纪新园 пре 2 година
родитељ
комит
26e18cf3dd
29 измењених фајлова са 1528 додато и 57 уклоњено
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/dto/ReportsLogDTO.java
  2. 161 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/entity/ReportsLog.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/vo/ReportsLogVO.java
  4. 143 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/dto/DecisionAnalysis.java
  5. 2 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  6. 80 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/dto/FeeCenterReports.java
  7. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/controller/ReportsLogController.java
  8. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsLogMapper.java
  9. 37 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsLogMapper.xml
  10. 48 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsLogService.java
  11. 75 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsLogServiceImpl.java
  12. 123 15
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  13. 58 8
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/ContainersController.java
  14. 9 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.java
  15. 58 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  16. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java
  17. 11 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IContainersService.java
  18. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  19. 132 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/ContainersServiceImpl.java
  20. 4 4
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java
  21. 64 0
      blade-service/blade-los/src/main/java/org/springblade/los/excel/BoxAndLeadSealNoExcel.java
  22. 26 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/controller/FeeCenterController.java
  23. 7 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/IFeeCenterService.java
  24. 78 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java
  25. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java
  26. 58 0
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/StatisticAnalysisController.java
  27. 48 0
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java
  28. 40 0
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  29. 24 27
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/dto/ReportsLogDTO.java

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

+ 161 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/entity/ReportsLog.java

@@ -0,0 +1,161 @@
+/*
+ *      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.reports.entity;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 基础资料-报表打印记录实体类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Data
+@TableName("los_b_reports_log")
+@ApiModel(value = "ReportsLog对象", description = "基础资料-报表打印记录")
+public class ReportsLog implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建部门 Id
+	 */
+	@ApiModelProperty(value = "创建部门 Id")
+	private String createDept;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private String createDeptName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@TableLogic(value = "0", delval = "1")
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+	/**
+	 * 报表编码
+	 */
+	@ApiModelProperty(value = "报表编码")
+	private String reportsCode;
+	/**
+	 * 业务类型
+	 */
+	@ApiModelProperty(value = "业务类型")
+	private String businessType;
+	/**
+	 * 组别
+	 */
+	@ApiModelProperty(value = "组别")
+	private String groupCode;
+	/**
+	 * 打印时间
+	 */
+	@ApiModelProperty(value = "打印时间")
+	private Date printTime;
+	/**
+	 * 业务id
+	 */
+	@ApiModelProperty(value = "业务id")
+	private Long billId;
+	/**
+	 * 打印内容
+	 */
+	@ApiModelProperty(value = "打印内容")
+	private String printContent;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/vo/ReportsLogVO.java

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

+ 143 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/dto/DecisionAnalysis.java

@@ -0,0 +1,143 @@
+package org.springblade.los.business.sea.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/11/29
+ */
+@Data
+public class DecisionAnalysis {
+
+	/**
+	 * 客户中文名称
+	 */
+	private String customer;
+
+	/**
+	 * 来源中文
+	 */
+	private String analysis;
+
+	/**
+	 * 单据编号
+	 */
+	private String billNo;
+
+	/**
+	 * MB/L NO
+	 */
+	private String mblno;
+
+	/**
+	 * 订舱号
+	 */
+	private String bookingNo;
+
+	/**
+	 * HB/L NO
+	 */
+	private String hblno;
+
+	/**
+	 * 场站中文名称
+	 */
+	private String depot;
+
+	/**
+	 * 航线
+	 */
+	private String lane;
+
+	/**
+	 * 操作人
+	 */
+	private String op;
+
+	/**
+	 * 船公司英文名称
+	 */
+	private String carrier;
+
+	/**
+	 * 船名
+	 */
+	private String vessel;
+
+	/**
+	 * 航次
+	 */
+	private String voyageNo;
+
+	/**
+	 * 装货港英文名称
+	 */
+	private String pol;
+
+	/**
+	 * 卸货港英文名称
+	 */
+	private String pod;
+
+	/**
+	 * MB/L 收货人国家名称
+	 */
+	private String podCountry;
+
+	/**
+	 * MB/L 付款方式
+	 */
+	private String freight;
+
+	/**
+	 * 开船日期
+	 */
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	private String etd;
+
+	/**
+	 * 到港日期
+	 */
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	private String eta;
+
+	/**
+	 * 20GP
+	 */
+	private String quantityV20;
+
+	/**
+	 * 40GP
+	 */
+	private String quantityV40;
+
+	/**
+	 * 45GP
+	 */
+	private String quantityV45;
+
+	/**
+	 * 48GP
+	 */
+	private String quantityV48;
+
+	/**
+	 * 40hc
+	 */
+	private String quantityV40hc;
+
+	/**
+	 * 租户
+	 */
+	private String tenantId;
+
+	/**
+	 * 排序字段
+	 */
+	private String sort;
+
+}

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

@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.sea.dto.WaitingBox;
+import org.springblade.los.finance.fee.dto.FeeCenterReports;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -1483,7 +1484,7 @@ public class Bills implements Serializable {
 	 * 物流-费用中心(总)
 	 */
 	@TableField(exist = false)
-	private List<FeeCenter> feeCenterList;
+	private List<FeeCenterReports> feeCenterList;
 
 	/**
 	 * 文件

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

@@ -0,0 +1,80 @@
+/*
+ *      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.finance.fee.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author BladeX
+ * @since 2023-10-18
+ */
+@Data
+public class FeeCenterReports implements Serializable {
+
+	/**
+	 * 主表 id
+	 */
+	private Long pid;
+	/**
+	 * 客户中文名称
+	 */
+	private String corpCnName;
+
+	/**
+	 * 主表客户中文名称
+	 */
+	private String billCorpCnName;
+	/**
+	 * 费用中文名称
+	 */
+	private String feeCnName;
+
+	/**
+	 * 金额
+	 */
+	private BigDecimal amountD;
+
+	/**
+	 * 金额
+	 */
+	private BigDecimal amountUsdD;
+
+	/**
+	 * 本币金额,外币转为本币的金额
+	 */
+	private BigDecimal amountLocD;
+
+	/**
+	 * 金额
+	 */
+	private BigDecimal amountC;
+
+	/**
+	 * 金额
+	 */
+	private BigDecimal amountUsdC;
+
+	/**
+	 * 本币金额,外币转为本币的金额
+	 */
+	private BigDecimal amountLocC;
+
+
+}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/controller/ReportsLogController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.basic.reports.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.basic.reports.entity.ReportsLog;
+import org.springblade.los.basic.reports.vo.ReportsLogVO;
+import org.springblade.los.basic.reports.service.IReportsLogService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 基础资料-报表打印记录 控制器
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/reportslog")
+@Api(value = "基础资料-报表打印记录", tags = "基础资料-报表打印记录接口")
+public class ReportsLogController extends BladeController {
+
+	private final IReportsLogService reportsLogService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入reportsLog")
+	public R<ReportsLog> detail(ReportsLog reportsLog) {
+		ReportsLog detail = reportsLogService.getOne(Condition.getQueryWrapper(reportsLog));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 基础资料-报表打印记录
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入reportsLog")
+	public R<IPage<ReportsLog>> list(ReportsLog reportsLog, Query query) {
+		IPage<ReportsLog> pages = reportsLogService.page(Condition.getPage(query), Condition.getQueryWrapper(reportsLog));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 基础资料-报表打印记录
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入reportsLog")
+	public R<IPage<ReportsLogVO>> page(ReportsLogVO reportsLog, Query query) {
+		IPage<ReportsLogVO> pages = reportsLogService.selectReportsLogPage(Condition.getPage(query), reportsLog);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 基础资料-报表打印记录
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入reportsLog")
+	public R save(@Valid @RequestBody ReportsLog reportsLog) {
+		return R.status(reportsLogService.save(reportsLog));
+	}
+
+	/**
+	 * 修改 基础资料-报表打印记录
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入reportsLog")
+	public R update(@Valid @RequestBody ReportsLog reportsLog) {
+		return R.status(reportsLogService.updateById(reportsLog));
+	}
+
+	/**
+	 * 新增或修改 基础资料-报表打印记录
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入reportsLog")
+	public R submit(@Valid @RequestBody ReportsLog reportsLog) {
+		return reportsLogService.submit(reportsLog);
+	}
+
+
+	/**
+	 * 删除 基础资料-报表打印记录
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(reportsLogService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsLogMapper.java

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

+ 37 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/mapper/ReportsLogMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.basic.reports.mapper.ReportsLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="reportsLogResultMap" type="org.springblade.los.basic.reports.entity.ReportsLog">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_dept_name" property="createDeptName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="remarks" property="remarks"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="reports_code" property="reportsCode"/>
+        <result column="business_type" property="businessType"/>
+        <result column="group_code" property="groupCode"/>
+        <result column="print_time" property="printTime"/>
+        <result column="bill_id" property="billId"/>
+        <result column="print_content" property="printContent"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+    </resultMap>
+
+
+    <select id="selectReportsLogPage" resultMap="reportsLogResultMap">
+        select * from los_b_reports_log where is_deleted = 0
+    </select>
+
+</mapper>

+ 48 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsLogService.java

@@ -0,0 +1,48 @@
+/*
+ *      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.reports.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.reports.entity.ReportsLog;
+import org.springblade.los.basic.reports.vo.ReportsLogVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 基础资料-报表打印记录 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface IReportsLogService extends IService<ReportsLog> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param reportsLog
+	 * @return
+	 */
+	IPage<ReportsLogVO> selectReportsLogPage(IPage<ReportsLogVO> page, ReportsLogVO reportsLog);
+
+	/**
+	 *
+	 * @param reportsLog
+	 * @return
+	 */
+	R submit(ReportsLog reportsLog);
+}

+ 75 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsLogServiceImpl.java

@@ -0,0 +1,75 @@
+/*
+ *      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.reports.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.reports.entity.ReportsLog;
+import org.springblade.los.basic.reports.mapper.ReportsLogMapper;
+import org.springblade.los.basic.reports.service.IReportsLogService;
+import org.springblade.los.basic.reports.vo.ReportsLogVO;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 基础资料-报表打印记录 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Service
+@AllArgsConstructor
+public class ReportsLogServiceImpl extends ServiceImpl<ReportsLogMapper, ReportsLog> implements IReportsLogService {
+
+	private final ISysClient sysClient;
+
+	@Override
+	public IPage<ReportsLogVO> selectReportsLogPage(IPage<ReportsLogVO> page, ReportsLogVO reportsLog) {
+		return page.setRecords(baseMapper.selectReportsLogPage(page, reportsLog));
+	}
+
+	@Override
+	public R submit(ReportsLog reportsLog) {
+		if (reportsLog.getId() == null) {
+			reportsLog.setCreateTime(new Date());
+			reportsLog.setCreateUser(AuthUtil.getUserId());
+			reportsLog.setCreateUserName(AuthUtil.getUserName());
+			//获取部门ids对应中文名
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				reportsLog.setCreateDept(AuthUtil.getDeptId());
+				R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+				if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+					reportsLog.setCreateDeptName(String.join(",", res.getData()));
+				}
+			}
+		} else {
+			reportsLog.setUpdateUser(AuthUtil.getUserId());
+			reportsLog.setUpdateTime(new Date());
+			reportsLog.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(reportsLog);
+		return R.data(reportsLog);
+	}
+
+}

+ 123 - 15
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -31,6 +31,7 @@ import org.springblade.los.basic.reports.service.IReportsService;
 import org.springblade.los.basic.reports.vo.ReportsVO;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.finance.fee.dto.FeeCenterReports;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.system.feign.ISysClient;
@@ -135,13 +136,67 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 								.eq(FeeCenter::getIsDeleted, 0));
 							for (Bills item : billsList) {
-								item.setFeeCenterList(feeCenterListMh.stream()
-									.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()))
-									.collect(Collectors.toList()));
-								list.add(item);
-								item.setFeeCenterList(feeCenterListMh.stream()
-									.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()))
-									.collect(Collectors.toList()));
+								List<FeeCenter> feeCenterList = feeCenterListMh.stream()
+									.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+										Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
+								List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+								for (FeeCenter fee : feeCenterList) {
+									FeeCenterReports feeCenterReports = new FeeCenterReports();
+									feeCenterReports.setPid(item.getId());
+									feeCenterReports.setBillCorpCnName(item.getCorpCnName());
+									feeCenterReports.setFeeCnName(fee.getFeeCnName());
+
+									List<FeeCenter> feeCenterListD = feeCenterListMh.stream()
+										.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()))
+										.collect(Collectors.toList());
+									if (feeCenterListD.size() > 0) {
+										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+										feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									}
+									List<FeeCenter> feeCenterListUsdD = feeCenterListMh.stream()
+										.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()))
+										.collect(Collectors.toList());
+									if (feeCenterListUsdD.size() > 0) {
+										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+										feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									}
+									List<FeeCenter> feeCenterListC = feeCenterListMh.stream()
+										.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()))
+										.collect(Collectors.toList());
+									if (feeCenterListC.size() > 0) {
+										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+										feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									}
+									List<FeeCenter> feeCenterListUsdC = feeCenterListMh.stream()
+										.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()))
+										.collect(Collectors.toList());
+									if (feeCenterListUsdC.size() > 0) {
+										feeCenterReports.setCorpCnName(fee.getCorpCnName());
+										feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+										feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+											.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+									}
+									feeCenterReportList.add(feeCenterReports);
+								}
+								item.setFeeCenterList(feeCenterReportList);
 								list.add(item);
 							}
 						}
@@ -152,15 +207,68 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getIsDeleted, 0));
 				if (feeCenterList.size() > 0) {
-					bills.setFeeCenterList(feeCenterList.stream()
-						.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()))
-						.collect(Collectors.toList()));
-					list.add(0, bills);
-					bills.setFeeCenterList(feeCenterList.stream()
-						.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()))
-						.collect(Collectors.toList()));
-					list.add(0, bills);
+					List<FeeCenter> feeCenters = feeCenterList.stream()
+						.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+							Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode()))), ArrayList::new));
+					List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+					for (FeeCenter fee : feeCenters) {
+						FeeCenterReports feeCenterReports = new FeeCenterReports();
+						feeCenterReports.setPid(bills.getId());
+						feeCenterReports.setFeeCnName(fee.getFeeCnName());
+
+						List<FeeCenter> feeCenterListD = feeCenterList.stream()
+							.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+								e.getCorpId().equals(fee.getCorpId()))
+							.collect(Collectors.toList());
+						if (feeCenterListD.size() > 0) {
+							feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+							feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						}
+						List<FeeCenter> feeCenterListUsdD = feeCenterList.stream()
+							.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+								e.getCorpId().equals(fee.getCorpId()))
+							.collect(Collectors.toList());
+						if (feeCenterListUsdD.size() > 0) {
+							feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+							feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						}
+						List<FeeCenter> feeCenterListC = feeCenterList.stream()
+							.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && "CNY".equals(e.getCurCode()) &&
+								e.getCorpId().equals(fee.getCorpId()))
+							.collect(Collectors.toList());
+						if (feeCenterListC.size() > 0) {
+							feeCenterReports.setCorpCnName(fee.getCorpCnName());
+							feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						}
+						List<FeeCenter> feeCenterListUsdC = feeCenterList.stream()
+							.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
+								e.getFeeId().equals(fee.getFeeId()) && "USD".equals(e.getCurCode()) &&
+								e.getCorpId().equals(fee.getCorpId()))
+							.collect(Collectors.toList());
+						if (feeCenterListUsdC.size() > 0) {
+							feeCenterReports.setCorpCnName(fee.getCorpCnName());
+							feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+							feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+								.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+						}
+						feeCenterReportList.add(feeCenterReports);
+					}
+					bills.setFeeCenterList(feeCenterReportList);
 				}
+				list.add(0, bills);
 			}
 		}
 		map.put("data", list);

+ 58 - 8
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/ContainersController.java

@@ -16,24 +16,32 @@
  */
 package org.springblade.los.business.sea.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
+import org.springblade.core.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.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.los.business.sea.entity.Containers;
-import org.springblade.los.business.sea.vo.ContainersVO;
 import org.springblade.los.business.sea.service.IContainersService;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.los.business.sea.vo.ContainersVO;
+import org.springblade.los.excel.BCntrTypesExcel;
+import org.springblade.los.excel.BoxAndLeadSealNoExcel;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -114,12 +122,54 @@ public class ContainersController extends BladeController {
 	}
 
 	/**
+	 * 新增或修改 业务-海运进出口配箱-箱号装箱业务(批量)
+	 */
+	@PostMapping("/submitList")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入containers")
+	public R submit(@Valid @RequestBody List<Containers> containers) {
+		return containersService.submitList(containers);
+	}
+
+	/**
+	 * 导出 箱号铅封号导入模板
+	 */
+	@GetMapping("/exportContainers")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "导出 基础资料-集装箱箱型", notes = "传入containers")
+	public void exportContainers(Containers containers, HttpServletResponse response) {
+		LambdaQueryWrapper<Containers> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.eq(Containers::getPid, containers.getPid())
+			.orderByAsc(Containers::getLineNo);
+		List<Containers> containersList = containersService.list(lambdaQueryWrapper);
+		ExcelUtil.export(response, "箱号铅封号", "箱号铅封号", BeanUtil.copy(containersList, BoxAndLeadSealNoExcel.class), BoxAndLeadSealNoExcel.class);
+
+	}
+
+	/**
+	 * 导入 箱号 铅封号
+	 */
+	@PostMapping("/importBoxNo")
+	@ApiOperationSupport(order = 13)
+	@ApiOperation(value = "导入 箱号 铅封号", notes = "传入excel")
+	public R<List<Containers>> importBoxNo(@RequestParam("file") MultipartFile file) {
+		//导入数据
+		List<BoxAndLeadSealNoExcel> excelList = ExcelUtil.read(file, BoxAndLeadSealNoExcel.class);
+		if (CollectionUtils.isEmpty(excelList)) {
+			throw new SecurityException("数据不能为空");
+		}
+		return containersService.importBoxNo(excelList);
+	}
+
+	/**
 	 * 清除箱号
 	 */
 	@PostMapping("/cleanBoxNo")
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
-	public R cleanBoxNo( @RequestParam String ids) {
+	public R cleanBoxNo(@RequestParam String ids) {
 		return containersService.cleanBoxNo(Func.toLongList(ids));
 	}
 

+ 9 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.java

@@ -17,6 +17,8 @@
 package org.springblade.los.business.sea.mapper;
 
 import org.apache.ibatis.annotations.Param;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.vo.BillsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -26,6 +28,7 @@ import org.springblade.los.finance.fee.entity.ListAccBillVO;
 import org.springblade.los.finance.fee.vo.FinAccBillsVO;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 业务-海运进出口 Mapper 接口
@@ -45,4 +48,10 @@ public interface BillsMapper extends BaseMapper<Bills> {
 	List<BillsVO> selectBillsPage(IPage page, BillsVO bills);
 
     List<FinAccBillsVO> listAccBill(@Param("acc") ListAccBillVO finAccBills);
+
+	List<DecisionAnalysis> decisionAnalysis(@Param("data") DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page);
+
+	List<Map<String, Object>> decisionAnalysisByCGS();
+
+	List<Map<String, Object>> decisionAnalysisByYWY();
 }

+ 58 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml

@@ -427,5 +427,63 @@
         GROUP BY acc.bill_no
         ORDER BY acc.create_time
     </select>
+    <select id="decisionAnalysis" resultType="org.springblade.los.business.sea.dto.DecisionAnalysis">
+        SELECT
+        corp_cn_name AS customer,
+        src_cn_name AS analysis,
+        bill_no AS billNo,
+        mblno AS mblno,
+        booking_no AS bookingNo,
+        hblno AS hblno,
+        cy_cn_name AS depot,
+        line_cn_name AS lane,
+        operator_name AS op,
+        carrier_en_name AS carrier,
+        vessel_en_name AS vessel,
+        voyage_no AS voyageNo,
+        pol_en_name AS pol,
+        pod_en_name AS pod,
+        m_consignee_cnty_name AS podCountry,
+        m_paymode AS freight,
+        etd AS etd,
+        eta AS eta,
+        quantity_v20 AS quantityV20,
+        quantity_v40 AS quantityV40,
+        quantity_v45 AS quantityV45,
+        quantity_v48 AS quantityV48,
+        quantity_v40hc AS quantityV40hc
+        FROM
+        `los_sea_bills`
+        WHERE
+        is_deleted = '0'
+        AND tenant_id = #{data.tenantId}
+        <if test="data.sort!=null and data.sort != ''">
+            ORDER BY #{data.sort}
+        </if>
+    </select>
+    <select id="decisionAnalysisByCGS" resultType="java.util.Map">
+        SELECT
+            c.cn_name as cname,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'PP' and src_type = 'OWN' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'PP' and src_type = 'OWN' GROUP BY b.src_id),0.00) as totalP,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'CC' and src_type = 'OWN' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'CC' and src_type = 'OWN' GROUP BY b.src_id),0.00) as totalC,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and src_type = 'OWN' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and src_type = 'OWN' GROUP BY b.src_id),0.00) as total
+        FROM
+            los_b_corps c
+        WHERE
+            c.is_deleted = 0
+          and FIND_IN_SET('1712286570540703745',c.corp_type)
+    </select>
+    <select id="decisionAnalysisByYWY" resultType="java.util.Map">
+        SELECT
+            c.real_name as cname,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'PP' and src_type = 'SALES' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'PP' and src_type = 'SALES' GROUP BY b.src_id),0.00) as totalP,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'CC' and src_type = 'SALES' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and m_paymode = 'CC' and src_type = 'SALES' GROUP BY b.src_id),0.00) as totalC,
+            IF((select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and src_type = 'SALES' GROUP BY b.src_id),(select sum(b.quantity_v20+b.quantity_v40+b.quantity_v45+b.quantity_v48+b.quantity_v40hc) from los_sea_bills b  where c.id = b.src_id and b.is_deleted = '0' and b.tenant_id = '409341' and src_type = 'SALES' GROUP BY b.src_id),0.00) as total
+        FROM
+            blade_user c
+        WHERE
+            c.is_deleted = 0
+          and FIND_IN_SET('1727585951967916033',c.role_id)
+    </select>
 
 </mapper>

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java

@@ -17,6 +17,7 @@
 package org.springblade.los.business.sea.service;
 
 import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.vo.BillsVO;
 import com.baomidou.mybatisplus.extension.service.IService;

+ 11 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IContainersService.java

@@ -17,10 +17,12 @@
 package org.springblade.los.business.sea.service;
 
 import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.cntr.entity.BCntrTypes;
 import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.vo.ContainersVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.excel.BoxAndLeadSealNoExcel;
 
 import java.util.List;
 
@@ -74,4 +76,13 @@ public interface IContainersService extends IService<Containers> {
 	 * 配箱 - 平均分配件数
 	 */
 	R equalDistribution(Containers containers);
+
+    R<List<Containers>> importBoxNo(List<BoxAndLeadSealNoExcel> excelList);
+
+	/**
+	 * 新增或修改 业务-海运进出口配箱-箱号装箱业务(批量)
+	 * @param containers
+	 * @return
+	 */
+	R submitList(List<Containers> containers);
 }

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -34,6 +34,7 @@ import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
 import org.springblade.los.business.sea.dto.WaitingBox;
 import org.springblade.los.business.sea.entity.*;
 import org.springblade.los.business.sea.mapper.BillsMapper;

+ 132 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/ContainersServiceImpl.java

@@ -36,6 +36,7 @@ import org.springblade.los.business.sea.service.IContainersBillsService;
 import org.springblade.los.business.sea.service.IContainersCommodityService;
 import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.business.sea.vo.ContainersVO;
