Browse Source

2025年2月28日17:21:32

纪新园 1 year ago
parent
commit
e972907288
22 changed files with 1143 additions and 156 deletions
  1. 34 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/dto/ExpenseSettlementDTO.java
  2. 70 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/ExpenseSettlement.java
  3. 22 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/OrderItem.java
  4. 11 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/feign/ILandClient.java
  5. 36 0
      blade-service-api/blade-land-api/src/main/java/org/springblade/land/vo/ExpenseSettlementVO.java
  6. 136 137
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vojo/Items.java
  7. 143 0
      blade-service/blade-land/src/main/java/org/springblade/land/controller/ExpenseSettlementController.java
  8. 20 0
      blade-service/blade-land/src/main/java/org/springblade/land/controller/OrderFeeController.java
  9. 21 8
      blade-service/blade-land/src/main/java/org/springblade/land/controller/OrderItemController.java
  10. 42 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/ExpenseSettlementMapper.java
  11. 37 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/ExpenseSettlementMapper.xml
  12. 41 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/IExpenseSettlementService.java
  13. 41 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ExpenseSettlementServiceImpl.java
  14. 8 3
      blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/InOutStorageServiceImpl.java
  15. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  16. 4 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/mapper/SharePutOnShelvesMapper.java
  17. 3 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/mapper/SharePutOnShelvesMapper.xml
  18. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/service/ISharePutOnShelvesService.java
  19. 4 4
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/service/impl/SharePutOnShelvesServiceImpl.java
  20. 261 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/LandExpenseSettlementController.java
  21. 6 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/ISettlementService.java
  22. 200 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java

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

+ 70 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/ExpenseSettlement.java

@@ -0,0 +1,70 @@
+/*
+ *      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.land.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * VIEW实体类
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+@Data
+@TableName("land_expense_settlement")
+@ApiModel(value = "ExpenseSettlement对象", description = "VIEW")
+public class ExpenseSettlement implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long feeId;
+	private String feeName;
+	private Long corpId;
+	private String corpName;
+	private Integer quantity;
+	private String unit;
+	private BigDecimal price;
+	private Long fleetId;
+	private String fleetName;
+	private String plateNo;
+	private String srcOrderNo;
+	private String srcBillNo;
+	private String billNo;
+	private String currency;
+	private BigDecimal amount;
+	private BigDecimal settlementAmount;
+	private Long dc;
+	private Integer isDeleted;
+	private Long srcFeesId;
+	private Long srcParentId;
+	private String srcType;
+	private String ctnType;
+	private Date srcDate;
+
+	private String tenantId;
+
+
+}

+ 22 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/entity/OrderItem.java

@@ -464,4 +464,26 @@ public class OrderItem implements Serializable {
 	@TableField(exist = false)
 	private List<OrderEstimate> orderEstimateList;
 
+	/**
+	 * 结算金额-收
+	 */
+	@ApiModelProperty(value = "结算金额-收")
+	private BigDecimal settlementAmountD;
+	/**
+	 * 结算时间-收
+	 */
+	@ApiModelProperty(value = "结算时间-收")
+	private Date settlementDateD;
+
+	/**
+	 * 结算金额-付
+	 */
+	@ApiModelProperty(value = "结算金额-付")
+	private BigDecimal settlementAmountC;
+	/**
+	 * 结算时间-付
+	 */
+	@ApiModelProperty(value = "结算时间-付")
+	private Date settlementDateC;
+
 }

+ 11 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/feign/ILandClient.java

@@ -38,4 +38,15 @@ public interface ILandClient {
 	@PostMapping("/order-fee/update")
 	R updateOrderFee( @RequestBody OrderFee orderFee);
 
+	@PostMapping("/order-item/selectOrderItems")
+    List<OrderItem> selectOrderItems(@RequestBody List<Long> orderItemsIdList);
+
+	@PostMapping("/order-fee/selectOrderFee")
+	List<OrderFee> selectOrderFee(@RequestBody List<Long> feesItemsIdList);
+
+	@PostMapping("/order-item/updateOrderItemsList")
+	R updateOrderItemsList(@RequestBody List<OrderItem> orderItemsNew);
+
+	@PostMapping("/order-fee/updateOrderFeeList")
+	R updateOrderFeeList(@RequestBody List<OrderFee> orderFeeNew);
 }

+ 36 - 0
blade-service-api/blade-land-api/src/main/java/org/springblade/land/vo/ExpenseSettlementVO.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.land.vo;
+
+import org.springblade.land.entity.ExpenseSettlement;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * VIEW视图实体类
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ExpenseSettlementVO对象", description = "VIEW")
+public class ExpenseSettlementVO extends ExpenseSettlement {
+	private static final long serialVersionUID = 1L;
+
+}

+ 136 - 137
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vojo/Items.java

@@ -16,18 +16,17 @@
  */
 package org.springblade.finance.vojo;
 
