已修改35个文件
已删除33个文件
已添加2个文件
| | |
| | | import com.yuanchu.mom.dto.DataConfigDto; |
| | | import com.yuanchu.mom.dto.DeviceDto; |
| | | import com.yuanchu.mom.pojo.Device; |
| | | import com.yuanchu.mom.pojo.PkMaster; |
| | | import com.yuanchu.mom.service.DataConfigService; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.service.PkMasterService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private DataConfigService dataConfigService; |
| | | |
| | | @Autowired |
| | | private PkMasterService pkMasterService; |
| | | |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "æ¥è¯¢è®¾å¤è¯¦æ
å表") |
| | |
| | | } |
| | | |
| | | |
| | | @ValueClassify("设å¤") |
| | | @ApiOperation(value = "æ¸©åº¦å¾ªç¯æ°é") |
| | | @PostMapping("/temDataAcquisition") |
| | | public Result<?> temDataAcquisition(@RequestBody PkMaster pkMaster) { |
| | | return Result.success(pkMasterService.temDataAcquisition(pkMaster)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å·¦ä¾§è®¾å¤æ å½¢æ ") |
| | | @GetMapping("/treeDevice") |
| | | @ValueAuth |
| | |
| | | return Result.success(deviceService.treeDevice(deviceName)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¸©åº¦å¾ªç¯æ°éæ»ä½") |
| | | @PostMapping("/temDataAcquisition2") |
| | | @ValueAuth |
| | | public Result<?> temDataAcquisition2(@RequestBody PkMaster pkMaster) { |
| | | return Result.success(pkMasterService.temDataAcquisition2(pkMaster)); |
| | | } |
| | | } |
| | |
| | | <artifactId>jackson-datatype-jsr310</artifactId> |
| | | <version>2.13.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
| | |
| | | public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId,String sonLaboratory) { |
| | | return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId,sonLaboratory)); |
| | | } |
| | | |
| | | @ValueClassify("æ£éªä¸å") |
| | | @ApiOperation(value = "æ·»å æ£éªä¸åæ°æ®") |
| | | @PostMapping("/addInsOrder") |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "忢å¥ç®¡/å
纤/å
çº¤å¸¦è®°å½æ¨¡çæ¥è¯¢æ£éªå
容") |
| | | @PostMapping("/getReportModel") |
| | | @ValueAuth |
| | | public Result<?> getReportModel(Integer sampleId) { |
| | | return Result.success(insOrderPlanService.getReportModel(sampleId)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsProduct") |
| | | @ApiOperation("è·åæ£éªé¡¹ç®å模æ¿å
容") |
| | |
| | | @ValueClassify("æ£éªä»»å¡") |
| | | @ApiOperation(value = "夿 ¸æ£éªä»»å¡") |
| | | @PostMapping("/verifyPlan") |
| | | public Result<?> verifyPlan(Integer orderId, String laboratory, Integer type, String tell) { |
| | | public Result<?> verifyPlan(Integer orderId, String laboratory, Integer type, String tell) throws IOException { |
| | | return Result.success(insOrderPlanService.verifyPlan(orderId, laboratory, type, tell)); |
| | | } |
| | | |
| | |
| | | @ValueAuth |
| | | public Result<?> write(@RequestBody InsProductDto insProductDto) { |
| | | return Result.success(insProductService.write(insProductDto)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "æ¸©åº¦å¾ªç¯æ¥çåè¡¨æ°æ®(å
æ¬éè¿æ ·åid,å¾ªç¯æ¬¡æ°,温度,å¾ªç¯æ¬¡æ°è¿è¡çé)") |
| | | @PostMapping("/temCycle") |
| | | public Result<?> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass) { |
| | | return Result.success(insOrderPlanService.temCycle(sampleId, inspectionItem, inspectionItemSubclass)); |
| | | } |
| | | |
| | | @ValueClassify("æ£éªä»»å¡") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.InsReportDto; |
| | | import com.yuanchu.mom.dto.ReportPageDto; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.service.InsReportService; |
| | |
| | | return Result.success(insReportService.upAll(file)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "æ¥åºè¯¥è®¢å䏿¯ä¸ªç«ç¹ä¸çæ£éªæ¬¡æ°") |
| | | @GetMapping("/getInsOrderStateCount") |
| | | public Result getInsOrderStateCount(Integer id){ |
| | | return Result.success(insReportService.getInsOrderStateCount(id)); |
| | | } |
| | | |
| | | @ValueClassify("æ¥åç¼å¶") |
| | | @ApiOperation(value = "夿æ¯å¦çææ»æ¥å") |
| | | @PostMapping("/isReport") |
| | | public Result isReport(Integer id,Integer state) { |
| | | return Result.success(insReportService.isReport(id,state)); |
| | | public Result isReport(@RequestBody InsReportDto insReportDto) { |
| | | return Result.success(insReportService.isReport(insReportDto)); |
| | | } |
| | | } |
| | |
| | | public class SampleOrderController { |
| | | |
| | | private SampleOrderService sampleOrderService; |
| | | |
| | | @ValueAuth |
| | | @GetMapping("/list") |
| | | public Result list() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InsReportDto { |
| | | |
| | | //订åid |
| | | private Integer id; |
| | | |
| | | //çæä¸ççæ |
| | | private Integer state; |
| | | |
| | | //éæ©çæ¯ä¸ªç«ç¹çç¬¬å æ¬¡æ°æ® |
| | | private List<InsReportDto1> insReportDto1s; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InsReportDto1 { |
| | | |
| | | private String laboratory; |
| | | |
| | | private Integer num; |
| | | } |
| | |
| | | |
| | | private List<InsProduct> insProduct; |
| | | |
| | | private List<BushingDto> bushing; |
| | | |
| | | private List<SampleProductDto> childSampleList; |
| | | |
| | | private InsulatingDto insulating; |
| | |
| | | |
| | | private List<InsProduct> insProduct; |
| | | |
| | | private List<BushingDto> bushing; |
| | | |
| | | private List<SampleProductDto3> childSampleList; |
| | | |
| | | private InsulatingDto insulating; |
| | |
| | | |
| | | String getEnumLabelByValue(String value); |
| | | |
| | | String getStandardMethodCode(Integer id); |
| | | |
| | | int updateStatus( Integer id); |
| | | |
| | | String selLaboratoryCode(String laboratory); |
| | |
| | | import com.yuanchu.mom.pojo.InsOrderState; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author admin |
| | | * @description é对表ãins_order_stateãçæ°æ®åºæä½Mapper |
| | |
| | | public interface InsOrderStateMapper extends BaseMapper<InsOrderState> { |
| | | |
| | | |
| | | List<InsOrderState> getInsOrderStateCount(Integer id); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | int updateInspected(@Param("id") Integer id); |
| | | |
| | | List<InsProduct> selectFiberInsProduct(List<Integer> ids, String laboratory); |
| | | |
| | | IPage<InsProduct> selectNoProducts(Page page, Integer orderId); |
| | | |
| | | int selectInsProductCountByOrderId(int orderId); |
| | |
| | | IPage<InsOrderPlanTaskSwitchVo> inspectionOrderDetailsTaskSwitching(Page page, @Param("ew") QueryWrapper<InsOrderPlanDTO> ew, @Param("userId") Integer userId, @Param("sonLaboratory") String sonLaboratory, @Param("laboratory") String laboratory); |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId(Integer id); |
| | | List<SampleProductDto> selectSampleProductListByOrder2Id(Integer id); |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId2(Integer id); |
| | | List<SampleProductDto> selectSampleProductListByOrder2Id2(Integer id); |
| | |
| | | String selMethodById(Integer sampleId); |
| | | |
| | | List<Map<String, String>> selectSampleList(Integer orderId); |
| | | |
| | | //è¿æ»¤ææ²¡ææ£éªé¡¹ç®çæ ·å |
| | | List<InsSample> selectSampleListByOrderId(Integer orderId); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | StandardProductList getOne(Integer standardMethodListId, String inspectionItem, String sample, String inspectionItemSubclass, String model, String inspectionItemClass); |
| | | |
| | | List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model); |
| | | List<StandardProductList> selectDetail(@Param("ids") List<Integer> ids, @Param("state") int state, @Param("model") String model); |
| | | |
| | | List<StandardProductList> selectDetail2(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("tree") String tree); |
| | | List<StandardProductList> selectDetail2(@Param("ids") List<Integer> ids, @Param("state") int state, @Param("tree") String tree); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private Integer send; |
| | | |
| | | /** |
| | | * 订åç±»å(æ°æ®åå
¸) |
| | | */ |
| | | private String formType; |
| | | |
| | | @ApiModelProperty("å®¡æ ¸æ¶é´") |
| | |
| | | @ApiModelProperty("éä¿¡:ææ¯è´è´£äººå®¡æ ¸ç»æ2:ä¸éè¿;1:éè¿") |
| | | private Integer checkState3; |
| | | |
| | | @ApiModelProperty("ä¸å对象(é¤äºå
¶ä»æåå¤è¿ä¸ªå段å¿
é,ç¨äºä¼ä¸å¾®ä¿¡æ¨é)") |
| | | private Integer issueUser; |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | * 次æ°(æ£æµæ¬¡æ°) |
| | | */ |
| | | private Integer num; |
| | | |
| | | //æ£éªäºº |
| | | @TableField(exist = false,select = false) |
| | | private String userName; |
| | | |
| | | } |
| | |
| | | //湿度 |
| | | private String humidity; |
| | | |
| | | private Integer insFiberId; |
| | | |
| | | private Integer insFibersId; |
| | | |
| | | private Integer insBushId; |
| | | |
| | | private Integer standardMethodListId; |
| | | |
| | | //è¿åç20度常温ç计ç®å¼(温度循ç¯) |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | private Integer standardMethodListId; |
| | | private String standardMethodListId; |
| | | |
| | | @ApiModelProperty("æ ·ååä½") |
| | | private String unit; |
| | |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å¤é®ï¼æ£éªæ ·åins_sample表id(å®é
å
³èins_order_state表id) |
| | | * å¤é®ï¼æ£éªæ ·åins_sample表id(å®é
å
³èins_order表id) |
| | | */ |
| | | private Integer insSampleId; |
| | | |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | int upPlanUser(Integer userId, Integer orderId,String sonLaboratory); |
| | | |
| | | int verifyPlan(Integer orderId, String laboratory, Integer type, String tell); |
| | | int verifyPlan(Integer orderId, String laboratory, Integer type, String tell) throws IOException; |
| | | |
| | | int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode); |
| | | |
| | |
| | | Map<String,Object> getFileList(Page page, InsOrderFile insOrderFile); |
| | | |
| | | int uploadFile(Integer orderId, MultipartFile file); |
| | | |
| | | Map<String,Object> getReportModel(Integer sampleId); |
| | | |
| | | Map<String,Object> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass); |
| | | |
| | | List<String> upPlanUser2(Integer orderId); |
| | | |
| | |
| | | //è·åå使£éªä¸åæ°æ® |
| | | Map<String, Object> selectInsOrderParameter(IPage<InsOrder> page, SampleOrderDto sampleOrderDto); |
| | | |
| | | //ä¿®æ¹æ£éªä¸åæ°æ® |
| | | //åé
ç«ç¹ |
| | | int upInsOrder(Integer orderId,Integer sampleId, String appointed, Integer userId,String sonLaboratory); |
| | | |
| | | int addInsOrder(List<SampleProductDto> list, InsOrder insOrder, List<List<Integer>> pairing); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.dto.InsReportDto; |
| | | import com.yuanchu.mom.dto.ReportPageDto; |
| | | import com.yuanchu.mom.pojo.InsOrderState; |
| | | import com.yuanchu.mom.pojo.InsReport; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | int upAll(MultipartFile file) throws IOException; |
| | | |
| | | //æ¯å¦çææ»æ¥å |
| | | int isReport(Integer id,Integer state); |
| | | int isReport(InsReportDto insReportDto); |
| | | |
| | | //æ¥åºè¯¥è®¢å䏿¯ä¸ªç«ç¹ä¸çæ£éªæ¬¡æ° |
| | | List<InsOrderState> getInsOrderStateCount(Integer id); |
| | | } |
| | |
| | | import com.yuanchu.mom.utils.*; |
| | | import com.yuanchu.mom.vo.*; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | private String imgUrl; |
| | | |
| | | @Resource |
| | | private InsBushingService insBushingService; |
| | | |
| | | @Resource |
| | | private InsBushingMapper insBushingMapper; |
| | | |
| | | @Resource |
| | | private InsFiberMapper insFiberMapper; |
| | | |
| | | @Resource |
| | | private InsFibersMapper insFibersMapper; |
| | | |
| | | @Resource |
| | | private InsOrderFileMapper insOrderFileMapper; |
| | | |
| | | @Override |
| | |
| | | } |
| | | Map<String, Object> map = insOrderService.getInsOrderAndSample(id, laboratory); |
| | | List<SampleProductDto> list = JSON.parseArray(JSON.toJSONString(map.get("sampleProduct")), SampleProductDto.class); |
| | | for (SampleProductDto samples : list) { |
| | | if (BeanUtil.isEmpty(samples.getInsProduct())) continue; |
| | | samples.setBushing(insBushingService.selectBushingBySampleId(samples.getId())); |
| | | } |
| | | map.put("sampleProduct", list); |
| | | return map; |
| | | } |
| | |
| | | case 0: |
| | | //æ ·å |
| | | insProducts = insSampleMapper.getInsProduct1(id, laboratory); |
| | | if (insProducts.size()==0){ |
| | | if (insProducts.size() == 0) { |
| | | insProducts = insSampleMapper.getIns2Product1(id, laboratory); |
| | | } |
| | | break; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<InsProduct> getInsProduct2(Integer id, Integer type, String laboratory, HttpServletRequest request,Integer num) { |
| | | public List<InsProduct> getInsProduct2(Integer id, Integer type, String laboratory, HttpServletRequest request, Integer num) { |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | | switch (type) { |
| | | case 0: |
| | | //æ ·å |
| | | insProducts = insSampleMapper.get2InsProduct1(id, laboratory,num); |
| | | insProducts = insSampleMapper.get2InsProduct1(id, laboratory, num); |
| | | if (insProducts.size() == 0) { |
| | | throw new ErrorException("å½åæ£éªæ°æ®è¿æ²¡æä¿å,ä¿åä¹åææ°æ®åå²"); |
| | | } |
| | | break; |
| | | case 1: |
| | | //å
纤带 |
| | |
| | | } |
| | | } |
| | | |
| | | //åæ¢è®°å½æ¨¡çæ¥è¯¢æ£éªå
容 |
| | | @Override |
| | | public Map<String, Object> getReportModel(Integer sampleId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //å
æ¥åºå¥ç®¡ |
| | | List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); |
| | | List<InsFibers> fibers = new ArrayList<>(); |
| | | List<InsFiber> fiber = new ArrayList<>(); |
| | | List<InsBushing> bush = new ArrayList<>(); |
| | | for (InsBushing insBushing : insBushings) { |
| | | //åæ¥è¯¢åºææçå
纤带 |
| | | List<InsFibers> insFibers = insFibersMapper.selectList(Wrappers.<InsFibers>lambdaQuery().eq(InsFibers::getInsBushingId, insBushing.getId())); |
| | | List<InsFiber> insFiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushing.getId())); |
| | | if (CollectionUtils.isNotEmpty(insFibers)) { |
| | | for (InsFibers insFiber : insFibers) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFibersId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//å·²æ£éª |
| | | } else { |
| | | insFiber.setState(0);//æªæ£éª |
| | | } |
| | | } |
| | | fibers.addAll(insFibers); |
| | | //æ¥åºå
çº¤å¸¦ä¸ææçå
纤 |
| | | List<InsFiber> fiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().in(InsFiber::getInsFibersId, insFibers.stream().map(InsFibers::getId).collect(Collectors.toList()))); |
| | | for (InsFiber insFiber : fiberList) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//å·²æ£éª |
| | | } else { |
| | | insFiber.setState(0);//æªæ£éª |
| | | } |
| | | } |
| | | fiber.addAll(fiberList); |
| | | } |
| | | //妿å¥ç®¡ä¸æ²¡æå
çº¤å¸¦å°±åªæå
çº¤äº |
| | | else if (CollectionUtils.isNotEmpty(insFiberList)) { |
| | | for (InsFiber insFiber : insFiberList) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//å·²æ£éª |
| | | } else { |
| | | insFiber.setState(0);//æªæ£éª |
| | | } |
| | | } |
| | | fiber.addAll(insFiberList); |
| | | } |
| | | //妿å
纤带åå
çº¤é½æ²¡æå°±åªæå¥ç®¡(æ¾å¥ç®¡) |
| | | else { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsBushId, insBushing.getId())); |
| | | List<Integer> collect = insProducts.stream() |
| | | .map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insBushing.setState(1);//å·²æ£éª |
| | | } else { |
| | | insBushing.setState(0);//æªæ£éª |
| | | } |
| | | bush.add(insBushing); |
| | | } |
| | | } |
| | | map.put("å
纤带", fibers); |
| | | map.put("å
纤", fiber); |
| | | map.put("å¥ç®¡", bush); |
| | | return map; |
| | | } |
| | | |
| | | //æ¸©åº¦å¾ªç¯æ¥çåè¡¨æ°æ®(å
æ¬éè¿æ ·åid,å¾ªç¯æ¬¡æ°,温度,å¾ªç¯æ¬¡æ°è¿è¡çé) |
| | | @Override |
| | | public Map<String, Object> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //æ ·åä¿¡æ¯ |
| | | SampleVo sampleVo = insSampleMapper.getDetailById(sampleId); |
| | | map.put("sampleVo", sampleVo); |
| | | List<ProductVo> productVos = new ArrayList<>(); |
| | | //å
æ¥åºè¿ä¸ªæ ·å䏿åªäºç®¡è²æ ,å
纤带,å
çº¤è²æ |
| | | //å
æ¥åºå¥ç®¡ |
| | | List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); |
| | | if (insBushings.size() > 0) { |
| | | //éä¿¡--æ¸©åº¦å¾ªç¯ |
| | | for (InsBushing insBushing : insBushings) { |
| | | //åæ¥è¯¢åºææçå
纤带 |
| | | List<InsFibers> insFibers = insFibersMapper.selectList(Wrappers.<InsFibers>lambdaQuery().eq(InsFibers::getInsBushingId, insBushing.getId())); |
| | | if (CollectionUtils.isNotEmpty(insFibers)) { |
| | | for (InsFibers insFiber : insFibers) { |
| | | //æ¥åºå
çº¤å¸¦ä¸ææçå
纤 |
| | | List<InsFiber> fiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsFibersId, insFiber.getId())); |
| | | for (InsFiber fiber : fiberList) { |
| | | //åæ ¹æ®å
³èçå
纤é
ç½®çidåå¾ªç¯æ¬¡æ°åæ¸©åº¦åæ ·åidè¿è¡æ¥è¯¢æ£éªé¡¹ç® |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, inspectionItem) |
| | | .eq(InsProduct::getInspectionItemSubclass, inspectionItemSubclass) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())); |
| | | for (InsProduct insProduct : insProducts) { |
| | | InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery() |
| | | .eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | ProductVo productVo = new ProductVo(); |
| | | productVo.setCode(insFiber.getCode()); |
| | | productVo.setColor(fiber.getColor()); |
| | | productVo.setBushColor(insBushing.getColor()); |
| | | if (ObjectUtils.isNotEmpty(insProductResult)) { |
| | | insProduct.setInsProductResult(insProductResult); |
| | | } |
| | | //æ±åçæ¡ä»¶ä¸1次循ç¯20度常温ç计ç®å¼ |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20â(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId())); |
| | | if (ObjectUtils.isNotEmpty(insProductResult1) && !insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | | productVos.add(productVo); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | //妿å¥ç®¡ä¸æ²¡æå
çº¤å¸¦å°±åªæå
çº¤äº |
| | | List<InsFiber> insFiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushing.getId())); |
| | | for (InsFiber fiber : insFiberList) { |
| | | //åæ ¹æ®å
³èçå
纤é
ç½®çidåå¾ªç¯æ¬¡æ°åæ¸©åº¦åæ ·åidè¿è¡æ¥è¯¢æ£éªé¡¹ç® |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, inspectionItem) |
| | | .eq(InsProduct::getInspectionItemSubclass, inspectionItemSubclass) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())); |
| | | for (InsProduct insProduct : insProducts) { |
| | | InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | ProductVo productVo = new ProductVo(); |
| | | productVo.setCode("-"); |
| | | productVo.setColor(fiber.getColor()); |
| | | productVo.setBushColor(fiber.getBushColor()); |
| | | insProduct.setInsProductResult(insProductResult); |
| | | //æ±åçæ¡ä»¶ä¸1次循ç¯20度常温ç计ç®å¼ |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20â(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId())); |
| | | if (ObjectUtils.isNotEmpty(insProductResult1) && !insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | | productVos.add(productVo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | productVos = productVos.stream().sorted(Comparator.comparing(productVo -> productVo.getInsProduct().getInspectionItemClass())).collect(Collectors.toList()); |
| | | } else { |
| | | //çµå--ç循ç¯å温åè¯éª |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, inspectionItem)); |
| | | for (InsProduct insProduct : insProducts) { |
| | | InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | ProductVo productVo = new ProductVo(); |
| | | if (ObjectUtils.isNotEmpty(insProductResult)) { |
| | | insProduct.setInsProductResult(insProductResult); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | | productVos.add(productVo); |
| | | } |
| | | } |
| | | map.put("productVos", productVos); |
| | | 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()); |
| | |
| | | |
| | | |
| | | @Override |
| | | public void saveInsContext(Map<String, Object> insContext,Integer num) { |
| | | public void saveInsContext(Map<String, Object> insContext, Integer num) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | CompletableFuture.supplyAsync(() -> { |
| | | insContext.forEach((k, v) -> { |
| | |
| | | InsProduct insProduct = new InsProduct(); |
| | | insProduct.setId(Integer.parseInt(k)); |
| | | List<InsProductResult> results = insProductResultMapper.selectList(Wrappers.<InsProductResult>lambdaQuery() |
| | | .eq(InsProductResult::getNum, num) |
| | | .eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | InsProductResult result; |
| | | if (CollectionUtils.isEmpty(results)) { |
| | |
| | | insSampleMapper.updateById(insSample); |
| | | /*æ ¡éªä¸ä¸result表*/ |
| | | List<InsProductResult> insProductResults = insProductResultMapper.selectList(Wrappers.<InsProductResult>lambdaQuery() |
| | | .eq(InsProductResult::getNum, num) |
| | | .eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | if (insProductResults.size() > 1) { |
| | | for (int i = 1; i < insProductResults.size(); i++) { |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int verifyPlan(Integer orderId, String laboratory, Integer type, String tell) { |
| | | public int verifyPlan(Integer orderId, String laboratory, Integer type, String tell) throws IOException { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | List<InsUnPass> insUnPasses = new ArrayList<>(); |
| | |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | | break; |
| | | } |
| | | /*夿 ¸å®æä¹åçæä»èªå·±çç«ç¹æ¥å(ä»
éè¾å°è¯éªæ£æµ(è¿åº,è¿åº)åçµè·¯è¯éª)*/ |
| | | /*switch (laboratory) { |
| | | case "è¿åº": |
| | | uploadFile(orderId, null); |
| | | break; |
| | | case "è¿åº": |
| | | uploadFile(orderId, null); |
| | | break; |
| | | case "çµè·¯è¯éª": |
| | | uploadFile(orderId, generateExcelFile(orderId,laboratory)); |
| | | break; |
| | | default: |
| | | break; |
| | | }*/ |
| | | return 1; |
| | | } |
| | | |
| | | //çæçµè·¯è¯éªçexcelæä»¶ |
| | | private MultipartFile generateExcelFile(Integer orderId, String laboratory) throws IOException{ |
| | | // å建ä¸ä¸ªWorkbook对象 |
| | | Workbook workbook = new XSSFWorkbook(); |
| | | |
| | | // å建第ä¸ä¸ªSheet |
| | | Sheet sheet1 = workbook.createSheet("Sheet1"); |
| | | Row row1 = sheet1.createRow(0); |
| | | Cell cell1 = row1.createCell(0); |
| | | cell1.setCellValue("Hello, Sheet1"); |
| | | |
| | | // å建第äºä¸ªSheet |
| | | Sheet sheet2 = workbook.createSheet("Sheet2"); |
| | | Row row2 = sheet2.createRow(0); |
| | | Cell cell2 = row2.createCell(0); |
| | | cell2.setCellValue("Hello, Sheet2"); |
| | | |
| | | // å°Workbookåå
¥å°åèæ°ç»ä¸ |
| | | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| | | workbook.write(outputStream); |
| | | workbook.close(); |
| | | |
| | | byte[] excelBytes = outputStream.toByteArray(); |
| | | |
| | | // å建MultipartFile对象 |
| | | MultipartFile multipartFile = new MockMultipartFile( |
| | | "file", "example.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", new ByteArrayInputStream(excelBytes)); |
| | | |
| | | return multipartFile; |
| | | } |
| | | |
| | | private void getTemplateThing(Set<Integer> set, Map<Integer, String> map2, List<InsProduct> insProducts) { |
| | |
| | | .isNull(InsProduct::getInsResult) |
| | | .or() |
| | | .eq(InsProduct::getInsResult, 2) |
| | | ) |
| | | .isNull(InsProduct::getInsFiberId) |
| | | .isNull(InsProduct::getInsFibersId)); |
| | | insProducts.addAll(insProductMapper.selectFiberInsProduct(ids, laboratory)); |
| | | )); |
| | | if (insProducts.size() > 0) { |
| | | String str = ""; |
| | | int count = 0; |
| | |
| | | /*妿æ¯C类订å䏿¯ä¸åå°è´¨éé¨,åç´æ¥å¤æ ¸éè¿(ç»æè¯éª)*/ |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | if (insOrder.getOrderType().equals("C") && insOrder.getDepartmentLims().equals("è´¨éé¨")) { |
| | | verifyPlan(orderId, laboratory, 2, null); |
| | | try { |
| | | verifyPlan(orderId, laboratory, 2, null); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | //LIMSç³»ç»æ¶æ¯æ¨é |
| | |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.service.InsProductService; |
| | | import com.yuanchu.mom.utils.GiveCode; |
| | | import com.yuanchu.mom.utils.QYWXApi; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import com.yuanchu.mom.vo.SampleDefectsFatherVo; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | |
| | | PowerMapper powerMapper; |
| | | |
| | | private InsBushingMapper insBushingMapper; |
| | | |
| | | private InsFibersMapper insFibersMapper; |
| | | |
| | | private InsFiberMapper insFiberMapper; |
| | | |
| | | CustomMapper customMapper; |
| | | |
| | | QYWXApi qywxApi; |
| | | |
| | | |
| | | //è·åæ£éªä¸åæ°æ® |
| | |
| | | User user = userMapper.selectById(map1.get("userId"));//å½åç»å½ç人 |
| | | Integer roleId = user.getRoleId(); |
| | | String laboratory = null; |
| | | //è·åå½å人æå±å®éªå®¤id |
| | | /*String departLimsId = user.getDepartLimsId(); |
| | | if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //æ¥è¯¢å¯¹åºæ¶æåç§°(éä¿¡å®éªå®¤,çµåå®éªå®¤,æ£æµå) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("å®éªå®¤")) { |
| | | laboratory = departLims; |
| | | } |
| | | }*/ |
| | | //夿æ¯å¦æ¯å
¨é¨æé |
| | | Power power = powerMapper.selectOne(Wrappers.<Power>lambdaQuery().eq(Power::getRoleId, roleId).eq(Power::getMenuMethod, "selectAllInsOrderParameter")); |
| | | if (ObjectUtils.isEmpty(power)) { |
| | |
| | | insSampleMapper.insert(a); |
| | | //æ ·åçæ£éªé¡¹ç® |
| | | if (ObjectUtil.isNotEmpty(a.getInsProduct())) { |
| | | addInsProductMethod(a.getId(), a.getInsProduct(), null, 0); |
| | | addInsProductMethod(a.getId(), a.getInsProduct()); |
| | | } |
| | | //æ ·åçæ£éªæ å |
| | | if (ObjectUtil.isNotEmpty(a.getInsulating())) { |
| | |
| | | for (InsProduct product : ip2) { |
| | | product.setStandardMethodListId(a.getInsulating().getStandardMethodListId()); |
| | | } |
| | | addInsProductMethod(a.getId(), ip2, null, 0); |
| | | addInsProductMethod(a.getId(), ip2); |
| | | } |
| | | //æ ·åçæ£éªæ å |
| | | if (ObjectUtil.isNotEmpty(a.getSheath())) { |
| | | for (InsProduct product : a.getSheath().getInsProduct()) { |
| | | product.setStandardMethodListId(a.getSheath().getStandardMethodListId()); |
| | | } |
| | | addInsProductMethod(a.getId(), a.getSheath().getInsProduct(), null, 0); |
| | | addInsProductMethod(a.getId(), a.getSheath().getInsProduct()); |
| | | } |
| | | //åæ ·åé
ç½® |
| | | if (ObjectUtil.isNotEmpty(a.getChildSampleList())) { |
| | |
| | | } |
| | | insSampleMapper.insert(b); |
| | | if (ObjectUtil.isNotEmpty(b.getInsProduct())) { |
| | | addInsProductMethod(b.getId(), b.getInsProduct(), null, 0); |
| | | addInsProductMethod(b.getId(), b.getInsProduct()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //å
纤é
ç½® |
| | | /*if (ObjectUtil.isEmpty(a.getInsProduct()) && ObjectUtil.isNotEmpty(a.getBushing())) { |
| | | for (BushingDto bushingDto : a.getBushing()) { |
| | | bushingDto.setInsSampleId(a.getId()); |
| | | insBushingMapper.insert(bushingDto); |
| | | if (bushingDto.getFiber().size() != 0) { |
| | | for (FiberDto fiberDto : bushingDto.getFiber()) { |
| | | fiberDto.setInsBushingId(bushingDto.getId()); |
| | | insFiberMapper.insert(fiberDto); |
| | | addInsProductMethod(a.getId(), fiberDto.getProductList(), fiberDto.getId(), 2); |
| | | } |
| | | } else { |
| | | for (FibersDto fibersDto : bushingDto.getFibers()) { |
| | | fibersDto.setInsBushingId(bushingDto.getId()); |
| | | fibersDto.setCode(this.giveCode.giveCode("", "ins_fibers", "", "yyMMdd")); |
| | | insFibersMapper.insert(fibersDto); |
| | | for (FiberDto fiberDto : fibersDto.getFiber()) { |
| | | fiberDto.setInsFibersId(fibersDto.getId()); |
| | | insFiberMapper.insert(fiberDto); |
| | | addInsProductMethod(a.getId(), fiberDto.getProductList(), fiberDto.getId(), 2); |
| | | } |
| | | addInsProductMethod(a.getId(), fibersDto.getProductList(), fibersDto.getId(), 1); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | }); |
| | | //å¤ä¸ªæ ·åå°±æ¼æ¥ |
| | | /*for (List<Integer> i : pairing) { |
| | | SampleProductDto sample = JSON.parseObject(JSON.toJSONString(list.get(i.get(0) - 1)), SampleProductDto.class); |
| | | sample.setSampleCode(list.get(i.get(0) - 1).getSampleCode() + "/" + list.get(i.get(1) - 1).getSampleCode()); |
| | | sample.setId(null); |
| | | insSampleMapper.insert(sample); |
| | | try { |
| | | List<InsProduct> insProducts = sample.getInsProduct().stream().filter(a -> Objects.equals(a.getInspectionItem(), "å
纤æ¥å¤´æè")).collect(Collectors.toList()); |
| | | for (InsProduct insProduct : insProducts) { |
| | | insProduct.setId(null); |
| | | insProduct.setInsSampleId(sample.getId()); |
| | | insProductMapper.insert(insProduct); |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | }*/ |
| | | //éä¿¡:妿æ¯Cç±»è®¢åæ éå®¡æ ¸ç´æ¥éè¿ |
| | | if (insOrder.getOrderType().equals("C")) { |
| | | insOrder.setState(1); |
| | |
| | | return insOrder.getId(); |
| | | } |
| | | |
| | | private void addInsProductMethod(Integer sampleId, List<InsProduct> productList, Integer id, Integer type) { |
| | | private void addInsProductMethod(Integer sampleId, List<InsProduct> productList) { |
| | | for (InsProduct product : productList) { |
| | | if (product.getState() == 1 ) { |
| | | switch (type) { |
| | | case 1: |
| | | product.setInsFibersId(id); |
| | | break; |
| | | case 2: |
| | | product.setInsFiberId(id); |
| | | break; |
| | | } |
| | | if (product.getState() == 1) { |
| | | product.setId(null); |
| | | product.setCreateTime(null); |
| | | product.setCreateUser(null); |
| | |
| | | } |
| | | } |
| | | |
| | | //温度循ç¯çå¤ç |
| | | private void dealWithTemperatureLoop(Integer type, Integer id, Integer sampleId, InsProduct product) { |
| | | List<InsProduct> insProductes = new ArrayList<>(); |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | | String[] strings = product.getAsk().split(";"); |
| | | for (int i = 0; i < strings.length; i++) { |
| | | int count = Integer.parseInt(strings[strings.length - 1]); |
| | | if (i != strings.length - 1) { |
| | | InsProduct insProduct = new InsProduct(); |
| | | switch (type) { |
| | | case 1: |
| | | insProduct.setInsFibersId(id); |
| | | break; |
| | | case 2: |
| | | insProduct.setInsFiberId(id); |
| | | break; |
| | | } |
| | | String[] split = strings[i].split(","); |
| | | if (split[0].equals("20â")) { |
| | | insProduct.setInspectionItem(count + "");//æ£éªé¡¹--å¾ªç¯æ¬¡æ° |
| | | } else { |
| | | insProduct.setInspectionItem("1");//æ£éªé¡¹--å¾ªç¯æ¬¡æ° |
| | | } |
| | | insProduct.setInspectionItemSubclass(split[0]);//æ£éªé¡¹--温度 |
| | | insProduct.setInspectionItemClass(split[1]);//æ£éªé¡¹--å
çº¤é¡¹ç® |
| | | insProduct.setAsk(split[2]);//æ£éªè¦æ± |
| | | insProduct.setTell(strings[i]);//æ£éªæè¿° |
| | | insProduct.setInsSampleId(sampleId); |
| | | insProduct.setState(1); |
| | | insProduct.setFactory(product.getFactory()); |
| | | insProduct.setLaboratory(product.getLaboratory()); |
| | | insProduct.setSampleType(product.getSampleType()); |
| | | insProduct.setSample(product.getSample()); |
| | | insProduct.setModel(product.getModel()); |
| | | insProduct.setSonLaboratory(product.getSonLaboratory()); |
| | | insProduct.setUnit(product.getUnit()); |
| | | insProduct.setManHourGroup(product.getManHourGroup()); |
| | | insProduct.setInspectionItemType("0"); |
| | | insProduct.setInspectionValueType("1"); |
| | | insProducts.add(insProduct); |
| | | insProductes.add(insProduct); |
| | | } else { |
| | | //æåä¸ä¸ªæ°æ®æ¯è¯´æä¼å¾ªç¯å¤å°æ¬¡ |
| | | if (count > 1) { |
| | | //循ç¯è¶
è¿1次 |
| | | for (int j = 2; j <= count; j++) { |
| | | for (InsProduct insProduct : insProducts) { |
| | | if (!insProduct.getInspectionItemSubclass().equals("20â") && !insProduct.getInspectionItemSubclass().equals("20â(常温)")) { |
| | | InsProduct insProduct1 = new InsProduct(); |
| | | BeanUtils.copyProperties(insProduct, insProduct1); |
| | | insProduct1.setInspectionItem(j + ""); |
| | | insProductes.add(insProduct1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | insProductService.saveBatch(insProductes); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getInsOrder(Integer id) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById(id); |
| | | List<SampleProductDto> list = insSampleMapper.selectSampleProductListByOrderId2(id); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | list = insSampleMapper.selectSampleProductListByOrder2Id2(id); |
| | | } |
| | | map.put("insOrder", insOrder); |
| | |
| | | System.out.println("=============" + custom.getCompany()); |
| | | System.out.println("-------------" + order.getCompany()); |
| | | insOrder.setEntrustCode(giveCode.giveCode2("TXJC-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMMdd")); |
| | | //ç³»ç»æ¥è¯¢ç«ç¹ä»»å¡å叿
åµ,å°æ£éªä»»å¡ä¸åè³æå°çç«å° |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery() |
| | | .eq(InsSample::getInsOrderId, insOrder.getId()).select(InsSample::getId)); |
| | | List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getState, 1) |
| | | .in(InsProduct::getInsSampleId, ids)); |
| | | List<String> collect = insProducts.stream().map(InsProduct::getSonLaboratory).distinct().collect(Collectors.toList()); |
| | | //è¦å¤æå©ä½è¯éªå®¤ä¸åªä¸ªæç©ºé²å°±å®æç»åªä¸ª |
| | | Map<String, Long> dataCounts = new HashMap<>(); |
| | | for (String sonLaboratory : collect) { |
| | | Long count = insOrderStateMapper.selectCount(Wrappers.<InsOrderState>lambdaQuery() |
| | | .eq(InsOrderState::getLaboratory, sonLaboratory) |
| | | .ne(InsOrderState::getInsState, 4) |
| | | .ne(InsOrderState::getInsState, 5) |
| | | .ne(InsOrderState::getInsState, 6)); |
| | | dataCounts.put(sonLaboratory, count); |
| | | } |
| | | // æ¥æ¾æ°æ®éæå°çå
ç´ |
| | | String minElement = null; |
| | | Long minCount = Long.MAX_VALUE; |
| | | for (Map.Entry<String, Long> entry : dataCounts.entrySet()) { |
| | | if (entry.getValue() < minCount) { |
| | | minCount = entry.getValue(); |
| | | minElement = entry.getKey(); |
| | | } |
| | | } |
| | | int day = insProductService.selectOrderManDay(insOrder.getId());//é¢è®¡å®ææ¶é´ |
| | | upInsOrder(insOrder.getId(), null, LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")), null, minElement); |
| | | //ç¡®å®è®¢åçä¸åæ¶é´åçº¦å®æ¶é´ |
| | | insOrder.setAppointed(LocalDate.parse(LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); |
| | | insOrder.setSendTime(LocalDateTime.now()); |
| | | /*todo æ ¹æ®è®¢åç±»å夿æ¯å¦éè¦æ¨éä¼ä¸å¾®ä¿¡ @zss*/ |
| | | if (!order.getFormType().equals("å
¶ä»æå")) { |
| | | /* HashMap<String, Object> map = new HashMap<>(); |
| | | String account = userMapper.selectById(order.getIssueUser()).getAccount(); |
| | | map.put("touser", account);//æ¥æ¶æ¶æ¯æåçè´¦å·'ZT-031292'è¿ç§ç±»å(妿æå¤ä¸ªç¨'|'åé) |
| | | map.put("toparty", "");//æ¥æ¶é¨é¨id |
| | | map.put("totag", "");//æ¶æ¯æ ç¾id |
| | | map.put("msgtype", "text");//æ¶æ¯ç±»å text:ææ¬ |
| | | map.put("agentid", 1000513);//åºç¨id |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("content", "æ¨æä¸æ¡è®¢åéçææ£éª,请åå¾LIMSç³»ç»æ¥çã<a href=\"http://10.1.13.77/enter\"> </a>"); |
| | | map.put("text", JSONArray.toJSONString(hashMap));//æ¶æ¯å
容 |
| | | map.put("safe", 0);//æ¯å¦ä¿å¯æ¶æ¯.0å¦ |
| | | map.put("enable_id_trans", 0);//æ¯å¦å¼å¯id转è¯.0å¦ |
| | | map.put("enable_duplicate_check", 0);//æ¯å¦å¼å¯é夿¶æ¯æ£æ¥.0å¦ |
| | | qywxApi.send(map);*/ |
| | | } |
| | | } |
| | | return insOrderMapper.updateById(insOrder); |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById2(id); |
| | | List<SampleProductDto> list = insSampleMapper.getInsOrderAndSample(id, laboratory); |
| | | if (list.size()==0){ |
| | | list=insSampleMapper.getInsOrderAndSample2(id, laboratory); |
| | | if (list.size() == 0) { |
| | | list = insSampleMapper.getInsOrderAndSample2(id, laboratory); |
| | | } |
| | | for (SampleProductDto sampleProductDto : list) { |
| | | List<Integer> ids = sampleProductDto.getInsProduct().stream().map(InsProduct::getId).collect(Collectors.toList()); |
| | |
| | | import com.itextpdf.text.pdf.PdfStamper; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.InsReportDto; |
| | | import com.yuanchu.mom.dto.InsReportDto1; |
| | | import com.yuanchu.mom.dto.ReportPageDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | |
| | | private InsOrderMapper insOrderMapper; |
| | | |
| | | @Resource |
| | | private StandardMethodListMapper standardMethodListMapper; |
| | | |
| | | @Resource |
| | | private InsOrderStateMapper insOrderStateMapper; |
| | | |
| | | @Resource |
| | | private InsProductMapper insProductMapper; |
| | | |
| | | @Resource |
| | | private InsProductResultMapper insProductResultMapper; |
| | | |
| | | @Resource |
| | | private InsProductResult2Mapper insProductResult2Mapper; |
| | | |
| | | @Resource |
| | | private InsSampleMapper insSampleMapper; |
| | |
| | | //æ¯å¦éè¦çææ¥å: 0ä¸éè¦;1éè¦ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int isReport(Integer id, Integer state) { |
| | | public int isReport(InsReportDto insReportDto) { |
| | | //å
å¤æè¯¥è®¢åæ¯å¦å¯ä»¥å»ç产æ¥å |
| | | Long count = insOrderStateMapper.selectCount(Wrappers.<InsOrderState>lambdaQuery().eq(InsOrderState::getInsOrderId, id).eq(InsOrderState::getInsState, 5)); |
| | | Long count = insOrderStateMapper.selectCount(Wrappers.<InsOrderState>lambdaQuery().eq(InsOrderState::getInsOrderId, insReportDto.getId()).eq(InsOrderState::getInsState, 5)); |
| | | if (count > 0) { |
| | | if (state == 1) { |
| | | generateReport(id); |
| | | if (insReportDto.getState() == 1) { |
| | | generateReport(insReportDto.getId(), insReportDto.getInsReportDto1s()); |
| | | } else { |
| | | //ç»æè®¢å |
| | | InsOrder insOrder = new InsOrder(); |
| | | insOrder.setId(id); |
| | | insOrder.setId(insReportDto.getId()); |
| | | insOrder.setState(4); |
| | | insOrderMapper.updateById(insOrder); |
| | | } |
| | |
| | | throw new ErrorException("该订åè¿æªç»æè¯éª,æ æ³ç产æ¥å!"); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //æ¥åºè¯¥è®¢å䏿¯ä¸ªç«ç¹ä¸çæ£éªæ¬¡æ° |
| | | @Override |
| | | public List<InsOrderState> getInsOrderStateCount(Integer id) { |
| | | List<InsOrderState> insOrderStates = insOrderStateMapper.getInsOrderStateCount(id); |
| | | return insOrderStates; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | //çææ¥å |
| | | private void generateReport(Integer orderId) { |
| | | private void generateReport(Integer orderId, List<InsReportDto1> insReportDto1s) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | //å§æé¨é¨ departLims |
| | | String departLims = userMapper.selectDepartLims(insOrder.getPrepareUser()); |
| | | //samplesæ¯è¿æ»¤ææ²¡ææ£éªé¡¹ç®çæ ·å |
| | | List<SampleProductDto> samples = insSampleMapper.selectSampleProductListByOrderId(orderId); |
| | | if (samples.size()==0){ |
| | | samples=insSampleMapper.selectSampleProductListByOrder2Id(orderId); |
| | | } |
| | | String sampleCode = samples.get(0).getSampleCode(); |
| | | InsReport insReport = new InsReport(); |
| | | insReport.setCode(insOrder.getEntrustCode()); |
| | |
| | | String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; |
| | | samples.forEach(s -> { |
| | | models.add(s.getModel()); |
| | | standardMethod.add(insOrderMapper.getStandardMethodCode(s.getStandardMethodListId())); |
| | | standardMethod.addAll(standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery() |
| | | .in(StandardMethodList::getId,Arrays.stream(s.getStandardMethodListId().replaceAll("[\\[\\]]", "").split(",")) |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()))).stream().map(StandardMethodList::getCode).distinct().collect(Collectors.toList())); |
| | | //æ»æ° |
| | | Long productCount = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsSampleId, s.getId())); |
| | | Long productCount = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId())); |
| | | productSize.set(productSize.get() + Integer.parseInt(productCount + "")); |
| | | //ä¸å¤å® |
| | | Long productCount1 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId()) |
| | | .eq(InsProduct::getInsResult,3)); |
| | | .eq(InsProduct::getInsResult, 3)); |
| | | productSize1.set(productSize1.get() + Integer.parseInt(productCount1 + "")); |
| | | //ä¸åæ ¼ |
| | | Long productCount2 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId()) |
| | | .eq(InsProduct::getInsResult,0)); |
| | | .eq(InsProduct::getInsResult, 0)); |
| | | productSize2.set(productSize2.get() + Integer.parseInt(productCount2 + "")); |
| | | //åæ ¼ |
| | | Long productCount3 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId()) |
| | | .eq(InsProduct::getInsResult,1)); |
| | | .eq(InsProduct::getInsResult, 1)); |
| | | productSize3.set(productSize3.get() + Integer.parseInt(productCount3 + "")); |
| | | for (InsProduct b : s.getInsProduct()) { |
| | | if (b.getInsProductResult() != null) { |
| | | List<JSONObject> jsonObjects = JSON.parseArray(b.getInsProductResult().getEquipValue(), JSONObject.class); |
| | | //å°é¡¹ç®æç
§ç«ç¹è¿è¡åç±» |
| | | Map<String, List<InsProduct>> listMap = s.getInsProduct().stream().collect(Collectors.groupingBy(InsProduct::getLaboratory)); |
| | | // å建ä¸ä¸ª Map å°ç«ç¹å项ç®IDçæ å°å
³ç³» |
| | | Map<String, Set<Integer>> labToDeviceMap = new HashMap<>(); |
| | | // è·åææç«ç¹ç项ç®ID å表 |
| | | for (Map.Entry<String, List<InsProduct>> entry : listMap.entrySet()) { |
| | | Set<Integer> deviceIds = entry.getValue().stream() |
| | | .map(InsProduct::getId) |
| | | .collect(Collectors.toSet()); |
| | | labToDeviceMap.put(entry.getKey(), deviceIds); |
| | | } |
| | | for (InsReportDto1 insReportDto1 : insReportDto1s) { |
| | | String laboratory = insReportDto1.getLaboratory(); |
| | | if (!labToDeviceMap.containsKey(laboratory)) { |
| | | continue; |
| | | } |
| | | Set<Integer> deviceIds = labToDeviceMap.get(laboratory); |
| | | Integer num = insReportDto1.getNum(); |
| | | List<InsProductResult> insProductResults = insProductResultMapper.selectList( |
| | | Wrappers.<InsProductResult>lambdaQuery() |
| | | .eq(InsProductResult::getNum, num) |
| | | .in(InsProductResult::getInsProductId, deviceIds)); |
| | | for (InsProductResult insProductResult : insProductResults) { |
| | | List<JSONObject> jsonObjects = JSON.parseArray(insProductResult.getEquipValue(), JSONObject.class); |
| | | for (JSONObject jsonObject : jsonObjects) { |
| | | if (!"".equals(jsonObject.get("v") + "")) { |
| | | deviceSet.add(jsonObject.get("v") + ""); |
| | | String value = jsonObject.getString("v"); |
| | | if (value != null && !value.isEmpty()) { |
| | | deviceSet.add(value); |
| | | } |
| | | } |
| | | } |
| | | if (b.getInsProductResult2() != null) { |
| | | for (InsProductResult2 jsonObject : b.getInsProductResult2()) { |
| | | if (jsonObject.getEquipValue() != null) { |
| | | deviceSet.add(jsonObject.getEquipValue()); |
| | | } |
| | | List<InsProductResult2> insProductResult2s = insProductResult2Mapper.selectList( |
| | | Wrappers.<InsProductResult2>lambdaQuery() |
| | | .eq(InsProductResult2::getNum, num) |
| | | .in(InsProductResult2::getInsProductId, deviceIds)); |
| | | for (InsProductResult2 result2 : insProductResult2s) { |
| | | String equipValue = result2.getEquipValue(); |
| | | if (equipValue != null && !equipValue.isEmpty()) { |
| | | deviceSet.add(equipValue); |
| | | } |
| | | } |
| | | } |
| | |
| | | public Map<String, Object> pageInsUnPass(Page page, UnPassPageDto unPassPageDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(UnPassPageDto.class)); |
| | | // Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("pageInsUnPass"); |
| | | // if (map1.get("look") == 1) unPassPageDto.setCreateUser(map1.get("userId")); |
| | | map.put("body", insUnPassMapper.pageInsUnPass(page, QueryWrappers.queryWrappers(unPassPageDto))); |
| | | return map; |
| | | } |
| | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | String[] models = insSample.getModel().split("-(?=[^-]*$)");//æåæåä¸ä¸ªã-ã |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); |
| | | List<Integer> ids = Arrays.stream(insSample.getStandardMethodListId().split(",")) |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()); |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(ids, 1, models[0]); |
| | | if (list.size() == 0) { |
| | | if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { |
| | | return null; |
| | | } |
| | | String[] split = insSample.getFactory().split(" - "); |
| | | String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree); |
| | | list = standardProductListMapper.selectDetail2(ids, 1, tree); |
| | | if (list.size() == 0) { |
| | | String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3]; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1); |
| | | list = standardProductListMapper.selectDetail2(ids, 1, tree1); |
| | | } |
| | | } |
| | | String[] split1 = insSample.getFactory().split(" - "); |
| | |
| | | <result column="name" property="name"/> |
| | | <result column="create_time" property="create_time"/> |
| | | </resultMap> |
| | | <select id="selectInsOrderParameter" resultType="com.yuanchu.mom.pojo.InsOrder"> |
| | | select * |
| | | from ( |
| | | select |
| | | id, |
| | | appointed, |
| | | user_id, |
| | | create_user, |
| | | otc_code, |
| | | code, |
| | | custom, |
| | | update_user, |
| | | update_time, |
| | | type, |
| | | entrust_code, |
| | | company, |
| | | remark, |
| | | create_time, |
| | | state |
| | | from ins_order |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getLaboratoryCode" resultType="java.lang.String"> |
| | | select laboratory_number |
| | | from laboratory |
| | |
| | | select label |
| | | from `center-lims`.enums |
| | | where value = #{value} |
| | | </select> |
| | | <select id="getStandardMethodCode" resultType="java.lang.String"> |
| | | select code |
| | | from `center-lims`.standard_method |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selLaboratoryCode" resultType="java.lang.String"> |
| | | select laboratory_code |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.InsOrderStateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsOrderState"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sort" column="sort" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="sortTime" column="sort_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sort" column="sort" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="sortTime" column="sort_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | ins_state,create_user,create_time, |
| | | update_user,update_time,sort,sort_time |
| | | </sql> |
| | | <select id="getInsOrderStateCount" resultType="com.yuanchu.mom.pojo.InsOrderState"> |
| | | select distinct ios.*,userName |
| | | from ins_order_state ios |
| | | LEFT JOIN ( |
| | | SELECT ins_sample_id,GROUP_CONCAT( DISTINCT uu.name SEPARATOR ',') AS userName |
| | | FROM ins_sample_user u LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state=0 |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id |
| | | ) isu ON isu.ins_sample_id = ios.ins_order_id |
| | | where ios.ins_order_id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsProduct"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemClassify" column="inspection_item_classify" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemClass" column="inspection_item_class" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | |
| | | where ip.ins_sample_id = #{sampleId} |
| | | |
| | | and template_id is not null |
| | | </select> |
| | | <select id="selectFiberInsProduct" resultType="com.yuanchu.mom.pojo.InsProduct"> |
| | | select * from ins_product |
| | | where state = 1 |
| | | and (ins_fibers_id is not null or ins_fiber_id is not null) |
| | | and ins_result is null |
| | | and son_laboratory = #{laboratory} |
| | | and ins_sample_id in |
| | | <foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectNoProducts" resultType="com.yuanchu.mom.pojo.InsProduct"> |
| | | select * |
| | |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | select * from(select * from( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user,ios.id orderStateId,ios.create_time,ios.sort,sort_time,version,ios.num num1 |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user,ios.id |
| | | orderStateId,ios.create_time,ios.sort,sort_time,version,ios.num-1 num1 |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | |
| | | <select id="selectSampleProductListByOrderId" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | 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, |
| | | 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, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | 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, |
| | | 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, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | 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 |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ios.laboratory = #{laboratory} |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | | and (ipr.num = ios.num or ipr.num is null) |
| | | and isa.id in (select id1 |
| | | from (select is2.id id1, ip.id |
| | | from ins_sample is2 |
| | | left join ins_product ip on is2.id = |
| | | ip.ins_sample_id |
| | | where ip.id is not null) s) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | | else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 妿以æ°åå¼å¤´ï¼åæç
§æ°åå¤§å°æåº |
| | | WHEN man_hour_group REGEXP '[0-9]+' |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- æå忝åé¢çæ°åé¨å |
| | | , id asc |
| | | </select> |
| | | <select id="selectSampleProductListByOrder2Id" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | 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, |
| | | tell, |
| | | `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, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | 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 |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ios.laboratory = #{laboratory} |
| | | and isa.id in (select id1 |
| | | from (select is2.id id1, ip.id |
| | | from ins_sample is2 |
| | |
| | | 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 |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | |
| | | 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 |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | order by ipr.id, ipr2.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 |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | and ipr2.num = #{num} |
| | | and ipr.num = #{num} |
| | | and (ipr2.num = #{num} or ipr.num = #{num}) |
| | | order by ipr.id, ipr2.id |
| | | </select> |
| | | |
| | |
| | | <result property="lastValue" column="last_value" jdbcType="VARCHAR"/> |
| | | <result property="insResult" column="ip_ins_result" jdbcType="INTEGER"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="insBushId" column="ins_bush_id" jdbcType="INTEGER"/> |
| | | <result property="insSampleId" column="ins_sample_id" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="ip_create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="ip_update_user" jdbcType="INTEGER"/> |
| | |
| | | where ins_order_id = #{orderId} |
| | | and ip.id is not null |
| | | </select> |
| | | <select id="selectSampleListByOrderId" resultType="com.yuanchu.mom.pojo.InsSample"> |
| | | select DISTINCT ins_sample.* |
| | | from ins_sample |
| | | left join ins_product ip on ins_sample.id = ip.ins_sample_id |
| | | where ins_order_id = #{orderId} |
| | | and ip.id is not null |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | <select id="selectDetail" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | where standard_method_list_id in |
| | | <foreach item="id" index="index" collection="ids" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | and state =#{state} |
| | | and model=#{model} |
| | | order by case when man_hour_group is NULL then 1 |
| | |
| | | </select> |
| | | <select id="selectDetail2" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | where standard_method_list_id in |
| | | <foreach item="id" index="index" collection="ids" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | and state =#{state} |
| | | and tree =#{tree} |
| | | order by case when man_hour_group is NULL then 1 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.pojo.Role; |
| | | import com.yuanchu.mom.service.PowerService; |
| | | import com.yuanchu.mom.service.RoleService; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | RolePowerDto powers = JSON.parseObject(str, RolePowerDto.class); |
| | | return Result.success(roleService.upRole(powers)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "æ¥çå½åç¨æ·çè§è²") |
| | | @GetMapping("/getRole") |
| | | public Result<?> getRole() { |
| | | return Result.success(roleService.getRole()); |
| | | } |
| | | } |
| | |
| | | |
| | | int upRole(RolePowerDto rolePowerDto); |
| | | |
| | | String getRole(); |
| | | } |
| | |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.mapper.PowerMapper; |
| | | import com.yuanchu.mom.mapper.RoleMapper; |
| | | import com.yuanchu.mom.mapper.UserMapper; |
| | | import com.yuanchu.mom.pojo.Menu; |
| | | import com.yuanchu.mom.pojo.Power; |
| | | import com.yuanchu.mom.pojo.Role; |
| | |
| | | private PowerMapper powerMapper; |
| | | |
| | | private GetLook getLook; |
| | | private UserMapper userMapper; |
| | | |
| | | @Override |
| | | public List<Role> selectList() { |
| | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public String getRole() { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | Integer roleId = userMapper.selectById(userId).getRoleId(); |
| | | Role role = roleMapper.selectById(roleId); |
| | | return role.getName(); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<User> getUserMenu() { |
| | | List<Integer> roleIds = roleMapper.selectList(Wrappers.<Role>lambdaQuery() |
| | | .ne(Role::getCategory, 10003).or(wrapper -> wrapper.isNull(Role::getCategory))).stream().map(Role::getId).distinct().collect(Collectors.toList()); |
| | | return userMapper.selectList(Wrappers.<User>lambdaQuery() |
| | | .in(User::getRoleId, roleIds) |
| | | .eq(User::getState, 1).select(User::getName, User::getId)); |
| | | } |
| | | |