+import org.springblade.los.excel.BoxAndLeadSealNoExcel;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -331,4 +332,135 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 		return R.data(containersList);
 	}
 
+	@Override
+	public R<List<Containers>> importBoxNo(List<BoxAndLeadSealNoExcel> excelList) {
+		List<Long> lineNo = excelList.stream().map(BoxAndLeadSealNoExcel::getLineNo).collect(Collectors.toList());
+		List<Containers> list = baseMapper.selectList(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.in(Containers::getLineNo, lineNo));
+		List<Containers> containersList = new ArrayList<>();
+		for (BoxAndLeadSealNoExcel item : excelList) {
+			Containers containers = list.stream().filter(e -> e.getLineNo().equals(item.getLineNo())).findFirst().orElse(null);
+			if (containers != null) {
+				containers.setCntrNo(item.getCntrNo());
+				containers.setSealNo(item.getSealNo());
+				containersList.add(containers);
+			}
+		}
+		if (containersList.size() > 0) {
+			this.updateBatchById(containersList);
+			return R.data(containersList);
+		} else {
+			return R.fail("导入失败,导入条数为零");
+		}
+	}
+
+	@Override
+	public R submitList(List<Containers> list) {
+		String deptId = "";
+		String deptName = "";
+		//获取部门ids对应中文名
+		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+			deptId = AuthUtil.getDeptId();
+			R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = String.join(",", res.getData());
+			}
+		}
+		List<ContainersBills> containersBillsList = new ArrayList<>();
+		List<ContainersBills> subtractContainersBillsList = new ArrayList<>();
+		List<ContainersCommodity> containersCommodityList = new ArrayList<>();
+		for (Containers containers : list) {
+			if (containers.getId() == null) {
+				containers.setCreateTime(new Date());
+				containers.setCreateUser(AuthUtil.getUserId());
+				containers.setCreateUserName(AuthUtil.getUserName());
+				if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+					containers.setBranchId(deptId);
+					containers.setCreateDept(deptId);
+					containers.setCreateDeptName(deptName);
+				}
+			} else {
+				containers.setUpdateUser(AuthUtil.getUserId());
+				containers.setUpdateTime(new Date());
+				containers.setUpdateUserName(AuthUtil.getUserName());
+			}
+			this.saveOrUpdate(containers);
+			//箱号装货明细
+			if (ObjectUtils.isNotNull(containers.getContainersCommodityList())) {
+				for (ContainersCommodity item : containers.getContainersCommodityList()) {
+					if (item.getId() == null) {
+						item.setPid(containers.getId());
+						item.setCreateTime(new Date());
+						item.setCreateUser(AuthUtil.getUserId());
+						item.setCreateUserName(AuthUtil.getUserName());
+						if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+							item.setCreateDept(deptId);
+							item.setBranchId(deptId);
+							item.setCreateDeptName(deptName);
+						}
+					} else {
+						item.setUpdateUser(AuthUtil.getUserId());
+						item.setUpdateTime(new Date());
+						item.setUpdateUserName(AuthUtil.getUserName());
+					}
+					containersCommodityList.add(item);
+				}
+			}
+			//预配箱型箱量
+			if (ObjectUtils.isNotNull(containers.getContainersBillsList())) {
+				containers.setQuantity(containers.getContainersBillsList().stream().map(ContainersBills::getQuantity).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				containers.setGrossWeight(containers.getContainersBillsList().stream().map(ContainersBills::getGrossWeight).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				containers.setNetWeight(containers.getContainersBillsList().stream().map(ContainersBills::getNetWeight).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				containers.setMeasurement(containers.getContainersBillsList().stream().map(ContainersBills::getMeasurement).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				for (ContainersBills item : containers.getContainersBillsList()) {
+					if (item.getId() == null) {
+						Bills bills = billsMapper.selectById(item.getPpId());
+						bills.setCfsQuantity((ObjectUtils.isNotNull(bills.getCfsQuantity()) ? bills.getCfsQuantity() : new BigDecimal("0.00")).add(item.getQuantity()));
+						bills.setCfsMeasurement((ObjectUtils.isNotNull(bills.getCfsMeasurement()) ? bills.getCfsMeasurement() : new BigDecimal("0.00")).add(item.getMeasurement()));
+						bills.setCfsGrossWeight((ObjectUtils.isNotNull(bills.getCfsGrossWeight()) ? bills.getCfsGrossWeight() : new BigDecimal("0.00")).add(item.getGrossWeight()));
+						bills.setUpdateUserName(AuthUtil.getUserName());
+						bills.setUpdateUser(AuthUtil.getUserId());
+						bills.setUpdateTime(new Date());
+						billsMapper.updateById(bills);
+						item.setPid(containers.getId());
+						item.setCreateTime(new Date());
+						item.setCreateUser(AuthUtil.getUserId());
+						item.setCreateUserName(AuthUtil.getUserName());
+						if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+							item.setCreateDept(deptId);
+							item.setBranchId(deptId);
+							item.setCreateDeptName(deptName);
+						}
+					} else {
+						item.setUpdateUser(AuthUtil.getUserId());
+						item.setUpdateTime(new Date());
+						item.setUpdateUserName(AuthUtil.getUserName());
+					}
+					containersBillsList.add(item);
+				}
+				this.saveOrUpdate(containers);
+			}
+			//预配箱型箱量(删减)
+			if (ObjectUtils.isNotNull(containers.getSubtractContainersBillsList())) {
+				for (ContainersBills item : containers.getSubtractContainersBillsList()) {
+					Bills bills = billsMapper.selectById(item.getPpId());
+					bills.setCfsQuantity((ObjectUtils.isNotNull(bills.getCfsQuantity()) ? bills.getCfsQuantity() : new BigDecimal("0.00")).subtract(item.getQuantity()));
+					bills.setCfsMeasurement((ObjectUtils.isNotNull(bills.getCfsMeasurement()) ? bills.getCfsMeasurement() : new BigDecimal("0.00")).subtract(item.getMeasurement()));
+					bills.setCfsGrossWeight((ObjectUtils.isNotNull(bills.getCfsGrossWeight()) ? bills.getCfsGrossWeight() : new BigDecimal("0.00")).subtract(item.getGrossWeight()));
+					bills.setUpdateUserName(AuthUtil.getUserName());
+					bills.setUpdateUser(AuthUtil.getUserId());
+					bills.setUpdateTime(new Date());
+					billsMapper.updateById(bills);
+					subtractContainersBillsList.add(item);
+				}
+			}
+		}
+		containersCommodityService.saveOrUpdateBatch(containersCommodityList);
+		containersBillsService.saveOrUpdateBatch(containersBillsList);
+		containersBillsService.removeByIds(subtractContainersBillsList.stream().map(ContainersBills::getId).collect(Collectors.toList()));
+		return R.data(list);
+	}
+
 }

