Parcourir la source

Merge branch 'medicare' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

chenjiasheng il y a 3 ans
Parent
commit
870302711a

+ 68 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/Mediicinedevice.java

@ -170,10 +170,78 @@ public class Mediicinedevice extends UuidIdentityEntityWithOperator implements S
     */
    private String wayer;
    /**
     * 目标湿度
     */
    private String humidity;
    /**
     * 目标温度
     */
    private String temperature;
    /**
     * 湿度控制
     */
    private String humiditycontrol;
    /**
     * 温度控制
     */
    private String temperaturecontrol;
    /**
     * 是否加热
     */
    private String heat;
    /**
     * 预警温度
     */
    private String warningTemperature;
    /**
     * 预警湿度
     */
    private String waringHumidity;
    public String getHumiditycontrol() {
        return humiditycontrol;
    }
    public void setHumiditycontrol(String humiditycontrol) {
        this.humiditycontrol = humiditycontrol;
    }
    public String getTemperaturecontrol() {
        return temperaturecontrol;
    }
    public void setTemperaturecontrol(String temperaturecontrol) {
        this.temperaturecontrol = temperaturecontrol;
    }
    public String getHeat() {
        return heat;
    }
    public void setHeat(String heat) {
        this.heat = heat;
    }
    public String getWarningTemperature() {
        return warningTemperature;
    }
    public void setWarningTemperature(String warningTemperature) {
        this.warningTemperature = warningTemperature;
    }
    public String getWaringHumidity() {
        return waringHumidity;
    }
    public void setWaringHumidity(String waringHumidity) {
        this.waringHumidity = waringHumidity;
    }
    public Mediicinedevice() {
    }

+ 14 - 14
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineDrugsService.java

@ -311,20 +311,20 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
            int ii=1;
            for (Map<String, Object> tmp : ls) {
                addCell(sheet, j, 0, ii + "img");
                addCell(sheet, j, 1, tmp.get("drugNameAlies") +"/" + tmp.get("drugBarCode"));
                addCell(sheet, j, 2, tmp.get("drugTypeCode") + "");
                addCell(sheet, j, 3, tmp.get("dosForm") + "");
                addCell(sheet, j, 4, tmp.get("drugTypeCode")+"");
                addCell(sheet, j, 5, tmp.get("unit") + "");
                addCell(sheet, j, 6, tmp.get("price") + "");
                addCell(sheet, j, 7, tmp.get("inventory") + "");
                addCell(sheet, j, 8, tmp.get("saleVolume") + "");
                addCell(sheet, j, 9, tmp.get("selfCode") + "");
                addCell(sheet, j, 10, tmp.get("specif") + "");
                addCell(sheet, j, 11, tmp.get("manufactor") + "");
                addCell(sheet, j, 12, tmp.get("approvalNum") + "");
                addCell(sheet, j, 13, tmp.get("brand") + "");
                addCell(sheet, j, 14, tmp.get("state") + "");
                addCell(sheet, j, 1, tmp.get("drugNameAlies")==null ? "" : tmp.get("drugNameAlies") +"/" + tmp.get("drugBarCode")==null ? "" : tmp.get("drugBarCode") +"");
                addCell(sheet, j, 2, tmp.get("drugTypeCode") == null? "" : tmp.get("drugTypeCode") + "");
                addCell(sheet, j, 3, tmp.get("dosForm") == null ? "" : tmp.get("dosForm") + "");
                addCell(sheet, j, 4, tmp.get("drugTypeCode") == null ? "" :tmp.get("drugTypeCode") +"");
                addCell(sheet, j, 5, tmp.get("unit") == null ? "" : tmp.get("unit") + "");
                addCell(sheet, j, 6, tmp.get("price") == null ? "" :tmp.get("price")  + "");
                addCell(sheet, j, 7, tmp.get("inventory") == null ? "" : tmp.get("inventory") + "");
                addCell(sheet, j, 8, tmp.get("saleVolume") == null ? "" : tmp.get("saleVolume") + "");
                addCell(sheet, j, 9, tmp.get("selfCode") == null ? "" :tmp.get("selfCode")  + "");
                addCell(sheet, j, 10, tmp.get("specif") == null ? "" : tmp.get("specif") + "");
                addCell(sheet, j, 11, tmp.get("manufactor") == null ? "" : tmp.get("manufactor") + "");
                addCell(sheet, j, 12, tmp.get("approvalNum") == null ? "" : tmp.get("approvalNum") + "");
                addCell(sheet, j, 13, tmp.get("brand") == null ? "" : tmp.get("brand")  + "");
                addCell(sheet, j, 14, tmp.get("state") == null ? "" : tmp.get("state") + "");
                j++;
                ii++;
            }

