sunhz 4 лет назад
Родитель
Сommit
f672f8dcd1
24 измененных файлов с 1053 добавлено и 1820 удалено
  1. 28 18
      blade-ops/blade-report/src/main/java/org/springblade/report/ureport/DeliveryBean.java
  2. 31 0
      blade-ops/blade-report/src/main/java/org/springblade/report/util/ParamUtil.java
  3. 8 6
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditItems.java
  4. 5 4
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditItemsUsers.java
  5. 12 5
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPaths.java
  6. 20 9
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPathsActs.java
  7. 5 2
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPathsLevels.java
  8. 29 12
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditProecess.java
  9. 16 3
      blade-service-api/blade-check-api/src/main/java/org/springblade/check/feign/ICheckClient.java
  10. 2 2
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/feign/IDeliveryReportClient.java
  11. 2 0
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/vo/DeliveryReportVO.java
  12. 100 127
      blade-service/blade-check/src/main/java/org/springblade/check/controller/AuditProecessController.java
  13. 0 156
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditItems.java
  14. 0 75
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditItemsUsers.java
  15. 0 93
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPaths.java
  16. 0 82
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPathsActs.java
  17. 0 81
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPathsLevels.java
  18. 0 159
      blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditProecess.java
  19. 6 4
      blade-service/blade-check/src/main/java/org/springblade/check/service/IAuditProecessService.java
  20. 247 366
      blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java
  21. 9 5
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/controller/DeliveryReportController.java
  22. 225 263
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderController.java
  23. 22 11
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/IOrderService.java
  24. 286 337
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

+ 28 - 18
blade-ops/blade-report/src/main/java/org/springblade/report/ureport/DeliveryBean.java

@@ -5,6 +5,7 @@ import org.apache.commons.lang.StringUtils;
 import org.springblade.deliver.goods.entity.Delivery;
 import org.springblade.deliver.goods.feign.IDeliveryReportClient;
 import org.springblade.deliver.goods.vo.DeliveryReportVO;
