Explorar el Código

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

yangyj hace 3 años
padre
commit
2d706d4865
Se han modificado 26 ficheros con 928 adiciones y 28 borrados
  1. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/OperationLogDTO.java
  2. 3 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractLog.java
  3. 76 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/OperationLog.java
  4. 22 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java
  5. 24 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/OperationLogClient.java
  6. 50 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/OperationLogVO.java
  7. 30 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/SaveContractLogVO.java
  8. 18 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/OperationLogWrapper.java
  9. 226 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeVO2.java
  10. 10 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ArchiveFileController.java
  11. 86 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/OperationLogController.java
  12. 0 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/WeatherController.java
  13. 1 5
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ConstructionLedgerFeignController.java
  14. 45 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java
  15. 68 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/OperationLogClientImpl.java
  16. 33 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.java
  17. 24 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.xml
  18. 32 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IOperationLogService.java
  19. 36 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/OperationLogServiceImpl.java
  20. 2 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java
  21. 3 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java
  22. 1 11
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.java
  23. 44 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml
  24. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java
  25. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java
  26. 57 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/OperationLogDTO.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.OperationLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OperationLogDTO extends OperationLog {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -74,6 +74,7 @@ public class ContractLog extends BaseEntity {
 
     @ApiModelProperty("工程部位")
     private String projectPart;
+
     /**
      * 数据ID
      */
@@ -82,5 +83,7 @@ public class ContractLog extends BaseEntity {
     @ApiModelProperty("填报人姓名")
     private String createUserName;
 
+    @ApiModelProperty("关联工序的ids")
+    private String correlationId;
 
 }

+ 76 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/OperationLog.java

@@ -0,0 +1,76 @@
+/*
+ *      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-07-14
+ */
+@Data
+@TableName("u_operation_log")
+@EqualsAndHashCode(callSuper = true)
+public class OperationLog extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 操作类型
+     */
+    @ApiModelProperty("操作类型")
+    private Integer operationType;
+    /**
+     * 操作模块
+     */
+	@ApiModelProperty("操作模块")
+    private String operationModule;
+    /**
+     * 操作内容
+     */
+	@ApiModelProperty("操作内容")
+    private String operationContent;
+    /**
+     * 操作媒介,PC还是APP
+     */
+	@ApiModelProperty("操作媒介,PC还是APP")
+    private String operationMedium;
+    /**
+     * 操作账户
+     */
+	@ApiModelProperty("操作账户")
+    private String operationAccount;
+    /**
+     * 删除类型则是被删除数据的主键,废除类型则是被废除任务的主键
+     */
+	@ApiModelProperty("删除类型则是被删除数据的主键,废除类型则是被废除任务的主键")
+    private String businessId;
+
+	@ApiModelProperty("操作人")
+    private String createUserName;
+
+
+}

+ 22 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java

@@ -0,0 +1,22 @@
+package org.springblade.business.feign;
+
+import org.springblade.business.vo.SaveContractLogVO;
+import org.springblade.common.constant.BusinessConstant;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@FeignClient(value =
+        BusinessConstant.APPLICATION_WEATHER_NAME
+)
+public interface ContractLogClient {
+
+    String API_PREFIX = "/contractLog";
+
+    /**
+     * 保存日志信息
+     */
+    @PostMapping(API_PREFIX + "/saveContractLog")
+    void saveContractLog(@RequestBody SaveContractLogVO saveContractLogVO);
+
+}

+ 24 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/OperationLogClient.java

@@ -0,0 +1,24 @@
+package org.springblade.business.feign;
+
+import org.springblade.common.constant.BusinessConstant;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(value =
+        BusinessConstant.APPLICATION_WEATHER_NAME
+)
+public interface OperationLogClient {
+
+    String API_PREFIX = "/operationLog";
+
+    /**
+     * 保存操作日志
+     * @param type 操作类型,详见业务字典中操作类型
+     * @param operationObjId 操作的业务对象ID
+     */
+    @PostMapping(API_PREFIX + "/saveUserOperationLog")
+    void saveUserOperationLog(@RequestBody Integer type, @RequestParam String operationModule, @RequestParam Object operationObjId);
+
+}

+ 50 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/OperationLogVO.java

@@ -0,0 +1,50 @@
+/*
+ *      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 io.swagger.annotations.ApiModelProperty;
+import org.springblade.business.entity.OperationLog;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OperationLogVO extends OperationLog {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 操作类型
+	 */
+	@ApiModelProperty("操作类型")
+	private String operationTypeValue;
+
+	@ApiModelProperty("输入框查询")
+	private String queryValue;
+
+	@ApiModelProperty("开始时间")
+	private String startTime;
+
+	@ApiModelProperty("结束时间")
+	private String endTime;
+
+}

