Quellcode durchsuchen

Merge branch 'dev' of chaoren1/wlyy2.0 into medicare

wangzhinan vor 3 Jahren
Ursprung
Commit
e4f8011591

+ 20 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/MediicinecabinetInventory.java

@ -24,7 +24,7 @@ public class MediicinecabinetInventory extends UuidIdentityEntityWithOperator im
    private String sku;
    private String sku;
    /**
    /**
     * state
     * state,用于区分是单列货道,还是合并货道,1,单列,21合并主,20合并副货道
     */
     */
    private String state;
    private String state;
@ -110,10 +110,20 @@ public class MediicinecabinetInventory extends UuidIdentityEntityWithOperator im
    private String merge;
    private String merge;
    /**
    /**
     * 货道状态,1开启,0关闭,只针对出货的问题,初始化,默认开启,1、解绑设备,2、设备初始化两位置涉及到
     * 货道状态,1开启,0关闭,只针对出货的问题,
     * 初始化,默认开启,1、解绑设备,2、设备初始化两位置涉及到,3更新设备货道故障状态也会更改这次内容
     */
     */
    private String cargoState;
    private String cargoState;
    /**
     * 2021-12-22,新增故障,
     * 货道故障状态,1故障,0正常,
     * 涉及位置:
     * 1、设备初始化,默认正常,(解绑设备就不更改了,故障就是故障)
     * 2、更新设备故障状态
     */
    private String faultState;
    public MediicinecabinetInventory() {
    public MediicinecabinetInventory() {
    }
    }
@ -276,4 +286,12 @@ public class MediicinecabinetInventory extends UuidIdentityEntityWithOperator im
    public void setCargoState(String cargoState) {
    public void setCargoState(String cargoState) {
        this.cargoState = cargoState;
        this.cargoState = cargoState;
    }
    }
    public String getFaultState() {
        return faultState;
    }
    public void setFaultState(String faultState) {
        this.faultState = faultState;
    }
}
}

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -226,6 +226,8 @@ public class BaseRequestMapping {
        public static final String selectMediicinecabineInventoryById="/selectMediicinecabineInventoryById";
        public static final String selectMediicinecabineInventoryById="/selectMediicinecabineInventoryById";
        public static final String updateMediicinecabineInventoryInfoById = "/updateMediicinecabineInventoryInfoById";
        public static final String updateMediicinecabineInventoryInfoById = "/updateMediicinecabineInventoryInfoById";
        public static final String uploadDeviceInfo = "/uploadDeviceInfo";
        public static final String uploadDeviceInfo = "/uploadDeviceInfo";
        public static final String updateShipmentLogPic = "/updateShipmentLogPic";
        public static final String updateDeviceCargoState = "/updateDeviceCargoState";
        public static final String getDeviceList = "/getDeviceList";
        public static final String getDeviceList = "/getDeviceList";
        public static final String getDeviceInfo = "/getDeviceInfo";
        public static final String getDeviceInfo = "/getDeviceInfo";

+ 38 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/open/nologin/ServiceNoLoginEndPoint.java

@ -287,4 +287,42 @@ public class ServiceNoLoginEndPoint extends EnvelopRestEndpoint {
        return "上传失败";
        return "上传失败";
    }
    }
    @PostMapping(value = BaseRequestMapping.BaseDevice.updateShipmentLogPic)
    @ApiOperation(value = "更新出货单信息-出货图片")
    public String updateShipmentLogPic(
            @ApiParam(name = "shipmentLogId", value = "出货单id", required = true)
            @RequestParam(value = "shipmentLogId", required = true) String shipmentLogId,
            @ApiParam(name = "picPath", value = "图片路径", required = true)
            @RequestParam(value = "picPath") String picPath) throws Exception {
        if (StringUtils.isEmpty(shipmentLogId) || StringUtils.isEmpty(picPath)){
            return "参数缺失";
        }
        if (!deviceService.updateShipmentLogPic(shipmentLogId, picPath)) {
            return "更新失败";
        }
        return "更新成功";
    }
    @PostMapping(value = BaseRequestMapping.BaseDevice.updateDeviceCargoState)
    @ApiOperation(value = "更新设备货道状态")
    public String updateDeviceCargoState(
            @ApiParam(name = "equNum", value = "设备编号", required = true)
            @RequestParam(value = "equNum", required = true) String equNum,
            @ApiParam(name = "layerNo", value = "层", required = true)
            @RequestParam(value = "layerNo") String layerNo,
            @ApiParam(name = "wayerNo", value = "列", required = true)
            @RequestParam(value = "wayerNo") String wayerNo,
            @ApiParam(name = "state", value = "目标货道状态", required = true)
            @RequestParam(value = "state") String state) throws Exception {
        if (StringUtils.isEmpty(equNum) || StringUtils.isEmpty(layerNo) || StringUtils.isEmpty(wayerNo) || StringUtils.isEmpty(state)){
            return "参数缺失";
        }
        if (!deviceService.updateDeviceCargoState(equNum, layerNo, wayerNo, state)) {
            return "更新失败";
        }
        return "更新成功";
    }
}
}

