| | |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigDto; |
| | | import com.java110.intf.common.ICarInoutDetailV1InnerServiceSMO; |
| | | import com.java110.intf.common.ICarInoutPaymentV1InnerServiceSMO; |
| | | import com.java110.intf.common.ICarInoutV1InnerServiceSMO; |
| | | import com.java110.intf.common.IMachineInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | |
| | | import com.java110.po.car.CarInoutDetailPo; |
| | | import com.java110.po.car.CarInoutPo; |
| | | import com.java110.po.car.OwnerCarPo; |
| | | import com.java110.po.carInoutPayment.CarInoutPaymentPo; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.owner.OwnerPo; |
| | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICarInoutPaymentV1InnerServiceSMO carInoutPaymentV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "machineCode", "必填,请填写设备编码"); |
| | |
| | | tempCar = CAR_TYPE_NO_DATA; |
| | | } else { |
| | | reqJson.put("carId", ownerCarDtos.get(0).getCarId()); |
| | | if (OwnerCarDto.CAR_TYPE_TEMP.equals(ownerCarDtos.get(0).getCarTypeCd())) { |
| | | tempCar = CAR_TYPE_TEMP; |
| | | } |
| | | } |
| | | |
| | | if (OwnerCarDto.CAR_TYPE_TEMP.equals(ownerCarDtos.get(0).getCarType())) { |
| | | tempCar = CAR_TYPE_TEMP; |
| | | } |
| | | |
| | | |
| | | //进场处理 |
| | | if (MachineDto.DIRECTION_IN.equals(machineDtos.get(0).getDirection())) { |
| | |
| | | |
| | | //将状态更新为 出场状态 |
| | | |
| | | CarInoutPo carInoutPo = new CarInoutPo(); |
| | | carInoutPo.setPaId(carInoutDtos.get(0).getPaId()); |
| | | carInoutPo.setOutTime(reqJson.getString("outTime")); |
| | | carInoutPo.setInoutId(carInoutDtos.get(0).getInoutId()); |
| | | carInoutPo.setCommunityId(carInoutDtos.get(0).getCommunityId()); |
| | | carInoutPo.setState(CarInoutDto.STATE_OUT); |
| | | flag = carInoutV1InnerServiceSMOImpl.updateCarInout(carInoutPo); |
| | | |
| | | if (flag < 1) { |
| | | throw new CmdException("更新出场时间失败"); |
| | | } |
| | | |
| | | //写支付记录 |
| | | CarInoutPaymentPo carInoutPaymentPo = new CarInoutPaymentPo(); |
| | | carInoutPaymentPo.setPaymentId(GenerateCodeFactory.getGeneratorId("10")); |
| | | carInoutPaymentPo.setCommunityId(carInoutDtos.get(0).getCommunityId()); |
| | | carInoutPaymentPo.setInoutId(carInoutDtos.get(0).getInoutId()); |
| | | carInoutPaymentPo.setPaId(carInoutDtos.get(0).getPaId()); |
| | | carInoutPaymentPo.setPayCharge(reqJson.getString("payCharge")); |
| | | carInoutPaymentPo.setPayType(reqJson.getString("payType")); |
| | | carInoutPaymentPo.setRealCharge(reqJson.getString("realCharge")); |
| | | flag = carInoutPaymentV1InnerServiceSMOImpl.saveCarInoutPayment(carInoutPaymentPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("更新出场时间失败"); |
| | | } |
| | | |
| | | //月租车 |
| | | if (tempCar != CAR_TYPE_NO_DATA && tempCar != CAR_TYPE_TEMP) { |
| | | return; |
| | | } |
| | | |
| | | //临时车时查看 是否有费用没有结束,可能是半小时免费 问题 或者时 其他原因 将费用结束 |
| | | FeeAttrDto feeAttrDto = new FeeAttrDto(); |
| | | feeAttrDto.setSpecCd(FeeAttrDto.SPEC_CD_CAR_INOUT_ID); |
| | | feeAttrDto.setValue(carInoutPo.getInoutId()); |
| | | feeAttrDto.setCommunityId(carInoutDtos.get(0).getCommunityId()); |
| | | List<FeeAttrDto> feeAttrDtos = feeAttrInnerServiceSMOImpl.queryFeeAttrs(feeAttrDto); |
| | | |
| | | if (feeAttrDtos == null || feeAttrDtos.size() < 1) { |
| | | return; |
| | | } |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setCommunityId(carInoutDtos.get(0).getCommunityId()); |
| | | feeDto.setFeeId(feeAttrDtos.get(0).getFeeId()); |
| | | feeDto.setState(FeeDto.STATE_DOING); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | if (feeDtos == null || feeDtos.size() < 1) { |
| | | return; |
| | | } |
| | | PayFeePo payFeePo = new PayFeePo(); |
| | | payFeePo.setState(FeeDto.STATE_FINISH); |
| | | payFeePo.setFeeId(feeDtos.get(0).getFeeId()); |
| | | payFeePo.setCommunityId(feeDtos.get(0).getCommunityId()); |
| | | flag = feeInnerServiceSMOImpl.updateFee(payFeePo); |
| | | if (flag < 1) { |
| | | throw new CmdException("更新出场时间失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (flag < 1) { |
| | | throw new CmdException("保存入记录失败"); |
| | | } |
| | | reqJson.put("inoutId", carInoutPo.getInoutId()); |
| | | |
| | | //保存明细 |
| | | CarInoutDetailPo carInoutDetailPo = new CarInoutDetailPo(); |
| | |
| | | feeAttrPo.setValue("11111111111"); |
| | | feeAttrPo.setFeeId(payFeePo.getFeeId()); |
| | | feeAttrPos.add(feeAttrPo); |
| | | feeAttrPo = new FeeAttrPo(); |
| | | feeAttrPo.setCommunityId(reqJson.getString("communityId")); |
| | | feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_CAR_INOUT_ID); |
| | | feeAttrPo.setValue(reqJson.getString("inoutId")); |
| | | feeAttrPo.setFeeId(payFeePo.getFeeId()); |
| | | feeAttrPos.add(feeAttrPo); |
| | | int flag = feeInnerServiceSMOImpl.saveFee(payFeePos); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存临时车费用失败"); |
| | |
| | | ownerCarPo.setPsId("-1"); |
| | | ownerCarPo.setMemberId(ownerCarPo.getCarId()); |
| | | ownerCarPo.setCarTypeCd(OwnerCarDto.CAR_TYPE_CD_TEMP); |
| | | ownerCarPo.setCarType("9901"); |
| | | ownerCarPo.setCarBrand("未知"); |
| | | ownerCarPo.setCarColor("未知"); |
| | | ownerCarPo.setCarNum(reqJson.getString("carNum")); |