wuxw
2022-05-10 b2b5bdf6f42597e582da96aa56707e1f68d3936e
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeConfirmCmd.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.annotation.Java110Transactional;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.AbstractServiceCmdListener;
import com.java110.core.event.cmd.CmdEvent;
@@ -32,7 +33,6 @@
import com.java110.po.car.OwnerCarPo;
import com.java110.po.couponUser.CouponUserPo;
import com.java110.po.couponUserDetail.CouponUserDetailPo;
import com.java110.po.fee.PayFeePo;
import com.java110.po.owner.RepairPoolPo;
import com.java110.po.owner.RepairUserPo;
import com.java110.po.parkingSpaceApply.ParkingSpaceApplyPo;
@@ -112,6 +112,7 @@
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        String paramIn = CommonCache.getAndRemoveValue("payFeePre" + reqJson.getString("oId"));
        JSONObject paramObj = JSONObject.parseObject(paramIn);
@@ -131,6 +132,8 @@
        //处理现金账户
        dealAccount(paramObj);
        paramObj.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
        //处理 优惠折扣
        addDiscount(paramObj);
@@ -160,10 +163,6 @@
            if (flag < 1) {
                throw new CmdException("更新微信派单池信息失败");
            }
        }
        //修改报修派单状态
        if (feeAttrDtos != null && feeAttrDtos.size() > 0) {
            RepairUserDto repairUserDto = new RepairUserDto();
            repairUserDto.setRepairId(feeAttrDtos.get(0).getValue());
            repairUserDto.setState(RepairUserDto.STATE_PAY_FEE);
@@ -178,7 +177,7 @@
            DecimalFormat df = new DecimalFormat("0.00");
            BigDecimal payment_amount = new BigDecimal(paramObj.getString("receivableAmount"));
            repairUserPo.setContext("已支付" + df.format(payment_amount) + "元");
            int flag = repairUserNewV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
            flag = repairUserNewV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
            if (flag < 1) {
                throw new CmdException("更新微信派单池信息失败");
            }
@@ -212,9 +211,12 @@
            //获取bId
            String bId = feeDetailDtoList.get(0).getbId();
            //获取优惠
            List<ComputeDiscountDto> computeDiscountDtos = (List<ComputeDiscountDto>) paramObj.get("computeDiscountDtos");
            if (computeDiscountDtos != null) {
                for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) {
            //List<ComputeDiscountDto> computeDiscountDtos = (List<ComputeDiscountDto>) paramObj.get("computeDiscountDtos");
            JSONArray computeDiscountDtos = paramObj.getJSONArray("computeDiscountDtos");
            ComputeDiscountDto computeDiscountDto = null;
            if (computeDiscountDtos != null && computeDiscountDtos.size() > 0) {
                for (int accountIndex = 0; accountIndex < computeDiscountDtos.size(); accountIndex++) {
                    computeDiscountDto = BeanConvertUtil.covertBean(computeDiscountDtos.getJSONObject(accountIndex), ComputeDiscountDto.class);
                    if (!StringUtil.isEmpty(computeDiscountDto.getArdId())) {
                        ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo();
                        //将业务id更新到空置房优惠里面
@@ -265,6 +267,7 @@
            AccountDetailPo accountDetailPo = new AccountDetailPo();
            accountDetailPo.setAcctId(accountDto.getAcctId());
            accountDetailPo.setObjId(accountDto.getObjId());
            accountDetailPo.setObjType(accountDto.getObjType());
            if (amount.doubleValue() < deductionAmount.doubleValue()) {
                accountDetailPo.setAmount(amount.doubleValue() + "");
                deductionAmount = deductionAmount.subtract(amount).setScale(2, BigDecimal.ROUND_HALF_UP);