zhuo
2025-02-24 6888584781c77de6854b62f93a57dcce53240cf9
清除标准库部分接口
已修改12个文件
已添加1个文件
310 ■■■■■ 文件已修改
basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-manage/src/main/java/com/ruoyi/manage/controller/InternalPlanController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-personnel/src/main/java/com/ruoyi/personnel/task/PersonTrainingSchedule.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/UserController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
basic-server/src/main/java/com/ruoyi/basic/controller/StandardTreeController.java
@@ -57,14 +57,6 @@
        return Result.success(standardTreeService.addStandardTree(standardTree));
    }
    @ApiOperation(value = "给标准树添加检验标准")
    @PostMapping("/addStandardMethodList")
    public Result addStandardMethodList(@RequestBody Map<String, Object> map) {
        Integer standardId = (Integer) map.get("standardId");
        String tree = (String) map.get("tree");
        return Result.success(standardMethodListService.addStandardMethodList(standardId, tree));
    }
    @ApiOperation(value = "根据标准树进行标准查询")
    @GetMapping("/selectsStandardMethodByFLSSM")
    public Result selectsStandardMethodByFLSSM(String tree) {
@@ -87,27 +79,6 @@
        return Result.success(standardProductListService.updateSection(list));
    }
    @ApiOperation(value = "删除标准树下的检验标准")
    @DeleteMapping("/delStandardMethodByFLSSM")
    public Result delStandardMethodByFLSSM(Integer id) {
        return Result.success(standardMethodListService.delStandardMethodByFLSSM(id));
    }
    @ApiOperation(value = "删除标准树下的检验项目")
    @DeleteMapping("/delStandardProductByIds")
    public Result delStandardProductByIds(String ids) {
        JSONArray lists = JSON.parseArray(ids);
        return Result.success(standardProductListService.delStandardProduct(lists));
    }
    @ApiOperation(value = "新增标准树下的检验项目")
    @PostMapping("/addStandardProduct")
    public Result addStandardProduct(@RequestBody Map<String, String> map) {
        String ids = map.get("ids");
        String tree = map.get("tree");
        return Result.success(standardTreeService.addStandardProduct(ids, tree));
    }
    @ApiOperation(value = "删除标准树的层级")
    @DeleteMapping("/delStandardTree")
    public Result delStandardTree(String tree) {
@@ -122,8 +93,8 @@
    @ApiOperation(value = "通过检验标准查询检验项目")
    @GetMapping("/selectStandardProductListByMethodId")
    public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page) {
        return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page));
    public Result selectStandardProductListByMethodId(Integer id, String tree) {
        return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree));
    }
    @ApiOperation(value = "批量查询检验项目")
basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
@@ -39,9 +39,6 @@
    List<SampleTypeDto> getStandardTree2();
    List<SampleDto> getStandardTree3(String sampleType);
    String getLaboratory(String str);
    Integer getStructureItemParameterId(String sampleType, String item, String itemChild, String inspectionItemClass);
basic-server/src/main/java/com/ruoyi/basic/pojo/StandardProductList.java
@@ -153,7 +153,7 @@
    @ApiModelProperty("型号")
    private String model;
    @ApiModelProperty("型号")
    @ApiModelProperty("模板id")
    private Integer templateId;
    @ApiModelProperty("")
@@ -187,6 +187,7 @@
    private String tree;
    @ApiModelProperty("检验项id")
    private Integer structureItemParameterId;
    @ApiModelProperty(value = "检验项分类")
@@ -218,4 +219,10 @@
     */
    @ApiModelProperty("导体类型")
    private String conductorType;
    @ApiModelProperty("structure_test_object表id")
    private Integer structureTestObjectId;
    @ApiModelProperty("product  äº§å“id")
    private Integer productId;
}
basic-server/src/main/java/com/ruoyi/basic/service/StandardMethodListService.java
@@ -13,13 +13,8 @@
*/
public interface StandardMethodListService extends IService<StandardMethodList> {
    int addStandardMethodList(Integer standardId, String tree);
    Map<String, List<?>> selectsStandardMethodByFLSSM(String tree);
    Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree);
    int delStandardMethodByFLSSM(Integer id);
    List<StandardMethodList> selectStandardMethodEnum();
