| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.dto.fee.FeeConfigDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.machine.CarInoutDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.fee.bmo.ApiBaseBMO; |
| | | import com.java110.fee.bmo.fee.IFeeBMO; |
| | | import com.java110.intf.common.ICarInoutInnerServiceSMO; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.fee.IPayFeeDetailV1InnerServiceSMO; |
| | | import com.java110.intf.fee.IPayFeeV1InnerServiceSMO; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.po.car.CarInoutPo; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeeConfigPo; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.feeReceipt.FeeReceiptPo; |
| | | import com.java110.po.feeReceiptDetail.FeeReceiptDetailPo; |
| | | import com.java110.po.fee.FeeReceiptPo; |
| | | import com.java110.po.fee.FeeReceiptDetailPo; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.constant.*; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | |
| | | @Autowired |
| | | private IPayFeeV1InnerServiceSMO payFeeV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFeeReceiptInnerServiceSMO feeReceiptInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeInfo.getFeeFlag())) { |
| | | maxEndTime = feeInfo.getDeadlineTime(); |
| | | } |
| | | if(maxEndTime != null) { //这里数据问题的情况下 |
| | | if (maxEndTime != null) { //这里数据问题的情况下 |
| | | Date endTime = DateUtil.getDateFromStringA(paramInJson.getString("endTime")); |
| | | if (endTime.getTime() >= maxEndTime.getTime()) { |
| | | feeMap.put("state", FeeDto.STATE_FINISH); |
| | |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addFeePreDetail(JSONObject paramInJson) { |
| | | |
| | | //todo 生成收据编号 |
| | | String receiptCode = feeReceiptInnerServiceSMOImpl.generatorReceiptCode(paramInJson.getString("communityId")); |
| | | |
| | | JSONObject businessFeeDetail = new JSONObject(); |
| | | businessFeeDetail.putAll(paramInJson); |
| | |
| | | |
| | | PayFeeDetailPo payFeeDetail = BeanConvertUtil.covertBean(businessFeeDetail, PayFeeDetailPo.class); |
| | | payFeeDetail.setbId("-1"); |
| | | if (StringUtil.isEmpty(payFeeDetail.getPayableAmount())) { |
| | | payFeeDetail.setPayableAmount("0.0"); |
| | | } |
| | | payFeeDetail.setPayOrderId(paramInJson.getString("oId")); |
| | | //todo 缓存收据编号 |
| | | CommonCache.setValue(payFeeDetail.getDetailId()+CommonCache.RECEIPT_CODE,receiptCode,CommonCache.DEFAULT_EXPIRETIME_TWO_MIN); |
| | | // todo 刷入收银人员信息 |
| | | freshCashierInfo(payFeeDetail, paramInJson); |
| | | |
| | | int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetail); |
| | | if (flag < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存费用明细失败"); |
| | | } |
| | | |
| | | return businessFeeDetail; |
| | | } |
| | | |
| | | /** |
| | | * 刷入收银人员 |
| | | * |
| | | * @param payFeeDetail |
| | | * @param paramInJson |
| | | */ |
| | | private void freshCashierInfo(PayFeeDetailPo payFeeDetail, JSONObject paramInJson) { |
| | | String userId = paramInJson.getString("userId"); |
| | | if (StringUtil.isEmpty(userId)) { |
| | | payFeeDetail.setCashierId("-1"); |
| | | payFeeDetail.setCashierName("系统收银"); |
| | | return; |
| | | } |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | if (userDtos != null && userDtos.size() > 0) { |
| | | payFeeDetail.setCashierId(userDtos.get(0).getUserId()); |
| | | payFeeDetail.setCashierName(userDtos.get(0).getName()); |
| | | return; |
| | | } |
| | | |
| | | payFeeDetail.setCashierId("-1"); |
| | | payFeeDetail.setCashierName("系统收银"); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | businessUnit.put("feeTypeCd", paramInJson.getString("feeTypeCd")); |
| | | businessUnit.put("incomeObjId", paramInJson.getString("storeId")); |
| | | businessUnit.put("amount", "-1.00"); |
| | | if (paramInJson.containsKey("amount") && !StringUtil.isEmpty(paramInJson.getString("amount"))) { |
| | | businessUnit.put("amount", paramInJson.getString("amount")); |
| | | } |
| | | businessUnit.put("startTime", time); |
| | | businessUnit.put("endTime", time); |
| | | businessUnit.put("communityId", paramInJson.getString("communityId")); |
| | |
| | | feeAttrPo.setSpecCd(specCd); |
| | | feeAttrPo.setValue(value); |
| | | feeAttrPo.setFeeId(paramInJson.getString("feeId")); |
| | | feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId,true)); |
| | | return feeAttrPo; |
| | | |
| | | } |