| | |
| | | |
| | | @Override |
| | | protected void addInterceptors(InterceptorRegistry registry) { |
| | | // TODO: 2024/6/4 访问swagger需关下面拦截器 |
| | | // registry.addInterceptor(fiferConfig).addPathPatterns("/**"); |
| | | // registry.addInterceptor(powerConfig).addPathPatterns("/**"); |
| | | registry.addInterceptor(logConfig).addPathPatterns("/**"); |
| | |
| | | public Result<?> doInsOrder(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsProduct") |
| | | @ApiOperation("获取检验项目和模板内容") |
| | | public Result<?> getInsProduct(Integer id, Integer type, String laboratory) { |
| | | return Result.success(insOrderPlanService.getInsProduct(id, type, laboratory)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "任务交接") |
| | | @PostMapping("/upPlanUser") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | |
| | | List<SampleProductDto> getInsOrderAndSample(Integer id, String laboratory); |
| | | |
| | | String getSampleEn(String sample); |
| | | |
| | | List<InsProduct> getInsProduct1(Integer id, String laboratory); |
| | | |
| | | List<InsProduct> getInsProduct2(Integer id); |
| | | |
| | | List<InsProduct> getInsProduct3(Integer id); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | int verifyPlan(Integer orderId, String laboratory, Integer type, String tell); |
| | | |
| | | int submitPlan(Integer orderId, String laboratory, Integer verifyUser); |
| | | |
| | | List<InsProduct> getInsProduct(Integer id, Integer type, String laboratory); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.dto.BushingDto; |
| | | import com.yuanchu.mom.dto.FiberDto; |
| | | import com.yuanchu.mom.dto.FibersDto; |
| | | import com.yuanchu.mom.mapper.InsBushingMapper; |
| | | import com.yuanchu.mom.pojo.InsBushing; |
| | |
| | | if(bushingDto.getFiber().size()==0){ |
| | | bushingDto.setFibers(insBushingMapper.selectFibersByBushingId(insBushing.getId())); |
| | | for (FibersDto fibers : bushingDto.getFibers()) { |
| | | getTemplateThing(fibers.getProductList()); |
| | | // 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()); |
| | | // for (FiberDto fiberDto : fibers.getFiber()) { |
| | | // getTemplateThing(fiberDto.getProductList()); |
| | | // } |
| | | } |
| | | } |
| | | // else{ |
| | | // for (FiberDto fiberDto : bushingDto.getFiber()) { |
| | | // getTemplateThing(fiberDto.getProductList()); |
| | | // } |
| | | // } |
| | | bushingDtos.add(bushingDto); |
| | | } |
| | | return bushingDtos; |
| | |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, id).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 1)); |
| | | } |
| | | Map<String, Object> map = insOrderService.getInsOrderAndSample(id, laboratory); |
| | | Set<Integer> set = new HashSet<>(); |
| | | Map<Integer, String> map2 = new HashMap<>(); |
| | | 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); |
| | | // getTemplateThing(set, map2, samples.getInsProduct()); |
| | | } |
| | | map.put("sampleProduct", list); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public List<InsProduct> getInsProduct(Integer id, Integer type, String laboratory) { |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | | switch (type){ |
| | | case 0: |
| | | insProducts = insSampleMapper.getInsProduct1(id, laboratory); |
| | | break; |
| | | case 1: |
| | | insProducts = insSampleMapper.getInsProduct2(id); |
| | | break; |
| | | case 2: |
| | | insProducts = insSampleMapper.getInsProduct3(id); |
| | | break; |
| | | } |
| | | Set<Integer> set = new HashSet<>(); |
| | | Map<Integer, String> map2 = new HashMap<>(); |
| | | if (BeanUtil.isEmpty(insProducts)) return null; |
| | | getTemplateThing(set, map2, insProducts); |
| | | return insProducts; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | Map<String, String> user = insProductMapper.selectUserById(insOrder.getUserId()); |
| | | List<SampleProductDto> samples = insSampleMapper.selectSampleProductListByOrderId2(orderId); |
| | | List<SampleProductDto> samples = insSampleMapper.selectSampleProductListByOrderId(orderId); |
| | | InsReport insReport = new InsReport(); |
| | | insReport.setCode(insOrder.getEntrustCode()); |
| | | insReport.setInsOrderId(orderId); |
| | |
| | | models.add(a.getModel()); |
| | | standardMethod.add(baseMapper.getStandardMethodCode(a.getStandardMethodListId())); |
| | | Set<String> templateSet = new HashSet<>(); |
| | | getTemplateThing(set, map2, a); |
| | | getTemplateThing(set, map2, a.getInsProduct()); |
| | | for (InsProduct b : a.getInsProduct()) { |
| | | if (b.getInsProductResult() != null) { |
| | | List<JSONObject> jsonObjects = JSON.parseArray(b.getInsProductResult().getEquipValue(), JSONObject.class); |
| | |
| | | } |
| | | templateSet.add(JSON.toJSONString(b.getTemplate())); |
| | | } |
| | | AtomicInteger index = new AtomicInteger(); |
| | | templateSet.forEach(tem -> { |
| | | AtomicInteger index = new AtomicInteger(); |
| | | Set<Integer> set2 = new HashSet<>(); |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | List<TextRenderData> text = new ArrayList<>(); |
| | |
| | | List<JSONObject> temp = JSON.parseArray(JSON.toJSONString(excelDtos), JSONObject.class); |
| | | Map<String, InsProduct> pMap = new HashMap<>(); |
| | | Set<String> delRSet = new HashSet<>(); |
| | | delRSet.add("0"); |
| | | delRSet.add("1"); |
| | | for (JSONObject jo1 : temp) { |
| | | JSONObject v = JSON.parseObject(JSON.toJSONString(jo1.get("v"))); |
| | | if (Integer.parseInt(jo1.get("c") + "") > 9) { |
| | |
| | | textRenderData.setText(textRenderData.getText() + "∑" + jo1.get("mc")); |
| | | } |
| | | Style style = new Style(); |
| | | style.setFontFamily(v.get("ff") == null ? "微软雅黑" : v.get("ff") + ""); |
| | | // style.setFontFamily(v.get("ff") == null ? "宋体" : v.get("ff") + ""); |
| | | style.setFontFamily("宋体"); |
| | | if (!((v.get("fc") + "").indexOf("rgb") > -1)) { |
| | | style.setColor(v.get("fc") == null ? "000000" : (v.get("fc") + "").replace("#", "")); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | maps.forEach((k, v) -> { |
| | | }); |
| | | List<String> list = new ArrayList<>(); |
| | | for (String s : maps.keySet()) { |
| | | list.add(s); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | private void getTemplateThing(Set<Integer> set, Map<Integer, String> map2, SampleProductDto a) { |
| | | for (InsProduct product : a.getInsProduct()) { |
| | | private void getTemplateThing(Set<Integer> set, Map<Integer, String> map2, List<InsProduct> insProducts) { |
| | | for (InsProduct product : insProducts) { |
| | | if (product.getTemplateId() == null) { |
| | | product.setTemplate(new ArrayList<>()); |
| | | continue; |
| | |
| | | where ins_order_id = #{id} |
| | | and state = 1 |
| | | </select> |
| | | <select id="getInsProduct1" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | </select> |
| | | <select id="getInsProduct2" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_fibers_id = #{id} |
| | | and state = 1 |
| | | and ins_fiber_id is null |
| | | </select> |
| | | <select id="getInsProduct3" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | where ins_fiber_id = #{id} |
| | | and state = 1 |
| | | and ins_fibers_id is null |
| | | </select> |
| | | |
| | | <resultMap id="sampleDto" type="com.yuanchu.mom.dto.SampleProductDto"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |