| | |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | |
| | | @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 = "æ¹éæ¥è¯¢æ£éªé¡¹ç®") |
| | |
| | | |
| | | List<SampleTypeDto> getStandardTree2(); |
| | | |
| | | List<SampleDto> getStandardTree3(String sampleType); |
| | | |
| | | |
| | | String getLaboratory(String str); |
| | | |
| | | Integer getStructureItemParameterId(String sampleType, String item, String itemChild, String inspectionItemClass); |
| | |
| | | @ApiModelProperty("åå·") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | @ApiModelProperty("模æ¿id") |
| | | private Integer templateId; |
| | | |
| | | @ApiModelProperty("") |
| | |
| | | |
| | | private String tree; |
| | | |
| | | @ApiModelProperty("æ£éªé¡¹id") |
| | | private Integer structureItemParameterId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»") |
| | |
| | | */ |
| | | @ApiModelProperty("导ä½ç±»å") |
| | | private String conductorType; |
| | | |
| | | @ApiModelProperty("structure_test_object表id") |
| | | private Integer structureTestObjectId; |
| | | |
| | | @ApiModelProperty("product 产åid") |
| | | private Integer productId; |
| | | } |
| | |
| | | */ |
| | | 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(); |
| | | |
| | |
| | | |
| | | 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); |
| | | |
| | |
| | | |
| | | int delStandardTree(String tree); |
| | | |
| | | int addStandardProduct(String ids, String tree); |
| | | |
| | | List<SampleTypeDto> getStandardTree2(); |
| | | |
| | | int upStandardProducts(Map<String, Object> product); |
| | |
| | | |
| | | 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) { |
| | |
| | | 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(); |
| | |
| | | return standardProductListMapper.updateById(list); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardProduct(JSONArray list) { |
| | | return standardProductListMapper.deleteBatchIds(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample) { |
| | |
| | | |
| | | @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) { |
| | |
| | | } |
| | | } |
| | | } |
| | | 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(); |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | |
| | | @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(); |
| | | } |
| | |
| | | */ |
| | | |
| | | @ApiOperation(value = "å
审年度计åå é¤") |
| | | @GetMapping("/delInternalPlan") |
| | | @DeleteMapping("/delInternalPlan") |
| | | public Result delInternalPlan(Integer planId){ |
| | | return Result.success(internalPlanService.delInternalPlan(planId)); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public class InsOrderPlanVO{ |
| | | |
| | | |
| | | private String id; |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å§æç¼å·") |
| | | private String entrustCode; |
| | |
| | | private String tempUrlPdf; |
| | | |
| | | @ApiModelProperty("æ¥åid") |
| | | private String insReportId; |
| | | private Integer insReportId; |
| | | |
| | | } |
| | |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * type : 1: è·åæ£æµäººåä¿¡æ¯ |
| | | * todo: type : 1: è·åæ£æµäººåä¿¡æ¯ |
| | | type : 2: è·åå½åé¨é¨(å®éªå®¤äººå) |
| | | * @param user |
| | | * @param type |
| | | * @return |