+ 30 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/SaveContractLogVO.java

@@ -0,0 +1,30 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class SaveContractLogVO {
+
+    @ApiModelProperty("列表数据主键")
+    private Long id;
+
+    @ApiModelProperty("项目ID")
+    private String projectId;
+
+    @ApiModelProperty("合同段ID")
+    private String contractId;
+
+    @ApiModelProperty("日志填报的节点ID(唯一键)")
+    private String wbsNodeId;
+
+    @ApiModelProperty("填报的日志类型")
+    private String wbsNodeType;
+
+    @ApiModelProperty("填报日期,所选的日期")
+    private String recordTime;
+
+    @ApiModelProperty("关联工序的ids")
+    private String correlationId;
+
+}

+ 18 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/wrapper/OperationLogWrapper.java

@@ -0,0 +1,18 @@
+package org.springblade.business.wrapper;
+
+import org.springblade.business.entity.OperationLog;
+import org.springblade.business.vo.OperationLogVO;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+
+import java.util.Objects;
+
+public class OperationLogWrapper extends BaseEntityWrapper<OperationLog, OperationLogVO> {
+
+    public static OperationLogWrapper build(){return new OperationLogWrapper();}
+
+    @Override
+    public OperationLogVO entityVO(OperationLog entity) {
+        return Objects.requireNonNull(BeanUtil.copy(entity, OperationLogVO.class));
+    }
+}

+ 226 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeVO2.java

