old mode 100644
new mode 100755
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.fee.*; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.fee.bmo.IPayOweFee; |
| | | import com.java110.fee.listener.fee.UpdateFeeInfoListener; |
| | | import com.java110.intf.IFeeReceiptDetailInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeReceiptDetailInnerServiceSMO; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | 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.po.owner.RepairPoolPo; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.lock.DistributedLock; |
| | |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 欠费缴费实现类 |
| | |
| | | @Service |
| | | public class PayOweFeeImpl implements IPayOweFee { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateFeeInfoListener.class); |
| | | private static Logger logger = LoggerFactory.getLogger(PayOweFeeImpl.class); |
| | | |
| | | |
| | | @Autowired |
| | |
| | | FeeReceiptPo feeReceiptPo = new FeeReceiptPo(); |
| | | feeReceiptPo.setReceiptId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_receiptId)); |
| | | feeReceiptPo.setAmount("0.0"); |
| | | |
| | | feeReceiptPo.setPayObjId("-1"); |
| | | feeReceiptPo.setPayObjName("未知"); |
| | | |
| | | for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) { |
| | | feeObj = fees.getJSONObject(feeIndex); |
| | | Assert.hasKeyAndValue(feeObj, "feeId", "未包含费用项ID"); |
| | |
| | | if (fees.size() > 0) { |
| | | feeReceiptInnerServiceSMOImpl.saveFeeReceipt(feeReceiptPo); |
| | | } |
| | | return ResultVo.success(); |
| | | return ResultVo.createResponseEntity(feeReceiptPo); |
| | | } |
| | | |
| | | private void doPayOweFee(JSONObject feeObj, FeeReceiptPo feeReceiptPo) { |
| | |
| | | feeDto = feeDtos.get(0); |
| | | paramInJson.put("feeInfo", feeDto); |
| | | payFeeDetailPo.setStartTime(DateUtil.getFormatTimeString(feeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); |
| | | Map feePriceAll=computeFeeSMOImpl.getFeePrice(feeDto); |
| | | BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); |
| | | |
| | | BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(paramInJson.getString("feePrice"))); |
| | | BigDecimal cycles = receivedAmount.divide(feePrice, 2, BigDecimal.ROUND_HALF_EVEN); |
| | | paramInJson.put("tmpCycles", cycles); |
| | | payFeeDetailPo.setEndTime(computeFeeSMOImpl.getFeeStateByCycles(feeDto, cycles.doubleValue() + "")); |
| | | payFeeDetailPo.setEndTime(DateUtil.getFormatTimeString(computeFeeSMOImpl.getFeeEndTimeByCycles(feeDto, cycles.doubleValue() + ""), DateUtil.DATE_FORMATE_STRING_A)); |
| | | payFeeDetailPo.setCommunityId(paramInJson.getString("communityId")); |
| | | payFeeDetailPo.setCycles(cycles.doubleValue() + ""); |
| | | payFeeDetailPo.setReceivableAmount(receivedAmount.doubleValue() + ""); |
| | |
| | | feeReceiptDetailPo.setFeeName(StringUtil.isEmpty(feeDto.getImportFeeName()) ? feeDto.getFeeName() : feeDto.getImportFeeName()); |
| | | feeReceiptDetailPo.setStartTime(payFeeDetailPo.getStartTime()); |
| | | feeReceiptDetailPo.setReceiptId(feeReceiptPo.getReceiptId()); |
| | | computeFeeSMOImpl.freshFeeReceiptDetail(feeDto, feeReceiptDetailPo); |
| | | feeReceiptDetailInnerServiceSMOImpl.saveFeeReceiptDetail(feeReceiptDetailPo); |
| | | |
| | | BigDecimal amount = new BigDecimal(Double.parseDouble(feeReceiptPo.getAmount())); |
| | |
| | | if (StringUtil.isEmpty(feeReceiptPo.getObjName())) { |
| | | feeReceiptPo.setObjName(computeFeeSMOImpl.getFeeObjName(feeDto)); |
| | | } |
| | | OwnerDto ownerDto = computeFeeSMOImpl.getFeeOwnerDto(feeDto); |
| | | feeReceiptPo.setPayObjId(ownerDto.getOwnerId()); |
| | | feeReceiptPo.setPayObjName(ownerDto.getName()); |
| | | } |
| | | } |