zjh
5 天以前 769f5f1c452560ab044fee905c1c514c9ca373bb
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReservationController.java
@@ -41,6 +41,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -103,14 +104,15 @@
    @Autowired
    private ITjDwGroupingService tjDwGroupingService;
    @Value("${path.filePath}")
    private String value;
//    @Value("${path.filePath}")
//    private String value;
    @PostMapping("/importTemplate")
    @ApiOperation(value = "导出excel表模板")
    public void importTemplate(HttpServletResponse response) {
        //原来的下载模板调用接口
        try {
            String value = configService.selectConfigByKey("path_filePath");
            String base64String = PDFBinaryUtil.getPDFBinary(value + File.separator + "西安路泰机电科技有限公司.xls");
            if (null != base64String) {
                PDFBinaryUtil.base64StringToPDF(base64String, FileUtil.mkdir(value).getPath() + File.separator + "团体预约Excel模版.xls");
@@ -177,7 +179,7 @@
    @ApiOperation(value = "查询体检预约列表接口(默认)")
    public TableDataInfo list(TjReservation tjReservation) {
        startPage();
        tjReservation.setIsExpire(2);
       if(tjReservation.getIsExpire()==null) tjReservation.setIsExpire(2);
        List<TjReservation> list = tjReservationService.selectTjReservationList(tjReservation);
//        if(null !=list && list.size()>0){
//            for (TjReservation reservation : list) {
@@ -436,7 +438,7 @@
                        log.info(tjReservation.getName() + " " + idCard);
                    }
                        if ((sfjysfzh.equalsIgnoreCase("Y") && !MatchUtils.isIdCard(idCard)) ||
                        if ((sfjysfzh.equalsIgnoreCase("Y") &&  idCard.length()==18 && !MatchUtils.isIdCard(idCard)) ||
                                (sfjysjh.equalsIgnoreCase("Y") && !MatchUtils.isMobileNO(phoe))) {
                            wrongList.add(tjReservation.getName() + " " + tjReservation.getIdCard()+"身份证号/手机号 格式不准确");
//                            errMsg = "身份证号/手机号 格式不准确";
@@ -570,9 +572,10 @@
        if (null != tjReservation.getIdType()) {
            if (tjReservation.getIdType().equals("1")) {
                b = MatchUtils.isIdCard(tjReservation.getIdCard());
            } else {
                b = MatchUtils.cardValidate(tjReservation.getIdCard(), tjReservation.getIdType());
            }
//            else {
//                b = MatchUtils.cardValidate(tjReservation.getIdCard(), tjReservation.getIdType());
//            }
        } else {
            return AjaxResult.error("请选择证件类型");
        }
@@ -761,7 +764,7 @@
        //团体人数
        int tramNum = 0;
        if (null != rightList && rightList.size() > 0) {
        if (null != rightList && !rightList.isEmpty()) {
            String teamNo = PinyinUtil.getFirstLetter(dwDept.getDwName(), "") + DateUtil.format(new Date(), "yyMMddHHmmss");
            for (TjReservation reservation : rightList) {
                TjDwGrouping dwGrouping = dwGroupingService.getById(reservation.getGroupingId());
@@ -864,7 +867,6 @@
        Date date = new Date();
        //异步数据
//        asyncService.addNewReservationConfirm(rightList);
        asyncService.saveNewReservationConfirm(rightList);
        //体检单位部门
@@ -893,7 +895,6 @@
                TjDwGrouping dwGrouping = dwGroupingService.getById(reservation.getGroupingId());
//                TjDwDept dwDept = dwDeptService.getById(dwGrouping.getDwDeptId());
                LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>();
                wq.eq(TjReservation::getIdCard, reservation.getIdCard());
@@ -924,7 +925,6 @@
                reservation.setPacId(dwGrouping.getId());
                compPay = compPay.add(dwGrouping.getYsPrice());
//                reservation.setTjType(String.valueOf(1));
                reservation.setTeamNo(teamNo);
                reservation.setYxts(dto.getYxts());
                tjReservationService.save(reservation);
@@ -954,14 +954,13 @@
                compPayService.save(tjCompPay);
            }
//            .filter(a-> null != a.getPacId())
            Map<String, List<TjReservation>> collect = rightList.stream().collect(Collectors.groupingBy(TjReservation::getPacId));
   /*         Map<String, List<TjReservation>> collect = rightList.stream().collect(Collectors.groupingBy(TjReservation::getPacId));
            if (!collect.isEmpty()) {
                for (Map.Entry<String, List<TjReservation>> entry : collect.entrySet()) {
                    LambdaQueryWrapper<TjTeamSelectRecord> wq = new LambdaQueryWrapper<>();
                    wq.eq(TjTeamSelectRecord::getTeamNo, teamNo);
                    wq.eq(TjTeamSelectRecord::getPacId, entry.getKey());
                    wq.eq(TjTeamSelectRecord::getCompId, dto.getDwId());
                    TjTeamSelectRecord recordServiceOne = selectRecordService.getOne(wq);
                    if (null != recordServiceOne) {
@@ -983,7 +982,7 @@
                        selectRecordService.save(selectRecord);
                    }
                }
            }
            }*/
            return AjaxResult.success("预约成功");
        }
        return AjaxResult.error("请选择预约对象");