-import java.math.BigDecimal;
-
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 结算明细实体类
@@ -41,142 +40,142 @@ import io.swagger.annotations.ApiModelProperty;
 public class Items implements Serializable {
 
 	private static final long serialVersionUID = 1L;
-    @TableId
+	@TableId
 	private Long id;
 	/**
-	* 主表主键
-	*/
-		@ApiModelProperty(value = "主表主键")
-		private Long pid;
-	/**
-	* 排序
-	*/
-		@ApiModelProperty(value = "排序")
-		private Integer sort;
-	/**
-	* 费用id
-	*/
-		@ApiModelProperty(value = "费用id")
-		private Long itemId;
-	/**
-	* 客户id
-	*/
-		@ApiModelProperty(value = "客户id")
-		private Long corpId;
-	/**
-	* 数量
-	*/
-		@ApiModelProperty(value = "数量")
-		private BigDecimal quantity;
-	/**
-	* 计费单位
-	*/
-		@ApiModelProperty(value = "计费单位")
-		private String unit;
-	/**
-	* 单价
-	*/
-		@ApiModelProperty(value = "单价")
-		private BigDecimal price;
-	/**
-	* 来源订单号
-	*/
-		@ApiModelProperty(value = "来源订单号")
-		@TableField("src_orderNo")
+	 * 主表主键
+	 */
+	@ApiModelProperty(value = "主表主键")
+	private Long pid;
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+	/**
+	 * 费用id
+	 */
+	@ApiModelProperty(value = "费用id")
+	private Long itemId;
+	/**
+	 * 客户id
+	 */
+	@ApiModelProperty(value = "客户id")
+	private Long corpId;
+	/**
+	 * 数量
+	 */
+	@ApiModelProperty(value = "数量")
+	private BigDecimal quantity;
+	/**
+	 * 计费单位
+	 */
+	@ApiModelProperty(value = "计费单位")
+	private String unit;
+	/**
+	 * 单价
+	 */
+	@ApiModelProperty(value = "单价")
+	private BigDecimal price;
+	/**
+	 * 来源订单号
+	 */
+	@ApiModelProperty(value = "来源订单号")
+	@TableField("src_orderNo")
 	private String srcOrderno;
 	/**
-	* 金额
-	*/
-		@ApiModelProperty(value = "金额")
-		@TableField("Amount")
+	 * 金额
+	 */
+	@ApiModelProperty(value = "金额")
+	@TableField("Amount")
 	private BigDecimal amount;
 	/**
-	* 币别
-	*/
-		@ApiModelProperty(value = "币别")
-		private String currency;
-	/**
-	* 汇率
-	*/
-		@ApiModelProperty(value = "汇率")
-		private BigDecimal exchangeRate;
-	/**
-	* 税率
-	*/
-		@ApiModelProperty(value = "税率")
-		private BigDecimal taxRate;
-	/**
-	* 核销金额
-	*/
-		@ApiModelProperty(value = "核销金额")
-		private BigDecimal settlmentAmount;
-	/**
-	* 备注
-	*/
-		@ApiModelProperty(value = "备注")
-		private String remarks;
-	/**
-	* 版本
-	*/
-		@ApiModelProperty(value = "版本")
-		private String version;
-	/**
-	* 创建人
-	*/
-		@ApiModelProperty(value = "创建人")
-		private Long createUser;
-	/**
-	* 创建部门
-	*/
-		@ApiModelProperty(value = "创建部门")
-		private Long createDept;
-	/**
-	* 创建时间
-	*/
-		@ApiModelProperty(value = "创建时间")
-		private Date createTime;
-	/**
-	* 修改人
-	*/
-		@ApiModelProperty(value = "修改人")
-		private Long updateUser;
-	/**
-	* 修改时间
-	*/
-		@ApiModelProperty(value = "修改时间")
-		private Date updateTime;
-	/**
-	* 状态(0 正常 1停用)
-	*/
-		@ApiModelProperty(value = "状态(0 正常 1停用)")
-		private Integer status;
-	/**
-	* 是否已删除(0 否 1是)
-	*/
-		@ApiModelProperty(value = "是否已删除(0 否 1是)")
-		@TableLogic
-		private Integer isDeleted;
-	/**
-	* 创建人姓名
-	*/
-		@ApiModelProperty(value = "创建人姓名")
-		private String createUserName;
-	/**
-	* 修改人姓名
-	*/
-		@ApiModelProperty(value = "修改人姓名")
-		private String updateUserName;
-
-		@ApiModelProperty(value = "租户id")
-		private String tenantId;
-
-
-		@ApiModelProperty(value = "参考号(进口和出口 主提单号)")
-		private String srcBillNo;
-
-
-		@ApiModelProperty(value = "付款类型: 采购 销售 收货 发货")
-		private String itemType;
+	 * 币别
+	 */
+	@ApiModelProperty(value = "币别")
+	private String currency;
+	/**
+	 * 汇率
+	 */
+	@ApiModelProperty(value = "汇率")
+	private BigDecimal exchangeRate;
+	/**
+	 * 税率
+	 */
+	@ApiModelProperty(value = "税率")
+	private BigDecimal taxRate;
+	/**
+	 * 核销金额
+	 */
+	@ApiModelProperty(value = "核销金额")
+	private BigDecimal settlmentAmount;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private Long createDept;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	@TableLogic
+	private Integer isDeleted;
+	/**
+	 * 创建人姓名
+	 */
+	@ApiModelProperty(value = "创建人姓名")
+	private String createUserName;
+	/**
+	 * 修改人姓名
+	 */
+	@ApiModelProperty(value = "修改人姓名")
+	private String updateUserName;
+
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+	@ApiModelProperty(value = "参考号(进口和出口 主提单号)")
+	private String srcBillNo;
+
+
+	@ApiModelProperty(value = "付款类型: 采购 销售 收货 发货")
+	private String itemType;
 
 	/**
 	 * 来源主表(业务模块 主表 id)

+ 143 - 0
blade-service/blade-land/src/main/java/org/springblade/land/controller/ExpenseSettlementController.java

@@ -0,0 +1,143 @@
+/*
+ *      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.land.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+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.secure.utils.AuthUtil;
+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.land.entity.ExpenseSettlement;
+import org.springblade.land.vo.ExpenseSettlementVO;
+import org.springblade.land.service.IExpenseSettlementService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * VIEW 控制器
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/expensesettlement")
+@Api(value = "VIEW", tags = "VIEW接口")
+public class ExpenseSettlementController extends BladeController {
+
+	private final IExpenseSettlementService expenseSettlementService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入expenseSettlement")
+	public R<ExpenseSettlement> detail(ExpenseSettlement expenseSettlement) {
+		ExpenseSettlement detail = expenseSettlementService.getOne(Condition.getQueryWrapper(expenseSettlement));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 VIEW
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入expenseSettlement")
+	public R<IPage<ExpenseSettlement>> list(ExpenseSettlement expenseSettlement, Query query) {
+		LambdaQueryWrapper<ExpenseSettlement> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(ExpenseSettlement::getIsDeleted,0)
+			.eq(ExpenseSettlement::getTenantId, AuthUtil.getTenantId())
+			.eq(ObjectUtils.isNotNull(expenseSettlement.getCorpId()),ExpenseSettlement::getCorpId,expenseSettlement.getCorpId())
+			.eq(ObjectUtils.isNotNull(expenseSettlement.getFeeId()),ExpenseSettlement::getFeeId,expenseSettlement.getFeeId())
+			.eq(ObjectUtils.isNotNull(expenseSettlement.getFleetId()),ExpenseSettlement::getFleetId,expenseSettlement.getFleetId())
+			.like(ObjectUtils.isNotNull(expenseSettlement.getPlateNo()),ExpenseSettlement::getPlateNo,expenseSettlement.getPlateNo())
+			.like(ObjectUtils.isNotNull(expenseSettlement.getSrcBillNo()),ExpenseSettlement::getSrcBillNo,expenseSettlement.getSrcBillNo())
+			.like(ObjectUtils.isNotNull(expenseSettlement.getSrcOrderNo()),ExpenseSettlement::getSrcOrderNo,expenseSettlement.getSrcOrderNo())
+			.like(ObjectUtils.isNotNull(expenseSettlement.getBillNo()),ExpenseSettlement::getBillNo,expenseSettlement.getBillNo())
+			.eq(ObjectUtils.isNotNull(expenseSettlement.getDc()),ExpenseSettlement::getDc,expenseSettlement.getDc())
+			.eq(ObjectUtils.isNotNull(expenseSettlement.getSrcType()),ExpenseSettlement::getSrcType,expenseSettlement.getSrcType())
+			.apply("amount - settlement_amount != 0")
+			;
+		IPage<ExpenseSettlement> pages = expenseSettlementService.page(Condition.getPage(query), lambdaQueryWrapper);
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 VIEW
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入expenseSettlement")
+	public R<IPage<ExpenseSettlementVO>> page(ExpenseSettlementVO expenseSettlement, Query query) {
+		IPage<ExpenseSettlementVO> pages = expenseSettlementService.selectExpenseSettlementPage(Condition.getPage(query), expenseSettlement);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 VIEW
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入expenseSettlement")
+	public R save(@Valid @RequestBody ExpenseSettlement expenseSettlement) {
+		return R.status(expenseSettlementService.save(expenseSettlement));
+	}
+
+	/**
+	 * 修改 VIEW
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入expenseSettlement")
+	public R update(@Valid @RequestBody ExpenseSettlement expenseSettlement) {
+		return R.status(expenseSettlementService.updateById(expenseSettlement));
+	}
+
+	/**
+	 * 新增或修改 VIEW
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入expenseSettlement")
+	public R submit(@Valid @RequestBody ExpenseSettlement expenseSettlement) {
+		return R.status(expenseSettlementService.saveOrUpdate(expenseSettlement));
+	}
+
+
+	/**
+	 * 删除 VIEW
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(expenseSettlementService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 20 - 0
blade-service/blade-land/src/main/java/org/springblade/land/controller/OrderFeeController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.land.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
@@ -29,6 +30,7 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.land.entity.OrderFee;
+import org.springblade.land.entity.OrderItem;
 import org.springblade.land.service.IOrderFeeService;
 import org.springblade.land.vo.OrderFeeVO;
 import org.springframework.web.bind.annotation.*;
@@ -194,4 +196,22 @@ public class OrderFeeController extends BladeController {
 		return R.data(orderFeeService.getById(id));
 	}
 
+	/**
+	 * 费用明细
+	 */
+	@PostMapping("/selectOrderFee")
+	public List<OrderFee> listReport(@RequestBody List<Long> feesItemsIdList) {
+		return orderFeeService.list(new LambdaQueryWrapper<OrderFee>()
+			.eq(OrderFee::getIsDeleted, 0)
+			.in(OrderFee::getId, feesItemsIdList));
+	}
+
+	/**
+	 * 费用明细
+	 */
+	@PostMapping("/updateOrderFeeList")
+	public R updateOrderFeeList(@RequestBody List<OrderFee> orderFeeNew) {
+		return R.data(orderFeeService.updateBatchById(orderFeeNew));
+	}
+
 }

