zjh
2024-05-22 ccbcd23becc1359f26d8cc571005e546e2ed6053
zjh 2024/05/22-1
3个文件已修改
1个文件已添加
116 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictCompController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/dto/QianDaoDto.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TbTransitionMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictCompController.java
@@ -123,17 +123,15 @@
    public AjaxResult getCusTomterListByCompId(@RequestParam(required = false) @ApiParam(value = "单位id") String compId,
                                               @RequestParam(required = false) @ApiParam(value = "名字") String name,
                                               @RequestParam(required = false) @ApiParam(value = "部门id") String deptId,
                                               @RequestParam(required = false) @ApiParam(value = "预约时间") Date reservationTime,
                                               @RequestParam(defaultValue = "1") @ApiParam(value = "页码数") Integer page,
                                               @RequestParam(defaultValue = "10") @ApiParam(value = "每页显示条数") Integer pageSize) {
        IPage<TjReservation> pages=new Page<>(page,pageSize);
                                               @RequestParam(required = false) @ApiParam(value = "预约时间") Date reservationTime) {
        LambdaQueryWrapper<TjReservation> wq=new LambdaQueryWrapper<>();
        if(null !=compId)wq.eq(TjReservation::getCompanyId,compId);
        if(null !=name)wq.eq(TjReservation::getName,name);
        if(null !=deptId)wq.eq(TjReservation::getDepartment,deptId);
        if(null !=reservationTime)wq.between(TjReservation::getReservationTime, DateUtil.beginOfDay(reservationTime),DateUtil.endOfDay(reservationTime));
        IPage<TjReservation> iPage = reservationService.page(pages, wq);
        return AjaxResult.success(iPage);
//        IPage<TjReservation> iPage = reservationService.page(pages, wq);
        return AjaxResult.success(reservationService.list(wq));
    }
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -33,6 +33,7 @@
import com.ltkj.framework.config.UserHoder;
import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.dto.QianDaoDto;
import com.ltkj.hosp.mapper.TestMapper;
import com.ltkj.hosp.service.*;
import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail;
@@ -1015,10 +1016,10 @@
    @PostMapping("/addPlOrderAndDetail")
    @ApiOperation(value = "体检批量签到登记接口")
    @Transactional  //(切换数据库出错,所以注释)
    public AjaxResult addPlOrderAndDetail(@RequestBody List<String> cusIds){
    public AjaxResult addPlOrderAndDetail(@RequestBody QianDaoDto daoDto){
         SysUser sysUser = UserHoder.getLoginUser().getUser();
        List<String> cusIds = daoDto.getCusIds();
        if(null !=cusIds && cusIds.size()>0){
            ExecutorService threadPools = Executors.newFixedThreadPool(cusIds.size());
            for (String cusId : cusIds) {
                threadPools.execute(new Runnable() {
@@ -1038,7 +1039,7 @@
                        @Override
                        public void run() {
                            try {
                                getAjaxResult(aLong,sysUser);
                                getAjaxResult(aLong,sysUser,daoDto.getTjCategory());
                                threadPool.shutdown();
                            } catch (IOException e) {
                                e.printStackTrace();
@@ -1105,14 +1106,14 @@
            wq.eq(TjReservation::getIsExpire, 2);
            TjReservation tjReservation = tjReservationService.getOne(wq);
            if (tjReservation != null) {
                if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) {
/*                if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) {
//                    return AjaxResult.error("未到预约时间");
                }
                if (null != tjReservation.getReservationTime() && DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) {
                    tjReservation.setIsExpire(1);
                    tjReservationService.updateById(tjReservation);
//                    return AjaxResult.error("对不起您的预约已超时请重新预约");
                }
                }*/
                LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>();
                qw.eq(TjCustomer::getCusIdcard, cusIdcard);
                TjCustomer tjCustomer1 = tjCustomerService.getOne(qw);
@@ -1131,40 +1132,34 @@
                    tjCustomer1.setAgeUnit(tjReservation.getAgeUnit());
                    tjCustomer1.setCareer(tjReservation.getCareer());
                    tjCustomerService.updateById(tjCustomer1);
                }else {
                    TjCustomer tjCustomer = new TjCustomer();
                    tjCustomer.setCusIdcard(tjReservation.getIdCard());
                    tjCustomer.setCusName(tjReservation.getName());
                    tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex()));
                    tjCustomer.setCusBrithday(tjReservation.getBirthday());
                    tjCustomer.setCusPhone(tjReservation.getPhoe());
                    tjCustomer.setCusEmail(tjReservation.getEmail());
                    tjCustomer.setCusAddr(tjReservation.getAddress());
                    tjCustomer.setCusMarryStatus(String.valueOf(tjReservation.getMarriage()));
                    tjCustomer.setCusNational(String.valueOf(tjReservation.getNation()));
                    tjCustomer.setIdType(tjReservation.getIdType());
                    tjCustomer.setAge(tjReservation.getAge());
                    tjCustomer.setAgeUnit(tjReservation.getAgeUnit());
                    tjCustomer.setCareer(tjReservation.getCareer());
                    tjCustomer.setDwPhone(tjReservation.getDwPhone());
                    tjCustomer.setCardId(tjReservation.getCardId());
                    tjCustomer.setIndexCard(tjReservation.getIndexCard());
                    //截取密码自动生成set进去
                    String substring = cusIdcard.substring(cusIdcard.length() - 6);
                    substring = DigestUtils.md5DigestAsHex(substring.getBytes());
                    tjCustomer.setCusPassword(substring);
                    tjCustomer.setTjType(tjReservation.getTjType());
                    tjCustomerService.save(tjCustomer);
                }
                TjCustomer tjCustomer = new TjCustomer();
                tjCustomer.setCusIdcard(tjReservation.getIdCard());
                tjCustomer.setCusName(tjReservation.getName());
                tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex()));
                tjCustomer.setCusBrithday(tjReservation.getBirthday());
                tjCustomer.setCusPhone(tjReservation.getPhoe());
                tjCustomer.setCusEmail(tjReservation.getEmail());
                tjCustomer.setCusAddr(tjReservation.getAddress());
                tjCustomer.setCusMarryStatus(String.valueOf(tjReservation.getMarriage()));
                tjCustomer.setCusNational(String.valueOf(tjReservation.getNation()));
                tjCustomer.setIdType(tjReservation.getIdType());
                tjCustomer.setAge(tjReservation.getAge());
                tjCustomer.setAgeUnit(tjReservation.getAgeUnit());
                tjCustomer.setCareer(tjReservation.getCareer());
                tjCustomer.setDwPhone(tjReservation.getDwPhone());
                tjCustomer.setCardId(tjReservation.getCardId());
                tjCustomer.setIndexCard(tjReservation.getIndexCard());
                //截取密码自动生成set进去
                String substring = cusIdcard.substring(cusIdcard.length() - 6);
                substring = DigestUtils.md5DigestAsHex(substring.getBytes());
                tjCustomer.setCusPassword(substring);
                tjCustomer.setTjType(tjReservation.getTjType());
                tjCustomerService.save(tjCustomer);
//                return success(tjCustomer);
            }
//            LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>();
//            qw.eq(TjCustomer::getCusIdcard, cusIdcard);
//            TjCustomer tjCustomer = tjCustomerService.getOne(qw);
//            return AjaxResult.success("暂无预约信息",tjCustomer);
        }
//        return error("身份证号不存在");
    }
    private void extracteds(TjCustomer customer) {
@@ -1191,7 +1186,7 @@
        DynamicDataSourceContextHolder.clearDataSourceType();
    }
    private AjaxResult getAjaxResult(Long userId,SysUser sysUser) throws IOException {
    private AjaxResult getAjaxResult(Long userId,SysUser sysUser,String tjCategory) throws IOException {
        LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>();
        wq.eq(TjCustomer::getCusId,userId);
@@ -1211,7 +1206,13 @@
            return AjaxResult.error("不可重复登记");
        }
        TjOrder tjOrder=new TjOrder();
        Date date=new Date();
        tjOrder.setCreateTime(date);
        tjOrder.setUpdateTime(date);
        tjOrder.setCreateBy(sysUser.getNickName());
        tjOrder.setUpdateBy(sysUser.getNickName());
        tjOrder.setUserId(userId);
        tjOrder.setTjCategory(tjCategory);
        LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>();
        wq1.eq(TjReservation::getIdCard, tjCustomer.getCusIdcard());
        wq1.eq(TjReservation::getIsExpire, 2);
@@ -1239,14 +1240,17 @@
            }
            tjReservation.setIsExpire(1);
            tjReservationService.updateById(tjReservation);
            if (null != tjReservation.getTeamNo()) {
                tjOrder.setTjType("1");
            } else {
                tjOrder.setTjType("2");
            }
//            if (null != tjReservation.getTeamNo()) {
//                tjOrder.setTjType("1");
//            } else {
//                tjOrder.setTjType("2");
//            }
        }
        //生成体检号
        String tjNumber = (sysUser.getUserName() + new SimpleDateFormat("yyMMddHHmmss").format(new Date()));
               tjNumber=tjNumber.replaceAll(".{4}$",userId.toString().substring(userId.toString().length() - 4));
        tjOrder.setTjNumber(tjNumber);
        if (null != tjOrder.getPhoto()) {
            File file = new File(tjOrder.getPhoto());
@@ -1270,6 +1274,7 @@
        if (null != mallOrder) tjOrder.setMallOrderId(String.valueOf(mallOrder.getId()));
        tjOrder.setStatus(TjConstants.TJ_BEGIN);
        tjOrder.setCardId(tjCustomer.getCardId());
        tjOrder.setTjType("1");
        if (tjOrderService.save(tjOrder)) {
            //保存收货地址
            if ("2".equals(tjOrder.getGetType())) {
ltkj-hosp/src/main/java/com/ltkj/hosp/dto/QianDaoDto.java
New file
@@ -0,0 +1,15 @@
package com.ltkj.hosp.dto;
import lombok.Data;
import java.util.List;
@Data
public class QianDaoDto {
    private List<String> cusIds;
    private String tjCategory;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TbTransitionMapper.java
@@ -108,7 +108,7 @@
    @Update("UPDATE tb_transition a SET \n" +
            "a.ord_price=a.now_price,\n" +
            "a.now_price=a.ord_price*#{discount}," +
            "a.now_price=a.ord_price*(#{discount}/10)," +
            "a.tj_num=#{tjNum}"+
            " WHERE a.cus_id=#{cusId} ")
    boolean updateTbTransitionPriceByCusId(@Param("cusId")String cusId,@Param("discount")BigDecimal discount,@Param("tjNum")String tjNum);