瀏覽代碼

状态nullpointer,检查

wangzhinan 3 年之前
父節點
當前提交
5502dfde78

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

@ -264,20 +264,21 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
        Logger.getAnonymousLogger().info("finalCountSql="+countSql);
        int count = jdbcTemplate.queryForObject(countSql,Integer.class);
        for (Map<String,Object> stringObjectMap:list){
            if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
                if ("1".equals(stringObjectMap.get("state").toString())) {
                    stringObjectMap.put("stateName", "已上架");
            if (stringObjectMap.get("state") != null) {
                if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
                    if ("1".equals(stringObjectMap.get("state").toString())) {
                        stringObjectMap.put("stateName", "已上架");
                    }
                    if ("2".equals(stringObjectMap.get("state").toString())) {
                        stringObjectMap.put("stateName", "已下架");
                    }
                    if ("3".equals(stringObjectMap.get("state").toString())) {
                        stringObjectMap.put("stateName", "处方");
                    }
                    if ("4".equals(stringObjectMap.get("state").toString())) {
                        stringObjectMap.put("stateName", "非处方");
                    }
                }
                if ("2".equals(stringObjectMap.get("state").toString())) {
                    stringObjectMap.put("stateName", "已下架");
                }
                if ("3".equals(stringObjectMap.get("state").toString())) {
                    stringObjectMap.put("stateName", "处方");
                }
                if ("4".equals(stringObjectMap.get("state").toString())) {
                    stringObjectMap.put("stateName", "非处方");
                }
            }
        }
        result.put("count", count);

+ 28 - 26
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -1177,20 +1177,21 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            if (childList != null) {
                for (Map<String, Object> objectMap : childList) {
                    objectMap.put("upInventory", Integer.parseInt(stringObjectMap.get("cargoCapacity").toString()) - Integer.parseInt(objectMap.get("qty").toString()));
                    if (!StringUtils.isEmpty(objectMap.get("state").toString())) {
                        if ("1".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "已上架");
                        }
                        if ("2".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "已下架");
                        }
                        if ("3".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "处方");
                        }
                        if ("4".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "非处方");
                    if (stringObjectMap.get("state") != null) {
                        if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
                            if ("1".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "已上架");
                            }
                            if ("2".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "已下架");
                            }
                            if ("3".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "处方");
                            }
                            if ("4".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "非处方");
                            }
                        }
                    }
                }
                stringObjectMap.put("children", childList);
@ -1352,20 +1353,21 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            if (childList != null) {
                for (Map<String, Object> objectMap : childList) {
                    objectMap.put("upInventory", Integer.parseInt(stringObjectMap.get("cargoCapacity").toString()) - Integer.parseInt(objectMap.get("qty").toString()));
                    if (!StringUtils.isEmpty(objectMap.get("state").toString())) {
                        if ("1".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "已上架");
                        }
                        if ("2".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "已下架");
                        }
                        if ("3".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "处方");
                        }
                        if ("4".equals(objectMap.get("state").toString())) {
                            objectMap.put("stateName", "非处方");
                    if (stringObjectMap.get("state") != null) {
                        if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
                            if ("1".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "已上架");
                            }
                            if ("2".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "已下架");
                            }
                            if ("3".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "处方");
                            }
                            if ("4".equals(stringObjectMap.get("state").toString())) {
                                stringObjectMap.put("stateName", "非处方");
                            }
                        }
                    }
                }
                stringObjectMap.put("children", childList);