LAPTOP-KB9HII50\70708 2 months ago
parent
commit
ebb74f1f89

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

@ -262,7 +262,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
    //设备货道信息列表
    public PageEnvelop deviceCabinetInventoryPage(Integer page,Integer size,String name,String orgCode,String networkStatus){
        String sql = " SELECT a.*,CONCAT(FORMAT(((a.normalCargoNumber-a.usedCargoNumber) / a.normalCargoNumber) * 100, 2),'%') kongzhilv " +
        String sql = " SELECT a.*,if(a.normalCargoNumber=0,0,CONCAT(FORMAT(((a.normalCargoNumber-a.usedCargoNumber) / a.normalCargoNumber) * 100, 2),'%')) kongzhilv " +
                ",(a.normalCargoNumber  - a.alreadySetDrugNumber) noSetDrugCargoNumber " +
                ",(a.normalOpenCargoCapacity - a.usedCargoCapacity) noUsedCargoCapacity  " ;
        String countSql = "select count(a.id)";
@ -2846,8 +2846,13 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                                    !StringUtils.isEmpty(item.get("orgCode")) &&
                                    !StringUtils.isEmpty(item.get("drugCode")) &&
                            Integer.parseInt(String.valueOf(item.get("qty"))) > 0).count());
            stringObjectMap.put("kongzhilv",
                    new BigDecimal(((normalCargoNumber-usedCargoNumber) * 1.0) / normalCargoNumber).setScale(2, BigDecimal.ROUND_HALF_UP));
            if(normalCargoNumber==0){
                stringObjectMap.put("kongzhilv",0);
            }else {
                stringObjectMap.put("kongzhilv",
                        new BigDecimal(((normalCargoNumber-usedCargoNumber) * 1.0) / normalCargoNumber).setScale(2, BigDecimal.ROUND_HALF_UP));
            }
            //上一次补货时间
            tempSql = "SELECT\n" +
                    "\t(\n" +
@ -3207,9 +3212,12 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                            !StringUtils.isEmpty(item.get("orgCode")) &&
                            !StringUtils.isEmpty(item.get("drugCode")) &&
                            Integer.parseInt(String.valueOf(item.get("qty"))) > 0).count());
            stringObjectMap.put("kongzhilv",
                    new BigDecimal(((normalCargoNumber-usedCargoNumber) * 1.0) / normalCargoNumber).setScale(2, BigDecimal.ROUND_HALF_UP));
            if(normalCargoNumber==0){
                stringObjectMap.put("kongzhilv",0);
            }else {
                stringObjectMap.put("kongzhilv",
                        new BigDecimal(((normalCargoNumber-usedCargoNumber) * 1.0) / normalCargoNumber).setScale(2, BigDecimal.ROUND_HALF_UP));
            }
            //商品庫存
//            Integer inventoryNum = inventoryDao.sumInventoryWithEquNum(stringObjectMap.get("equNum")+"", "1", "21");