huangjn 3 年 前
コミット
5b581ef8f8
21 ファイル変更696 行追加10 行削除
  1. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractLogWbsDTO.java
  2. 60 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLogWbs.java
  3. 26 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java
  4. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogWbsVO.java
  5. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FirstInformationVO.java
  6. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  7. 55 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiWaiYeProgressVO.java
  8. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/QueryProcessDataVO.java
  9. 94 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/UserVO.java
  10. 22 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  11. 108 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiWaiYeProgressController.java
  12. 26 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/UserViewProjectContractController.java
  13. 39 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogWbsMapper.java
  14. 72 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogWbsMapper.xml
  15. 4 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  16. 42 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IContractLogWbsService.java
  17. 66 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogWbsServiceImpl.java
  18. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FirstInformationServiceImpl.java
  19. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java
  20. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreePrivateClientImpl.java
  21. 5 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractLogWbsDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.ContractLogWbs;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractLogWbsDTO extends ContractLogWbs {
+	private static final long serialVersionUID = 1L;
+
+}

+ 60 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLogWbs.java

@@ -0,0 +1,60 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+@Data
+@TableName("u_contract_log_wbs")
+@EqualsAndHashCode(callSuper = true)
+public class ContractLogWbs extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * contract_log表主键
+     */
+    @ApiModelProperty("contract_log表主键")
+    private Long contractLogId;
+
+    /**
+     * 关联的工序唯一键,wbs_tree_contract表p_key_id
+     */
+	@ApiModelProperty("关联的工序唯一键,wbs_tree_contract表p_key_id")
+    private Long treePrimaryKeyId;
+
+    /**
+     * 节点名称
+     */
+	@ApiModelProperty("节点名称")
+    private String title;
+
+
+}

+ 26 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogVO.java

@@ -5,6 +5,9 @@ import org.springblade.business.entity.ContractLog;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 日志通用表视图实体类
  *
