| | |
| | | return Result.success(insOrderPlanService.upPlanUser(userId, orderId, sonLaboratory)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "判断交接的试验室") |
| | | @PostMapping("/upPlanUser2") |
| | | public Result<?> upPlanUser2(Integer orderId) { |
| | | return Result.success(insOrderPlanService.upPlanUser2(orderId)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "复核检验任务") |
| | | @PostMapping("/verifyPlan") |
| | |
| | | Map<String,Object> getReportModel(Integer sampleId); |
| | | |
| | | Map<String,Object> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass); |
| | | |
| | | List<String> upPlanUser2(Integer orderId); |
| | | } |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> upPlanUser2(Integer orderId) { |
| | | List<Integer> sampleId = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId)).stream().map(InsSample::getId).collect(Collectors.toList()); |
| | | List<String> sonLaboratory = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getState, 1).in(InsProduct::getInsSampleId, sampleId)).stream().map(InsProduct::getSonLaboratory).distinct().collect(Collectors.toList()); |
| | | return sonLaboratory; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveInsContext(Map<String, Object> insContext) { |
| | |
| | | insSampleUser.setInsSampleId(orderId); |
| | | insSampleUser.setState(0); |
| | | insSampleUser.setSonLaboratory(laboratory); |
| | | insSampleUserMapper.insert(insSampleUser); |
| | | insSampleUserMapper.insert(insSampleUser); |
| | | /*校验一下result表*/ |
| | | CompletableFuture.supplyAsync(() -> { |
| | | List<Integer> ips = insProducts.stream().map(InsProduct::getId).distinct().collect(Collectors.toList()); |
| | |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_order_id = #{id} |
| | | and template_id is not null |
| | | and ip.standard_method_list_id is not null |
| | | and state = 1 |
| | | </select> |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, String laboratory) { |
| | | //查询当前登录人员的架构 |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | //判断全部,个人,组织的权限 |
| | | User user = userMapper.selectById(userId);//当前登录的人 |
| | | //获取当前人所属实验室id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //查询对应架构名称(通信实验室,电力实验室,检测办) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("实验室")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | IPage<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYear(page, time, userName, laboratory); |
| | | List<Enums> shiftType = enumService.selectEnumByCategory("班次类型"); |
| | | mapYearIPage.setRecords(annualAttendanceProcessing(mapYearIPage.getRecords(), shiftType)); |
| | |
| | | SELECT |
| | | s.user_id, s.shift |
| | | FROM performance_shift s |
| | | LEFT JOIN user u on u.id = s.user_id |
| | | LEFT JOIN (SELECT u.* from |
| | | user u |
| | | left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where state=1 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | | ) u2 on u2.id = s.user_id |
| | | where s.shift is not NULL |
| | | and s.shift != '' |
| | | and name is not null |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and u2.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftYear" resultType="java.util.Map"> |
| | | SELECT if(u.department is not null and u.department != '', CONCAT(u.name, '(', u.department, ')'), u.name) name, |
| | | s.user_id, u.account, |
| | | SELECT if(u2.department is not null and u2.department != '', CONCAT(u2.name, '(', u2.department, ')'), u2.name) name, |
| | | s.user_id, u2.account, |
| | | DATE_FORMAT(s.work_time, '%c') work_time, |
| | | GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), ':', s.shift order by s.work_time SEPARATOR ';') month_str |
| | | FROM performance_shift s |
| | | LEFT JOIN user u on u.id = s.user_id |
| | | LEFT JOIN (SELECT u.* from |
| | | user u |
| | | left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where state=1 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | | ) u2 on u2.id = s.user_id |
| | | where s.shift is not NULL |
| | | and s.shift != '' |
| | | and name is not null |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | </if> |
| | | GROUP BY u.id |
| | | GROUP BY u2.id |
| | | order by s.create_time |
| | | </select> |
| | | |