| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.annotation.RepeatSubmit; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | |
| | | 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; |
| | |
| | | LambdaQueryWrapper<TjChargingStandard> wq3 = new LambdaQueryWrapper<>(); |
| | | wq3.eq(TjChargingStandard::getTjNum, TjNumber); |
| | | List<TjChargingStandard> list = chargingStandardService.list(wq3); |
| | | if (null != list && list.size() > 0) { |
| | | if (null != list && !list.isEmpty()) { |
| | | for (TjChargingStandard standard : list) { |
| | | TjProject project = projectService.getById(standard.getProId()); |
| | | if (null != project && null != project.getProCheckType()) { |
| | |
| | | @PutMapping |
| | | @ApiOperation(value = "体检点击收费按钮接口") |
| | | @Transactional |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody TjFlowingWater tjFlowingWater) { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | 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() +SecurityUtils.getUsername() + DateUtil.format(new Date(), "yyMMddHHmmssSSS")); |
| | | tjFlowingWater.setIsAddition("Y"); |
| | | if (tjFlowingWaterService.save(tjFlowingWater)) { |
| | | //异步单项收费明细 |
| | | asyncService.iundividualCharges(tjFlowingWater, order, customer, sysUser); |
| | | Boolean b = asyncService.iundividualCharges(tjFlowingWater, order, customer, sysUser); |
| | | if (!b){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error(); |
| | | } |
| | | // if(!b){ |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // } |
| | | //extracted(tjFlowingWater, order, customer); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("waterId", tjFlowingWater.getWaterId()); |