wangzhinan 3 years ago
parent
commit
a78af80b6b

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

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

@ -153,8 +153,10 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                inventory.setCargoCapacity(mediicinedevice.getCargoCapacity());
                //默认下架
                inventory.setShelfStatus("0");
                //默认货道关闭
                //默认货道关闭(0)---->后续更改为开启的(1)
                inventory.setCargoState("1");
                //设备初始化库存,默认货道是正常的
                inventory.setFaultState("0");
                inventoryDao.save(inventory);
            }
        }
@ -3214,7 +3216,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    "t.price AS price,\n" +
                    "t.pic AS pic,\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" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "WHERE\n" +
@ -3322,7 +3326,8 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    "t.pic AS pic,\n" +
                    "t.equ_num AS equNum,\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" +
                    "\tt_mediicinecabinet_inventory t\n" +
                    "WHERE\n" +
@ -3888,7 +3893,18 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        if (inventory == null) {
            return false;
        }
        inventory.setCargoState(state);
        //故障
        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;
    }