+ 4 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java

@@ -110,7 +110,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			.eq(Containers::getIsDeleted, 0)
 			.eq(Containers::getPid, preContainers.getPid()));
 		containersService.removeByPid(preContainers.getPid(), preContainers.getCntrTypeCode());
-		for (Containers item : removeContainersList) {
+		/*for (Containers item : removeContainersList) {
 			item.setQuantity(new BigDecimal("0.00"));
 			item.setMeasurement(new BigDecimal("0.00"));
 			item.setNetWeight(new BigDecimal("0.00"));
@@ -119,7 +119,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			item.setUpdateUserName(AuthUtil.getUserName());
 			item.setUpdateTime(new Date());
 		}
-		containersService.saveOrUpdateBatch(removeContainersList);
+		containersService.saveOrUpdateBatch(removeContainersList);*/
 		if (removeContainersList.size() > 0) {
 			List<Long> ids = removeContainersList.stream().map(Containers::getId).collect(Collectors.toList());
 			containersBillsService.removeByPid(ids);
@@ -236,7 +236,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 				.eq(Containers::getIsDeleted, 0)
 				.eq(Containers::getPid, preContainers.getPid()));
 			containersService.removeByPid(preContainers.getPid(), preContainers.getCntrTypeCode());
-			for (Containers item : removeContainersList) {
+			/*for (Containers item : removeContainersList) {
 				item.setQuantity(new BigDecimal("0.00"));
 				item.setMeasurement(new BigDecimal("0.00"));
 				item.setNetWeight(new BigDecimal("0.00"));
@@ -245,7 +245,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 				item.setUpdateUserName(AuthUtil.getUserName());
 				item.setUpdateTime(new Date());
 			}
-			containersService.saveOrUpdateBatch(removeContainersList);
+			containersService.saveOrUpdateBatch(removeContainersList);*/
 			if (removeContainersList.size() > 0) {
 				List<Long> ids = removeContainersList.stream().map(Containers::getId).collect(Collectors.toList());
 				containersBillsService.removeByPid(ids);

+ 64 - 0
blade-service/blade-los/src/main/java/org/springblade/los/excel/BoxAndLeadSealNoExcel.java

@@ -0,0 +1,64 @@
+/*
+ *      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.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 基础资料-集装箱箱型实体类
+ *
+ * @author BladeX
+ * @since 2023-10-07
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class BoxAndLeadSealNoExcel implements Serializable {
+
+	/**
+	 * 行号
+	 */
+	@ExcelProperty("行号")
+	private Long lineNo;
+
+	/**
+	 * 尺码箱型
+	 */
+	@ExcelProperty(value = "箱型")
+	private String cntrTypeCode;
+
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号")
+	private String cntrNo;
+
+	/**
+	 * 铅封号
+	 */
+	@ExcelProperty(value = "铅封号")
+	private String sealNo;
+
+
+}

+ 26 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/controller/FeeCenterController.java

@@ -170,6 +170,16 @@ public class FeeCenterController extends BladeController {
 		return feeCenterService.submit(feeCenter);
 	}
 
+	/**
+	 * 新增或修改 物流-费用中心-所有业务费用集中在该表中(批量)
+	 */
+	@PostMapping("/submitList")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入feeCenter")
+	public R submitList(@Valid @RequestBody List<FeeCenter> feeCenter) {
+		return feeCenterService.submitList(feeCenter);
+	}
+
 
 	/**
 	 * 删除 物流-费用中心-所有业务费用集中在该表中
@@ -192,5 +202,21 @@ public class FeeCenterController extends BladeController {
 		return feeCenterService.templateImport(losBFeesTemplate);
 	}
 
+	/**
+	 *  物流-费用中心
+	 */
+	@GetMapping("/selectByAccNoList")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "物流-费用中心", notes = "传入feeCenter")
+	public R<List<FeeCenter>> selectByAccNoList(FeeCenter feeCenter) {
+		LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(FeeCenter::getTenantId, 0)
+			.eq(FeeCenter::getIsDeleted, 0)
+			.eq(FeeCenter::getAccBillId, feeCenter.getAccBillId())
+			.orderByDesc(FeeCenter::getCreateTime);
+		List<FeeCenter> list = feeCenterService.list(Condition.getQueryWrapper(feeCenter));
+		return R.data(list);
+	}
+
 
 }

