| | |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(reqJson, "resName", "必填,请填写物品名称"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户信息"); |
| | | Assert.hasKeyAndValue(reqJson, "price", "必填,请填写物品价格"); |
| | | Assert.hasKeyAndValue(reqJson, "shId", "必填,请填写仓库"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区"); |
| | | // Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户信息"); |
| | | // Assert.hasKeyAndValue(reqJson, "price", "必填,请填写物品价格"); |
| | | // Assert.hasKeyAndValue(reqJson, "shId", "必填,请填写仓库"); |
| | | // Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区"); |
| | | //获取最低收费标准 |
| | | double outLowPrice = Double.parseDouble(reqJson.getString("outLowPrice")); |
| | | //获取最高收费标准 |
| | | double outHighPrice = Double.parseDouble(reqJson.getString("outHighPrice")); |
| | | if (outLowPrice > outHighPrice) { |
| | | throw new IllegalArgumentException("最低收费标准不能大于最高收费标准!"); |
| | | } |
| | | // double outLowPrice = Double.parseDouble(reqJson.getString("outLowPrice")); |
| | | // //获取最高收费标准 |
| | | // double outHighPrice = Double.parseDouble(reqJson.getString("outHighPrice")); |
| | | // if (outLowPrice > outHighPrice) { |
| | | // throw new IllegalArgumentException("最低收费标准不能大于最高收费标准!"); |
| | | // } |
| | | String resCode = reqJson.getString("resCode"); |
| | | String storeId = cmdDataFlowContext.getReqHeaders().get("store-id"); |
| | | //根据物品编码查询物品资源表 |
| | |
| | | resourceStoreDto.setStoreId(storeId); |
| | | List<ResourceStoreDto> resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto); |
| | | //判断资源表里是否有该物品编码,避免物品编码重复 |
| | | Assert.listIsNull(resourceStoreDtos, "物品编码重复,请重新添加!"); |
| | | // Assert.listIsNull(resourceStoreDtos, "物品编码重复,请重新添加!"); |
| | | } |
| | | |
| | | @Override |