@@ -35,4 +38,27 @@ public class ContractLogVO extends ContractLog {
 	@ApiModelProperty("流程状态")
 	private String statusValue;
 
+	private List<SelectTree> selectNodeList;
+
+	private List<String> selectPrimaryKeyIds;
+
+	public void setSelectNodeList(String primaryKeyId, String title){
+		if(this.selectNodeList == null){
+			this.selectNodeList = new ArrayList<>();
+		}
+		this.selectNodeList.add(new SelectTree(primaryKeyId, title));
+	}
+
+	@Data
+	public static class SelectTree {
+		private String primaryKeyId;
+		private String title;
+
+		public SelectTree(String primaryKeyId, String title){
+			this.primaryKeyId = primaryKeyId;
+			this.title = title;
+		}
+
+	}
+
 }

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractLogWbsVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.ContractLogWbs;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractLogWbsVO extends ContractLogWbs {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FirstInformationVO.java

@@ -63,7 +63,7 @@ public class FirstInformationVO extends FirstInformation {
 	private Integer size;
 
 	@ApiModelProperty("节点查询")
-	private String wbsNodeIds;
+	private String wbsId;
 
 	private List<String> wbsNodeArray;
 

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

@@ -57,4 +57,6 @@ public class InformationQueryVO extends InformationQuery {
 
 	private String taskStatus;
 
+	private String isFirst;
+
 }

+ 55 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiWaiYeProgressVO.java

@@ -0,0 +1,55 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class NeiWaiYeProgressVO {
+
+    @ApiModelProperty("节点名称")
+    private String title;
+
+    @ApiModelProperty("填报节点总数")
+    private Integer amount;
+
+    @ApiModelProperty("内业完成数量")
+    private Integer neiYeSuccessAmount;
+
+    @ApiModelProperty("外业完成数量")
+    private Integer waiYeSuccessAmount;
+
+    @ApiModelProperty("内业完成比")
+    private Double neiYeRatio;
+
+    @ApiModelProperty("外业完成比")
+    private Double waiYeRatio;
+
+    @ApiModelProperty("进度集合")
+    private List<NeiWaiYeProgressVO> progressList;
+
+    public void setProgressList(String title, Integer amount, Integer neiYeSuccessAmount, Integer waiYeSuccessAmount){
+        if(this.progressList == null){
+            this.progressList = new ArrayList<>();
+        }
+        this.progressList.add(new NeiWaiYeProgressVO(title, amount, neiYeSuccessAmount, waiYeSuccessAmount));
+    }
+
+    public NeiWaiYeProgressVO(String title, Integer amount, Integer neiYeSuccessAmount, Integer waiYeSuccessAmount){
+        this.title = title;
+        this.amount = amount;
+        this.neiYeSuccessAmount = neiYeSuccessAmount;
+        this.waiYeSuccessAmount = waiYeSuccessAmount;
+        if(amount > 0){
+            double result1 = Double.parseDouble(String.valueOf(new BigDecimal(neiYeSuccessAmount.toString()).divide(new BigDecimal(amount.toString()), 2, BigDecimal.ROUND_HALF_UP)));
+            this.neiYeRatio = result1 > -1 ? result1 * 100 : 0;
+
+            double result2 = Double.parseDouble(String.valueOf(new BigDecimal(waiYeSuccessAmount.toString()).divide(new BigDecimal(amount.toString()), 2, BigDecimal.ROUND_HALF_UP)));
+            this.waiYeRatio = result2 > -1 ? result2 * 100 : 0;
+        }
+    }
+
+}

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

@@ -21,4 +21,6 @@ public class QueryProcessDataVO {
 
     private Integer majorDataType;
 
+    private String firstId;
+
 }

+ 94 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/UserVO.java

@@ -0,0 +1,94 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class UserVO {
+
+    /**
+     * 用户编号
+     */
+    private String code;
+    /**
+     * 用户平台
+     */
+    private Integer userType;
+    /**
+     * 账号
+     */
+    private String account;
+    /**
+     * 密码
+     */
+    private String password;
+    /**
+     * 明文密码
+     */
+    private String plaintextPassword;
+    /**
+     * 昵称
+     */
+    private String name;
+    /**
+     * 真名
+     */
+    private String realName;
+    /**
+     * 身份证号
+     */
+    private String idNumber;
+    /**
+     * 头像
+     */
+    private String avatar;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 手机
+     */
+    private String phone;
+    /**
+     * 生日
+     */
+    private Date birthday;
+    /**
+     * 性别
+     */
+    private Integer sex;
+    /**
+     * 角色id
+     */
+    private String roleId;
+
+    private String roleName;
+
+    /**
+     * 部门id
+     */
+    private String deptId;
+    /**
+     * 岗位id
+     */
+    private String postId;
+
+    /**
+     * 单位名称
+     */
+    @ApiModelProperty(value = "单位名称")
+    private String companyName;
+
+    /**
+     * 职位
+     */
+    @ApiModelProperty(value = "职位")
+    private String position;
+
+    @ApiModelProperty(value = "签名url")
+    private String signatureUrl;
+
+}

+ 22 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1079,6 +1079,23 @@ public class InformationWriteQueryController extends BladeController {
 			@ApiImplicitParam(name = "id", value = "点击节点ID")
 	})
 	public R<List<WbsTreeContractTreeVOS>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String projectId, @RequestParam String id){
+//		List<WbsTreeContractTreeVOS> result = new ArrayList<>();
+//
+//		WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();
+//		WbsTreePrivate wbsTreePrivate = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(projectId, Long.parseLong(id));
+//		//设置参数
+//		vos.setId(wbsTreePrivate.getId().toString());
+//		vos.setKey(wbsTreePrivate.getId().toString());
+//		vos.setPrimaryKeyId(wbsTreePrivate.getPKeyId().toString());
+//		vos.setParentId(wbsTreePrivate.getParentId().toString());
+//		vos.setTitle(wbsTreePrivate.getDeptName());
+//		vos.setType(wbsTreePrivate.getType());
+//		vos.setWbsType(Integer.parseInt(wbsTreePrivate.getWbsType()));
+//		//设置子级
+//		vos.setChildren();
+//		//添加进结果集合中
+//		result.add(vos);
+
 		return R.data(this.wbsTreePrivateClient.queryWbsTreePrivateByProjectIdAndId(projectId, Long.parseLong(id)));
 	}
 