+ 7 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/IFeeCenterService.java

@@ -63,4 +63,11 @@ public interface IFeeCenterService extends IService<FeeCenter> {
 	 * 模板导入
 	 */
     R<List<FeeCenter>> templateImport(LosBFeesTemplate losBFeesTemplate);
+
+	/**
+	 * 新增或修改 物流-费用中心-所有业务费用集中在该表中(批量)
+	 * @param feeCenter
+	 * @return
+	 */
+	R submitList(List<FeeCenter> feeCenter);
 }

+ 78 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

@@ -249,4 +249,82 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		return R.data(list);
 	}
 
+	@Override
+	public R submitList(List<FeeCenter> list) {
+		String deptId = "";
+		String deptName = "";
+		//获取部门ids对应中文名
+		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+			deptId = AuthUtil.getDeptId();
+			R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = String.join(",", res.getData());
+			}
+		}
+		List<FeeCenter> feeCenterList = new ArrayList<>();
+		for (FeeCenter feeCenter : list) {
+			if (feeCenter.getId() == null) {
+				feeCenter.setCreateTime(new Date());
+				feeCenter.setCreateUser(AuthUtil.getUserId());
+				feeCenter.setCreateUserName(AuthUtil.getUserName());
+				if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+					feeCenter.setCreateDept(deptId);
+					feeCenter.setBranchId(deptId);
+					feeCenter.setCreateDeptName(deptName);
+				}
+			} else {
+				feeCenter.setUpdateUser(AuthUtil.getUserId());
+				feeCenter.setUpdateTime(new Date());
+				feeCenter.setUpdateUserName(AuthUtil.getUserName());
+			}
+
+			/** --------------------金额计算-------------------------**/
+			// 去税金额 = 数量quantity * 单价price
+			BigDecimal amountNet = new BigDecimal("0.00");
+			// 税额 = 去税金额amountNet * 税率taxRateSum
+			BigDecimal amountTax = new BigDecimal("0.00");
+			// 金额,amountTax + 去税金额amountNet - 折扣金额amountDiscount
+			BigDecimal amount = new BigDecimal("0.00");
+			//总税率  = 税率taxRate + 附加税率surchargeRate
+			BigDecimal taxRate = new BigDecimal("0.00");
+			// 税率 = 总税率/100
+			BigDecimal taxRateSum = new BigDecimal("0.00");
+
+			//计算字段null值处理
+			feeCenter.setQuantity(ObjectUtils.isNotNull(feeCenter.getQuantity()) ? feeCenter.getQuantity() : new BigDecimal("0.00"));
+			feeCenter.setPrice(ObjectUtils.isNotNull(feeCenter.getPrice()) ? feeCenter.getPrice() : new BigDecimal("0.00"));
+			feeCenter.setSurchargeRate(ObjectUtils.isNotNull(feeCenter.getSurchargeRate()) ? feeCenter.getSurchargeRate() : new BigDecimal("0.00"));
+			feeCenter.setTaxRate(ObjectUtils.isNotNull(feeCenter.getTaxRate()) ? feeCenter.getTaxRate() : new BigDecimal("0.00"));
+			feeCenter.setAmountDiscount(ObjectUtils.isNotNull(feeCenter.getAmountDiscount()) ? feeCenter.getAmountDiscount() : new BigDecimal("0.00"));
+			feeCenter.setStlTtlAmount(ObjectUtils.isNotNull(feeCenter.getStlTtlAmount()) ? feeCenter.getStlTtlAmount() : new BigDecimal("0.00"));
+
+			amountNet = amountNet.add(feeCenter.getQuantity().multiply(feeCenter.getPrice()))
+				.setScale(2, RoundingMode.HALF_UP);
+			taxRate = taxRate.add(feeCenter.getTaxRate()).add(feeCenter.getSurchargeRate());
+			taxRateSum = taxRateSum.add(taxRate.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP));
+			amountTax = amountTax.add(amountNet.multiply(taxRateSum)).setScale(2, RoundingMode.HALF_UP);
+			amount = amount.add(amountNet.add(amountTax).subtract(feeCenter.getAmountDiscount()));
+
+			//判断是否是本位币
+			if ("CNY".equals(feeCenter.getCurCode())) {
+				feeCenter.setAmountNetLoc(amountNet);
+				feeCenter.setAmountTaxLoc(amountTax);
+				feeCenter.setAmountLoc(amount);
+				feeCenter.setAmountDiscountLoc(amount);
+			} else {
+				feeCenter.setAmountNetLoc(bCurrencyService.converterCny(feeCenter.getCurCode(), amountNet));
+				feeCenter.setAmountTaxLoc(bCurrencyService.converterCny(feeCenter.getCurCode(), amountTax));
+				feeCenter.setAmountLoc(bCurrencyService.converterCny(feeCenter.getCurCode(), amount));
+				feeCenter.setAmountDiscountLoc(bCurrencyService.converterCny(feeCenter.getCurCode(), amount));
+			}
+			feeCenter.setAmountNet(amountNet);
+			feeCenter.setAmountTax(amountTax);
+			feeCenter.setAmount(amount);
+			feeCenter.setUnsettledAmount(feeCenter.getAmount().subtract(feeCenter.getStlTtlAmount()));
+			feeCenterList.add(feeCenter);
+		}
+		this.saveOrUpdateBatch(feeCenterList);
+		return R.data(feeCenterList);
+	}
+
 }

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java