+ 60 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -85,6 +85,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
    @Autowired
    @Autowired
    private MediicineorderDao mediicineorderDao;
    private MediicineorderDao mediicineorderDao;
    @Autowired
    private MedicineShipmentLogDao medicineShipmentLogDao;
    /**
    /**
     * 设备出货服务,创建设备,创建库存内容
     * 设备出货服务,创建设备,创建库存内容
@ -150,8 +153,10 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                inventory.setCargoCapacity(mediicinedevice.getCargoCapacity());
                inventory.setCargoCapacity(mediicinedevice.getCargoCapacity());
                //默认下架
                //默认下架
                inventory.setShelfStatus("0");
                inventory.setShelfStatus("0");
                //默认货道关闭
                //默认货道关闭(0)---->后续更改为开启的(1)
                inventory.setCargoState("1");
                inventory.setCargoState("1");
                //设备初始化库存,默认货道是正常的
                inventory.setFaultState("0");
                inventoryDao.save(inventory);
                inventoryDao.save(inventory);
            }
            }
        }
        }
@ -3211,7 +3216,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    "t.price AS price,\n" +
                    "t.price AS price,\n" +
                    "t.pic AS pic,\n" +
                    "t.pic AS pic,\n" +
                    "t.equ_num AS equNum,\n" +
                    "t.equ_num AS equNum,\n" +
                    "t.`merge` AS `merge`" +
                    "t.`merge` AS `merge`,\n" +
                    "t.cargo_state AS cargoState,\n" +
                    "t.fault_state AS faultState\n" +
                    "FROM\n" +
                    "FROM\n" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "WHERE\n" +
                    "WHERE\n" +
@ -3319,7 +3326,8 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    "t.pic AS pic,\n" +
                    "t.pic AS pic,\n" +
                    "t.equ_num AS equNum,\n" +
                    "t.equ_num AS equNum,\n" +
                    "t.`merge` AS `merge`,\n" +
                    "t.`merge` AS `merge`,\n" +
                    "t.cargo_state AS cargoState\n" +
                    "t.cargo_state AS cargoState,\n" +
                    "t.fault_state AS faultState\n" +
                    "FROM\n" +
                    "FROM\n" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "WHERE\n" +
                    "WHERE\n" +
@ -3481,7 +3489,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        boolean cargoCapacityChanged = false;
        boolean cargoCapacityChanged = false;
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(qty)){
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(qty)){
            if (Integer.parseInt(qty) > 99) {
            if (Integer.parseInt(qty) > 99) {
                throw new RuntimeException("库存数量最多99个,请重新设置");
                throw new Exception("库存数量最多99个,请重新设置");
            }
            }
            //有药品时的补货
            //有药品时的补货
            MedicineDrugInventoryRecord inventoryRecord = new MedicineDrugInventoryRecord();
            MedicineDrugInventoryRecord inventoryRecord = new MedicineDrugInventoryRecord();
@ -3854,4 +3862,52 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        object.put("drugTotal",quantity);
        object.put("drugTotal",quantity);
        return object;
        return object;
    }
    }
    /**
     * 更新出货单图片-出货图片
     * @param shipmentLogId
     * @param picPath
     * @return
     */
    public Boolean updateShipmentLogPic(String shipmentLogId, String picPath) {
        MedicineShipmentLog shipmentLog = medicineShipmentLogDao.findOne(shipmentLogId);
        if (shipmentLog == null) {
            return false;
        }
        shipmentLog.setPic(picPath);
        medicineShipmentLogDao.save(shipmentLog);
        return true;
    }
    /**
     * 更新设备货道状态
     * @param equNum
     * @param layerNo
     * @param wayerNo
     * @param state
     * @return
     */
    public Boolean updateDeviceCargoState(String equNum, String layerNo, String wayerNo, String state) {
        MediicinecabinetInventory inventory = inventoryDao.findMediicinecabinetInventoryByEquNumAndLayerNoAndWayerNo(equNum, layerNo, wayerNo);
        if (inventory == null) {
            return false;
        }
        //故障
        if ("1".equals(state)) {
            if ("1".equals(inventory.getCargoState())) {
                //开启--->关闭
                inventory.setCargoState("0");
            }
            inventory.setFaultState("1");
        }
        //正常
        if ("0".equals(state)) {
            inventory.setFaultState("0");
        }
        inventoryDao.save(inventory);
        return true;
    }
}
}