Explorar o código

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

yangyj %!s(int64=2) %!d(string=hai) anos
pai
achega
2b7b14d8da
Modificáronse 34 ficheiros con 953 adicións e 249 borrados
  1. 3 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQuery.java
  2. 90 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/MetadataClassification.java
  3. 0 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  4. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  5. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/QueryProcessDataVO.java
  6. 8 2
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTree.java
  7. 8 3
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTreeContract.java
  8. 5 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsTreeContractClient.java
  9. 41 20
      blade-service/blade-business/src/main/java/org/springblade/business/controller/BusinessUserOpinionController.java
  10. 43 23
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  11. 7 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/MessageWarningController.java
  12. 80 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/MetadataController.java
  13. 75 47
      blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java
  14. 19 4
      blade-service/blade-business/src/main/java/org/springblade/business/controller/UserOpinionController.java
  15. 1 2
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  16. 7 5
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  17. 20 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.java
  18. 78 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.xml
  19. 17 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IMetadataClassificationService.java
  20. 34 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  21. 96 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java
  22. 55 44
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  23. 17 4
      blade-service/blade-business/src/main/java/org/springblade/business/socket/WebSocket.java
  24. 52 10
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  25. 3 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java
  26. 13 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java
  27. 8 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.java
  28. 17 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml
  29. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeContractService.java
  30. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeService.java
  31. 36 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java
  32. 14 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeServiceImpl.java
  33. 89 71
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  34. 1 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQuery.java

@@ -119,4 +119,7 @@ public class InformationQuery extends BaseEntity {
     @ApiModelProperty("pdf路径,引用试验记录后合并的pdf")
     private String pdfTrialUrl;
 
+    @ApiModelProperty("首件关联工序资料ids")
+    private String sjRecordIds;
+
 }

+ 90 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/MetadataClassification.java

@@ -0,0 +1,90 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+/**
+ * 元数据容器
+ * **/
+@Data
+@TableName("u_metadata_classification")
+@EqualsAndHashCode(callSuper = true)
+public class MetadataClassification extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 主键id
+     */
+    private Long id;
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty(value = "租户ID")
+    private String tenantId;
+
+    @ApiModelProperty("合同段ID")
+    private String contractId;
+
+    /**
+     * 元数据项
+     */
+    @ApiModelProperty(value = "元数据项")
+    private String containerName;
+
+    /**
+     * 编号
+     */
+    @ApiModelProperty(value = "编号")
+    private String code;
+    /**
+     * 字段数据类型
+     */
+    @ApiModelProperty(value = "字段数据类型")
+    private String fieldType;
+
+    /**
+     * 容器类型
+     */
+    @ApiModelProperty(value = "容器类型")
+    private Integer containerType;
+
+    /**
+     * 捕获方式
+     */
+    @ApiModelProperty(value = "捕获方式")
+    private Integer captureMode;
+
+    /**
+     * 是否必选
+     */
+    @ApiModelProperty(value = "是否必选")
+    private Integer mandatoryType;
+
+    /**
+     * 文件存储类型
+     */
+    @ApiModelProperty(value = "文件存储类型")
+    private String fileStorageType;
+
+    /**
+     * 容器实体表名称
+     */
+    @ApiModelProperty(value = "容器实体表名称")
+    private String containerInitTabName;
+
+    /**
+     * 实体表字段名
+     */
+    @ApiModelProperty(value = "实体表字段名")
+    private String fieldKey;
+
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

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

@@ -51,5 +51,4 @@ public interface InformationQueryClient {
 
     @PostMapping(API_PREFIX + "/updateInformationQuery")
     void updateInformationQuery(@RequestParam String link, @RequestParam String classify, @RequestParam String nodeId, @RequestParam String contractId);
-
 }

+ 2 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java