@@ -121,8 +121,8 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 		List<Bills> billsList = new ArrayList<>();
 		List<Long> ids = finAccBills.getFeeCenterList().stream().map(FeeCenter::getPid).collect(Collectors.toList());
 		for (FeeCenter item : finAccBills.getFeeCenterList()) {
-			if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getUnitNo()) &&
-				ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsCode())) {
+			if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getCorpId()) &&
+				ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsCode()) && ObjectUtils.isNotNull(item.getCurCode())) {
 				item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getElementsCode() + "-" + item.getCurCode());
 			} else {
 				throw new RuntimeException("单据号、单位、费用类型、核算要素不能为空");

+ 58 - 0
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/StatisticAnalysisController.java

@@ -0,0 +1,58 @@
+package org.springblade.los.statisticAnalysis.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
+import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/11/29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/statisticAnalysis")
+@Api(value = "统计分析", tags = "统计分析")
+public class StatisticAnalysisController {
+
+	private final IStatisticAnalysisService statisticAnalysisService;
+
+
+	/**
+	 * 分页 决策分析列表
+	 */
+	@GetMapping("/decisionAnalysis")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入decisionAnalysis")
+	public R<IPage<DecisionAnalysis>> list(DecisionAnalysis decisionAnalysis, Query query) {
+		return statisticAnalysisService.decisionAnalysis(decisionAnalysis, Condition.getPage(query));
+	}
+
+	/**
+	 * 分页 箱量明细统计
+	 */
+	@GetMapping("/boxDetailStatistics")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入decisionAnalysis")
+	public R<List<Map<String, Object>>> boxDetailStatistics(@RequestParam("type") String type) {
+		if ("1".equals(type)) {
+			return statisticAnalysisService.decisionAnalysisByCGS();
+		} else {
+			return statisticAnalysisService.decisionAnalysisByYWY();
+		}
+	}
+
+}

+ 48 - 0
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java

@@ -0,0 +1,48 @@
+/*
+ *      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.statisticAnalysis.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
+import org.springblade.los.business.sea.vo.BillsVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 统计分析
+ *
+ * @author BladeX
+ * @since 2023-10-10
+ */
+public interface IStatisticAnalysisService {
+
+
+	/**
+	 * 分页 决策分析列表
+	 * @param decisionAnalysis
+	 * @param page
+	 * @return
+	 */
+	R<IPage<DecisionAnalysis>> decisionAnalysis(DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page);
+
+	R<List<Map<String, Object>>> decisionAnalysisByCGS();
+
+	R<List<Map<String, Object>>> decisionAnalysisByYWY();
+}

+ 40 - 0
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -0,0 +1,40 @@
+package org.springblade.los.statisticAnalysis.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.dto.DecisionAnalysis;
+import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/11/29
+ */
+@Service
+@AllArgsConstructor
+public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
+
+	private final BillsMapper billsMapper;
+
+	@Override
+	public R<IPage<DecisionAnalysis>> decisionAnalysis(DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page) {
+		return R.data(page.setRecords(billsMapper.decisionAnalysis(decisionAnalysis, page)));
+	}
+
+	@Override
+	public R<List<Map<String, Object>>> decisionAnalysisByCGS() {
+		List<Map<String, Object>> list = billsMapper.decisionAnalysisByCGS();
+		return null;
+	}
+
+	@Override
+	public R<List<Map<String, Object>>> decisionAnalysisByYWY() {
+		List<Map<String, Object>> list = billsMapper.decisionAnalysisByYWY();
+		return null;
+	}
+}

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

