Procházet zdrojové kódy

试验委托单文件题名

chenr před 2 měsíci
rodič
revize
2af946938b

+ 0 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java

@@ -121,8 +121,6 @@ public class  EntrustInfoController extends BladeController {
 	@Transactional
 	public R update(@Valid @RequestBody EntrustInfo entrustInfo) {
 			// rfid--绑定 需要判断 委托单的状态和创建情况
-
-
 			if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==1){
 				entrustInfo.setSampleStatus("6");
 				entrustInfo.setRepealTime(new Date());

+ 7 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -196,6 +196,13 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
         this.saveOrUpdate(entrustInfo);
 		dataInfo.put("groupId",entrustInfo.getId());
 		dataInfo.put("pkeyId", dataInfo.getString("nodeErTreeId"));
+        if(StringUtils.isEmpty(entrustInfo.getEntrustNo())){
+            entrustInfo.setEntrustNo("");
+        }
+        if(StringUtils.isEmpty(entrustInfo.getEntrustName())){
+            entrustInfo.setEntrustName("");
+        }
+        dataInfo.put("entrustInfoName",entrustInfo.getEntrustNo()+entrustInfo.getEntrustName());
         String pdfUrl = excelTabClient.saveEntrustTabData(dataInfo);
         return R.data(200,pdfUrl,"操作成功");
 	}

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -1138,6 +1138,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
           for (Map.Entry<String, List<JSONObject>> entry : groupedByType.entrySet()) {
               List<JSONObject> jsonObjects = groupedByType.get(entry.getKey());
               JSONObject   jsonObject = jsonObjects.get(0);
+              if(entry.getKey().equals("2")&&jsonObjects.size()>1){
+                  jsonObject = jsonObjects.get(1);
+              }
               String pkeyId = jsonObject.getString("pkeyId");
               String sql = "select * from m_wbs_tree_private where p_key_id =" + pkeyId;
               WbsTreePrivate table = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
@@ -1244,6 +1247,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         String recordOrReportNo = jsonObject.getString(key);
         if(!"".equals(recordOrReportNo) && !(recordOrReportNo == null)){
             String updateSql = "update u_trial_self_inspection_record set " + fileVlue +"='" + recordOrReportNo + "' where id='" + dto.getId()+"'";
+            if(fileVlue.equals("record_no")){
+               dto.setRecordNo(recordOrReportNo);
+            }else {
+                dto.setReportNo(recordOrReportNo);
+            }
             jdbcTemplate.execute(updateSql);
         }
     }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -197,7 +197,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 试验委托单 生成 pdf
      */
-    String getEntrustPDFTrial(Long pKeyId, String contractId, Long groupId) throws Exception;
+    String getEntrustPDFTrial(Long pKeyId, String contractId, Long groupId,String entrustInfoName) throws Exception;
 
 
     // 添加

+ 3 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -2147,9 +2147,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             Elements trs = table.select("tr");
             if (ObjectUtil.isNotEmpty(DataInfo)) {
                 for (String val : DataInfo.keySet()) {
-                    if(val.equals("key_23__12_1")){
-                        System.out.println("");
-                    }
                     Elements datas = doc.getElementsByAttributeValue("keyname", val);
                     Element data = null;
                     if (datas.size() >= 1) {
@@ -4235,7 +4232,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 委托单 单pdf
      */
     @Override
-    public String getEntrustPDFTrial(Long pkeyId, String contractId, Long groupId) throws Exception {
+    public String getEntrustPDFTrial(Long pkeyId, String contractId, Long groupId,String entrustInfoName) throws Exception {
         String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
@@ -4509,9 +4506,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 jdbcTemplate.update("update u_entrust_info set entrust_pdf = '" + pdfUrl + "' where id='" + groupId + "' ");
             List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify = 1 and wbs_id ='" + groupId + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
             if (query2.size() > 0) {
-                jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='委托单'  where classify='1' and  wbs_id='" + groupId + "' and contract_id ='" + contractId + "'");
+                jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='"+entrustInfoName+"'  where classify='1' and  wbs_id='" + groupId + "' and contract_id ='" + contractId + "'");
             } else {
-                informationQueryClient.saveData(groupId.toString(), projectInfo.getId().toString(), contractId, "1", bladeFile.getLink(), "委托单");
+                informationQueryClient.saveData(groupId.toString(), projectInfo.getId().toString(), contractId, "1", bladeFile.getLink(), entrustInfoName);
             }
             return bladeFile.getLink();
         }

+ 12 - 3
blade-service/blade-repair/src/main/java/org/springblade/repair/controller/CheckAndRepairController.java

@@ -367,13 +367,23 @@ public class CheckAndRepairController {
         int n=list.size();
         for (WbsTreePrivate wbsTreePrivate : list) {
             String htmlUrl = wbsTreePrivate.getHtmlUrl();
+            int lastIndex = htmlUrl.lastIndexOf("/");
+            String result="";
+            if (lastIndex != -1) {
+                result= htmlUrl.substring(lastIndex + 1);
+            }
             File  html = new File(htmlUrl);
             boolean flag=true;
             //判断文件是否存在
             if(!html.exists()){
+                List<WbsTreePrivate> list1;
                 Path sourcePath = Paths.get(htmlUrl);
-                String sql1="select * from m_wbs_tree_private where excel_id="+wbsTreePrivate.getExcelId()+" and is_deleted=0";
-                List<WbsTreePrivate> list1 = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+                String sql1="select html_url from m_wbs_tree_private where excel_id="+wbsTreePrivate.getExcelId()+" and is_deleted=0"+" and init_table_name= '"+wbsTreePrivate.getInitTableName()+"' and html_url like '%"+result+"' ";
+                list1= jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+                if(list1.isEmpty()){
+                    String sql2="select html_url from m_wbs_tree_private where excel_id="+wbsTreePrivate.getExcelId()+" and is_deleted=0 and html_url is not null ";
+                    list1 = jdbcTemplate.query(sql2, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
+                }
                 Set<String> htmlSets = list1.stream().map(WbsTreePrivate::getHtmlUrl).collect(Collectors.toSet());
                 //通过excel_id  找寻其他项目级下路径,判断是否存在,如果存在则拿去覆盖
                 for (String htmlUrlSet : htmlSets) {
@@ -391,7 +401,6 @@ public class CheckAndRepairController {
                     excelTabClient.saveLinkTab(wbsTreePrivate.getExcelId(),wbsTreePrivate.getPKeyId());
                     System.out.println("关联成功!"+wbsTreePrivate.getPKeyId());
                 }
-
                 i++;
             }
             n--;