lige
2024-05-21 f9501db5a27184c54ec25832f4dffc356e961bfe
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -52,6 +52,7 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpRequest;
@@ -1184,6 +1185,8 @@
                }
            }
        }
        if (null != tbTransitionList && tbTransitionList.size() > 0) {
            if (redisCache.hasKey(cardId + cusId)) {
                redisCache.deleteObject(cardId + cusId);
@@ -1427,19 +1430,20 @@
        if (!handleOption.isCanship()) {
            return AjaxResult.error("订单不能核销");
        }
        Date date = new Date();
        order.setOrderStatus(OrderUtil.STATUS_SHIP.longValue());
        order.setShipTime(new Date());
        order.setConfirmTime(new Date());
        order.setShipTime(date);
        order.setConfirmTime(date);
        MallCheckLog checkLog = new MallCheckLog();
        String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(new Date());
        String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(date);
        checkLog.setCheckBy(String.valueOf(SecurityUtils.getUserId()));
        checkLog.setUserId(order.getUserId());
        checkLog.setConsignee(order.getConsignee());
        checkLog.setIdCard(order.getIdCard());
        checkLog.setOrderId(String.valueOf(order.getId()));
        checkLog.setOrderSn(order.getOrderSn());
        checkLog.setCheckTime(new Date());
        checkLog.setCheckTime(date);
        checkLog.setShipSn("HX" + s1);
        mallCheckLogService.save(checkLog);
        mallOrderService.updateById(order);
@@ -1450,11 +1454,11 @@
    private List<Map<String, Object>> getMaps(String cusId, String cardId) {
        List<TbTransition> transitionList = null;
        if (redisCache.hasKey(cardId + cusId)) {
            transitionList = redisCache.getCacheList(cardId + cusId);
        } else {
//        if (redisCache.hasKey(cardId + cusId)) {
//            transitionList = redisCache.getCacheList(cardId + cusId);
//        } else {
            transitionList = transitionService.getTbTransitionListByCusId(cusId, cardId);
        }
//        }
        if (null == transitionList) return null;
        Map<Long, List<TbTransition>> collect = transitionList.stream().collect(Collectors.groupingBy(TbTransition::getParentProId));
        List<Map<String, Object>> list = new ArrayList<>();
@@ -1465,14 +1469,15 @@
                TjPackage aPackage = tjPackageService.getById(entry.getValue().get(0).getPacId());
                map.put("pacName", aPackage.getPacName());
                TjProject tjProject = projectService.getById(entry.getKey());
                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
                        .eq(TjPackageProject::getProId, entry.getKey()));
//                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
//                        .eq(TjPackageProject::getProId, entry.getKey()));
                map.put("ordPrice", tjProject.getProPrice());
                if (null != project) {
                    map.put("nowPrice", project.getPriceNow());
                } else {
                    map.put("nowPrice", tjProject.getProPrice());
                }
//                if (null != project) {
//                    map.put("nowPrice", project.getPriceNow());
//                } else {
//                    map.put("nowPrice", tjProject.getProPrice());
//                }
                map.put("nowPrice",transitionService.getTbTransitionDxPriceByPac(cusId,entry.getKey(),cardId,pacId));
            } else {
                map.put("pacName", "单项");
                List<TbTransition> tbTransitionList = entry.getValue();
@@ -1489,8 +1494,6 @@
            }
            map.put("parentName", projectService.getById(entry.getKey()).getProName());
            map.put("list", entry.getValue());
            list.add(map);
        }
        return list;
@@ -1867,5 +1870,28 @@
        return AjaxResult.success(list);
    }
    @GetMapping("/revokeTjOrderByTjNum")
    @ApiOperation(value = "根据客户体检号撤销体检记录")
    @Transactional
    public AjaxResult revokeTjOrderByTjNum(@RequestParam @ApiParam(value = "体检号") String tjNum) {
        TjOrder order = tjOrderService.getOrderByTjNum(tjNum);
        if(null !=order){
            String payByTjNum = tjOrderService.isPayByTjNum(String.valueOf(order.getOrderId()));
            if(null!=payByTjNum){
                return AjaxResult.success("该用户已收费不可撤销签到!");
            }
            tjOrderService.deleteTjOrderByOrderId(order.getOrderId());
            tjOrderDetailService.deleteTjOrderDetailByOrderDetailId(String.valueOf(order.getOrderId()));
            remarkService.deletedOrderRemarkByTjNum(tjNum);
            tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId()));
            transitionService.deletedTbTransitionByTjNum(tjNum);
            transitionService.updateTbTransitionByTjNum(tjNum);
            return AjaxResult.success("撤销成功!!!");
        }
        return AjaxResult.success("签到记录不存在!");
    }
}