+ 16 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -11,6 +11,8 @@ import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.a1entity.*;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.DmHospitalDO;
import com.yihu.jw.hospital.HospitalDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
@ -44,6 +46,9 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
    @Autowired
    private MediicinecabinetInventoryDao inventoryDao;
    @Autowired
    HospitalDao hospitalDao;
    @Autowired
    private MediicineDeviceDao deviceDao;
@ -913,6 +918,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
                            "    t.id,\n" +
                            "    t.layer_no AS layerNo,\n" +
                            "    t.wayer_no AS wayerNo,\n" +
                            "    t.merge AS merge,\n" +
                            "    t.qty\n" +
                            "FROM\n" +
                            "\tt_mediicinecabinet_inventory t\n" +
@ -920,6 +926,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
                            "\tt.drug_code = '"+ mediicineorderdetail.getDrugCode() +"'\n" +
                            "AND t.org_code = '" + mediicineorderdetail.getOrgCode() +"'\n" +
                            "AND CONCAT(t.id_device, t.equ_num) like '%"+ deviceId + "%'\n" +
                            "AND ( t.state = '1' or t.state = '21')\n" +
                            "and t.qty > 0"
            );
            for (int i = 0; i < qty; i++) {
@ -932,7 +939,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
                        shipmentLog.setDrugId(mediicinedrugs.getId());
                        shipmentLog.setStatus("1");
                        shipmentLog.setLayerNo(objectMap.get("layerNo").toString());
                        shipmentLog.setWayerNo(objectMap.get("wayerNo").toString());
                        shipmentLog.setWayerNo(objectMap.get("merge").toString());
                        shipmentLog.setDrugBarCode(mediicinedrugs.getDrugBarCode());
                        shipmentLog.setDrugCode(mediicinedrugs.getDrugCode());
                        shipmentLog.setDrugName(mediicinedrugs.getDrugName());
@ -950,7 +957,14 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
                }
            }
        }
        DmHospitalDO dmHospitalDO = hospitalDao.findOne(Integer.parseInt(mediicineorder.getBelongCommunity()));
        jsonObject.put("community", dmHospitalDO == null ? "" : dmHospitalDO.getName());
        jsonObject.put("phone", "123456");
        jsonObject.put("num", mediicineorder.getPrescribeNum());
        jsonObject.put("date", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
        jsonObject.put("time", DateUtil.dateToStr(new Date(), "HH:mm:ss"));
        jsonObject.put("remark", "若未取到货物,请您扫描小票二维码申请退款。\n谢谢慢走,祝您生活愉快!");
        jsonObject.put("qrCodeContent", "谢谢慢走,祝您生活愉快!");
        jsonObject.put("list", shipmentLogs);
        jsonObject.put("status", 1);
        result.put("response", ConstantUtils.SUCCESS);

+ 27 - 49
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -124,12 +124,13 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                //到底要存什么,deviceId device表中equNum
                inventory.setIdDevice(mediicinedevice.getId());
                inventory.setEquNum(deviceId);
                inventory.setState("0");
                //1标识单列货道,21表示合并货道主货道,20表示合并货道的次货道
                inventory.setState("1");
                inventory.setMerge(String.valueOf(i1+1));
                inventory.setCargoCapacity(mediicinedevice.getCargoCapacity());
                inventory.setShelfStatus("0");
                inventoryDao.save(inventory);
            }
        }
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",mediicinedevice);
@ -559,7 +560,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
    //mergeAndSplitCargo
    /**
     * 合并和分离过道
     * 合并和分离货道
     * @param cargoIds
     * @param isMerge
     * @return
@ -571,54 +572,30 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            result.put("response", ConstantUtils.FAIL);
            return result.toJSONString();
        }
        for (String deviceId : cargoIds.split(",")) {
            if(!StringUtils.isEmpty(deviceId)){
                Mediicinedevice mediicinedevice = deviceDao.findOne(deviceId);
                //删除补货员
                {
                    List<Map<String, Object>> list = null;
                    list = hibenateUtils.createSQLQuery("SELECT * FROM t_mediicine_device_user where del = 1 AND device_id = '" + deviceId + "'");
                    if (list != null && list.size() > 0) {
                        for (Map<String, Object> stringObjectMap : list) {
                            if (!StringUtils.isEmpty(stringObjectMap.get("id").toString())) {
                                MediicineDeviceUser mediicineDeviceUser = deviceUserDao.findOne(stringObjectMap.get("id").toString());
                                if (mediicineDeviceUser != null) {
                                    mediicineDeviceUser.setDel("0");
                                    deviceUserDao.save(mediicineDeviceUser);
                                }
                            }
                        }
        if (isMerge) {
            Boolean isFirst = true;
            for (String deviceId : cargoIds.split(",")) {
                if(!StringUtils.isEmpty(deviceId)){
                    if (isFirst) {
                        MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
                        inventory.setMerge(cargoIds);
                        inventory.setState("21");
                        inventoryDao.save(inventory);
                        isFirst = false;
                    } else {
                        MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
                        inventory.setMerge(cargoIds);
                        inventory.setState("20");
                        inventoryDao.save(inventory);
                    }
                }
                //删除社区,社区中心名称
                mediicinedevice.setBelongCommunity(null);
                mediicinedevice.setCommunity(null);
                mediicinedevice.setStatus("0");
                mediicinedevice.setSaleStatus("2");
                mediicinedevice.setAisles(String.valueOf(Integer.parseInt(mediicinedevice.getLayer()) *
                        Integer.parseInt(mediicinedevice.getWayer())));
                mediicinedevice.setCargoCapacity("5");
                mediicinedevice.setCapacity(String.valueOf(Integer.parseInt(mediicinedevice.getAisles()) *
                        Integer.parseInt(mediicinedevice.getCargoCapacity())));
                mediicinedevice.setDeliveryAddress(null);
                mediicinedevice.setDetailAddress(null);
                mediicinedevice.setEquArea(null);
                this.save(mediicinedevice);
                //更新库存
                List<MediicinecabinetInventory> list = inventoryDao.findMediicinecabinetInventoryByDeviceId(deviceId);
                for (MediicinecabinetInventory inventory : list) {
                    inventory.setPic(null);
                    inventory.setShelfStatus("0");
                    inventory.setQty("0");
                    inventory.setDrugCode(null);
                    inventory.setDrugId(null);
                    inventory.setDrugName(null);
                    inventory.setPrice(null);
                    inventory.setSku(null);
                    inventory.setDrugSku(null);
                    inventory.setNum("0");
                    inventory.setLongtime(null);
                    inventory.setOrgCode(null);
            }
        } else {
            for (String deviceId : cargoIds.split(",")) {
                if(!StringUtils.isEmpty(deviceId)){
                    MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
                    inventory.setMerge(inventory.getWayerNo());
                    inventory.setState("1");
                    inventoryDao.save(inventory);
                }
            }
@ -628,6 +605,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
    }
    /**
     * 分页查询设备信息getDeviceListByPage
     * @param content