+import org.springblade.report.util.ParamUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -17,12 +18,13 @@ public class DeliveryBean {
 
 	private final IDeliveryReportClient reportClient;
 
-	public List<DeliveryReportVO> loadCommissionData(String dsName, String datasetName, Map<String, Object> parameters) {
-		Integer year = parameters.get("year") == null ? null : Integer.parseInt(((String) parameters.get("year")).trim());
-		String quarter = parameters.get("quarter") == null ? null : ((String) parameters.get("quarter")).trim();
-		String userType = parameters.get("userType") == null ? null : ((String) parameters.get("userType")).trim();
-		Long goodsId = parameters.get("goodsId") == null ? null : Long.parseLong(((String) parameters.get("goodsId")).trim());
-		Long userId = parameters.get("userId") == null ? null : Long.parseLong(((String) parameters.get("userId")).trim());
+	public List<DeliveryReportVO> loadCommissionData(String dsName, String datasetName, Map<String, Object> params) {
+		Integer year = ParamUtil.getInteger(params.get("year"));
+		String quarter = ParamUtil.getString(params.get("quarter"));
+		String userType = ParamUtil.getString(params.get("userType"));
+		Long goodsId = ParamUtil.getLong(params.get("goodsId"));
+		Long userId = ParamUtil.getLong(params.get("userId"));
+		String tenantId = ParamUtil.getString(params.get("tenantId"));
 
 		if (year == null || StringUtils.isBlank(quarter) || StringUtils.isBlank(userType) || goodsId == null) {
 			return new ArrayList<DeliveryReportVO>() {{
@@ -36,21 +38,25 @@ public class DeliveryBean {
 		reportVO.setUserId(userId);
 		reportVO.setGoodsId(goodsId);
 		reportVO.setUserType(userType);
+		reportVO.setTenantId(tenantId);
 		return reportClient.commission(reportVO).getData();
 	}
 
-	public List<Delivery> loadApprovalData(String dsName, String datasetName, Map<String, Object> parameters) {
-		String orgOrderNo = parameters.get("orgOrderNo") == null ? null : ((String) parameters.get("orgOrderNo")).trim();
-		Long corpId = parameters.get("corpId") == null ? null : Long.parseLong(((String) parameters.get("corpId")).trim());
-		Long salesCompany = parameters.get("salesCompany") == null ? null : Long.parseLong(((String) parameters.get("salesCompany")).trim());
-		Long storageId = parameters.get("storageId") == null ? null : Long.parseLong(((String) parameters.get("storageId")).trim());
-		String arrivalAddress = parameters.get("arrivalAddress") == null ? null : ((String) parameters.get("arrivalAddress")).trim();
-		String arrivalContact = parameters.get("arrivalContact") == null ? null : ((String) parameters.get("arrivalContact")).trim();
-		String arrivalTel = parameters.get("arrivalTel") == null ? null : ((String) parameters.get("arrivalTel")).trim();
-		Long createUser = parameters.get("createUser") == null ? null : Long.parseLong(((String) parameters.get("createUser")).trim());
-		String businessStartDate = parameters.get("businessStartDate") == null ? null : ((String) parameters.get("businessStartDate")).trim();
-		String businessEndDate = parameters.get("businessEndDate") == null ? null : ((String) parameters.get("businessEndDate")).trim();
-		String billType = parameters.get("billType") == null ? null : ((String) parameters.get("billType")).trim();
+	public List<Delivery> loadApprovalData(String dsName, String datasetName, Map<String, Object> params) {
+		String orgOrderNo = ParamUtil.getString(params.get("orgOrderNo"));
+		Long corpId = ParamUtil.getLong(params.get("corpId"));
+		Long salesCompany = ParamUtil.getLong(params.get("salesCompany"));
+		Long storageId = ParamUtil.getLong(params.get("storageId"));
+		String arrivalAddress = ParamUtil.getString(params.get("arrivalAddress"));
+		String arrivalContact = ParamUtil.getString(params.get("arrivalContact"));
+		String arrivalTel = ParamUtil.getString(params.get("arrivalTel"));
+		Long createUser = ParamUtil.getLong(params.get("createUser"));
+		String businessStartDate = ParamUtil.getString(params.get("businessStartDate"));
+		String businessEndDate = ParamUtil.getString(params.get("businessEndDate"));
+		String createTimeStart = ParamUtil.getString(params.get("createTimeStart"));
+		String createTimeEnd = ParamUtil.getString(params.get("createTimeEnd"));
+		String billType = ParamUtil.getString(params.get("billType"));
+		String tenantId = ParamUtil.getString(params.get("tenantId"));
 
 		Delivery delivery = new Delivery();
 		delivery.setOrgOrderNo(orgOrderNo);
@@ -63,7 +69,11 @@ public class DeliveryBean {
 		delivery.setCreateUser(createUser);
 		delivery.setBusinessStartDate(businessStartDate);
 		delivery.setBusinessEndDate(businessEndDate);
+		delivery.setCreateStartTime(createTimeStart);
+		delivery.setCreateEndTime(createTimeEnd);
 		delivery.setBillType(billType);
+		delivery.setTenantId(tenantId);
 		return reportClient.approval(delivery).getData();
 	}
+
 }

+ 31 - 0
blade-ops/blade-report/src/main/java/org/springblade/report/util/ParamUtil.java

@@ -0,0 +1,31 @@
+package org.springblade.report.util;
+
+import org.apache.commons.lang.StringUtils;
+
+public class ParamUtil {
+
+	public static String getString(Object parameter) {
+		String value = (String) parameter;
+		if (StringUtils.isNotBlank(value)){
+			return value.trim();
+		}
+		return null;
+	}
+
+	public static Long getLong(Object parameter) {
+		String value = (String) parameter;
+		if (StringUtils.isNotBlank(value)){
+			return Long.parseLong(value.trim());
+		}
+		return null;
+	}
+
+	public static Integer getInteger(Object parameter) {
+		String value = (String) parameter;
+		if (StringUtils.isNotBlank(value)){
+			return Integer.parseInt(value.trim());
+		}
+		return null;
+	}
+
+}

+ 8 - 6
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditItems.java

@@ -38,17 +38,17 @@ public class AuditItems implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
+	private Long id;
 	/**
 	* 活动号
 	*/
 		@ApiModelProperty(value = "活动号")
-		private Integer actId;
+		private Long actId;
 	/**
 	* 业务id
 	*/
 		@ApiModelProperty(value = "业务id")
-		private Integer billId;
+		private Long billId;
 	/**
 	* 单据编号
 	*/
@@ -73,7 +73,7 @@ public class AuditItems implements Serializable {
 	* 审核路径名
 	*/
 		@ApiModelProperty(value = "审核路径名")
-		private Integer pathId;
+		private Long pathId;
 	/**
 	* 审核级次1.2.3
 	*/
@@ -93,7 +93,7 @@ public class AuditItems implements Serializable {
 	* 请核人ID
 	*/
 		@ApiModelProperty(value = "请核人ID")
-		private Integer sendUserId;
+		private Long sendUserId;
 	/**
 	* 请核人姓名
 	*/
@@ -113,7 +113,7 @@ public class AuditItems implements Serializable {
 	* 审核人ID
 	*/
 		@ApiModelProperty(value = "审核人ID")
-		private Integer auditUserId;
+		private Long auditUserId;
 	/**
 	* 审核通过时间
 	*/
@@ -150,5 +150,7 @@ public class AuditItems implements Serializable {
 		@ApiModelProperty(value = "第几次提交审批")
 		private Integer times;
 
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
 
 }

+ 5 - 4
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditItemsUsers.java

@@ -37,8 +37,8 @@ public class AuditItemsUsers implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
-	private Integer pid;
+	private Long id;
+	private Long pid;
 	/**
 	* 单据编号
 	*/
@@ -53,7 +53,7 @@ public class AuditItemsUsers implements Serializable {
 	* 审批人
 	*/
 		@ApiModelProperty(value = "审批人")
-		private Integer userId;
+		private Long userId;
 	/**
 	* 状态
 	*/
@@ -70,5 +70,6 @@ public class AuditItemsUsers implements Serializable {
 		@ApiModelProperty(value = "第几次提交审批")
 		private Integer times;
 
-
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
 }

+ 12 - 5
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPaths.java

@@ -17,13 +17,14 @@
 package org.springblade.check.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
+
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -40,12 +41,12 @@ public class AuditPaths implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
+	private Long id;
 	/**
 	* 审核路径ID
 	*/
 		@ApiModelProperty(value = "审核路径ID")
-		private Integer pathId;
+		private Long pathId;
 	/**
 	* 审核路径名称
 	*/
@@ -55,7 +56,7 @@ public class AuditPaths implements Serializable {
 	* 维护人id
 	*/
 		@ApiModelProperty(value = "维护人id")
-		private Integer opUserId;
+		private Long opUserId;
 	/**
 	* 维护人
 	*/
@@ -82,5 +83,11 @@ public class AuditPaths implements Serializable {
 		@ApiModelProperty(value = "备注")
 		private String remarks;
 
+		@ApiModelProperty(value = "审批流配置明细级别表")
+		@TableField(exist = false)
+		private List<AuditPathsLevels> auditPathsLevels;
+
 
+		@ApiModelProperty(value = "租户id")
+		private String tenantId;
 }

+ 20 - 9
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPathsActs.java

@@ -17,6 +17,7 @@
 package org.springblade.check.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
 import lombok.Data;
@@ -37,7 +38,7 @@ public class AuditPathsActs implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
+	private Long id;
 	/**
 	* 承包单位id
 	*/
@@ -46,8 +47,8 @@ public class AuditPathsActs implements Serializable {
 	/**
 	* 活动号
 	*/
-		@ApiModelProperty(value = "活动号")
-		private Integer actId;
+		@ApiModelProperty(value = "1:代表财务清核 ")
+		private int actId;
 	/**
 	* 审核条件(O是正常审批,I非正常审批)
 	*/
@@ -57,15 +58,25 @@ public class AuditPathsActs implements Serializable {
 	* 审核路径Id
 	*/
 		@ApiModelProperty(value = "审核路径Id")
-		private Integer pathId;
+		private Long pathId;
+	/**
+	* 存储对应审批字段
+	*/
+		@ApiModelProperty(value = "存储对应审批字段")
+		private String fidStatus;
+
+		@ApiModelProperty(value = "活动名")
+		private String actName;
 
+		@ApiModelProperty(value = "租户id")
+		private String tenantId;
 
-		/**
-		 * 是否启用此审批流(1启动 2不启动)
-		 */
-		@ApiModelProperty(value = "是否启用此审批流(1启动 2不启动)")
-		private Integer isEnable;
+	@ApiModelProperty(value = "审批路径名称")
+	@TableField(exist = false)
+		private String pathName;
 
+	@ApiModelProperty(value = "是否启用此审批流(1启动 2不启动)")
+	private Integer isEnable;
 
 
 }

+ 5 - 2
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditPathsLevels.java

@@ -37,12 +37,12 @@ public class AuditPathsLevels implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
+	private Long id;
 	/**
 	* 审批路径id
 	*/
 		@ApiModelProperty(value = "审批路径id")
-		private Integer pathId;
+		private Long pathId;
 	/**
 	* 审批级次
 	*/
@@ -74,5 +74,8 @@ public class AuditPathsLevels implements Serializable {
 		@ApiModelProperty(value = "备注")
 		private String remarks;
 
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
 
 }

+ 29 - 12
blade-service-api/blade-check-api/src/main/java/org/springblade/check/entity/AuditProecess.java

@@ -20,6 +20,7 @@ import java.time.LocalDateTime;
 import java.io.Serializable;
 import java.util.Date;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
@@ -66,28 +67,28 @@ public class AuditProecess implements Serializable {
 	/**
 	* 请核人ID
 	*/
-		@ApiModelProperty(value = "请人ID")
+		@ApiModelProperty(value = "请人ID")
 		private Long sendUserId;
 	/**
 	* 请核人姓名
 	*/
-		@ApiModelProperty(value = "请人姓名")
+		@ApiModelProperty(value = "请人姓名")
 		private String sendName;
 	/**
 	* 请核时间
 	*/
-		@ApiModelProperty(value = "请时间")
+		@ApiModelProperty(value = "请时间")
 		private Date sendTime;
 	/**
 	* 请核备注
 	*/
-		@ApiModelProperty(value = "备注")
+		@ApiModelProperty(value = "请核备注")
 		private String sendMsg;
 	/**
 	* 审核人ID
 	*/
 		@ApiModelProperty(value = "审核人ID")
-		private Long auditUserId;
+		private String auditUserId;
 	/**
 	* 审核通过时间
 	*/
@@ -112,7 +113,7 @@ public class AuditProecess implements Serializable {
 	* 业务日期
 	*/
 		@ApiModelProperty(value = "业务日期")
-		private Date billTime;
+		private LocalDateTime billTime;
 	/**
 	* 存储对应审批字段
 	*/
@@ -124,19 +125,35 @@ public class AuditProecess implements Serializable {
 		@ApiModelProperty(value = "第几次提交审批")
 		private Integer times;
 
-		private Long srcBillId;
+	    @ApiModelProperty(value = "租户id")
+		private String tenantId;
+
+		@ApiModelProperty(value = "是否是最后一级审核(T是 F不是)")
+	    private String iffinalItem;
 
-		private String url;
+		//1.通过  2.驳回
+		@TableField(exist = false)
+	    private Integer operate;
 
+		private Long srcBillId;
+	    @ApiModelProperty(value = "审批类型")
 		private String processType;
 
-		private String pageLabel;
+	    private String url;
+
+	    private Integer isDelete;
+
+	    private int batchNo;
+
+	    @TableField(exist = false)
+	    private String auditName;
 
-		private String pageStatus;
+	    private String pageStatus;
 
-		private String checkType;
+	    private String pageLabel;
 
-		private Long  corpId;
+	    private String checkType;
 
+	    private Long corpId;
 
 }

+ 16 - 3
blade-service-api/blade-check-api/src/main/java/org/springblade/check/feign/ICheckClient.java

@@ -4,6 +4,7 @@ package org.springblade.check.feign;
 import org.springblade.check.dto.AuditProecessDTO;
 import org.springblade.check.entity.AuditPathsActs;
 import org.springblade.check.entity.AuditPathsLevels;
+import org.springblade.check.entity.AuditProecess;
 import org.springblade.core.tool.api.R;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -21,19 +22,31 @@ import java.util.List;
  */
 public interface ICheckClient {
 
-	//通过唯一的actId查询审批等级
+	/**
+	 * 通过唯一的actId查询审批等级
+	 */
 	@GetMapping("/auditpathsacts/listLevelsByActId")
 	List<AuditPathsLevels> listLevelsByActId(@RequestParam("actId") int actId, @RequestParam("fidStatus") String fidStatus);
 
-	//通过actId查询是否开启审批
+	/**
+	 * 通过actId查询是否开启审批
+	 */
 	@GetMapping("/auditpathsacts/getActsByActId")
 	AuditPathsActs getActsByActId(@RequestParam("actId") int actId, @RequestParam("fidStatus") String fidStatus);
 
-	//开启审批流程
+	/**
+	 * 开启审批流程
+	 */
 	@PostMapping("/auditproecess/createFinanceProcess")
 	R createFinanceProcess (@RequestBody AuditProecessDTO auditProecessDTO);
 
 	/**
+	 * 更换审批人
+	 */
+	@PostMapping("/auditproecess/changeAuditUser")
+	R changeAuditUser(@RequestBody AuditProecess auditProecess);
+
+	/**
 	 * 获取商品信息
 	 *
 	 * @param Id

+ 2 - 2
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/feign/IDeliveryReportClient.java

@@ -25,6 +25,6 @@ public interface IDeliveryReportClient {
 	@PostMapping(COMMISSION)
 	R<List<DeliveryReportVO>> commission(@RequestBody DeliveryReportVO report);
 
-	@GetMapping(APPROVAL)
-	R<List<Delivery>> approval(Delivery report);
+	@PostMapping(APPROVAL)
+	R<List<Delivery>> approval(@RequestBody Delivery report);
 }

+ 2 - 0
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/vo/DeliveryReportVO.java

@@ -49,4 +49,6 @@ public class DeliveryReportVO {
 
 	private BigDecimal retainedAmount;
 
+	private String tenantId;
+
 }

+ 100 - 127
blade-service/blade-check/src/main/java/org/springblade/check/controller/AuditProecessController.java

@@ -17,34 +17,33 @@
 package org.springblade.check.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-import io.swagger.annotations.ApiParam;
-import org.springblade.check.dto.AuditProecessDTO;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
-
+import org.springblade.check.dto.AuditProecessDTO;
 import org.springblade.check.entity.AuditProecess;
 import org.springblade.check.service.IAuditProecessService;
 import org.springblade.check.vo.AuditOrderVO;
 import org.springblade.client.feign.ICorpsDescClient;
+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.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.finance.vojo.Settlement;
 import org.springblade.finance.feign.IFinanceClient;
+import org.springblade.finance.vojo.Settlement;
 import org.springblade.purchase.sales.entity.Order;
 import org.springblade.purchase.sales.feign.IOrderDescClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.boot.ctrl.BladeController;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -81,42 +80,36 @@ public class AuditProecessController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "列表-用户审批记录", notes = "传入auditProecess")
 	public R list(AuditProecess auditProecess, Query query) {
-		LambdaQueryWrapper<AuditProecess> lambdaQueryWrapper=new LambdaQueryWrapper<>();
-		lambdaQueryWrapper.eq(AuditProecess::getIsDelete,0);
+		LambdaQueryWrapper<AuditProecess> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(AuditProecess::getIsDelete, 0);
 		lambdaQueryWrapper.like(AuditProecess::getAuditUserId, String.valueOf(AuthUtil.getUserId()));
-		lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditProecess.getAuditStatus()),AuditProecess::getAuditStatus, auditProecess.getAuditStatus());
+		lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditProecess.getAuditStatus()), AuditProecess::getAuditStatus, auditProecess.getAuditStatus());
 		lambdaQueryWrapper.orderByDesc(AuditProecess::getSendTime);
 		IPage pages = auditProecessService.page(Condition.getPage(query), lambdaQueryWrapper);
 		List<AuditProecess> auditProecessList = pages.getRecords();
-		if(CollectionUtils.isNotEmpty(auditProecessList))
-		{
-			List<AuditOrderVO> auditOrderVOS=new ArrayList<>();
-			auditProecessList.forEach(e->{
-				AuditOrderVO auditOrderVO=new AuditOrderVO();
-				BeanUtil.copyProperties(e,auditOrderVO);
+		if (CollectionUtils.isNotEmpty(auditProecessList)) {
+			List<AuditOrderVO> auditOrderVOS = new ArrayList<>();
+			auditProecessList.forEach(e -> {
+				AuditOrderVO auditOrderVO = new AuditOrderVO();
+				BeanUtil.copyProperties(e, auditOrderVO);
 				//采购销售表相关数据
-				if(e.getBillId()!=null)
-				{
+				if (e.getBillId() != null) {
 					Order order = orderDescClient.getById(e.getBillId());
-					if(order!=null)
-					{
+					if (order != null) {
 						auditOrderVO.setOrderDate(order.getCreateTime());
 						auditOrderVO.setOrderNo(order.getOrderNo());
-						if(order.getCorpId()!=null)
-						{
+						if (order.getCorpId() != null) {
 							auditOrderVO.setCorpsName(corpsDescClient.getCorpMessage(order.getCorpId()).getData().getCname());
 						}
 
 					}
 				}
 				//财务明细表相关数据
-				if(e.getSrcBillId()!=null)
-				{
-					Settlement settlement=new Settlement();
+				if (e.getSrcBillId() != null) {
+					Settlement settlement = new Settlement();
 					settlement.setId(e.getBillId());
 					R<Settlement> detail = financeClient.detail(settlement);
-					if(detail.isSuccess())
-					{
+					if (detail.isSuccess()) {
 						BigDecimal amount = detail.getData().getAmount();
 						auditOrderVO.setAmount(amount);
 					}
@@ -127,9 +120,7 @@ public class AuditProecessController extends BladeController {
 
 			pages.setRecords(auditOrderVOS);
 			return R.data(pages);
-		}
-		else
-		{
+		} else {
 			return R.data(Collections.EMPTY_LIST);
 		}
 	}
@@ -137,60 +128,50 @@ public class AuditProecessController extends BladeController {
 	@PostMapping("cancelCheck")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "撤回审核", notes = " ")
-	public R cancelCheck(@ApiParam(value = "申请表主键", required = true) @RequestParam Long id)
-	{
+	public R cancelCheck(@ApiParam(value = "申请表主键", required = true) @RequestParam Long id) {
 		auditProecessService.cancelCheck(id);
 		return R.success("操作成功");
 	}
+
 	@GetMapping("findAuditProcessList")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "查看审核记录", notes = " ")
-	public R findAuditProcessList(@ApiParam(value = "申请表主键", required = true) @RequestParam Long id,@ApiParam(value = "批次号", required = false) @RequestParam Long batchNo)
-	{
+	public R findAuditProcessList(@ApiParam(value = "申请表主键", required = true) @RequestParam Long id, @ApiParam(value = "批次号", required = false) @RequestParam Long batchNo) {
 		//查询最大批次号
-		LambdaQueryWrapper<AuditProecess> countMaxWrapper=new LambdaQueryWrapper<>();
+		LambdaQueryWrapper<AuditProecess> countMaxWrapper = new LambdaQueryWrapper<>();
 		countMaxWrapper
-			.eq(AuditProecess::getSrcBillId,id)
-			.eq(AuditProecess::getIsDelete,0)
-			.eq(AuditProecess::getTenantId,AuthUtil.getTenantId());
+			.eq(AuditProecess::getSrcBillId, id)
+			.eq(AuditProecess::getIsDelete, 0)
+			.eq(AuditProecess::getTenantId, AuthUtil.getTenantId());
 		List<AuditProecess> proecessList = auditProecessService.list(countMaxWrapper);
-		if(CollectionUtils.isEmpty(proecessList))
-		{
+		if (CollectionUtils.isEmpty(proecessList)) {
 			return R.data(Collections.EMPTY_LIST);
 		}
 		//获取此付费申请下的最大批次号
 		int max = proecessList.stream().max(Comparator.comparing(AuditProecess::getBatchNo)).get().getBatchNo();
 		//根据最大批次号, 查询最新的审批记录
-		LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper=new LambdaQueryWrapper<>();
-			if(batchNo==null)
-			{
-				auditProecessLambdaQueryWrapper.eq(AuditProecess::getBatchNo,max);
-			}
-			else
-			{
-				auditProecessLambdaQueryWrapper.eq(AuditProecess::getBatchNo,batchNo);
-			}
-		    auditProecessLambdaQueryWrapper
+		LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		if (batchNo == null) {
+			auditProecessLambdaQueryWrapper.eq(AuditProecess::getBatchNo, max);
+		} else {
+			auditProecessLambdaQueryWrapper.eq(AuditProecess::getBatchNo, batchNo);
+		}
+		auditProecessLambdaQueryWrapper
 			.orderByAsc(AuditProecess::getLevelId)
-			.eq(AuditProecess::getSrcBillId,id)
-		.eq(AuditProecess::getIsDelete,0)
-		.eq(AuditProecess::getTenantId,AuthUtil.getTenantId());
+			.eq(AuditProecess::getSrcBillId, id)
+			.eq(AuditProecess::getIsDelete, 0)
+			.eq(AuditProecess::getTenantId, AuthUtil.getTenantId());
 		List<AuditProecess> list = auditProecessService.list(auditProecessLambdaQueryWrapper);
-		if(CollectionUtils.isNotEmpty(list))
-		{
-			list.forEach(e->{
-
-				try
-				{
-					R<User> userR  = userClient.userInfoById(Long.valueOf(e.getAuditUserId()));
-					if(userR.isSuccess())
-					{
+		if (CollectionUtils.isNotEmpty(list)) {
+			list.forEach(e -> {
+
+				try {
+					R<User> userR = userClient.userInfoById(Long.valueOf(e.getAuditUserId()));
+					if (userR.isSuccess()) {
 						e.setAuditName(userR.getData().getRealName());
 					}
-				}
-				catch (Exception exception)
-				{
-					throw new SecurityException("审批人名称查询错误:"+exception.getMessage());
+				} catch (Exception exception) {
+					throw new SecurityException("审批人名称查询错误:" + exception.getMessage());
 				}
 
 
@@ -203,45 +184,35 @@ public class AuditProecessController extends BladeController {
 	@PostMapping("createFinanceProcess")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "开启-财务审批流记录", notes = "传入auditProecessDTO")
-	public R createFinanceProcess(@RequestBody AuditProecessDTO auditProecessDTO)
-	{
-        if(CollectionUtils.isEmpty(auditProecessDTO.getPathsLevelsList()))
-        {
-        	throw new SecurityException("传入审批等级列表失败");
+	public R createFinanceProcess(@RequestBody AuditProecessDTO auditProecessDTO) {
+		if (CollectionUtils.isEmpty(auditProecessDTO.getPathsLevelsList())) {
+			throw new SecurityException("传入审批等级列表失败");
 		}
 		auditProecessService.createFinanceProcess(auditProecessDTO);
-        return R.success("操作成功");
+		return R.success("操作成功");
 	}
 
 	@PostMapping("operationFinanceProcess")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "操作-公共审批-根据checkType区别", notes = "传入auditProecessDTO")
-	public  R operationFinanceProcess(@RequestBody AuditProecess auditProecess)
-	{
+	public R operationFinanceProcess(@RequestBody AuditProecess auditProecess) {
 		AuditProecess proecess = auditProecessService.getById(auditProecess.getId());
-		if(proecess==null)
-		{
+		if (proecess == null) {
 			throw new SecurityException("审核失败,查无此记录");
 		}
-		if(StringUtils.isBlank(proecess.getCheckType()))
-		{
+		if (StringUtils.isBlank(proecess.getCheckType())) {
 			throw new SecurityException("审核失败,未填写审批类型");
 		}
 		//付费申请请核
-        if(proecess.getCheckType().equals("ffsq"))
-        {
+		if (proecess.getCheckType().equals("ffsq")) {
 			auditProecessService.operationFinanceProcess(auditProecess);
 		}
-        //采购 或者 销售 订单请核
-        else if(proecess.getCheckType().equals("xsqh")||proecess.getCheckType().equals("cgqh"))
-        {
+		//采购 或者 销售 订单请核
+		else if (proecess.getCheckType().equals("xsqh") || proecess.getCheckType().equals("cgqh")) {
 			auditProecessService.orderCheckProcess(auditProecess);
-		}
-        else if (proecess.getCheckType().equals("xsgz")){
-        	auditProecessService.salaryCheck(auditProecess);
-		}
-        else
-		{
+		} else if (proecess.getCheckType().equals("xsgz")) {
+			auditProecessService.salaryCheck(auditProecess);
+		} else {
 			throw new SecurityException("此审批类型未查到相关审批类型");
 		}
 
@@ -251,8 +222,7 @@ public class AuditProecessController extends BladeController {
 	@PostMapping("orderCheckProcess")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "操作-财务审批流记录", notes = "传入auditProecessDTO")
-	public  R orderCheckProcess(@RequestBody AuditProecess auditProecess)
-	{
+	public R orderCheckProcess(@RequestBody AuditProecess auditProecess) {
 		auditProecessService.orderCheckProcess(auditProecess);
 		return R.data(auditProecess);
 	}
@@ -262,44 +232,48 @@ public class AuditProecessController extends BladeController {
 	@ApiOperation(value = "批量审批", notes = "传入auditProecessDTOList")
 	public R batchOperation(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,
 							@ApiParam(value = "审批意见", required = true) @RequestParam String auditMsg,
-							@ApiParam(value = "操作状态", required = true) @RequestParam Integer operate)
-	{
-              LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper=new LambdaQueryWrapper<>();
-		      auditProecessLambdaQueryWrapper.in(AuditProecess::getId, Func.toLongList(ids));
-		      List<AuditProecess> proecessList = auditProecessService.list(auditProecessLambdaQueryWrapper);
-		      if(CollectionUtils.isEmpty(proecessList))
-		      {
-		      	throw new SecurityException("未查询相关数据,禁止操作");
-			  }
-		      auditProecessService.batchOperation(proecessList,operate,auditMsg);
-		      return R.success("操作成功");
+							@ApiParam(value = "操作状态", required = true) @RequestParam Integer operate) {
+		LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		auditProecessLambdaQueryWrapper.in(AuditProecess::getId, Func.toLongList(ids));
+		List<AuditProecess> proecessList = auditProecessService.list(auditProecessLambdaQueryWrapper);
+		if (CollectionUtils.isEmpty(proecessList)) {
+			throw new SecurityException("未查询相关数据,禁止操作");
+		}
+		auditProecessService.batchOperation(proecessList, operate, auditMsg);
+		return R.success("操作成功");
 	}
 
+	@PostMapping("changeAuditUser")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "更换审批人", notes = "传入auditProecess")
+	public R changeAuditUser(@RequestBody AuditProecess auditProecess) {
+		auditProecessService.changeAuditUser(auditProecess);
+		return R.success("操作成功");
+	}
 
 
 	/**
 	 * 详情
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入auditProecess")
-	public R<AuditProecess> detail(AuditProecess auditProecess) {
-		AuditProecess detail = auditProecessService.getOne(Condition.getQueryWrapper(auditProecess));
-		return R.data(detail);
-	}*/
-
+	 @GetMapping("/detail")
+	 @ApiOperationSupport(order = 1)
+	 @ApiOperation(value = "详情", notes = "传入auditProecess")
+	 public R<AuditProecess> detail(AuditProecess auditProecess) {
+	 AuditProecess detail = auditProecessService.getOne(Condition.getQueryWrapper(auditProecess));
+	 return R.data(detail);
+	 }*/
 
 
 	/**
 	 * 自定义分页 审批流记录
-	@GetMapping("/page")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入auditProecess")
-	public R<IPage<AuditProecessVO>> page(AuditProecessVO auditProecess, Query query) {
-		IPage<AuditProecessVO> pages = auditProecessService.selectAuditProecessPage(Condition.getPage(query), auditProecess);
-		return R.data(pages);
-	}
-
-	*//**
+	 @GetMapping("/page")
+	 @ApiOperationSupport(order = 3)
+	 @ApiOperation(value = "分页", notes = "传入auditProecess")
+	 public R<IPage<AuditProecessVO>> page(AuditProecessVO auditProecess, Query query) {
+	 IPage<AuditProecessVO> pages = auditProecessService.selectAuditProecessPage(Condition.getPage(query), auditProecess);
+	 return R.data(pages);
+	 }
+
+	 *//**
 	 * 新增 审批流记录
 	 *//*
 	@PostMapping("/save")
@@ -342,16 +316,15 @@ public class AuditProecessController extends BladeController {
 
 	/**
 	 * 同海-待审批数据统计: 第一级审批未开始,整个审批数据就算待审
-	 * */
+	 */
 	@GetMapping("countTongHaiNoApproval")
-	public R countTongHaiNoApproval()
-	{
-		LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper=new LambdaQueryWrapper<>();
+	public R countTongHaiNoApproval() {
+		LambdaQueryWrapper<AuditProecess> auditProecessLambdaQueryWrapper = new LambdaQueryWrapper<>();
 		auditProecessLambdaQueryWrapper
-			.eq(AuditProecess::getAuditStatus,"S")
-			.eq(AuditProecess::getLevelId,1)
-			.eq(AuditProecess::getTenantId,AuthUtil.getTenantId())
-			.eq(AuditProecess::getIsDelete,0);
+			.eq(AuditProecess::getAuditStatus, "S")
+			.eq(AuditProecess::getLevelId, 1)
+			.eq(AuditProecess::getTenantId, AuthUtil.getTenantId())
+			.eq(AuditProecess::getIsDelete, 0);
 		int count = auditProecessService.count(auditProecessLambdaQueryWrapper);
 		return R.data(count);
 	}

+ 0 - 156
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditItems.java

@@ -1,156 +0,0 @@
-/*
- *      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.check.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流任务明细实体类
- *
- * @author BladeX
- * @since 2021-12-07
- */
-@Data
-@ApiModel(value = "AuditItems对象", description = "审批流任务明细")
-public class AuditItems implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	@TableId(value = "id", type = IdType.AUTO)
-	private Long id;
-	/**
-	* 活动号
-	*/
-		@ApiModelProperty(value = "活动号")
-		private Long actId;
-	/**
-	* 业务id
-	*/
-		@ApiModelProperty(value = "业务id")
-		private Long billId;
-	/**
-	* 单据编号
-	*/
-		@ApiModelProperty(value = "单据编号")
-		private String billNo;
-	/**
-	* 参考号
-	*/
-		@ApiModelProperty(value = "参考号")
-		private String refno1;
-	/**
-	* 参考号2
-	*/
-		@ApiModelProperty(value = "参考号2")
-		private String refno2;
-	/**
-	* 参考号3
-	*/
-		@ApiModelProperty(value = "参考号3")
-		private String refno3;
-	/**
-	* 审核路径名
-	*/
-		@ApiModelProperty(value = "审核路径名")
-		private Long pathId;
-	/**
-	* 审核级次1.2.3
-	*/
-		@ApiModelProperty(value = "审核级次1.2.3")
-		private Integer levelId;
-	/**
-	* 是否是最后一级审核(T是 F不是)
-	*/
-		@ApiModelProperty(value = "是否是最后一级审核(T是 F不是)")
-		private String iffinalItem;
-	/**
-	* 单位id
-	*/
-		@ApiModelProperty(value = "单位id")
-		private Integer branchId;
-	/**
-	* 请核人ID
-	*/
-		@ApiModelProperty(value = "请核人ID")
-		private Long sendUserId;
-	/**
-	* 请核人姓名
-	*/
-		@ApiModelProperty(value = "请核人姓名")
-		private String sendName;
-	/**
-	* 请核时间
-	*/
-		@ApiModelProperty(value = "请核时间")
-		private LocalDateTime sendTime;
-	/**
-	* 请核备注
-	*/
-		@ApiModelProperty(value = "请核备注")
-		private String sendMsg;
-	/**
-	* 审核人ID
-	*/
-		@ApiModelProperty(value = "审核人ID")
-		private Long auditUserId;
-	/**
-	* 审核通过时间
-	*/
-		@ApiModelProperty(value = "审核通过时间")
-		private LocalDateTime auditItem;
-	/**
-	* 审核时间
-	*/
-		@ApiModelProperty(value = "审核时间")
-		private LocalDateTime auditOpTime;
-	/**
-	* 审核意见
-	*/
-		@ApiModelProperty(value = "审核意见")
-		private String auditMsg;
-	/**
-	* O提交、N未知状态、S待审、B审核退回、A审核通过
-	*/
-		@ApiModelProperty(value = "O提交、N未知状态、S待审、B审核退回、A审核通过")
-		private String auditStatus;
-	/**
-	* 业务日期
-	*/
-		@ApiModelProperty(value = "业务日期")
-		private LocalDateTime billTime;
-	/**
-	* 存储对应审批字段
-	*/
-		@ApiModelProperty(value = "存储对应审批字段")
-		private String fidStatus;
-	/**
-	* 第几次提交审批
-	*/
-		@ApiModelProperty(value = "第几次提交审批")
-		private Integer times;
-
-	@ApiModelProperty(value = "租户id")
-	private String tenantId;
-
-}

+ 0 - 75
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditItemsUsers.java

@@ -1,75 +0,0 @@
-/*
- *      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.check.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流任务明细用户表实体类
- *
- * @author BladeX
- * @since 2021-12-07
- */
-@Data
-@ApiModel(value = "AuditItemsUsers对象", description = "审批流任务明细用户表")
-public class AuditItemsUsers implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	@TableId(value = "id", type = IdType.AUTO)
-	private Long id;
-	private Long pid;
-	/**
-	* 单据编号
-	*/
-		@ApiModelProperty(value = "单据编号")
-		private String billNo;
-	/**
-	* 活动号
-	*/
-		@ApiModelProperty(value = "活动号")
-		private Integer actId;
-	/**
-	* 审批人
-	*/
-		@ApiModelProperty(value = "审批人")
-		private Long userId;
-	/**
-	* 状态
-	*/
-		@ApiModelProperty(value = "状态")
-		private String auditStatus;
-	/**
-	* 存储对应审批字段
-	*/
-		@ApiModelProperty(value = "存储对应审批字段")
-		private String fidStatus;
-	/**
-	* 第几次提交审批
-	*/
-		@ApiModelProperty(value = "第几次提交审批")
-		private Integer times;
-
-	@ApiModelProperty(value = "租户id")
-	private String tenantId;
-}

+ 0 - 93
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPaths.java

@@ -1,93 +0,0 @@
-/*
- *      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.check.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import lombok.Data;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流配置主表实体类
- *
- * @author BladeX
- * @since 2021-12-07
- */
-@Data
-@ApiModel(value = "AuditPaths对象", description = "审批流配置主表")
-public class AuditPaths implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	@TableId(value = "id", type = IdType.AUTO)
-	private Long id;
-	/**
-	* 审核路径ID
-	*/
-		@ApiModelProperty(value = "审核路径ID")
-		private Long pathId;
-	/**
-	* 审核路径名称
-	*/
-		@ApiModelProperty(value = "审核路径名称")
-		private String pathName;
-	/**
-	* 维护人id
-	*/
-		@ApiModelProperty(value = "维护人id")
-		private Long opUserId;
-	/**
-	* 维护人
-	*/
-		@ApiModelProperty(value = "维护人")
-		private String opUserName;
-	/**
-	* 维护时间
-	*/
-		@ApiModelProperty(value = "维护时间")
-		private Date opDate;
-	/**
-	* 承包单位id
-	*/
-		@ApiModelProperty(value = "承包单位id")
-		private Integer branchId;
-	/**
-	* N-新建;A-有效;S-停用; Z暂存
-	*/
-		@ApiModelProperty(value = "N-新建;A-有效;S-停用; Z暂存")
-		private String status;
-	/**
-	* 备注
-	*/
-		@ApiModelProperty(value = "备注")
-		private String remarks;
-
-		@ApiModelProperty(value = "审批流配置明细级别表")
-		@TableField(exist = false)
-		private List<AuditPathsLevels> auditPathsLevels;
-
-
-		@ApiModelProperty(value = "租户id")
-		private String tenantId;
-}

+ 0 - 82
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPathsActs.java

@@ -1,82 +0,0 @@
-/*
- *      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.check.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流配置明细表实体类
- *
- * @author BladeX
- * @since 2021-12-07
- */
-@Data
-@ApiModel(value = "AuditPathsActs对象", description = "审批流配置明细表")
-public class AuditPathsActs implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	@TableId(value = "id", type = IdType.AUTO)
-	private Long id;
-	/**
-	* 承包单位id
-	*/
-		@ApiModelProperty(value = "承包单位id")
-		private Integer branchId;
-	/**
-	* 活动号
-	*/
-		@ApiModelProperty(value = "1:代表财务清核 ")
-		private int actId;
-	/**
-	* 审核条件(O是正常审批,I非正常审批)
-	*/
-		@ApiModelProperty(value = "审核条件(O是正常审批,I非正常审批)")
-		private String reviewConditions;
-	/**
-	* 审核路径Id
-	*/
-		@ApiModelProperty(value = "审核路径Id")
-		private Long pathId;
-	/**
-	* 存储对应审批字段
-	*/
-		@ApiModelProperty(value = "存储对应审批字段")
-		private String fidStatus;
-
-		@ApiModelProperty(value = "活动名")
-		private String actName;
-
-		@ApiModelProperty(value = "租户id")
-		private String tenantId;
-
-	@ApiModelProperty(value = "审批路径名称")
-	@TableField(exist = false)
-		private String pathName;
-
-	@ApiModelProperty(value = "是否启用此审批流(1启动 2不启动)")
-	private Integer isEnable;
-
-
-}

+ 0 - 81
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditPathsLevels.java

@@ -1,81 +0,0 @@
-/*
- *      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.check.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流配置明细级别表实体类
- *
- * @author BladeX
- * @since 2021-12-07
- */
-@Data
-@ApiModel(value = "AuditPathsLevels对象", description = "审批流配置明细级别表")
-public class AuditPathsLevels implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	@TableId(value = "id", type = IdType.AUTO)
-	private Long id;
-	/**
-	* 审批路径id
-	*/
-		@ApiModelProperty(value = "审批路径id")
-		private Long pathId;
-	/**
-	* 审批级次
-	*/
-		@ApiModelProperty(value = "审批级次")
-		private Integer levelId;
-	/**
-	* 审批级次名称
-	*/
-		@ApiModelProperty(value = "审批级次名称")
-		private String levelName;
-	/**
-	* 审核人
-	*/
-		@ApiModelProperty(value = "审核人")
-		private String auditUserId;
-	/**
-	* 是否指定审批人
-	*/
-		@ApiModelProperty(value = "是否指定审批人")
-		private String iffixAuditUser;
-	/**
-	* 是否是最后一级审核(T是 F不是)
-	*/
-		@ApiModelProperty(value = "是否是最后一级审核(T是 F不是)")
-		private String iffinalItem;
-	/**
-	* 备注
-	*/
-		@ApiModelProperty(value = "备注")
-		private String remarks;
-
-	@ApiModelProperty(value = "租户id")
-	private String tenantId;
-
-
-}

+ 0 - 159
blade-service/blade-check/src/main/java/org/springblade/check/entity/AuditProecess.java

@@ -1,159 +0,0 @@
-/*
- *      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.check.entity;
-
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 审批流记录实体类
- *
- * @author BladeX
- * @since 2021-12-08
- */
-@Data
-@ApiModel(value = "AuditProecess对象", description = "审批流记录")
-public class AuditProecess implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	private Long id;
-	/**
-	* 1:财务清核
-	*/
-		@ApiModelProperty(value = "1:财务清核")
-		private int actId;
-	/**
-	* 业务id
-	*/
-		@ApiModelProperty(value = "业务id")
-		private Long billId;
-	/**
-	* 单据编号
-	*/
-		@ApiModelProperty(value = "单据编号")
-		private String billNo;
-	/**
-	* 审核路径名
-	*/
-		@ApiModelProperty(value = "审核路径名")
-		private Long pathId;
-	/**
-	* 审核级次1.2.3
-	*/
-		@ApiModelProperty(value = "审核级次1.2.3")
-		private Integer levelId;
-	/**
-	* 请核人ID
-	*/
-		@ApiModelProperty(value = "请核人ID")
-		private Long sendUserId;
-	/**
-	* 请核人姓名
-	*/
-		@ApiModelProperty(value = "请核人姓名")
-		private String sendName;
-	/**
-	* 请核时间
-	*/
-		@ApiModelProperty(value = "请核时间")
-		private Date sendTime;
-	/**
-	* 请核备注
-	*/
-		@ApiModelProperty(value = "请核备注")
-		private String sendMsg;
-	/**
-	* 审核人ID
-	*/
-		@ApiModelProperty(value = "审核人ID")
-		private String auditUserId;
-	/**
-	* 审核通过时间
-	*/
-		@ApiModelProperty(value = "审核通过时间")
-		private Date auditItem;
-	/**
-	* 审核时间
-	*/
-		@ApiModelProperty(value = "审核时间")
-		private Date auditOpTime;
-	/**
-	* 审核意见
-	*/
-		@ApiModelProperty(value = "审核意见")
-		private String auditMsg;
-	/**
-	* O提交、N未知状态、S待审、B审核退回、A审核通过
-	*/
-		@ApiModelProperty(value = "O提交、N未知状态、S待审、B审核退回、A审核通过")
-		private String auditStatus;
-	/**
-	* 业务日期
-	*/
-		@ApiModelProperty(value = "业务日期")
-		private LocalDateTime billTime;
-	/**
-	* 存储对应审批字段
-	*/
-		@ApiModelProperty(value = "存储对应审批字段")
-		private String fidStatus;
-	/**
-	* 第几次提交审批
-	*/
-		@ApiModelProperty(value = "第几次提交审批")
-		private Integer times;
-
-	    @ApiModelProperty(value = "租户id")
-		private String tenantId;
-
-		@ApiModelProperty(value = "是否是最后一级审核(T是 F不是)")
-	    private String iffinalItem;
-
-		//1.通过  2.驳回
-		@TableField(exist = false)
-	    private Integer operate;
-
-		private Long srcBillId;
-	    @ApiModelProperty(value = "审批类型")
-		private String processType;
-
-	    private String url;
-
-	    private Integer isDelete;
-
-	    private int batchNo;
-
-	    @TableField(exist = false)
-	    private String auditName;
-
-	    private String pageStatus;
-
-	    private String pageLabel;
-
-	    private String checkType;
-
-	    private Long corpId;
-
-}

+ 6 - 4
blade-service/blade-check/src/main/java/org/springblade/check/service/IAuditProecessService.java

@@ -16,11 +16,11 @@
  */
 package org.springblade.check.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
 import org.springblade.check.dto.AuditProecessDTO;
 import org.springblade.check.entity.AuditProecess;
 import org.springblade.check.vo.AuditProecessVO;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.util.List;
 
@@ -41,7 +41,7 @@ public interface IAuditProecessService extends IService<AuditProecess> {
 	 */
 	IPage<AuditProecessVO> selectAuditProecessPage(IPage<AuditProecessVO> page, AuditProecessVO auditProecess);
 
-	void  createFinanceProcess(AuditProecessDTO auditProecessDTO);
+	void createFinanceProcess(AuditProecessDTO auditProecessDTO);
 
 	void operationFinanceProcess(AuditProecess auditProecess);
 
@@ -49,7 +49,9 @@ public interface IAuditProecessService extends IService<AuditProecess> {
 
 	void orderCheckProcess(AuditProecess auditProecess);
 
-	void batchOperation(List<AuditProecess> processLis,Integer operate,String auditMsg);
+	void batchOperation(List<AuditProecess> processLis, Integer operate, String auditMsg);
+
+	void changeAuditUser(AuditProecess auditProecess);
 
 	void cancelCheck(Long srcBillId);
 

Разница между файлами не показана из-за своего большого размера
+ 247 - 366
blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java


+ 9 - 5
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/controller/DeliveryReportController.java

@@ -12,7 +12,7 @@ import org.springblade.client.feign.IGoodsDescClient;
 import org.springblade.client.feign.IStorageClient;
 import org.springblade.client.vo.GoodsDescVO;
 import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.Func;
@@ -24,7 +24,10 @@ import org.springblade.deliver.goods.service.IDeliveryService;
 import org.springblade.deliver.goods.vo.DeliveryReportVO;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -94,6 +97,7 @@ public class DeliveryReportController extends BladeController {
 		LambdaQueryWrapper<Delivery> idQueryWrapper = new LambdaQueryWrapper<>();
 		idQueryWrapper.select(Delivery::getId)
 			.eq(Delivery::getIsDeleted, 0)
+			.eq(Delivery::getTenantId, reportVO.getTenantId())
 			.gt(Delivery::getBillWeight, 0)
 			.between(Delivery::getBusinessDate, getDayOfMonth(year, lastMonth - 2).get(0), getDayOfMonth(year, lastMonth).get(1));
 		deliveryService.list(idQueryWrapper).forEach(delivery -> idList.add(delivery.getId()));
@@ -197,11 +201,11 @@ public class DeliveryReportController extends BladeController {
 	/**
 	 * 客户确认
 	 */
-	@GetMapping("/approval")
-	public R<List<Delivery>> approval(Delivery delivery) {
+	@PostMapping("/approval")
+	public R<List<Delivery>> approval(@RequestBody Delivery delivery) {
 		LambdaQueryWrapper<Delivery> deliveryLambdaQueryWrapper = new LambdaQueryWrapper<>();
 		deliveryLambdaQueryWrapper.eq(Delivery::getIsDeleted, 0)
-			.eq(Delivery::getTenantId, SecureUtil.getTenantId())
+			.eq(Delivery::getTenantId, delivery.getTenantId())
 			.eq(Delivery::getBillType, OrderTypeEnum.SHIP.getType())
 			.eq(Delivery::getTradeType, OrderTypeEnum.DOMESTIC.getType())
 			.eq(delivery.getSalesCompany() != null, Delivery::getSalesCompany, delivery.getSalesCompany())

+ 225 - 263
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderController.java

@@ -18,51 +18,44 @@ package org.springblade.purchase.sales.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.trade.purchase.order.enums.OrderTypeEnum;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
-import org.springblade.check.dto.AuditProecessDTO;
-import org.springblade.check.entity.AuditPathsActs;
-import org.springblade.check.entity.AuditPathsLevels;
-import org.springblade.check.feign.ICheckClient;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.client.entity.FeesDesc;
 import org.springblade.client.feign.ICorpsDescClient;
 import org.springblade.client.feign.IFeesDescClient;
+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.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.deliver.goods.entity.Delivery;
 import org.springblade.deliver.goods.feign.IDeliveryClient;
-import org.springblade.finance.vojo.Acc;
 import org.springblade.finance.feign.IFinanceClient;
-import org.springblade.finance.vojo.Settlement;
+import org.springblade.finance.vojo.Acc;
+import org.springblade.purchase.sales.entity.Order;
 import org.springblade.purchase.sales.entity.OrderFees;
 import org.springblade.purchase.sales.entity.OrderItems;
 import org.springblade.purchase.sales.service.*;
 import org.springblade.purchase.sales.vo.OrderItemsVO;
 import org.springblade.purchase.sales.vo.OrderStatisticAnalysisVO;
+import org.springblade.purchase.sales.vo.OrderVO;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.purchase.sales.entity.Order;
-import org.springblade.purchase.sales.vo.OrderVO;
-import org.springblade.core.boot.ctrl.BladeController;
 
+import javax.validation.Valid;
 import java.math.BigDecimal;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -119,6 +112,7 @@ public class OrderController extends BladeController {
 		IPage<Order> pages = orderService.page(Condition.getPage(query), Condition.getQueryWrapper(order));
 		return R.data(pages);
 	}
+
 	/**
 	 * 自定义分页 销售或采购订单表
 	 */
@@ -127,70 +121,70 @@ public class OrderController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入order")
 	public R<IPage<Order>> page(OrderVO order, Query query) {
 		LambdaQueryWrapper<Order> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-		lambdaQueryWrapper.eq(Order::getTenantId,SecureUtil.getTenantId());//租户id
-		lambdaQueryWrapper.eq(Order::getIsDeleted,0);//订单是否有效
-		lambdaQueryWrapper.eq(Order::getBillType,OrderTypeEnum.SALES.getType());//订单类型
-		lambdaQueryWrapper.eq(Order::getTradeType,OrderTypeEnum.DOMESTIC.getType());//贸易类型
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderNo()),Order::getOrderNo,order.getOrderNo());//订单号
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getCorpId()),Order::getCorpId,order.getCorpId());//客户id
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getContractStartDate()),Order::getBusinesDate,order.getContractStartDate());//合同日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getContractEndDate()),Order::getBusinesDate,order.getContractEndDate());//合同日期结束
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getSrcOrderNo()),Order::getSrcOrderNo,order.getSrcOrderNo());//订单来源
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getShippingAddress()),Order::getShippingAddress,order.getShippingAddress());//发货地址
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getArrivalAddress()),Order::getArrivalAddress,order.getArrivalAddress());//到货地址
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getActualDeliveryDateStart()),Order::getActualDeliveryDate,order.getActualDeliveryDateStart());//发货日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getActualDeliveryDateEnd()),Order::getActualDeliveryDate,order.getActualDeliveryDateEnd());//发货日期结束
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getDeliveryStartDate()),Order::getRequiredDeliveryDate,order.getDeliveryStartDate());//要求发货日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getDeliveryEndDate()),Order::getRequiredDeliveryDate,order.getDeliveryEndDate());//要求发货日期结束
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getArrivalDateStart()),Order::getRequiredArrivalDate,order.getArrivalDateStart());//要求到货日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getArrivalDateEnd()),Order::getRequiredArrivalDate,order.getArrivalDateEnd());//要求到货日期结束
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderStatus()),Order::getOrderStatus,order.getOrderStatus());//单据状态
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getSysNo()),Order::getSysNo,order.getSysNo());//系统编号
-		lambdaQueryWrapper.eq(Func.isNotEmpty(order.getCreateUser()),Order::getCreateUser,order.getCreateUser());//制单人
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getCreateTimeStart()),Order::getCreateTime,order.getCreateTimeStart());//制单日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getCreateTimeEnd()),Order::getCreateTime,order.getCreateTimeEnd());//制单日期结束
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getDateValidityStart()),Order::getDateValidity,order.getDateValidityStart());//有效日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getDateValidityEnd()),Order::getDateValidity,order.getDateValidityEnd());//有效日期结束
-		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getOrderStartDate()),Order::getBusinesDate,order.getOrderStartDate());//订单日期开始
-		lambdaQueryWrapper.le(Func.isNotEmpty(order.getOrderEndDate()),Order::getBusinesDate,order.getOrderEndDate());//订单日期结束
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPortOfLoad()),Order::getPortOfLoad,order.getPortOfLoad());//装货港
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPortOfDestination()),Order::getPortOfDestination,order.getPortOfDestination());//目的港
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryStart()), Order::getPlannedDeliveryDate,order.getPlannedDeliveryStart());//计划交货开始
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryEnd()), Order::getPlannedDeliveryDate,order.getPlannedDeliveryEnd());//计划交货结束
-		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderRemark()),Order::getOrderRemark,order.getOrderRemark());//备注
+		lambdaQueryWrapper.eq(Order::getTenantId, SecureUtil.getTenantId());//租户id
+		lambdaQueryWrapper.eq(Order::getIsDeleted, 0);//订单是否有效
+		lambdaQueryWrapper.eq(Order::getBillType, OrderTypeEnum.SALES.getType());//订单类型
+		lambdaQueryWrapper.eq(Order::getTradeType, OrderTypeEnum.DOMESTIC.getType());//贸易类型
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderNo()), Order::getOrderNo, order.getOrderNo());//订单号
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getCorpId()), Order::getCorpId, order.getCorpId());//客户id
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getContractStartDate()), Order::getBusinesDate, order.getContractStartDate());//合同日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getContractEndDate()), Order::getBusinesDate, order.getContractEndDate());//合同日期结束
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getSrcOrderNo()), Order::getSrcOrderNo, order.getSrcOrderNo());//订单来源
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getShippingAddress()), Order::getShippingAddress, order.getShippingAddress());//发货地址
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getArrivalAddress()), Order::getArrivalAddress, order.getArrivalAddress());//到货地址
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getActualDeliveryDateStart()), Order::getActualDeliveryDate, order.getActualDeliveryDateStart());//发货日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getActualDeliveryDateEnd()), Order::getActualDeliveryDate, order.getActualDeliveryDateEnd());//发货日期结束
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getDeliveryStartDate()), Order::getRequiredDeliveryDate, order.getDeliveryStartDate());//要求发货日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getDeliveryEndDate()), Order::getRequiredDeliveryDate, order.getDeliveryEndDate());//要求发货日期结束
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getArrivalDateStart()), Order::getRequiredArrivalDate, order.getArrivalDateStart());//要求到货日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getArrivalDateEnd()), Order::getRequiredArrivalDate, order.getArrivalDateEnd());//要求到货日期结束
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderStatus()), Order::getOrderStatus, order.getOrderStatus());//单据状态
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getSysNo()), Order::getSysNo, order.getSysNo());//系统编号
+		lambdaQueryWrapper.eq(Func.isNotEmpty(order.getCreateUser()), Order::getCreateUser, order.getCreateUser());//制单人
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getCreateTimeStart()), Order::getCreateTime, order.getCreateTimeStart());//制单日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getCreateTimeEnd()), Order::getCreateTime, order.getCreateTimeEnd());//制单日期结束
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getDateValidityStart()), Order::getDateValidity, order.getDateValidityStart());//有效日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getDateValidityEnd()), Order::getDateValidity, order.getDateValidityEnd());//有效日期结束
+		lambdaQueryWrapper.ge(Func.isNotEmpty(order.getOrderStartDate()), Order::getBusinesDate, order.getOrderStartDate());//订单日期开始
+		lambdaQueryWrapper.le(Func.isNotEmpty(order.getOrderEndDate()), Order::getBusinesDate, order.getOrderEndDate());//订单日期结束
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPortOfLoad()), Order::getPortOfLoad, order.getPortOfLoad());//装货港
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPortOfDestination()), Order::getPortOfDestination, order.getPortOfDestination());//目的港
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryStart()), Order::getPlannedDeliveryDate, order.getPlannedDeliveryStart());//计划交货开始
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getPlannedDeliveryEnd()), Order::getPlannedDeliveryDate, order.getPlannedDeliveryEnd());//计划交货结束
+		lambdaQueryWrapper.like(Func.isNotEmpty(order.getOrderRemark()), Order::getOrderRemark, order.getOrderRemark());//备注
 		lambdaQueryWrapper.orderByDesc(Order::getId);
 		IPage<Order> page = orderService.page(Condition.getPage(query), lambdaQueryWrapper);
