Browse Source

2024年11月11日17:26:31

纪新园 1 year ago
parent
commit
c120e7c643
32 changed files with 1831 additions and 263 deletions
  1. 1 1
      blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java
  2. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  3. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/dto/UpdateDTO.java
  4. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/dto/UpdateItemDTO.java
  5. 129 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/entity/Update.java
  6. 129 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/entity/UpdateItem.java
  7. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/vo/UpdateItemVO.java
  8. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/vo/UpdateVO.java
  9. 5 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/funding/entity/PjpfFunding.java
  10. 10 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/funding/entity/PjpfFundingItem.java
  11. 14 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/WxUnionIdOpenId.java
  12. 1 1
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IWxUnionIdOpenIdClient.java
  13. 181 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/controller/UpdateController.java
  14. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/controller/UpdateItemController.java
  15. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateItemMapper.java
  16. 31 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateItemMapper.xml
  17. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateMapper.java
  18. 28 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateMapper.xml
  19. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/IUpdateItemService.java
  20. 55 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/IUpdateService.java
  21. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/impl/UpdateItemServiceImpl.java
  22. 260 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/impl/UpdateServiceImpl.java
  23. 314 84
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  24. 19 17
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/check/service/impl/AuditProecessServiceImpl.java
  25. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/funding/service/impl/PjpfBalanceResetServiceImpl.java
  26. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/controller/OrderController.java
  27. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/IOrderService.java
  28. 84 83
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  29. 102 64
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java
  30. 9 3
      blade-service/blade-school/src/main/java/org/springblade/school/controller/WxUnionIdOpenIdController.java
  31. 6 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/feign/WxUnionIdOpenIdClient.java
  32. 12 4
      blade-service/blade-weChat/src/main/java/org/springblade/weChat/officialAccount/WxUnionIdOpenIdController.java

+ 1 - 1
blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java

@@ -150,7 +150,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
 
 			//根据unionId查询微信信息表是否存在该unionId
 			if (ObjectUtil.isNotEmpty(unionId)) {
-				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,user.getTenantId());
 				if (ObjectUtil.isNotEmpty(wxUnionIdOpenId)) {//存在 更新公众号openid
 					user.setOaOpenId(wxUnionIdOpenId.getOpenId());
 				}

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -1839,5 +1839,10 @@ public class Bills implements Serializable {
 	 */
 	@TableField(exist = false)
 	private String endTime2;
+	/**
+	 * 派车时间
+	 */
+	@TableField(exist = false)
+	private String dispatchTime2;
 
 }

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

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

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

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

+ 129 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/entity/Update.java

@@ -0,0 +1,129 @@
+/*
+ *      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.los.business.update.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务修改表实体类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@Data
+@TableName("los_update")
+@ApiModel(value = "Update对象", description = "业务修改表")
+public class Update implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 唛头
+	 */
+	@ApiModelProperty(value = "唛头")
+	private String remarks;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 业务类型, SE=海运出口 SI=海运进口
+	 */
+	@ApiModelProperty(value = "业务类型, SE=海运出口 SI=海运进口")
+	private String businessType;
+	/**
+	 * 检索类型
+	 */
+	@ApiModelProperty(value = "检索类型")
+	private String retrievalType;
+	/**
+	 * 检索值
+	 */
+	@ApiModelProperty(value = "检索值")
+	private String retrievalValue;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+	/**
+	 * 审批状态
+	 */
+	@ApiModelProperty(value = "审批状态")
+	private String approvalStatus;
+
+	@TableField(exist = false)
+	private List<UpdateItem> updateItemList;
+
+	//跳转对应页面的路由
+	@TableField(exist = false)
+	private String url;
+	//页面枚举
+	@TableField(exist = false)
+	private String pageStatus;
+	//页面名字
+	@TableField(exist = false)
+	private String pageLabel;
+
+
+}

+ 129 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/entity/UpdateItem.java

@@ -0,0 +1,129 @@
+/*
+ *      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.los.business.update.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 业务修改明细表实体类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@Data
+@TableName("los_update_item")
+@ApiModel(value = "UpdateItem对象", description = "业务修改明细表")
+public class UpdateItem implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 唛头
+	 */
+	@ApiModelProperty(value = "唛头")
+	private String remarks;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 主表id
+	 */
+	@ApiModelProperty(value = "主表id")
+	private Long pid;
+	/**
+	 * 字段类型
+	 */
+	@ApiModelProperty(value = "字段类型")
+	private String fieldType;
+	/**
+	 * 字段描述
+	 */
+	@ApiModelProperty(value = "字段描述")
+	private String fieldDescribe;
+	/**
+	 * 字段值
+	 */
+	@ApiModelProperty(value = "字段值")
+	private String fieldValue;
+	/**
+	 * 关联字段
+	 */
+	@ApiModelProperty(value = "关联字段")
+	private String relationField;
+	/**
+	 * 字段值新
+	 */
+	@ApiModelProperty(value = "字段值新")
+	private String fieldValueNew;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+	/**
+	 * 修改表
+	 */
+	@ApiModelProperty(value = "修改表")
+	private String surface;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/vo/UpdateItemVO.java

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

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/update/vo/UpdateVO.java

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

+ 5 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/funding/entity/PjpfFunding.java

