zjh
2024-09-05 9155df2aeab5b0d95c89dd928dbaefbfbaeae9d1
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java
@@ -23,6 +23,7 @@
import io.swagger.annotations.ApiParam;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.*;
import com.ltkj.common.annotation.Log;
import com.ltkj.common.core.controller.BaseController;
@@ -202,16 +203,24 @@
        SysUser sysUser = userService.getById(userId);
        TjFlowingWater flowingWater = tjFlowingWaterService.getById(tjFlowingWater.getTjSerialNumber());
        tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
        tjFlowingWater.setPayStasus(1L);
//        tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
//        tjFlowingWater.setPayStasus(1L);
        TjOrder order = orderService.getById(tjFlowingWater.getOrderId());
        if(order.getFinishTime() !=null){
            return AjaxResult.error("该人员已签离,不可补录项目!");
        }
        TjCustomer customer = customerService.getById(order.getUserId());
        if (null != tjFlowingWater.getTjProIds() && tjFlowingWater.getTjProIds().length > 0) {
            tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(customer.getCusName(), "").toUpperCase() + DateUtil.format(new Date(), "yyMMddHHmmssSSS"));
            tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(customer.getCusName(), "").toUpperCase() +SecurityUtils.getUsername() + DateUtil.format(new Date(), "yyMMddHHmmssSSS"));
            tjFlowingWater.setIsAddition("Y");
            if (tjFlowingWaterService.save(tjFlowingWater)) {
                //异步单项收费明细
                asyncService.iundividualCharges(tjFlowingWater, order, customer, sysUser);
//                if(!b){
//                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//                }
                //extracted(tjFlowingWater, order, customer);
                Map<String, Object> map = new HashMap<>();
                map.put("waterId", tjFlowingWater.getWaterId());