-		if (CollectionUtils.isNotEmpty(page.getRecords())){
-			page.getRecords().stream().forEach(item ->{
-				if (item.getCorpId() != null){
+		if (CollectionUtils.isNotEmpty(page.getRecords())) {
+			page.getRecords().stream().forEach(item -> {
+				if (item.getCorpId() != null) {
 					R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());//客户
-					if (corpMessage.isSuccess() && corpMessage.getData() != null){
+					if (corpMessage.isSuccess() && corpMessage.getData() != null) {
 						item.setCorpsName(corpMessage.getData().getCname());
 					}
 				}
-				if (item.getBelongToCorpId() != null){
+				if (item.getBelongToCorpId() != null) {
 					R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getBelongToCorpId());//销售公司
-					if (corpMessage.isSuccess() && corpMessage.getData() != null){
+					if (corpMessage.isSuccess() && corpMessage.getData() != null) {
 						item.setBelongToCorpName(corpMessage.getData().getCname());
 					}
 				}
-				if (item.getProductionPlant() != null){
+				if (item.getProductionPlant() != null) {
 					R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getProductionPlant());//销售公司
-					if (corpMessage.isSuccess() && corpMessage.getData() != null){
+					if (corpMessage.isSuccess() && corpMessage.getData() != null) {
 						item.setProductionPlantName(corpMessage.getData().getCname());
 					}
 				}
 				R<User> user = userClient.userInfoById(item.getCreateUser());//制单人
-				if (user.isSuccess() && user.getData() != null){
+				if (user.isSuccess() && user.getData() != null) {
 					item.setCreateUserName(user.getData().getName());
 				}
 				//获取订单明细
 				List<OrderItems> list = orderItemsService.list(new QueryWrapper<OrderItems>().eq("pid", item.getId()).eq("is_deleted", 0));
-				if (CollectionUtils.isNotEmpty(list)){
-					item.setOrderQuantity(list.stream().map(OrderItems::getOrderQuantity).reduce(BigDecimal.ZERO,BigDecimal::add));//数量合计
-					item.setAmount(list.stream().map(OrderItems::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add));//销售金额
-					item.setPurchaseAmount(list.stream().map(OrderItems::getPurchaseAmount).reduce(BigDecimal.ZERO,BigDecimal::add));//采购金额
-					item.setActualQuantity(list.stream().map(OrderItems::getActualQuantity).reduce(BigDecimal.ZERO,BigDecimal::add));//发货数量
+				if (CollectionUtils.isNotEmpty(list)) {
+					item.setOrderQuantity(list.stream().map(OrderItems::getOrderQuantity).reduce(BigDecimal.ZERO, BigDecimal::add));//数量合计
+					item.setAmount(list.stream().map(OrderItems::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));//销售金额
+					item.setPurchaseAmount(list.stream().map(OrderItems::getPurchaseAmount).reduce(BigDecimal.ZERO, BigDecimal::add));//采购金额
+					item.setActualQuantity(list.stream().map(OrderItems::getActualQuantity).reduce(BigDecimal.ZERO, BigDecimal::add));//发货数量
 					item.setActualWeight(list.stream().map(OrderItems::getActualWeight).reduce(BigDecimal.ZERO, BigDecimal::add));//已发重量(吨)
 				}
 			});
@@ -215,30 +209,30 @@ public class OrderController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入order")
 	public R update(@Valid @RequestBody Order order) {
-		if (order.getId() == null){
-			throw  new SecurityException("请选择要删除的数据");
+		if (order.getId() == null) {
+			throw new SecurityException("请选择要删除的数据");
 		}
 		//先查订单信息
 		Order orderMessage = orderService.getById(order.getId());
 		//是否生成采购单
 		LambdaQueryWrapper<Order> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-		lambdaQueryWrapper.eq(Order::getSrcOrderNo,orderMessage.getSysNo());
-		lambdaQueryWrapper.eq(Order::getTradeType,OrderTypeEnum.DOMESTIC.getType());
-		lambdaQueryWrapper.eq(Order::getIsDeleted,0);
-		lambdaQueryWrapper.eq(Order::getBillType,OrderTypeEnum.PURCHASE.getType());
+		lambdaQueryWrapper.eq(Order::getSrcOrderNo, orderMessage.getSysNo());
+		lambdaQueryWrapper.eq(Order::getTradeType, OrderTypeEnum.DOMESTIC.getType());
+		lambdaQueryWrapper.eq(Order::getIsDeleted, 0);
+		lambdaQueryWrapper.eq(Order::getBillType, OrderTypeEnum.PURCHASE.getType());
 		List<Order> orderList = orderService.list(lambdaQueryWrapper);
-		if (CollectionUtils.isNotEmpty(orderList)){
-			throw  new SecurityException("销售单已生成采购单不能删除");
+		if (CollectionUtils.isNotEmpty(orderList)) {
+			throw new SecurityException("销售单已生成采购单不能删除");
 		}
 		//是否生成发货单
-		List<Delivery> list = deliveryClient.getOrderMessage(orderMessage.getSysNo(),OrderTypeEnum.DOMESTIC.getType());
-		if (CollectionUtils.isNotEmpty(list)){
-			throw  new SecurityException("销售单已生成发货单不能删除");
+		List<Delivery> list = deliveryClient.getOrderMessage(orderMessage.getSysNo(), OrderTypeEnum.DOMESTIC.getType());
+		if (CollectionUtils.isNotEmpty(list)) {
+			throw new SecurityException("销售单已生成发货单不能删除");
 		}
 		//是否生成账单单
 		List<Acc> financeAcc = iFinanceClient.getFinanceAccList(orderMessage.getOrderNo(), OrderTypeEnum.DOMESTIC.getType());
-		if (CollectionUtils.isNotEmpty(financeAcc)){
-			throw  new SecurityException("销售单已生成账单不能删除");
+		if (CollectionUtils.isNotEmpty(financeAcc)) {
+			throw new SecurityException("销售单已生成账单不能删除");
 		}
 		order.setIsDeleted(1);
 		orderService.updateById(order);
@@ -250,6 +244,7 @@ public class OrderController extends BladeController {
 		orderPartsService.updateByPid(order.getId());
 		return R.success("操作成功");
 	}
+
 	/**
 	 * 新增或修改 国内销售或采购订单表
 	 */
@@ -275,6 +270,7 @@ public class OrderController extends BladeController {
 
 	/**
 	 * 国内销售单生成发货单
+	 *
 	 * @param order
 	 * @return
 	 */
@@ -282,42 +278,46 @@ public class OrderController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "国内销售单生成发货单", notes = "传入主订单id,明细ids")
 	public R deliverGoods(@Valid @RequestBody Order order) {
-		if (order.getId() == null){
-			return R.fail(500,"参数缺失");
+		if (order.getId() == null) {
+			return R.fail(500, "参数缺失");
 		}
-		if (CollectionUtils.isEmpty(order.getOrderItemIds())){
-			return R.fail(500,"请选择要发货的商品明细");
+		if (CollectionUtils.isEmpty(order.getOrderItemIds())) {
+			return R.fail(500, "请选择要发货的商品明细");
 		}
 		order.setBillType(OrderTypeEnum.SALES.getType());
 		order.setTradeType(OrderTypeEnum.DOMESTIC.getType());
 		return R.data(orderService.deliverGoods(order));
 	}
+
 	/**
 	 * 发货单获取订单明细
-	 * @param query  分页参数
-	 * @param orderNo 订单号或合同号
-	 * @param corpId 客户id
+	 *
+	 * @param query          分页参数
+	 * @param orderNo        订单号或合同号
+	 * @param corpId         客户id
 	 * @param orderStartDate 时间开始时间
-	 * @param orderEndDate 时间结束时间
+	 * @param orderEndDate   时间结束时间
 	 * @return
 	 */
 	@GetMapping("/orderItemsList")
 	@ApiOperationSupport(order = 10)
 	@ApiOperation(value = "发货单获取订单明细", notes = "传入orderItems")
 	public R<IPage<OrderItemsVO>> orderItemsList(Query query,
-												 @RequestParam(value = "orderNo",required = false) String orderNo,
-												 @RequestParam(value = "corpId",required = false)Long corpId,
-												 @RequestParam(value = "orderStartDate",required = false)String orderStartDate,
-												 @RequestParam(value = "orderEndDate",required = false)String orderEndDate) {
+												 @RequestParam(value = "orderNo", required = false) String orderNo,
+												 @RequestParam(value = "corpId", required = false) Long corpId,
+												 @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
+												 @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
 		String tradeType = OrderTypeEnum.DOMESTIC.getType();
 		String billType = OrderTypeEnum.SALES.getType();
 		String tenantId = SecureUtil.getTenantId();
-		IPage<OrderItemsVO> pages = orderItemsService.orderItemsList(Condition.getPage(query),orderNo,corpId,orderStartDate,orderEndDate,
-			tradeType,billType,tenantId);
+		IPage<OrderItemsVO> pages = orderItemsService.orderItemsList(Condition.getPage(query), orderNo, corpId, orderStartDate, orderEndDate,
+			tradeType, billType, tenantId);
 		return R.data(pages);
 	}
+
 	/**
 	 * 国内销售单生成采购单
+	 *
 	 * @param order
 	 * @return
 	 */
@@ -325,8 +325,8 @@ public class OrderController extends BladeController {
 	@ApiOperationSupport(order = 9)
 	@ApiOperation(value = "国内销售单生成采购单")
 	public R createMarket(@Valid @RequestBody Order order) {
-		if (order.getId() == null){
-			return R.fail(500,"参数缺失");
+		if (order.getId() == null) {
+			return R.fail(500, "参数缺失");
 		}
 		order.setBillType(OrderTypeEnum.PURCHASE.getType());
 		order.setTradeType(OrderTypeEnum.DOMESTIC.getType());
@@ -335,81 +335,72 @@ public class OrderController extends BladeController {
 
 	/**
 	 * 统计分析
-	 * */
+	 */
 	@GetMapping("/listOrderStatisticAnalysis")
 	@ApiOperationSupport(order = 9)
 	@ApiOperation(value = "统计分析")
-	public R listOrderStatisticAnalysis(Order order, Query query)
-	{
+	public R listOrderStatisticAnalysis(Order order, Query query) {
 
 	/*	LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
 		orderLambdaQueryWrapper.eq(StringUtils.isNotBlank(order.getOrderNo()),Order::getOrderNo,order.getOrderNo());
 		orderLambdaQueryWrapper.between(StringUtils.isNotBlank(order.getStartTime())&&StringUtils.isNotBlank(order.getEndTime()),Order::getCreateTime,order.getStartTime(),order.getEndTime());
 		IPage<Order> iPage = orderService.page(Condition.getPage(query), orderLambdaQueryWrapper);
 		List<Order> records = iPage.getRecords();*/
-		Page<OrderStatisticAnalysisVO> iPage = new Page(query.getCurrent(),query.getSize());
-		IPage<OrderStatisticAnalysisVO> orderStatisticAnalysisVOIPage = orderService.listOrderStatisticAnalysis(iPage, AuthUtil.getTenantId(), order.getOrderNo(),order.getStartTime(),order.getEndTime());
+		Page<OrderStatisticAnalysisVO> iPage = new Page(query.getCurrent(), query.getSize());
+		IPage<OrderStatisticAnalysisVO> orderStatisticAnalysisVOIPage = orderService.listOrderStatisticAnalysis(iPage, AuthUtil.getTenantId(), order.getOrderNo(), order.getStartTime(), order.getEndTime());
 		List<OrderStatisticAnalysisVO> records = orderStatisticAnalysisVOIPage.getRecords();
-		if(CollectionUtils.isNotEmpty(records))
-		{
-			records.forEach(e->{
+		if (CollectionUtils.isNotEmpty(records)) {
+			records.forEach(e -> {
 				Long orderId = e.getOrderId();
 				//采购主表信息
-				LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				LambdaQueryWrapper<Order> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
 				orderLambdaQueryWrapper
-					.eq(Order::getId,orderId)
-					.eq(Order::getTenantId,AuthUtil.getTenantId())
-					.eq(Order::getIsDeleted,0);
+					.eq(Order::getId, orderId)
+					.eq(Order::getTenantId, AuthUtil.getTenantId())
+					.eq(Order::getIsDeleted, 0);
 				Order service = orderService.getOne(orderLambdaQueryWrapper);
 				//供应商名称
-				if(e.getCorpId()!=null)
-				{
+				if (e.getCorpId() != null) {
 					R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(e.getCorpId());
-					if(corpMessage.isSuccess())
-					{
+					if (corpMessage.isSuccess()) {
 						e.setCorpName(corpMessage.getData().getCname());
 					}
 				}
 				//调用-费用微服务-获取关税设置详情
 				R<FeesDesc> customDuty = feesDescClient.getFeesByName("关税");
-				Long customDutyId=null;
-				if(customDuty.isSuccess()&&customDuty.getData()!=null)
-				{
-					customDutyId=customDuty.getData().getId();
+				Long customDutyId = null;
+				if (customDuty.isSuccess() && customDuty.getData() != null) {
+					customDutyId = customDuty.getData().getId();
 				}
 
 				//关税
-				BigDecimal customDutyMoney=BigDecimal.ZERO;
+				BigDecimal customDutyMoney = BigDecimal.ZERO;
 				//查询采购订单关税的费用明细
-				if(customDutyId!=null)
-				{
-					LambdaQueryWrapper<OrderFees> orderFeesLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				if (customDutyId != null) {
+					LambdaQueryWrapper<OrderFees> orderFeesLambdaQueryWrapper = new LambdaQueryWrapper<>();
 					orderFeesLambdaQueryWrapper
-						.eq(OrderFees::getPid,orderId)
-						.eq(OrderFees::getItemId,customDutyId);
+						.eq(OrderFees::getPid, orderId)
+						.eq(OrderFees::getItemId, customDutyId);
 					List<Long> customDutyIds = orderFeesService.list(orderFeesLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
 
-					if(CollectionUtils.isNotEmpty(customDutyIds))
-					{
-						Acc customDutyAcc=new Acc();
+					if (CollectionUtils.isNotEmpty(customDutyIds)) {
+						Acc customDutyAcc = new Acc();
 						customDutyAcc.setSrcType(2);
 						customDutyAcc.setSrcFeesIds(customDutyIds);
 						//只有 itemType=采购 && billType=申请 才是付钱
 						customDutyAcc.setItemType("采购");
 						customDutyAcc.setBillType("申请");
 						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
-						if(accListByCondition.isSuccess())
-						{
+						if (accListByCondition.isSuccess()) {
 							List<Acc> customDutyList = accListByCondition.getData();
 							//关税
 
-							if(CollectionUtils.isNotEmpty(customDutyList))
-							{
-								customDutyMoney=customDutyList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-							}
-							else
-							{
-								customDutyMoney=BigDecimal.ZERO;
+							if (CollectionUtils.isNotEmpty(customDutyList)) {
+								customDutyMoney = customDutyList.stream().reduce(BigDecimal.ZERO, (x, y) -> {
+									return x.add(y.getAmount().multiply(y.getExchangeRate()));
+								}, BigDecimal::add);
+							} else {
+								customDutyMoney = BigDecimal.ZERO;
 							}
 
 						}
@@ -419,42 +410,37 @@ public class OrderController extends BladeController {
 
 
 				//调用-费用微服务-获取物流费设置详情
-				Long deliverId=null;
+				Long deliverId = null;
 				R<FeesDesc> deliver = feesDescClient.getFeesByName("物流费");
-				if(deliver.isSuccess()&&deliver.getData()!=null)
-				{
-					deliverId=deliver.getData().getId();
+				if (deliver.isSuccess() && deliver.getData() != null) {
+					deliverId = deliver.getData().getId();
 				}
-				BigDecimal deliverMoney=BigDecimal.ZERO;
-				if(deliverId!=null)
-				{
-					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				BigDecimal deliverMoney = BigDecimal.ZERO;
+				if (deliverId != null) {
+					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper = new LambdaQueryWrapper<>();
 					quotaLambdaQueryWrapper
-						.eq(OrderFees::getPid,orderId)
-						.eq(OrderFees::getItemId,deliverId);
+						.eq(OrderFees::getPid, orderId)
+						.eq(OrderFees::getItemId, deliverId);
 					List<Long> deliverIds = orderFeesService.list(quotaLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
 
-					if(CollectionUtils.isNotEmpty(deliverIds))
-					{
-						Acc customDutyAcc=new Acc();
+					if (CollectionUtils.isNotEmpty(deliverIds)) {
+						Acc customDutyAcc = new Acc();
 						customDutyAcc.setSrcType(2);
 						customDutyAcc.setSrcFeesIds(deliverIds);
 						//只有 itemType=采购 && billType=申请 才是付钱
 						customDutyAcc.setItemType("采购");
 						customDutyAcc.setBillType("申请");
 						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
-						if(accListByCondition.isSuccess())
-						{
+						if (accListByCondition.isSuccess()) {
 							List<Acc> deliverList = accListByCondition.getData();
 							//物流费
 
-							if(CollectionUtils.isNotEmpty(deliverList))
-							{
-								deliverMoney=deliverList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-							}
-							else
-							{
-								deliverMoney=BigDecimal.ZERO;
+							if (CollectionUtils.isNotEmpty(deliverList)) {
+								deliverMoney = deliverList.stream().reduce(BigDecimal.ZERO, (x, y) -> {
+									return x.add(y.getAmount().multiply(y.getExchangeRate()));
+								}, BigDecimal::add);
+							} else {
+								deliverMoney = BigDecimal.ZERO;
 							}
 
 						}
@@ -465,44 +451,39 @@ public class OrderController extends BladeController {
 
 
 				//调用-费用微服务-获取配额设置详情
-				Long quotaId=null;
+				Long quotaId = null;
 				R<FeesDesc> quota = feesDescClient.getFeesByName("配额");
-				if(quota.isSuccess()&&quota.getData()!=null)
-				{
-					quotaId=quota.getData().getId();
+				if (quota.isSuccess() && quota.getData() != null) {
+					quotaId = quota.getData().getId();
 				}
 				//配额
-				BigDecimal quotaMoney=BigDecimal.ZERO;
+				BigDecimal quotaMoney = BigDecimal.ZERO;
 				//查询采购订单配额的费用明细
-				if(quotaId!=null)
-				{
-					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				if (quotaId != null) {
+					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper = new LambdaQueryWrapper<>();
 					quotaLambdaQueryWrapper
-						.eq(OrderFees::getPid,orderId)
-						.eq(OrderFees::getItemId,quotaId);
+						.eq(OrderFees::getPid, orderId)
+						.eq(OrderFees::getItemId, quotaId);
 					List<Long> quotaIdIds = orderFeesService.list(quotaLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
 
-					if(CollectionUtils.isNotEmpty(quotaIdIds))
-					{
-						Acc customDutyAcc=new Acc();
+					if (CollectionUtils.isNotEmpty(quotaIdIds)) {
+						Acc customDutyAcc = new Acc();
 						customDutyAcc.setSrcType(2);
 						customDutyAcc.setSrcFeesIds(quotaIdIds);
 						//只有 itemType=采购 && billType=申请 才是付钱
 						customDutyAcc.setItemType("采购");
 						customDutyAcc.setBillType("申请");
 						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
-						if(accListByCondition.isSuccess())
-						{
+						if (accListByCondition.isSuccess()) {
 							List<Acc> quotaList = accListByCondition.getData();
 							//关税
 
-							if(CollectionUtils.isNotEmpty(quotaList))
-							{
-								quotaMoney=quotaList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-							}
-							else
-							{
-								quotaMoney=BigDecimal.ZERO;
+							if (CollectionUtils.isNotEmpty(quotaList)) {
+								quotaMoney = quotaList.stream().reduce(BigDecimal.ZERO, (x, y) -> {
+									return x.add(y.getAmount().multiply(y.getExchangeRate()));
+								}, BigDecimal::add);
+							} else {
+								quotaMoney = BigDecimal.ZERO;
 							}
 
 						}
@@ -513,43 +494,38 @@ public class OrderController extends BladeController {
 
 
 				//调用-费用微服务-获取增值税设置详情
-				Long gstId=null;
+				Long gstId = null;
 				R<FeesDesc> GST = feesDescClient.getFeesByName("增值税");
-				if(GST.isSuccess()&&GST.getData()!=null)
-				{
-					gstId=GST.getData().getId();
+				if (GST.isSuccess() && GST.getData() != null) {
+					gstId = GST.getData().getId();
 				}
 				//增值税
-				BigDecimal gstMoney=BigDecimal.ZERO;
-				if(gstId!=null)
-				{
-					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				BigDecimal gstMoney = BigDecimal.ZERO;
+				if (gstId != null) {
+					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper = new LambdaQueryWrapper<>();
 					quotaLambdaQueryWrapper
-						.eq(OrderFees::getPid,orderId)
-						.eq(OrderFees::getItemId,gstId);
+						.eq(OrderFees::getPid, orderId)
+						.eq(OrderFees::getItemId, gstId);
 					List<Long> gstIds = orderFeesService.list(quotaLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
 
-					if(CollectionUtils.isNotEmpty(gstIds))
-					{
-						Acc customDutyAcc=new Acc();
+					if (CollectionUtils.isNotEmpty(gstIds)) {
+						Acc customDutyAcc = new Acc();
 						customDutyAcc.setSrcType(2);
 						customDutyAcc.setSrcFeesIds(gstIds);
 						//只有 itemType=采购 && billType=申请 才是付钱
 						customDutyAcc.setItemType("采购");
 						customDutyAcc.setBillType("申请");
 						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
-						if(accListByCondition.isSuccess())
-						{
+						if (accListByCondition.isSuccess()) {
 							List<Acc> gstList = accListByCondition.getData();
 							//关税
 
-							if(CollectionUtils.isNotEmpty(gstList))
-							{
-								gstMoney=gstList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-							}
-							else
-							{
-								gstMoney=BigDecimal.ZERO;
+							if (CollectionUtils.isNotEmpty(gstList)) {
+								gstMoney = gstList.stream().reduce(BigDecimal.ZERO, (x, y) -> {
+									return x.add(y.getAmount().multiply(y.getExchangeRate()));
+								}, BigDecimal::add);
+							} else {
+								gstMoney = BigDecimal.ZERO;
 							}
 
 						}
@@ -560,7 +536,7 @@ public class OrderController extends BladeController {
 
 
 				//获取货款账单明细
-				Acc itemAcc=new Acc();
+				Acc itemAcc = new Acc();
 				itemAcc.setSrcType(1);
 				itemAcc.setSrcFeesId(null);
 				itemAcc.setSrcParentId(orderId);
@@ -569,95 +545,69 @@ public class OrderController extends BladeController {
 				itemAcc.setBillType("申请");
 				R<List<Acc>> accListByCondition4 = iFinanceClient.getAccListByCondition(itemAcc);
 				//货款
-				BigDecimal itemMoney=BigDecimal.ZERO;
-				if(accListByCondition4.isSuccess())
-				{
+				BigDecimal itemMoney = BigDecimal.ZERO;
+				if (accListByCondition4.isSuccess()) {
 					List<Acc> itemList = accListByCondition4.getData();
-					if(CollectionUtils.isNotEmpty(itemList))
-					{
+					if (CollectionUtils.isNotEmpty(itemList)) {
 						//货款
-						itemMoney=itemList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-					}
-					else
-					{
-						itemMoney=BigDecimal.ZERO;
+						itemMoney = itemList.stream().reduce(BigDecimal.ZERO, (x, y) -> {
+							return x.add(y.getAmount().multiply(y.getExchangeRate()));
+						}, BigDecimal::add);
+					} else {
+						itemMoney = BigDecimal.ZERO;
 					}
 				}
 
-				e.setItemMoney(itemMoney.setScale(2,BigDecimal.ROUND_HALF_UP));
+				e.setItemMoney(itemMoney.setScale(2, BigDecimal.ROUND_HALF_UP));
 
 
 				//成本单价=(货款+关税+配额)/发票重量---精确小数点2位
-				BigDecimal unitPrice=null;
-				if(service.getInvoiceWeight()==null || service.getInvoiceWeight().compareTo(BigDecimal.ZERO)==0)
-				{
-					unitPrice=BigDecimal.ZERO;
-				}
-				else
-				{
-					unitPrice=((itemMoney.add(quotaMoney)).add(customDutyMoney)).divide(service.getInvoiceWeight(),2,BigDecimal.ROUND_HALF_UP);
+				BigDecimal unitPrice = null;
+				if (service.getInvoiceWeight() == null || service.getInvoiceWeight().compareTo(BigDecimal.ZERO) == 0) {
+					unitPrice = BigDecimal.ZERO;
+				} else {
+					unitPrice = ((itemMoney.add(quotaMoney)).add(customDutyMoney)).divide(service.getInvoiceWeight(), 2, BigDecimal.ROUND_HALF_UP);
 				}
 				e.setUnitPrice(unitPrice);
 
 				//销售主表信息
-				LambdaQueryWrapper<Order> saleOrderWrapper=new LambdaQueryWrapper<>();
-				saleOrderWrapper.eq(Order::getId,e.getOrderSaleId()).eq(Order::getTenantId,AuthUtil.getTenantId());
+				LambdaQueryWrapper<Order> saleOrderWrapper = new LambdaQueryWrapper<>();
+				saleOrderWrapper.eq(Order::getId, e.getOrderSaleId()).eq(Order::getTenantId, AuthUtil.getTenantId());
 				Order serviceOne = orderService.getOne(saleOrderWrapper);
-				if(serviceOne==null)
-				{
-                  return;
+				if (serviceOne == null) {
+					return;
 				}
 
 				//客户名称
-				if(e.getSaleCorpId()!=null)
-				{
+				if (e.getSaleCorpId() != null) {
 					R<CorpsDesc> corpsDescClientCorpMessage = corpsDescClient.getCorpMessage(e.getSaleCorpId());
-					if(corpsDescClientCorpMessage.isSuccess())
-					{
+					if (corpsDescClientCorpMessage.isSuccess()) {
 						e.setSaleCorpName(corpsDescClientCorpMessage.getData().getCname());
 					}
 				}
 				//业务员名称
-				if(e.getCreateUser()!=null)
-				{
+				if (e.getCreateUser() != null) {
 					R<User> info = userClient.userInfoById(e.getCreateUser());
-					if(info.isSuccess())
-					{
+					if (info.isSuccess()) {
 						e.setCreateUserName(info.getData().getRealName());
 					}
 				}
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-				if(serviceOne.getExchangeRate()==null)
-				{
-                   throw new SecurityException("销售订单:"+serviceOne.getOrderNo()+",汇率未填,无法完成统计");
+				if (serviceOne.getExchangeRate() == null) {
+					throw new SecurityException("销售订单:" + serviceOne.getOrderNo() + ",汇率未填,无法完成统计");
 				}
 				//开票金额= 销售订单明细总价*销售订单主表的汇率
-				BigDecimal InvoiceAmount=e.getAmount().multiply(serviceOne.getExchangeRate()).setScale(2,BigDecimal.ROUND_HALF_UP);
+				BigDecimal InvoiceAmount = e.getAmount().multiply(serviceOne.getExchangeRate()).setScale(2, BigDecimal.ROUND_HALF_UP);
 				e.setInvoiceAmount(InvoiceAmount);
 				e.setExchangeRate(serviceOne.getExchangeRate());
 				//成本金额=提货数量*成本价格
-				BigDecimal costAmount=e.getSaleBillWeight().multiply(unitPrice).setScale(2,BigDecimal.ROUND_HALF_UP);
+				BigDecimal costAmount = e.getSaleBillWeight().multiply(unitPrice).setScale(2, BigDecimal.ROUND_HALF_UP);
 				e.setCostAmount(costAmount);
 
-                //利润=开票金额-成本金额-物流费用
-				BigDecimal profit=(InvoiceAmount.subtract(costAmount)).subtract(deliverMoney).setScale(2,BigDecimal.ROUND_HALF_UP);
-                e.setProfit(profit);
+				//利润=开票金额-成本金额-物流费用
+				BigDecimal profit = (InvoiceAmount.subtract(costAmount)).subtract(deliverMoney).setScale(2, BigDecimal.ROUND_HALF_UP);
+				e.setProfit(profit);
 			});
 		}
 		orderStatisticAnalysisVOIPage.setRecords(records);
@@ -665,8 +615,7 @@ public class OrderController extends BladeController {
 	}
 
 	@PostMapping("checkOrder")
-	public R checkOrder(@RequestBody Order order)
-	{
+	public R checkOrder(@RequestBody Order order) {
 
 		orderService.checkOrder(order);
 		return R.data("操作成功");
@@ -674,41 +623,54 @@ public class OrderController extends BladeController {
 
 	/**
 	 * 审核通过
-	 * */
+	 */
 	@PostMapping("/passCheck")
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "Feign-审核通过", notes = "传入财务id")
-	public R passCheck (@ApiParam(value = "财务主表id", required = true) @RequestParam Long id)
-	{
+	public R passCheck(@ApiParam(value = "财务主表id", required = true) @RequestParam Long id) {
 		orderService.passCheck(id);
 		return R.success("操作成功");
 	}
 
 	/**
 	 * 审核不通过
-	 * */
+	 */
 	@PostMapping("/passCancel")
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "Feign-审核不通过", notes = "传入财务id")
-	public R passCancel (@ApiParam(value = "财务主表id", required = true) @RequestParam Long id)
-	{
+	public R passCancel(@ApiParam(value = "财务主表id", required = true) @RequestParam Long id) {
 		orderService.passCancel(id);
 		return R.success("操作成功");
 	}
 
 	/**
+	 * 更换审批人
+	 */
+	@GetMapping("/changeAuditUser")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "Feign-更换审批人", notes = "传入财务id")
+	public R changeAuditUser(@ApiParam(value = "审批id", required = true) @RequestParam Long auditId,
+							 @ApiParam(value = "更改的审批人id", required = true) @RequestParam String auditUserId) {
+		if (auditId == null || StringUtil.isBlank(auditUserId)) {
+			throw new SecurityException("参数异常,更改审批人失败");
+		}
+		orderService.changeAuditUser(auditId, auditUserId);
+		return R.success("操作成功");
+	}
+
+	/**
 	 * 库存账查询锁定库存订单信息
 	 */
 	@GetMapping("/ListMessage")
 	@ApiOperationSupport(order = 9)
 	@ApiOperation(value = "库存账查询锁定库存订单信息", notes = "传入order")
-	public R<IPage<OrderVO>> ListMessage(Query query,@RequestParam("itemId") Long itemId,
-									   @RequestParam("corpId") Long corpId) {
-		IPage<OrderVO> pages = orderService.orderInventory(Condition.getPage(query),SecureUtil.getTenantId(),OrderTypeEnum.DOMESTIC.getType(),OrderTypeEnum.SALES.getType(),itemId,corpId);
-		if (CollectionUtils.isNotEmpty(pages.getRecords())){
-			pages.getRecords().stream().forEach(item ->{
+	public R<IPage<OrderVO>> ListMessage(Query query, @RequestParam("itemId") Long itemId,
+										 @RequestParam("corpId") Long corpId) {
+		IPage<OrderVO> pages = orderService.orderInventory(Condition.getPage(query), SecureUtil.getTenantId(), OrderTypeEnum.DOMESTIC.getType(), OrderTypeEnum.SALES.getType(), itemId, corpId);
+		if (CollectionUtils.isNotEmpty(pages.getRecords())) {
+			pages.getRecords().stream().forEach(item -> {
 				R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
-				if (corpMessage.isSuccess() && corpMessage.getData() != null){
+				if (corpMessage.isSuccess() && corpMessage.getData() != null) {
 					item.setCorpsName(corpMessage.getData().getCname());
 				}
 			});

+ 22 - 11
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/IOrderService.java

@@ -16,19 +16,17 @@
  */
 package org.springblade.purchase.sales.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.trade.purchase.order.vo.OrderDTO;
+import com.baomidou.mybatisplus.extension.service.IService;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.core.tool.api.R;
 import org.springblade.purchase.sales.entity.Order;
 import org.springblade.purchase.sales.vo.OrderItemBillNoVO;
 import org.springblade.purchase.sales.vo.OrderStatisticAnalysisVO;
 import org.springblade.purchase.sales.vo.OrderVO;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 销售或采购订单表 服务类
@@ -49,6 +47,7 @@ public interface IOrderService extends IService<Order> {
 
 	/**
 	 * 保存订单信息
+	 *
 	 * @param order
 	 * @return
 	 */
@@ -56,6 +55,7 @@ public interface IOrderService extends IService<Order> {
 
 	/**
 	 * 获取订单详情
+	 *
 	 * @param order
 	 * @return
 	 */
@@ -63,47 +63,58 @@ public interface IOrderService extends IService<Order> {
 
 	/**
 	 * 获取要生成发货的销售单信息
+	 *
 	 * @param order
 	 * @return
 	 */
 	Order deliverGoods(Order order);
+
 	/**
 	 * 确认询价单
+	 *
 	 * @param order
 	 * @return
 	 */
 	R affirm(Order order);
+
 	/**
 	 * 销售单生成采购单
+	 *
 	 * @param order
 	 * @return
 	 */
 	R createMarket(Order order);
+
 	/**
 	 * 报价单生成销售单
+	 *
 	 * @param order
 	 * @return
 	 */
 	R quotation(Order order);
 
 
-	List<OrderItemBillNoVO> findContractNoByBillNo(@Param("billNo")String billNo, @Param("billType")String billType);
+	List<OrderItemBillNoVO> findContractNoByBillNo(@Param("billNo") String billNo, @Param("billType") String billType);
 
-	IPage<OrderStatisticAnalysisVO> listOrderStatisticAnalysis(Page<OrderStatisticAnalysisVO> page, @Param("tenantId")String tenantId, @Param("orderNo")String orderNo,@Param("startTime")String startTime,@Param("endTime")String endTime);
+	IPage<OrderStatisticAnalysisVO> listOrderStatisticAnalysis(Page<OrderStatisticAnalysisVO> page, @Param("tenantId") String tenantId, @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 	void checkOrder(Order order);
 
 	void passCheck(Long id);
 
 	void passCancel(Long id);
+
+	void changeAuditUser(Long auditId, String auditUserId);
+
 	/**
 	 * 查询锁定库存订单
-	 * @param tenantId 租户
+	 *
+	 * @param tenantId  租户
 	 * @param tradeType 贸易类型
-	 * @param billType 订单类型
-	 * @param itemId 商品id
-	 * @param corpId 供应商
+	 * @param billType  订单类型
+	 * @param itemId    商品id
+	 * @param corpId    供应商
 	 * @return
 	 */
-	IPage<OrderVO> orderInventory(IPage<OrderVO> page,String tenantId,String tradeType,String billType, Long itemId,Long corpId);
+	IPage<OrderVO> orderInventory(IPage<OrderVO> page, String tenantId, String tradeType, String billType, Long itemId, Long corpId);
 }

Разница между файлами не показана из-за своего большого размера
+ 286 - 337
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java


Некоторые файлы не были показаны из-за большого количества измененных файлов