Browse Source

Merge remote-tracking branch 'origin/master' into master

yangyj 2 năm trước cách đây
mục cha
commit
92d4f59f5a

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java

@@ -27,7 +27,7 @@ public interface TaskClient {
     String QUERY_FORM_DATA_ID = API_PREFIX + "/query-form-data-id";
     String QUERY_BUSINESS_DATA_TASK = API_PREFIX + "/query-business-data-task";
     String QUERY_APPROVAL_USER = API_PREFIX + "/query-approval-user";
-    String QUERY_BUSINESS_TABLE_E_VISA_CONFIG = API_PREFIX + "/query-business-table-E_VISA_CONFIG";
+    String QUERY_BUSINESS_TABLE_E_VISA_CONFIG = API_PREFIX + "/query-business-table-e-visa-config";
 
     /**
      * 获取当前任务绑定的表格

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ImageClassificationConfigClient.java

@@ -22,7 +22,7 @@ public interface ImageClassificationConfigClient {
      * @return 结果集
      */
     @GetMapping(API_PREFIX + "/queryClassificationConfigList")
-    List<ImageClassificationConfig> queryClassificationConfigList();
+    List<ImageClassificationConfig> queryClassificationConfigList(@RequestParam Integer classify);
 
     /**
      * 根据ID集获取分类

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -72,8 +72,8 @@ public class ContractLogController extends BladeController {
 	/**
 	 * 单个废除(填报页)
 	 */
-	@PostMapping("/oneAbolish")
-	@ApiOperationSupport(order = 9)
+	@GetMapping("/oneAbolish")
+	@ApiOperationSupport(order = 11)
 	@ApiOperation(value = " 单个废除(填报页)")
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
@@ -94,7 +94,7 @@ public class ContractLogController extends BladeController {
 	 * 获取当前资料的任务状态
 	 */
 	@GetMapping("/checkTheLogTaskStatus")
-	@ApiOperationSupport(order = 9)
+	@ApiOperationSupport(order = 10)
 	@ApiOperation(value = "获取当前资料的任务状态")
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ImageClassificationFileController.java

@@ -31,9 +31,11 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.IoUtil;
+import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.ImageClassificationConfig;
 import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.ExcelTabClient;
 import org.springblade.manager.feign.ImageClassificationConfigClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
@@ -96,6 +98,8 @@ public class ImageClassificationFileController extends BladeController {
 
 	private final RecycleBinClient recycleBinClient;
 
+	private final ContractClient contractClient;
+
 	/**
 	 * 批量下载
 	 */
@@ -347,7 +351,7 @@ public class ImageClassificationFileController extends BladeController {
 		//首先获取显隐
 		List<ImageClassificationShow> showClassifyIdList = this.imageClassificationShowService.queryShowClassify(projectId, contractId, null);
 		//获取当前系统配置的所有有效分类
-		List<ImageClassificationConfig> sysClassifyConfigList = this.imageClassificationConfigClient.queryClassificationConfigList();
+		List<ImageClassificationConfig> sysClassifyConfigList = this.imageClassificationConfigClient.queryClassificationConfigList(this.contractClient.getContractById(Long.parseLong(contractId)).getContractType());
 
 		if(sysClassifyConfigList == null || sysClassifyConfigList.size() == 0){
 			return R.data(-1, null, "不存在数据,请联系管理员或维护人员");
@@ -401,6 +405,7 @@ public class ImageClassificationFileController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "获取类型列表(类型主页)")
 	public R<List<ImageClassificationConfigVO>> getClassIfyList(@RequestParam String projectId, @RequestParam String contractId){
+
 		//获取当前项目下的类型显隐情况
 		List<ImageClassificationShow> allShowClassifyIdList = this.imageClassificationShowService.queryShowClassify(projectId, contractId, null);
 
@@ -408,7 +413,7 @@ public class ImageClassificationFileController extends BladeController {
 		List<ImageClassificationConfig> configList = new ArrayList<>();
 		if(allShowClassifyIdList == null || allShowClassifyIdList.size() == 0){
 			//说明没有控制显隐,全查
-			configList = this.imageClassificationConfigClient.queryClassificationConfigList();
+			configList = this.imageClassificationConfigClient.queryClassificationConfigList(this.contractClient.getContractById(Long.parseLong(contractId)).getContractType());
 		} else {
 			//获取分类ID集合
 			List<Long> classifyIds = new ArrayList<>();

+ 10 - 1
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -12,12 +12,15 @@ import org.springblade.business.vo.SaveContractLogVO;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springblade.manager.feign.WbsTreePrivateClient;
 import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 
 @RestController
@@ -29,6 +32,8 @@ public class ContractLogClientImpl implements ContractLogClient {
 
     private final IContractLogWbsService contractLogWbsService;
 
+    private final WbsTreePrivateClient wbsTreePrivateClient;
+
     @Override
     public void removeContractLogWbsByTheLogId(String theLogId) {
         try{
@@ -104,12 +109,16 @@ public class ContractLogClientImpl implements ContractLogClient {
             this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getDataId, contractLog.getDataId()).eq(ContractLog::getId, logJson.getString("id")));
 
         } else {
+            //获取节点信息
+            WbsTreePrivate node =  this.wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(saveContractLogVO.getWbsNodeId().toString())).get(0);
+
             //新增
             contractLog.setId(SnowFlakeUtil.getId());
             contractLog.setCreateTime(new Date());
             contractLog.setCreateUser(AuthUtil.getUserId());
             contractLog.setCreateUserName(AuthUtil.getUserName());
             contractLog.setStatus(0);
+            contractLog.setFileName(saveContractLogVO.getRecordTime() + " " + node.getNodeName());
 
             if(saveContractLogVO.getCorrelationIds() != null && saveContractLogVO.getCorrelationIds().size() > 0){
                 List<JSONObject> list = saveContractLogVO.getCorrelationIds();

+ 20 - 11
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -8,14 +8,11 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.http.client.utils.DateUtils;
 import org.springblade.business.entity.*;
 import org.springblade.business.feign.TaskClient;
-import org.springblade.business.service.IFirstInformationService;
-import org.springblade.business.service.IInformationQueryFileService;
-import org.springblade.business.service.ITaskParallelService;
+import org.springblade.business.service.*;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.business.mapper.InformationQueryMapper;
-import org.springblade.business.service.IInformationQueryService;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -24,6 +21,7 @@ import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
@@ -61,21 +59,32 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	private final IInformationQueryFileService informationQueryFileService;
 
+	private final IContractLogService contractLogService;
+
 	@Override
 	public List<String> queryBusinessTableData(String formDataId) {
 		//获取具体业务数据
 		InformationQuery query = this.getById(formDataId);
 
 		//查询这个业务数据绑定的表格,需要区分监理和施工
-		WbsTreeContract tree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(query.getWbsId());
-		List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(tree, "queryTable", String.valueOf(query.getClassify()));
-		if(tableList != null && tableList.size() > 0){
-			//删除掉无法溯源的数据
-			tableList.removeIf(node -> node.getIsTypePrivatePid() == null || node.getIsTypePrivatePid() <= 0 || StringUtils.isEmpty(node.getIsTypePrivatePid().toString()));
+		if(query != null){
+			WbsTreeContract tree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(query.getWbsId());
+			List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(tree, "queryTable", String.valueOf(query.getClassify()));
+			if(tableList != null && tableList.size() > 0){
+				//删除掉无法溯源的数据
+				tableList.removeIf(node -> node.getIsTypePrivatePid() == null || node.getIsTypePrivatePid() <= 0 || StringUtils.isEmpty(node.getIsTypePrivatePid().toString()));
 
-			List<Long> privatePIdList = tableList.stream().map(WbsTreeContract::getIsTypePrivatePid).distinct().collect(Collectors.toList());
+				List<Long> privatePIdList = tableList.stream().map(WbsTreeContract::getIsTypePrivatePid).distinct().collect(Collectors.toList());
 
-			return JSONArray.parseArray(JSONObject.toJSONString(privatePIdList), String.class);
+				return JSONArray.parseArray(JSONObject.toJSONString(privatePIdList), String.class);
+			}
+		} else {
+			//那么就可能是日志,检查是不是日志
+			ContractLog log = this.contractLogService.getById(formDataId);
+			if(log != null){
+				//说明是日志,日志的绑定节点在wbs_tree_private表中,所以这个节点ID就是要找的ID
+				return Func.toStrList(String.valueOf(log.getWbsNodeId()));
+			}
 		}
 
 		return null;

+ 52 - 30
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -658,11 +658,12 @@ public class ExcelTabController extends BladeController {
 
 
 
- /*   public static void main(String[] args) throws FileNotFoundException {
+
+   /* public static void main(String[] args) throws FileNotFoundException {
 
         String thmlUrl = "/Users/hongchuangyanfa/Desktop/1234567890.html";
 
-        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/A16.xlsx");
+        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/D8.101.xlsx");
 
         Workbook wb = new Workbook();
         wb.loadFromMHtml(new FileInputStream(file1));
@@ -954,38 +955,47 @@ public class ExcelTabController extends BladeController {
                             inputText = inputText.substring(0, inputText.lastIndexOf("_"));
                         }
 
+                        // 质检表特殊处理匹配
+
                         String parm = i + "," + j + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
                         // 设置文本信息
                         ExctabCell exctabCell = new ExctabCell();
-                        if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
-
-                            data.empty().append("<el-input type='text'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-input>");
-                            exctabCell.setExctabId(excelId);
-                            exctabCell.setTextInfo(inputText);
-
-                            if (inputText.contains("日期") || inputText.contains("年") || inputText.contains("月") || inputText.contains("日")){
-                                //日期
-                                exctabCell.setTextElementType(4);
-                            }else {
-                                //字符串
-                                exctabCell.setTextElementType(1);
+                        if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0)|| inputText.indexOf("日期")>=0 ) {
+                            if(inputText.indexOf("日期")>=0){
+                                data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='"+inputText+"'> </el-date-picker>");
+                            }else if(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0){
+                                if(inputText.indexOf("专业监理工程师:")>=0){
+                                    inputText="专业监理工程师_年月日";
+                                }else if(inputText.indexOf("质检工程师:")>=0){
+                                    inputText="质检工程师_年月日";
+                                }else{
+                                    inputText="年月日";
+                                }
                             }
-
+                            data.empty().append("<el-date-picker type='date' format='YYYY年MM月DD日'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            exctabCell.setTextInfo(inputText);
+                            exctabCell.setExctabId(excelId);
                             exctabCell.setIsDeleted(0);
                             exctabCell.setXys(i + "_" + j);
                             colTitle.add(exctabCell);
                             data.attr("title", inputText);
 
-                        }else if(textInfo.indexOf("□")>=0){
+                        }else if(textInfo.indexOf("□")>=0){ //下拉框
+
+                            exctabCell.setTextInfo(inputText);
+                            exctabCell.setExctabId(excelId);
+                            exctabCell.setIsDeleted(0);
+                            exctabCell.setXys(i + "_" + j);
+                            colTitle.add(exctabCell);
                             data.attr("title", inputText);
                         } else {
-                            if (index_state) {
+                            if (index_state) { // 区域内
                                 if (rowspan >= 1) {
                                     data.empty().append("<el-input type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                 } else {
                                     data.empty().append("<el-input type='text'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder=''> </el-input>");
                                 }
-                            } else {
+                            } else { // 区域外
                                 if (j == 0) {
                                     if (colspan == maxCol && i >= 1) {
                                         if (rowspan >= 1) {
@@ -1347,6 +1357,7 @@ public class ExcelTabController extends BladeController {
                 Document doc = Jsoup.parse(htmlString);
                 Element table = doc.select("table").first();
                 Elements trs = table.select("tr");
+                Elements cols = table.select("col");
 
                 if (ObjectUtil.isNotEmpty(DataInfo)) {
                     for (String val : DataInfo.keySet()) {
@@ -1392,22 +1403,33 @@ public class ExcelTabController extends BladeController {
                                 }
                                 //https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
                                 if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
-                                  //  Element element = trs.get(y1).select("td").get(x1);
-                                    String styles[] = data.attr("style").split(";");
-                                    int Height = 0;
-                                    for (String sty : styles) {
-                                        if (sty.indexOf("height:") >= 0) {
-                                            Height = Integer.parseInt(sty.replace("height:", "").replace("px", ""));
+
+                                    BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
+
+                                    int colspan = Integer.parseInt(data.attr("colspan"));
+                                    int rowspan = Integer.parseInt(data.attr("rowspan"));
+                                    int picHeight = 0;
+                                    int picWidth = 0;
+                                    for (int i=y1;i<=(y1+rowspan);i++){ // 跨列处理
+                                        String dataInfo = trs.get(i).attr("height");
+                                        if(StringUtils.isNotEmpty(dataInfo)){
+                                            picHeight += Integer.parseInt(dataInfo);
                                         }
                                     }
 
-                                    BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
-                                    ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
-                                    pic.setHeight(Height);
-                                    System.out.println(sheet.getCellRange(y1, x1).getRowHeight());
-                                    System.out.println(sheet.getCellRange(y1, x1).getColumnWidth());
-                                    sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
+                                    if(colspan>=1){ //框行处理
+                                        for(int i=x1-1;i<x1+colspan-1;i++){
+                                            String dataInfo=cols.get(i).attr("width").replaceAll("px","");
+                                            if(StringUtils.isNotEmpty(dataInfo)){
+                                                picWidth += Integer.parseInt(dataInfo);
+                                            }
+                                        }
+                                    }
 
+                                    ExcelPicture pic = sheet.getPictures().add(y1, x1, image);
+                                    pic.setWidth(picWidth-10);
+                                    pic.setHeight(picHeight);
+                                    pic.setLeft(5);
                                 } else {
                                     final CellRange cellRange = sheet.getCellRange(y1, x1);
                                     cellRange.setText(myData);

+ 17 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ImageClassificationConfigClientImpl.java

@@ -1,5 +1,6 @@
 package org.springblade.manager.feign;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.springblade.manager.entity.ImageClassificationConfig;
 import org.springblade.manager.service.IImageClassificationConfigService;
@@ -19,7 +20,21 @@ public class ImageClassificationConfigClientImpl implements ImageClassificationC
     }
 
     @Override
-    public List<ImageClassificationConfig> queryClassificationConfigList() {
-        return this.imageClassificationConfigService.list();
+    public List<ImageClassificationConfig> queryClassificationConfigList(Integer classify) {
+        switch (classify){
+            case 1:
+                classify = 3;
+                break;
+            case 2:
+                classify = 2;
+                break;
+            case 3:
+                classify = 1;
+                break;
+            default:
+                break;
+        }
+
+        return this.imageClassificationConfigService.list(Wrappers.<ImageClassificationConfig>lambdaQuery().eq(ImageClassificationConfig::getAffiliatedParty, classify));
     }
 }