+ 21 - 8
blade-service/blade-land/src/main/java/org/springblade/land/controller/OrderItemController.java

@@ -16,8 +16,8 @@
  */
 package org.springblade.land.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -26,11 +26,9 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.land.entity.OrderEstimate;
+import org.springblade.land.entity.OrderFee;
 import org.springblade.land.entity.OrderItem;
 import org.springblade.land.service.IOrderEstimateService;
 import org.springblade.land.service.IOrderItemService;
@@ -38,11 +36,7 @@ import org.springblade.land.vo.OrderItemVO;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
-import java.util.Objects;
 
 /**
  * 陆运订单明细表 控制器
@@ -293,4 +287,23 @@ public class OrderItemController extends BladeController {
 		return R.status(orderItemService.changeVehicle(orderItem));
 	}
 
+
+	/**
+	 * 明细
+	 */
+	@PostMapping("/selectOrderItems")
+	public List<OrderItem> listReport(@RequestBody List<Long> orderItemsIdList) {
+		return orderItemService.list(new LambdaQueryWrapper<OrderItem>()
+			.eq(OrderItem::getIsDeleted, 0)
+			.in(OrderItem::getId, orderItemsIdList));
+	}
+
+	/**
+	 * 费用明细
+	 */
+	@PostMapping("/updateOrderItemsList")
+	public R updateOrderItemsList(@RequestBody List<OrderItem> orderItemsNew) {
+		return R.data(orderItemService.updateBatchById(orderItemsNew));
+	}
+
 }

+ 42 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/ExpenseSettlementMapper.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.land.mapper;
+
+import org.springblade.land.entity.ExpenseSettlement;
+import org.springblade.land.vo.ExpenseSettlementVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * VIEW Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+public interface ExpenseSettlementMapper extends BaseMapper<ExpenseSettlement> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param expenseSettlement
+	 * @return
+	 */
+	List<ExpenseSettlementVO> selectExpenseSettlementPage(IPage page, ExpenseSettlementVO expenseSettlement);
+
+}

+ 37 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/ExpenseSettlementMapper.xml

@@ -0,0 +1,37 @@
+<?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.land.mapper.ExpenseSettlementMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="expenseSettlementResultMap" type="org.springblade.land.entity.ExpenseSettlement">
+        <result column="fee_id" property="feeId"/>
+        <result column="fee_name" property="feeName"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_name" property="corpName"/>
+        <result column="quantity" property="quantity"/>
+        <result column="unit" property="unit"/>
+        <result column="price" property="price"/>
+        <result column="fleet_id" property="fleetId"/>
+        <result column="fleet_name" property="fleetName"/>
+        <result column="plate_no" property="plateNo"/>
+        <result column="src_order_no" property="srcOrderNo"/>
+        <result column="src_bill_no" property="srcBillNo"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="currency" property="currency"/>
+        <result column="amount" property="amount"/>
+        <result column="settlement_amount" property="settlementAmount"/>
+        <result column="dc" property="dc"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="src_fees_id" property="srcFeesId"/>
+        <result column="src_parent_id" property="srcParentId"/>
+        <result column="src_type" property="srcType"/>
+        <result column="ctn_type" property="ctnType"/>
+        <result column="src_date" property="srcDate"/>
+    </resultMap>
+
+
+    <select id="selectExpenseSettlementPage" resultMap="expenseSettlementResultMap">
+        select * from land_expense_settlement where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/IExpenseSettlementService.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.land.service;
+
+import org.springblade.land.entity.ExpenseSettlement;
+import org.springblade.land.vo.ExpenseSettlementVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务类
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+public interface IExpenseSettlementService extends IService<ExpenseSettlement> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param expenseSettlement
+	 * @return
+	 */
+	IPage<ExpenseSettlementVO> selectExpenseSettlementPage(IPage<ExpenseSettlementVO> page, ExpenseSettlementVO expenseSettlement);
+
+}

+ 41 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ExpenseSettlementServiceImpl.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.land.service.impl;
+
+import org.springblade.land.entity.ExpenseSettlement;
+import org.springblade.land.vo.ExpenseSettlementVO;
+import org.springblade.land.mapper.ExpenseSettlementMapper;
+import org.springblade.land.service.IExpenseSettlementService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-02-28
+ */
+@Service
+public class ExpenseSettlementServiceImpl extends ServiceImpl<ExpenseSettlementMapper, ExpenseSettlement> implements IExpenseSettlementService {
+
+	@Override
+	public IPage<ExpenseSettlementVO> selectExpenseSettlementPage(IPage<ExpenseSettlementVO> page, ExpenseSettlementVO expenseSettlement) {
+		return page.setRecords(baseMapper.selectExpenseSettlementPage(page, expenseSettlement));
+	}
+
+}

+ 8 - 3
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/InOutStorageServiceImpl.java

@@ -252,11 +252,15 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			inStorage.setOutWeight(inStorage.getOutWeight().add(inOutStorage.getOutWeight()));
 			inStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
-			inStorage.setSurplusGoodsAmount(inStorage.getSurplusGoodsAmount().subtract(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice())));
+			inStorage.setSurplusGoodsAmount(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
 			inStorage.setUpdateTime(new Date());
 			inStorage.setUpdateUser(AuthUtil.getUserId());
 			inStorage.setUpdateUserName(AuthUtil.getUserName());
 			baseMapper.updateById(inStorage);
+
+			inOutStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
+			inOutStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
+			inOutStorage.setSurplusGoodsAmount(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
 			Bills bills = billsMapper.selectById(inOutStorage.getPid());
 			if (bills != null) {
 				BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
@@ -410,8 +414,8 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 		outStorage.setBillType("CK");
 		outStorage.setOutQuantity(inOutStorage.getQuantity().subtract(inOutStorage.getOutQuantity()));
 		outStorage.setOutWeight(inOutStorage.getNetWeight().subtract(inOutStorage.getOutWeight()));
-		outStorage.setSurplusQuantity(inOutStorage.getOutQuantity());
-		outStorage.setSurplusWeight(inOutStorage.getOutWeight());
+		outStorage.setSurplusQuantity(inOutStorage.getQuantity().subtract(inOutStorage.getOutQuantity()));
+		outStorage.setSurplusWeight(inOutStorage.getNetWeight().subtract(inOutStorage.getOutWeight()));
 		outStorage.setSurplusGoodsAmount(inOutStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
 		outStorage.setConfirmDispatchVehicles("0");
 		baseMapper.insert(outStorage);
@@ -419,6 +423,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			new BigDecimal("0.00").compareTo(inOutStorage.getSurplusWeight()) == 0) {
 			throw new RuntimeException("库存余额为零,生成失败");
 		}
+
 		baseMapper.updateById(inOutStorage);
 		return R.data(inOutStorage);
 	}

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

@@ -4252,7 +4252,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 		if (productLaunchList.isEmpty()) {
 			throw new RuntimeException("未查到对应商品信息");
 		}
-		List<SharePutOnShelves> sharePutOnShelvesSrcList = sharePutOnShelvesService.selectSharePutOnShelvesList(goodsNo, null, dept.getTenantId());
+		List<SharePutOnShelves> sharePutOnShelvesSrcList = sharePutOnShelvesService.selectSharePutOnShelvesList(goodsNo, null,null, dept.getTenantId());
 		List<PjProductLaunch> productLaunchListNew = new ArrayList<>();
 		List<SharePutOnShelves> sharePutOnShelvesSrcListNew = new ArrayList<>();
 		List<PjOrderItems> itemsList = new ArrayList<>();
@@ -4452,7 +4452,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 		if (productLaunchList.isEmpty()) {
 			throw new RuntimeException("未查到对应商品信息");
 		}
-		List<SharePutOnShelves> selectSharePutOnShelvesList = sharePutOnShelvesService.selectSharePutOnShelvesList(goodsNo, sharedCompanyName, null);
+		List<SharePutOnShelves> selectSharePutOnShelvesList = sharePutOnShelvesService.selectSharePutOnShelvesList(goodsNo, sharedCompanyName,null, null);
 		if (productLaunchList.isEmpty()) {
 			throw new RuntimeException("未查到对应商品信息");
 		}

+ 4 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/mapper/SharePutOnShelvesMapper.java

@@ -45,7 +45,10 @@ public interface SharePutOnShelvesMapper extends BaseMapper<SharePutOnShelves> {
 	int deleteBySharedId(@Param("ids")String ids);
 
 	@TenantIgnore
-    List<SharePutOnShelves> selectSharePutOnShelvesList(@Param("goodsNo")String goodsNo, @Param("salesCompanyName")String salesCompanyName,@Param("tenantId")String tenantId);
+    List<SharePutOnShelves> selectSharePutOnShelvesList(@Param("goodsNo")String goodsNo,
+														@Param("salesCompanyName")String salesCompanyName,
+														@Param("srcSalesCompanyName")String srcSalesCompanyName,
+														@Param("tenantId")String tenantId);
 
 	@TenantIgnore
 	int updateSharePutOnShelves(SharePutOnShelves item);

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/mapper/SharePutOnShelvesMapper.xml

@@ -78,6 +78,9 @@
         <if test="salesCompanyName !=null and salesCompanyName !=''">
             and find_in_set(sales_company_name, #{salesCompanyName})
         </if>
+        <if test="srcSalesCompanyName !=null and srcSalesCompanyName !=''">
+            and find_in_set(src_sales_company_name, #{srcSalesCompanyName})
+        </if>
         <if test="tenantId !=null and tenantId !=''">
             and tenant_id = #{tenantId}
         </if>

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/service/ISharePutOnShelvesService.java

@@ -58,7 +58,7 @@ public interface ISharePutOnShelvesService extends IService<SharePutOnShelves> {
 
 	R importShareProductLaunch(List<SharePutOnShelvesImportExcel> excelList);
 
-    List<SharePutOnShelves> selectSharePutOnShelvesList(String goodsNo, String salesCompanyName, String tenantId);
+    List<SharePutOnShelves> selectSharePutOnShelvesList(String goodsNo, String salesCompanyName,String srcSalesCompanyName, String tenantId);
 
 	int updateSharePutOnShelves(SharePutOnShelves item);
 

+ 4 - 4
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/service/impl/SharePutOnShelvesServiceImpl.java

@@ -279,7 +279,7 @@ public class SharePutOnShelvesServiceImpl extends ServiceImpl<SharePutOnShelvesM
 					item.setSharedCompanyId(deptItem.getId() + "");
 					item.setSharedCompany(deptItem.getDeptName());
 				}
-				List<SharePutOnShelves> sharePutOnShelvesList1 = baseMapper.selectSharePutOnShelvesList(item.getGoodsCode(), deptItem.getDeptName(), deptItem.getTenantId());
+				List<SharePutOnShelves> sharePutOnShelvesList1 = baseMapper.selectSharePutOnShelvesList(item.getGoodsCode(), deptItem.getDeptName(),item.getSalesCompanyName(), deptItem.getTenantId());
 				if (!sharePutOnShelvesList1.isEmpty()) {
 					for (SharePutOnShelves shelves : sharePutOnShelvesList1) {
 						shelves.setInventory(item.getInventory());
@@ -770,7 +770,7 @@ public class SharePutOnShelvesServiceImpl extends ServiceImpl<SharePutOnShelvesM
 						item.setSharedCompanyId(deptItem.getId() + "");
 						item.setSharedCompany(deptItem.getDeptName());
 					}
-					List<SharePutOnShelves> sharePutOnShelvesList1 = baseMapper.selectSharePutOnShelvesList(item.getGoodsCode(), deptItem.getDeptName(), deptItem.getTenantId());
+					List<SharePutOnShelves> sharePutOnShelvesList1 = baseMapper.selectSharePutOnShelvesList(item.getGoodsCode(), deptItem.getDeptName(),item.getSalesCompanyName(), deptItem.getTenantId());
 					if (!sharePutOnShelvesList1.isEmpty()) {
 						for (SharePutOnShelves shelves : sharePutOnShelvesList1) {
 							if (0 == shelves.getBillType() && shelves.getSharedCompany().contains(deptName)) {
@@ -829,8 +829,8 @@ public class SharePutOnShelvesServiceImpl extends ServiceImpl<SharePutOnShelvesM
 	}
 
 	@Override
-	public List<SharePutOnShelves> selectSharePutOnShelvesList(String goodsNo, String salesCompanyName, String tenantId) {
-		return baseMapper.selectSharePutOnShelvesList(goodsNo, salesCompanyName, tenantId);
+	public List<SharePutOnShelves> selectSharePutOnShelvesList(String goodsNo, String salesCompanyName,String srcSalesCompanyName, String tenantId) {
+		return baseMapper.selectSharePutOnShelvesList(goodsNo, salesCompanyName,srcSalesCompanyName, tenantId);
 	}
 
 	@Override

+ 261 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/LandExpenseSettlementController.java

@@ -0,0 +1,261 @@
+/*
+ *      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.finance.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.FeesDesc;
+import org.springblade.client.feign.ICorpsDescClient;
+import org.springblade.client.feign.IFeesDescClient;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.finance.dto.SettlementDTO;
+import org.springblade.finance.entity.InvoiceItem;
+import org.springblade.finance.excel.ExpenseExcel;
+import org.springblade.finance.service.IInvoiceItemService;
+import org.springblade.finance.service.IItemsService;
+import org.springblade.finance.service.ISettlementService;
+import org.springblade.finance.vojo.Items;
+import org.springblade.finance.vojo.Settlement;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 结算表 控制器
+ *
+ * @author BladeX
+ * @since 2021-11-03
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/landExpenseSettlement")
+@Api(value = "收款付款", tags = "收款付款-接口")
+public class LandExpenseSettlementController extends BladeController {
+
+	private final ISettlementService settlementService;
+
+	private final IItemsService itemsService;
+
+	private final ICorpsDescClient corpsDescClient;//获取客户信息
+
+	private final IUserClient iUserClient;
+
+	private final IFeesDescClient iFeesDescClient;
+
+	private final IInvoiceItemService iInvoiceItemService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入settlement")
+	public R<Settlement> detail(Settlement settlement) throws Exception {
+		Settlement detail = settlementService.getById(settlement.getId());
+		if (ObjectUtil.isNotEmpty(detail.getUpdateUser())) {
+			R<User> user = iUserClient.userInfoById(detail.getUpdateUser());
+			if (user.isSuccess() && user.getData() != null) {
+				detail.setUpdateUserName(user.getData().getName());
+			}
+		}
+		if (ObjectUtil.isNotEmpty(detail.getUpdateUser())) {
+			R<User> user = iUserClient.userInfoById(detail.getCreateUser());
+			if (user.isSuccess() && user.getData() != null) {
+				detail.setCreateUserName(user.getData().getName());
+			}
+		}
+		LambdaQueryWrapper<Items> itemsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		itemsLambdaQueryWrapper.eq(Items::getPid, detail.getId()).eq(Items::getIsDeleted, 0);
+		List<Items> list = itemsService.list(itemsLambdaQueryWrapper);
+		LambdaQueryWrapper<InvoiceItem> itemLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		itemLambdaQueryWrapper.eq(InvoiceItem::getPid, detail.getId()).eq(InvoiceItem::getIsDeleted, 0);
+		List<InvoiceItem> invoiceItemList = iInvoiceItemService.list(itemLambdaQueryWrapper);
+		detail.setInvoiceItemList(invoiceItemList);
+		if (CollectionUtils.isNotEmpty(list)) {
+			list.forEach(e -> {
+				if (ObjectUtil.isNotEmpty(detail.getUpdateUser())) {
+					R<User> user = iUserClient.userInfoById(e.getUpdateUser());
+					if (user.isSuccess() && user.getData() != null) {
+						e.setUpdateUserName(user.getData().getName());
+					}
+				}
+				if (ObjectUtil.isNotEmpty(detail.getUpdateUser())) {
+					R<User> user = iUserClient.userInfoById(e.getCreateUser());
+					if (user.isSuccess() && user.getData() != null) {
+						e.setCreateUserName(user.getData().getName());
+					}
+				}
+				//客户名称
+				if (ObjectUtil.isNotEmpty(e.getCorpId())) {
+					e.setCorpName(corpsDescClient.getCorpMessage(e.getCorpId()).getData().getCname());
+				}
+				//客户名称
+				if (ObjectUtil.isNotEmpty(e.getFleetId())) {
+					e.setFleetName(corpsDescClient.getCorpMessage(e.getFleetId()).getData().getCname());
+				}
+				//费用名称
+				if (e.getItemId() != null) {
+					R<FeesDesc> r = iFeesDescClient.detail(e.getItemId());
+					if (r.isSuccess() && ObjectUtils.isNotNull(r.getData())) {
+						e.setItemName(r.getData().getCname());
+					}
+				}
+			});
+		}
+		detail.setItemsList(list);
+		//获取客户中文名
+		if (detail.getCorpId() != null) {
+			R<List<Map<String, Object>>> corpMessage = corpsDescClient.getCorpsMessage(detail.getCorpId().toString());
+			if (corpMessage.isSuccess() && corpMessage.getData() != null) {
+				detail.setCustomerModel(corpMessage.getData());
+			}
+		}
+		if (ObjectUtils.isNotNull(detail.getCreateUser())) {
+			//制单人
+			detail.setCreateUserName(iUserClient.userInfoById(detail.getCreateUser()).getData().getRealName());
+		}
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 结算表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入settlement")
+	public R<IPage<Settlement>> list(Settlement settlement, Query query) {
+		LambdaQueryWrapper<Settlement> settlementLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		settlementLambdaQueryWrapper.between(StringUtils.isNotBlank(settlement.getSettlementStartDate()) && StringUtils.isNotBlank(settlement.getSettlementEndDate()), Settlement::getSettlementDate, settlement.getSettlementStartDate(), settlement.getSettlementEndDate());
+		settlementLambdaQueryWrapper.between(StringUtils.isNotBlank(settlement.getCreateStartDate()) && StringUtils.isNotBlank(settlement.getCreateEndDate()), Settlement::getCreateTime, settlement.getCreateStartDate(), settlement.getCreateEndDate());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getSrcOrderno()), Settlement::getSrcOrderno, settlement.getSrcOrderno());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getSysNo()), Settlement::getSysNo, settlement.getSysNo());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getBillNo()), Settlement::getBillNo, settlement.getBillNo());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getAccount()), Settlement::getAccount, settlement.getAccount());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getRemark()), Settlement::getRemark, settlement.getRemark());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getAccountName()), Settlement::getAccountName, settlement.getAccountName());
+		settlementLambdaQueryWrapper.like(settlement.getCorpId() != null, Settlement::getCorpId, settlement.getCorpId());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getFinanceStatus()), Settlement::getFinanceStatus, settlement.getFinanceStatus());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getCheckStatus()), Settlement::getCheckStatus, settlement.getCheckStatus());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getBillType()), Settlement::getBillType, settlement.getBillType());
+		settlementLambdaQueryWrapper.ge(Func.isNotEmpty(settlement.getCompletionTimeStart()), Settlement::getCompletionTime, settlement.getCompletionTimeStart());//单据完成开始日期
+		settlementLambdaQueryWrapper.le(Func.isNotEmpty(settlement.getCompletionTimeEnd()), Settlement::getCompletionTime, settlement.getCompletionTimeEnd());//单据完成结束日期
+		settlementLambdaQueryWrapper.eq(Settlement::getTenantId, AuthUtil.getTenantId());
+		settlementLambdaQueryWrapper.eq(Settlement::getIsDeleted, 0);
+		settlementLambdaQueryWrapper.like(ObjectUtil.isNotEmpty(settlement.getAmount()), Settlement::getAmount, settlement.getAmount());//金额
+		settlementLambdaQueryWrapper.like(ObjectUtil.isNotEmpty(settlement.getCode()), Settlement::getCode, settlement.getCode());//箱号
+		settlementLambdaQueryWrapper.orderByDesc(Settlement::getCreateTime);
+		IPage<Settlement> pages = settlementService.page(Condition.getPage(query), settlementLambdaQueryWrapper);
+		List<Settlement> settlementList = pages.getRecords();
+		if (CollectionUtils.isNotEmpty(settlementList)) {
+			settlementList.forEach(e -> {
+				R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(e.getCorpId());
+				if (corpMessage.getData() != null) {
+					e.setCorpName(corpMessage.getData().getCname());
+				}
+			});
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 付费收费导出
+	 */
+	@GetMapping("/expenseExport")
+	@ApiOperation(value = "付费收费导出", notes = "传入settlement")
+	public void expenseExport(Settlement settlement, HttpServletResponse response) {
+		LambdaQueryWrapper<Settlement> settlementLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		settlementLambdaQueryWrapper.between(StringUtils.isNotBlank(settlement.getSettlementStartDate()) && StringUtils.isNotBlank(settlement.getSettlementEndDate()), Settlement::getSettlementDate, settlement.getSettlementStartDate(), settlement.getSettlementEndDate());
+		settlementLambdaQueryWrapper.between(StringUtils.isNotBlank(settlement.getCreateStartDate()) && StringUtils.isNotBlank(settlement.getCreateEndDate()), Settlement::getCreateTime, settlement.getCreateStartDate(), settlement.getCreateEndDate());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getSrcOrderno()), Settlement::getSrcOrderno, settlement.getSrcOrderno());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getSysNo()), Settlement::getSysNo, settlement.getSysNo());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getBillNo()), Settlement::getBillNo, settlement.getBillNo());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getAccount()), Settlement::getAccount, settlement.getAccount());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getRemark()), Settlement::getRemark, settlement.getRemark());
+		settlementLambdaQueryWrapper.like(StringUtils.isNotBlank(settlement.getAccountName()), Settlement::getAccountName, settlement.getAccountName());
+		settlementLambdaQueryWrapper.like(settlement.getCorpId() != null, Settlement::getCorpId, settlement.getCorpId());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getFinanceStatus()), Settlement::getFinanceStatus, settlement.getFinanceStatus());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getCheckStatus()), Settlement::getCheckStatus, settlement.getCheckStatus());
+		settlementLambdaQueryWrapper.eq(StringUtils.isNotBlank(settlement.getBillType()), Settlement::getBillType, settlement.getBillType());
+		settlementLambdaQueryWrapper.ge(Func.isNotEmpty(settlement.getCompletionTimeStart()), Settlement::getCompletionTime, settlement.getCompletionTimeStart());//单据完成开始日期
+		settlementLambdaQueryWrapper.le(Func.isNotEmpty(settlement.getCompletionTimeEnd()), Settlement::getCompletionTime, settlement.getCompletionTimeEnd());//单据完成结束日期
+		settlementLambdaQueryWrapper.eq(Settlement::getTenantId, AuthUtil.getTenantId());
+		settlementLambdaQueryWrapper.eq(Settlement::getIsDeleted, 0);
+		settlementLambdaQueryWrapper.orderByDesc(Settlement::getCreateTime);
+		List<Settlement> list = settlementService.list(settlementLambdaQueryWrapper);
+		if (CollectionUtils.isNotEmpty(list)) {
+			list.forEach(e -> {
+				R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(e.getCorpId());
+				if (corpMessage.getData() != null) {
+					e.setCorpName(corpMessage.getData().getCname());
+				}
+			});
+		}
+
+		List<ExpenseExcel> excelList = BeanUtil.copy(list, ExpenseExcel.class);
+		if (settlement.getBillType().equals("付费")) {
+			ExcelUtil.export(response, "付款结算", "付费结算", excelList, ExpenseExcel.class);
+		} else if (settlement.getBillType().equals("收费")) {
+			ExcelUtil.export(response, "收款结算", "收费结算", excelList, ExpenseExcel.class);
+		} else if (settlement.getBillType().equals("对账")) {
+			ExcelUtil.export(response, "对账", "对账", excelList, ExpenseExcel.class);
+		}
+	}
+
+	@PostMapping("/modifyExpense")
+	@ApiOperation(value = "修改新增收付款信息", notes = "传入修改新增收付款信息对象")
+	public R modify(@RequestBody SettlementDTO dto) {
+		Settlement modify = settlementService.modifyExpense(dto);
+		return R.data(modify);
+	}
+
+	@PostMapping("/cancelModifyExpense")
+	@ApiOperation(value = "撤销结算", notes = "撤销结算")
+	public R cancelModify(@RequestBody SettlementDTO dto) {
+		Settlement modify = settlementService.cancelModifyExpense(dto);
+		return R.data(modify);
+	}
+
+	@PostMapping("/saveOrEditExpense")
+	@ApiOperation(value = "保存收付款信息", notes = "保存收付款信息")
+	public R saveOrEdit(@RequestBody SettlementDTO dto) {
+		return R.data(settlementService.saveOrEditExpense(dto));
+	}
+
+}

+ 6 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/ISettlementService.java

@@ -122,4 +122,10 @@ public interface ISettlementService extends IService<Settlement> {
 	boolean removeSettlementHy(List<Long> toLongList);
 
 	void paymentApplyPartsQB(ApplyDTO dto);
+
+	Settlement modifyExpense(SettlementDTO dto);
+
+	Settlement cancelModifyExpense(SettlementDTO dto);
+
+	Settlement saveOrEditExpense(SettlementDTO dto);
 }

+ 200 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java

@@ -77,6 +77,7 @@ import org.springblade.finance.vo.CollectionPayment;
 import org.springblade.finance.vo.SettlementVO;
 import org.springblade.finance.vojo.*;
 import org.springblade.land.entity.OrderFee;
+import org.springblade.land.entity.OrderItem;
 import org.springblade.land.feign.ILandClient;
 import org.springblade.mocha.entity.BusinessOverpaymentItem;
 import org.springblade.mocha.entity.Overpayment;
@@ -3729,4 +3730,203 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 			}
 		}
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Settlement modifyExpense(SettlementDTO settlementDTO) {
+		Long id = settlementDTO.getId();
+		Settlement settlement = baseMapper.selectById(id);
+		if ("结算完成".equals(settlement.getFinanceStatus())) {
+			throw new SecurityException("此结算单已结算过,禁止重复操作");
+		}
+		settlement.setFinanceStatus("结算完成");
+		this.updateById(settlement);
+		List<Items> itemsList = settlementDTO.getItemsList();
+		List<Long> orderItemsIdList = itemsList.stream().filter(e -> 2 == e.getSrcType())
+			.map(Items::getSrcFeesId).collect(Collectors.toList());
+		List<OrderItem> orderItemsList = new ArrayList<>();
+		List<OrderItem> orderItemsNew = new ArrayList<>();
+		if (!orderItemsIdList.isEmpty()) {
+			orderItemsList = landClient.selectOrderItems(orderItemsIdList);
+		}
+		List<Long> feesItemsIdList = itemsList.stream().filter(e -> 1 == e.getSrcType())
+			.map(Items::getSrcFeesId).collect(Collectors.toList());
+		List<OrderFee> orderFeeList = new ArrayList<>();
+		List<OrderFee> orderFeeNew = new ArrayList<>();
+		if (!feesItemsIdList.isEmpty()) {
+			orderFeeList = landClient.selectOrderFee(feesItemsIdList);
+		}
+		for (Items item : itemsList) {
+			if ((item.getAmount().subtract(item.getSettlementAmount())).compareTo(item.getThisAmount()) < 0) {
+				throw new RuntimeException("单号:" + item.getSrcBillNo() + "本次结算金额大于剩余结算金额");
+			}
+			if (2 == item.getSrcType() && "D".equals(item.getDc()) && !orderItemsList.isEmpty()){
+				OrderItem orderItem = orderItemsList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderItem != null){
+					orderItem.setSettlementAmountD(orderItem.getSettlementAmountD().add(item.getThisAmount()));
+					orderItem.setSettlementDateD(new Date());
+					orderItemsNew.add(orderItem);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+			if (2 == item.getSrcType() && "C".equals(item.getDc()) && !orderItemsList.isEmpty()){
+				OrderItem orderItem = orderItemsList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderItem != null){
+					orderItem.setSettlementAmountC(orderItem.getSettlementAmountC().add(item.getThisAmount()));
+					orderItem.setSettlementDateC(new Date());
+					orderItemsNew.add(orderItem);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+			if (1 == item.getSrcType() && !orderFeeList.isEmpty()){
+				OrderFee orderFee = orderFeeList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderFee != null){
+					orderFee.setSettlementAmount(orderFee.getSettlementAmount().add(item.getThisAmount()));
+					orderFee.setSettlementDate(new Date());
+					orderFeeNew.add(orderFee);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+		}
+		if (!orderItemsNew.isEmpty()){
+			landClient.updateOrderItemsList(orderItemsNew);
+		}
+		if (!orderFeeNew.isEmpty()){
+			landClient.updateOrderFeeList(orderFeeNew);
+		}
+		settlement.setItemsList(itemsList);
+		return settlement;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Settlement cancelModifyExpense(SettlementDTO settlementDTO) {
+		Long id = settlementDTO.getId();
+		Settlement settlement = baseMapper.selectById(id);
+		if ("待结算".equals(settlement.getFinanceStatus())) {
+			throw new SecurityException("此结算单未结算 或者 已经撤销,禁止重复操作");
+		}
+		settlement.setFinanceStatus("待结算");
+		this.updateById(settlement);
+		List<Items> itemsList = settlementDTO.getItemsList();
+		List<Long> orderItemsIdList = itemsList.stream().filter(e -> 2 == e.getSrcType())
+			.map(Items::getSrcFeesId).collect(Collectors.toList());
+		List<OrderItem> orderItemsList = new ArrayList<>();
+		List<OrderItem> orderItemsNew = new ArrayList<>();
+		if (!orderItemsIdList.isEmpty()) {
+			orderItemsList = landClient.selectOrderItems(orderItemsIdList);
+		}
+		List<Long> feesItemsIdList = itemsList.stream().filter(e -> 1 == e.getSrcType())
+			.map(Items::getSrcFeesId).collect(Collectors.toList());
+		List<OrderFee> orderFeeList = new ArrayList<>();
+		List<OrderFee> orderFeeNew = new ArrayList<>();
+		if (!feesItemsIdList.isEmpty()) {
+			orderFeeList = landClient.selectOrderFee(feesItemsIdList);
+		}
+		for (Items item : itemsList) {
+			if (2 == item.getSrcType() && "D".equals(item.getDc()) && !orderItemsList.isEmpty()){
+				OrderItem orderItem = orderItemsList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderItem != null){
+					orderItem.setSettlementAmountD(orderItem.getSettlementAmountD().subtract(item.getThisAmount()));
+					orderItemsNew.add(orderItem);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+			if (2 == item.getSrcType() && "C".equals(item.getDc()) && !orderItemsList.isEmpty()){
+				OrderItem orderItem = orderItemsList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderItem != null){
+					orderItem.setSettlementAmountC(orderItem.getSettlementAmountC().subtract(item.getThisAmount()));
+					orderItemsNew.add(orderItem);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+			if (1 == item.getSrcType() && !orderFeeList.isEmpty()){
+				OrderFee orderFee = orderFeeList.stream().filter(e-> e.getId().equals(item.getSrcFeesId())).findFirst().orElse(null);
+				if (orderFee != null){
+					orderFee.setSettlementAmount(orderFee.getSettlementAmount().subtract(item.getThisAmount()));
+					orderFeeNew.add(orderFee);
+				}else{
+					throw new RuntimeException("单号:" + item.getSrcBillNo() + "未查到单据信息");
+				}
+			}
+		}
+		if (!orderItemsNew.isEmpty()){
+			landClient.updateOrderItemsList(orderItemsNew);
+		}
+		if (!orderFeeNew.isEmpty()){
+			landClient.updateOrderFeeList(orderFeeNew);
+		}
+		return settlementDTO;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Settlement saveOrEditExpense(SettlementDTO settlementDTO) {
+		Settlement model = new Settlement();
+		BeanUtils.copyProperties(settlementDTO, model);
+		List<Items> itemsList = settlementDTO.getItemsList();
+		if (!itemsList.isEmpty()) {
+			model.setBillNo(itemsList.stream().map(Items::getSrcBillNo).distinct().collect(Collectors.joining(",")));
+			model.setSrcOrderno(itemsList.stream().map(Items::getSrcOrderno).distinct().collect(Collectors.joining(",")));
+			model.setForeignAmount(itemsList.stream().filter(e -> e.getAmount() != null && !"1".equals(e.getCurrency()))
+				.map(Items::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
+			model.setAmount(itemsList.stream().filter(e -> e.getAmount() != null && "1".equals(e.getCurrency()))
+				.map(Items::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
+		}
+		//如果id=null, 无论主表还是从表, 必然都是新增
+		Long id = settlementDTO.getId();
+		if (id == null) {
+			model.setSysNo(String.valueOf(System.currentTimeMillis()));
+			model.setTenantId(AuthUtil.getTenantId());
+			model.setCreateTime(new Date());
+			model.setCreateUser(AuthUtil.getUserId());
+			model.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+			baseMapper.insert(model);
+			settlementDTO.setId(model.getId());
+			settlementDTO.setSysNo(model.getSysNo());
+			settlementDTO.setCreateTime(new Date());
+			settlementDTO.setCreateUserName(AuthUtil.getUserName());
+			if (CollectionUtils.isNotEmpty(itemsList)) {
+				itemsList.forEach(e -> {
+					e.setId(null);
+					e.setPid(model.getId());
+					e.setTenantId(AuthUtil.getTenantId());
+					e.setCreateTime(new Date());
+					e.setCreateUser(AuthUtil.getUserId());
+					e.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+					itemsMapper.insert(e);
+				});
+			}
+		}
+		//主表更新, 从表视情况更新新增
+		else {
+			model.setUpdateTime(new Date());
+			model.setUpdateUser(AuthUtil.getUserId());
+			model.setUpdateUserName(AuthUtil.getUser().getRoleName());
+			baseMapper.updateById(model);
+			if (CollectionUtils.isNotEmpty(itemsList)) {
+				itemsList.forEach(e -> {
+					if (e.getId() == null) {
+						e.setPid(model.getId());
+						e.setTenantId(AuthUtil.getTenantId());
+						e.setCreateTime(new Date());
+						e.setCreateUser(AuthUtil.getUserId());
+						e.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+						itemsMapper.insert(e);
+					} else {
+						e.setUpdateTime(new Date());
+						e.setUpdateUser(AuthUtil.getUserId());
+						e.setUpdateUserName(AuthUtil.getUser().getRoleName());
+						itemsMapper.updateById(e);
+					}
+				});
+			}
+		}
+		return settlementDTO;
+	}
 }