@@ -1181,6 +1198,10 @@ public class InformationWriteQueryController extends BladeController {
 		if(!new Integer("6").equals(node.getDeptCategory()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
 			//不是工序,则查询当前节点下的所有填报节点
 			List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), 1, vo.getContractId().toString());
+			if(StringUtils.isNotEmpty(vo.getIsFirst())){
+				//如果是首件列表请求,则删掉没有标记为首件的数据
+				queryDataResult.removeIf(data -> StringUtils.isEmpty(data.getFirstId()));
+			}
 			if(queryDataResult != null && queryDataResult.size() > 0){
 				submitNodeKeyIds.addAll(queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList()));
 			}
@@ -1226,7 +1247,7 @@ public class InformationWriteQueryController extends BladeController {
 			//获取当前父节点下所有工序节点及填报资料
 			List<QueryProcessDataVO> queryDataResult;
 			if(new Integer("2").equals(contractInfo.getContractType())){
-				queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractIdRelation);
+				queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 2, contractIdRelation);
 			} else {
 				queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractId);
 			}

+ 108 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiWaiYeProgressController.java

@@ -0,0 +1,108 @@
+package org.springblade.business.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.service.IContractLogWbsService;
+import org.springblade.business.service.IInformationQueryService;
+import org.springblade.business.vo.NeiWaiYeProgressVO;
+import org.springblade.business.vo.QueryProcessDataVO;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/neiWaiYeProgressController")
+@Api(tags = "内外业进度")
+public class NeiWaiYeProgressController {
+
+    private final WbsTreeContractClient wbsTreeContractClient;
+
+    private final IInformationQueryService informationQueryService;
+
+    private final IContractLogWbsService contractLogWbsService;
+
+    /**
+     * 内外业进度
+     */
+    @GetMapping("/neiWaiYeProgress")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "内外业进度")
+    public R<List<NeiWaiYeProgressVO>> neiWaiYeProgress(@RequestParam String primaryKeyId, @RequestParam String contractId){
+        if(StringUtils.isNotEmpty(primaryKeyId)){
+            //判断primaryKeyId是唯一键还是泛用键
+            WbsTreeContract node = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
+            if(node == null){
+                //说明是监理合同段
+                node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(Long.parseLong(primaryKeyId), Long.parseLong(contractId));
+            }
+            //设置返回集合
+            List<NeiWaiYeProgressVO> result = new ArrayList<>();
+
+            //获取当前节点的子节点
+            List<WbsTreeContract> childList = this.wbsTreeContractClient.queryChildByParentId(node, "");
+
+            //获取当前节点下的所有填报节点
+            List<QueryProcessDataVO> queryProcessDataVOList;
+            if(!new Integer("6").equals(node.getDeptCategory()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
+                queryProcessDataVOList = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), 1, contractId);
+            } else {
+                //填报节点
+                queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), 1);
+                childList.clear();
+                //设置填报节点进集合中
+                childList.add(node);
+            }
+
+            if(queryProcessDataVOList != null && queryProcessDataVOList.size() > 0){
+                //删除掉开工报告等节点
+                queryProcessDataVOList.removeIf(vo -> !new Integer("4").equals(vo.getMajorDataType()));
+                //循环子节点
+                for(WbsTreeContract child : childList){
+                    //设置返回参数
+                    int amount = 0, neiYeSuccessAmount = 0, waiYeSuccessAmount = 0;
+
+                    //使用迭代器,减少之后的循环次数
+                    Iterator<QueryProcessDataVO> iterator = queryProcessDataVOList.iterator();
+                    while (iterator.hasNext()){
+                        QueryProcessDataVO vo = iterator.next();
+                        //找到自己的子节点
+                        if(vo.getAncestors().contains(child.getId().toString()) || vo.getParentId().equals(child.getId().toString()) || vo.getPrimaryKeyId().equals(child.getPKeyId().toString())){
+                            //统计内业数量(内业根据已审批的节点资料统计)
+                            if(new Integer("2").equals(vo.getStatus())){
+                                neiYeSuccessAmount ++;
+                            }
+                            //统计外业数量(外业根据当前填报节点是否已经生成一份施工日志为准(暂时))
+                            Integer logCount = this.contractLogWbsService.countContractLogBySelectPrimaryKeyIdsAndClassify(Func.toStrList(vo.getPrimaryKeyId()), 7);
+                            if(logCount != null && logCount > 0){
+                                waiYeSuccessAmount ++;
+                            }
+                            //统计总数
+                            amount ++;
+                            iterator.remove();
+                        }
+                    }
+
+                    //添加返回结果
+                    result.add(new NeiWaiYeProgressVO(StringUtils.isNotEmpty(child.getFullName()) ? child.getFullName() : child.getDeptName(), amount, neiYeSuccessAmount, waiYeSuccessAmount));
+                }
+                return R.data(result);
+            }
+        }
+        return R.data(300, null, "未查询到数据");
+    }
+
+}