@@ -0,0 +1,226 @@
+package org.springblade.manager.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+import org.springblade.core.tool.node.INode;
+import org.springblade.core.tool.node.TreeNode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * wbsTree树形结构VO2
+ *
+ * @author liuyc
+ * @since 2022-07-13
+ */
+@Data
+public class WbsTreeVO2 implements INode<WbsTreeVO2> {
+    private static final long serialVersionUID = 1L;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long parentId;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List<WbsTreeVO2> children;
+
+    private String title;
+    @JsonSerialize(
+            using = ToStringSerializer.class
+    )
+    private Long key;
+    @JsonSerialize(
+            using = ToStringSerializer.class
+    )
+    private Long value;
+
+    private Integer type;
+
+    private Integer wbsType;
+
+    private Integer deptCategory;
+
+    private String tenantId;
+
+    private Integer isExistForm;
+
+    private String ancestors;
+
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private Boolean hasChildren;
+
+    public WbsTreeVO2() {
+    }
+
+    @Override
+    public List<WbsTreeVO2> getChildren() {
+        if (this.children == null) {
+            this.children = new ArrayList<>();
+        }
+        return this.children;
+    }
+
+    @Override
+    public Boolean getHasChildren() {
+        return hasChildren;
+    }
+
+    public String getAncestors() {
+        return ancestors;
+    }
+
+    public void setAncestors(String ancestors) {
+        this.ancestors = ancestors;
+    }
+
+    public String getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(String tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public Integer getIsExistForm() {
+        return isExistForm;
+    }
+
+    public void setIsExistForm(Integer isExistForm) {
+        this.isExistForm = isExistForm;
+    }
+
+    public Integer getDeptCategory() {
+        return deptCategory;
+    }
+
+    public void setDeptCategory(Integer deptCategory) {
+        this.deptCategory = deptCategory;
+    }
+
+    public Integer getWbsType() {
+        return wbsType;
+    }
+
+    public void setWbsType(Integer wbsType) {
+        this.wbsType = wbsType;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public String getTitle() {
+        return this.title;
+    }
+
+    public Long getKey() {
+        return this.key;
+    }
+
+    public Long getValue() {
+        return this.value;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public void setTitle(final String title) {
+        this.title = title;
+    }
+
+    public void setKey(final Long key) {
+        this.key = key;
+    }
+
+    public void setValue(final Long value) {
+        this.value = value;
+    }
+
+
+    public String toString() {
+        return "TreeNode(deptCategory=" + this.getDeptCategory()
+                + ",tenantId" + this.getTenantId()
+                + ",ancestors" + this.getAncestors()
+                + ",isExistForm" + this.getIsExistForm()
+                + ",wbsType=" + this.getWbsType()
+                + ", type=" + this.getType()
+                + ", title=" + this.getTitle()
+                + ", key=" + this.getKey()
+                + ", value=" + this.getValue()
+                + ")";
+    }
+
+    public boolean equals(final Object o) {
+        if (o == this) {
+            return true;
+        } else if (!(o instanceof TreeNode)) {
+            return false;
+        } else {
+            TreeNodeVO other = (TreeNodeVO) o;
+            if (!other.canEqual(this)) {
+                return false;
+            } else {
+                label47:
+                {
+                    Object this$key = this.getKey();
+                    Object other$key = other.getKey();
+                    if (this$key == null) {
+                        if (other$key == null) {
+                            break label47;
+                        }
+                    } else if (this$key.equals(other$key)) {
+                        break label47;
+                    }
+
+                    return false;
+                }
+
+                Object this$value = this.getValue();
+                Object other$value = other.getValue();
+                if (this$value == null) {
+                    if (other$value != null) {
+                        return false;
+                    }
+                } else if (!this$value.equals(other$value)) {
+                    return false;
+                }
+
+                Object this$title = this.getTitle();
+                Object other$title = other.getTitle();
+                if (this$title == null) {
+                    if (other$title != null) {
+                        return false;
+                    }
+                } else if (!this$title.equals(other$title)) {
+                    return false;
+                }
+
+                return true;
+            }
+        }
+    }
+
+    protected boolean canEqual(final Object other) {
+        return other instanceof TreeNode;
+    }
+
+    public int hashCode() {
+        boolean PRIME = true;
+        int result = 1;
+        Object $key = this.getKey();
+        result = result * 59 + ($key == null ? 43 : $key.hashCode());
+        Object $value = this.getValue();
+        result = result * 59 + ($value == null ? 43 : $value.hashCode());
+        Object $title = this.getTitle();
+        result = result * 59 + ($title == null ? 43 : $title.hashCode());
+        return result;
+    }
+
+}

+ 10 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/ArchiveFileController.java

@@ -11,6 +11,7 @@ import lombok.AllArgsConstructor;
 
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.Task;
+import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.business.service.IArchiveShowService;
 import org.springblade.business.vo.ArchiveTaskVO;
@@ -51,6 +52,8 @@ public class ArchiveFileController extends BladeController {
 
 	private final TaskClient taskClient;
 
+	private final OperationLogClient operationLogClient;
+
 	/**
 	 * 批量废除
 	 * @param ids 列表主键
@@ -74,6 +77,9 @@ public class ArchiveFileController extends BladeController {
 			// todo ================== 调用撤签
 		}
 
+		//保存操作记录
+		this.operationLogClient.saveUserOperationLog(26, "工程文件", ids);
+
 		return R.data(true);
 	}
 
@@ -91,6 +97,10 @@ public class ArchiveFileController extends BladeController {
 			BeanUtils.copyProperties(archiveTaskVO, taskVO);
 			taskVO.setFormDataId(archiveTaskIds);
 			taskVO.setApprovalType(2);
+
+			//新增操作日志
+			this.operationLogClient.saveUserOperationLog(25, "工程文件", archiveTaskIds);
+
 			//启动流程
 			this.taskClient.startTask(taskVO);
 			//修改状态为待审批

+ 86 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/OperationLogController.java

@@ -0,0 +1,86 @@
+/*
+ *      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.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+
+import org.springblade.business.wrapper.OperationLogWrapper;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.system.entity.DictBiz;
+import org.springblade.system.feign.IDictBizClient;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.OperationLog;
+import org.springblade.business.vo.OperationLogVO;
+import org.springblade.business.service.IOperationLogService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/operationLog")
+@Api(value = "操作日志", tags = "操作日志")
+public class OperationLogController extends BladeController {
+
+	private final IOperationLogService operationLogService;
+
+	private final IDictBizClient dictBizClient;
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页", notes = "传入operationLog")
+	public R<IPage<OperationLogVO>> list(OperationLog operationLog, Query query) {
+
+		operationLog.setCreateUser(AuthUtil.getUserId());
+		IPage<OperationLog> pages = operationLogService.page(Condition.getPage(query), Condition.getQueryWrapper(operationLog));
+
+		//获取业务字典
+		List<DictBiz> dictBizList = this.dictBizClient.getList("operation_type", "notRoot").getData();
+
+		IPage<OperationLogVO> voiPage = OperationLogWrapper.build().pageVO(pages);
+		List<OperationLogVO> resultVo = voiPage.getRecords();
+		resultVo.forEach(vo -> {
+			for(DictBiz biz : dictBizList){
+				if(vo.getOperationType() != null && vo.getOperationType().toString().equals(biz.getDictKey())){
+					vo.setOperationTypeValue(biz.getDictValue());
+					break;
+				}
+			}
+		});
+		voiPage.setRecords(resultVo);
+
+		return R.data(voiPage);
+	}
+
+	
+}

+ 0 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/WeatherController.java

@@ -2,7 +2,6 @@ package org.springblade.business.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.*;
-import io.undertow.util.DateUtils;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;

+ 1 - 5
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ConstructionLedgerFeignController.java

@@ -23,10 +23,6 @@ public class ConstructionLedgerFeignController implements ConstructionLedgerFeig
     @Override
     @PostMapping(INIT_URL)
     public boolean initConstructionLedger(@RequestBody ConstructionLedger constructionLedger) {
-        boolean save = iConstructionLedgerService.save(constructionLedger);
-        if (save) {
-            return true;
-        }
-        return false;
+        return iConstructionLedgerService.save(constructionLedger);
     }
 }

+ 45 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -0,0 +1,45 @@
+package org.springblade.business.feignClient;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.ContractLog;
+import org.springblade.business.feign.ContractLogClient;
+import org.springblade.business.service.IContractLogService;
+import org.springblade.business.vo.SaveContractLogVO;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tenant.annotation.NonDS;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+@RestController
+@AllArgsConstructor
+@NonDS
+public class ContractLogClientImpl implements ContractLogClient {
+
+    private final IContractLogService contractLogService;
+
+    @Override
+    public void saveContractLog(SaveContractLogVO saveContractLogVO) {
+        ContractLog contractLog = new ContractLog();
+        //复制数据
+        BeanUtils.copyProperties(saveContractLogVO, contractLog);
+
+        if(contractLog.getId() != null){
+            //主键不为空,说明是修改
+            //修改只修改关联的工序ids
+            if(StringUtils.isNotEmpty(contractLog.getCorrelationId())){
+                this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getContractId, contractLog.getCorrelationId()).set(ContractLog::getUpdateUser, AuthUtil.getUserId()).set(ContractLog::getUpdateTime, new Date()).eq(ContractLog::getId, contractLog.getId().toString()));
+            }
+        } else {
+            //新增
+            contractLog.setCreateUser(AuthUtil.getUserId());
+            contractLog.setCreateUserName(AuthUtil.getUserName());
+
+            this.contractLogService.save(contractLog);
+        }
+
+    }
+}

+ 68 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/OperationLogClientImpl.java

@@ -0,0 +1,68 @@
+package org.springblade.business.feignClient;
+
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.OperationLog;
+import org.springblade.business.feign.OperationLogClient;
+import org.springblade.business.service.IOperationLogService;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.system.entity.DictBiz;
+import org.springblade.system.feign.IDictBizClient;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@NonDS
+public class OperationLogClientImpl implements OperationLogClient {
+
+    private final IOperationLogService operationLogService;
+
+    private final IDictBizClient dictBizClient;
+
+    @Override
+    public void saveUserOperationLog(Integer type, String operationModule, Object operationObjId) {
+        try{
+            //获取业务字典
+            List<DictBiz> dictBizList = this.dictBizClient.getList("operation_type", "notRoot").getData();
+            String operationAccount = "";
+            for(DictBiz dictBiz : dictBizList){
+                if(dictBiz.getDictKey().equals(type.toString())){
+                    operationAccount = dictBiz.getDictValue();
+                    break;
+                }
+            }
+
+            //新增数据
+            OperationLog newData = new OperationLog();
+            //操作模块
+            newData.setOperationModule(operationModule);
+            //操作内容
+            newData.setOperationAccount(operationAccount + ";" + operationObjId);
+            //PC 还是 APP
+            newData.setOperationMedium("PC");
+            //业务数据
+            newData.setOperationType(type);
+            if(operationObjId != null && StringUtils.isNotEmpty(operationObjId.toString())){
+                //业务数据ID
+                newData.setBusinessId(operationObjId.toString());
+            }
+            //操作账户
+            newData.setOperationAccount(AuthUtil.getUserName());
+            //操作人姓名
+            newData.setCreateUserName(AuthUtil.getNickName());
+            //操作人ID
+            newData.setCreateUser(AuthUtil.getUserId());
+            //操作时间
+            newData.setCreateTime(new Date());
+            //保存数据
+            this.operationLogService.save(newData);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+}

+ 33 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.java

@@ -0,0 +1,33 @@
+/*
+ *      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.springblade.business.entity.OperationLog;
+import org.springblade.business.vo.OperationLogVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+public interface OperationLogMapper extends BaseMapper<OperationLog> {
+
+}

+ 24 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/OperationLogMapper.xml

@@ -0,0 +1,24 @@
+<?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.OperationLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="operationLogResultMap" type="org.springblade.business.entity.OperationLog">
+        <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="operation_type" property="operationType"/>
+        <result column="operation_module" property="operationModule"/>
+        <result column="operation_content" property="operationContent"/>
+        <result column="operation_medium" property="operationMedium"/>
+        <result column="operation_account" property="operationAccount"/>
+        <result column="business_id" property="businessId"/>
+        <result column="create_user_name" property="createUserName"/>
+    </resultMap>
+
+</mapper>

+ 32 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IOperationLogService.java

@@ -0,0 +1,32 @@
+/*
+ *      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.OperationLog;
+import org.springblade.business.vo.OperationLogVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+public interface IOperationLogService extends BaseService<OperationLog> {
+
+}

+ 36 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/OperationLogServiceImpl.java

@@ -0,0 +1,36 @@
+/*
+ *      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 org.springblade.business.entity.OperationLog;
+import org.springblade.business.vo.OperationLogVO;
+import org.springblade.business.mapper.OperationLogMapper;
+import org.springblade.business.service.IOperationLogService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-14
+ */
+@Service
+public class OperationLogServiceImpl extends BaseServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService {
+
+}

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

@@ -246,7 +246,6 @@ public class ProjectInfoController extends BladeController {
             default:
                 return R.fail("关联wbs树失败");
         }
-
     }
 
     /**
@@ -255,8 +254,8 @@ public class ProjectInfoController extends BladeController {
     @GetMapping("/findProjectAndContractList")
     @ApiOperationSupport(order = 12)
     @ApiOperation(value = "根据用户id查询项目合同岗位列表信息", notes = "传入用户id")
-    public R<List<Map>> findProjectAndContractList(Long userId) {
-        List<Map> result = wbsTreeService.findProjectAndContractList(userId);
+    public R<List<SaveUserInfoByProjectVO2>> findProjectAndContractList(Long userId) {
+        List<SaveUserInfoByProjectVO2> result = wbsTreeService.findProjectAndContractList(userId);
         return R.data(result);
     }
 }

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

@@ -40,6 +40,7 @@ import org.springblade.manager.service.IWbsFormElementService;
 import org.springblade.manager.vo.WbsFormElementVO;
 import org.springblade.manager.vo.WbsNodeTableVO;
 import org.springblade.manager.vo.WbsTreeVO;
+import org.springblade.manager.vo.WbsTreeVO2;
 import org.springblade.system.cache.DictCache;
 import org.springblade.system.enums.DictEnum;
 import org.springframework.transaction.annotation.Transactional;
@@ -118,8 +119,8 @@ public class WbsTreeController extends BladeController {
             @ApiImplicitParam(name = "wbsId", value = "wbsId", required = true),
             @ApiImplicitParam(name = "type", value = "节点类型type '1'节点or'2'表单"),
     })
-    public R<List<WbsTreeVO>> tree(String wbsId, String type, String tenantId, BladeUser bladeUser) {
-        List<WbsTreeVO> tree = wbsTreeService.tree(wbsId, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), type);
+    public R<List<WbsTreeVO2>> tree(String wbsId, String type, String tenantId, BladeUser bladeUser) {
+        List<WbsTreeVO2> tree = wbsTreeService.tree(wbsId, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), type);
         if (tree != null && tree.size() > 0) {
             return R.data(tree);
         }

+ 1 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.java

@@ -39,20 +39,12 @@ public interface WbsTreeMapper extends BaseMapper<WbsTree> {
 
     /**
      * 自定义分页
-     *
-     * @param page
-     * @param wbsTree
-     * @return
      */
     List<WbsTreeVO> selectWbsTreePage(IPage page, WbsTreeVO wbsTree);
 
 
     /**
      * 懒加载获取树形节点
-     *
-     * @param tenantId
-     * @param parentId
-     * @return
      */
     List<WbsTreeVO> lazyTree(@Param("wbsId") String wbsId,
                              @Param("tenantId") String tenantId,
@@ -60,12 +52,10 @@ public interface WbsTreeMapper extends BaseMapper<WbsTree> {
 
     /**
      * 获取树形节点
-     *
-     * @param tenantId
-     * @return
      */
     List<WbsTreeVO> tree(@Param("wbsId") String wbsId, @Param("tenantId") String tenantId, @Param("type") String type);
 
+    List<WbsTreeVO2> tree2(@Param("wbsId") String wbsId, @Param("tenantId") String tenantId, @Param("type") String type);
 
     /**
      * 表单查询(根据节点ID查询当前表单)

+ 44 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml

@@ -48,6 +48,21 @@
         <result column="ancestors" property="ancestors"/>
     </resultMap>
 
+    <resultMap id="treeNodeResultMap2" type="org.springblade.manager.vo.WbsTreeVO2">
+        <id column="id" property="id"/>
+        <result column="parentId" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="value" property="value"/>
+        <result column="key" property="key"/>
+        <result column="has_children" property="hasChildren"/>
+        <result column="type" property="type"/>
+        <result column="deptCategory" property="deptCategory"/>
+        <result column="wbsType" property="wbsType"/>
+        <result column="isExistForm" property="isExistForm"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="tenantId" property="tenantId"/>
+    </resultMap>
+
     <resultMap id="selectByNodeTableMap" type="org.springblade.manager.vo.WbsNodeTableVO">
         <id column="id" property="id"/>
         <result column="tableName" property="tableName"/>
@@ -225,6 +240,35 @@
         ORDER BY sort
     </select>
 
+    <select id="tree2" resultMap="treeNodeResultMap2">
+        SELECT d.id,
+        d.tenant_id AS "tenantId",
+        d.parent_id AS "parentId",
+        d.dept_name AS title,
+        d.type AS "type",
+        d.id AS "value",
+        d.id AS "key",
+        d.dept_category AS "deptCategory",
+        d.is_exist_form AS "isExistForm",
+        (SELECT wbs_type FROM m_wbs_info WHERE id = #{wbsId}) AS "wbsType",
+        (SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree c WHERE c.parent_id = d.id AND c.is_deleted =
+        0) AS "has_children"
+        FROM m_wbs_tree d
+        WHERE
+        is_deleted = 0
+        AND status = 1
+        <if test="wbsId!=null and wbsId!=''">
+            AND wbs_id = #{wbsId}
+        </if>
+        <if test="tenantId!=null and tenantId!=''">
+            AND tenant_id = #{tenantId}
+        </if>
+        <if test="type!=null and type!=''">
+            AND `type` = #{type}
+        </if>
+        ORDER BY sort
+    </select>
+
 
     <select id="lazyTree" resultMap="treeNodeResultMap">
         SELECT

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java

@@ -63,7 +63,7 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
      * @param tenantId
      * @return
      */
-    List<WbsTreeVO> tree(String wbsId, String tenantId, String type);
+    List<WbsTreeVO2> tree(String wbsId, String tenantId, String type);
 
     /**
      * 提交
@@ -104,7 +104,7 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
 
     List<WbsTree> findByWbsTreeNode(String ids);
 
-    List<Map> findProjectAndContractList(Long userId);
+    List<SaveUserInfoByProjectVO2> findProjectAndContractList(Long userId);
 
     List<WbsTreeDTO2> findWbsTreeSameLevel(String parentId);
 

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java

@@ -205,6 +205,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
             wbsFormElement.setEKey("key_1");
         }
         String newName = wbsFormElement.getEKey();
+
         //同步
         StringBuilder sbr1 = new StringBuilder();
         String fieldType = judgeDataType(wbsFormElement.getEType());

+ 57 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -93,8 +93,37 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     }
 
     @Override
-    public List<WbsTreeVO> tree(String wbsId, String tenantId, String type) {
-        return ForestNodeMerger.merge(baseMapper.tree(wbsId, tenantId, type));
+    public List<WbsTreeVO2> tree(String wbsId, String tenantId, String type) {
+
+        //方法1-数据量过大时响应格式错误
+        /*return ForestNodeMerger.merge(baseMapper.tree(wbsId, tenantId, type));*/
+
+        //方法2
+        List<WbsTreeVO2> wbsTreeVO2s = baseMapper.tree2(wbsId, tenantId, type);
+        if (wbsTreeVO2s != null && wbsTreeVO2s.size() > 0) {
+            return buildWbsTreeByStream(wbsTreeVO2s);
+        }
+        return wbsTreeVO2s;
+    }
+
+    private List<WbsTreeVO2> buildWbsTreeByStream(List<WbsTreeVO2> wbsTreeVO2s) {
+        //构建数据,获取根节点
+        List<WbsTreeVO2> list = wbsTreeVO2s.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
+        //根节点分组
+        Map<Long, List<WbsTreeVO2>> map = wbsTreeVO2s.stream().collect(Collectors.groupingBy(WbsTreeVO2::getParentId));
+        this.recursionFnTree(list, map);
+        return list;
+    }
+
+    private void recursionFnTree(List<WbsTreeVO2> list, Map<Long, List<WbsTreeVO2>> map) {
+        //递归
+        for (WbsTreeVO2 wbsTreeVO2 : list) {
+            List<WbsTreeVO2> childrenList = map.get(wbsTreeVO2.getId());
+            wbsTreeVO2.setChildren(childrenList);
+            if (childrenList != null && childrenList.size() > 0) {
+                recursionFnTree(childrenList, map);
+            }
+        }
     }
 
     @Override
@@ -390,9 +419,30 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     @Override
     public List<WbsFormElementVO> selectFormElements(String id) {
         List<WbsFormElementVO> wbsFormElements = wbsTreeMapper.selectFormElements(id);
+        wbsFormElements.stream().forEach(elements -> {
+            String eAllowDeviation = elements.getEAllowDeviation();
+            //转义
+            String escapeChar = getEscapeChar(eAllowDeviation);
+            if (escapeChar != null) {
+                elements.setEAllowDeviation(escapeChar);
+            }
+        });
         return wbsFormElements;
     }
 
+    private static String getEscapeChar(String str) {
+        if (StringUtils.isBlank(str)) {
+            return str;
+        }
+        if (str.contains("&gt;")) {
+            return str.replace("&gt;", ">");
+        }
+        if (str.contains("&lt;")) {
+            return str.replace("&lt;", "<");
+        }
+        return null;
+    }
+
     private String selectTableIdByTableName(String id) {
         QueryWrapper<WbsTree> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", id);
@@ -542,8 +592,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     }
 
     @Override
-    public List<Map> findProjectAndContractList(Long userId) {
+    public List<SaveUserInfoByProjectVO2> findProjectAndContractList(Long userId) {
         List<SaveUserInfoByProjectVO2> list = baseMapper.selectListByUserId(userId);
+
+        //TODO 用户项目合同段角色返回Map
         Map<String, List<SaveUserInfoByProjectVO2>> collect = list.stream().collect(Collectors.groupingBy(SaveUserInfoByProjectVO2::getProjectName));
         List<Map> collect1 = collect.entrySet().stream().map(entity -> {
             Map resultMap = new HashMap();
@@ -551,7 +603,8 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
             resultMap.put("dataInfo", entity.getValue());
             return resultMap;
         }).collect(Collectors.toList());
-        return collect1;
+
+        return list;
     }
 
     @Override