@@ -141,6 +141,11 @@ public class PjpfFunding implements Serializable {
 	@ApiModelProperty(value = "可用金额")
 	private BigDecimal availableAmount;
 	/**
+	 * 融资金额
+	 */
+	@ApiModelProperty(value = "融资金额")
+	private BigDecimal fundingAmount;
+	/**
 	 * 利息
 	 */
 	@ApiModelProperty(value = "利息")

+ 10 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/funding/entity/PjpfFundingItem.java

@@ -118,6 +118,16 @@ public class PjpfFundingItem implements Serializable {
 	 */
 	@ApiModelProperty(value = "租户id")
 	private String tenantId;
+	/**
+	 * 保证金
+	 */
+	@ApiModelProperty(value = "保证金")
+	private BigDecimal bondAmount;
+	/**
+	 * 融资金额
+	 */
+	@ApiModelProperty(value = "融资金额")
+	private BigDecimal fundingAmount;
 
 
 }

+ 14 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/WxUnionIdOpenId.java

@@ -1,5 +1,6 @@
 package org.springblade.system.user.entity;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -33,4 +34,17 @@ public class WxUnionIdOpenId {
 	@ApiModelProperty(value = "unionId")
 	private String unionId;
 
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	@TableLogic(value = "0", delval = "1")
+	private Integer isDeleted;
+
 }

+ 1 - 1
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IWxUnionIdOpenIdClient.java

@@ -24,7 +24,7 @@ public interface IWxUnionIdOpenIdClient {
 	 * @param unionId
 	 */
 	@GetMapping(GET_WX_UNION_ID)
-	WxUnionIdOpenId getWxUnionId(@RequestParam(value = "unionId") String unionId);
+	WxUnionIdOpenId getWxUnionId(@RequestParam(value = "unionId") String unionId,@RequestParam(value = "tenantId") String tenantId);
 
 	/**
 	 * 新增

+ 181 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/controller/UpdateController.java

@@ -0,0 +1,181 @@
+/*
+ *      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.los.business.update.controller;
+
+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.common.annotation.RepeatSubmit;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.update.entity.Update;
+import org.springblade.los.business.update.vo.UpdateVO;
+import org.springblade.los.business.update.service.IUpdateService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务修改表 控制器
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/update")
+@Api(value = "业务修改表", tags = "业务修改表接口")
+public class UpdateController extends BladeController {
+
+	private final IUpdateService updateService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入update")
+	public R<Update> detail(Update update) {
+		Update detail = updateService.detail(update);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务修改表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入update")
+	public R<IPage<Update>> list(Update update, Query query) {
+		IPage<Update> pages = updateService.page(Condition.getPage(query), Condition.getQueryWrapper(update));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务修改表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入update")
+	public R<IPage<UpdateVO>> page(UpdateVO update, Query query) {
+		IPage<UpdateVO> pages = updateService.selectUpdatePage(Condition.getPage(query), update);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务修改表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入update")
+	public R save(@Valid @RequestBody Update update) {
+		return R.status(updateService.save(update));
+	}
+
+	/**
+	 * 修改 业务修改表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入update")
+	public R update(@Valid @RequestBody Update update) {
+		return R.status(updateService.updateById(update));
+	}
+
+	/**
+	 * 新增或修改 业务修改表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入update")
+	public R submit(@Valid @RequestBody Update update) {
+		return updateService.submit(update);
+	}
+
+
+	/**
+	 * 删除 业务修改表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(updateService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/getUpdate")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入update")
+	public R<Update> getUpdate(Update update) {
+		Update detail = updateService.getUpdate(update);
+		return R.data(detail);
+	}
+
+	/**
+	 * 单据请核
+	 */
+	@PostMapping("/checkUpdate")
+	@ApiOperationSupport(order = 13)
+	@RepeatSubmit
+	public R checkUpdate(@RequestBody Update update) {
+		Update declare = updateService.checkUpdate(update);
+		return R.data(declare);
+	}
+
+	/**
+	 * 审核通过
+	 */
+	@PostMapping("/passCheck")
+	@ApiOperationSupport(order = 14)
+	@RepeatSubmit
+	public R passCheck(@ApiParam(value = "主表id", required = true) @RequestParam Long id) {
+		return updateService.passCheck(id);
+	}
+
+	/**
+	 * 审核中
+	 */
+	@PostMapping("/underReview")
+	@ApiOperationSupport(order = 15)
+	@RepeatSubmit
+	public R underReview(@ApiParam(value = "主表id", required = true) @RequestParam Long id) {
+		return updateService.underReview(id);
+	}
+
+	/**
+	 * 审核不通过
+	 */
+	@PostMapping("/passCancel")
+	@ApiOperationSupport(order = 16)
+	@RepeatSubmit
+	public R passCancel(@ApiParam(value = "财务主表id", required = true) @RequestParam Long id) {
+		updateService.passCancel(id);
+		return R.success("操作成功");
+	}
+
+
+}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/controller/UpdateItemController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.los.business.update.controller;
+
+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.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.update.entity.UpdateItem;
+import org.springblade.los.business.update.vo.UpdateItemVO;
+import org.springblade.los.business.update.service.IUpdateItemService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务修改明细表 控制器
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/updateitem")
+@Api(value = "业务修改明细表", tags = "业务修改明细表接口")
+public class UpdateItemController extends BladeController {
+
+	private final IUpdateItemService updateItemService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入updateItem")
+	public R<UpdateItem> detail(UpdateItem updateItem) {
+		UpdateItem detail = updateItemService.getOne(Condition.getQueryWrapper(updateItem));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务修改明细表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入updateItem")
+	public R<IPage<UpdateItem>> list(UpdateItem updateItem, Query query) {
+		IPage<UpdateItem> pages = updateItemService.page(Condition.getPage(query), Condition.getQueryWrapper(updateItem));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务修改明细表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入updateItem")
+	public R<IPage<UpdateItemVO>> page(UpdateItemVO updateItem, Query query) {
+		IPage<UpdateItemVO> pages = updateItemService.selectUpdateItemPage(Condition.getPage(query), updateItem);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务修改明细表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入updateItem")
+	public R save(@Valid @RequestBody UpdateItem updateItem) {
+		return R.status(updateItemService.save(updateItem));
+	}
+
+	/**
+	 * 修改 业务修改明细表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入updateItem")
+	public R update(@Valid @RequestBody UpdateItem updateItem) {
+		return R.status(updateItemService.updateById(updateItem));
+	}
+
+	/**
+	 * 新增或修改 业务修改明细表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入updateItem")
+	public R submit(@Valid @RequestBody UpdateItem updateItem) {
+		return R.status(updateItemService.saveOrUpdate(updateItem));
+	}
+
+	
+	/**
+	 * 删除 业务修改明细表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(updateItemService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateItemMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.update.mapper;
+
+import org.springblade.los.business.update.entity.UpdateItem;
+import org.springblade.los.business.update.vo.UpdateItemVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务修改明细表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+public interface UpdateItemMapper extends BaseMapper<UpdateItem> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param updateItem
+	 * @return
+	 */
+	List<UpdateItemVO> selectUpdateItemPage(IPage page, UpdateItemVO updateItem);
+
+}

+ 31 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateItemMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.business.update.mapper.UpdateItemMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="updateItemResultMap" type="org.springblade.los.business.update.entity.UpdateItem">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="remarks" property="remarks"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="pid" property="pid"/>
+        <result column="field_type" property="fieldType"/>
+        <result column="field_describe" property="fieldDescribe"/>
+        <result column="field_value" property="fieldValue"/>
+        <result column="relation_field" property="relationField"/>
+        <result column="field_value_new" property="fieldValueNew"/>
+        <result column="surface" property="surface"/>
+    </resultMap>
+
+
+    <select id="selectUpdateItemPage" resultMap="updateItemResultMap">
+        select * from los_update_item where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.update.mapper;
+
+import org.springblade.los.business.update.entity.Update;
+import org.springblade.los.business.update.vo.UpdateVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务修改表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+public interface UpdateMapper extends BaseMapper<Update> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param update
+	 * @return
+	 */
+	List<UpdateVO> selectUpdatePage(IPage page, UpdateVO update);
+
+}

+ 28 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/mapper/UpdateMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.business.update.mapper.UpdateMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="updateResultMap" type="org.springblade.los.business.update.entity.Update">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="remarks" property="remarks"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="business_type" property="businessType"/>
+        <result column="retrieval_type" property="retrievalType"/>
+        <result column="retrieval_value" property="retrievalValue"/>
+        <result column="approval_status" property="approvalStatus"/>
+    </resultMap>
+
+
+    <select id="selectUpdatePage" resultMap="updateResultMap">
+        select * from los_update where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/IUpdateItemService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.los.business.update.service;
+
+import org.springblade.los.business.update.entity.UpdateItem;
+import org.springblade.los.business.update.vo.UpdateItemVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务修改明细表 服务类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+public interface IUpdateItemService extends IService<UpdateItem> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param updateItem
+	 * @return
+	 */
+	IPage<UpdateItemVO> selectUpdateItemPage(IPage<UpdateItemVO> page, UpdateItemVO updateItem);
+
+}

+ 55 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/IUpdateService.java

@@ -0,0 +1,55 @@
+/*
+ *      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.los.business.update.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.update.entity.Update;
+import org.springblade.los.business.update.vo.UpdateVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务修改表 服务类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+public interface IUpdateService extends IService<Update> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param update
+	 * @return
+	 */
+	IPage<UpdateVO> selectUpdatePage(IPage<UpdateVO> page, UpdateVO update);
+
+    Update detail(Update update);
+
+	R submit(Update update);
+
+	Update getUpdate(Update update);
+
+	Update checkUpdate(Update update);
+
+	R passCheck(Long id);
+
+	R underReview(Long id);
+
+	void passCancel(Long id);
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/impl/UpdateItemServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.los.business.update.service.impl;
+
+import org.springblade.los.business.update.entity.UpdateItem;
+import org.springblade.los.business.update.vo.UpdateItemVO;
+import org.springblade.los.business.update.mapper.UpdateItemMapper;
+import org.springblade.los.business.update.service.IUpdateItemService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务修改明细表 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@Service
+public class UpdateItemServiceImpl extends ServiceImpl<UpdateItemMapper, UpdateItem> implements IUpdateItemService {
+
+	@Override
+	public IPage<UpdateItemVO> selectUpdateItemPage(IPage<UpdateItemVO> page, UpdateItemVO updateItem) {
+		return page.setRecords(baseMapper.selectUpdateItemPage(page, updateItem));
+	}
+
+}

+ 260 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/impl/UpdateServiceImpl.java

@@ -0,0 +1,260 @@
+/*
+ *      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.los.business.update.service.impl;
+
+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.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.Util.IDeptUtils;
+import org.springblade.los.business.update.entity.Update;
+import org.springblade.los.business.update.entity.UpdateItem;
+import org.springblade.los.business.update.mapper.UpdateMapper;
+import org.springblade.los.business.update.service.IUpdateItemService;
+import org.springblade.los.business.update.service.IUpdateService;
+import org.springblade.los.business.update.vo.UpdateVO;
+import org.springblade.los.check.dto.LosAuditProecessDTO;
+import org.springblade.los.check.entity.LosAuditPathsActs;
+import org.springblade.los.check.entity.LosAuditPathsLevels;
+import org.springblade.los.check.service.IAuditPathsActsService;
+import org.springblade.los.check.service.IAuditPathsLevelsService;
+import org.springblade.los.check.service.IAuditProecessService;
+import org.springblade.system.entity.Dept;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务修改表 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-11-11
+ */
+@Service
+@AllArgsConstructor
+public class UpdateServiceImpl extends ServiceImpl<UpdateMapper, Update> implements IUpdateService {
+
+
+	private final IUpdateItemService updateItemService;
+
+	private final IAuditPathsActsService auditPathsActsService;
+
+	private final IAuditPathsLevelsService auditPathsLevelsService;
+
+	private final IAuditProecessService auditProecessService;
+
+	private final IDeptUtils deptUtils;
+
+	@Override
+	public IPage<UpdateVO> selectUpdatePage(IPage<UpdateVO> page, UpdateVO update) {
+		return page.setRecords(baseMapper.selectUpdatePage(page, update));
+	}
+
+	@Override
+	public Update detail(Update update) {
+		Update details = baseMapper.selectById(update.getId());
+		details.setUpdateItemList(updateItemService.list(new LambdaQueryWrapper<UpdateItem>()
+			.eq(UpdateItem::getTenantId, AuthUtil.getTenantId())
+			.eq(UpdateItem::getIsDeleted, 0)
+			.eq(UpdateItem::getPid, update.getId())
+		));
+		return details;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R submit(Update update) {
+		if (update.getId() == null) {
+			update.setCreateTime(new Date());
+			update.setCreateUser(AuthUtil.getUserId());
+			update.setCreateUserName(AuthUtil.getUserName());
+		} else {
+			update.setUpdateUser(AuthUtil.getUserId());
+			update.setUpdateTime(new Date());
+			update.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(update);
+		//明细
+		if (ObjectUtils.isNotNull(update.getUpdateItemList()) && !update.getUpdateItemList().isEmpty()) {
+			for (UpdateItem item : update.getUpdateItemList()) {
+				item.setPid(update.getId());
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			updateItemService.saveOrUpdateBatch(update.getUpdateItemList());
+		}
+		return R.data(update);
+	}
+
+	@Override
+	public Update getUpdate(Update update) {
+		Update update1 = baseMapper.selectOne(new LambdaQueryWrapper<Update>()
+			.eq(Update::getIsDeleted, 0)
+			.eq(Update::getTenantId, AuthUtil.getTenantId())
+			.eq(Update::getBusinessType, update.getBusinessType())
+			.eq(Update::getStatus, 0)
+			.last("LIMIT 1"));
+		if (update1 == null) {
+			throw new RuntimeException("请先维护配置文件");
+		}
+		List<UpdateItem> updateItemList = updateItemService.list(new LambdaQueryWrapper<UpdateItem>()
+			.eq(UpdateItem::getTenantId, AuthUtil.getTenantId())
+			.eq(UpdateItem::getIsDeleted, 0)
+			.eq(UpdateItem::getPid, update1.getId())
+		);
+		for (UpdateItem item : updateItemList) {
+			item.setId(null);
+			item.setPid(null);
+			item.setUpdateTime(null);
+			item.setUpdateUser(null);
+			item.setUpdateUserName("");
+			item.setStatus(0);
+		}
+		update1.setId(null);
+		update1.setUpdateTime(null);
+		update1.setUpdateUser(null);
+		update1.setUpdateUserName("");
+		update1.setStatus(0);
+		update1.setUpdateItemList(updateItemList);
+		return update1;
+	}
+
+	@Override
+	public Update checkUpdate(Update update) {
+		Update declare = baseMapper.selectById(update.getId());
+
+		Integer actId = 1113;
+		String processType = "业务数据修改审批";
+		String checkType = "YW_UPDATE";
+		//审批数据
+		LosAuditProecessDTO auditProecessDTO = new LosAuditProecessDTO();
+		//获取审批级次
+		List<LosAuditPathsLevels> auditPathsLevels = null;
+		// 判断是否有审批流,如果审批流已开启就进入审批流,否则直接走申请通过
+		LosAuditPathsActs pathsActs = null;
+		//是否开启流程
+		LambdaQueryWrapper<LosAuditPathsActs> auditPathsActsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		auditPathsActsLambdaQueryWrapper
+			.eq(LosAuditPathsActs::getIsEnable, 1)
+			.eq(LosAuditPathsActs::getFidStatus, "approval_status")
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId())
+			.eq(LosAuditPathsActs::getSalesCompanyId, deptUtils.getDeptPid())
+			.eq(LosAuditPathsActs::getActId, actId);
+		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
+		//获取审批信息
+		LosAuditPathsActs losAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<LosAuditPathsActs>()
+			.eq(LosAuditPathsActs::getActId, actId)
+			.eq(LosAuditPathsActs::getFidStatus, "approval_status")
+			.eq(LosAuditPathsActs::getSalesCompanyId, deptUtils.getDeptPid())
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
+		Long pathId = losAuditPathsActs.getPathId();
+		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<LosAuditPathsLevels>()
+			.eq(LosAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(LosAuditPathsLevels::getPathId, pathId));
+		auditProecessDTO.setTimes(1);
+		auditProecessDTO.setProcessType(processType);
+		// 没开启审批流直接走 通过流程
+		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
+			declare.setApprovalStatus("审核通过");
+		} else {
+			if (CollectionUtils.isEmpty(auditPathsLevels)) {
+				throw new SecurityException("开启审批失败:未查询到审批信息");
+			}
+			// 绑定审核类型
+			auditProecessDTO.setCheckType(checkType);
+			// 追加跳转路由url
+			auditProecessDTO.setUrl(update.getUrl());
+			auditProecessDTO.setPageStatus(update.getPageStatus());
+			auditProecessDTO.setPageLabel(update.getPageLabel());
+			auditProecessDTO.setOrderRemark(declare.getRemarks());
+			auditProecessDTO.setPathsLevelsList(auditPathsLevels);
+			auditProecessDTO.setActId(1);
+			auditProecessDTO.setSrcBillId(declare.getId());
+			auditProecessDTO.setBillId(declare.getId());
+			auditProecessDTO.setSendUserId(AuthUtil.getUserId());
+			auditProecessDTO.setSendName(AuthUtil.getUserName());
+			auditProecessDTO.setSendTime(new Date());
+			auditProecessDTO.setBillTime(declare.getCreateTime());
+			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
+			Dept dept = deptUtils.getDept(AuthUtil.getDeptId());
+			if (dept != null) {
+				auditProecessDTO.setSalesCompanyId(dept.getId());
+				auditProecessDTO.setSalesCompanyName(dept.getDeptName());
+			}
+			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
+			if (!financeProcess.isSuccess()) {
+				throw new SecurityException("操作失败,请联系管理员");
+			}
+		}
+		declare.setApprovalStatus("审核提交");
+		baseMapper.updateById(declare);
+		return declare;
+	}
+
+	@Override
+	public R passCheck(Long id) {
+		Update update = baseMapper.selectById(id);
+		if (update == null) {
+			throw new SecurityException("审批通过失败");
+		}
+		update.setApprovalStatus("审核通过");
+		baseMapper.updateById(update);
+		List<UpdateItem> updateItemList = updateItemService.list(new LambdaQueryWrapper<UpdateItem>()
+			.eq(UpdateItem::getTenantId, AuthUtil.getTenantId())
+			.eq(UpdateItem::getIsDeleted, 0)
+			.eq(UpdateItem::getPid, update.getId())
+		);
+		for (UpdateItem item : updateItemList) {
+
+		}
+		return R.success("操作成功");
+	}
+
+	@Override
+	public R underReview(Long id) {
+		Update update = baseMapper.selectById(id);
+		if (update == null) {
+			throw new SecurityException("审批通过失败");
+		}
+		update.setApprovalStatus("审核中");
+		baseMapper.updateById(update);
+		return R.success("操作成功");
+	}
+
+	@Override
+	public void passCancel(Long id) {
+		Update update = baseMapper.selectById(id);
+		if (update == null) {
+			throw new SecurityException("审批失败");
+		}
+		update.setApprovalStatus("录入");
+		baseMapper.updateById(update);
+	}
+
+}

+ 314 - 84
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -322,11 +322,31 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.eq(Bills::getIsDeleted, 0)
 			.ge(Bills::getBillDate, dateStart)
 			.le(Bills::getBillDate, dateEnd);
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+		String jurisdiction = sysClient.getParamService("data.jurisdiction");
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					lambdaQueryWrapper.eq(Bills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					lambdaQueryWrapper.eq(Bills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					lambdaQueryWrapper.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
+				} else {
+					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
+				}
+				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		lambdaQueryWrapper.eq(Bills::getBusinessType, "SE");
 		HYCK = billsMapper.selectCount(lambdaQueryWrapper);
@@ -335,11 +355,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.eq(Bills::getIsDeleted, 0)
 			.ge(Bills::getBillDate, dateStart)
 			.le(Bills::getBillDate, dateEnd);
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			lambdaQueryWrapperSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					lambdaQueryWrapperSI.eq(Bills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					lambdaQueryWrapperSI.eq(Bills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					lambdaQueryWrapperSI.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
+				} else {
+					lambdaQueryWrapperSI.eq(Bills::getCreateUser, AuthUtil.getUserId());
+				}
+				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				lambdaQueryWrapperSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		lambdaQueryWrapperSI.eq(Bills::getBusinessType, "SI");
 		HYJK = billsMapper.selectCount(lambdaQueryWrapperSI);
@@ -349,11 +388,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.eq(AeaBills::getIsDeleted, 0)
 			.le(AeaBills::getBillDate, dateEnd)
 			.ge(AeaBills::getBillDate, dateStart);
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			aeaBillsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getSrcId, AuthUtil.getUserId());
+				} else {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getCreateUser, AuthUtil.getUserId());
+				}
+				aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				aeaBillsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		aeaBillsLambdaQueryWrapper.eq(AeaBills::getBusinessType, "AE");
 		KYCK = aeaBillsMapper.selectCount(aeaBillsLambdaQueryWrapper);
@@ -362,11 +420,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.eq(AeaBills::getIsDeleted, 0)
 			.le(AeaBills::getBillDate, dateEnd)
 			.ge(AeaBills::getBillDate, dateStart);
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			aeaBillsLambdaQueryWrapperAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getSrcId, AuthUtil.getUserId());
+				} else {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getCreateUser, AuthUtil.getUserId());
+				}
+				aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				aeaBillsLambdaQueryWrapperAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBusinessType, "AI");
 		KYJK = aeaBillsMapper.selectCount(aeaBillsLambdaQueryWrapperAI);
