标准库导入提示+能力范围场所字段+检验任务新增接口+委托编号生成
| | |
| | | |
| | | @Select("select coalesce(count(id), 0) from ${tableName} where create_time like concat('%', #{date}, '%')") |
| | | int countRowsByNow(String tableName, String date); |
| | | |
| | | @Select("select coalesce(count(id), 0) from ${tableName} where examine_time like concat('%', #{date}, '%')") |
| | | int countRowsByNow2(String tableName, String date); |
| | | } |
| | | |
| | |
| | | public String giveCode(String code, String tableName, String symbol, String patten){ |
| | | String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); |
| | | int num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | int num; |
| | | if (tableName.equals("ins_order")){ |
| | | num = systemLogMapper.countRowsByNow2(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | }else { |
| | | num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | } |
| | | String nums = num + ""; |
| | | if(nums.length() == 1) nums = "00" + num; |
| | | else if(nums.length() == 2) nums = "0" + num; |
| | |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "切换光纤/光纤带记录模版查询检验内容") |
| | | @PostMapping("/getReportModel") |
| | | public Result<?> getReportModel(Integer orderId) { |
| | | return Result.success(insOrderPlanService.getReportModel(orderId)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsProduct") |
| | | @ApiOperation("获取检验项目和模板内容") |
| | |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取标准树(检验下单)") |
| | | @GetMapping("/selectStandardTreeList2") |
| | | public Result selectStandardTreeList2() { |
| | |
| | | int updateStatus( Integer id); |
| | | |
| | | String selLaboratoryCode(String laboratory); |
| | | |
| | | List<Map<Integer, Object>> selectReportModelByOrderId(@Param("id") Integer id, @Param("laboratory") String laboratory); |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | List<InsProduct> getInsProduct2(Integer id); |
| | | |
| | | List<InsProduct> getInsProduct3(Integer id); |
| | | |
| | | List<Map<String, Object>> getReportModel(@Param("orderId") Integer orderId, @Param("id") Integer id, @Param("laboratory") String laboratory); |
| | | } |
| | | |
| | | |
| | |
| | | Integer getStructureItemParameterId(String sampleType, String item, String itemChild); |
| | | |
| | | List<ProductDto> selectPList(String name); |
| | | |
| | | String selSample(String sample); |
| | | } |
| | | |
| | | |
| | |
| | | Map<String,Object> getFileList(Page page, InsOrderFile insOrderFile); |
| | | |
| | | int uploadFile(Integer orderId, MultipartFile file); |
| | | |
| | | Map<String,Object> getReportModel(Integer orderId); |
| | | } |
| | |
| | | if(bushingDto.getFiber().size()==0){ |
| | | bushingDto.setFibers(insBushingMapper.selectFibersByBushingId(insBushing.getId())); |
| | | for (FibersDto fibers : bushingDto.getFibers()) { |
| | | // getTemplateThing(fibers.getProductList()); |
| | | fibers.setFiber(insBushingMapper.selectFiberByFibersId(fibers.getId())); |
| | | // for (FiberDto fiberDto : fibers.getFiber()) { |
| | | // getTemplateThing(fiberDto.getProductList()); |
| | | // } |
| | | } |
| | | } |
| | | // else{ |
| | | // for (FiberDto fiberDto : bushingDto.getFiber()) { |
| | | // getTemplateThing(fiberDto.getProductList()); |
| | | // } |
| | | // } |
| | | bushingDtos.add(bushingDto); |
| | | } |
| | | return bushingDtos; |
| | |
| | | import com.deepoove.poi.xwpf.WidthScalePattern; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.BushingDto; |
| | | import com.yuanchu.mom.dto.ExcelDto; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | |
| | | private InsBushingService insBushingService; |
| | | |
| | | @Resource |
| | | private InsBushingMapper insBushingMapper; |
| | | |
| | | @Resource |
| | | private InsFiberMapper insFiberMapper; |
| | | |
| | | @Resource |
| | | private InsFibersMapper insFibersMapper; |
| | | |
| | | @Resource |
| | | private InsOrderFileMapper insOrderFileMapper; |
| | |
| | | Map<String, Object> map = insOrderService.getInsOrderAndSample(id, laboratory); |
| | | List<SampleProductDto> list = JSON.parseArray(JSON.toJSONString(map.get("sampleProduct")), SampleProductDto.class); |
| | | for (SampleProductDto samples : list) { |
| | | // Set<Integer> set = new HashSet<>(); |
| | | // Map<Integer, String> map2 = new HashMap<>(); |
| | | if (BeanUtil.isEmpty(samples.getInsProduct())) continue; |
| | | samples.setBushing(insBushingService.selectBushingBySampleId(samples.getId())); |
| | | // getTemplateThing(set, map2, samples.getInsProduct()); |
| | | } |
| | | map.put("sampleProduct", list); |
| | | return map; |
| | |
| | | } |
| | | } |
| | | |
| | | //切换记录模版查询检验内容 |
| | | @Override |
| | | public Map<String, Object> getReportModel(Integer orderId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Integer> insSampleIds = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId)).stream().map(InsSample::getId).collect(Collectors.toList()); |
| | | //先查出套管 |
| | | List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().in(InsBushing::getInsSampleId, insSampleIds)); |
| | | List<InsFibers> fibers = new ArrayList<>(); |
| | | List<InsFiber> fiber = new ArrayList<>(); |
| | | for (InsBushing insBushing : insBushings) { |
| | | //再查询出所有的光纤带 |
| | | List<InsFibers> insFibers = insFibersMapper.selectList(Wrappers.<InsFibers>lambdaQuery().eq(InsFibers::getInsBushingId, insBushing.getId())); |
| | | if (CollectionUtils.isNotEmpty(insFibers)) { |
| | | fibers.addAll(insFibers); |
| | | //查出光纤带下所有的光纤 |
| | | List<InsFiber> fiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().in(InsFiber::getInsFibersId, insFibers.stream().map(InsFibers::getId).collect(Collectors.toList()))); |
| | | fiber.addAll(fiberList); |
| | | } else { |
| | | //如果套管下没有光纤带就只有光纤了 |
| | | List<InsFiber> insFiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushing.getId())); |
| | | fiber.addAll(insFiberList); |
| | | } |
| | | } |
| | | map.put("光纤带",fibers); |
| | | map.put("光纤",fiber); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public void saveInsContext(Map<String, Object> insContext) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | |
| | | List<InsProductResult> results = insProductResultMapper.selectList(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | InsProductResult result; |
| | | if (CollectionUtils.isEmpty(results)) { |
| | | result = new InsProductResult(); |
| | | result = new InsProductResult(); |
| | | } else { |
| | | result = results.get(0); |
| | | result = results.get(0); |
| | | } |
| | | result.setInsProductId(Integer.parseInt(k)); |
| | | if (jo.get("insValue") != null) { |
| | |
| | | break; |
| | | } |
| | | } else if (value.equals("序号")) { |
| | | if(itemSet.add(p.getInspectionItem())){ |
| | | if (itemSet.add(p.getInspectionItem())) { |
| | | index.getAndIncrement(); |
| | | } |
| | | textRenderData.setText(index + ""); |
| | |
| | | @Override |
| | | public int upInsOrderOfState(InsOrder insOrder) { |
| | | insOrder.setExamineTime(LocalDateTime.now()); |
| | | String code = baseMapper.selLaboratoryCode(insOrder.getLaboratory()); |
| | | if (StringUtils.isEmpty(code)) { |
| | | code = ""; |
| | | if (insOrder.getState() == 1) { |
| | | //审核通过才会生成委托编号 |
| | | String code = baseMapper.selLaboratoryCode(insOrder.getLaboratory()); |
| | | if (StringUtils.isEmpty(code)) { |
| | | code = ""; |
| | | } |
| | | String code2 = customMapper.selectById(insOrder.getCompanyId()).getCode2(); |
| | | insOrder.setEntrustCode(giveCode.giveCode("JC/ZX" + code + "-" + code2 + "-", "ins_order", "", "yyMM")); |
| | | } |
| | | String code2 = customMapper.selectById(insOrder.getCompanyId()).getCode2(); |
| | | insOrder.setEntrustCode(giveCode.giveCode("JC/ZX" + code + "-" + code2 + "-", "ins_order", "", "yyMM")); |
| | | return insOrderMapper.updateById(insOrder); |
| | | } |
| | | |
| | |
| | | List<SampleProductDto> list = insSampleMapper.getInsOrderAndSample(id, laboratory); |
| | | map.put("insOrder", insOrder); |
| | | map.put("sampleProduct", list); |
| | | //查询所有记录模版去重 |
| | | List<Map<Integer, Object>> list2 = insOrderMapper.selectReportModelByOrderId(id, laboratory); |
| | | map.put("reportModel", list2); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | //标签打印 |
| | | @Override |
| | | public List<SampleProductDto3> labelPrinting(String ids) { |
| | | public List<SampleProductDto3> labelPrinting(String ids) { |
| | | List<Integer> list = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList()); |
| | | List<SampleProductDto3> sampleProductDtos = insSampleMapper.selectSampleProductListByOrderId3(list); |
| | | Set<String> processedCodes = new HashSet<>(); |
| | |
| | | str.setStandardMethodListId(standardMethodId); |
| | | str.setSampleType(list.get(1) + ""); |
| | | if (list.get(2) != null) { |
| | | String sample = baseMapper.selSample(list.get(2) + ""); |
| | | if (sample == null) { |
| | | throw new ErrorException("样品不存在:" + list.get(2)); |
| | | } |
| | | str.setSample(list.get(2) + ""); |
| | | } else { |
| | | str.setSample(null); |
| | |
| | | (select count(*) from ins_sample isa2 |
| | | where isa2.ins_order_id = io.id and isa2.sample_code NOT REGEXP '/' ) sample_num, |
| | | concat(ROUND((select count(*) from ins_product ip |
| | | where state = 1 and ins_result is not null and ip.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) / (select count(*) from ins_product ip2 |
| | | where state = 1 and ip2.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) * 100, 2), '%') insProgress, |
| | | where state = 1 and ins_result is not null and ip.ins_sample_id in (select id from ins_sample where |
| | | ins_sample.ins_order_id= io.id )) / (select count(*) from ins_product ip2 |
| | | where state = 1 and ip2.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) * |
| | | 100, 2), '%') insProgress, |
| | | group_concat(distinct isa.sample_code,' ') sample_code, |
| | | group_concat(distinct isa.sample,' ') sample_name, |
| | | group_concat(distinct isa.model,' ') sample_model, |
| | |
| | | from laboratory |
| | | where laboratory_name = #{laboratory} |
| | | </select> |
| | | <select id="selectReportModelByOrderId" resultType="java.util.Map"> |
| | | select distinct id, name |
| | | from standard_template |
| | | where id in (select template_id |
| | | from ins_product |
| | | where son_laboratory = #{laboratory} |
| | | and ins_sample_id in |
| | | (select id from ins_sample where ins_order_id = #{id})) |
| | | </select> |
| | | </mapper> |
| | |
| | | and state = 1 |
| | | and ins_fibers_id is null |
| | | </select> |
| | | <select id="getReportModel" resultType="java.util.Map"> |
| | | |
| | | </select> |
| | | |
| | | <resultMap id="sampleDto" type="com.yuanchu.mom.dto.SampleProductDto"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | OR sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | ) |
| | | and (laboratory is null |
| | | or laboratory='' |
| | | or laboratory = '' |
| | | or laboratory = #{laboratory}) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | |
| | | id structure_item_parameter_id |
| | | from structure_item_parameter |
| | | where sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | and (laboratory is null |
| | | or laboratory='' |
| | | or laboratory = #{laboratory}) |
| | | and (laboratory is null |
| | | or laboratory = '' |
| | | or laboratory = #{laboratory}) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | |
| | | id structure_item_parameter_id |
| | | from structure_item_parameter |
| | | where ( |
| | | sample is NULL |
| | | OR sample = '' |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%', #{tree}, '%') |
| | | ) |
| | | and (laboratory is null |
| | | or laboratory='' |
| | | or laboratory = #{laboratory}) |
| | | sample is NULL |
| | | OR sample = '' |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%', #{tree}, '%') |
| | | ) |
| | | and (laboratory is null |
| | | or laboratory = '' |
| | | or laboratory = #{laboratory}) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | |
| | | , id asc |
| | | </select> |
| | | <select id="getStandardTree3" resultType="com.yuanchu.mom.dto.SampleDto"> |
| | | select model label, |
| | | select model label, |
| | | model value |
| | | from standard_tree |
| | | where sample_type = #{sampleType} |
| | |
| | | where sto.specimen_name = #{name} |
| | | order by p.id |
| | | </select> |
| | | <select id="selSample" resultType="java.lang.String"> |
| | | select name |
| | | from product |
| | | where name = #{name} |
| | | </select> |
| | | </mapper> |