cnas-server/src/main/java/com/yuanchu/mom/pojo/StructureItemParameter.java
@@ -77,7 +77,7 @@ private Double manHour; @ValueTableShow(7) @ApiModelProperty(value = "é¢è®¡æ¶é´(天)") @ApiModelProperty(value = "é¢è®¡æ¶é´(H)") private Integer manDay; @ValueTableShow(8) framework/src/main/java/com/yuanchu/mom/mapper/SystemLogMapper.java
@@ -25,5 +25,8 @@ @Select("select coalesce(count(id), 0) from ${tableName} where examine_time like concat('%', #{date}, '%')") int countRowsByNow2(String tableName, String date); @Select("select coalesce(count(id), 0) from ${tableName} where examine_time like concat('%', #{date}, '%') and laboratory=#{laboratory} and company_id=#{companyId}") int countRowsByNow3(String tableName, Long companyId, String laboratory, String date); } framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java
@@ -13,19 +13,31 @@ @Resource private SystemLogMapper systemLogMapper; public String giveCode(String code, String tableName, String symbol, String patten){ 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; if (tableName.equals("ins_order")){ 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; } 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 code + (date2==null?date:date2) + symbol + nums; if (nums.length() == 1) nums = "00" + num; else if (nums.length() == 2) nums = "0" + num; return code + (date2 == null ? date : date2) + symbol + nums; } //æ£éªåå§æåå·ççæè§å public String giveCode2(String code, Long companyId, String laboratory, String tableName, String symbol, String patten) { String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); int num; num = systemLogMapper.countRowsByNow3(tableName, companyId, laboratory, 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 code + (date2 == null ? date : date2) + symbol + nums; } } inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
@@ -80,7 +80,7 @@ @ValueAuth public Result<?> selectOrderManDay(Integer id) { int day = insProductService.selectOrderManDay(id); return Result.success("æå", LocalDateTime.now().plusDays(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); return Result.success("æå", LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); } @ApiOperation(value = "æ¥è¯¢æ£éªä¸åå 容详æ ") inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderPlanController.java
@@ -5,9 +5,11 @@ import com.yuanchu.mom.annotation.ValueAuth; import com.yuanchu.mom.annotation.ValueClassify; import com.yuanchu.mom.dto.InsOrderPlanDTO; import com.yuanchu.mom.dto.InsProductDto; import com.yuanchu.mom.pojo.InsOrderFile; import com.yuanchu.mom.service.InsOrderFileService; import com.yuanchu.mom.service.InsOrderPlanService; import com.yuanchu.mom.service.InsProductService; import com.yuanchu.mom.utils.JackSonUtil; import com.yuanchu.mom.vo.Result; import io.swagger.annotations.Api; @@ -34,6 +36,8 @@ private InsOrderPlanService insOrderPlanService; private InsOrderFileService insOrderFileService; private InsProductService insProductService; @ValueClassify("æ£éªä»»å¡") @ApiOperation(value = "è·åæ£éªä»»å¡å表") @@ -71,8 +75,9 @@ @ApiOperation(value = "忢å 纤/å çº¤å¸¦è®°å½æ¨¡çæ¥è¯¢æ£éªå 容") @PostMapping("/getReportModel") public Result<?> getReportModel(Integer orderId) { return Result.success(insOrderPlanService.getReportModel(orderId)); @ValueAuth public Result<?> getReportModel(Integer sampleId) { return Result.success(insOrderPlanService.getReportModel(sampleId)); } @ValueAuth @@ -155,4 +160,11 @@ map.put("fileUrl", insOrderFile.getFileUrl()); return Result.success(map); } @ApiOperation(value = "填忏©åº¦ä¸æ¹¿åº¦") @PostMapping("/write") @ValueAuth public Result<?> write(@RequestBody InsProductDto insProductDto) { return Result.success(insProductService.write(insProductDto)); } } inspect-server/src/main/java/com/yuanchu/mom/dto/InsProductDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ package com.yuanchu.mom.dto; import lombok.Data; import java.util.List; @Data public class InsProductDto { private List<Integer> ids; private String temperature; private String humidity; } inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProduct.java
@@ -14,9 +14,10 @@ /** * æ£éªé¡¹ç® * * @TableName ins_product */ @TableName(value ="ins_product") @TableName(value = "ins_product") @Data public class InsProduct implements Serializable { /** @@ -150,7 +151,9 @@ */ private String ask; /**è¦æ±æè¿°*/ /** * è¦æ±æè¿° */ private String tell; /** @@ -208,6 +211,10 @@ private String templateName; private String dic; //温度 private String temperature; //湿度 private String humidity; private Integer insFiberId; inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderPlanService.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yuanchu.mom.dto.InsOrderPlanDTO; import com.yuanchu.mom.dto.InsProductDto; import com.yuanchu.mom.pojo.InsOrderFile; import com.yuanchu.mom.pojo.InsProduct; import org.springframework.web.multipart.MultipartFile; @@ -37,5 +38,6 @@ int uploadFile(Integer orderId, MultipartFile file); Map<String,Object> getReportModel(Integer orderId); Map<String,Object> getReportModel(Integer sampleId); } inspect-server/src/main/java/com/yuanchu/mom/service/InsProductService.java
@@ -1,5 +1,6 @@ package com.yuanchu.mom.service; import com.yuanchu.mom.dto.InsProductDto; import com.yuanchu.mom.pojo.InsProduct; import com.baomidou.mybatisplus.extension.service.IService; @@ -13,4 +14,7 @@ int selectOrderManDay(Integer orderId); int updateInspected(Integer id); boolean write(InsProductDto insProductDto); } inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -25,10 +25,7 @@ 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; import com.yuanchu.mom.dto.*; import com.yuanchu.mom.exception.ErrorException; import com.yuanchu.mom.mapper.*; import com.yuanchu.mom.pojo.*; @@ -271,11 +268,11 @@ //åæ¢è®°å½æ¨¡çæ¥è¯¢æ£éªå 容 @Override public Map<String, Object> getReportModel(Integer orderId) { public Map<String, Object> getReportModel(Integer sampleId) { 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<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<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); List<InsFibers> fibers = new ArrayList<>(); List<InsFiber> fiber = new ArrayList<>(); for (InsBushing insBushing : insBushings) { @@ -296,6 +293,9 @@ map.put("å 纤",fiber); return map; } @Override public void saveInsContext(Map<String, Object> insContext) { @@ -897,7 +897,7 @@ //第ä¸è¡ if (j == 0) { //第ä¸å textRenderData.setText("ç®¡è²æ Pipeâ100"); textRenderData.setText("ç®¡è²æ \r\nPipeâ100"); renderData.add(textRenderData); paragraphRenderData.setContents(renderData); paragraphRenderDataList.add(paragraphRenderData); inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -15,6 +15,7 @@ import com.yuanchu.mom.mapper.*; import com.yuanchu.mom.pojo.*; import com.yuanchu.mom.service.InsOrderService; import com.yuanchu.mom.service.InsProductService; import com.yuanchu.mom.utils.GiveCode; import com.yuanchu.mom.utils.QueryWrappers; import com.yuanchu.mom.vo.SampleDefectsFatherVo; @@ -47,6 +48,7 @@ private InsSampleMapper insSampleMapper; private InsProductMapper insProductMapper; private InsProductService insProductService; private GiveCode giveCode; @@ -145,6 +147,7 @@ } insSampleMapper.insert(a); if (ObjectUtil.isNotEmpty(a.getInsProduct())) { //æ®éæ£éªé¡¹ç®(é¤äºå 纤æ¥å¤´æè)çæ·»å addInsProductMethod(a.getId(), a.getInsProduct(), null, 0); } if (ObjectUtil.isNotEmpty(a.getInsulating())) { @@ -211,10 +214,12 @@ sample.setId(null); insSampleMapper.insert(sample); try { InsProduct insProduct = sample.getInsProduct().stream().filter(a -> Objects.equals(a.getInspectionItem(), "çæ¥æè")).findFirst().get(); insProduct.setId(null); insProduct.setInsSampleId(sample.getId()); insProductMapper.insert(insProduct); 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) { } } @@ -222,30 +227,70 @@ } private void addInsProductMethod(Integer sampleId, List<InsProduct> productList, Integer id, Integer type) { InsOrder insOrder = insOrderMapper.selectById(insSampleMapper.selectById(sampleId).getInsOrderId()); for (InsProduct product : productList) { /*if(product.getState()==1 && (product.getAsk().indexOf("D")>-1||product.getAsk().indexOf("W")>-1||product.getAsk().indexOf("X")>-1 ||product.getAsk().indexOf("RTS")>-1||product.getAsk().indexOf("H")>-1||product.getAsk().indexOf("L")>-1)){ throw new ErrorException("æäº¤å¤±è´¥ï¼å卿ªå¡«åçåéï¼"+product.getInspectionItem()+" "+product.getInspectionItemSubclass()); }*/ if (product.getState() == 1 && !product.getInspectionItem().equals("çæ¥æè")) { switch (type) { case 1: product.setInsFibersId(id); break; case 2: product.setInsFiberId(id); break; if (product.getState() == 1 && !product.getInspectionItem().equals("å 纤æ¥å¤´æè")) { //夿å ç¼ç温度循ç¯é¡¹ç®æ·»å if (insOrder.getSampleType().equals("å ç¼") && product.getInspectionItem().equals("温度循ç¯") && type != 0) { List<InsProduct> insProductes = new ArrayList<>(); List<InsProduct> insProducts = new ArrayList<>(); String[] strings = product.getAsk().split(";"); for (int i = 0; i < strings.length; i++) { 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(","); insProduct.setInspectionItem("1次");//æ£éªé¡¹--å¾ªç¯æ¬¡æ° insProduct.setInspectionItemSubclass(split[0]);//æ£éªé¡¹--温度 insProduct.setInspectionItemClass(split[1]);//æ£éªé¡¹--å çº¤é¡¹ç® insProduct.setAsk(split[2]);//æ£éªè¦æ± insProduct.setTell(strings[i]);//æ£éªæè¿° insProducts.add(insProduct); insProductes.add(insProduct); } else { //æåä¸ä¸ªæ°æ®æ¯è¯´æä¼å¾ªç¯å¤å°æ¬¡ int count = Integer.parseInt(strings[i]); if (count > 1) { //循ç¯è¶ è¿1次 for (int j = 2; j <= count; j++) { for (InsProduct insProduct : insProducts) { if (!insProduct.getInspectionItemSubclass().equals("20â")) { insProduct.setInspectionItem(j + "次"); insProductes.add(insProduct); } } } } } } insProductService.saveBatch(insProductes); } else { switch (type) { case 1: product.setInsFibersId(id); break; case 2: product.setInsFiberId(id); break; } product.setId(null); product.setCreateTime(null); product.setUpdateTime(null); product.setUpdateTime(null); product.setUpdateUser(null); product.setInsSampleId(sampleId); if (product.getInspectionItemSubclass() == null) { product.setInspectionItemSubclass(""); } insProductMapper.insert(product); } product.setId(null); product.setCreateTime(null); product.setUpdateTime(null); product.setUpdateTime(null); product.setUpdateUser(null); product.setInsSampleId(sampleId); if (product.getInspectionItemSubclass() == null) { product.setInspectionItemSubclass(""); } insProductMapper.insert(product); } } } @@ -270,7 +315,7 @@ code = ""; } String code2 = customMapper.selectById(insOrder.getCompanyId()).getCode2(); insOrder.setEntrustCode(giveCode.giveCode("JC/ZX" + code + "-" + code2 + "-", "ins_order", "", "yyMM")); insOrder.setEntrustCode(giveCode.giveCode2("JCZX/" + code + "-" + code2 + "-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMM")); } return insOrderMapper.updateById(insOrder); } inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsProductServiceImpl.java
@@ -1,11 +1,14 @@ package com.yuanchu.mom.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.dto.InsProductDto; import com.yuanchu.mom.mapper.InsProductMapper; import com.yuanchu.mom.pojo.InsProduct; import com.yuanchu.mom.service.InsProductService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; @Service @AllArgsConstructor @@ -24,6 +27,16 @@ insProductMapper.updateInspected(id); return 0; } @Override public boolean write(InsProductDto insProductDto) { List<InsProduct> insProducts = baseMapper.selectBatchIds(insProductDto.getIds()); for (InsProduct insProduct : insProducts) { insProduct.setTemperature(insProductDto.getTemperature()); insProduct.setHumidity(insProductDto.getHumidity()); } return updateBatchById(insProducts); } } inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -59,8 +59,6 @@ @Override public List<StandardProductList> selectStandardProductList(InsSample insSample) { String[] models = insSample.getModel().split("-(?=[^-]*$)");//æåæåä¸ä¸ªã-ã // String[] factorys = insSample.getFactory().split(" - "); //List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]).eq(StandardProductList::getSampleType, factorys[2])); List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); if (list.size() == 0) { if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { @@ -69,11 +67,6 @@ 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.selectList(Wrappers.<StandardProductList>lambdaQuery() .eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()) .eq(StandardProductList::getState, 1) .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]));*/ } list = list.stream().filter(a -> { try { inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -96,7 +96,7 @@ ir.url, ir.url_s, (select count(*) from ins_sample isa2 where isa2.ins_order_id = io.id and isa2.sample_code NOT REGEXP '/' ) sample_num, where isa2.ins_order_id = io.id) 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 inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -25,7 +25,7 @@ </resultMap> <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> select * from( select * from(select * from( SELECT a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user FROM @@ -63,6 +63,7 @@ a.type DESC, a.id ) b where ins_state is not null)A <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> @@ -207,7 +208,9 @@ ipr.equip_name, ip.method_s, ip.tell, ip.dic ip.dic, ip.temperature, ip.humidity from ins_sample isa 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 @@ -448,7 +451,6 @@ and ins_fibers_id is null </select> <select id="getReportModel" resultType="java.util.Map"> </select> <resultMap id="sampleDto" type="com.yuanchu.mom.dto.SampleProductDto"> @@ -516,6 +518,8 @@ <result property="methodS" column="method_s"/> <result property="tell" column="tell"/> <result property="dic" column="dic"/> <result property="temperature" column="temperature"/> <result property="humidity" column="humidity"/> <collection property="insProductResult" resultMap="insProductResult"/> </resultMap> user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java
@@ -163,7 +163,7 @@ user.setEmail(person.getCompanyEmail()); user.setIsCustom(person.getCompanyId().equals("SC2463") ? 0 : 1); // user.setPassword(DigestUtils.md5DigestAsHex(headerToken.getPassword(person.getEmployeeID()).getBytes())); user.setPassword(DigestUtils.md5DigestAsHex("123456".getBytes())); user.setPassword(DigestUtils.md5DigestAsHex("zttZTT123!".getBytes())); user.setCompany(BeanUtil.isNotEmpty(custom) ? (custom.getId() + "") : companyName); user.setAddress("æªå¡«å"); user.setRoleId(personDto.getRoleId() > 10000 ? 0 : personDto.getRoleId());