@@ -410,11 +487,31 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Bills::getBillDate, dateStart)
 			.le(Bills::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+		String jurisdiction = sysClient.getParamService("data.jurisdiction");
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					lambdaQueryWrapper.eq(Bills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					lambdaQueryWrapper.eq(Bills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					lambdaQueryWrapper.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
+				} else {
+					lambdaQueryWrapper.eq(Bills::getCreateUser, AuthUtil.getUserId());
+				}
+				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		lambdaQueryWrapper.eq(Bills::getBusinessType, "SE");
 		HYCK = billsMapper.selectCount(lambdaQueryWrapper);
@@ -424,11 +521,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Bills::getBillDate, dateStart)
 			.le(Bills::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			lambdaQueryWrapperSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					lambdaQueryWrapperSI.eq(Bills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					lambdaQueryWrapperSI.eq(Bills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					lambdaQueryWrapperSI.eq(Bills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
+				} else {
+					lambdaQueryWrapperSI.eq(Bills::getCreateUser, AuthUtil.getUserId());
+				}
+				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				lambdaQueryWrapperSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				lambdaQueryWrapperSI.eq(Bills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		lambdaQueryWrapperSI.eq(Bills::getBusinessType, "SI");
 		HYJK = billsMapper.selectCount(lambdaQueryWrapperSI);
@@ -440,11 +556,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(AeaBills::getBillDate, dateStart)
 			.le(AeaBills::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			aeaBillsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getSrcId, AuthUtil.getUserId());
+				} else {
+					aeaBillsLambdaQueryWrapper.eq(AeaBills::getCreateUser, AuthUtil.getUserId());
+				}
+				aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				aeaBillsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				aeaBillsLambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		aeaBillsLambdaQueryWrapper.eq(AeaBills::getBusinessType, "AE");
 		KYCK = aeaBillsMapper.selectCount(aeaBillsLambdaQueryWrapper);
@@ -454,11 +589,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(AeaBills::getBillDate, dateStart)
 			.le(AeaBills::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			aeaBillsLambdaQueryWrapperAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getSrcId, AuthUtil.getUserId());
+				} else {
+					aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getCreateUser, AuthUtil.getUserId());
+				}
+				aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				aeaBillsLambdaQueryWrapperAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		aeaBillsLambdaQueryWrapperAI.eq(AeaBills::getBusinessType, "AI");
 		KYJK = aeaBillsMapper.selectCount(aeaBillsLambdaQueryWrapperAI);
@@ -470,11 +624,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Amends::getBillDate, dateStart)
 			.le(Amends::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			amendsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			amendsLambdaQueryWrapper.eq(Amends::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					amendsLambdaQueryWrapper.eq(Amends::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					amendsLambdaQueryWrapper.eq(Amends::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					amendsLambdaQueryWrapper.eq(Amends::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					amendsLambdaQueryWrapper.eq(Amends::getSrcId, AuthUtil.getUserId());
+				} else {
+					amendsLambdaQueryWrapper.eq(Amends::getCreateUser, AuthUtil.getUserId());
+				}
+				amendsLambdaQueryWrapper.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				amendsLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				amendsLambdaQueryWrapper.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		amendsLambdaQueryWrapper.eq(Amends::getBusinessType, "SEA");
 		SEA = amendsMapper.selectCount(amendsLambdaQueryWrapper);
@@ -484,11 +657,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Amends::getBillDate, dateStart)
 			.le(Amends::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			amendsLambdaQueryWrapperSIA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			amendsLambdaQueryWrapperSIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					amendsLambdaQueryWrapperSIA.eq(Amends::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					amendsLambdaQueryWrapperSIA.eq(Amends::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					amendsLambdaQueryWrapperSIA.eq(Amends::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					amendsLambdaQueryWrapperSIA.eq(Amends::getSrcId, AuthUtil.getUserId());
+				} else {
+					amendsLambdaQueryWrapperSIA.eq(Amends::getCreateUser, AuthUtil.getUserId());
+				}
+				amendsLambdaQueryWrapperSIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				amendsLambdaQueryWrapperSIA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				amendsLambdaQueryWrapperSIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		amendsLambdaQueryWrapperSIA.eq(Amends::getBusinessType, "SIA");
 		SIA = amendsMapper.selectCount(amendsLambdaQueryWrapperSIA);
@@ -498,11 +690,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Amends::getBillDate, dateStart)
 			.le(Amends::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			amendsLambdaQueryWrapperAEA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			amendsLambdaQueryWrapperAEA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					amendsLambdaQueryWrapperAEA.eq(Amends::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					amendsLambdaQueryWrapperAEA.eq(Amends::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					amendsLambdaQueryWrapperAEA.eq(Amends::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					amendsLambdaQueryWrapperAEA.eq(Amends::getSrcId, AuthUtil.getUserId());
+				} else {
+					amendsLambdaQueryWrapperAEA.eq(Amends::getCreateUser, AuthUtil.getUserId());
+				}
+				amendsLambdaQueryWrapperAEA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				amendsLambdaQueryWrapperAEA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				amendsLambdaQueryWrapperAEA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		amendsLambdaQueryWrapperAEA.eq(Amends::getBusinessType, "AEA");
 		AEA = amendsMapper.selectCount(amendsLambdaQueryWrapperAEA);
@@ -512,11 +723,30 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(Amends::getBillDate, dateStart)
 			.le(Amends::getBillDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			amendsLambdaQueryWrapperAIA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			amendsLambdaQueryWrapperAIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+		if ("1".equals(jurisdiction)) {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("老板")
+				&& !AuthUtil.getUserRole().contains("副总") && !AuthUtil.getUserRole().contains("财务")
+				&& !AuthUtil.getUserRole().contains("经理")) {
+				if (AuthUtil.getUserRole().contains("操作经理")) {
+					amendsLambdaQueryWrapperAIA.eq(Amends::getOperatorDept, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("操作员")) {
+					amendsLambdaQueryWrapperAIA.eq(Amends::getOperatorId, AuthUtil.getUserId());
+				} else if (AuthUtil.getUserRole().contains("销售经理")) {
+					amendsLambdaQueryWrapperAIA.eq(Amends::getSrcDeptId, AuthUtil.getDeptId());
+				} else if (AuthUtil.getUserRole().contains("业务员")) {
+					amendsLambdaQueryWrapperAIA.eq(Amends::getSrcId, AuthUtil.getUserId());
+				} else {
+					amendsLambdaQueryWrapperAIA.eq(Amends::getCreateUser, AuthUtil.getUserId());
+				}
+				amendsLambdaQueryWrapperAIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
+		} else {
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				amendsLambdaQueryWrapperAIA.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				amendsLambdaQueryWrapperAIA.eq(Amends::getBranchId, deptUtils.getDeptPid());
+			}
 		}
 		amendsLambdaQueryWrapperAIA.eq(Amends::getBusinessType, "AIA");
 		AIA = amendsMapper.selectCount(amendsLambdaQueryWrapperAIA);
@@ -528,12 +758,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(CustomsDeclaration::getDeclareDate, dateStart)
 			.le(CustomsDeclaration::getDeclareDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			customsDeclarationLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			customsDeclarationLambdaQueryWrapper.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
-		}
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				customsDeclarationLambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				customsDeclarationLambdaQueryWrapper.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
+			}
 		customsDeclarationLambdaQueryWrapper.eq(CustomsDeclaration::getBusinessType, "BGSE");
 		BGSE = customsDeclarationMapper.selectCount(customsDeclarationLambdaQueryWrapper);
 		LambdaQueryWrapper<CustomsDeclaration> customsDeclarationLambdaQueryWrapperBGSI = new LambdaQueryWrapper<>();
@@ -542,12 +772,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(CustomsDeclaration::getDeclareDate, dateStart)
 			.le(CustomsDeclaration::getDeclareDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			customsDeclarationLambdaQueryWrapperBGSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			customsDeclarationLambdaQueryWrapperBGSI.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
-		}
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				customsDeclarationLambdaQueryWrapperBGSI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				customsDeclarationLambdaQueryWrapperBGSI.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
+			}
 		customsDeclarationLambdaQueryWrapperBGSI.eq(CustomsDeclaration::getBusinessType, "BGSI");
 		BGSI = customsDeclarationMapper.selectCount(customsDeclarationLambdaQueryWrapperBGSI);
 		LambdaQueryWrapper<CustomsDeclaration> customsDeclarationLambdaQueryWrapperBGAE = new LambdaQueryWrapper<>();
@@ -556,12 +786,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(CustomsDeclaration::getDeclareDate, dateStart)
 			.le(CustomsDeclaration::getDeclareDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			customsDeclarationLambdaQueryWrapperBGAE.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			customsDeclarationLambdaQueryWrapperBGAE.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
-		}
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				customsDeclarationLambdaQueryWrapperBGAE.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				customsDeclarationLambdaQueryWrapperBGAE.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
+			}
 		customsDeclarationLambdaQueryWrapperBGAE.eq(CustomsDeclaration::getBusinessType, "BGAE");
 		BGAE = customsDeclarationMapper.selectCount(customsDeclarationLambdaQueryWrapperBGAE);
 		LambdaQueryWrapper<CustomsDeclaration> customsDeclarationLambdaQueryWrapperBGAI = new LambdaQueryWrapper<>();
@@ -570,12 +800,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.ge(CustomsDeclaration::getDeclareDate, dateStart)
 			.le(CustomsDeclaration::getDeclareDate, dateEnd)
 			.apply("find_in_set(status,'1,2')");
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
-			customsDeclarationLambdaQueryWrapperBGAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
-		}
-		if (!AuthUtil.getUserRole().contains("admin")) {
-			customsDeclarationLambdaQueryWrapperBGAI.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
-		}
+			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+				customsDeclarationLambdaQueryWrapperBGAI.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+			}
+			if (!AuthUtil.getUserRole().contains("admin")) {
+				customsDeclarationLambdaQueryWrapperBGAI.eq(CustomsDeclaration::getBranchId, deptUtils.getDeptPid());
+			}
 		customsDeclarationLambdaQueryWrapperBGAI.eq(CustomsDeclaration::getBusinessType, "BGAI");
 		BGAI = customsDeclarationMapper.selectCount(customsDeclarationLambdaQueryWrapperBGAI);
 

+ 19 - 17
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/check/service/impl/AuditProecessServiceImpl.java

@@ -414,23 +414,6 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, P
 						.eq(PjpfFunding::getTenantId, AuthUtil.getTenantId())
 						.eq(PjpfFunding::getIsDeleted, 0));
 					if (pjpfFunding != null) {
-						PjpfFundingItem item = new PjpfFundingItem();
-						item.setPid(pjpfFunding.getId());
-						item.setTenantId(AuthUtil.getTenantId());
-						item.setCreateTime(new Date());
-						item.setCreateUser(AuthUtil.getUserId());
-						item.setCreateUserName(AuthUtil.getUserName());
-						item.setCreateDept(pjpfFunding.getCreateDept());
-						item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-						item.setType("采购融资-审核通过");
-						item.setSrcId(auditProecess.getSrcBillId());
-						item.setSrcNo(auditProecess.getBillNo());
-						item.setAmount(order.getSalesAmount());
-						if (ObjectUtils.isNull(proportion)) {
-							throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
-						}
-						item.setProportion(proportion);
-						pjpfFundingItemService.save(item);
 						String[] arr = proportion.split(":");
 						BigDecimal a = new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32);
 						BigDecimal bondAmount = order.getSalesAmount().multiply(a)
@@ -449,6 +432,25 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, P
 						pjpfFunding.setUpdateUser(AuthUtil.getUserId());
 						pjpfFunding.setUpdateUserName(AuthUtil.getUserName());
 						pjpfFundingService.updateById(pjpfFunding);
+						PjpfFundingItem item = new PjpfFundingItem();
+						item.setPid(pjpfFunding.getId());
+						item.setTenantId(AuthUtil.getTenantId());
+						item.setCreateTime(new Date());
+						item.setCreateUser(AuthUtil.getUserId());
+						item.setCreateUserName(AuthUtil.getUserName());
+						item.setCreateDept(pjpfFunding.getCreateDept());
+						item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+						item.setType("采购融资-审核通过");
+						item.setSrcId(auditProecess.getSrcBillId());
+						item.setSrcNo(auditProecess.getBillNo());
+						item.setAmount(order.getSalesAmount());
+						if (ObjectUtils.isNull(proportion)) {
+							throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
+						}
+						item.setProportion(proportion);
+						item.setBondAmount(bondAmount);
+						item.setFundingAmount(fundingAmount);
+						pjpfFundingItemService.save(item);
 					} else {
 						throw new RuntimeException("未找到融资总账信息");
 					}

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/funding/service/impl/PjpfBalanceResetServiceImpl.java

@@ -188,7 +188,7 @@ public class PjpfBalanceResetServiceImpl extends ServiceImpl<PjpfBalanceResetMap
 			item.setType("充值撤销");
 			item.setSrcId(pjpfBalanceReset.getId());
 			item.setSrcNo(pjpfBalanceReset.getSysNo());
-			item.setAmount(pjpfBalanceReset.getAmount());
+			item.setAmount(new BigDecimal("0.00").subtract(pjpfBalanceReset.getAmount()));
 			pjpfFundingItemService.save(item);
 
 			if (pjpfFunding.getAvailableAmount().compareTo(pjpfBalanceReset.getAmount()) < 0) {

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/controller/OrderController.java

@@ -1201,13 +1201,13 @@ public class OrderController extends BladeController {
 	}
 
 	/**
-	 * 退款审核通过
+	 * 出库任务审核通过
 	 */
 	@PostMapping("/passCheckRW")
 	@ApiOperationSupport(order = 14)
 	@ApiOperation(value = "审核通过", notes = "传入id")
 	@RepeatSubmit
-	public R passCheckRW(@ApiParam(value = "主表id", required = true) @RequestParam Long id) {
+	public R<PjOrder> passCheckRW(@ApiParam(value = "主表id", required = true) @RequestParam Long id) {
 		return orderService.passCheckRW(id);
 	}
 

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/IOrderService.java

@@ -249,7 +249,7 @@ public interface IOrderService extends IService<PjOrder> {
 
 	PjOrder revokeCheckOrderRW(PjOrder order);
 
-	R passCheckRW(Long id);
+	R<PjOrder> passCheckRW(Long id);
 
 	R underReviewRW(Long id);
 

+ 84 - 83
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -2894,23 +2894,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				.eq(PjpfFunding::getTenantId, AuthUtil.getTenantId())
 				.eq(PjpfFunding::getIsDeleted, 0));
 			if (pjpfFunding != null) {
-				PjpfFundingItem item = new PjpfFundingItem();
-				item.setPid(pjpfFunding.getId());
-				item.setTenantId(AuthUtil.getTenantId());
-				item.setCreateTime(new Date());
-				item.setCreateUser(AuthUtil.getUserId());
-				item.setCreateUserName(AuthUtil.getUserName());
-				item.setCreateDept(pjpfFunding.getCreateDept());
-				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-				item.setType("融资采购-确认到货");
-				item.setSrcId(order.getId());
-				item.setSrcNo(order.getOrdNo());
-				if (ObjectUtils.isNull(proportion)) {
-					throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
-				}
-				item.setProportion(proportion);
-				item.setAmount(order.getGoodsTotalShipAmount());
-				pjpfFundingItemService.save(item);
 				String[] arr = proportion.split(":");
 				BigDecimal actualBondAmount = order.getGoodsTotalShipAmount().multiply(
 					(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
@@ -2921,7 +2904,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 						.setScale(2, RoundingMode.HALF_UP)));
 				BigDecimal fundingAmount = order.getFundingAmount();
 				order.setPrimaryFundingAmount(fundingAmount);
-				order.setFundingAmount(actualFundingAmount);
 				if (fundingAmount.compareTo(actualFundingAmount) > 0) {
 					BigDecimal amount = fundingAmount.subtract(actualFundingAmount);
 					order.setProduceAdvanceChargeAmount(amount);
@@ -2960,6 +2942,25 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				pjpfFunding.setUpdateUserName(AuthUtil.getUserName());
 				pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().add(primaryBondAmount.subtract(actualBondAmount)));
 				pjpfFundingService.updateById(pjpfFunding);
+				PjpfFundingItem item = new PjpfFundingItem();
+				item.setPid(pjpfFunding.getId());
+				item.setTenantId(AuthUtil.getTenantId());
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				item.setCreateDept(pjpfFunding.getCreateDept());
+				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+				item.setType("融资采购-确认到货");
+				item.setSrcId(order.getId());
+				item.setSrcNo(order.getOrdNo());
+				if (ObjectUtils.isNull(proportion)) {
+					throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
+				}
+				item.setProportion(proportion);
+				item.setAmount(order.getGoodsTotalShipAmount());
+				item.setBondAmount(actualBondAmount);
+				item.setFundingAmount(actualFundingAmount);
+				pjpfFundingItemService.save(item);
 			} else {
 				throw new RuntimeException("未找到融资总账信息");
 			}
@@ -3037,23 +3038,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				.eq(PjpfFunding::getTenantId, AuthUtil.getTenantId())
 				.eq(PjpfFunding::getIsDeleted, 0));
 			if (pjpfFunding != null) {
-				PjpfFundingItem item = new PjpfFundingItem();
-				item.setPid(pjpfFunding.getId());
-				item.setTenantId(AuthUtil.getTenantId());
-				item.setCreateTime(new Date());
-				item.setCreateUser(AuthUtil.getUserId());
-				item.setCreateUserName(AuthUtil.getUserName());
-				item.setCreateDept(pjpfFunding.getCreateDept());
-				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-				item.setType("融资采购-撤销确认到货");
-				item.setSrcId(order.getId());
-				item.setSrcNo(order.getOrdNo());
-				if (ObjectUtils.isNull(proportion)) {
-					throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
-				}
-				item.setProportion(proportion);
-				item.setAmount(order.getGoodsTotalShipAmount());
-				pjpfFundingItemService.save(item);
 				String[] arr = proportion.split(":");
 				BigDecimal actualBondAmount = order.getGoodsTotalShipAmount().multiply(
 					(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
@@ -3068,7 +3052,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				BigDecimal primaryFundingAmount = order.getSalesAmount().multiply(
 					(new BigDecimal(arr[1]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
 						.setScale(2, RoundingMode.HALF_UP)));
-				order.setFundingAmount(primaryFundingAmount);
 				order.setPrimaryFundingAmount(actualFundingAmount);
 				pjpfFunding.setPrimaryFundingAmount(pjpfFunding.getPrimaryFundingAmount().subtract(actualFundingAmount).add(primaryFundingAmount));
 				pjpfFunding.setSurplusFundingAmount(pjpfFunding.getSurplusFundingAmount().subtract(actualFundingAmount).add(primaryFundingAmount));
@@ -3083,6 +3066,25 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				BigDecimal amount = primaryBondAmount.subtract(actualBondAmount);
 				pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().subtract(amount));
 				pjpfFundingService.updateById(pjpfFunding);
+				PjpfFundingItem item = new PjpfFundingItem();
+				item.setPid(pjpfFunding.getId());
+				item.setTenantId(AuthUtil.getTenantId());
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				item.setCreateDept(pjpfFunding.getCreateDept());
+				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+				item.setType("融资采购-撤销确认到货");
+				item.setSrcId(order.getId());
+				item.setSrcNo(order.getOrdNo());
+				if (ObjectUtils.isNull(proportion)) {
+					throw new RuntimeException("未查到第一个月融资比例,请先设置业务参数");
+				}
+				item.setProportion(proportion);
+				item.setAmount(new BigDecimal("0.00").subtract(order.getGoodsTotalShipAmount()));
+				item.setBondAmount(new BigDecimal("0.00").subtract(actualBondAmount));
+				item.setFundingAmount(new BigDecimal("0.00").subtract(actualFundingAmount));
+				pjpfFundingItemService.save(item);
 			} else {
 				throw new RuntimeException("未找到融资总账信息");
 			}
@@ -3149,6 +3151,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				.eq(PjOrderItems::getIsDeleted, 0)
 				.eq(PjOrderItems::getPid, pjOrder.getId());
 			List<PjOrderItems> itemsList = orderItemsService.list(itemsLambdaQueryWrapper);
+			for (PjOrderItems item : itemsList) {
+				if (ObjectUtils.isNull(item.getRebatePrice())) {
+					throw new RuntimeException("获取数据失败,请先保存");
+				}
+				if (ObjectUtils.isNull(item.getCostprie())) {
+					throw new RuntimeException("获取数据失败,请先保存");
+				}
+			}
 			long count = itemsList.stream().filter(e -> ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(e.getBrandName())).count();
 			if (count > 0) {
 				if ("审核提交".equals(order.getTaskWhetherAdopt())) {
@@ -3215,27 +3225,24 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
 			.eq(PjAuditPathsActs::getActId, 1110);
 		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
-		//获取审批信息
-		PjAuditPathsActs pjAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<PjAuditPathsActs>()
-			.eq(PjAuditPathsActs::getActId, 1110)
-			.eq(PjAuditPathsActs::getFidStatus, "taskWhetherAdopt")
-			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
-			.eq(PjAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
-		Long pathId = pjAuditPathsActs.getPathId();
-		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
-			.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
-		auditProecessDTO.setTimes(1);
-		auditProecessDTO.setProcessType("出库任务审批");
-
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
-			throw new SecurityException("当前租户未查询到审批流配置");
+//			throw new SecurityException("当前租户未查询到审批流配置");
+			R<PjOrder> res = this.passCheckRW(order.getId());
+			if (res.isSuccess()) {
+				return res.getData();
+			} else {
+				throw new RuntimeException(res.getMsg());
+			}
 		} else {
-
+			Long pathId = pathsActs.getPathId();
+			auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
+				.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
+			auditProecessDTO.setTimes(1);
+			auditProecessDTO.setProcessType("出库任务审批");
 			if (CollectionUtils.isEmpty(auditPathsLevels)) {
 				throw new SecurityException("开启审批失败:未查询到审批信息");
 			}
-
 			auditProecessDTO.setOrderQuantity(declare.getGoodsTotalNum());
 			auditProecessDTO.setAmount(declare.getTotalMoney());
 			// 绑定审核类型
@@ -3263,10 +3270,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			if (!financeProcess.isSuccess()) {
 				throw new SecurityException("操作失败,请联系管理员");
 			}
+			declare.setTaskWhetherAdopt("审核提交");
+			baseMapper.updateById(declare);
+			return declare;
 		}
-		declare.setTaskWhetherAdopt("审核提交");
-		baseMapper.updateById(declare);
-		return declare;
 	}
 
 	@Override
@@ -3291,7 +3298,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public R passCheckRW(Long id) {
+	public R<PjOrder> passCheckRW(Long id) {
 		PjOrder pjOrder = baseMapper.selectById(id);
 		if (OrderTypeEnum.SCRW.getType().equals(pjOrder.getGenerateTask())) {
 			throw new RuntimeException("订单数据已生成出库,请刷新数据重新操作!");
@@ -3807,6 +3814,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				if (order.getGoodsTotalNum().compareTo(new BigDecimal(1)) == 0) {//只有一条轮胎加5元运费
 					order.setTotalMoney(totalMoney.add(new BigDecimal(5)));
 					order.setFreight(new BigDecimal(5));
+				} else {
+					order.setFreight(new BigDecimal(0));
 				}
 				//毛利
 				order.setGrossProfit(order.getOrderItemsList().stream().map(PjOrderItems::getGrossProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -4201,6 +4210,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					.in(PjProductLaunch::getGoodsId, goodsId);
 				List<PjProductLaunch> launchList = productLaunchService.list(queryWrapper);
 				itemsList.forEach(e -> {
+					if (ObjectUtils.isNull(e.getRebatePrice())) {
+						throw new RuntimeException("获取数据失败,请先保存");
+					}
+					if (ObjectUtils.isNull(e.getCostprie())) {
+						throw new RuntimeException("获取数据失败,请先保存");
+					}
 					if (ObjectUtil.isNotEmpty(launchList)) {
 						PjProductLaunch pjProductLaunch = launchList.stream().filter(i -> i.getGoodsId().equals(e.getGoodsId())).findFirst().orElse(null);
 						if (pjProductLaunch != null) {
@@ -4756,27 +4771,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
 			.eq(PjAuditPathsActs::getActId, 1106);
 		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
-		//获取审批信息
-		PjAuditPathsActs pjAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<PjAuditPathsActs>()
-			.eq(PjAuditPathsActs::getActId, 1106)
-			.eq(PjAuditPathsActs::getFidStatus, "status")
-			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
-			.eq(PjAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
-		Long pathId = pjAuditPathsActs.getPathId();
-		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
-			.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
-		auditProecessDTO.setTimes(1);
-		auditProecessDTO.setProcessType("退款审批");
-
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
 			throw new SecurityException("当前租户未查询到审批流配置");
 		} else {
-
+			//获取审批信息
+			Long pathId = pathsActs.getPathId();
+			auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
+				.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
+			auditProecessDTO.setTimes(1);
+			auditProecessDTO.setProcessType("退款审批");
 			if (CollectionUtils.isEmpty(auditPathsLevels)) {
 				throw new SecurityException("开启审批失败:未查询到审批信息");
 			}
-
 			auditProecessDTO.setOrderQuantity(declare.getGoodsTotalNum());
 			auditProecessDTO.setAmount(declare.getTotalMoney());
 			// 绑定审核类型
@@ -5293,9 +5300,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					.eq(AdvanceCharge::getTenantId, AuthUtil.getTenantId())
 					.eq(AdvanceCharge::getCorpId, declare.getFundingPartyId()));
 				if (advanceCharge != null) {
-					if (advanceCharge.getAdvancePaymentBalance().compareTo(order.getUseAdvanceChargeAmount()) < 0) {
+					if (advanceCharge.getAdvancePaymentBalance().compareTo(declare.getUseAdvanceChargeAmount()) < 0) {
 						throw new RuntimeException("预付款余额:" + advanceCharge.getAdvancePaymentBalance() + "小于本次使用预付款:"
-							+ order.getUseAdvanceChargeAmount());
+							+ declare.getUseAdvanceChargeAmount());
 					}
 					advanceCharge.setAdvancePaymentBalance(advanceCharge.getAdvancePaymentBalance().subtract(declare.getUseAdvanceChargeAmount()));
 					advanceCharge.setOutOverpaymen(advanceCharge.getOutOverpaymen().add(declare.getUseAdvanceChargeAmount()));
@@ -5334,22 +5341,16 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
 			.eq(PjAuditPathsActs::getActId, actId);
 		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
-		//获取审批信息
-		PjAuditPathsActs pjAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<PjAuditPathsActs>()
-			.eq(PjAuditPathsActs::getActId, actId)
-			.eq(PjAuditPathsActs::getFidStatus, "status")
-			.eq(PjAuditPathsActs::getSalesCompanyId, AuthUtil.getDeptId())
-			.eq(PjAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
-		Long pathId = pjAuditPathsActs.getPathId();
-		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
-			.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
-		auditProecessDTO.setTimes(1);
-		auditProecessDTO.setProcessType(processType);
-
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
 			throw new SecurityException("当前租户未查询到审批流配置");
 		} else {
+			//获取审批信息
+			Long pathId = pathsActs.getPathId();
+			auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<PjAuditPathsLevels>()
+				.eq(PjAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(PjAuditPathsLevels::getPathId, pathId));
+			auditProecessDTO.setTimes(1);
+			auditProecessDTO.setProcessType(processType);
 			if (CollectionUtils.isEmpty(auditPathsLevels)) {
 				throw new SecurityException("开启审批失败:未查询到审批信息");
 			}

+ 102 - 64
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java

@@ -966,6 +966,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				.apply("send_num > out_goods_total_ship_num")
 				.orderByAsc(PjOrderItems::getCreateTime)
 			);
+			BigDecimal amountSum = new BigDecimal("0.00");
 			if (!orderItemsList.isEmpty()) {
 				List<PjOrder> orders = orderList.stream().filter(e -> e.getWhetherRedeem().equals("0")).distinct().collect(Collectors.toList());
 				if (!orders.isEmpty()) {
@@ -977,24 +978,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					if (pjpfFunding.getAvailableAmount().compareTo(amount) < 0) {
 						throw new RuntimeException("剩余可用资金:" + pjpfFunding.getAvailableAmount() + "小于本次出库金额:" + amount + ",出库失败");
 					}
+					amountSum = amount;
 					pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().subtract(amount));
-					PjpfFundingItem item = new PjpfFundingItem();
-					item.setPid(pjpfFunding.getId());
-					item.setTenantId(AuthUtil.getTenantId());
-					item.setCreateTime(new Date());
-					item.setCreateUser(AuthUtil.getUserId());
-					item.setCreateUserName(AuthUtil.getUserName());
-					item.setCreateDept(pjpfFunding.getCreateDept());
-					item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-					item.setType("融资出库");
-					item.setSrcId(ship.getId());
-					item.setSrcNo(ship.getBillno());
-					item.setAmount(amount);
-					pjpfFundingItemService.save(item);
+//					pjpfFunding.setFundingAmount(pjpfFunding.getFundingAmount().add(amount));
 				}
 			}
 			List<FinancingShipItemDto> allList = new ArrayList<>();
 			List<ShipItemsRecord> recordList = new ArrayList<>();
+			List<PjOrderItems> orderItemList1 = new ArrayList<>();
 			for (PjShipItems shipItems : shipItemsList) {
 				if (ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(shipItems.getBrandName())) {
 					BigDecimal number = shipItems.getSendNum();
@@ -1044,6 +1035,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 							}
 							mapList.add(financingShipItemDto);
 							recordList.add(shipItemsRecord);
+							orderItemList1.add(orderItems1);
 						}
 					}
 					if (!mapList.isEmpty()) {
@@ -1061,13 +1053,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			if (!recordList.isEmpty()) {
 				shipItemsRecordService.saveBatch(recordList);
 			}
-			orderItemsService.updateBatchById(orderItemsList);
-			if (!orderItemsList.isEmpty()) {
+			orderItemsService.updateBatchById(orderItemList1);
+			if (!orderItemList1.isEmpty()) {
 				BigDecimal bondAmountSum = new BigDecimal("0.00");
 				BigDecimal fundingAmountSum = new BigDecimal("0.00");
 				BigDecimal availableAmountSum = new BigDecimal("0.00");
 				for (PjOrder items : orderList) {
-					List<PjOrderItems> pjOrderItems = orderItemsList.stream().filter(e -> items.getId().equals(e.getPid()))
+					List<PjOrderItems> pjOrderItems = orderItemList1.stream().filter(e -> items.getId().equals(e.getPid()))
 						.collect(Collectors.toList());
 					if (!pjOrderItems.isEmpty()) {
 						items.setOutGoodsTotalShipNum(items.getOutGoodsTotalShipNum().add(pjOrderItems.stream().map(PjOrderItems::getOutGoodsTotalShipNum)
@@ -1144,9 +1136,25 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				pjpfFunding.setPaidAlreadyBondAmount(bondAmountSum);
 				pjpfFunding.setBondAmount(bondAmountSum);
 				pjpfFunding.setAmount(pjpfFunding.getSurplusFundingAmount().add(pjpfFunding.getBondAmount()));
+				pjpfFunding.setFundingAmount(pjpfFunding.getFundingAmount().add(amountSum.subtract(availableAmountSum)));
 				pjpfFunding.setProportion(pjpfFunding.getBondAmount().divide(pjpfFunding.getAmount(), MathContext.DECIMAL32)
 					.setScale(2, RoundingMode.HALF_UP));
 				pjpfFundingService.updateById(pjpfFunding);
+				PjpfFundingItem item = new PjpfFundingItem();
+				item.setPid(pjpfFunding.getId());
+				item.setTenantId(AuthUtil.getTenantId());
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				item.setCreateDept(pjpfFunding.getCreateDept());
+				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+				item.setType("融资出库");
+				item.setSrcId(ship.getId());
+				item.setSrcNo(ship.getBillno());
+				item.setAmount(new BigDecimal("0.00").subtract(amountSum));
+				item.setFundingAmount(new BigDecimal("0.00").subtract(amountSum).add(availableAmountSum));
+				item.setBondAmount(new BigDecimal("0.00").subtract(availableAmountSum));
+				pjpfFundingItemService.save(item);
 				for (PjShipItems shipItems : shipItemsList) {
 					if (ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(shipItems.getBrandName())) {
 						List<PjOrderItems> orderItems = pjOrderItemsList.stream().filter(e -> e.getId().equals(shipItems.getSrcItemId())).collect(Collectors.toList());
@@ -1373,6 +1381,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				.eq(PjOrder::getIsDeleted, 0)
 				.eq(PjOrder::getWhetherFinancing, "1")
 				.eq(PjOrder::getBsType, "RZCG")
+				.orderByAsc(PjOrder::getBusinesDate)
 			);
 			List<Long> ordIds = orderList.stream().map(PjOrder::getId).collect(Collectors.toList());
 			List<PjOrderItems> orderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
@@ -1381,7 +1390,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				.eq(PjOrderItems::getBizType, "RZCG")
 				.in(PjOrderItems::getPid, ordIds)
 				.in(PjOrderItems::getId, financingShipItemDtoList.stream().map(FinancingShipItemDto::getId).filter(Objects::nonNull)
-					.distinct().collect(Collectors.toList())));
+					.distinct().collect(Collectors.toList()))
+				.orderByAsc(PjOrderItems::getCreateTime)
+			);
 			for (PjOrderItems items : orderItemsList) {
 				FinancingShipItemDto pjOrderItems = financingShipItemDtoList.stream().filter(e -> e.getId().equals(items.getId())).findFirst().orElse(null);
 				if (pjOrderItems != null) {
@@ -1393,34 +1404,21 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			BigDecimal amount = itemsList.stream().filter(e -> ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(e.getBrandName()))
 				.map(PjShipItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 			pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().add(amount));
-			PjpfFundingItem item = new PjpfFundingItem();
-			item.setPid(pjpfFunding.getId());
-			item.setTenantId(AuthUtil.getTenantId());
-			item.setCreateTime(new Date());
-			item.setCreateUser(AuthUtil.getUserId());
-			item.setCreateUserName(AuthUtil.getUserName());
-			item.setCreateDept(pjpfFunding.getCreateDept());
-			item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-			item.setType("撤销出库");
-			item.setSrcId(ship.getId());
-			item.setSrcNo(ship.getBillno());
-			item.setAmount(amount);
-			pjpfFundingItemService.save(item);
 			BigDecimal bondAmountSum = new BigDecimal("0.00");
 			BigDecimal fundingAmountSum = new BigDecimal("0.00");
 			BigDecimal availableAmountSum = new BigDecimal("0.00");
 			List<Long> orderIdsList = financingShipItemDtoList.stream().map(FinancingShipItemDto::getPid).filter(Objects::nonNull)
 				.distinct().collect(Collectors.toList());
 			for (PjOrder items : orderList) {
+				List<PjOrderItems> pjOrderItems = orderItemsList.stream().filter(e -> items.getId().equals(e.getPid()))
+					.collect(Collectors.toList());
+				if (!pjOrderItems.isEmpty()) {
+					items.setOutGoodsTotalShipNum(pjOrderItems.stream().map(PjOrderItems::getOutGoodsTotalShipNum)
+						.reduce(BigDecimal.ZERO, BigDecimal::add));
+					items.setOutGoodsTotalShipAmount(pjOrderItems.stream().map(PjOrderItems::getOutGoodsTotalShipAmount)
+						.reduce(BigDecimal.ZERO, BigDecimal::add));
+				}
 				if (orderIdsList.contains(items.getId())) {
-					List<PjOrderItems> pjOrderItems = orderItemsList.stream().filter(e -> items.getId().equals(e.getPid()))
-						.collect(Collectors.toList());
-					if (!pjOrderItems.isEmpty()) {
-						items.setOutGoodsTotalShipNum(pjOrderItems.stream().map(PjOrderItems::getOutGoodsTotalShipNum)
-							.reduce(BigDecimal.ZERO, BigDecimal::add));
-						items.setOutGoodsTotalShipAmount(pjOrderItems.stream().map(PjOrderItems::getOutGoodsTotalShipAmount)
-							.reduce(BigDecimal.ZERO, BigDecimal::add));
-					}
 					if (!"1".equals(items.getWhetherRedeem())) {
 						Date currentDate = new Date();
 						Calendar calendar = Calendar.getInstance();
@@ -1429,6 +1427,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 						Date thirtyDayAgo = calendar.getTime();
 
 						BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
+						if (new BigDecimal("0.00").compareTo(subAmount) == 0) {
+							subAmount = items.getGoodsTotalShipAmount();
+						}
 						List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getItemId).collect(Collectors.toList());
 						List<PjShipItems> shipItems = new ArrayList<>();
 						if (!itemIdList.isEmpty()) {
@@ -1492,6 +1493,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 						calendar.add(Calendar.DAY_OF_MONTH, -60);
 						Date thirtyDayAgo = calendar.getTime();
 						BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
+						if (new BigDecimal("0.00").compareTo(subAmount) == 0) {
+							subAmount = items.getGoodsTotalShipAmount();
+						}
 						List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getId).collect(Collectors.toList());
 						List<PjShipItems> shipItems = new ArrayList<>();
 						if (!itemIdList.isEmpty()) {
@@ -1557,9 +1561,25 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			pjpfFunding.setPaidAlreadyBondAmount(bondAmountSum);
 			pjpfFunding.setBondAmount(bondAmountSum);
 			pjpfFunding.setAmount(pjpfFunding.getSurplusFundingAmount().add(pjpfFunding.getBondAmount()));
+			pjpfFunding.setFundingAmount(pjpfFunding.getFundingAmount().subtract(amount.add(availableAmountSum)));
 			pjpfFunding.setProportion(pjpfFunding.getBondAmount().divide(pjpfFunding.getAmount(), MathContext.DECIMAL32)
 				.setScale(2, RoundingMode.HALF_UP));
 			pjpfFundingService.updateById(pjpfFunding);
+			PjpfFundingItem item = new PjpfFundingItem();
+			item.setPid(pjpfFunding.getId());
+			item.setTenantId(AuthUtil.getTenantId());
+			item.setCreateTime(new Date());
+			item.setCreateUser(AuthUtil.getUserId());
+			item.setCreateUserName(AuthUtil.getUserName());
+			item.setCreateDept(pjpfFunding.getCreateDept());
+			item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+			item.setType("撤销出库");
+			item.setSrcId(ship.getId());
+			item.setSrcNo(ship.getBillno());
+			item.setAmount(amount);
+			item.setFundingAmount(amount.add(availableAmountSum));
+			item.setBondAmount(availableAmountSum.abs());
+			pjpfFundingItemService.save(item);
 		}
 		//生成出库工单历史记录
 		saveHistory(ship.getId(), OrderTypeEnum.TOBESHIPPEDOUT.getType());
@@ -2080,19 +2100,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			BigDecimal amount = shipItemsList.stream().filter(e -> ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(e.getBrandName()))
 				.map(PjShipItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 			pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().add(amount));
-			PjpfFundingItem item = new PjpfFundingItem();
-			item.setPid(pjpfFunding.getId());
-			item.setTenantId(AuthUtil.getTenantId());
-			item.setCreateTime(new Date());
-			item.setCreateUser(AuthUtil.getUserId());
-			item.setCreateUserName(AuthUtil.getUserName());
-			item.setCreateDept(pjpfFunding.getCreateDept());
-			item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-			item.setType("融资销售退货-入库确认");
-			item.setSrcId(ship.getId());
-			item.setSrcNo(ship.getBillno());
-			item.setAmount(amount);
-			pjpfFundingItemService.save(item);
 			BigDecimal bondAmountSum = new BigDecimal("0.00");
 			BigDecimal fundingAmountSum = new BigDecimal("0.00");
 			BigDecimal availableAmountSum = new BigDecimal("0.00");
@@ -2116,6 +2123,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 						Date thirtyDayAgo = calendar.getTime();
 
 						BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
+						if (new BigDecimal("0.00").compareTo(subAmount) == 0) {
+							subAmount = items.getGoodsTotalShipAmount();
+						}
 						List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getItemId).collect(Collectors.toList());
 						List<PjShipItems> shipItems = new ArrayList<>();
 						if (!itemIdList.isEmpty()) {
@@ -2179,6 +2189,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 						calendar.add(Calendar.DAY_OF_MONTH, -60);
 						Date thirtyDayAgo = calendar.getTime();
 						BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
+						if (new BigDecimal("0.00").compareTo(subAmount) == 0) {
+							subAmount = items.getGoodsTotalShipAmount();
+						}
 						List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getId).collect(Collectors.toList());
 						List<PjShipItems> shipItems = new ArrayList<>();
 						if (!itemIdList.isEmpty()) {
@@ -2244,9 +2257,25 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			pjpfFunding.setPaidAlreadyBondAmount(bondAmountSum);
 			pjpfFunding.setBondAmount(bondAmountSum);
 			pjpfFunding.setAmount(pjpfFunding.getSurplusFundingAmount().add(pjpfFunding.getBondAmount()));
+			pjpfFunding.setFundingAmount(pjpfFunding.getFundingAmount().subtract(amount.add(availableAmountSum)));
 			pjpfFunding.setProportion(pjpfFunding.getBondAmount().divide(pjpfFunding.getAmount(), MathContext.DECIMAL32)
 				.setScale(2, RoundingMode.HALF_UP));
 			pjpfFundingService.updateById(pjpfFunding);
+			PjpfFundingItem item = new PjpfFundingItem();
+			item.setPid(pjpfFunding.getId());
+			item.setTenantId(AuthUtil.getTenantId());
+			item.setCreateTime(new Date());
+			item.setCreateUser(AuthUtil.getUserId());
+			item.setCreateUserName(AuthUtil.getUserName());
+			item.setCreateDept(pjpfFunding.getCreateDept());
+			item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+			item.setType("融资销售退货-入库确认");
+			item.setSrcId(ship.getId());
+			item.setSrcNo(ship.getBillno());
+			item.setAmount(amount);
+			item.setBondAmount(availableAmountSum.abs());
+			item.setFundingAmount(amount.add(availableAmountSum));
+			pjpfFundingItemService.save(item);
 		}
 
 		return R.data(ship);
@@ -2692,6 +2721,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				.apply("send_num > out_goods_total_ship_num")
 				.orderByAsc(PjOrderItems::getCreateTime)
 			);
+			BigDecimal amountSum = new BigDecimal("0.00");
 			if (!orderItemsList.isEmpty()) {
 				if (pjpfFunding.getBondAmount().compareTo(pjpfFunding.getPaidAlreadyBondAmount()) > 0) {
 					throw new RuntimeException("已缴保证金不足,出库失败");
@@ -2701,20 +2731,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				if (pjpfFunding.getAvailableAmount().compareTo(amount) < 0) {
 					throw new RuntimeException("剩余可用资金:" + pjpfFunding.getAvailableAmount() + "小于本次出库金额:" + amount + ",出库失败");
 				}
+				amountSum = amount;
 				pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().subtract(amount));
-				PjpfFundingItem item = new PjpfFundingItem();
-				item.setPid(pjpfFunding.getId());
-				item.setTenantId(AuthUtil.getTenantId());
-				item.setCreateTime(new Date());
-				item.setCreateUser(AuthUtil.getUserId());
-				item.setCreateUserName(AuthUtil.getUserName());
-				item.setCreateDept(pjpfFunding.getCreateDept());
-				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
-				item.setType("融资销售退货-撤销入库");
-				item.setSrcId(ship.getId());
-				item.setSrcNo(ship.getBillno());
-				item.setAmount(amount);
-				pjpfFundingItemService.save(item);
+				pjpfFunding.setFundingAmount(pjpfFunding.getFundingAmount().add(amount));
 			}
 			List<FinancingShipItemDto> allList = new ArrayList<>();
 			List<ShipItemsRecord> recordList = new ArrayList<>();
@@ -2786,6 +2805,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			}
 			orderItemsService.updateBatchById(orderItemsList);
 			if (!orderItemsList.isEmpty()) {
+				BigDecimal thisAmount = pjpfFunding.getFundingAmount();
 				BigDecimal bondAmountSum = new BigDecimal("0.00");
 				BigDecimal fundingAmountSum = new BigDecimal("0.00");
 				BigDecimal availableAmountSum = new BigDecimal("0.00");
@@ -2830,6 +2850,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 								items.setBondAmount(bondAmount);
 								bondAmountSum = bondAmountSum.add(bondAmount);
 								availableAmountSum = availableAmountSum.add(availableAmount);
+								thisAmount = thisAmount.subtract(availableAmount);
 							}
 							if (fundingAmount.compareTo(items.getFundingAmount()) <= 0) {
 								items.setFundingAmount(fundingAmount);
@@ -2855,6 +2876,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 								items.setBondAmount(bondAmount);
 								bondAmountSum = bondAmountSum.add(bondAmount);
 								availableAmountSum = availableAmountSum.add(availableAmount);
+								thisAmount = thisAmount.subtract(availableAmount);
 							}
 							if (fundingAmount.compareTo(items.getFundingAmount()) <= 0) {
 								items.setFundingAmount(fundingAmount);
@@ -2869,9 +2891,25 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				pjpfFunding.setPaidAlreadyBondAmount(bondAmountSum);
 				pjpfFunding.setBondAmount(bondAmountSum);
 				pjpfFunding.setAmount(pjpfFunding.getSurplusFundingAmount().add(pjpfFunding.getBondAmount()));
+				pjpfFunding.setFundingAmount(thisAmount);
 				pjpfFunding.setProportion(pjpfFunding.getBondAmount().divide(pjpfFunding.getAmount(), MathContext.DECIMAL32)
 					.setScale(2, RoundingMode.HALF_UP));
 				pjpfFundingService.updateById(pjpfFunding);
+				PjpfFundingItem item = new PjpfFundingItem();
+				item.setPid(pjpfFunding.getId());
+				item.setTenantId(AuthUtil.getTenantId());
+				item.setCreateTime(new Date());
+				item.setCreateUser(AuthUtil.getUserId());
+				item.setCreateUserName(AuthUtil.getUserName());
+				item.setCreateDept(pjpfFunding.getCreateDept());
+				item.setCreateDeptName(pjpfFunding.getCreateDeptName());
+				item.setType("融资销售退货-撤销入库");
+				item.setSrcId(ship.getId());
+				item.setSrcNo(ship.getBillno());
+				item.setAmount(amountSum);
+				item.setBondAmount(new BigDecimal("0.00").subtract(availableAmountSum));
+				item.setFundingAmount(new BigDecimal("0.00").subtract(amountSum).add(availableAmountSum));
+				pjpfFundingItemService.save(item);
 			}
 		}
 		return R.data(ship);

+ 9 - 3
blade-service/blade-school/src/main/java/org/springblade/school/controller/WxUnionIdOpenIdController.java

@@ -57,14 +57,16 @@ public class WxUnionIdOpenIdController {
 
 			if (ObjectUtil.isNotEmpty(unionId)) {
 				//根据unionId查询数据库是否存在
-				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"266504");
 				if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {//不存在 新增
 					WxUnionIdOpenId item = new WxUnionIdOpenId();
 					item.setOpenId(openId);
 					item.setUnionId(unionId);
+					item.setTenantId("266504");
 					wxUnionIdOpenIdClient.insertWxUO(item);
 				} else {//存在 则更新
 					wxUnionIdOpenId.setOpenId(openId);
+					wxUnionIdOpenId.setTenantId("266504");
 					wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 				}
 			}
@@ -104,14 +106,16 @@ public class WxUnionIdOpenIdController {
 
 			if (ObjectUtil.isNotEmpty(unionId)) {
 				//根据unionId查询数据库是否存在
-				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"504978");
 				if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {//不存在 新增
 					WxUnionIdOpenId item = new WxUnionIdOpenId();
 					item.setOpenId(openId);
 					item.setUnionId(unionId);
+					item.setTenantId("504978");
 					wxUnionIdOpenIdClient.insertWxUO(item);
 				} else {//存在 则更新
 					wxUnionIdOpenId.setOpenId(openId);
+					wxUnionIdOpenId.setTenantId("504978");
 					wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 				}
 			}
@@ -153,14 +157,16 @@ public class WxUnionIdOpenIdController {
 
 			if (ObjectUtil.isNotEmpty(unionId)) {
 				//根据unionId查询数据库是否存在
-				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"792368");
 				if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {
 					WxUnionIdOpenId item = new WxUnionIdOpenId();
 					item.setOpenId(openId);
 					item.setUnionId(unionId);
+					item.setTenantId("792368");
 					wxUnionIdOpenIdClient.insertWxUO(item);
 				} else {//存在 则更新
 					wxUnionIdOpenId.setOpenId(openId);
+					wxUnionIdOpenId.setTenantId("792368");
 					wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 				}
 			}

+ 6 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/WxUnionIdOpenIdClient.java

@@ -19,8 +19,12 @@ public class WxUnionIdOpenIdClient implements IWxUnionIdOpenIdClient {
 	private final IWxUnionIdOpenIdService wxUnionIdOpenIdService;
 
 	@Override
-	public WxUnionIdOpenId getWxUnionId(String unionId) {
-		return wxUnionIdOpenIdService.getOne(new QueryWrapper<WxUnionIdOpenId>().eq("union_id", unionId));
+	public WxUnionIdOpenId getWxUnionId(String unionId, String tenantId) {
+		return wxUnionIdOpenIdService.getOne(new QueryWrapper<WxUnionIdOpenId>()
+			.eq("union_id", unionId)
+			.eq("tenant_id", tenantId)
+			.eq("is_deleted", 0)
+		);
 	}
 
 	@Override

+ 12 - 4
blade-service/blade-weChat/src/main/java/org/springblade/weChat/officialAccount/WxUnionIdOpenIdController.java

@@ -57,14 +57,16 @@ public class WxUnionIdOpenIdController {
 
 			if (ObjectUtil.isNotEmpty(unionId)) {
 				//根据unionId查询数据库是否存在
-				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+				WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"266504");
 				if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {//不存在 新增
 					WxUnionIdOpenId item = new WxUnionIdOpenId();
 					item.setOpenId(openId);
 					item.setUnionId(unionId);
+					item.setTenantId("266504");
 					wxUnionIdOpenIdClient.insertWxUO(item);
 				} else {//存在 则更新
 					wxUnionIdOpenId.setOpenId(openId);
+					wxUnionIdOpenId.setTenantId("266504");
 					wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 				}
 			}
@@ -104,14 +106,16 @@ public class WxUnionIdOpenIdController {
 
 		if (ObjectUtil.isNotEmpty(unionId)) {
 			//根据unionId查询数据库是否存在
-			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"504978");
 			if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {//不存在 新增
 				WxUnionIdOpenId item = new WxUnionIdOpenId();
 				item.setOpenId(openId);
 				item.setUnionId(unionId);
+				item.setTenantId("504978");
 				wxUnionIdOpenIdClient.insertWxUO(item);
 			} else {//存在 则更新
 				wxUnionIdOpenId.setOpenId(openId);
+				wxUnionIdOpenId.setTenantId("504978");
 				wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 			}
 		}
@@ -153,14 +157,16 @@ public class WxUnionIdOpenIdController {
 
 		if (ObjectUtil.isNotEmpty(unionId)) {
 			//根据unionId查询数据库是否存在
-			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,"792368");
 			if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {
 				WxUnionIdOpenId item = new WxUnionIdOpenId();
 				item.setOpenId(openId);
 				item.setUnionId(unionId);
+				item.setTenantId("792368");
 				wxUnionIdOpenIdClient.insertWxUO(item);
 			} else {//存在 则更新
 				wxUnionIdOpenId.setOpenId(openId);
+				wxUnionIdOpenId.setTenantId("792368");
 				wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 			}
 		}
@@ -211,14 +217,16 @@ public class WxUnionIdOpenIdController {
 
 		if (ObjectUtil.isNotEmpty(unionId)) {
 			//根据unionId查询数据库是否存在
-			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId);
+			WxUnionIdOpenId wxUnionIdOpenId = wxUnionIdOpenIdClient.getWxUnionId(unionId,request.getParameter("tenantId"));
 			if (ObjectUtil.isEmpty(wxUnionIdOpenId)) {
 				WxUnionIdOpenId item = new WxUnionIdOpenId();
 				item.setOpenId(openId);
 				item.setUnionId(unionId);
+				item.setTenantId(request.getParameter("tenantId"));
 				wxUnionIdOpenIdClient.insertWxUO(item);
 			} else {//存在 则更新
 				wxUnionIdOpenId.setOpenId(openId);
+				wxUnionIdOpenId.setTenantId(request.getParameter("tenantId"));
 				wxUnionIdOpenIdClient.updateWxUO(wxUnionIdOpenId);
 			}
 		}