@@ -67,6 +67,8 @@ public class InformationQueryVO extends InformationQuery {
 
 	private String classifyType;
 
+	private Boolean isApprove;
+
 	@ApiModelProperty("上报批次")
 	private String reportNumber;
 

+ 2 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/QueryProcessDataVO.java

@@ -29,4 +29,6 @@ public class QueryProcessDataVO {
 
     private String queryType;
 
+    private String reportNumber;
+
 }

+ 8 - 2
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTree.java

@@ -140,10 +140,16 @@ public class ArchiveTree extends BaseEntity {
     @ApiModelProperty(value = "自动立卷类型")
     private Integer archiveAutoType;
 	/**
-	* 自动立卷关联Id
+	* 自动立卷设置的节点ID
 	*/
-    @ApiModelProperty(value = "自动立卷关联Id")
+    @ApiModelProperty(value = "自动立卷设置的节点ID")
     private Long archiveAutoNodeId;
 
+    /**
+     * 是否自动立卷规则选择设置的节点 选中的节点设为1 方便页面显示列表
+     */
+    @ApiModelProperty(value = "是否为设置的节点")
+    private Integer archiveAutoSelect;
+
 
 }

+ 8 - 3
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ArchiveTreeContract.java

@@ -128,9 +128,14 @@ public class ArchiveTreeContract extends BaseEntity {
 	*/
 		private Integer archiveAutoType;
 	/**
-	* 自动立卷关联Id
-	*/
-		private Long archiveAutoNodeId;
+	 * 自动立卷设置的节点ID
+	 */
+	private Long archiveAutoNodeId;
+
+	/**
+	 * 是否自动立卷规则选择设置的节点 选中的节点设为1 方便页面显示列表
+	 */
+	private Integer archiveAutoSelect;
 
 
 }

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

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
@@ -140,5 +141,8 @@ public interface WbsTreeContractClient {
     List<WbsTreeContract> selectContractTreeAll(@RequestParam String contractId);
 
     @GetMapping(API_PREFIX + "/getContractWbsTreeByParentId")
-    List<WbsTreeContract> getContractWbsTreeByParentId(@RequestParam String parentId,@RequestParam String contractId);
+    List<WbsTreeContract> getContractWbsTreeByParentId(@RequestParam String parentId, @RequestParam String contractId);
+
+    @PostMapping(API_PREFIX + "/diySort")
+    boolean diySort(@RequestBody List<String> sortLists);
 }

+ 41 - 20
blade-service/blade-business/src/main/java/org/springblade/business/controller/BusinessUserOpinionController.java

@@ -1,5 +1,6 @@
 package org.springblade.business.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -14,9 +15,11 @@ import org.springblade.business.entity.UserOpinion;
 import org.springblade.business.entity.UserOpinionFile;
 import org.springblade.business.entity.UserOpinionFlow;
 import org.springblade.business.feign.MessageWarningClient;
+import org.springblade.business.service.ITaskService;
 import org.springblade.business.service.IUserOpinionFileService;
 import org.springblade.business.service.IUserOpinionFlowService;
 import org.springblade.business.service.IUserOpinionService;
+import org.springblade.business.socket.WebSocket;
 import org.springblade.business.vo.AssessmentUserVOS;
 import org.springblade.business.vo.BusinessUserOpinionVO;
 import org.springblade.business.vo.MessageWarningVO;
@@ -27,9 +30,13 @@ import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -46,13 +53,17 @@ public class BusinessUserOpinionController {
 
     private final MessageWarningClient messageWarningClient;
 
+    private final ITaskService iTaskService;
+
+    private final WebSocket webSocket;
+
     /**
      * isIgnore
      */
     @PostMapping("/isIgnore")
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "是否忽略")
-    public R<Boolean> isIgnore(@RequestParam String userOpinionId){
+    public R<Boolean> isIgnore(@RequestParam String userOpinionId) {
         return R.data(this.userOpinionService.update(Wrappers.<UserOpinion>lambdaUpdate().set(UserOpinion::getIsIgnore, 1).eq(UserOpinion::getId, userOpinionId)));
     }
 
@@ -62,7 +73,7 @@ public class BusinessUserOpinionController {
     @GetMapping("/queryUserAssessmentPage")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "考核区分页")
-    public R<IPage<AssessmentUserVOS>> queryUserAssessmentPageList(AssessmentUserVOS vo){
+    public R<IPage<AssessmentUserVOS>> queryUserAssessmentPageList(AssessmentUserVOS vo) {
         Query query = new Query();
         query.setCurrent(vo.getCurrent());
         query.setSize(vo.getSize());
@@ -71,7 +82,7 @@ public class BusinessUserOpinionController {
         //总数
         Integer count = this.userOpinionFlowService.countUserAssessmentPageList(vo);
         //分页数据
-        if(StringUtils.isNotEmpty(vo.getEndTime())){
+        if (StringUtils.isNotEmpty(vo.getEndTime())) {
             //因为between的含头不含尾属性,需要给结尾时间+1
             String endTime = vo.getEndTime();
             endTime = DateUtil.format(org.apache.commons.lang.time.DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd hh:mm"), 1), "yyyy-MM-dd hh:mm");
@@ -80,7 +91,7 @@ public class BusinessUserOpinionController {
         List<AssessmentUserVOS> result = this.userOpinionFlowService.queryUserAssessmentPage(vo);
         result.forEach(vos -> {
             List<UserOpinionFile> files = this.userOpinionFileService.selectUserOpinionFileByUserOpinionKey(vos.getUserOpinionId());
-            if(files != null && files.size() > 0){
+            if (files != null && files.size() > 0) {
                 vos.setFileUrlList(files.stream().map(UserOpinionFile::getFileUrl).distinct().collect(Collectors.toList()));
             }
             vos.setOperation("qufq".equals(AuthUtil.getUserName()));
@@ -94,6 +105,7 @@ public class BusinessUserOpinionController {
 
     /**
      * 获取所有工单及处理进度
+     *
      * @param query 分页信息
      * @return 结果
      */
@@ -103,12 +115,13 @@ public class BusinessUserOpinionController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "query", value = "分页信息", required = true)
     })
-    public R<IPage<BusinessUserOpinionVO>> queryBusinessUserOpinionListAll(Query query){
+    public R<IPage<BusinessUserOpinionVO>> queryBusinessUserOpinionListAll(Query query) {
         return R.data(this.userOpinionService.queryBusinessUserOpinionListAll(query));
     }
 
     /**
      * 业务人员提交环节操作
+     *
      * @return 结果
      */
     @PostMapping("/manageUserOperationStatus")
@@ -119,9 +132,9 @@ public class BusinessUserOpinionController {
             @ApiImplicitParam(name = "newNumber", value = "当前流程次数", required = true),
             @ApiImplicitParam(name = "currentLinkId", value = "当前环节ID", required = true)
     })
-    public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer currentLink, @RequestParam Integer newNumber, @RequestParam String currentLinkId, String manageTime){
+    public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer currentLink, @RequestParam Integer newNumber, @RequestParam String currentLinkId, String manageTime) {
 
-        if(StringUtils.isEmpty(currentLinkId)){
+        if (StringUtils.isEmpty(currentLinkId)) {
             return R.data(-1, false, "缺少currentLinkId参数");
         }
         //获取当前操作用户
@@ -135,15 +148,15 @@ public class BusinessUserOpinionController {
 
         //找到当前环节的下一环节
         Long nextLink = null, nextLinkEnd = null;
-        if(StringUtils.isEmpty(manageTime) && new Integer("3").equals(currentLink)){
+        if (StringUtils.isEmpty(manageTime) && new Integer("3").equals(currentLink)) {
             //直接提交完结
             nextLink = flowVOS.get(2).getId();
             nextLinkEnd = flowVOS.get(3).getId();
         } else {
-            for(int i = 0, l = flowVOS.size(); i < l; i ++){
-                if(new Long(currentLinkId).equals(flowVOS.get(i).getId())){
+            for (int i = 0, l = flowVOS.size(); i < l; i++) {
+                if (new Long(currentLinkId).equals(flowVOS.get(i).getId())) {
                     //找到下一个环节ID
-                    switch (i){
+                    switch (i) {
                         case 1:
                             //说明当前环节是提交"进入人工处理环节"操作
                             nextLink = flowVOS.get(i + 1).getId();
@@ -162,8 +175,8 @@ public class BusinessUserOpinionController {
 
         //将当前环节更改为已完成
         boolean result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getIsCurrent, 2).set(UserOpinionFlow::getUpdateUser, user.getUserId()).set(UserOpinionFlow::getUpdateTime, new Date()).eq(UserOpinionFlow::getId, currentLinkId));
-        if(result){
-            if(StringUtils.isEmpty(manageTime)){
+        if (result) {
+            if (StringUtils.isEmpty(manageTime)) {
                 manageTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd");
             } else {
                 //更新预计时间
@@ -173,21 +186,21 @@ public class BusinessUserOpinionController {
             //内容
             String content = "";
 
-            if(nextLink != null && StringUtils.isNotEmpty(String.valueOf(nextLink))){
+            if (nextLink != null && StringUtils.isNotEmpty(String.valueOf(nextLink))) {
                 content = "用户" + userOpinion.getCreateUserName() + ",您好,您所提交的【" + userOpinion.getProblemType() + ":" + userOpinion.getOpinionContent() + "】工单服务已经进入人工处理环节,处理人:" + AuthUtil.getNickName();
 
                 //提交"进入人工处理环节"操作
                 result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getReplyContent, "预计" + manageTime + "之前完成").set(UserOpinionFlow::getUpdateTime, new Date()).set(UserOpinionFlow::getIsCurrent, new Integer("3").equals(currentLink) ? 2 : 1).eq(UserOpinionFlow::getId, nextLink));
             }
-            if(nextLinkEnd != null && StringUtils.isNotEmpty(String.valueOf(nextLinkEnd))){
+            if (nextLinkEnd != null && StringUtils.isNotEmpty(String.valueOf(nextLinkEnd))) {
                 content = "用户" + userOpinion.getCreateUserName() + ",您好,您所提交的【" + userOpinion.getProblemType() + ":" + userOpinion.getOpinionContent() + "】工单服务已解决,请及时查看,处理人:" + AuthUtil.getNickName();
 
                 //提交"已解决"操作
                 result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getUpdateTime, new Date()).set(UserOpinionFlow::getIsCurrent, 2).eq(UserOpinionFlow::getId, nextLinkEnd));
             }
 
-            try{
-                if(StringUtils.isNotEmpty(content)){
+            try {
+                if (StringUtils.isNotEmpty(content)) {
                     this.messageWarningClient.savePushUserMessageWarning(new MessageWarningVO(
                             userOpinion.getProjectId(),
                             userOpinion.getContractId(),
@@ -197,7 +210,14 @@ public class BusinessUserOpinionController {
                             0
                     ));
                 }
-            }catch (Exception e){
+
+                //通过WebSocket推送数量条数推送给反馈人
+                if (ObjectUtil.isNotEmpty(userOpinion.getProjectId()) && ObjectUtil.isNotEmpty(userOpinion.getContractId()) && ObjectUtil.isNotEmpty(userOpinion.getCreateUser())) {
+                    Map<String, String> stringMap = iTaskService.getTaskCount(userOpinion.getProjectId().toString(), userOpinion.getContractId().toString(), userOpinion.getCreateUser().toString());
+                    webSocket.sendMessageByUserId(userOpinion.getCreateUser().toString(), JSON.toJSONString(stringMap));
+                }
+
+            } catch (Exception e) {
                 e.printStackTrace();
             }
 
@@ -208,6 +228,7 @@ public class BusinessUserOpinionController {
 
     /**
      * 获取分配给当前登录用户的工单记录
+     *
      * @return 结果集
      */
     @GetMapping("/queryBusinessUserOpinionList")
@@ -217,13 +238,13 @@ public class BusinessUserOpinionController {
             @ApiImplicitParam(name = "current", value = "当前页", required = true),
             @ApiImplicitParam(name = "size", value = "当前页显示数量", required = true)
     })
-    public R<IPage<BusinessUserOpinionVO>> queryBusinessUserOpinionList(@RequestParam Integer current, @RequestParam Integer size){
+    public R<IPage<BusinessUserOpinionVO>> queryBusinessUserOpinionList(@RequestParam Integer current, @RequestParam Integer size) {
         BladeUser user = AuthUtil.getUser();
         Query query = new Query();
         query.setCurrent(current);
         query.setSize(size);
         //获取推送给当前用户的工单信息
-        return R.data(this.userOpinionService.queryBusinessUserOpinionList(String.valueOf(user.getUserId()),query));
+        return R.data(this.userOpinionService.queryBusinessUserOpinionList(String.valueOf(user.getUserId()), query));
     }
 
 }

+ 43 - 23
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1011,9 +1011,9 @@ public class InformationWriteQueryController extends BladeController {
     public R<Boolean> diySort(@RequestBody DiySortVO vo) {
         //对整棵树进行排序(资料查询需要同步显示排序)采用自增
         List<String> sortLists = vo.getSortList();
-        String id = sortLists.stream().map(String::valueOf).findAny().orElse(null);
-        WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(id);
 
+        /*String id = sortLists.stream().map(String::valueOf).findAny().orElse(null);
+        WbsTreeContract wbsTreeContract = wbsTreeContractClient.getContractNodeByPrimaryKeyId(id);
         //当前项目全部填报资料
         List<InformationQuery> informationQueries = informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
                 .eq(InformationQuery::getProjectId, wbsTreeContract.getProjectId())
@@ -1031,7 +1031,7 @@ public class InformationWriteQueryController extends BladeController {
             List<WbsTreeContract> rootNodes = list.stream().filter(f -> ObjectUtil.isNotEmpty(f.getParentId()) && f.getParentId() == 0).collect(Collectors.toList());
             List<InformationQuery> infos = new ArrayList<>();
             int sort = 2;
-            this.diySortRecursion(list, rootNodes, sort, informationQueries, infos);
+            //this.diySortRecursion(list, rootNodes, sort, informationQueries, infos);
 
             //修改资料查询sort、节点sort
             for (InformationQuery info : infos) {
@@ -1055,13 +1055,13 @@ public class InformationWriteQueryController extends BladeController {
                     }
                 }
             }
-            return R.data(true);
-        }
-        return R.data(false);
+            */
+
+        return R.status(wbsTreeContractClient.diySort(sortLists));
     }
 
     //递归排序
-    private void diySortRecursion(List<WbsTreeContract> list, List<WbsTreeContract> rootNodes, int sort, List<InformationQuery> informationQueries, List<InformationQuery> infos) {
+    /*private void diySortRecursion(List<WbsTreeContract> list, List<WbsTreeContract> rootNodes, int sort, List<InformationQuery> informationQueries, List<InformationQuery> infos) {
         if (ObjectUtil.isNotEmpty(rootNodes)) {
             List<WbsTreeContract> parentNodes = new ArrayList<>();
             for (WbsTreeContract wbsTreeContract : list) {
@@ -1087,7 +1087,7 @@ public class InformationWriteQueryController extends BladeController {
                 this.diySortRecursion(list, parentNodes, sort, informationQueries, infos);
             }
         }
-    }
+    }*/
 
     /**
      * 复制节点
@@ -1160,7 +1160,6 @@ public class InformationWriteQueryController extends BladeController {
                         newData.setOldId(node.getId().toString());
                     }
 
-
                     //设置新ID
                     if (new Integer("1").equals(node.getType())) {
                         //如果是节点类型才重塑ID
@@ -1188,6 +1187,14 @@ public class InformationWriteQueryController extends BladeController {
                     newData.setPdfUrl(null);
                     newData.setCreateUser(AuthUtil.getUserId());
 
+                    //获取当前所有复制的节点的最大sort
+                    String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
+                    List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+                    List<Integer> collect = query.stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
+                    Integer max = collect.stream().reduce(collect.get(0), Integer::max);
+                    //设置sort
+                    newData.setSort(max);
+
                     //重塑父节点关联关系
                     this.restoreParent(newData, oldToNewIdMap);
 
@@ -1393,14 +1400,14 @@ public class InformationWriteQueryController extends BladeController {
             @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<List<WbsTreeContractTreeVOS>> queryMappingStructureTree(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
-        List<WbsTreeContractTreeVOS> result = this.queryContractTree(parentId, contractId, contractIdRelation);
+        List<WbsTreeContractTreeVOS> result = this.queryContractTree(parentId, contractId, contractIdRelation, null);
         if (result.size() == 1) {
             //只有一个子节点,继续向下
             int size;
             WbsTreeContractTreeVOS vos = result.get(0);
             do {
                 try {
-                    List<WbsTreeContractTreeVOS> childResult = this.queryContractTree(vos.getId().toString(), contractId, vos.getContractIdRelation());
+                    List<WbsTreeContractTreeVOS> childResult = this.queryContractTree(vos.getId().toString(), contractId, vos.getContractIdRelation(), null);
 
                     vos.setChildren(childResult);
                     size = childResult.size();
@@ -1682,6 +1689,14 @@ public class InformationWriteQueryController extends BladeController {
                     newData.setIsTypePrivatePid(half.getPKeyId());
                 }
 
+                //获取当前所有复制的节点的最大sort
+                String sql = "select sort from m_wbs_tree_contract where contract_id = '" + treeContract.getContractId() + "' and (id = '" + half.getId() + "' or old_id = '" + half.getId() + "')";
+                List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+                List<Integer> collect = query.stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
+                Integer max = collect.stream().reduce(collect.get(0), Integer::max);
+                //设置sort
+                newData.setSort(max);
+
                 //设置节点名称
                 for (AddContractTreeNodeVO.Node addVO : selectList) {
                     if (half.getPKeyId().toString().equals(addVO.getPrimaryKeyId())) {
@@ -1969,9 +1984,9 @@ public class InformationWriteQueryController extends BladeController {
 
         if (!new Integer("6").equals(node.getNodeType()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())) {
             //不是工序,则查询当前节点下的所有填报节点
-            if (node.getParentId() == 0){
+            if (node.getParentId() == 0) {
                 String contractId = node.getContractId();
-                List<WbsTreeContract> treeS = wbsTreeContractClient.getContractWbsTreeByParentId(node.getId().toString(),contractId);
+                List<WbsTreeContract> treeS = wbsTreeContractClient.getContractWbsTreeByParentId(node.getId().toString(), contractId);
                 for (WbsTreeContract tree : treeS) {
                     List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(tree.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
                     if (queryDataResult != null && queryDataResult.size() > 0) {
@@ -1979,7 +1994,7 @@ public class InformationWriteQueryController extends BladeController {
                         queryDataResult.clear();
                     }
                 }
-            }else {
+            } else {
                 List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
                 if (StringUtils.isNotEmpty(vo.getIsFirst())) {
                     //如果是首件列表请求,则删掉没有标记为首件的数据
@@ -2015,7 +2030,7 @@ public class InformationWriteQueryController extends BladeController {
         if (StringUtils.isNotEmpty(primaryKeyId)) {
             parentId = primaryKeyId;
         }
-        List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation);
+        List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation, null);
         rootTreeNode.removeIf(vos -> (vos.getNodeType() != null && vos.getNodeType() == 111));
 
         return R.data(rootTreeNode);
@@ -2031,13 +2046,18 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperation(value = "获取当前合同段的划分树")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
-            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
+            @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
+            @ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
     })
-    public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
+    public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String primaryKeyId,
+                                                                                   @RequestParam String parentId,
+                                                                                   @RequestParam String contractId,
+                                                                                   @RequestParam String contractIdRelation,
+                                                                                   String classifyType) {
         if (StringUtils.isNotEmpty(primaryKeyId)) {
             parentId = primaryKeyId;
         }
-        return R.data(this.queryContractTree(parentId, contractId, contractIdRelation));
+        return R.data(this.queryContractTree(parentId, contractId, contractIdRelation, classifyType));
     }
 
     /**
@@ -2082,7 +2102,7 @@ public class InformationWriteQueryController extends BladeController {
             @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
     })
     public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
-        List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation);
+        List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation, null);
         //查询被标记为首件的数据
         rootTreeNode = rootTreeNode.stream().filter(WbsTreeContractTreeVOS::getIsFirst).collect(Collectors.toList());
 
@@ -2092,7 +2112,7 @@ public class InformationWriteQueryController extends BladeController {
     /**
      * 查询合同段划分树公共代码
      */
-    private List<WbsTreeContractTreeVOS> queryContractTree(String parentId, String contractId, String contractIdRelation) {
+    private List<WbsTreeContractTreeVOS> queryContractTree(String parentId, String contractId, String contractIdRelation, String classifyType) {
         List<WbsTreeContractTreeVOS> rootTreeNode;
 
         //获取合同段,检查是否是监理合同段
@@ -2109,14 +2129,14 @@ public class InformationWriteQueryController extends BladeController {
                 //原始classify=2时查不出数量统计,所以改成传1
                 if (StringUtils.isNotEmpty(parentId)) {
                     //子节点
-                    rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, parentId, 1);
+                    rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, parentId, Integer.parseInt(classifyType));
                 } else {
                     //根节点
-                    rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, "0", 1);
+                    rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, "0", Integer.parseInt(classifyType));
 
                     //设置根节点数量统计
                     for (WbsTreeContractTreeVOS root : rootTreeNode) {
-                        List<WbsTreeContractTreeVOS> rootZi = this.informationQueryService.queryContractTreeSupervision(Func.toStrList(root.getContractIdRelation()), root.getId().toString(), 1);
+                        List<WbsTreeContractTreeVOS> rootZi = this.informationQueryService.queryContractTreeSupervision(Func.toStrList(root.getContractIdRelation()), root.getId().toString(), Integer.parseInt(classifyType));
                         List<Long> collect = rootZi.stream().map(WbsTreeContractTreeVOS::getSubmitCounts).collect(Collectors.toList());
                         Long reduce = collect.stream().reduce(0L, Long::sum);
                         root.setSubmitCounts(reduce);

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

@@ -277,13 +277,16 @@ public class MessageWarningController extends BladeController {
         for (Map.Entry<String, String> entry : message) {
             String userId = entry.getKey();
             String projectAndContractId = entry.getValue();
-
-            if (StringUtils.isNotEmpty(projectAndContractId) && StringUtils.isNotEmpty(userId)) {
-
+            if (projectAndContractId.contains(",") && StringUtils.isNotEmpty(userId)) {
+                //客户端
                 String projectId = projectAndContractId.split(",")[0];
                 String contractId = projectAndContractId.split(",")[1];
                 Map<String, String> stringMap = iTaskService.getTaskCount(projectId, contractId, userId);
                 maps.add(stringMap);
+            } else {
+                //后管
+                Map<String, String> stringMap = iTaskService.getTaskCount(null, null, userId);
+                maps.add(stringMap);
             }
         }
 
@@ -292,6 +295,7 @@ public class MessageWarningController extends BladeController {
             webSocketMap.get(userId).sendMessage(JSON.toJSONString(map));
             logger.info("给用户{}重发消息{}", userId, map);
         }
+
         logger.info("定时重发消息WebSocket,reSendMessage()方法执行结束");
     }
 

+ 80 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/MetadataController.java

@@ -0,0 +1,80 @@
+package org.springblade.business.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.MetadataClassification;
+import org.springblade.business.mapper.MetadataClassificationMapper;
+import org.springblade.business.service.IMetadataClassificationService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/metadata")
+@Api(value = "元数据容器", tags = "元数据容器接口")
+public class MetadataController extends BladeController {
+    private final IMetadataClassificationService iMetadataClassificationService;
+    private final MetadataClassificationMapper metadataClassificationMapper;
+
+
+    @GetMapping("/classification/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "元数据容器分类详情", notes = "传入分类类型")
+    public R<IPage<MetadataClassification>> classificationDetail(@ApiIgnore @RequestParam Map<String, Object> log, Query query) {
+        IPage<MetadataClassification> page = iMetadataClassificationService.page(Condition.getPage(query), Condition.getQueryWrapper(log, MetadataClassification.class));
+        return R.data(page);
+    }
+
+    @PostMapping("/classification/submit")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "元数据新增或修改", notes = "传入MetadataClassification")
+    public R<Object> classificationSubmit(@RequestBody MetadataClassification obj) {
+        return R.status(iMetadataClassificationService.classificationSubmit(obj));
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(iMetadataClassificationService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    /**
+     * 设置分类
+     */
+    @PostMapping("/allocation")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "设置分类", notes = "传入ids")
+    public R allocation(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,@RequestParam String type) {
+        return R.status(iMetadataClassificationService.updateMetadataBytype(Func.toLongList(ids),type));
+    }
+
+    /**
+     * 查看没有设置当前分类的元数据容器
+     */
+    @GetMapping("/allocation/detail")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "元数据容器分类详情", notes = "传入分类类型")
+    public R<IPage<MetadataClassification>> allocationDetail(@ApiIgnore @RequestParam String fileStorage, Query query) {
+        QueryWrapper<MetadataClassification> metadata = new QueryWrapper<>();
+        metadata.lambda().ne(MetadataClassification :: getFileStorageType,fileStorage).eq(MetadataClassification::getIsDeleted,0);
+        IPage<MetadataClassification> page = iMetadataClassificationService.page(Condition.getPage(query), metadata);
+        return R.data(page);
+    }
+}

+ 75 - 47
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -77,10 +77,22 @@ public class NeiYeController {
                 node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(Long.parseLong(queryVO.getWbsIds().get(0)), Long.parseLong(contractId));
             }
             //不是工序,则查询当前节点下的所有填报节点
-            List<QueryProcessDataVO> queryDataResult;
+            List<QueryProcessDataVO> queryDataResult = new ArrayList<>();
             if(!new Integer("6").equals(node.getNodeType()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
                 //非填报节点
-                queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), contractId);
+                if (node.getParentId() == 0){
+                    String contractI = node.getContractId();
+                    List<WbsTreeContract> treeS = wbsTreeContractClient.getContractWbsTreeByParentId(node.getId().toString(),contractI);
+                    for (WbsTreeContract tree : treeS) {
+                        List<QueryProcessDataVO> dataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(tree.getId().toString(), contract.getContractType(), contractId);
+                        if (dataResult != null && dataResult.size() > 0) {
+                            queryDataResult.addAll(dataResult);
+                            dataResult.clear();
+                        }
+                    }
+                }else {
+                    queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), contractId);
+                }
             } else {
                 //填报节点
                 queryDataResult = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), contract.getContractType());
@@ -91,8 +103,14 @@ public class NeiYeController {
                 queryDataResult.removeIf(query -> StringUtils.isNotEmpty(query.getQueryType()) && "3".equals(query.getQueryType()));
                 //过滤Evaluate
                 queryDataResult.stream().forEach(qdr->{
-                    if ("2".equals(qdr.getStatus()+"")){
+                    Integer status = qdr.getStatus();
+                    if (status == null){
+                        qdr.setStatus(0);
+                        qdr.setEvaluate("false");
+                    }else if (status.equals(2)){
                         qdr.setEvaluate("true");
+                    }else {
+                        qdr.setEvaluate("false");
                     }
                 });
                 String isEvaluate = String.valueOf(queryVO.getIsEvaluate());
@@ -106,9 +124,59 @@ public class NeiYeController {
                 //审批状态
                 String taskStatus = queryVO.getTaskStatus();
                 if (!"".equals(taskStatus) && !"null".equals(taskStatus) && taskStatus != null) {
-                    Integer status = Integer.parseInt(taskStatus) - 1;
+                    Integer sta = Integer.valueOf(taskStatus) -1;
+                    queryDataResult = queryDataResult.stream()
+                            .filter(qdr->sta.equals(qdr.getStatus())).collect(Collectors.toList());
+                }
+                if (queryDataResult.size() <= 0){
+                    return R.data(300, null, "未查询到数据");
+                }
+                //过滤输入框条件
+                String queryStr = queryVO.getQueryStr();
+                if (!"".equals(queryStr) && !"null".equals(queryStr) && queryStr != null){
+                    String contractId1 = queryVO.getContractId();
+                    queryDataResult = queryDataResult.stream()
+                            .filter(qdr->{
+                                StringBuilder str = new StringBuilder();
+                                Map<String, String> map = new HashMap<>();
+                                foreachGetParent(map, idToNodeMap, qdr.getParentId(), contractId1);
+                                str.append(map.get("unitProject"));
+                                if (map.get("partProject") != null && map.get("partProject") != "")
+                                    str.append(map.get("partProject"));
+                                if (map.get("partChildProject") != null && map.get("partChildProject") != "")
+                                    str.append(map.get("partChildProject"));
+                                if (map.get("subentryProject") != null && map.get("subentryProject") != "")
+                                    str.append(map.get("subentryProject"));
+                                if (map.get("subentryChildProject") != null && map.get("subentryChildProject") != "")
+                                    str.append(map.get("subentryChildProject"));
+                                if (  qdr.getTitle() != null &&   qdr.getTitle()!= "")
+                                    str.append(qdr.getTitle());
+                                return str.toString().toUpperCase().contains(queryStr.toUpperCase())?true:false;
+                            }).collect(Collectors.toList());
+                }
+                if (queryDataResult.size() <= 0){
+                    return R.data(300, null, "未查询到数据");
+                }
+                //上报批次
+                for (QueryProcessDataVO vo : queryDataResult) {
+                    if (vo.getInformationQueryId() != null && vo.getStatus() != 0){
+                        List<Task> tasks = taskClient.queryTaskListByFormDataId(vo.getInformationQueryId());
+                        Task task = new Task();
+                        if (tasks == null || tasks.size() <= 0){
+                            task.setBatch(0);
+                        }else {
+                            tasks = tasks.stream().sorted(Comparator.comparing(e -> e.getCreateTime())).collect(Collectors.toList());
+                            task = tasks.get(tasks.size() - 1);
+                        }
+                        vo.setReportNumber(task.getBatch()+"");
+                    }else {
+                        vo.setReportNumber("0");
+                    }
+                }
+                String reportNumber = queryVO.getReportNumber();
+                if (!"".equals(reportNumber) && !"null".equals(reportNumber) && reportNumber != null) {
                     queryDataResult = queryDataResult.stream()
-                            .filter(qdr->status.equals(qdr.getStatus())).collect(Collectors.toList());
+                            .filter(qdr->reportNumber.equals(qdr.getReportNumber())).collect(Collectors.toList());
                 }
                 if (queryDataResult.size() <= 0){
                     return R.data(300, null, "未查询到数据");
@@ -147,46 +215,6 @@ public class NeiYeController {
                         }
                     }
                     //todo 当前缺少是否关联评定、是否关联试验 =================================
-                    //过滤输入框条件
-                    String queryStr = queryVO.getQueryStr();
-                    if (!"".equals(queryStr) && !"null".equals(queryStr) && queryStr != null){
-                        StringBuilder str = new StringBuilder();
-                        str.append(map.get("unitProject"));
-                        if (map.get("partProject") != null && map.get("partProject")!= "")
-                            str.append(map.get("partProject"));
-                        if (map.get("partChildProject") != null && map.get("partChildProject")!= "")
-                            str.append(map.get("partChildProject"));
-                        if (map.get("subentryProject") != null && map.get("subentryProject")!= "")
-                            str.append(map.get("subentryProject"));
-                        if (map.get("subentryChildProject") != null && map.get("subentryChildProject")!= "")
-                            str.append(map.get("subentryChildProject"));
-                        if (  vo.getTitle() != null &&   vo.getTitle()!= "")
-                            str.append(vo.getTitle());
-                        if (!str.toString().toUpperCase().contains(queryStr.toUpperCase()))
-                            continue;
-                    }
-                    //上报批次
-                    if (vo.getInformationQueryId() != null){
-                        List<Task> tasks = taskClient.queryTaskListByFormDataId(vo.getInformationQueryId());
-                        Task task;
-                        if (tasks == null || tasks.size() <= 0){
-                            task = new Task();
-                            task.setBatch(0);
-                        }else {
-                            tasks = tasks.stream().sorted(Comparator.comparing(e -> e.getCreateTime())).collect(Collectors.toList());
-                            task = tasks.get(tasks.size() - 1);
-                        }
-                        map.put("reportNumber",task.getBatch()+"");
-                        String reportNumber = queryVO.getReportNumber();
-                        if (!"".equals(reportNumber) && !"null".equals(reportNumber) && reportNumber != null) {
-                            int anInt = Integer.parseInt(reportNumber);
-                            if (task.getBatch() != anInt){
-                                continue;
-                            }
-                        }
-                    }else {
-                        map.put("reportNumber","0");
-                    }
                     //新增列表数据
                     neiYeLedgerVOList.add(new NeiYeLedgerVO(map.get("unitProject"),
                             map.get("partProject"),
@@ -199,7 +227,7 @@ public class NeiYeController {
                             new Integer("1").equals(vo.getStatus()) ? "待审批" : new Integer("2").equals(vo.getStatus()) ? "已审批" : "未上报",
                             vo.getEvaluate(),
                             "false",
-                            map.get("reportNumber")));
+                            vo.getReportNumber()));
                 }
                 //转换为page信息
                 Query query = new Query();
@@ -222,7 +250,7 @@ public class NeiYeController {
      * @param parentId 父节点
      */
     private void foreachGetParent(Map<String,String> resultMap, Map<String,WbsTreeContractTreeVOS> vosMap, String parentId, String contractId){
-        if(vosMap.containsKey(parentId) || !"0".equals(parentId.trim())){
+        if(vosMap.containsKey(parentId)){
             //存在父节点信息,获取
             WbsTreeContractTreeVOS vos = vosMap.get(parentId);
             if(new Integer("1").equals(vos.getNodeType())){

+ 19 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/UserOpinionController.java

@@ -1,5 +1,6 @@
 package org.springblade.business.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -14,9 +15,8 @@ import org.springblade.business.entity.UserOpinionFile;
 import org.springblade.business.entity.UserOpinionFlow;
 import org.springblade.business.entity.UserOpinionGood;
 import org.springblade.business.feign.MessageWarningClient;
-import org.springblade.business.service.IUserOpinionFileService;
-import org.springblade.business.service.IUserOpinionFlowService;
-import org.springblade.business.service.IUserOpinionGoodService;
+import org.springblade.business.service.*;
+import org.springblade.business.socket.WebSocket;
 import org.springblade.business.vo.MessageWarningVO;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.mp.support.Condition;
@@ -26,6 +26,7 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ProjectInfo;
@@ -43,9 +44,9 @@ import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.business.entity.UserOpinion;
 import org.springblade.business.vo.UserOpinionVO;
-import org.springblade.business.service.IUserOpinionService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.io.IOException;
 import java.util.*;
 
 /**
@@ -80,6 +81,10 @@ public class UserOpinionController extends BladeController {
 
 	private final ProjectClient projectClient;
 
+	private final ITaskService iTaskService;
+
+	private final WebSocket webSocket;
+
 	/**
 	 * 取消点赞
 	 * @param userOpinionId 工单ID
@@ -285,6 +290,16 @@ public class UserOpinionController extends BladeController {
 					0
 			));
 
+			//通过WebSocket推送数量条数,推送到对应维护人的工单反馈中
+			if (ObjectUtil.isNotEmpty(userOpinionVo.getProjectId()) && ObjectUtil.isNotEmpty(userOpinionVo.getContractId()) && ObjectUtil.isNotEmpty(manageUser)) {
+				Map<String, String> stringMap = iTaskService.getTaskCount(userOpinionVo.getProjectId().toString(), userOpinionVo.getContractId().toString(), manageUser.toString());
+				try {
+					webSocket.sendMessageByUserId(manageUser.toString(), JSON.toJSONString(stringMap));
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+
 		}catch (Exception e){
 			e.printStackTrace();
 		}

+ 1 - 2
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -46,7 +46,7 @@ public class InformationQueryClientImpl implements InformationQueryClient {
     }
 
     @Override
-    public void saveData(String id, String projectId, String contractId, String classify, String link,String trialProjectName) {
+    public void saveData(String id, String projectId, String contractId, String classify, String link, String trialProjectName) {
         InformationQuery obj = new InformationQuery();
         obj.setId(SnowFlakeUtil.getId());
         obj.setWbsId(Long.valueOf(id));
@@ -68,5 +68,4 @@ public class InformationQueryClientImpl implements InformationQueryClient {
         updateWrapper.eq(InformationQuery::getContractId, contractId);
         iInformationQueryService.update(null, updateWrapper);
     }
-
 }

+ 7 - 5
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -32,6 +32,7 @@
         <result column="e_visa_pdf_url" property="eVisaPdfUrl"/>
         <result column="table_id" property="tableId"/>
         <result column="link_merge_pdf_url" property="linkMergePdfUrl"/>
+        <result column="sj_record_ids" property="sjRecordIds"/>
         <result column="sort" property="sort"/>
     </resultMap>
 
@@ -172,6 +173,7 @@
         and wtc.node_type != 111
         and wtc.type = 1
         and wtc.is_deleted= '0'
+        ORDER BY wtc.sort,wtc.create_time
     </select>
 
     <select id="queryContractTree" resultMap="queryContractTreeMap">
@@ -257,7 +259,7 @@
         AND wtc.parent_id = #{parentId}
         AND wtc.node_type != 111
         AND wtc.is_deleted= '0'
-        ORDER BY wtc.sort
+        ORDER BY wtc.sort,wtc.create_time
     </select>
 
     <select id="queryProcessDataByPrimaryKeyIdAndClassify" resultMap="queryProcessDataMap">
@@ -395,8 +397,7 @@
             query.file_user_id_and_name,
             query.pdf_url,
             query.e_visa_pdf_url,
-            query.sort as qSort,
-            (select sort from m_wbs_tree_contract c where c.p_key_id = query.wbs_id ) as sort
+            query.sj_record_ids
         from
         (
             select
@@ -411,7 +412,8 @@
                 date_format(create_time,'%Y-%m-%d') as createTimes,
                 pdf_url,
                 e_visa_pdf_url,
-                wbs_id
+                wbs_id,
+                sj_record_ids
             from u_information_query
             where
                 is_deleted = 0
@@ -436,7 +438,7 @@
         <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
             and query.createTimes between #{query.startTime} and #{query.endTime}
         </if>
-        order by sort,qSort
+        order by create_time desc
         limit #{current}, #{size}
     </select>
 

+ 20 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.java

@@ -0,0 +1,20 @@
+package org.springblade.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.MetadataClassification;
+import org.springblade.business.entity.TrialContainerClassification;
+
+import java.util.HashMap;
+import java.util.List;
+
+public interface MetadataClassificationMapper extends BaseMapper<MetadataClassification> {
+
+
+    MetadataClassification classificationDetail(@Param("type") Integer type);
+    void alterTabFiled(@Param("tabName") String containerInitTabName, @Param("fieldName") String initTabFieldName, @Param("fieldType") String fieldType, @Param("fieldLength") Integer fieldLength);
+    void updateFiledType(@Param("tabName") String containerInitTabName, @Param("fieldName") String initTabFieldName, @Param("fieldType") String fieldType, @Param("fieldLength") Integer fieldLength);
+    MetadataClassification selectMetadaOne(@Param("containerName") String containerName,@Param("code") String code,@Param("fieldKey") String fieldKey,@Param("id") Long id);
+
+    void updateMetadataBytype(@Param("ids") List<Long> ids, @Param("type") String type);
+}

+ 78 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/MetadataClassificationMapper.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.MetadataClassificationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ResultEntityMap" type="org.springblade.business.entity.MetadataClassification">
+        <result column="id" property="id"/>
+        <result column="container_name" property="containerName"/>
+        <result column="field_type" property="fieldType"/>
+        <result column="code" property="code"/>
+        <result column="container_type" property="containerType"/>
+        <result column="capture_mode" property="captureMode"/>
+        <result column="mandatory_type" property="mandatoryType"/>
+        <result column="file_storage_type" property="fileStorageType"/>
+        <result column="field_key" property="fieldKey"/>
+        <result column="container_init_tab_name" property="containerInitTabName"/>
+        <result column="sort" property="sort"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+    <insert id="insertData">
+        insert into ${tabName}(id,field_calibration_time,${fieldKeys}) values(${id},#{time},${fieldValues})
+    </insert>
+
+    <update id="updateFiledType">
+        alter table ${tabName} MODIFY ${fieldName} ${fieldType}(${fieldLength})
+    </update>
+
+    <update id="alterTabFiled">
+        alter table ${tabName} add column ${fieldName} ${fieldType}(${fieldLength})
+    </update>
+
+
+    <update id="deleteTableField">
+        alter table ${tabName} drop column ${fieldName}
+    </update>
+
+    <update id="updateData">
+        update ${tabName} set field_calibration_time = #{time}
+        <if test="values != null and values != '' ">${values}</if>
+        where id = ${id}
+    </update>
+
+    <delete id="removeData">
+        delete from ${tabName} where id in
+        <foreach collection="ids" item="ids" index="ids" open="(" separator="," close=")">
+            ${ids}
+        </foreach>
+    </delete>
+
+    <select id="selectTabDataAll" resultType="java.util.HashMap">
+        select * from ${tabName} order by id
+    </select>
+
+    <select id="selectLikeByFieldKey" resultType="java.util.HashMap">
+        select * from ${tabName} where ${fieldKey} like concat('%',#{queryValue},'%') order by id limit ${current},${size}
+    </select>
+
+    <select id="classificationDetail" resultMap="ResultEntityMap">
+        select * from u_metadata_classification where file_storage_type = #{type} order by create_time desc
+    </select>
+    <select id="selectMetadaOne" resultMap="ResultEntityMap">
+        select * from u_metadata_classification where (container_name = #{containerName} or code = #{code} or field_key = #{fieldKey} )
+        <if test="id != null and id != '' ">and id != #{id} </if>
+        order by create_time desc limit 1
+    </select>
+
+    <update id="updateMetadataBytype">
+        update u_metadata_classification set file_storage_type = CONCAT(file_storage_type, ',', #{type})
+        where id in(${ids}) and locate(#{type},file_storage_type) = 0
+    </update>
+</mapper>

+ 17 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IMetadataClassificationService.java

@@ -0,0 +1,17 @@
+package org.springblade.business.service;
+
+
+import org.springblade.business.entity.MetadataClassification;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+public interface IMetadataClassificationService extends BaseService<MetadataClassification> {
+
+
+    MetadataClassification classificationDetail(Integer type);
+
+    boolean classificationSubmit(MetadataClassification obj);
+
+    boolean updateMetadataBytype(List<Long> ids,String type);
+}

+ 34 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -149,7 +149,6 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                 //获取pdfUrl
                 List<String> pdfUrls = linkList.stream().map(query -> StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl()).distinct().collect(Collectors.toList());
 
-
                 String mergeFileName = SnowFlakeUtil.getId() + ".pdf", margePdfPath = file_path + "/pdf//" + mergeFileName;
                 //合并
                 FileUtils.mergePdfPublicMethods(pdfUrls, margePdfPath);
@@ -228,6 +227,11 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                 this.informationQueryFileService.save(file);
             }
 
+            List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+            if (linkIds.size() > 0) {
+                oldData.setSjRecordIds(StringUtils.join(linkIds, ","));
+            }
+
             //修改数据
             this.baseMapper.updateById(oldData);
 
@@ -266,6 +270,11 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
             newData.setTableId(tableId);
 
+            List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+            if (linkIds.size() > 0) {
+                newData.setSjRecordIds(StringUtils.join(linkIds, ","));
+            }
+
             //新增附件
             InformationQueryFile file = new InformationQueryFile();
             file.setQueryId(Long.parseLong(businessId));
@@ -320,6 +329,12 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
                 oldData.setUpdateTime(new Date());
                 oldData.setUpdateUser(user.getUserId());
+
+                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                if (linkIds.size() > 0) {
+                    oldData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                }
+
                 //修改数据
                 this.baseMapper.updateById(oldData);
             } else {
@@ -349,6 +364,12 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                 newData.setSourceType(sourceType);
                 newData.setCreateUser(user.getUserId());
                 newData.setCreateTime(new Date());
+
+                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                if (linkIds.size() > 0) {
+                    newData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                }
+
                 //保存数据
                 this.baseMapper.insert(newData);
             }
@@ -471,6 +492,18 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                         //vor.setReportNumber(String.valueOf(tasks.get(0).getBatch()));
                     }
                 }
+
+                //校验关联的工序节点是否全都已审批
+                if (StringUtils.isNotEmpty(vor.getSjRecordIds())) {
+                    List<InformationQuery> informationQueryList = this.baseMapper.selectBatchIds(Func.toLongList(vor.getSjRecordIds()));
+                    List<InformationQuery> collect = informationQueryList.stream().filter(f -> f.getStatus().equals(2)).collect(Collectors.toList());
+                    if (collect.size() == informationQueryList.size()) {
+                        vor.setIsApprove(true);
+                    } else {
+                        vor.setIsApprove(false);
+                    }
+                }
+
             });
             page.setRecords(voResult);
             page.setTotal(count);

+ 96 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java

@@ -0,0 +1,96 @@
+package org.springblade.business.service.impl;
+
+
+import lombok.AllArgsConstructor;
+import org.springblade.business.dto.TrialContainerClassificationDTO;
+
+import org.springblade.business.entity.MetadataClassification;
+import org.springblade.business.mapper.MetadataClassificationMapper;
+import org.springblade.business.service.IMetadataClassificationService;
+
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class MetadataClassificationServiceImpl
+        extends BaseServiceImpl<MetadataClassificationMapper, MetadataClassification>
+        implements IMetadataClassificationService {
+
+
+    @Override
+    public MetadataClassification classificationDetail(Integer type) {
+        return baseMapper.classificationDetail(type);
+    }
+    @Override
+    public boolean classificationSubmit(MetadataClassification obj) {
+
+        try {
+            BladeUser user = AuthUtil.getUser();
+//            obj.setFileStorageType("");
+
+            if(ObjectUtil.isEmpty(obj.getId())){
+                MetadataClassification metadataClassification = baseMapper.selectMetadaOne(obj.getContainerName(), obj.getCode(),
+                        "file_key_" + obj.getCode().toLowerCase(),null);
+                if(metadataClassification != null){
+                    return false;
+                }
+                obj.setId(SnowFlakeUtil.getId());
+                obj.setCreateUser(user.getUserId());
+                obj.setCreateTime(new Date());
+                obj.setTenantId(user.getTenantId());
+                obj.setIsDeleted(BladeConstant.DB_NOT_DELETED);
+                obj.setContainerInitTabName("u_metadata_file");
+                obj.setFieldKey("file_key_"+obj.getCode().toLowerCase());
+
+                String filetype = "varchar";
+                Integer fileLength = 255;
+                if(obj.getFieldType().equals("1")){
+                    filetype = "varchar";
+                }else if(obj.getFieldType().equals("4")){
+                    filetype = "datetime";
+                    fileLength = 6;
+                }
+                int insert = baseMapper.insert(obj);
+                baseMapper.alterTabFiled(obj.getContainerInitTabName(),obj.getFieldKey(),filetype,fileLength);
+            }else{
+                MetadataClassification metadataClassification = baseMapper.selectMetadaOne(obj.getContainerName(), obj.getCode(),
+                        "file_key_" + obj.getCode().toLowerCase(),obj.getId());
+                if(metadataClassification != null){
+                    return false;
+                }
+                String filetype = "varchar";
+                Integer fileLength = 255;
+                if(obj.getFieldType().equals("1")){
+                    filetype = "varchar";
+                }else if(obj.getFieldType().equals("4")){
+                    filetype = "datetime";
+                    fileLength = 6;
+                }
+                obj.setUpdateTime(new Date());
+                obj.setUpdateUser(user.getUserId());
+                baseMapper.updateById(obj);
+                baseMapper.updateFiledType(obj.getContainerInitTabName(),obj.getFieldKey(),filetype,fileLength);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean updateMetadataBytype(List<Long> ids, String type) {
+        baseMapper.updateMetadataBytype(ids,type);
+        return false;
+    }
+}

+ 55 - 44
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
 import org.springblade.business.entity.*;
 import org.springblade.business.mapper.TaskMapper;
 import org.springblade.business.service.*;
+import org.springblade.business.vo.BusinessUserOpinionVO;
 import org.springblade.business.vo.MessageWarningVO;
 import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskVO;
@@ -89,6 +90,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     private final ITaskBatchService taskBatchService;
 
+    private final UserOpinionServiceImpl userOpinionService;
+
     @Override
     public List<TaskParallel> queryApprovalUser(String formDataIds) {
         //返回结果
@@ -285,51 +288,58 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     @Override
     public Map<String, String> getTaskCount(String projectId, String contractId, String userId) {
-        List<Task> tasks = this.baseMapper.selectList(Wrappers.<Task>lambdaQuery()
-                .eq(Task::getProjectId, projectId)
-                .eq(Task::getContractId, contractId)
-                .eq(Task::getStatus, 1));
-
-        List<String> collect = tasks.stream().map(Task::getProcessInstanceId).collect(Collectors.toList());
-
-        long aLong = 0L;
-        if (collect.size() > 0) {
-            for (String id : collect) {
-                Long row = taskParallelService.getBaseMapper().selectCount(Wrappers.<TaskParallel>lambdaQuery()
-                        .eq(TaskParallel::getProcessInstanceId, id)
-                        .eq(TaskParallel::getStatus, 1)
-                        .eq(TaskParallel::getTaskUser, userId)
-                );
-                if (row == 1) {
-                    aLong++;
+        if (StringUtils.isNotEmpty(projectId) && StringUtils.isNotEmpty(contractId)) {
+            List<Task> tasks = this.baseMapper.selectList(Wrappers.<Task>lambdaQuery()
+                    .eq(Task::getProjectId, projectId)
+                    .eq(Task::getContractId, contractId)
+                    .eq(Task::getStatus, 1));
+
+            List<String> collect = tasks.stream().map(Task::getProcessInstanceId).collect(Collectors.toList());
+
+            long aLong = 0L;
+            if (collect.size() > 0) {
+                for (String id : collect) {
+                    Long row = taskParallelService.getBaseMapper().selectCount(Wrappers.<TaskParallel>lambdaQuery()
+                            .eq(TaskParallel::getProcessInstanceId, id)
+                            .eq(TaskParallel::getStatus, 1)
+                            .eq(TaskParallel::getTaskUser, userId)
+                    );
+                    if (row == 1) {
+                        aLong++;
+                    }
                 }
             }
-        }
 
-        List<MessageWarning> messageWarnings = messageWarningService.getBaseMapper().selectList(Wrappers.<MessageWarning>lambdaQuery()
-                .eq(MessageWarning::getProjectId, projectId)
-                .eq(MessageWarning::getContractId, contractId)
-                .eq(MessageWarning::getPushUser, userId)
-                .eq(MessageWarning::getIsRead, 0)
-        );
-
-        long messageCount1 = messageWarnings.stream().filter(f -> f.getType().equals(1)).count();
-        long messageCount2 = messageWarnings.stream().filter(f -> f.getType().equals(2)).count();
-        long messageCount3 = messageWarnings.stream().filter(f -> f.getType().equals(3)).count();
-        long messageCount4 = messageWarnings.stream().filter(f -> f.getType().equals(4)).count();
-        long messageCount5 = messageWarnings.stream().filter(f -> f.getType().equals(5)).count();
-
-        Map<String, String> map = new HashMap<>();
-        map.put("allCount", String.valueOf(aLong + messageWarnings.size()));//任务管理
-        map.put("taskCount", String.valueOf(aLong));//任务查看
-        map.put("messageCount", String.valueOf(messageWarnings.size()));//消息提醒
-        map.put("messageCount_1", String.valueOf(messageCount1));//任务催办
-        map.put("messageCount_2", String.valueOf(messageCount2));//监测预警
-        map.put("messageCount_3", String.valueOf(messageCount3));//废除通知
-        map.put("messageCount_4", String.valueOf(messageCount4));//工单反馈
-        map.put("messageCount_5", String.valueOf(messageCount5));//系统消息
-        map.put("userId", userId);
-        return map;
+            List<MessageWarning> messageWarnings = messageWarningService.getBaseMapper().selectList(Wrappers.<MessageWarning>lambdaQuery()
+                    .eq(MessageWarning::getProjectId, projectId)
+                    .eq(MessageWarning::getContractId, contractId)
+                    .eq(MessageWarning::getPushUser, userId)
+                    .eq(MessageWarning::getIsRead, 0)
+            );
+            long messageCount1 = messageWarnings.stream().filter(f -> f.getType().equals(1)).count();
+            long messageCount2 = messageWarnings.stream().filter(f -> f.getType().equals(2)).count();
+            long messageCount3 = messageWarnings.stream().filter(f -> f.getType().equals(3)).count();
+            long messageCount4 = messageWarnings.stream().filter(f -> f.getType().equals(4)).count();
+            long messageCount5 = messageWarnings.stream().filter(f -> f.getType().equals(5)).count();
+
+            Map<String, String> map = new HashMap<>();
+            map.put("allCount", String.valueOf(aLong + messageWarnings.size()));//任务管理
+            map.put("taskCount", String.valueOf(aLong));//任务查看
+            map.put("messageCount", String.valueOf(messageWarnings.size()));//消息提醒
+            map.put("messageCount_1", String.valueOf(messageCount1));//任务催办
+            map.put("messageCount_2", String.valueOf(messageCount2));//监测预警
+            map.put("messageCount_3", String.valueOf(messageCount3));//废除通知
+            map.put("messageCount_4", String.valueOf(messageCount4));//工单反馈
+            map.put("messageCount_5", String.valueOf(messageCount5));//系统消息
+            map.put("userId", userId);
+            return map;
+        } else {
+            Map<String, String> map = new HashMap<>();
+            List<BusinessUserOpinionVO> businessUserOpinionVOS = userOpinionService.getBaseMapper().queryManageUserOpinionList(userId).stream().filter(f -> f.getIsCurrent().equals(false)).collect(Collectors.toList());
+            map.put("myMessageCount", String.valueOf(businessUserOpinionVOS.size()));//后管消息区-我的消息-未处理
+            map.put("userId", userId);
+            return map;
+        }
     }
 
     /**
@@ -337,7 +347,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
      */
     @Override
     public List<String> queryBatchListTwo(String projectId, String contractId) {
-        return baseMapper.queryBatchListTwo(projectId,contractId);
+        return baseMapper.queryBatchListTwo(projectId, contractId);
     }
 
     @Override
@@ -348,7 +358,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     //@Async
 
     /**
-     *  批量电签接口
+     * 批量电签接口
+     *
      * @param taskApprovalVOS
      * @param userId
      * @throws FileNotFoundException

+ 17 - 4
blade-service/blade-business/src/main/java/org/springblade/business/socket/WebSocket.java

@@ -5,6 +5,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.springblade.business.service.ITaskService;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import cn.hutool.core.util.StrUtil;
@@ -81,15 +82,27 @@ public class WebSocket {
         webSocketMessageMap.put(userId, message);
         logger.info("来自客户端用户:{} 消息:{}", userId, message);
 
-        String projectId = message.split(",")[0];
-        String contractId = message.split(",")[1];
+        String projectId = "";
+        String contractId = "";
+        if (message.contains(",")) {
+            projectId = message.split(",")[0];
+            contractId = message.split(",")[1];
+        } else {
+            //后管处理userId
+            userId = AuthUtil.getUserId().toString();
+            //userId = "1123598821738675201";
+        }
 
-        Map<String, String> stringMap = null;
+        Map<String, String> stringMap;
         if (StringUtils.isNotEmpty(projectId) && StringUtils.isNotEmpty(contractId) && StringUtils.isNotEmpty(userId)) {
+            //客户端
             stringMap = iTaskService.getTaskCount(projectId, contractId, userId);
+        } else {
+            //后管
+            stringMap = iTaskService.getTaskCount(null, null, userId);
         }
 
-        //切换项目合同段,推送当前项目合同段的业务数量
+        //客户端切换项目合同段、后管推送消息
         try {
             webSocketMap.get(userId).sendMessage(JSON.toJSONString(stringMap));
         } catch (IOException e) {

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

@@ -452,8 +452,8 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "tabId", value = "表Id", required = true),
     })
     public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws IOException {
-        //String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        //String file_path = "C:\\Users\\泓创开发\\Desktop";
 
         // 关联 私有项目 wbs 数据信息
         WbsTreePrivate wbsTree = new WbsTreePrivate();
@@ -701,12 +701,42 @@ public class ExcelTabController extends BladeController {
         }
 
         File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+//        File file1 = ResourceUtil.getFile("D:\\develop\\1613737889349238784.html");
         FileInputStream fileInputStream = new FileInputStream(file1);
         String htmlString = IoUtil.readToString(fileInputStream);
         // 解析 style
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        htmlString = htmlString.replaceAll("title", "titlexx");
+
+        // 远程搜索配置
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();
+
+
+        Elements col = doc.select("Col");
         doc.select("Col").remove();
+        ProjectInfo projectInfo = projectInfoService.getById(wbsTreePrivate.getProjectId());
+        // 添加标题显示
+
+        Elements trs = table.select("tr");
+        for (int i = 1; i < 6; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            for (int j = 0; j < tds.size(); j++) {
+                Element data = tds.get(j);
+                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                String style = data.attr("style");
+                if (style.indexOf("font-size") >= 0) {
+                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
+                    if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
+                        trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                        break;
+                    }
+                }
+            }
+        }
+
+
         fileInputStream.close();
         return R.data(table + "");
     }
@@ -1574,10 +1604,10 @@ public class ExcelTabController extends BladeController {
         }
 
         if (theLogJson != null) {
-            String evPdf = theLogJson.getString("eVisaPdfUrl");
-            if(StringUtils.isNotEmpty(evPdf)){
-                return R.data(evPdf);
-            }
+//            String evPdf = theLogJson.getString("eVisaPdfUrl");
+//            if(StringUtils.isNotEmpty(evPdf)){
+//                return R.data(evPdf);
+//            }
 
             theLogId = theLogJson.getString("id");
             //查询对应的html
@@ -1601,7 +1631,7 @@ public class ExcelTabController extends BladeController {
             List<Map<String, Object>> businessDataMapList = this.getTheLogBusinessData(theLogId, nodePrimaryKeyId, recordTime, contractId).getData();
             //PDF路径
             List<String> pdfUrls = new ArrayList<>();
-
+            ProjectInfo projectInfo = projectInfoService.getById(tableNode.getProjectId());
             //处理数据
             for (Map<String, Object> dataMap : businessDataMapList) {
                 // 获取excel流 和 html流
@@ -1609,15 +1639,26 @@ public class ExcelTabController extends BladeController {
                 wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
                 //获取工作表
                 Worksheet sheet = wb.getWorksheets().get(0);
-
                 // 数据不为空 &&
                 if (StringUtils.isNotEmpty(tableNode.getHtmlUrl())) {
                     File htmlFile = ResourceUtil.getFile(tableNode.getHtmlUrl());
+//                    File htmlFile = ResourceUtil.getFile("D:\\develop\\1613737889349238784.html");
                     if (htmlFile.exists()) {
                         String htmlString = IoUtil.readToString(new FileInputStream(htmlFile));
                         Document doc = Jsoup.parse(htmlString);
                         Element table = doc.select("table").first();
                         Elements trs = table.select("tr");
+                        //添加标题
+                        CellRange[] columns = sheet.getMergedCells();
+                        for (int i = 0; i < columns.length; i++) {
+                            CellRange cellRange = columns[i];
+                            System.out.println(cellRange.getStyle().getFont().getSize());
+                            if (cellRange.getStyle().getFont().getSize() >= 12) {
+                                cellRange.setText(projectInfo.getProjectName());
+                                cellRange.getStyle().getFont().setSize(20);
+                                break;
+                            }
+                        }
 
                         if (ObjectUtil.isNotEmpty(dataMap)) {
                             for (String val : dataMap.keySet()) {
@@ -1684,7 +1725,6 @@ public class ExcelTabController extends BladeController {
                                 }
                             }
                         }
-
                         // 组装电签设置
                         QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
                         queryWrapper.eq("type", 2);
@@ -1715,7 +1755,7 @@ public class ExcelTabController extends BladeController {
 
                 Long fileName = SnowFlakeUtil.getId();
                 String onePdfPath = file_path + "/pdf//" + fileName + ".pdf";
-
+//                wb.saveToFile("d://123123.xls", ExcelVersion.Version2010);
                 sheet.saveToPdf(onePdfPath);
 
                 BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName + ".pdf", onePdfPath);
@@ -1855,6 +1895,8 @@ public class ExcelTabController extends BladeController {
             }
         }
 
+
+
         return R.data(resultMapList);
     }
 

+ 3 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java

@@ -430,9 +430,9 @@ public class FirstController extends BladeController {
                 Elements sgTitle = doc.select("el-input[placeholder~=^施工单位]");
                 Elements sgTitle1 = doc.select("el-input[placeholder=安装单位]");
                 sgTitle.addAll(sgTitle1);
-                Elements htdTitle = doc.select("el-input[placeholder~=.*合同段.*]");
-                Elements htdTitle1 = doc.select("el-input[placeholder~=合同名称.*]");
-                htdTitle.addAll(htdTitle1);
+                Elements htdTitle = doc.select("el-input[placeholder~=.*合同段");
+                /*Elements htdTitle1 = doc.select("el-input[placeholder~=合同名称.*]");
+                htdTitle.addAll(htdTitle1);*/
                 Elements jlTitle = doc.select("el-input[placeholder~=监理单位.*]");
                 Elements bhTitle = doc.select("el-input[placeholder~=^编号]");
                 Elements bhTitle1 = doc.select("el-input[placeholder~=合同编号.*]");

+ 13 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -200,13 +200,23 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
     }
 
     @Override
-    public List<WbsTreeContract> getContractWbsTreeByParentId(String parentId,String contractId) {
+    public List<WbsTreeContract> getContractWbsTreeByParentId(String parentId, String contractId) {
         LambdaQueryWrapper<WbsTreeContract> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(WbsTreeContract::getParentId,parentId);
-        wrapper.eq(WbsTreeContract::getContractId,contractId);
+        wrapper.eq(WbsTreeContract::getParentId, parentId);
+        wrapper.eq(WbsTreeContract::getContractId, contractId);
         return this.wbsTreeContractService.list(wrapper);
     }
 
+    @Override
+    public boolean diySort(List<String> sortLists) {
+        int sort = 1;
+        for (String pKeyId : sortLists) {
+            WbsTreeContract sortNode = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, pKeyId));
+            wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getSort, sort++).eq(WbsTreeContract::getPKeyId, sortNode.getPKeyId()));
+        }
+        return true;
+    }
+
     @Override
     public List<WbsTreeContractTreeVOS> queryCurrentContractLogList(String contractId) {
         ContractInfo contract = this.contractInfoService.getById(contractId);

+ 8 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.manager.mapper;
 
+import org.apache.ibatis.annotations.Param;
 import org.springblade.manager.entity.ArchiveTreeContract;
 import org.springblade.manager.vo.ArchiveTreeContractVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -39,4 +40,11 @@ public interface ArchiveTreeContractMapper extends BaseMapper<ArchiveTreeContrac
 	 */
 	List<ArchiveTreeContractVO> selectArchiveTreeContractPage(IPage page, ArchiveTreeContractVO archiveTreeContract);
 
+	/**
+	 * 自动组卷规则设置节点下所有子节点
+	 * @param treeContract
+	 * @return
+	 */
+	int updateAllSonNodeIdsForArchiveAutoRule(@Param("treeContract") ArchiveTreeContract treeContract);
+
 }

+ 17 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -43,4 +43,21 @@
         select * from m_archive_tree_contract where is_deleted = 0
     </select>
 
+    <update id="updateAllSonNodeIdsForArchiveAutoRule">
+        update m_archive_tree_contract
+        set
+            archive_auto_type= #{treeContract.archiveAutoType},
+            archive_auto_node_id = #{treeContract.archive_auto_node_id}
+        where
+            is_deleted = 0 and ancestors like concat('', #{treeContract.ancestors}, '%')
+            /*最高并卷规则不能覆盖 分类并卷规则,单独组卷规则*/
+            <if test="treeContract.archiveAutoType ==1 ">
+                and archive_auto_type != 2 and archive_auto_type != 3
+            </if>
+            /*分类并卷规则不能覆盖单独组卷规则*/
+            <if test="treeContract.archiveAutoType ==2 ">
+                and archive_auto_type != 3
+            </if>
+    </update>
+
 </mapper>

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeContractService.java

@@ -38,4 +38,10 @@ public interface IArchiveTreeContractService extends BaseService<ArchiveTreeCont
 	 */
 	IPage<ArchiveTreeContractVO> selectArchiveTreeContractPage(IPage<ArchiveTreeContractVO> page, ArchiveTreeContractVO archiveTreeContract);
 
+
+	/**
+	 *项目级立卷规则新增
+	 * @return
+	 */
+	boolean saveArchiveAutoRule(Integer archiveAutoType,String nodeIds);
 }

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IArchiveTreeService.java

@@ -26,4 +26,10 @@ public interface IArchiveTreeService extends BaseService<ArchiveTree> {
     List<ArchiveTree> getSameGradeNode(String id);
 
 	boolean submitArchiveTreeSort(List<ArchiveTreeSortDTO> listSort);
+
+	/**
+	 * 系统级立卷规则新增
+	 * @return
+	 */
+	boolean saveAechiveAutoRule(Integer archiveAutoType,String nodeIds);
 }

+ 36 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java

@@ -38,4 +38,40 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 		return page.setRecords(baseMapper.selectArchiveTreeContractPage(page, archiveTreeContract));
 	}
 
+	@Override
+	public boolean saveArchiveAutoRule(Integer archiveAutoType, String nodeIds) {
+		//项目级不需要考虑是否为wbs节点,已经同步出来了都属于归档树节点,直接按归档树节点处理
+
+		//步骤1保存选择节点的立卷规则。
+		String[] ids = nodeIds.split(",");
+
+		Long archiveAutoNodeId=null;
+
+		//分类并卷规则的需要生成个随机数,作为同一个分类赋值archiveAutoNodeId
+		if(archiveAutoType==2){
+			double ran=(Math.random()*100000000) + 1;
+			archiveAutoNodeId=Long.parseLong(System.currentTimeMillis()+""+ran);
+		}
+		for(String nodeId:ids){
+			long nodeIdLong = Long.parseLong(nodeId);
+			ArchiveTreeContract archiveTreeContract = baseMapper.selectById(nodeIdLong);
+			archiveTreeContract.setArchiveAutoSelect(1);
+			archiveTreeContract.setArchiveAutoType(archiveAutoType);
+			if(archiveAutoType==2){
+				//分类并卷规则 提交都是一个分类类型
+				archiveTreeContract.setArchiveAutoNodeId(archiveAutoNodeId);
+			}else{
+				//最高并卷规则 选择节点的ID
+				archiveTreeContract.setArchiveAutoNodeId(nodeIdLong);
+			}
+			baseMapper.updateById(archiveTreeContract);
+		}
+
+		//TODO 步骤2保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
+		/*
+		* 测试覆盖
+		* */
+		return false;
+	}
+
 }

+ 14 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeServiceImpl.java

@@ -167,4 +167,18 @@ public class ArchiveTreeServiceImpl extends BaseServiceImpl<ArchiveTreeMapper, A
     }
 
 
+    @Override
+    public boolean saveAechiveAutoRule(Integer archiveAutoType, String nodeIds) {
+        //步骤1:判断选择节点是否为wbs节点。
+        //步骤2:归档树原始节点,
+            //2.1保存选择节点的立卷规则。
+                //2.1.1 最高并卷规则的需要将选择节点的ID赋值archiveAutoNodeId
+                //2.1.2 分类并卷规则的需要生成个随机数,作为同一个分类赋值archiveAutoNodeId
+            //2.2保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
+        //步骤3:归档树关联wbs节点
+            //TODO 关联wbs节点的立卷规则保存,涉及到能否正确同步出来。再议
+            //3.1保存选择节点的立卷规则。
+            //3.2保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
+        return false;
+    }
 }

+ 89 - 71
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -627,7 +627,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
 
                         //获取文件题名
-                        String fileTitleNames = this.getFileTitleNames(firstNodeId);
+                        String fileTitleNames = this.getFileTitleNames(linkProcessList);
 
                         try {
                             //新增或修改首件记录
@@ -643,49 +643,67 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     }
 
     //首件文件题名
-    private String getFileTitleNames(String firstNodeId) {
-        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, Long.parseLong(firstNodeId)));
-        //获取到该项目的首件节点以及上级的单位工程节点、分项工程节点
-        List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
-                .eq(WbsTreePrivate::getProjectId, wbsTreeContract.getProjectId())
-                .eq(WbsTreePrivate::getWbsId, wbsTreeContract.getWbsId())
-                .eq(WbsTreePrivate::getType, 1)
-                .and(f -> f.eq(WbsTreePrivate::getNodeType, 111).or().eq(WbsTreePrivate::getNodeType, 1).or().eq(WbsTreePrivate::getNodeType, 4))
+    private String getFileTitleNames(List<JSONObject> linkProcessList) {
+        //关联的工序资料ids
+        List<String> linkIds = linkProcessList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+        String sql = "select wbs_id from u_information_query where id in(" + StringUtils.join(linkIds, ",") + ")";
+        List<InformationQuery> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(InformationQuery.class));
+
+        //合同段树节点ids
+        List<Long> contractNodePkeyIds = query.stream().map(InformationQuery::getWbsId).collect(Collectors.toList());
+        //选择关联的工序节点信息
+        List<WbsTreeContract> wbsTreeContractNodeRecord = new ArrayList<>(wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, contractNodePkeyIds)));
+        WbsTreeContract wbsTreeContractOne = wbsTreeContractNodeRecord.stream().findAny().orElse(null);
+        assert wbsTreeContractOne != null;
+        //单位工程、分项工程、首件节点信息
+        List<WbsTreeContract> wbsTreeContractDWFXSJList = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>lambdaQuery()
+                .eq(WbsTreeContract::getProjectId, wbsTreeContractOne.getProjectId())
+                .eq(WbsTreeContract::getContractId, wbsTreeContractOne.getContractId())
+                .eq(WbsTreeContract::getWbsId, wbsTreeContractOne.getWbsId())
+                .eq(WbsTreeContract::getType, 1)
+                .and(obj -> obj.eq(WbsTreeContract::getNodeType, 1).or().eq(WbsTreeContract::getNodeType, 4).or().eq(WbsTreeContract::getNodeType, 111))
         );
 
-        WbsTreePrivate firstNode = wbsTreePrivates.stream().filter(f -> f.getNodeType().equals(111)).findAny().orElse(null);
+        List<WbsTreeContract> dwList = wbsTreeContractDWFXSJList.stream().filter(f -> f.getNodeType().equals(1) && f.getParentId() != 0L).collect(Collectors.toList());
 
-        List<WbsTreePrivate> collect1 = wbsTreePrivates.stream().filter(f -> f.getNodeType().equals(1) && f.getParentId() != 0L).collect(Collectors.toList());
+        List<WbsTreeContract> fxList = wbsTreeContractDWFXSJList.stream().filter(f -> f.getNodeType().equals(4)).collect(Collectors.toList());
 
-        List<WbsTreePrivate> collect4 = wbsTreePrivates.stream().filter(f -> f.getNodeType().equals(4)).collect(Collectors.toList());
+        WbsTreeContract sjObj = wbsTreeContractDWFXSJList.stream().filter(f -> f.getNodeType().equals(111)).findAny().orElse(null);
 
-        StringBuilder fileTitleNames = new StringBuilder();
+        List<String> ancestors = wbsTreeContractNodeRecord.stream().map(WbsTreeContract::getAncestors).collect(Collectors.toList());
 
-        if (ObjectUtil.isNotEmpty(firstNode)) {
-            for (WbsTreePrivate obj1 : collect1) {
-                assert firstNode != null;
-                if (firstNode.getAncestors().contains(obj1.getId().toString())) {
-                    fileTitleNames.append(obj1.getNodeName());
+        if (ObjectUtil.isNotEmpty(sjObj)) {
+
+            List<String> dwTitleList = new ArrayList<>();
+            for (WbsTreeContract dw : dwList) {
+                for (String ancestorId : ancestors) {
+                    if (ancestorId.contains(dw.getId().toString())) {
+                        dwTitleList.add(dw.getNodeName());
+                    }
                 }
             }
+            String dwNames = StringUtils.join(dwTitleList.stream().distinct().collect(Collectors.toList()), "");
 
-            for (WbsTreePrivate obj4 : collect4) {
-                assert firstNode != null;
-                if (firstNode.getAncestors().contains(obj4.getId().toString())) {
-                    fileTitleNames.append(obj4.getNodeName());
-                    break;
+            List<String> fxTitleList = new ArrayList<>();
+            for (WbsTreeContract fx : fxList) {
+                for (String ancestorId : ancestors) {
+                    if (ancestorId.contains(fx.getId().toString())) {
+                        fxTitleList.add(fx.getNodeName());
+                    }
                 }
             }
+            String fxNames = StringUtils.join(fxTitleList.stream().distinct().collect(Collectors.toList()), "、");
 
-            assert firstNode != null;
-            return fileTitleNames.append(firstNode.getNodeName()).toString();
-        }
+            assert sjObj != null;
+            return dwNames + fxNames + sjObj.getNodeName();
 
-        return "";
+        } else {
+            return "";
+        }
     }
 
 
-    public TransactionStatus beginTransaction(DataSourceTransactionManager transactionManager){
+    public TransactionStatus beginTransaction(DataSourceTransactionManager transactionManager) {
         DefaultTransactionDefinition def = new DefaultTransactionDefinition();//事务定义类
         def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
         TransactionStatus status = transactionManager.getTransaction(def);// 返回事务对象
@@ -747,7 +765,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         jdbcTemplate.execute(delSql);
                         jdbcTemplate.execute(sqlInfo);
                         transactionManager1.commit(transactionStatus);
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         transactionManager1.rollback(transactionStatus);
                         e.printStackTrace();
                     }
@@ -946,7 +964,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             for (String key : mysqlData.keySet()) {
                 String tabVal = mysqlData.get(key) + "";
                 // 时间段处理
-                if (StringUtils.isNotEmpty(tabVal) && tabVal.indexOf("null")<0) {
+                if (StringUtils.isNotEmpty(tabVal) && tabVal.indexOf("null") < 0) {
                     if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
                         String[] tabData = tabVal.split("_\\^_");
 
@@ -1031,7 +1049,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     public R getBussPdfInfo(Long pkeyId) throws Exception {
 
         //String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String file_path = "/Users/hongchuangyanfa/Desktop/";//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = "C:\\Users\\泓创开发\\Desktop";//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1072,27 +1090,27 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
         int all = sheet.getRow(0).getLastCellNum();
         int mergedCellCnt = sheet.getNumMergedRegions();
-        List<Map<String,Integer>> titleList = new ArrayList<>();
-        for (int i = 0; i < mergedCellCnt-1; i++) {
+        List<Map<String, Integer>> titleList = new ArrayList<>();
+        for (int i = 0; i < mergedCellCnt - 1; i++) {
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
-            int xx =mergedCell.getNumberOfCells();
-            if(xx==all){
+            int xx = mergedCell.getNumberOfCells();
+            if (xx == all) {
                 int fisRow = mergedCell.getFirstRow();
                 int firsrCol = mergedCell.getFirstColumn();
                 Cell cell = sheet.getRow(fisRow).getCell(firsrCol);
                 short fontIndex = cell.getCellStyle().getFontIndex();
                 Font fontAt = workbook.getFontAt(fontIndex);
                 short fontHeightInPoints = fontAt.getFontHeightInPoints();
-                if(fontHeightInPoints>=14){
-                    Map<String,Integer> titleMap = new HashMap<>();
-                    titleMap.put("index",i);
-                    titleMap.put("x",firsrCol);
-                    titleMap.put("y",fisRow);
+                if (fontHeightInPoints >= 14) {
+                    Map<String, Integer> titleMap = new HashMap<>();
+                    titleMap.put("index", i);
+                    titleMap.put("x", firsrCol);
+                    titleMap.put("y", fisRow);
                     String data = cell.getStringCellValue();
-                    if(StringUtils.isNotEmpty(data)){
-                        titleMap.put("val",2);
-                    }else{
-                        titleMap.put("val",1);
+                    if (StringUtils.isNotEmpty(data)) {
+                        titleMap.put("val", 2);
+                    } else {
+                        titleMap.put("val", 1);
                     }
                     titleList.add(titleMap);
                 }
@@ -1101,18 +1119,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
         //添加标题
         System.out.println(titleList.size());
-        if(titleList!=null){
-            if(titleList.size()==1){
-                Map<String,Integer> titData = titleList.get(0);
-                if(titData.get("val")==1){
+        if (titleList != null) {
+            if (titleList.size() == 1) {
+                Map<String, Integer> titData = titleList.get(0);
+                if (titData.get("val") == 1) {
                     Cell cell = sheet.getRow(titData.get("y")).getCell(titData.get("x"));
                     cell.setCellValue(projectInfo.getProjectName());
                 }
-            }else if(titleList.size()>=2){
-                for(int i=0;i<titleList.size();i++){
-                    Map<String,Integer> titData = titleList.get(i);
-                    if(titData.get("val")==2){
-                        Map<String,Integer> titData2 = titleList.get(i-1);
+            } else if (titleList.size() >= 2) {
+                for (int i = 0; i < titleList.size(); i++) {
+                    Map<String, Integer> titData = titleList.get(i);
+                    if (titData.get("val") == 2) {
+                        Map<String, Integer> titData2 = titleList.get(i - 1);
                         Cell cell = sheet.getRow(titData2.get("y")).getCell(titData2.get("x"));
                         cell.setCellValue(projectInfo.getProjectName());
                     }
@@ -1185,7 +1203,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     InputStream imageIn = CommonUtil.getOSSInputStream(myData);
                                     byte[] bytes = IOUtils.toByteArray(imageIn);
                                     // 这里根据实际需求选择图片类型
-                                    int pictureIdx = workbook.addPicture(bytes,6);
+                                    int pictureIdx = workbook.addPicture(bytes, 6);
 
                                     CreationHelper helper = workbook.getCreationHelper();
                                     ClientAnchor anchor = helper.createClientAnchor();
@@ -1198,19 +1216,19 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
                                     // 插入图片
                                     Picture pict = drawing.createPicture(anchor, pictureIdx); // 调整图片占单元格百分比的大小,1.0就是100%
-                                    pict.resize(1,1);
-                                    FileUtils.imageOrientation(sheet, anchor, new DataVO(x1-1, y1-1) );
+                                    pict.resize(1, 1);
+                                    FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
 
-                                } else if(myData.equals("1") && data.html().indexOf("hc-form-checkbox-group")>=0){
-                                    Cell cell = sheet.getRow(y1-1).getCell(x1-1);
-                                    String exceVal = cell.getStringCellValue().replaceAll(" ","");
+                                } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
+                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
+                                    String exceVal = cell.getStringCellValue().replaceAll(" ", "");
                                     short fontIndex = cell.getCellStyle().getFontIndex();
                                     Font fontAt = workbook.getFontAt(fontIndex);
                                     fontAt.setFontName("EUDC");
-                                    cell.setCellValue(exceVal.replace("□","\u2611"));
-                                }else {
-                                     Cell cell = sheet.getRow(y1-1).getCell(x1-1);
-                                     cell.setCellValue(myData);
+                                    cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                } else {
+                                    Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
+                                    cell.setCellValue(myData);
 
 
                                 }
@@ -1237,7 +1255,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
                         int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
 
-                        Cell cell = sheet.getRow(y1-1).getCell(x1-1);
+                        Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
                         cell.setCellValue(e.getId() + "");
                         short fontIndex = cell.getCellStyle().getFontIndex();
                         Font oldfontAt = workbook.getFontAt(fontIndex);
@@ -1254,7 +1272,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
         }
 
-      //  wb.saveToFile(excelPath, ExcelVersion.Version2010);
+        //  wb.saveToFile(excelPath, ExcelVersion.Version2010);
         //输出流
         FileOutputStream outputStream = new FileOutputStream(excelPath);
         workbook.write(outputStream);
@@ -1312,8 +1330,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
-        //String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String file_path = "/Users/hongchuangyanfa/Desktop/" ;//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        //String file_path = "/Users/hongchuangyanfa/Desktop/";//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();
@@ -1341,15 +1359,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         FileUtils.mergePdfPublicMethods(data, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
 
+        //获取当前填报节点sort
+        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
+
         // 合并pdf集合
-        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
+        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + (ObjectUtil.isNotEmpty(wbsTreeContract) ? wbsTreeContract.getSort() : 0) + " where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         jdbcTemplate.execute(sql);
     }
 
 
-
-
-
     /**
      * 试验 获取填报信息
      */

+ 1 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -477,8 +477,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                 }
             }
             // 获取默认密码配置
-            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
-            user.setPassword(initPassword);
+            user.setPassword("123456"); //此处不加密,submit里面加密了
             user.setPlaintextPassword("123456");
             user.setStatus(1);
             user.setIsDeleted(0);