| | |
| | | @Java110Cmd(serviceCode = "fee.saveTempCarFeeConfig") |
| | | public class SaveTempCarFeeConfigCmd extends Cmd { |
| | | |
| | | |
| | | @Autowired |
| | | private IParkingAreaInnerServiceSMO parkingAreaInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IPayFeeConfigV1InnerServiceSMO payFeeConfigV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ITempCarFeeConfigV1InnerServiceSMO tempCarFeeConfigV1InnerServiceSMOImpl; |
| | | |
| | |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime"); |
| | | |
| | | //查询停车场编号 |
| | | ParkingAreaDto parkingAreaDto = new ParkingAreaDto(); |
| | | parkingAreaDto.setPaId(reqJson.getString("paId")); |
| | | parkingAreaDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<ParkingAreaDto> parkingAreaDtos = parkingAreaInnerServiceSMOImpl.queryParkingAreas(parkingAreaDto); |
| | | |
| | | Assert.listOnlyOne(parkingAreaDtos, "停车场不存在"); |
| | | reqJson.put("areaNum", parkingAreaDtos.get(0).getNum()); |
| | | } |
| | |
| | | reqJson.put("feeConfigId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId)); |
| | | reqJson.put("configId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId)); |
| | | TempCarFeeConfigPo tempCarFeeConfigPo = BeanConvertUtil.covertBean(reqJson, TempCarFeeConfigPo.class); |
| | | |
| | | //处理房屋属性 |
| | | dealAttr(reqJson, context); |
| | | |
| | | int flag = tempCarFeeConfigV1InnerServiceSMOImpl.saveTempCarFeeConfig(tempCarFeeConfigPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存临时收费失败"); |
| | | } |
| | | |
| | | |
| | | //补费用项数据 |
| | | PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo(); |
| | | payFeeConfigPo.setAdditionalAmount("0"); |
| | | payFeeConfigPo.setBillType(FeeConfigDto.BILL_TYPE_YEAR); |
| | | payFeeConfigPo.setCommunityId(reqJson.getString("communityId")); |
| | | payFeeConfigPo.setComputingFormula(FeeConfigDto.COMPUTING_FORMULA_TEMP_CAR); |
| | | payFeeConfigPo.setComputingFormula(FeeConfigDto.COMPUTING_FORMULA_DYNAMIC); |
| | | payFeeConfigPo.setComputingFormulaText(""); |
| | | payFeeConfigPo.setConfigId(reqJson.getString("feeConfigId")); |
| | | payFeeConfigPo.setEndTime(reqJson.getString("endTime")); |
| | |
| | | if (flag < 1) { |
| | | throw new CmdException("保存临时收费失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void dealAttr(JSONObject reqJson, ICmdDataFlowContext context) { |
| | | |
| | | if (!reqJson.containsKey("attrs")) { |
| | | return; |
| | | } |
| | | |
| | | JSONArray attrs = reqJson.getJSONArray("attrs"); |
| | | if (attrs == null || attrs.size() < 1) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | JSONObject attr = null; |
| | | int flag = 0; |
| | | for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) { |
| | |
| | | throw new CmdException("保存临时收费失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |