Browse Source

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

wfg 8 months ago
parent
commit
81cc60a0b2
15 changed files with 637 additions and 800 deletions
  1. 2 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/dto/StaffInformationDTO.java
  2. 7 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/entity/StaffInformation.java
  3. 2 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/vo/StaffInformationVO.java
  4. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/dto/FeeCenterReports.java
  5. 0 263
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/controller/BStaffInformationController.java
  6. 263 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/controller/StaffInformationController.java
  7. 5 4
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/StaffInformationMapper.java
  8. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/StaffInformationMapper.xml
  9. 5 5
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/IStaffInformationService.java
  10. 31 31
      blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/impl/StaffInformationServiceImpl.java
  11. 74 64
      blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/ReportDataTradeServiceImpl.java
  12. 8 283
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java
  13. 183 86
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java
  14. 37 37
      blade-service/blade-sales-part/src/main/resources/log/logback-dev.xml
  15. 13 20
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/AccServiceImpl.java

+ 2 - 2
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/dto/BStaffInformationDTO.java → blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/dto/StaffInformationDTO.java

@@ -16,7 +16,7 @@
  */
 package org.springblade.los.basic.staff.dto;
 
-import org.springblade.los.basic.staff.entity.BStaffInformation;
+import org.springblade.los.basic.staff.entity.StaffInformation;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,7 +28,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class BStaffInformationDTO extends BStaffInformation {
+public class StaffInformationDTO extends StaffInformation {
 	private static final long serialVersionUID = 1L;
 
 }

+ 7 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/entity/BStaffInformation.java → blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/entity/StaffInformation.java

@@ -36,7 +36,7 @@ import java.util.List;
 @Data
 @TableName("los_b_staff_information")
 @ApiModel(value = "BStaffInformation对象", description = "员工信息表")
-public class BStaffInformation implements Serializable {
+public class StaffInformation implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 
@@ -350,5 +350,11 @@ public class BStaffInformation implements Serializable {
 	@TableField(exist = false)
 	private Integer age;
 
+	/**
+	 * 员工照片
+	 */
+	@ApiModelProperty(value = "员工照片")
+	private String url;
+
 
 }

+ 2 - 2
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/vo/BStaffInformationVO.java → blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/staff/vo/StaffInformationVO.java

@@ -16,7 +16,7 @@
  */
 package org.springblade.los.basic.staff.vo;
 
-import org.springblade.los.basic.staff.entity.BStaffInformation;
+import org.springblade.los.basic.staff.entity.StaffInformation;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
@@ -30,7 +30,7 @@ import io.swagger.annotations.ApiModel;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "BStaffInformationVO对象", description = "员工信息表")
-public class BStaffInformationVO extends BStaffInformation {
+public class StaffInformationVO extends StaffInformation {
 	private static final long serialVersionUID = 1L;
 
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/dto/FeeCenterReports.java

@@ -163,5 +163,10 @@ public class FeeCenterReports implements Serializable {
 	 */
 	private String curCodeC;
 
+	/**
+	 * 费用中文名称
+	 */
+	private String feeCnNameC;
+
 
 }

+ 0 - 263
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/controller/BStaffInformationController.java

@@ -1,263 +0,0 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
-package org.springblade.los.basic.staff.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;
-import io.swagger.annotations.ApiParam;
-import lombok.AllArgsConstructor;
-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.los.basic.staff.entity.BStaffInformation;
-import org.springblade.los.basic.staff.service.IBStaffInformationService;
-import org.springblade.los.basic.staff.vo.BStaffInformationVO;
-import org.springblade.los.excel.StaffInformationExcel;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import java.time.LocalDate;
-import java.time.Period;
-import java.time.ZoneId;
-import java.util.List;
-
-/**
- * 员工信息表 控制器
- *
- * @author BladeX
- * @since 2025-02-26
- */
-@RestController
-@AllArgsConstructor
-@RequestMapping("/bstaffinformation")
-@Api(value = "员工信息表", tags = "员工信息表接口")
-public class BStaffInformationController extends BladeController {
-
-	private final IBStaffInformationService bStaffInformationService;
-
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入bStaffInformation")
-	public R<BStaffInformation> detail(BStaffInformation bStaffInformation) {
-		BStaffInformation detail = bStaffInformationService.getOne(Condition.getQueryWrapper(bStaffInformation));
-		return R.data(detail);
-	}
-
-	/**
-	 * 分页 员工信息表
-	 */
-	@GetMapping("/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入bStaffInformation")
-	public R<IPage<BStaffInformation>> list(BStaffInformation bStaffInformation, Query query) {
-		LambdaQueryWrapper<BStaffInformation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-		lambdaQueryWrapper.eq(BStaffInformation::getTenantId, AuthUtil.getTenantId())
-			.eq(BStaffInformation::getIsDeleted, 0)
-			.like(ObjectUtils.isNotNull(bStaffInformation.getBillNo()), BStaffInformation::getBillNo, bStaffInformation.getBillNo())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPositionType()), BStaffInformation::getPositionType, bStaffInformation.getPositionType())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getAccountingDepartmentId()), BStaffInformation::getAccountingDepartmentId, bStaffInformation.getAccountingDepartmentId())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getAccountingDepartmentName()), BStaffInformation::getAccountingDepartmentName, bStaffInformation.getAccountingDepartmentName())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getStaffNo()), BStaffInformation::getStaffNo, bStaffInformation.getStaffNo())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getCname()), BStaffInformation::getCname, bStaffInformation.getCname())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getEname()), BStaffInformation::getEname, bStaffInformation.getEname())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getGender()), BStaffInformation::getGender, bStaffInformation.getGender())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getAdministrativeDepartmentId()), BStaffInformation::getAdministrativeDepartmentId, bStaffInformation.getAdministrativeDepartmentId())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getAdministrativeDepartmentName()), BStaffInformation::getAdministrativeDepartmentName, bStaffInformation.getAdministrativeDepartmentName())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPosition()), BStaffInformation::getPosition, bStaffInformation.getPosition())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getMaritalStatus()), BStaffInformation::getMaritalStatus, bStaffInformation.getMaritalStatus())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getOfficeLocation()), BStaffInformation::getOfficeLocation, bStaffInformation.getOfficeLocation())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getEducationalBackground()), BStaffInformation::getEducationalBackground, bStaffInformation.getEducationalBackground())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getMajor()), BStaffInformation::getMajor, bStaffInformation.getMajor())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherOnFile()), BStaffInformation::getWhetherOnFile, bStaffInformation.getWhetherOnFile())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getLanguageCategory()), BStaffInformation::getLanguageCategory, bStaffInformation.getLanguageCategory())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getLanguageLevel()), BStaffInformation::getLanguageLevel, bStaffInformation.getLanguageLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherIndefinitelyContract()), BStaffInformation::getWhetherIndefinitelyContract, bStaffInformation.getWhetherIndefinitelyContract())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getSocialSecurityNo()), BStaffInformation::getSocialSecurityNo, bStaffInformation.getSocialSecurityNo())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getSocialSecurityBaseLevel()), BStaffInformation::getSocialSecurityBaseLevel, bStaffInformation.getSocialSecurityBaseLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getProvidentFundLevel()), BStaffInformation::getProvidentFundLevel, bStaffInformation.getProvidentFundLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherMigrantWorkers()), BStaffInformation::getWhetherMigrantWorkers, bStaffInformation.getWhetherMigrantWorkers())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getNationality()), BStaffInformation::getNationality, bStaffInformation.getNationality())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPoliticalStatus()), BStaffInformation::getPoliticalStatus, bStaffInformation.getPoliticalStatus())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getIdNumber()), BStaffInformation::getIdNumber, bStaffInformation.getIdNumber())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getTel()), BStaffInformation::getTel, bStaffInformation.getTel())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getEname()), BStaffInformation::getEname, bStaffInformation.getEname())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherEmployedOrNot()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-			.ge(ObjectUtils.isNotNull(bStaffInformation.getContractPeriodStart()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-			.le(ObjectUtils.isNotNull(bStaffInformation.getContractPeriodEnd()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-		;
-		if (ObjectUtils.isNotNull(bStaffInformation.getAdvanceCompanyDateList()) && !bStaffInformation.getAdvanceCompanyDateList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getAdvanceCompanyDate, bStaffInformation.getAdvanceCompanyDateList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getAdvanceCompanyDate, bStaffInformation.getAdvanceCompanyDateList().get(1));
-		}
-		if (ObjectUtils.isNotNull(bStaffInformation.getTerminationDateList()) && !bStaffInformation.getTerminationDateList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getTerminationDate, bStaffInformation.getTerminationDateList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getTerminationDate, bStaffInformation.getTerminationDateList().get(1));
-		}
-		if (ObjectUtils.isNotNull(bStaffInformation.getDateOfBirthList()) && !bStaffInformation.getDateOfBirthList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getDateOfBirth, bStaffInformation.getDateOfBirthList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getDateOfBirth, bStaffInformation.getDateOfBirthList().get(1));
-		}
-		IPage<BStaffInformation> pages = bStaffInformationService.page(Condition.getPage(query), lambdaQueryWrapper);
-		LocalDate date = LocalDate.now();
-		for (BStaffInformation item : pages.getRecords()) {
-			if (ObjectUtils.isNotNull(item.getDateOfBirth())) {
-				java.time.Instant instant = item.getDateOfBirth().toInstant();
-				Period period = Period.between(instant.atZone(ZoneId.systemDefault()).toLocalDate(),date);
-				int year = period.getYears();
-				item.setAge(year);
-			}
-		}
-		return R.data(pages);
-	}
-
-	/**
-	 * 自定义分页 员工信息表
-	 */
-	@GetMapping("/page")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入bStaffInformation")
-	public R<IPage<BStaffInformationVO>> page(BStaffInformationVO bStaffInformation, Query query) {
-		IPage<BStaffInformationVO> pages = bStaffInformationService.selectBStaffInformationPage(Condition.getPage(query), bStaffInformation);
-		return R.data(pages);
-	}
-
-	/**
-	 * 新增 员工信息表
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入bStaffInformation")
-	public R save(@Valid @RequestBody BStaffInformation bStaffInformation) {
-		return R.status(bStaffInformationService.save(bStaffInformation));
-	}
-
-	/**
-	 * 修改 员工信息表
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入bStaffInformation")
-	public R update(@Valid @RequestBody BStaffInformation bStaffInformation) {
-		return R.status(bStaffInformationService.updateById(bStaffInformation));
-	}
-
-	/**
-	 * 新增或修改 员工信息表
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入bStaffInformation")
-	public R submit(@Valid @RequestBody BStaffInformation bStaffInformation) {
-		return bStaffInformationService.submit(bStaffInformation);
-	}
-
-
-	/**
-	 * 删除 员工信息表
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 8)
-	@ApiOperation(value = "删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(bStaffInformationService.removeByIds(Func.toLongList(ids)));
-	}
-
-	/**
-	 * 导出 员工信息
-	 */
-	@GetMapping("/exportStaff")
-	public void exportBPorts(BStaffInformation bStaffInformation, HttpServletResponse response) {
-		LambdaQueryWrapper<BStaffInformation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-		lambdaQueryWrapper.eq(BStaffInformation::getTenantId, AuthUtil.getTenantId())
-			.eq(BStaffInformation::getIsDeleted, 0)
-			.like(ObjectUtils.isNotNull(bStaffInformation.getBillNo()), BStaffInformation::getBillNo, bStaffInformation.getBillNo())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPositionType()), BStaffInformation::getPositionType, bStaffInformation.getPositionType())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getAccountingDepartmentId()), BStaffInformation::getAccountingDepartmentId, bStaffInformation.getAccountingDepartmentId())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getAccountingDepartmentName()), BStaffInformation::getAccountingDepartmentName, bStaffInformation.getAccountingDepartmentName())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getStaffNo()), BStaffInformation::getStaffNo, bStaffInformation.getStaffNo())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getCname()), BStaffInformation::getCname, bStaffInformation.getCname())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getEname()), BStaffInformation::getEname, bStaffInformation.getEname())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getGender()), BStaffInformation::getGender, bStaffInformation.getGender())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getAdministrativeDepartmentId()), BStaffInformation::getAdministrativeDepartmentId, bStaffInformation.getAdministrativeDepartmentId())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getAdministrativeDepartmentName()), BStaffInformation::getAdministrativeDepartmentName, bStaffInformation.getAdministrativeDepartmentName())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPosition()), BStaffInformation::getPosition, bStaffInformation.getPosition())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getMaritalStatus()), BStaffInformation::getMaritalStatus, bStaffInformation.getMaritalStatus())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getOfficeLocation()), BStaffInformation::getOfficeLocation, bStaffInformation.getOfficeLocation())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getEducationalBackground()), BStaffInformation::getEducationalBackground, bStaffInformation.getEducationalBackground())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getMajor()), BStaffInformation::getMajor, bStaffInformation.getMajor())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherOnFile()), BStaffInformation::getWhetherOnFile, bStaffInformation.getWhetherOnFile())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getLanguageCategory()), BStaffInformation::getLanguageCategory, bStaffInformation.getLanguageCategory())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getLanguageLevel()), BStaffInformation::getLanguageLevel, bStaffInformation.getLanguageLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherIndefinitelyContract()), BStaffInformation::getWhetherIndefinitelyContract, bStaffInformation.getWhetherIndefinitelyContract())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getSocialSecurityNo()), BStaffInformation::getSocialSecurityNo, bStaffInformation.getSocialSecurityNo())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getSocialSecurityBaseLevel()), BStaffInformation::getSocialSecurityBaseLevel, bStaffInformation.getSocialSecurityBaseLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getProvidentFundLevel()), BStaffInformation::getProvidentFundLevel, bStaffInformation.getProvidentFundLevel())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherMigrantWorkers()), BStaffInformation::getWhetherMigrantWorkers, bStaffInformation.getWhetherMigrantWorkers())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getNationality()), BStaffInformation::getNationality, bStaffInformation.getNationality())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getPoliticalStatus()), BStaffInformation::getPoliticalStatus, bStaffInformation.getPoliticalStatus())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getIdNumber()), BStaffInformation::getIdNumber, bStaffInformation.getIdNumber())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getTel()), BStaffInformation::getTel, bStaffInformation.getTel())
-			.like(ObjectUtils.isNotNull(bStaffInformation.getEname()), BStaffInformation::getEname, bStaffInformation.getEname())
-			.eq(ObjectUtils.isNotNull(bStaffInformation.getWhetherEmployedOrNot()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-			.ge(ObjectUtils.isNotNull(bStaffInformation.getContractPeriodStart()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-			.le(ObjectUtils.isNotNull(bStaffInformation.getContractPeriodEnd()), BStaffInformation::getWhetherEmployedOrNot, bStaffInformation.getWhetherEmployedOrNot())
-		;
-		if (ObjectUtils.isNotNull(bStaffInformation.getAdvanceCompanyDateList()) && !bStaffInformation.getAdvanceCompanyDateList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getAdvanceCompanyDate, bStaffInformation.getAdvanceCompanyDateList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getAdvanceCompanyDate, bStaffInformation.getAdvanceCompanyDateList().get(1));
-		}
-		if (ObjectUtils.isNotNull(bStaffInformation.getTerminationDateList()) && !bStaffInformation.getTerminationDateList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getTerminationDate, bStaffInformation.getTerminationDateList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getTerminationDate, bStaffInformation.getTerminationDateList().get(1));
-		}
-		if (ObjectUtils.isNotNull(bStaffInformation.getDateOfBirthList()) && !bStaffInformation.getDateOfBirthList().isEmpty()) {
-			lambdaQueryWrapper.ge(BStaffInformation::getDateOfBirth, bStaffInformation.getDateOfBirthList().get(0));
-			lambdaQueryWrapper.le(BStaffInformation::getDateOfBirth, bStaffInformation.getDateOfBirthList().get(1));
-		}
-		List<BStaffInformation> bPortsList = bStaffInformationService.list(lambdaQueryWrapper);
-		LocalDate date = LocalDate.now();
-		for (BStaffInformation item : bPortsList) {
-			if (ObjectUtils.isNotNull(item.getDateOfBirth())) {
-				java.time.Instant instant = item.getDateOfBirth().toInstant();
-				Period period = Period.between(instant.atZone(ZoneId.systemDefault()).toLocalDate(),date);
-				int year = period.getYears();
-				item.setAge(year);
-			}
-		}
-		if ("1".equals(bStaffInformation.getWhetherEmployedOrNot())){
-			ExcelUtil.export(response, "在职员工信息", "在职员工信息", BeanUtil.copy(bPortsList, StaffInformationExcel.class), StaffInformationExcel.class);
-		}else{
-			ExcelUtil.export(response, "离职员工信息", "离职员工信息", BeanUtil.copy(bPortsList, StaffInformationExcel.class), StaffInformationExcel.class);
-		}
-
-	}
-
-
-}

+ 263 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/controller/StaffInformationController.java

@@ -0,0 +1,263 @@
+/*
+ *      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.basic.staff.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;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+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.los.basic.staff.entity.StaffInformation;
+import org.springblade.los.basic.staff.service.IStaffInformationService;
+import org.springblade.los.basic.staff.vo.StaffInformationVO;
+import org.springblade.los.excel.StaffInformationExcel;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.time.Period;
+import java.time.ZoneId;
+import java.util.List;
+
+/**
+ * 员工信息表 控制器
+ *
+ * @author BladeX
+ * @since 2025-02-26
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/bstaffinformation")
+@Api(value = "员工信息表", tags = "员工信息表接口")
+public class StaffInformationController extends BladeController {
+
+	private final IStaffInformationService bStaffInformationService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入bStaffInformation")
+	public R<StaffInformation> detail(StaffInformation staffInformation) {
+		StaffInformation detail = bStaffInformationService.getOne(Condition.getQueryWrapper(staffInformation));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 员工信息表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入bStaffInformation")
+	public R<IPage<StaffInformation>> list(StaffInformation staffInformation, Query query) {
+		LambdaQueryWrapper<StaffInformation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(StaffInformation::getTenantId, AuthUtil.getTenantId())
+			.eq(StaffInformation::getIsDeleted, 0)
+			.like(ObjectUtils.isNotNull(staffInformation.getBillNo()), StaffInformation::getBillNo, staffInformation.getBillNo())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPositionType()), StaffInformation::getPositionType, staffInformation.getPositionType())
+			.eq(ObjectUtils.isNotNull(staffInformation.getAccountingDepartmentId()), StaffInformation::getAccountingDepartmentId, staffInformation.getAccountingDepartmentId())
+			.like(ObjectUtils.isNotNull(staffInformation.getAccountingDepartmentName()), StaffInformation::getAccountingDepartmentName, staffInformation.getAccountingDepartmentName())
+			.like(ObjectUtils.isNotNull(staffInformation.getStaffNo()), StaffInformation::getStaffNo, staffInformation.getStaffNo())
+			.like(ObjectUtils.isNotNull(staffInformation.getCname()), StaffInformation::getCname, staffInformation.getCname())
+			.like(ObjectUtils.isNotNull(staffInformation.getEname()), StaffInformation::getEname, staffInformation.getEname())
+			.eq(ObjectUtils.isNotNull(staffInformation.getGender()), StaffInformation::getGender, staffInformation.getGender())
+			.eq(ObjectUtils.isNotNull(staffInformation.getAdministrativeDepartmentId()), StaffInformation::getAdministrativeDepartmentId, staffInformation.getAdministrativeDepartmentId())
+			.like(ObjectUtils.isNotNull(staffInformation.getAdministrativeDepartmentName()), StaffInformation::getAdministrativeDepartmentName, staffInformation.getAdministrativeDepartmentName())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPosition()), StaffInformation::getPosition, staffInformation.getPosition())
+			.eq(ObjectUtils.isNotNull(staffInformation.getMaritalStatus()), StaffInformation::getMaritalStatus, staffInformation.getMaritalStatus())
+			.eq(ObjectUtils.isNotNull(staffInformation.getOfficeLocation()), StaffInformation::getOfficeLocation, staffInformation.getOfficeLocation())
+			.eq(ObjectUtils.isNotNull(staffInformation.getEducationalBackground()), StaffInformation::getEducationalBackground, staffInformation.getEducationalBackground())
+			.eq(ObjectUtils.isNotNull(staffInformation.getMajor()), StaffInformation::getMajor, staffInformation.getMajor())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherOnFile()), StaffInformation::getWhetherOnFile, staffInformation.getWhetherOnFile())
+			.eq(ObjectUtils.isNotNull(staffInformation.getLanguageCategory()), StaffInformation::getLanguageCategory, staffInformation.getLanguageCategory())
+			.eq(ObjectUtils.isNotNull(staffInformation.getLanguageLevel()), StaffInformation::getLanguageLevel, staffInformation.getLanguageLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherIndefinitelyContract()), StaffInformation::getWhetherIndefinitelyContract, staffInformation.getWhetherIndefinitelyContract())
+			.like(ObjectUtils.isNotNull(staffInformation.getSocialSecurityNo()), StaffInformation::getSocialSecurityNo, staffInformation.getSocialSecurityNo())
+			.eq(ObjectUtils.isNotNull(staffInformation.getSocialSecurityBaseLevel()), StaffInformation::getSocialSecurityBaseLevel, staffInformation.getSocialSecurityBaseLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getProvidentFundLevel()), StaffInformation::getProvidentFundLevel, staffInformation.getProvidentFundLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherMigrantWorkers()), StaffInformation::getWhetherMigrantWorkers, staffInformation.getWhetherMigrantWorkers())
+			.eq(ObjectUtils.isNotNull(staffInformation.getNationality()), StaffInformation::getNationality, staffInformation.getNationality())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPoliticalStatus()), StaffInformation::getPoliticalStatus, staffInformation.getPoliticalStatus())
+			.like(ObjectUtils.isNotNull(staffInformation.getIdNumber()), StaffInformation::getIdNumber, staffInformation.getIdNumber())
+			.like(ObjectUtils.isNotNull(staffInformation.getTel()), StaffInformation::getTel, staffInformation.getTel())
+			.like(ObjectUtils.isNotNull(staffInformation.getEname()), StaffInformation::getEname, staffInformation.getEname())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherEmployedOrNot()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+			.ge(ObjectUtils.isNotNull(staffInformation.getContractPeriodStart()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+			.le(ObjectUtils.isNotNull(staffInformation.getContractPeriodEnd()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+		;
+		if (ObjectUtils.isNotNull(staffInformation.getAdvanceCompanyDateList()) && !staffInformation.getAdvanceCompanyDateList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getAdvanceCompanyDate, staffInformation.getAdvanceCompanyDateList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getAdvanceCompanyDate, staffInformation.getAdvanceCompanyDateList().get(1));
+		}
+		if (ObjectUtils.isNotNull(staffInformation.getTerminationDateList()) && !staffInformation.getTerminationDateList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getTerminationDate, staffInformation.getTerminationDateList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getTerminationDate, staffInformation.getTerminationDateList().get(1));
+		}
+		if (ObjectUtils.isNotNull(staffInformation.getDateOfBirthList()) && !staffInformation.getDateOfBirthList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getDateOfBirth, staffInformation.getDateOfBirthList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getDateOfBirth, staffInformation.getDateOfBirthList().get(1));
+		}
+		IPage<StaffInformation> pages = bStaffInformationService.page(Condition.getPage(query), lambdaQueryWrapper);
+		LocalDate date = LocalDate.now();
+		for (StaffInformation item : pages.getRecords()) {
+			if (ObjectUtils.isNotNull(item.getDateOfBirth())) {
+				java.time.Instant instant = item.getDateOfBirth().toInstant();
+				Period period = Period.between(instant.atZone(ZoneId.systemDefault()).toLocalDate(),date);
+				int year = period.getYears();
+				item.setAge(year);
+			}
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 员工信息表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入bStaffInformation")
+	public R<IPage<StaffInformationVO>> page(StaffInformationVO bStaffInformation, Query query) {
+		IPage<StaffInformationVO> pages = bStaffInformationService.selectBStaffInformationPage(Condition.getPage(query), bStaffInformation);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 员工信息表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入bStaffInformation")
+	public R save(@Valid @RequestBody StaffInformation staffInformation) {
+		return R.status(bStaffInformationService.save(staffInformation));
+	}
+
+	/**
+	 * 修改 员工信息表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入bStaffInformation")
+	public R update(@Valid @RequestBody StaffInformation staffInformation) {
+		return R.status(bStaffInformationService.updateById(staffInformation));
+	}
+
+	/**
+	 * 新增或修改 员工信息表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入bStaffInformation")
+	public R submit(@Valid @RequestBody StaffInformation staffInformation) {
+		return bStaffInformationService.submit(staffInformation);
+	}
+
+
+	/**
+	 * 删除 员工信息表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(bStaffInformationService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 导出 员工信息
+	 */
+	@GetMapping("/exportStaff")
+	public void exportBPorts(StaffInformation staffInformation, HttpServletResponse response) {
+		LambdaQueryWrapper<StaffInformation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(StaffInformation::getTenantId, AuthUtil.getTenantId())
+			.eq(StaffInformation::getIsDeleted, 0)
+			.like(ObjectUtils.isNotNull(staffInformation.getBillNo()), StaffInformation::getBillNo, staffInformation.getBillNo())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPositionType()), StaffInformation::getPositionType, staffInformation.getPositionType())
+			.eq(ObjectUtils.isNotNull(staffInformation.getAccountingDepartmentId()), StaffInformation::getAccountingDepartmentId, staffInformation.getAccountingDepartmentId())
+			.like(ObjectUtils.isNotNull(staffInformation.getAccountingDepartmentName()), StaffInformation::getAccountingDepartmentName, staffInformation.getAccountingDepartmentName())
+			.like(ObjectUtils.isNotNull(staffInformation.getStaffNo()), StaffInformation::getStaffNo, staffInformation.getStaffNo())
+			.like(ObjectUtils.isNotNull(staffInformation.getCname()), StaffInformation::getCname, staffInformation.getCname())
+			.like(ObjectUtils.isNotNull(staffInformation.getEname()), StaffInformation::getEname, staffInformation.getEname())
+			.eq(ObjectUtils.isNotNull(staffInformation.getGender()), StaffInformation::getGender, staffInformation.getGender())
+			.eq(ObjectUtils.isNotNull(staffInformation.getAdministrativeDepartmentId()), StaffInformation::getAdministrativeDepartmentId, staffInformation.getAdministrativeDepartmentId())
+			.like(ObjectUtils.isNotNull(staffInformation.getAdministrativeDepartmentName()), StaffInformation::getAdministrativeDepartmentName, staffInformation.getAdministrativeDepartmentName())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPosition()), StaffInformation::getPosition, staffInformation.getPosition())
+			.eq(ObjectUtils.isNotNull(staffInformation.getMaritalStatus()), StaffInformation::getMaritalStatus, staffInformation.getMaritalStatus())
+			.eq(ObjectUtils.isNotNull(staffInformation.getOfficeLocation()), StaffInformation::getOfficeLocation, staffInformation.getOfficeLocation())
+			.eq(ObjectUtils.isNotNull(staffInformation.getEducationalBackground()), StaffInformation::getEducationalBackground, staffInformation.getEducationalBackground())
+			.eq(ObjectUtils.isNotNull(staffInformation.getMajor()), StaffInformation::getMajor, staffInformation.getMajor())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherOnFile()), StaffInformation::getWhetherOnFile, staffInformation.getWhetherOnFile())
+			.eq(ObjectUtils.isNotNull(staffInformation.getLanguageCategory()), StaffInformation::getLanguageCategory, staffInformation.getLanguageCategory())
+			.eq(ObjectUtils.isNotNull(staffInformation.getLanguageLevel()), StaffInformation::getLanguageLevel, staffInformation.getLanguageLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherIndefinitelyContract()), StaffInformation::getWhetherIndefinitelyContract, staffInformation.getWhetherIndefinitelyContract())
+			.like(ObjectUtils.isNotNull(staffInformation.getSocialSecurityNo()), StaffInformation::getSocialSecurityNo, staffInformation.getSocialSecurityNo())
+			.eq(ObjectUtils.isNotNull(staffInformation.getSocialSecurityBaseLevel()), StaffInformation::getSocialSecurityBaseLevel, staffInformation.getSocialSecurityBaseLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getProvidentFundLevel()), StaffInformation::getProvidentFundLevel, staffInformation.getProvidentFundLevel())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherMigrantWorkers()), StaffInformation::getWhetherMigrantWorkers, staffInformation.getWhetherMigrantWorkers())
+			.eq(ObjectUtils.isNotNull(staffInformation.getNationality()), StaffInformation::getNationality, staffInformation.getNationality())
+			.eq(ObjectUtils.isNotNull(staffInformation.getPoliticalStatus()), StaffInformation::getPoliticalStatus, staffInformation.getPoliticalStatus())
+			.like(ObjectUtils.isNotNull(staffInformation.getIdNumber()), StaffInformation::getIdNumber, staffInformation.getIdNumber())
+			.like(ObjectUtils.isNotNull(staffInformation.getTel()), StaffInformation::getTel, staffInformation.getTel())
+			.like(ObjectUtils.isNotNull(staffInformation.getEname()), StaffInformation::getEname, staffInformation.getEname())
+			.eq(ObjectUtils.isNotNull(staffInformation.getWhetherEmployedOrNot()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+			.ge(ObjectUtils.isNotNull(staffInformation.getContractPeriodStart()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+			.le(ObjectUtils.isNotNull(staffInformation.getContractPeriodEnd()), StaffInformation::getWhetherEmployedOrNot, staffInformation.getWhetherEmployedOrNot())
+		;
+		if (ObjectUtils.isNotNull(staffInformation.getAdvanceCompanyDateList()) && !staffInformation.getAdvanceCompanyDateList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getAdvanceCompanyDate, staffInformation.getAdvanceCompanyDateList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getAdvanceCompanyDate, staffInformation.getAdvanceCompanyDateList().get(1));
+		}
+		if (ObjectUtils.isNotNull(staffInformation.getTerminationDateList()) && !staffInformation.getTerminationDateList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getTerminationDate, staffInformation.getTerminationDateList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getTerminationDate, staffInformation.getTerminationDateList().get(1));
+		}
+		if (ObjectUtils.isNotNull(staffInformation.getDateOfBirthList()) && !staffInformation.getDateOfBirthList().isEmpty()) {
+			lambdaQueryWrapper.ge(StaffInformation::getDateOfBirth, staffInformation.getDateOfBirthList().get(0));
+			lambdaQueryWrapper.le(StaffInformation::getDateOfBirth, staffInformation.getDateOfBirthList().get(1));
+		}
+		List<StaffInformation> bPortsList = bStaffInformationService.list(lambdaQueryWrapper);
+		LocalDate date = LocalDate.now();
+		for (StaffInformation item : bPortsList) {
+			if (ObjectUtils.isNotNull(item.getDateOfBirth())) {
+				java.time.Instant instant = item.getDateOfBirth().toInstant();
+				Period period = Period.between(instant.atZone(ZoneId.systemDefault()).toLocalDate(),date);
+				int year = period.getYears();
+				item.setAge(year);
+			}
+		}
+		if ("1".equals(staffInformation.getWhetherEmployedOrNot())){
+			ExcelUtil.export(response, "在职员工信息", "在职员工信息", BeanUtil.copy(bPortsList, StaffInformationExcel.class), StaffInformationExcel.class);
+		}else{
+			ExcelUtil.export(response, "离职员工信息", "离职员工信息", BeanUtil.copy(bPortsList, StaffInformationExcel.class), StaffInformationExcel.class);
+		}
+
+	}
+
+
+}

+ 5 - 4
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/BStaffInformationMapper.java → blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/StaffInformationMapper.java

@@ -16,10 +16,11 @@
  */
 package org.springblade.los.basic.staff.mapper;
 
-import org.springblade.los.basic.staff.entity.BStaffInformation;
-import org.springblade.los.basic.staff.vo.BStaffInformationVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.basic.staff.entity.StaffInformation;
+import org.springblade.los.basic.staff.vo.StaffInformationVO;
+
 import java.util.List;
 
 /**
@@ -28,7 +29,7 @@ import java.util.List;
  * @author BladeX
  * @since 2025-02-26
  */
-public interface BStaffInformationMapper extends BaseMapper<BStaffInformation> {
+public interface StaffInformationMapper extends BaseMapper<StaffInformation> {
 
 	/**
 	 * 自定义分页
@@ -37,6 +38,6 @@ public interface BStaffInformationMapper extends BaseMapper<BStaffInformation> {
 	 * @param bStaffInformation
 	 * @return
 	 */
-	List<BStaffInformationVO> selectBStaffInformationPage(IPage page, BStaffInformationVO bStaffInformation);
+	List<StaffInformationVO> selectBStaffInformationPage(IPage page, StaffInformationVO bStaffInformation);
 
 }

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/BStaffInformationMapper.xml → blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/mapper/StaffInformationMapper.xml

@@ -1,9 +1,9 @@
 <?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.basic.staff.mapper.BStaffInformationMapper">
+<mapper namespace="org.springblade.los.basic.staff.mapper.StaffInformationMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="bStaffInformationResultMap" type="org.springblade.los.basic.staff.entity.BStaffInformation">
+    <resultMap id="bStaffInformationResultMap" type="org.springblade.los.basic.staff.entity.StaffInformation">
         <id column="id" property="id"/>
         <result column="create_user" property="createUser"/>
         <result column="create_user_name" property="createUserName"/>

+ 5 - 5
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/IBStaffInformationService.java → blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/IStaffInformationService.java

@@ -17,8 +17,8 @@
 package org.springblade.los.basic.staff.service;
 
 import org.springblade.core.tool.api.R;
-import org.springblade.los.basic.staff.entity.BStaffInformation;
-import org.springblade.los.basic.staff.vo.BStaffInformationVO;
+import org.springblade.los.basic.staff.entity.StaffInformation;
+import org.springblade.los.basic.staff.vo.StaffInformationVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
@@ -28,7 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  * @author BladeX
  * @since 2025-02-26
  */
-public interface IBStaffInformationService extends IService<BStaffInformation> {
+public interface IStaffInformationService extends IService<StaffInformation> {
 
 	/**
 	 * 自定义分页
@@ -37,7 +37,7 @@ public interface IBStaffInformationService extends IService<BStaffInformation> {
 	 * @param bStaffInformation
 	 * @return
 	 */
-	IPage<BStaffInformationVO> selectBStaffInformationPage(IPage<BStaffInformationVO> page, BStaffInformationVO bStaffInformation);
+	IPage<StaffInformationVO> selectBStaffInformationPage(IPage<StaffInformationVO> page, StaffInformationVO bStaffInformation);
 
-	R submit(BStaffInformation bStaffInformation);
+	R submit(StaffInformation staffInformation);
 }

+ 31 - 31
blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/impl/BStaffInformationServiceImpl.java → blade-service/blade-los/src/main/java/org/springblade/los/basic/staff/service/impl/StaffInformationServiceImpl.java

@@ -22,21 +22,21 @@ 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.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
-import org.springblade.los.basic.staff.entity.BStaffInformation;
-import org.springblade.los.basic.staff.mapper.BStaffInformationMapper;
-import org.springblade.los.basic.staff.service.IBStaffInformationService;
-import org.springblade.los.basic.staff.vo.BStaffInformationVO;
+import org.springblade.los.basic.staff.entity.StaffInformation;
+import org.springblade.los.basic.staff.mapper.StaffInformationMapper;
+import org.springblade.los.basic.staff.service.IStaffInformationService;
+import org.springblade.los.basic.staff.vo.StaffInformationVO;
 import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
-import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 员工信息表 服务实现类
@@ -46,62 +46,62 @@ import java.util.Date;
  */
 @Service
 @AllArgsConstructor
-public class BStaffInformationServiceImpl extends ServiceImpl<BStaffInformationMapper, BStaffInformation> implements IBStaffInformationService {
+public class StaffInformationServiceImpl extends ServiceImpl<StaffInformationMapper, StaffInformation> implements IStaffInformationService {
 
-	private final ISysClient sysClient;
-
-	private final IDeptUtils deptUtils;
 
 	private final IBusinessTypeService bBusinessTypeService;
 
 	private final IBusinessBillNoService businessBillNoService;
 
 	@Override
-	public IPage<BStaffInformationVO> selectBStaffInformationPage(IPage<BStaffInformationVO> page, BStaffInformationVO bStaffInformation) {
+	public IPage<StaffInformationVO> selectBStaffInformationPage(IPage<StaffInformationVO> page, StaffInformationVO bStaffInformation) {
 		return page.setRecords(baseMapper.selectBStaffInformationPage(page, bStaffInformation));
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public R submit(BStaffInformation bStaffInformation) {
-		BStaffInformation detail = baseMapper.selectOne(new LambdaQueryWrapper<BStaffInformation>()
-			.eq(BStaffInformation::getIdNumber, bStaffInformation.getIdNumber())
-			.eq(BStaffInformation::getTenantId, AuthUtil.getTenantId())
-			.eq(BStaffInformation::getIsDeleted, 0));
-		if (bStaffInformation.getId() == null) {
-			if (detail != null){
+	public R submit(StaffInformation staffInformation) {
+		List<StaffInformation> detail = this.list(new LambdaQueryWrapper<StaffInformation>()
+			.eq(StaffInformation::getIdNumber, staffInformation.getIdNumber())
+			.eq(StaffInformation::getTenantId, AuthUtil.getTenantId())
+			.eq(StaffInformation::getIsDeleted, 0));
+		if (staffInformation.getId() == null) {
+			if (!detail.isEmpty()) {
 				throw new RuntimeException("职员已存在,请勿重复添加");
 			}
 			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
 				.eq(BusinessType::getIsDeleted, 0)
 				.eq(BusinessType::getStatus, 0)
-				.eq(BusinessType::getCode, bStaffInformation.getBusinessTypeCode()));
+				.eq(BusinessType::getCode, staffInformation.getBusinessTypeCode()));
 			if (businessType == null) {
 				throw new RuntimeException("未找到可用业务类型");
 			}
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
-			businessBillNo.setCode(bStaffInformation.getBillNoFormat());
+			businessBillNo.setCode(staffInformation.getBillNoFormat());
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 				return R.fail(500, "生成订单编号失败");
 			}
-			bStaffInformation.setBillNo((String) clientBillNo.getData());
-			bStaffInformation.setCreateTime(new Date());
-			bStaffInformation.setCreateUser(AuthUtil.getUserId());
-			bStaffInformation.setCreateUserName(AuthUtil.getUserName());
+			staffInformation.setBillNo((String) clientBillNo.getData());
+			staffInformation.setCreateTime(new Date());
+			staffInformation.setCreateUser(AuthUtil.getUserId());
+			staffInformation.setCreateUserName(AuthUtil.getUserName());
 		} else {
-			if (detail != null && !detail.getId().equals(bStaffInformation.getId())){
-				throw new RuntimeException("职员已存在,请勿重复添加");
+			if (!detail.isEmpty()) {
+				List<Long> idList = detail.stream().map(StaffInformation::getId).collect(Collectors.toList());
+				if (!idList.isEmpty() && !idList.contains(staffInformation.getId())) {
+					throw new RuntimeException("职员已存在,请勿重复添加");
+				}
 			}
-			bStaffInformation.setUpdateUser(AuthUtil.getUserId());
-			bStaffInformation.setUpdateTime(new Date());
-			bStaffInformation.setUpdateUserName(AuthUtil.getUserName());
+			staffInformation.setUpdateUser(AuthUtil.getUserId());
+			staffInformation.setUpdateTime(new Date());
+			staffInformation.setUpdateUserName(AuthUtil.getUserName());
 		}
-		this.saveOrUpdate(bStaffInformation);
-		return R.data(bStaffInformation);
+		this.saveOrUpdate(staffInformation);
+		return R.data(staffInformation);
 	}
 
 }

+ 74 - 64
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/ReportDataTradeServiceImpl.java

@@ -348,8 +348,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 						throw new RuntimeException("请先维护费用");
 					}
 					list.add(0, bills);
-				}
-				else if (MagicValues.MH.equals(bills.getBillType())) {
+				} else if (MagicValues.MH.equals(bills.getBillType())) {
 					// 分单
 					Bills details = billsService.getOne(new LambdaQueryWrapper<Bills>()
 						.eq(Bills::getId, bills.getMasterId())
@@ -500,10 +499,39 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 				}
 				if (!list.isEmpty()) {
 					for (Bills item : list) {
-						List<FeeCenterReports> feeCenterList = item.getFeeCenterList().stream().sorted(Comparator.comparing(FeeCenterReports::getDc)).collect(Collectors.toList());
-						item.setFeeCenterList(feeCenterList);
-						item.setEquivalentToRmbDr(bCurrency.getExrate().multiply(item.getAmountDrUsd()).setScale(2,RoundingMode.HALF_UP));
-						item.setEquivalentToRmbCr(bCurrency.getExrate().multiply(item.getAmountCrUsd()).setScale(2,RoundingMode.HALF_UP));
+						int count = 0;
+						List<FeeCenterReports> feeCenterListD = item.getFeeCenterList().stream().filter(e -> "D".equals(e.getDc())).collect(Collectors.toList());
+						List<FeeCenterReports> feeCenterListC = item.getFeeCenterList().stream().filter(e -> "C".equals(e.getDc())).collect(Collectors.toList());
+						if (!feeCenterListD.isEmpty()) {
+							count = feeCenterListD.size();
+						}
+						if (!feeCenterListC.isEmpty()) {
+							if (feeCenterListC.size() > count) {
+								count = feeCenterListC.size();
+							}
+						}
+						List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
+						for (int i = 0; i < count; i++) {
+							FeeCenterReports feeCenterReports = new FeeCenterReports();
+							if (feeCenterListD.size() > i) {
+								FeeCenterReports d = feeCenterListD.get(i);
+								feeCenterReports.setFeeCnName(d.getFeeCnName());
+								feeCenterReports.setBillCorpCnName(d.getBillCorpCnName());
+								feeCenterReports.setAmountD(d.getAmountD());
+								feeCenterReports.setCurCode(d.getCurCode());
+							}
+							if (feeCenterListC.size() > i) {
+								FeeCenterReports c = feeCenterListC.get(i);
+								feeCenterReports.setFeeCnNameC(c.getFeeCnName());
+								feeCenterReports.setCorpCnName(c.getCorpCnName());
+								feeCenterReports.setAmountC(c.getAmountC());
+								feeCenterReports.setCurCodeC(c.getCurCodeC());
+							}
+							feeCenterReportsList.add(feeCenterReports);
+						}
+						item.setFeeCenterList(feeCenterReportsList);
+						item.setEquivalentToRmbDr(bCurrency.getExrate().multiply(item.getAmountDrUsd()).setScale(2, RoundingMode.HALF_UP));
+						item.setEquivalentToRmbCr(bCurrency.getExrate().multiply(item.getAmountCrUsd()).setScale(2, RoundingMode.HALF_UP));
 						item.setDept(dept1);
 					}
 				}
@@ -620,8 +648,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.DOCUMENT.equals(reportCode) && (MagicValues.BILLS_DETAIL.equals(groupCode) || MagicValues.BILLS_DETAIL_M.equals(groupCode)) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.DOCUMENT.equals(reportCode) && (MagicValues.BILLS_DETAIL.equals(groupCode) || MagicValues.BILLS_DETAIL_M.equals(groupCode)) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -726,8 +753,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.DISPATCH_NOTICE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.DISPATCH_NOTICE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -805,8 +831,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.INCOMING_NOTIFICATION.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.INCOMING_NOTIFICATION.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -874,8 +899,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -1072,8 +1096,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE_BILL.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE_BILL.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -1214,17 +1237,17 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 				amountDrLoc = amountDrLoc.add(equivalentToRmbDr).add(amountDr);
 				amountCrLoc = amountCrLoc.add(equivalentToRmbCr).add(amountCr);
 				amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
-				bills.setAmountDr(amountDr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCr(amountCr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfit(amountProfit.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountDrUsd(amountDrUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setEquivalentToRmbDr(equivalentToRmbDr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCrUsd(amountCrUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setEquivalentToRmbCr(equivalentToRmbCr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfitUsd(amountProfitUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountDrLoc(amountDrLoc.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCrLoc(amountCrLoc.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfitLoc(amountProfitLoc.setScale(2,RoundingMode.HALF_UP));
+				bills.setAmountDr(amountDr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCr(amountCr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfit(amountProfit.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountDrUsd(amountDrUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setEquivalentToRmbDr(equivalentToRmbDr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCrUsd(amountCrUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setEquivalentToRmbCr(equivalentToRmbCr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfitUsd(amountProfitUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountDrLoc(amountDrLoc.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCrLoc(amountCrLoc.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfitLoc(amountProfitLoc.setScale(2, RoundingMode.HALF_UP));
 				List<BCorpsBank> bCorpsBanks = bCorpsBankService.list(new LambdaQueryWrapper<BCorpsBank>()
 					.eq(BCorpsBank::getTenantId, AuthUtil.getTenantId())
 					.eq(BCorpsBank::getIsDeleted, 0)
@@ -1243,8 +1266,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -1431,8 +1453,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET_BILL.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET_BILL.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
@@ -1573,17 +1594,17 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 				amountDrLoc = amountDrLoc.add(equivalentToRmbDr).add(amountDr);
 				amountCrLoc = amountCrLoc.add(equivalentToRmbCr).add(amountCr);
 				amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
-				bills.setAmountDr(amountDr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCr(amountCr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfit(amountProfit.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountDrUsd(amountDrUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setEquivalentToRmbDr(equivalentToRmbDr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCrUsd(amountCrUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setEquivalentToRmbCr(equivalentToRmbCr.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfitUsd(amountProfitUsd.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountDrLoc(amountDrLoc.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountCrLoc(amountCrLoc.setScale(2,RoundingMode.HALF_UP));
-				bills.setAmountProfitLoc(amountProfitLoc.setScale(2,RoundingMode.HALF_UP));
+				bills.setAmountDr(amountDr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCr(amountCr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfit(amountProfit.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountDrUsd(amountDrUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setEquivalentToRmbDr(equivalentToRmbDr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCrUsd(amountCrUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setEquivalentToRmbCr(equivalentToRmbCr.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfitUsd(amountProfitUsd.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountDrLoc(amountDrLoc.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountCrLoc(amountCrLoc.setScale(2, RoundingMode.HALF_UP));
+				bills.setAmountProfitLoc(amountProfitLoc.setScale(2, RoundingMode.HALF_UP));
 				bills.setDept(dept1);
 				Date date = new Date();
 				SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
@@ -1592,8 +1613,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.PAID_APPLICATION.equals(reportCode) && MagicValues.PAID_APPLICATION.equals(groupCode)) {
+		} else if (MagicValues.PAID_APPLICATION.equals(reportCode) && MagicValues.PAID_APPLICATION.equals(groupCode)) {
 			FinStlBills finStlBills = finStlBillsService.getById(billId);
 			if (finStlBills != null) {
 				finStlBills.setBankAccountBank(finStlBills.getBankAccountBank() + "/" + finStlBills.getBankAccountNo());
@@ -1750,8 +1770,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode)
+		} else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode)
 			|| MagicValues.PAID_APPLICATION.equals(reportCode))
 			&& MagicValues.CHARGE_PAID_OFFSET.equals(groupCode)) {
 			FinStlBills finStlBills = finStlBillsService.getById(billId);
@@ -1811,8 +1830,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode)
+		} else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode)
 			|| MagicValues.PAID_APPLICATION.equals(reportCode))
 			&& (MagicValues.CHARGE_SETTLEMENT.equals(groupCode) || MagicValues.CHARGE.equals(groupCode))) {
 			FinStlBills finStlBills = finStlBillsService.getById(billId);
@@ -1877,8 +1895,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode) || MagicValues.PAID_APPLICATION.equals(reportCode))
+		} else if ((MagicValues.SETTLEMENT_CENTER.equals(reportCode) || MagicValues.RECONCILIATION_CENTER.equals(reportCode) || MagicValues.PAID_APPLICATION.equals(reportCode))
 			&& (MagicValues.PAID_SETTLEMENT.equals(groupCode) || MagicValues.PAID.equals(groupCode))) {
 			FinStlBills finStlBills = finStlBillsService.getById(billId);
 			if (finStlBills != null) {
@@ -1942,8 +1959,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.INVOICE_APPLICATION.equals(reportCode) && MagicValues.CHARGE_PAID_OFFSET.equals(groupCode)) {
+		} else if (MagicValues.INVOICE_APPLICATION.equals(reportCode) && MagicValues.CHARGE_PAID_OFFSET.equals(groupCode)) {
 			FinInvoices finStlBills = finInvoicesService.getById(billId);
 			if (finStlBills != null) {
 				if (ObjectUtils.isNotNull(finStlBills.getCorpId())) {
@@ -2002,8 +2018,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.INVOICE_APPLICATION.equals(reportCode) && MagicValues.CHARGE.equals(groupCode)) {
+		} else if (MagicValues.INVOICE_APPLICATION.equals(reportCode) && MagicValues.CHARGE.equals(groupCode)) {
 			FinInvoices finStlBills = finInvoicesService.getById(billId);
 			if (finStlBills != null) {
 				if (ObjectUtils.isNotNull(finStlBills.getCorpId())) {
@@ -2065,8 +2080,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET.equals(groupCode) && MagicValues.AMEND.equals(type)) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET.equals(groupCode) && MagicValues.AMEND.equals(type)) {
 			Bills bills;
 			Amends amends = amendsService.getById(billId);
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
@@ -2178,8 +2192,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET_BILL.equals(groupCode) && MagicValues.AMEND.equals(type)) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.MEET_BILL.equals(groupCode) && MagicValues.AMEND.equals(type)) {
 			Bills bills;
 			Amends amends = amendsService.getById(billId);
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
@@ -2292,8 +2305,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE.equals(groupCode) && MagicValues.AMEND.equals(type)) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE.equals(groupCode) && MagicValues.AMEND.equals(type)) {
 			Bills bills;
 			Amends amends = amendsService.getById(billId);
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
@@ -2405,8 +2417,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE_BILL.equals(groupCode) && MagicValues.AMEND.equals(type)) {
+		} else if (MagicValues.COST.equals(reportCode) && MagicValues.RECEIVABLE_BILL.equals(groupCode) && MagicValues.AMEND.equals(type)) {
 			Bills bills;
 			Amends amends = amendsService.getById(billId);
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
@@ -2519,8 +2530,7 @@ public class ReportDataTradeServiceImpl implements IReportDataTradeService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}
-		else if ((MagicValues.AMEND_SI.equals(reportCode) || MagicValues.AMEND_SE.equals(reportCode)) && MagicValues.AMEND.equals(type)
+		} else if ((MagicValues.AMEND_SI.equals(reportCode) || MagicValues.AMEND_SE.equals(reportCode)) && MagicValues.AMEND.equals(type)
 			&& (MagicValues.SE.equals(groupCode) || MagicValues.SI.equals(groupCode))) {
 			List<Bills> list = new ArrayList<>();
 			Amends amends = amendsService.getById(billId);

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

@@ -1351,8 +1351,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockOne.setBalanceQuantity(stockOne.getBalanceQuantity().add(item.getSendNum()));
 					stockOne.setBalanceQuantityFinancing(stockOne.getBalanceQuantityFinancing().add(item.getSendNumFinancing()));
 					stockOne.setBalanceQuantityHave(stockOne.getBalanceQuantityHave().add(item.getSendNumHave()));
-//					item.setSendNumHave(new BigDecimal("0"));
-//					item.setSendNumFinancing(new BigDecimal("0"));
 					stockOne.setStoreInventory(stockOne.getBalanceQuantity());
 					BigDecimal inventoryAmount = item.getSendNum().multiply(stockOne.getInventoryCostPrice());
 					BigDecimal rebateInventoryAmount = item.getSendNum().multiply(stockOne.getRebatePrice());
@@ -1360,10 +1358,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockOne.setRebateInventoryAmount(stockOne.getRebateInventoryAmount().add(rebateInventoryAmount));
 					stockOne.setVersion(stockOne.getVersion());
 					pjStockDescArrayList.add(stockOne);
-					/*R res = iStockDescService.updateByIdNew(stockOne);
-					if (!res.isSuccess()) {
-						throw new RuntimeException(res.getMsg());
-					}*/
 				} else {
 					throw new RuntimeException("未查到库存账");
 				}
@@ -1429,244 +1423,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 			throw new RuntimeException("数据异常请联系管理员");
 		}
 
-		/*if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
-			List<ShipItemsRecord> recordList = shipItemsRecordService.list(new LambdaQueryWrapper<ShipItemsRecord>()
-				.eq(ShipItemsRecord::getIsDeleted, 0)
-				.eq(ShipItemsRecord::getTenantId, AuthUtil.getTenantId())
-				.eq(ShipItemsRecord::getPid, ship.getId()));
-			if (!recordList.isEmpty()) {
-				shipItemsRecordService.removeByIds(recordList.stream().map(ShipItemsRecord::getId).collect(Collectors.toList()));
-			}
-			String firstProportion = sysClient.getParamService("first.month.proportion");
-			String secondProportion = sysClient.getParamService("second.month.proportion");
-			PjpfFunding pjpfFunding = pjpfFundingService.getOne(new LambdaQueryWrapper<PjpfFunding>()
-				.eq(PjpfFunding::getTenantId, AuthUtil.getTenantId())
-				.eq(PjpfFunding::getIsDeleted, 0));
-			if (pjpfFunding == null) {
-				throw new RuntimeException("未找到融资总账");
-			}
-			List<String> srcFinancingList = itemsList.stream().filter(e -> ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(e.getBrandName()))
-				.map(PjShipItems::getSrcFinancing).filter(Objects::nonNull).distinct().collect(Collectors.toList());
-			List<FinancingShipItemDto> financingShipItemDtoList = new ArrayList<>();
-			for (String item : srcFinancingList) {
-				ObjectMapper mapper = new ObjectMapper();
-				try {
-					List<FinancingShipItemDto> entities = mapper.readValue(item, new TypeReference<List<FinancingShipItemDto>>() {
-					});
-					if (!entities.isEmpty()) {
-						financingShipItemDtoList.addAll(entities);
-					}
-				} catch (JsonProcessingException e) {
-					throw new RuntimeException(e);
-				}
-			}
-			List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
-				.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
-				.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>()
-				.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
-				.eq(PjOrderItems::getIsDeleted, 0)
-				.eq(PjOrderItems::getBizType, "RZCG")
-				.in(PjOrderItems::getPid, ordIds)
-				.in(PjOrderItems::getId, financingShipItemDtoList.stream().map(FinancingShipItemDto::getId).filter(Objects::nonNull)
-					.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) {
-					items.setOutGoodsTotalShipNum(items.getOutGoodsTotalShipNum().subtract(pjOrderItems.getNum()));
-					items.setThisOutGoodsTotalShipNum(pjOrderItems.getNum());
-					items.setOutGoodsTotalShipAmount(items.getOutGoodsTotalShipAmount().subtract(pjOrderItems.getAmount()));
-					items.setThisOutGoodsTotalShipAmount(pjOrderItems.getAmount());
-				}
-			}
-			orderItemsService.updateBatchById(orderItemsList);
-			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));
-			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(items.getOutGoodsTotalShipNum().subtract(pjOrderItems.stream().map(PjOrderItems::getThisOutGoodsTotalShipNum)
-						.reduce(BigDecimal.ZERO, BigDecimal::add)));
-					items.setOutGoodsTotalShipAmount(items.getOutGoodsTotalShipAmount().subtract(pjOrderItems.stream().map(PjOrderItems::getThisOutGoodsTotalShipAmount)
-						.reduce(BigDecimal.ZERO, BigDecimal::add)));
-				}
-				if (orderIdsList.contains(items.getId())) {
-					if (!"1".equals(items.getWhetherRedeem())) {
-						Date currentDate = new Date();
-						Calendar calendar = Calendar.getInstance();
-						calendar.setTime(currentDate);
-						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::getItemId).collect(Collectors.toList());
-						List<PjShipItems> shipItems = new ArrayList<>();
-						if (!itemIdList.isEmpty()) {
-							shipItems = itemsList.stream().filter(e -> itemIdList.contains(e.getId())).collect(Collectors.toList());
-						}
-						if (currentDate.compareTo(thirtyDayAgo) > 0) {
-							String secondProportionOld = "";
-							if (!shipItems.isEmpty() && ObjectUtils.isNotNull(shipItems.get(0).getProportion())) {
-								secondProportionOld = shipItems.get(0).getProportion();
-							} else {
-								throw new RuntimeException("未找到出库融资比例");
-							}
-							String[] arr = secondProportionOld.split(":");
-							BigDecimal bondAmount = subAmount.multiply(
-								(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							BigDecimal fundingAmount = subAmount.multiply(
-								(new BigDecimal(arr[1]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							if (bondAmount.compareTo(items.getBondAmount()) > 0) {
-								BigDecimal availableAmount = bondAmount.subtract(items.getBondAmount());
-								items.setBondAmount(bondAmount);
-								bondAmountSum = bondAmountSum.add(bondAmount);
-								availableAmountSum = availableAmountSum.subtract(availableAmount);
-							}
-							if (fundingAmount.compareTo(items.getFundingAmount()) > 0) {
-								items.setFundingAmount(fundingAmount);
-								fundingAmountSum = fundingAmountSum.add(fundingAmount);
-							}
-						} else {
-							String firstProportionOld = "";
-							if (!shipItems.isEmpty() && ObjectUtils.isNotNull(shipItems.get(0).getProportion())) {
-								firstProportionOld = shipItems.get(0).getProportion();
-							} else {
-								throw new RuntimeException("未找到出库融资比例");
-							}
-							String[] arr = firstProportionOld.split(":");
-							BigDecimal bondAmount = subAmount.multiply(
-								(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							BigDecimal fundingAmount = subAmount.multiply(
-								(new BigDecimal(arr[1]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							if (bondAmount.compareTo(items.getBondAmount()) > 0) {
-								BigDecimal availableAmount = bondAmount.subtract(items.getBondAmount());
-								items.setBondAmount(bondAmount);
-								bondAmountSum = bondAmountSum.add(bondAmount);
-								availableAmountSum = availableAmountSum.add(availableAmount);
-							}
-							if (fundingAmount.compareTo(items.getFundingAmount()) > 0) {
-								items.setFundingAmount(fundingAmount);
-								fundingAmountSum = fundingAmountSum.add(fundingAmount);
-							}
-						}
-					}
-				} else {
-					if (!"1".equals(items.getWhetherRedeem())) {
-						Date currentDate = new Date();
-						Calendar calendar = Calendar.getInstance();
-						calendar.setTime(currentDate);
-						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()) {
-							shipItems = itemsList.stream().filter(e -> itemIdList.contains(e.getId())).collect(Collectors.toList());
-						}
-						if (currentDate.compareTo(thirtyDayAgo) > 0) {
-							if (!shipItems.isEmpty()) {
-								for (PjShipItems shipItems1 : itemsList) {
-									if (ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(shipItems1.getBrandName())) {
-										shipItems1.setProportion(firstProportion);
-									}
-								}
-							}
-							String[] arr = firstProportion.split(":");
-							BigDecimal bondAmount = subAmount.multiply(
-								(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							BigDecimal fundingAmount = subAmount.multiply(
-								(new BigDecimal(arr[1]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							if (bondAmount.compareTo(items.getBondAmount()) <= 0) {
-								BigDecimal availableAmount = items.getBondAmount().subtract(bondAmount);
-								items.setBondAmount(bondAmount);
-								bondAmountSum = bondAmountSum.add(bondAmount);
-								availableAmountSum = availableAmountSum.add(availableAmount);
-							}
-							if (fundingAmount.compareTo(items.getFundingAmount()) <= 0) {
-								items.setFundingAmount(fundingAmount);
-								fundingAmountSum = fundingAmountSum.add(fundingAmount);
-							}
-						} else {
-							if (!shipItems.isEmpty()) {
-								for (PjShipItems shipItems1 : shipItems) {
-									if (ObjectUtils.isNotNull(financingBrand) && financingBrand.contains(shipItems1.getBrandName())) {
-										shipItems1.setProportion(secondProportion);
-									}
-								}
-							}
-							String[] arr = secondProportion.split(":");
-							BigDecimal bondAmount = subAmount.multiply(
-								(new BigDecimal(arr[0]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							BigDecimal fundingAmount = subAmount.multiply(
-								(new BigDecimal(arr[1]).divide(new BigDecimal("10"), MathContext.DECIMAL32)
-									.setScale(2, RoundingMode.HALF_UP)));
-							if (bondAmount.compareTo(items.getBondAmount()) <= 0) {
-								BigDecimal availableAmount = items.getBondAmount().subtract(bondAmount);
-								items.setBondAmount(bondAmount);
-								bondAmountSum = bondAmountSum.add(bondAmount);
-								availableAmountSum = availableAmountSum.add(availableAmount);
-							}
-							if (fundingAmount.compareTo(items.getFundingAmount()) <= 0) {
-								items.setFundingAmount(fundingAmount);
-								fundingAmountSum = fundingAmountSum.add(fundingAmount);
-							}
-						}
-					}
-				}
-				orderMapper.updateById(items);
-			}
-			pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().add(availableAmountSum));
-			pjpfFunding.setSurplusFundingAmount(fundingAmountSum);
-			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);
-		}*/
 		if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
 			BigDecimal sendNumFinancing = itemsList.stream().map(PjShipItems::getSendNumFinancing).reduce(BigDecimal.ZERO, BigDecimal::add);
 			if (new BigDecimal("0.00").compareTo(sendNumFinancing) != 0) {
@@ -2080,31 +1836,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 	@Transactional(rollbackFor = Exception.class)
 	public R warehousingComplete(PjShip ship) {
 
-		/*if (ObjectUtils.isNotNull(ship.getStorageId())) {
-			String status = sysClient.getParamService("whether.financing");
-			PjStorageDesc storageDesc = storageDescMapper.selectById(ship.getStorageId());
-			if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
-				if (ship.getBizTypeName().equals(OrderTypeEnum.TKSHGD.getType())) {
-					if (storageDesc != null && "1".equals(storageDesc.getWhetherFinancing())) {
-						throw new RuntimeException("请选择自有库");
-					}
-				} else {
-					if ("1".equals(ship.getWhetherFinancing())) {
-						if ("0".equals(storageDesc.getWhetherFinancing())) {
-							throw new RuntimeException("请选择融资库");
-						}
-					} else {
-						if ("1".equals(storageDesc.getWhetherFinancing())) {
-							throw new RuntimeException("请选择自有库");
-						}
-					}
-				}
-			} else {
-				if ("1".equals(ship.getWhetherFinancing())) {
-					throw new RuntimeException("请选择自有库");
-				}
-			}
-		}*/
 		if (ship.getId() == null) {
 			// 获取系统编号
 			String billNo = serialService.getBillNo(OrderTypeEnum.SHGD.getType(), OrderTypeEnum.SHGD.getType(), OrderTypeEnum.SHGD.getType());
@@ -2146,10 +1877,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 				.eq(PjStockDesc::getIsDeleted, 0)
 				.eq(PjStockDesc::getSalesCompanyId, ship.getSalesCompanyId())
 				.in(PjStockDesc::getGoodsId, goodIds);
-//			if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
-			/*if (ObjectUtils.isNotNull(ship.getWhetherFinancing()) && "1".equals(ship.getWhetherFinancing())) {
-				stockLambdaQueryWrapper.apply("find_in_set(po_no,'" + poNo + "')");
-			}*/
 			List<PjStockDesc> pjStockDescList = iStockDescService.list(stockLambdaQueryWrapper);
 			List<PjGoodsType> pjGoodsTypeList = goodsTypeMapper.selectList(new LambdaQueryWrapper<PjGoodsType>()
 				.eq(PjGoodsType::getTenantId, AuthUtil.getTenantId())
@@ -2754,15 +2481,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 
 					BigDecimal inventoryAmount = item.getSendNum().multiply(item.getPrice());
 					stockOne.setInventoryAmount(stockOne.getInventoryAmount().add(inventoryAmount));
-					stockOne.setInventoryCostPrice(stockOne.getInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
+//					stockOne.setInventoryCostPrice(stockOne.getInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
 
 					BigDecimal RebateInventoryAmount = item.getSendNum().multiply(item.getRebatePrice());
 					stockOne.setRebateInventoryAmount(stockOne.getRebateInventoryAmount().add(RebateInventoryAmount));
-					stockOne.setRebatePrice(stockOne.getRebateInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
+//					stockOne.setRebatePrice(stockOne.getRebateInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
 
 					pjStockDescArrayList.add(stockOne);
 				}
-				/* ----------------------修改上架库存---------------------- */
 				//查询所有该商品的库存
 				List<PjStockDesc> stockDescList = pjStockDescList.stream().filter(e -> e.getGoodsId().equals(goodsDesc.getId())).collect(Collectors.toList());
 				//库存总数量
@@ -2776,7 +2502,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 						pjProductLaunchList.add(e);
 					}
 				}
-				/* ----------------------修改上架库存---------------------- */
 			}
 			shipItemsService.saveOrUpdateBatch(shipItemsList);
 			iStockDescService.saveOrUpdateBatch(pjStockDescArrayList);
@@ -3482,10 +3207,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockOneR.setStoreInventory(stockOneR.getBalanceQuantity());
 					stockOneR.setInventoryAmount(stockOneR.getInventoryAmount().add(orderItems.getGoodsNum()
 						.multiply(stockOneC.getInventoryCostPrice())));
-					stockOneR.setInventoryCostPrice(stockOneR.getInventoryAmount().divide(stockOneR.getBalanceQuantity(), 2, RoundingMode.HALF_UP));
+//					stockOneR.setInventoryCostPrice(stockOneR.getInventoryAmount().divide(stockOneR.getBalanceQuantity(), 2, RoundingMode.HALF_UP));
 					stockOneR.setRebateInventoryAmount(stockOneR.getRebateInventoryAmount().add(orderItems.getGoodsNum()
 						.multiply(stockOneC.getRebatePrice())));
-					stockOneR.setRebatePrice(stockOneR.getRebateInventoryAmount().divide(stockOneR.getBalanceQuantity(), 2, RoundingMode.HALF_UP));
+//					stockOneR.setRebatePrice(stockOneR.getRebateInventoryAmount().divide(stockOneR.getBalanceQuantity(), 2, RoundingMode.HALF_UP));
 					stockOneR.setVersion(stockOneR.getVersion());
 					pjStockDescList.add(stockOneR);
 				} else {
@@ -4072,10 +3797,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockOne.setInventoryAmount(stockOne.getInventoryAmount().subtract(inventoryAmount));
 					stockOne.setRebateInventoryAmount(stockOne.getRebateInventoryAmount().subtract(rebateInventoryAmount));
 					stockOne.setVersion(stockOne.getVersion());
-					if (stockOne.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
+					/*if (stockOne.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
 						stockOne.setInventoryCostPrice(stockOne.getInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
 						stockOne.setRebatePrice(stockOne.getRebateInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
-					}
+					}*/
 					pjStockDescArrayList.add(stockOne);
 				} else {
 					System.err.println("商品:" + goodsDesc.getCname());
@@ -4518,10 +4243,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockOne.setInventoryAmount(stockOne.getInventoryAmount().add(inventoryAmount));
 					stockOne.setRebateInventoryAmount(stockOne.getRebateInventoryAmount().add(rebateInventoryAmount));
 					stockOne.setVersion(stockOne.getVersion());
-					if (stockOne.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
+					/*if (stockOne.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
 						stockOne.setInventoryCostPrice(stockOne.getInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
 						stockOne.setRebatePrice(stockOne.getRebateInventoryAmount().divide(stockOne.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
-					}
+					}*/
 					pjStockDescArrayList.add(stockOne);
 					/*R res = iStockDescService.updateByIdNew(stockOne);
 					if (!res.isSuccess()) {

+ 183 - 86
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

@@ -46,6 +46,9 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.math.MathContext;
 import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -78,97 +81,192 @@ public class StatisticsServiceImpl implements IStatisticsService {
 	@Override
 	public R<Map<String, Object>> amountStatistics() {
 		Map<String, Object> map = new HashMap<>();
-		BigDecimal dealAmountD = new BigDecimal("0.00");
-		BigDecimal dealAmountM = new BigDecimal("0.00");
-		BigDecimal salesNumD = new BigDecimal("0.00");
-		BigDecimal salesNumM = new BigDecimal("0.00");
-		BigDecimal stlAmountD = new BigDecimal("0.00");
-		BigDecimal stlAmountM = new BigDecimal("0.00");
-		BigDecimal profitD = new BigDecimal("0.00");
-		BigDecimal profitM = new BigDecimal("0.00");
-		BigDecimal returnsNumberD = new BigDecimal("0.00");
-		BigDecimal returnsNumberM = new BigDecimal("0.00");
-		BigDecimal returnsAmountD = new BigDecimal("0.00");
-		BigDecimal returnsAmountM = new BigDecimal("0.00");
-		//成本
-		BigDecimal costD = new BigDecimal("0.00");
-		BigDecimal costM = new BigDecimal("0.00");
-		BigDecimal returnsCostD = new BigDecimal("0.00");
-		BigDecimal returnsCostM = new BigDecimal("0.00");
-		List<PjOrder> pjOrderListD = orderService.list(new LambdaQueryWrapper<PjOrder>()
-			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
-			.eq(PjOrder::getSalesCompanyId, AuthUtil.getDeptId())
-			.eq(PjOrder::getIsDeleted, 0)
-			.eq(PjOrder::getBsType, "XS")
-			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
-				"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
-				" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
-			.apply("FIND_IN_SET( status, '已发货,已收货' ) and busines_date = CURDATE()"));
-		if (!pjOrderListD.isEmpty()) {
-			List<Long> orderIdsD = pjOrderListD.stream().map(PjOrder::getId).collect(Collectors.toList());
-			if (!orderIdsD.isEmpty()) {
-				List<PjOrderItems> pjOrderItemsListD = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
-					.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
+		SaleDetail saleDetailDto = new SaleDetail();
+		saleDetailDto.setTenantId(AuthUtil.getTenantId());
+		saleDetailDto.setSalesCompanyId(AuthUtil.getDeptId());
+		saleDetailDto.setBsType("XS,TKXS");
+		saleDetailDto.setIsContain("1");
+		LocalDate today = LocalDate.now();
+		// 获取当前月的第一天
+		LocalDate firstDayOfMonth = today.withDayOfMonth(1);
+		// 获取当前月的最后一天
+		YearMonth yearMonth = YearMonth.from(today);
+		LocalDate lastDayOfMonth = yearMonth.atEndOfMonth();
+		// 格式化日期
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+		String formattedFirstDay = firstDayOfMonth.format(formatter);
+		String formattedLastDay = lastDayOfMonth.format(formatter);
+		saleDetailDto.setBusinesDateStart(formattedFirstDay);
+		saleDetailDto.setBusinesDateEnd(formattedLastDay);
+		List<SaleDetailDto> saleDetailDtoList = orderItemsService.saleDetailList(saleDetailDto);
+		if (!saleDetailDtoList.isEmpty()) {
+			String billNo = saleDetailDtoList.stream().map(SaleDetailDto::getOrdNo).distinct().collect(Collectors.joining(","));
+			List<PjOrder> pjOrderList = orderService.list(new LambdaQueryWrapper<PjOrder>()
+				.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+				.eq(PjOrder::getIsDeleted, 0)
+				.apply("find_in_set(ord_no,'" + billNo + "')")
+				.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
+				.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
+			);
+			List<Long> pids = pjOrderList.stream().map(PjOrder::getId).collect(Collectors.toList());
+			List<PjOrderItems> pjOrderItemsList = new ArrayList<>();
+			if (!pids.isEmpty()) {
+				pjOrderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
 					.eq(PjOrderItems::getIsDeleted, 0)
-					.in(PjOrderItems::getPid, orderIdsD));
-				if (!pjOrderItemsListD.isEmpty()) {
-					salesNumD = pjOrderItemsListD.stream().map(PjOrderItems::getSendNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					dealAmountD = pjOrderItemsListD.stream().map(PjOrderItems::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsAmountD = pjOrderItemsListD.stream().map(PjOrderItems::getReturnsAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsNumberD = pjOrderItemsListD.stream().map(PjOrderItems::getReturnsNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					costD = pjOrderItemsListD.stream().map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsCostD = pjOrderItemsListD.stream().filter(e -> ObjectUtils.isNotNull(e.getReturnsNumber())
-							&& new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0)
-						.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+					.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
+					.in(PjOrderItems::getPid, pids));
+			}
+			for (PjOrder item : pjOrderList) {
+				List<SaleDetailDto> saleDetailDtoList1 = saleDetailDtoList.stream()
+					.filter(e -> e.getOrdNo().equals(item.getOrdNo())).collect(Collectors.toList());
+				if (!saleDetailDtoList1.isEmpty()) {
+					for (SaleDetailDto items : saleDetailDtoList1) {
+						if (!pjOrderItemsList.isEmpty()) {
+							PjOrderItems orderItems = pjOrderItemsList.stream().filter(e -> e.getId().equals(items.getItemId())).findFirst().orElse(null);
+							if (orderItems != null) {
+								items.setGoodsNum(orderItems.getGoodsNum());
+								items.setPrice(orderItems.getPrice());
+								items.setSubTotalMoney(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
+								items.setSubTotalMoney(items.getSubTotalMoney().add(item.getFreight()));
+								items.setCostprie(orderItems.getGoodsNum().multiply(orderItems.getCostpriePrice()));
+								items.setProfit(items.getSubTotalMoney().subtract(items.getCostprie()));
+								items.setReturnsNumber(orderItems.getReturnsNumber());
+								items.setReturnsAmount(orderItems.getReturnsAmount());
+								items.setCostpriePrice(orderItems.getCostpriePrice());
+							}
+						}
+						if ("TKXS".equals(item.getBsType()) || "TKCG".equals(item.getBsType())) {
+							items.setGoodsNum(new BigDecimal("0.00").subtract(items.getReturnsNumber()));
+							items.setSubTotalMoney(new BigDecimal("0.00").subtract(items.getReturnsAmount()).subtract(item.getFreight()));
+							items.setFreight(new BigDecimal("0.00").subtract(items.getFreight()));
+							BigDecimal costprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+							BigDecimal profit = items.getSubTotalMoney().abs().subtract(costprie);
+							items.setProfit(new BigDecimal("0.00").subtract(profit));
+							items.setCostprie(new BigDecimal("0.00").subtract(costprie));
+						}
+					}
 				}
 			}
-			salesNumD = salesNumD.subtract(returnsNumberD);
-			dealAmountD = dealAmountD.subtract(returnsAmountD);
-			costD = costD.subtract(returnsCostD);
-			stlAmountD = pjOrderListD.stream().filter(e -> ObjectUtils.isNotNull(e.getOldTrxId()) && "已发货".equals(e.getStatus())).map(PjOrder::getSalesAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-			profitD = dealAmountD.subtract(costD);
-		}
-		List<PjOrder> pjOrderListM = orderService.list(new LambdaQueryWrapper<PjOrder>()
-			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
-			.eq(PjOrder::getSalesCompanyId, AuthUtil.getDeptId())
-			.eq(PjOrder::getIsDeleted, 0)
-			.eq(PjOrder::getBsType, "XS")
-			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
-				"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
-				" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
-			.apply("FIND_IN_SET( status, '已发货,已收货' ) and DATE_FORMAT(busines_date, '%Y-%m') = DATE_FORMAT(CURRENT_DATE(), '%Y-%m')"));
-		if (!pjOrderListM.isEmpty()) {
-			List<Long> orderIdsM = pjOrderListM.stream().map(PjOrder::getId).collect(Collectors.toList());
-			if (!orderIdsM.isEmpty()) {
-				List<PjOrderItems> pjOrderItemsListM = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
-					.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
-					.eq(PjOrderItems::getIsDeleted, 0)
-					.in(PjOrderItems::getPid, orderIdsM));
-				if (!pjOrderItemsListM.isEmpty()) {
-					salesNumM = pjOrderItemsListM.stream().map(PjOrderItems::getSendNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					dealAmountM = pjOrderItemsListM.stream().map(PjOrderItems::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsAmountM = pjOrderItemsListM.stream().map(PjOrderItems::getReturnsAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsNumberM = pjOrderItemsListM.stream().map(PjOrderItems::getReturnsNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					costM = pjOrderItemsListM.stream().map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-					returnsCostM = pjOrderItemsListM.stream().filter(e -> ObjectUtils.isNotNull(e.getReturnsNumber())
-							&& new BigDecimal("0").compareTo(e.getReturnsNumber()) != 0)
-						.map(PjOrderItems::getCostprie).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal goodsNumActual = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getGoodsNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal subTotalMoneyActual = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal profitActual = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal stlAmountActual = saleDetailDtoList.stream().filter(e -> !"已取消".equals(e.getStatus()) &&
+					!"已完成".equals(e.getStatus()) && "外部销售".equals(e.getBusinessSource()))
+				.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal goodsNumReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getGoodsNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal subTotalMoneyReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal profitReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
+				.map(SaleDetailDto::getProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+				.setScale(0, RoundingMode.HALF_UP).abs();
+			BigDecimal stlAmountReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()) &&
+					"外部销售".equals(e.getBusinessSource())).map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull)
+				.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(0, RoundingMode.HALF_UP);
+			map.put("dealAmountM", subTotalMoneyActual.subtract(subTotalMoneyReturns));
+			map.put("salesNumM", goodsNumActual.subtract(goodsNumReturns));
+			map.put("stlAmountM", stlAmountActual.subtract(stlAmountReturns));
+			map.put("profitM", profitActual.subtract(profitReturns));
+			String formattedDay = today.format(formatter);
+			List<SaleDetailDto> saleDetailDayList = saleDetailDtoList.stream().filter(e -> e.getBusinesDate().equals(formattedDay))
+				.collect(Collectors.toList());
+			if (!saleDetailDayList.isEmpty()) {
+				String billNoDay = saleDetailDayList.stream().map(SaleDetailDto::getOrdNo).distinct().collect(Collectors.joining(","));
+				List<PjOrder> pjOrderListDay = orderService.list(new LambdaQueryWrapper<PjOrder>()
+					.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+					.eq(PjOrder::getIsDeleted, 0)
+					.apply("find_in_set(ord_no,'" + billNoDay + "')")
+					.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
+					.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
+				);
+				List<Long> pidsDay = pjOrderList.stream().map(PjOrder::getId).collect(Collectors.toList());
+				List<PjOrderItems> pjOrderItemsListDay = new ArrayList<>();
+				if (!pids.isEmpty()) {
+					pjOrderItemsListDay = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
+						.eq(PjOrderItems::getIsDeleted, 0)
+						.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
+						.in(PjOrderItems::getPid, pidsDay));
 				}
+				for (PjOrder item : pjOrderListDay) {
+					List<SaleDetailDto> saleDetailDtoList1 = saleDetailDayList.stream()
+						.filter(e -> e.getOrdNo().equals(item.getOrdNo())).collect(Collectors.toList());
+					if (!saleDetailDtoList1.isEmpty()) {
+						for (SaleDetailDto items : saleDetailDtoList1) {
+							if (!pjOrderItemsList.isEmpty()) {
+								PjOrderItems orderItems = pjOrderItemsListDay.stream().filter(e -> e.getId().equals(items.getItemId())).findFirst().orElse(null);
+								if (orderItems != null) {
+									items.setGoodsNum(orderItems.getGoodsNum());
+									items.setPrice(orderItems.getPrice());
+									items.setSubTotalMoney(orderItems.getGoodsNum().multiply(orderItems.getPrice()));
+									items.setSubTotalMoney(items.getSubTotalMoney().add(item.getFreight()));
+									items.setCostprie(orderItems.getGoodsNum().multiply(orderItems.getCostpriePrice()));
+									items.setProfit(items.getSubTotalMoney().subtract(items.getCostprie()));
+									items.setReturnsNumber(orderItems.getReturnsNumber());
+									items.setReturnsAmount(orderItems.getReturnsAmount());
+									items.setCostpriePrice(orderItems.getCostpriePrice());
+								}
+							}
+							if ("TKXS".equals(item.getBsType()) || "TKCG".equals(item.getBsType())) {
+								items.setGoodsNum(new BigDecimal("0.00").subtract(items.getReturnsNumber()));
+								items.setSubTotalMoney(new BigDecimal("0.00").subtract(items.getReturnsAmount()).subtract(item.getFreight()));
+								items.setFreight(new BigDecimal("0.00").subtract(items.getFreight()));
+								BigDecimal costprie = items.getReturnsNumber().multiply(items.getCostpriePrice());
+								BigDecimal profit = items.getSubTotalMoney().abs().subtract(costprie);
+								items.setProfit(new BigDecimal("0.00").subtract(profit));
+								items.setCostprie(new BigDecimal("0.00").subtract(costprie));
+							}
+						}
+					}
+				}
+				BigDecimal goodsNumActualDay = saleDetailDayList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getGoodsNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal subTotalMoneyActualDay = saleDetailDayList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal profitActualDay = saleDetailDayList.stream().filter(e -> !"已取消".equals(e.getStatus()) && !"已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal stlAmountActualDay = saleDetailDayList.stream().filter(e -> !"已取消".equals(e.getStatus()) &&
+						!"已完成".equals(e.getStatus()) && "外部销售".equals(e.getBusinessSource()))
+					.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal goodsNumReturnsDay = saleDetailDayList.stream().filter(e -> "已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getGoodsNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal subTotalMoneyReturnsDay = saleDetailDayList.stream().filter(e -> "已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal profitReturnsDay = saleDetailDayList.stream().filter(e -> "已完成".equals(e.getStatus()))
+					.map(SaleDetailDto::getProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)
+					.setScale(0, RoundingMode.HALF_UP).abs();
+				BigDecimal stlAmountReturnsDay = saleDetailDayList.stream().filter(e -> "已完成".equals(e.getStatus()) &&
+						"外部销售".equals(e.getBusinessSource())).map(SaleDetailDto::getSubTotalMoney).filter(Objects::nonNull)
+					.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(0, RoundingMode.HALF_UP);
+				map.put("dealAmountD", subTotalMoneyActualDay.subtract(goodsNumReturnsDay));
+				map.put("salesNumD", goodsNumActualDay.subtract(subTotalMoneyReturnsDay));
+				map.put("stlAmountD", stlAmountActualDay.subtract(stlAmountReturnsDay));
+				map.put("profitD", profitActualDay.subtract(profitReturnsDay));
 			}
-			salesNumM = salesNumM.subtract(returnsNumberM);
-			dealAmountM = dealAmountM.subtract(returnsAmountM);
-			costM = costM.subtract(returnsCostM);
-			stlAmountM = pjOrderListM.stream().filter(e -> ObjectUtils.isNotNull(e.getOldTrxId()) && "已发货".equals(e.getStatus())).map(PjOrder::getSalesAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-			profitM = dealAmountM.subtract(costM);
+		}else{
+			map.put("dealAmountD", new BigDecimal("0.00"));
+			map.put("dealAmountM", new BigDecimal("0.00"));
+			map.put("salesNumD", new BigDecimal("0"));
+			map.put("salesNumM", new BigDecimal("0"));
+			map.put("stlAmountD", new BigDecimal("0.00"));
+			map.put("stlAmountM", new BigDecimal("0.00"));
+			map.put("profitD", new BigDecimal("0.00"));
+			map.put("profitM", new BigDecimal("0.00"));
 		}
-		map.put("dealAmountD", dealAmountD);
-		map.put("dealAmountM", dealAmountM);
-		map.put("salesNumD", salesNumD);
-		map.put("salesNumM", salesNumM);
-		map.put("stlAmountD", stlAmountD);
-		map.put("stlAmountM", stlAmountM);
-		map.put("profitD", profitD);
-		map.put("profitM", profitM);
 		return R.data(map);
 	}
 
@@ -943,7 +1041,6 @@ public class StatisticsServiceImpl implements IStatisticsService {
 			map.put("primaryGoodsTotalMoney", "0.00");
 			map.put("surplusNum", "0.00");
 			map.put("surplusAmount", "0.00");
-
 		}
 		return R.data(map);
 	}

+ 37 - 37
blade-service/blade-sales-part/src/main/resources/log/logback-dev.xml

@@ -58,56 +58,56 @@
     </if>
 
     <!-- 日志输出级别 -->
-    <root level="info">
+    <root level="ERROR">
         <appender-ref ref="STDOUT"/>
         <appender-ref ref="${STDOUT_APPENDER}"/>
     </root>
 
-    <logger name="net.sf.ehcache" level="info"/>
-    <logger name="druid.sql" level="info"/>
+    <logger name="net.sf.ehcache" level="ERROR"/>
+    <logger name="druid.sql" level="ERROR"/>
 
 
     <!-- MyBatis log configure -->
-    <logger name="com.apache.ibatis" level="info"/>
-    <logger name="org.mybatis.spring" level="info"/>
-    <logger name="java.sql.Connection" level="info"/>
-    <logger name="java.sql.Statement" level="info"/>
-    <logger name="java.sql.PreparedStatement" level="info"/>
+    <logger name="com.apache.ibatis" level="ERROR"/>
+    <logger name="org.mybatis.spring" level="ERROR"/>
+    <logger name="java.sql.Connection" level="ERROR"/>
+    <logger name="java.sql.Statement" level="ERROR"/>
+    <logger name="java.sql.PreparedStatement" level="ERROR"/>
 
     <!-- 减少部分debug日志 -->
-    <logger name="druid.sql" level="info"/>
-    <logger name="org.apache.shiro" level="info"/>
-    <logger name="org.mybatis.spring" level="info"/>
-    <logger name="org.springframework" level="info"/>
-    <logger name="org.springframework.context" level="info"/>
-    <logger name="org.springframework.beans" level="info"/>
-    <logger name="com.baomidou.mybatisplus" level="info"/>
-    <logger name="org.apache.ibatis.io" level="info"/>
-    <logger name="org.apache.velocity" level="info"/>
-    <logger name="org.eclipse.jetty" level="info"/>
-    <logger name="io.undertow" level="info"/>
-    <logger name="org.xnio.nio" level="info"/>
-    <logger name="org.thymeleaf" level="info"/>
-    <logger name="springfox.documentation" level="info"/>
-    <logger name="org.hibernate.validator" level="info"/>
-    <logger name="com.netflix.loadbalancer" level="info"/>
-    <logger name="com.netflix.hystrix" level="info"/>
-    <logger name="com.netflix.zuul" level="info"/>
-    <logger name="de.codecentric" level="info"/>
-    <!-- cache info -->
-    <logger name="net.sf.ehcache" level="info"/>
-    <logger name="org.springframework.cache" level="info"/>
+    <logger name="druid.sql" level="ERROR"/>
+    <logger name="org.apache.shiro" level="ERROR"/>
+    <logger name="org.mybatis.spring" level="ERROR"/>
+    <logger name="org.springframework" level="ERROR"/>
+    <logger name="org.springframework.context" level="ERROR"/>
+    <logger name="org.springframework.beans" level="ERROR"/>
+    <logger name="com.baomidou.mybatisplus" level="ERROR"/>
+    <logger name="org.apache.ibatis.io" level="ERROR"/>
+    <logger name="org.apache.velocity" level="ERROR"/>
+    <logger name="org.eclipse.jetty" level="ERROR"/>
+    <logger name="io.undertow" level="ERROR"/>
+    <logger name="org.xnio.nio" level="ERROR"/>
+    <logger name="org.thymeleaf" level="ERROR"/>
+    <logger name="springfox.documentation" level="ERROR"/>
+    <logger name="org.hibernate.validator" level="ERROR"/>
+    <logger name="com.netflix.loadbalancer" level="ERROR"/>
+    <logger name="com.netflix.hystrix" level="ERROR"/>
+    <logger name="com.netflix.zuul" level="ERROR"/>
+    <logger name="de.codecentric" level="ERROR"/>
+    <!-- cache ERROR -->
+    <logger name="net.sf.ehcache" level="ERROR"/>
+    <logger name="org.springframework.cache" level="ERROR"/>
     <!-- cloud -->
-    <logger name="org.apache.http" level="info"/>
-    <logger name="com.netflix.discovery" level="info"/>
-    <logger name="com.netflix.eureka" level="info"/>
+    <logger name="org.apache.http" level="ERROR"/>
+    <logger name="com.netflix.discovery" level="ERROR"/>
+    <logger name="com.netflix.eureka" level="ERROR"/>
     <!-- 业务日志 -->
-    <Logger name="org.springblade" level="info"/>
-    <Logger name="org.springblade.core.tenant" level="info"/>
-    <Logger name="org.springblade.core.version" level="info"/>
+    <Logger name="org.springblade" level="ERROR"/>
+    <Logger name="org.springblade.core.tenant" level="ERROR"/>
+    <Logger name="org.springblade.core.version" level="ERROR"/>
 
     <!-- 减少nacos日志 -->
-    <logger name="com.alibaba.nacos" level="info"/>
+    <logger name="com.alibaba.nacos" level="ERROR"/>
 
 
 </configuration>

+ 13 - 20
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/AccServiceImpl.java

@@ -528,9 +528,6 @@ public class AccServiceImpl extends ServiceImpl<AccMapper, Acc> implements IAccS
 			.eq(Items::getTenantId,AuthUtil.getTenantId())
 			.eq(Items::getIsDeleted,0)
 			.in(Items::getSrcParentId,srcParentId));
-		if (itemsList.isEmpty()){
-			return true;
-		}
 		for (Items item:itemsList){
 			item.setSrcOrderno(newOrdNo);
 			item.setSrcRefno(newOrdNo);
@@ -538,23 +535,19 @@ public class AccServiceImpl extends ServiceImpl<AccMapper, Acc> implements IAccS
 			item.setUpdateUser(AuthUtil.getUserId());
 			itemsMapper.updateById(item);
 		}
-		List<Long> setIds = itemsList.stream().map(Items::getPid).distinct().collect(Collectors.toList());
-		if (setIds.isEmpty()){
-			return true;
-		}
-		List<Settlement> settlementList = settlementMapper.selectList(new LambdaQueryWrapper<Settlement>()
-			.eq(Settlement::getTenantId,AuthUtil.getTenantId())
-			.eq(Settlement::getIsDeleted,0)
-			.in(Settlement::getAccId,setIds));
-		if (settlementList.isEmpty()){
-			return true;
-		}
-		for (Settlement item:settlementList){
-			if (ObjectUtils.isNotNull(item.getSrcOrderno())){
-				item.setSrcOrderno(item.getSrcOrderno().replace(oldOrdNo,newOrdNo));
-				item.setUpdateTime(new Date());
-				item.setUpdateUser(AuthUtil.getUserId());
-				settlementMapper.updateById(item);
+		if (!itemsList.isEmpty()){
+			List<Long> setIds = itemsList.stream().map(Items::getPid).distinct().collect(Collectors.toList());
+			List<Settlement> settlementList = settlementMapper.selectList(new LambdaQueryWrapper<Settlement>()
+				.eq(Settlement::getTenantId,AuthUtil.getTenantId())
+				.eq(Settlement::getIsDeleted,0)
+				.in(Settlement::getAccId,setIds));
+			for (Settlement item:settlementList){
+				if (ObjectUtils.isNotNull(item.getSrcOrderno())){
+					item.setSrcOrderno(item.getSrcOrderno().replace(oldOrdNo,newOrdNo));
+					item.setUpdateTime(new Date());
+					item.setUpdateUser(AuthUtil.getUserId());
+					settlementMapper.updateById(item);
+				}
 			}
 		}
 		return this.updateBatchById(accList);