+ 26 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/UserViewProjectContractController.java

@@ -2,6 +2,7 @@ package org.springblade.business.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
@@ -10,15 +11,19 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.DefaultProject;
 import org.springblade.business.service.IDefaultProjectService;
+import org.springblade.business.vo.UserVO;
 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.BeanUtil;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.entity.SignPfxFile;
 import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.ProjectAssignmentUserClient;
 import org.springblade.manager.feign.ProjectClient;
+import org.springblade.manager.feign.SignPfxClient;
 import org.springblade.manager.vo.ContractInfoVO;
 import org.springblade.manager.vo.ProjectInfoVO;
 import org.springblade.system.feign.ISysClient;
@@ -51,13 +56,15 @@ public class UserViewProjectContractController {
 
     private final ISysClient sysClient;
 
+    private final SignPfxClient signPfxClient;
+
     /**
      * 获取用户信息
      */
     @PostMapping("/queryCurrentUserData")
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "获取用户信息")
-    public R<User> queryCurrentUserData(){
+    public R<UserVO> queryCurrentUserData(){
         User user = this.userClient.userInfoById(AuthUtil.getUserId()).getData();
         if(user != null){
             //获取部门
@@ -65,8 +72,25 @@ public class UserViewProjectContractController {
             if(deptNames != null && deptNames.size() > 0){
                 user.setDeptId(String.join(",", deptNames));
             }
+            //数据对拷
+            UserVO userVO = new UserVO();
+            BeanUtil.copyProperties(user, userVO);
+
+            //获取个人签字文件
+            List<SignPfxFile> pfxFiles = this.signPfxClient.querySignPfxByUserIdOrContractId(user.getId().toString(), "");
+            if(pfxFiles != null && pfxFiles.size() > 0){
+                userVO.setSignatureUrl(pfxFiles.get(0).getSignatureFileUrl());
+            }
+            //获取角色信息
+            if(StringUtils.isNotEmpty(userVO.getRoleId())){
+                List<String> roleNames = this.sysClient.getRoleNames(userVO.getRoleId()).getData();
+                if(roleNames != null && roleNames.size() > 0){
+                    userVO.setRoleName(String.join(",", roleNames));
+                }
+            }
+            return R.data(userVO);
         }
-        return R.data(user);
+        return R.data(300, null, "未找到数据");
     }
 
     /**

+ 39 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogWbsMapper.java

@@ -0,0 +1,39 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.entity.ContractLogWbs;
+import org.springblade.business.vo.ContractLogWbsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+public interface ContractLogWbsMapper extends BaseMapper<ContractLogWbs> {
+
+	Integer countContractLogBySelectPrimaryKeyIdsAndClassify(@Param("primaryKeyIds") List<String> primaryKeyIds, @Param("classify") Integer classify);
+
+	List<ContractLog> queryContractLogBySelectPrimaryKeyIdsAndClassify(@Param("primaryKeyIds") List<String> primaryKeyIds, @Param("classify") Integer classify);
+
+}

+ 72 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogWbsMapper.xml

@@ -0,0 +1,72 @@
+<?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.ContractLogWbsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="contractLogWbsResultMap" type="org.springblade.business.entity.ContractLogWbs">
+        <result column="id" property="id"/>
+        <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"/>
+        <result column="contract_log_id" property="contractLogId"/>
+        <result column="tree_primary_key_id" property="treePrimaryKeyId"/>
+        <result column="title" property="title"/>
+    </resultMap>
+
+    <resultMap id="contractLogResultMap" type="org.springblade.business.entity.ContractLog">
+        <result column="id" property="id"/>
+        <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"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="wbs_node_id" property="wbsNodeId"/>
+        <result column="wbs_node_type" property="wbsNodeType"/>
+        <result column="record_time" property="recordTime"/>
+        <result column="record_number" property="recordNumber"/>
+        <result column="project_pileno" property="projectPileno"/>
+        <result column="project_part" property="projectPart"/>
+        <result column="data_id" property="dataId"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="file_name" property="fileName"/>
+    </resultMap>
+
+    <select id="countContractLogBySelectPrimaryKeyIdsAndClassify" resultType="java.lang.Integer">
+        select
+            count(id)
+        from
+            u_contract_log
+        where
+        id in(
+            select contract_log_id from u_contract_log_wbs where is_deleted = 0 and tree_primary_key_id in
+            <foreach collection="primaryKeyIds" item="primaryKeyId" open="(" separator="," close=")">
+                #{primaryKeyId}
+            </foreach>
+        )
+        and wbs_node_type = #{classify} and is_deleted = 0
+    </select>
+
+    <select id="queryContractLogBySelectPrimaryKeyIdsAndClassify" resultMap="contractLogResultMap">
+        select 
+            *
+        from
+            u_contract_log
+        where
+            id in(
+                select contract_log_id from u_contract_log_wbs where is_deleted = 0 and tree_primary_key_id in
+                <foreach collection="primaryKeyIds" item="primaryKeyId" open="(" separator="," close=")">
+                    #{primaryKeyId}
+                </foreach>
+            )
+        and wbs_node_type = #{classify} and is_deleted = 0
+    </select>
+
+</mapper>

+ 4 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -41,6 +41,7 @@
         <result column="major_data_type" property="majorDataType"/>
         <result column="parentId" property="parentId"/>
         <result column="title" property="title"/>
+        <result column="firstId" property="firstId"/>
     </resultMap>
 
     <resultMap id="intResultMap" type="java.lang.Integer"/>
@@ -72,10 +73,12 @@
             wtc.dept_name AS title,
             wtc.parent_id AS parentId,
             uiq.id AS informationQueryId,
-            uiq.status
+            uiq.status,
+            tcf.id AS firstId
         FROM
             m_wbs_tree_contract AS wtc
         LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = #{classify} and uiq.is_deleted = 0
+        LEFT JOIN u_tree_contract_first AS tcf ON wtc.p_key_id = tcf.wbs_node_id AND tcf.is_deleted = 0
         WHERE
             wtc.wbs_type = 1
         AND wtc.type = 1

+ 42 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IContractLogWbsService.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.ContractLogWbs;
+import org.springblade.business.vo.ContractLogVO;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+public interface IContractLogWbsService extends BaseService<ContractLogWbs> {
+
+	Integer countContractLogBySelectPrimaryKeyIdsAndClassify(List<String> selectPrimaryKeyIds, Integer classify);
+
+	/**
+	 * 根据关联的工序primaryKeyId查询对应类型的日志信息
+	 * @param selectPrimaryKeyIds 联的工序primaryKeyId集合
+	 * @param classify 填报类型(日志类型,详见字典wbs_node_type)
+	 */
+	List<ContractLogVO> queryContractLogBySelectPrimaryKeyIdsAndClassify(List<String> selectPrimaryKeyIds, Integer classify);
+
+}

+ 66 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogWbsServiceImpl.java

@@ -0,0 +1,66 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.entity.ContractLogWbs;
+import org.springblade.business.vo.ContractLogVO;
+import org.springblade.business.mapper.ContractLogWbsMapper;
+import org.springblade.business.service.IContractLogWbsService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-08-10
+ */
+@Service
+public class ContractLogWbsServiceImpl extends BaseServiceImpl<ContractLogWbsMapper, ContractLogWbs> implements IContractLogWbsService {
+
+	@Override
+	public Integer countContractLogBySelectPrimaryKeyIdsAndClassify(List<String> selectPrimaryKeyIds, Integer classify) {
+		return this.baseMapper.countContractLogBySelectPrimaryKeyIdsAndClassify(selectPrimaryKeyIds, classify);
+	}
+
+	@Override
+	public List<ContractLogVO> queryContractLogBySelectPrimaryKeyIdsAndClassify(List<String> selectPrimaryKeyIds, Integer classify) {
+		List<ContractLog> contractLogs = this.baseMapper.queryContractLogBySelectPrimaryKeyIdsAndClassify(selectPrimaryKeyIds, classify);
+		if(contractLogs != null && contractLogs.size() > 0){
+			//转换类型
+			List<ContractLogVO> voResult = JSONArray.parseArray(JSONObject.toJSONString(contractLogs), ContractLogVO.class);
+			//获取关联的节点信息
+			voResult.forEach(vo -> {
+				List<ContractLogWbs> contractLogWbsList = this.baseMapper.selectList(Wrappers.<ContractLogWbs>lambdaQuery().eq(ContractLogWbs::getContractLogId, vo.getId()));
+				if(contractLogWbsList != null && contractLogWbsList.size() > 0){
+					vo.setSelectPrimaryKeyIds(JSONArray.parseArray(JSONObject.toJSONString(contractLogWbsList.stream().map(ContractLogWbs::getTreePrimaryKeyId).distinct().collect(Collectors.toList())), String.class));
+					contractLogWbsList.forEach(wbs -> vo.setSelectNodeList(wbs.getTreePrimaryKeyId().toString(), wbs.getTitle()));
+				}
+			});
+			return voResult;
+		}
+		return null;
+	}
+}

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FirstInformationServiceImpl.java

@@ -76,8 +76,8 @@ public class FirstInformationServiceImpl extends BaseServiceImpl<FirstInformatio
 	public IPage<FirstInformationVO> selectFirstInformationPage(IPage<FirstInformationVO> page, FirstInformationVO vo) {
 		//处理分页相关
 		Long current = (page.getCurrent() - 1L) * page.getSize();
-		if(StringUtils.isNotEmpty(vo.getWbsNodeIds()) && !",".equals(vo.getWbsNodeIds())){
-			List<String> wbsNodeArray = JSONArray.parseArray(JSONObject.toJSONString(vo.getWbsNodeIds().split(",")), String.class);
+		if(StringUtils.isNotEmpty(vo.getWbsId()) && !",".equals(vo.getWbsId())){
+			List<String> wbsNodeArray = JSONArray.parseArray(JSONObject.toJSONString(vo.getWbsId().split(",")), String.class);
 			wbsNodeArray.removeIf(StringUtils::isEmpty);
 			vo.setWbsNodeArray(wbsNodeArray);
 		}

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

@@ -73,7 +73,7 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
         vos.forEach(voData -> {
             voData.setLeaf(new Integer("6").equals(voData.getDeptCategory()));
             //检查是否有下级
-            long count = this.wbsTreeContractService.count(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, voData.getPrimaryKeyId()).eq(WbsTreeContract::getContractId, voData.getContractIdRelation()).eq(WbsTreeContract::getWbsType, 1));
+            long count = this.wbsTreeContractService.count(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, voData.getPrimaryKeyId()).eq(WbsTreeContract::getContractId, voData.getContractIdRelation()).eq(WbsTreeContract::getType, 1));
             voData.setNotExsitChild(count == 0);
         });
 

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

@@ -45,7 +45,7 @@ public class WbsTreePrivateClientImpl implements WbsTreePrivateClient {
                 vos.setTitle(wbsTreePrivate.getDeptName());
                 vos.setType(wbsTreePrivate.getType());
                 vos.setWbsType(Integer.parseInt(wbsTreePrivate.getWbsType()));
-                long count = this.wbsTreePrivateService.count(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getParentId, wbsTreePrivate.getId()));
+                long count = this.wbsTreePrivateService.count(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getParentId, wbsTreePrivate.getId()).eq(WbsTreePrivate::getType, "1"));
                 vos.setNotExsitChild(count == 0);
 
                 vosResult.add(vos);

+ 5 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -431,7 +431,11 @@
         c.dept_category AS "deptCategory",
         c.parent_id,
         c.tenant_id AS "tenantId",
-        IFNULL(c.full_name, c.dept_name) AS "title",
+--         IFNULL(c.full_name, c.dept_name) AS "title",
+        case
+        when c.full_name is null then c.dept_name
+        when c.full_name = '' then c.dept_name
+        else c.full_name end AS "title",
         c.contract_id AS "contractIdRelation",
         (SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
         FROM m_wbs_tree_contract