basic-server/src/main/java/com/ruoyi/basic/service/StandardProductListService.java
@@ -20,11 +20,9 @@
    int upStandardProductList(StandardProductList list);
    int delStandardProduct(JSONArray list);
    List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample);
    Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page);
    Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree);
    IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items);
basic-server/src/main/java/com/ruoyi/basic/service/StandardTreeService.java
@@ -23,8 +23,6 @@
    int delStandardTree(String tree);
    int addStandardProduct(String ids, String tree);
    List<SampleTypeDto> getStandardTree2();
    int upStandardProducts(Map<String, Object> product);
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodListServiceImpl.java
@@ -29,48 +29,6 @@
    private StandardProductListMapper standardProductListMapper;
    @Override
    public int addStandardMethodList(Integer standardId, String tree) {
        String[] trees = tree.split(" - ");
        Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId);
        StandardMethodList list = new StandardMethodList();
        list.setCode(map.get("code"));
        list.setName(map.get("name"));
        list.setRemark(map.get("remark"));
        list.setFactory(trees[0]);
        try {
            list.setLaboratory(trees[1]);
        }catch (Exception e){}
        try {
            list.setSampleType(trees[2]);
        }catch (Exception e){}
        try {
            list.setSample(trees[3]);
        }catch (Exception e){}
        try {
            list.setModel(trees[4]);
        }catch (Exception e){}
        standardMethodListMapper.insert(list);
        List<StandardProductList> standardProductLists = standardMethodListMapper.selectParameterList(list.getCode());
        for (StandardProductList standardProductList : standardProductLists) {
            standardProductList.setStandardMethodListId(list.getId());
            standardProductList.setFactory(trees[0]);
            try {
                standardProductList.setLaboratory(trees[1]);
            }catch (Exception e){}
            try {
                standardProductList.setSampleType(trees[2]);
            }catch (Exception e){}
            try {
                standardProductList.setSample(trees[3]);
            }catch (Exception e){}
            try {
                standardProductList.setModel(trees[4]);
            }catch (Exception e){}
            standardProductListMapper.insert(standardProductList);
        }
        return 1;
    }
    @Override
    public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) {
@@ -103,37 +61,6 @@
        return map;
    }
    @Override
    public Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree) {
        String[] trees = tree.split(" - ");
        List<StandardMethodList> standardMethodLists = null;
        switch (trees.length){
            case 5:
                standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],trees[4]);
                break;
            case 4:
                standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],null);
                break;
            case 3:
                standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],null,null);
                break;
            case 2:
                standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],null,null,null);
                break;
            case 1:
                standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],null,null,null,null);
                break;
        }
        Map<String, List<?>> map = new HashMap<>();
        map.put("standardMethodList", standardMethodLists);
        return map;
    }
    @Override
    public int delStandardMethodByFLSSM(Integer id) {
        standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id));
        return standardMethodListMapper.deleteById(id);
    }
    @Override
    public List<StandardMethodList> selectStandardMethodEnum() {
        return standardMethodListMapper.selectListEnum();
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
@@ -57,10 +57,6 @@
        return standardProductListMapper.updateById(list);
    }
    @Override
    public int delStandardProduct(JSONArray list) {
        return standardProductListMapper.deleteBatchIds(list);
    }
    @Override
    public List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample) {
@@ -263,13 +259,9 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page) {
    public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree) {
        String[] trees = tree.split(" - ");
        try {
            String tree1 = trees[2];
        } catch (Exception e) {
            throw new BaseException("操作太快,系统传参错误!!!!");
        }
        // åˆ¤æ–­æ˜¯å¦æ‹–拽
        boolean isDrag = false;
        List<StandardProductList> list = new ArrayList<>();
        if (trees.length == 3) {
@@ -419,38 +411,36 @@
                }
            }
        }
        if (page == 1) {
            Integer userId = SecurityUtils.getUserId().intValue();
//            CompletableFuture.supplyAsync(() -> {
            if (trees.length == 5) {
                standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate()
                        .eq(StandardProductList::getStandardMethodListId, id)
                        .eq(StandardProductList::getTree, tree));
            } else {
                standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate()
                        .eq(StandardProductList::getStandardMethodListId, id)
                        .like(StandardProductList::getTree, tree));
            }
            try {
                standardProductListService2.saveBatch(list.stream().map(a -> {
                    a.setFactory(trees[0]);
                    a.setLaboratory(trees[1]);
                    a.setSampleType(trees[2]);
                    a.setCreateUser(userId);
                    a.setUpdateUser(userId);
                    a.setStandardMethodListId(id);
                    return a;
                }).collect(Collectors.toList()));
            } catch (Exception e) {
                // å¤„理重复 ID çš„记录,重新生成 ID å¹¶ç»§ç»­å°è¯•插入
                for (StandardProductList productList : list) {
                    productList.setId(IdWorker.getId());
                }
            }
        Integer userId = SecurityUtils.getUserId().intValue();
        if (trees.length == 5) {
            standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate()
                    .eq(StandardProductList::getStandardMethodListId, id)
                    .eq(StandardProductList::getTree, tree));
        } else {
            standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate()
                    .eq(StandardProductList::getStandardMethodListId, id)
                    .like(StandardProductList::getTree, tree));
        }
        Map<String, Object> map = new HashMap<>();
        try {
            List<StandardProductList> productLists = list.stream().map(a -> {
                a.setFactory(trees[0]);
                a.setLaboratory(trees[1]);
                a.setSampleType(trees[2]);
                a.setCreateUser(userId);
                a.setUpdateUser(userId);
                a.setStandardMethodListId(id);
                return a;
            }).collect(Collectors.toList());
            standardProductListService2.saveBatch(productLists);
        } catch (Exception e) {
            // å¤„理重复 ID çš„记录,重新生成 ID å¹¶ç»§ç»­å°è¯•插入
            for (StandardProductList productList : list) {
                productList.setId(IdWorker.getId());
            }
        }
        Collections.sort(list, (o1, o2) -> {
            String field1 = o1.getManHourGroup();
            String field2 = o2.getManHourGroup();
@@ -475,11 +465,9 @@
            list.sort((o1, o2) -> (o1.getSort() == null ? 0 : o1.getSort())
                    - (o2.getSort() == null ? 0 : o2.getSort()));
        }
        try {
            map.put("productList", list.subList((page - 1) * 300, page * 300));
        } catch (IndexOutOfBoundsException e) {
            map.put("productList", list.subList((page - 1) * 300, list.size()));
        }
        Map<String, Object> map = new HashMap<>();
        map.put("productList", list);
        map.put("total", list.size());
        return map;
    }
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardTreeServiceImpl.java
@@ -127,35 +127,6 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int addStandardProduct(String ids, String tree) {
        String[] trees = tree.split(" - ");
        JSONArray jsonArray = JSON.parseArray(ids);
        for (Object o : jsonArray) {
            StandardProductList standardProductList = standardTreeMapper.selectStandardProductById(Integer.parseInt("" + o));
            standardProductList.setFactory(trees[0]);
            try {
                standardProductList.setLaboratory(trees[1]);
            } catch (Exception e) {
            }
            try {
                standardProductList.setSampleType(trees[2]);
            } catch (Exception e) {
            }
            try {
                standardProductList.setSample(trees[3]);
            } catch (Exception e) {
            }
            try {
                standardProductList.setModel(trees[4]);
            } catch (Exception e) {
            }
            standardProductListMapper.insert(standardProductList);
        }
        return 1;
    }
    @Override
    public List<SampleTypeDto> getStandardTree2() {
        return standardTreeMapper.getStandardTree2();
    }