@@ -35,6 +35,7 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.pay.tonglianPayment.entity.WechatMark;
 import org.springblade.pay.tonglianPayment.fegin.IPaymentClient;
+import org.springblade.purchase.sales.entity.BidingItems;
 import org.springblade.purchase.sales.entity.IntegralDetail;
 import org.springblade.purchase.sales.feign.IIntegralDetailClient;
 import org.springblade.salesPart.brand.service.IBrandFilesService;
@@ -871,6 +872,28 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				}
 				StringBuilder goodsName = new StringBuilder();
 				StringBuilder retrieval = new StringBuilder();
+				List<Long> goodsId = order.getOrderItemsList().stream().map(PjOrderItems::getGoodsId).collect(Collectors.toList());
+				List<PjStockDesc> pjStockDescList = stockDescService.list(new LambdaQueryWrapper<PjStockDesc>()
+					.eq(PjStockDesc::getStorageId, order.getStorageId())
+					.eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
+					.eq(PjStockDesc::getIsDeleted, 0)
+					.in(PjStockDesc::getGoodsId, goodsId));
+				BigDecimal balanceQuantity = new BigDecimal("0.00");
+				BigDecimal inventoryAmount = new BigDecimal("0.00");
+				if (pjStockDescList.size() > 0) {
+					balanceQuantity = pjStockDescList.stream().map(PjStockDesc::getBalanceQuantity).filter(Objects::nonNull)
+						.reduce(BigDecimal.ZERO, BigDecimal::add);
+					inventoryAmount = pjStockDescList.stream().map(PjStockDesc::getInventoryAmount).filter(Objects::nonNull)
+						.reduce(BigDecimal.ZERO, BigDecimal::add);
+				}
+				BigDecimal inventoryCostPrice = new BigDecimal("0.00");
+				if (balanceQuantity.compareTo(new BigDecimal("0.00")) == 0 ||
+					inventoryAmount.compareTo(new BigDecimal("0.00")) == 0) {
+					inventoryCostPrice = new BigDecimal("0.00");
+				} else {
+					inventoryCostPrice = inventoryAmount.divide(balanceQuantity, 2, BigDecimal.ROUND_HALF_UP);
+				}
+
 				for (PjOrderItems item : order.getOrderItemsList()) {
 					item.setBizType(order.getBsType());
 					item.setBillNo(order.getOrdNo());
@@ -898,32 +921,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					}
 					item.setBrandName(goodsDesc.getBrandName());
 					//计算成本
-//					if (order.getSharedCompanyId().equals(Long.valueOf(AuthUtil.getDeptId()))) {//本地取库存账成本价
 					if (ObjectUtils.isNotNull(order.getBillType()) && 1 != order.getBillType()) {//本地取库存账成本价
-
 						goodsName = goodsName.append(goodsDesc.getCname()).append(",");
 						retrieval = retrieval.append(goodsDesc.getCnameInt()).append(",");
-						LambdaQueryWrapper<PjStockDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-						lambdaQueryWrapper.eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
-							.eq(PjStockDesc::getIsDeleted, 0)
-							.eq(PjStockDesc::getGoodsId, item.getGoodsId());
-						lambdaQueryWrapper.eq(PjStockDesc::getStorageId, order.getStorageId());
-						//是否管理批次号
-						if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
-							lambdaQueryWrapper.eq(PjStockDesc::getDot, item.getDot());
-						} else {
-							lambdaQueryWrapper.and(i -> i.eq(PjStockDesc::getDot, "").or().isNull(PjStockDesc::getDot));
-						}
-						PjStockDesc stockDesc = stockDescService.getOne(lambdaQueryWrapper);
-						if (ObjectUtil.isNotEmpty(stockDesc)) {
-							if (item.getGoodsNum().compareTo(stockDesc.getBalanceQuantity()) > 0) {
-								throw new RuntimeException("库存不足,保存失败");
-							}
-							item.setCostprie(item.getGoodsNum().multiply(stockDesc.getInventoryCostPrice()));
-						} else {
-							throw new RuntimeException("未查到库存信息 原因: 仓库、产品批次号 是否正确,请核对!!!");
-						}
-
+						item.setCostprie(item.getGoodsNum().multiply(inventoryCostPrice));
 					} else {//共享仓取共享上架的共享成本
 						LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 						lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
@@ -940,10 +941,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 							throw new RuntimeException("请维护共享商品成本价格");
 						}
 					}
-
 					//计算毛利
 					item.setGrossProfit(item.getSubTotalMoney().subtract(item.getCostprie()));
-
 					orderItemsService.updateById(item);
 
 				}
@@ -1037,10 +1036,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 
 				order.setSalesAmount(totalMoney);
 				order.setTotalMoney(totalMoney);
-
 			}
 		}
-
 		baseMapper.updateById(order);
 
 		return R.data(order);