cnas-manage/src/main/java/com/ruoyi/manage/controller/InternalPlanController.java
@@ -76,7 +76,7 @@
     */
    @ApiOperation(value = "内审年度计划删除")
    @GetMapping("/delInternalPlan")
    @DeleteMapping("/delInternalPlan")
    public Result delInternalPlan(Integer planId){
        return Result.success(internalPlanService.delInternalPlan(planId));
    }
cnas-personnel/src/main/java/com/ruoyi/personnel/task/PersonTrainingSchedule.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.ruoyi.personnel.task;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.domain.entity.User;
import com.ruoyi.common.utils.WxCpUtils;
import com.ruoyi.personnel.mapper.PersonTrainingDetailedMapper;
import com.ruoyi.personnel.pojo.PersonTrainingDetailed;
import com.ruoyi.system.mapper.UserMapper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
 * åŸ¹è®­è®¡åˆ’使用提醒记录提醒
 */
@Component
public class PersonTrainingSchedule {
    @Resource
    private PersonTrainingDetailedMapper personTrainingDetailedMapper;
    @Resource
    private UserMapper userMapper;
    @Resource
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    /**
     * æé†’填写设备使用记录
     */
//    @Scheduled(cron = "0/5 * * * * *")
    @Scheduled(cron = "0 0 9 1 * *") // æ¯æœˆä¸€å·æ‰§è¡Œ
    public void task1() {
        // æŸ¥è¯¢å½“月培训计划
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M");
        String format = LocalDateTime.now().format(formatter);
        List<PersonTrainingDetailed> personTrainingDetaileds = personTrainingDetailedMapper.selectList(Wrappers.<PersonTrainingDetailed>lambdaQuery()
                .eq(PersonTrainingDetailed::getTrainingDate, format));
        for (PersonTrainingDetailed personTrainingDetailed : personTrainingDetaileds) {
            threadPoolTaskExecutor.execute(() -> {
                // æŸ¥è¯¢åŸ¹è®­è®²å¸ˆ
                User user = userMapper.selectById(personTrainingDetailed.getTrainingLecturerId());
                // ä¼ä¸šå¾®ä¿¡é€šçŸ¥åŸ¹è®­
                String message = "";
                message += "人员培训计划提醒通知";
                message += "\n培训目标: " + personTrainingDetailed.getTrainingObjectives();
                message += "\n培训内容: " + personTrainingDetailed.getTrainingContent();
                message += "\n参加对象: " + personTrainingDetailed.getParticipants();
                message += "\n培训日期: " + personTrainingDetailed.getTrainingDate();
                message += "\n计划当月进行培训";
                //发送企业微信消息通知
                try {
                    WxCpUtils.inform(user.getAccount(), message, null);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            });
        }
    }
}
inspect-server/src/main/java/com/ruoyi/inspect/vo/InsOrderPlanVO.java
@@ -7,7 +7,7 @@
public class InsOrderPlanVO{
    private String id;
    private Integer id;
    @ApiModelProperty("委托编号")
    private String entrustCode;
@@ -73,6 +73,6 @@
    private String tempUrlPdf;
    @ApiModelProperty("报告id")
    private String insReportId;
    private Integer insReportId;
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/UserController.java
@@ -26,7 +26,8 @@
    private UserService userService;
    /**
     * type : 1: èŽ·å–æ£€æµ‹äººå‘˜ä¿¡æ¯
     * todo:  type : 1: èŽ·å–æ£€æµ‹äººå‘˜ä¿¡æ¯
              type : 2: èŽ·å–å½“å‰éƒ¨é—¨(实验室人员)
     * @param user
     * @param type
     * @return