Browse Source

1.费用模板保存接口收付字段值不更新修改
2.费用明细所属公司改为当前登录所属公司
3.增加批量修改POD场站模块列表接口
4.增加批量修改POD场站模块列表导出接口
5.增加批量修改POD场站接口
6.海运出口提取成本中心COC没数据问题修改
7. 退仓的主单分单,不允许在添加了
8.分公司,如果没有维护费用,不要让提交审核

纪新园 8 tháng trước cách đây
mục cha
commit
f2b9ff82bd
14 tập tin đã thay đổi với 508 bổ sung81 xóa
  1. 2 6
      blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/service/impl/LosBFeesTemplateServiceImpl.java
  2. 3 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java
  3. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java
  4. 72 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  5. 35 13
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java
  6. 5 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.java
  7. 132 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.xml
  8. 5 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IContainersService.java
  9. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/ISeaContainerNumberItemService.java
  10. 50 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  11. 19 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/ContainersServiceImpl.java
  12. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/SeaContainerNumberItemServiceImpl.java
  13. 129 0
      blade-service/blade-los/src/main/java/org/springblade/los/excel/UpdatePodStationExcel.java
  14. 52 55
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

+ 2 - 6
blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/service/impl/LosBFeesTemplateServiceImpl.java

@@ -170,9 +170,7 @@ public class LosBFeesTemplateServiceImpl extends ServiceImpl<LosBFeesTemplateMap
 		if (ObjectUtils.isNotNull(losBFeesTemplate.getFeesTemplateItemsList())) {
 			for (FeesTemplateItems item : losBFeesTemplate.getFeesTemplateItemsList()) {
 				item.setPid(losBFeesTemplate.getId());
-				if (ObjectUtils.isNull(item.getDc())) {
-					item.setDc(losBFeesTemplate.getDc());
-				}
+				item.setDc(losBFeesTemplate.getDc());
 				if (ObjectUtils.isNotNull(item.getCorpType())) {
 					item.setCorpId(0L);
 					item.setCorpCnName("");
@@ -199,9 +197,7 @@ public class LosBFeesTemplateServiceImpl extends ServiceImpl<LosBFeesTemplateMap
 			for (FeesTemplateItems item : losBFeesTemplate.getFeesTemplateItemsList()) {
 				if (ObjectUtils.isNotNull(item.getSonItemsList()) && !item.getSonItemsList().isEmpty()) {
 					for (FeesTemplateSonItems sonItems : item.getSonItemsList()) {
-						if (ObjectUtils.isNull(sonItems.getDc())) {
-							sonItems.setDc(item.getDc());
-						}
+						sonItems.setDc(item.getDc());
 						/*sonItems.setUnitNo(item.getUnitNo());
 						sonItems.setUnitId(item.getUnitId());*/
 						sonItems.setCorpId(item.getCorpId());

+ 3 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RouteCostController.java

@@ -342,7 +342,9 @@ public class RouteCostController extends BladeController {
 			.eq(RouteCost::getStatus, "审核通过")
 			.eq(ObjectUtils.isNotNull(routeCost.getPodId()), RouteCost::getPodId, routeCost.getPodId())
 			.eq(ObjectUtils.isNotNull(routeCost.getDestinationId()), RouteCost::getDestinationId, routeCost.getDestinationId())
-			.eq(ObjectUtils.isNotNull(routeCost.getShippingCompanyId()), RouteCost::getActualShippingCompanyId, routeCost.getShippingCompanyId());
+			.apply(ObjectUtils.isNotNull(routeCost.getShippingCompanyId()), "(business_type = 'SOC' and actual_shipping_company_id = '" + routeCost.getShippingCompanyId() + "')" +
+				"OR (business_type = 'COC' and shipping_company_id = '" + routeCost.getShippingCompanyId() + "')");
+//			.eq(ObjectUtils.isNotNull(routeCost.getShippingCompanyId()), RouteCost::getActualShippingCompanyId, routeCost.getShippingCompanyId());
 		lambdaQueryWrapper.orderByAsc(RouteCost::getTotalProfit);
 		List<RouteCost> list = routeCostService.list(lambdaQueryWrapper);
 		if (!list.isEmpty()) {

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IPutBoxService.java

@@ -77,4 +77,6 @@ public interface IPutBoxService extends IService<PutBox> {
 	PutBox copyDocument(PutBox putBox);
 
 	R emptyContainerEntry(MultipartFile file)throws IOException;
+
+	R batchUpdatePodStation(String ids, Long podStationId, String podStationCode, String podStationCname, String podStationEname);
 }

+ 72 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -27,6 +27,7 @@ import org.springblade.core.oss.model.BladeFile;
 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.Util.CurrencyUtils;
 import org.springblade.los.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
@@ -2789,4 +2790,75 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		archivesFilesService.save(archivesFiles);
 		return R.data("操作成功");
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R batchUpdatePodStation(String ids, Long podStationId, String podStationCode, String podStationCname, String podStationEname) {
+		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.in(Containers::getId, Func.toLongList(ids)));
+		if (containersList.isEmpty()) {
+			throw new RuntimeException("未查到配箱信息");
+		}
+		List<String> containerNumber = containersList.stream().map(Containers::getContainerNumber).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		List<String> boxCode = containersList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		for (Containers item : containersList) {
+			item.setPodStationId(podStationId);
+			item.setPodStationCname(podStationCname);
+			item.setPodStationEname(podStationEname);
+			item.setPodStationCode(podStationCode);
+			item.setUpdateTime(new Date());
+			item.setUpdateUser(AuthUtil.getUserId());
+			item.setUpdateUserName(AuthUtil.getUserName());
+		}
+		containersService.updateBatchById(containersList);
+		List<PutBox> putBoxList = baseMapper.selectList(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.in(PutBox::getContainerNumber, containerNumber));
+		if (!putBoxList.isEmpty()) {
+			List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
+				.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
+				.eq(PutBoxItems::getIsDeleted, 0)
+				.in(PutBoxItems::getBoxCode, boxCode)
+				.in(PutBoxItems::getPid, putBoxList.stream().map(PutBox::getId).collect(Collectors.toList()))
+			);
+			for (PutBoxItems item : putBoxItemsList) {
+				item.setPodStationId(podStationId);
+				item.setPodStationCname(podStationCname);
+				item.setPodStationEname(podStationEname);
+				item.setPodStationCode(podStationCode);
+				item.setUpdateTime(new Date());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			putBoxItemsService.updateBatchById(putBoxItemsList);
+		}
+		List<TradingBox> tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
+			.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBox::getIsDeleted, 0)
+			.in(TradingBox::getContainerNumber, containerNumber));
+		if (!tradingBoxList.isEmpty()) {
+			List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+				.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+				.eq(TradingBoxItem::getIsDeleted, 0)
+				.in(TradingBoxItem::getCode, boxCode)
+				.in(TradingBoxItem::getPid, tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList()))
+			);
+			for (TradingBoxItem item : tradingBoxItemList) {
+				item.setPodStationId(podStationId);
+				item.setPodStationCname(podStationCname);
+				item.setPodStationEname(podStationEname);
+				item.setPodStationCode(podStationCode);
+				item.setUpdateTime(new Date());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			tradingBoxItemService.updateBatchById(tradingBoxItemList);
+		}
+		return R.data("操作成功");
+	}
 }

+ 35 - 13
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java

@@ -1,25 +1,25 @@
 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.ObjectUtils;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springblade.common.annotation.RepeatSubmit;
+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.los.box.entity.TradingBox;
-import org.springblade.los.box.entity.TradingBoxItem;
+import org.springblade.los.box.service.IPutBoxService;
+import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
+import org.springblade.los.excel.UpdatePodStationExcel;
+import org.springblade.los.statisticAnalysis.FeeSummaryRD;
 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.text.SimpleDateFormat;
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * @author :jixinyuan
@@ -30,18 +30,40 @@ import java.util.stream.Collectors;
 @RequestMapping("/UpdatePodStation")
 public class UpdatePodStationController {
 
-	private final ISeaContainerNumberItemService seaContainerNumberItemService;
+	private final IContainersService containersService;
+
+	private final IPutBoxService putBoxService;
 
 
 	/**
-	 * 分页 买箱、卖箱、租箱、代理箱
+	 *  批量修改pod场站信息列
 	 */
 	@GetMapping("/list")
-	public R<IPage<TradingBox>> list(TradingBox tradingBox, Query query) {
+	public R<IPage<UpdatePodStationExcel>> updatePodStationPage(UpdatePodStationExcel excel, Query query) {
+		IPage<UpdatePodStationExcel> pages = containersService.updatePodStationPage(Condition.getPage(query), excel);
+		return R.data(pages);
+	}
+
+	/**
+	 *  批量修改pod场站信息列表
+	 */
+	@GetMapping("/listExport")
+	public void updatePodStationList(UpdatePodStationExcel excel, HttpServletResponse response) {
+		List<UpdatePodStationExcel> list = containersService.updatePodStationList( excel);
+		ExcelUtil.export(response, "批量修改pod场站信息表", "批量修改pod场站信息", list, UpdatePodStationExcel.class);
+	}
 
-//		IPage<TradingBox> pages = seaContainerNumberItemService.page(Condition.getPage(query), lambdaQueryWrapper);
 
-		return R.data(null);
+	/**
+	 * 批量修改pod场站信息
+	 */
+	@GetMapping("/batchUpdatePodStation")
+	@RepeatSubmit
+	public R batchUpdatePodStation(@RequestParam("ids") String ids,@RequestParam("podStationId") Long podStationId,
+								   @RequestParam("podStationCode") String podStationCode,
+								   @RequestParam("podStationCname") String podStationCname,
+								   @RequestParam("podStationEname") String podStationEname) {
+		return putBoxService.batchUpdatePodStation(ids,podStationId,podStationCode,podStationCname,podStationEname);
 	}
 
 

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

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.vo.ContainersVO;
+import org.springblade.los.excel.UpdatePodStationExcel;
 
 import java.util.List;
 
@@ -46,4 +47,8 @@ public interface ContainersMapper extends BaseMapper<Containers> {
 	 * @param pid
 	 */
 	void removeByPid(@Param("pid") Long pid, @Param("type")String type);
+
+	List<UpdatePodStationExcel> updatePodStationPage(IPage<UpdatePodStationExcel> page, @Param("data")UpdatePodStationExcel excel);
+
+	List<UpdatePodStationExcel> updatePodStationList(@Param("data")UpdatePodStationExcel excel);
 }

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

@@ -76,6 +76,138 @@
     <update id="removeByPid">
         update los_sea_containers set is_deleted = '1' where pid = #{pid} and cntr_type_code = #{type}
     </update>
+    <update id="updatePodStationPage">
+        SELECT
+        se.corp_cn_name as corpName,
+        se.mblno as mblno,
+        se.hblno as hblno,
+        se.vessel_cn_name as vesselCnName,
+        se.voyage_no as voyageNo,
+        se.pol_cn_name as polName,
+        se.pod_cn_name as podName,
+        sc.container_number as containerNumber,
+        cn.box_belongs_to as boxBelongsTo,
+        cn.bus_type as busType,
+        sc.cntr_no as cntrNo,
+        sc.cntr_type_code as cntrTypeCode,
+        sc.pod_station_cname as podStationName,
+        sc.id as containersId,
+        se.id as id
+        FROM
+        los_sea_containers sc
+        LEFT JOIN los_sea_bills se ON sc.pid = se.id
+        LEFT JOIN los_sea_container_number_item cn on sc.pid = cn.pid and sc.cntr_type_code = cn.box_type
+        WHERE
+        sc.tenant_id = #{data.tenantId}
+        AND se.tenant_id = #{data.tenantId}
+        AND sc.is_deleted = '0'
+        AND se.is_deleted = '0'
+        <if test="data.branchId != null and data.branchId != ''">
+            and se.branch_id = #{data.branchId}
+        </if>
+        <if test="data.mblno != null and data.mblno != ''">
+            and se.mblno like concat('%', #{data.mblno}, '%')
+        </if>
+        <if test="data.hblno != null and data.hblno != ''">
+            and se.hblno like concat('%', #{data.hblno}, '%')
+        </if>
+        <if test="data.corpName != null and data.corpName != ''">
+            and se.corp_cn_name like concat('%', #{data.corpName}, '%')
+        </if>
+        <if test="data.vesselCnName != null and data.vesselCnName != ''">
+            and se.vessel_cn_name like concat('%', #{data.vesselCnName}, '%')
+        </if>
+        <if test="data.voyageNo != null and data.voyageNo != ''">
+            and se.data.voyage_no like concat('%', #{data.voyageNo}, '%')
+        </if>
+        <if test="data.polName != null and data.polName != ''">
+            and se.pol_cn_name like concat('%', #{data.polName}, '%')
+        </if>
+        <if test="data.podName != null and data.podName != ''">
+            and se.pod_cn_name like concat('%', #{data.podName}, '%')
+        </if>
+        <if test="data.billType != null and data.billType != ''">
+            and se.bill_type = #{data.billType}
+        </if>
+        <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+            and se.actual_etd &gt;= #{data.actualEtdList[0]}
+        </if>
+        <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+            and se.actual_etd &lt;= #{data.actualEtdList[1]}
+        </if>
+        <if test='data.whether != null and data.whether == "0"'>
+            and sc.pod_station_cname is null
+        </if>
+        <if test='data.whether != null and data.whether == "1"'>
+            and sc.pod_station_cname is not null
+        </if>
+    </update>
+    <update id="updatePodStationList">
+        SELECT
+        se.corp_cn_name as corpName,
+        se.mblno as mblno,
+        se.hblno as hblno,
+        se.vessel_cn_name as vesselCnName,
+        se.voyage_no as voyageNo,
+        se.pol_cn_name as polName,
+        se.pod_cn_name as podName,
+        sc.container_number as containerNumber,
+        cn.box_belongs_to as boxBelongsTo,
+        cn.bus_type as busType,
+        sc.cntr_no as cntrNo,
+        sc.cntr_type_code as cntrTypeCode,
+        sc.pod_station_cname as podStationName,
+        sc.id as containersId,
+        se.id as id
+        FROM
+        los_sea_containers sc
+        LEFT JOIN los_sea_bills se ON sc.pid = se.id
+        LEFT JOIN los_sea_container_number_item cn on sc.pid = cn.pid and sc.cntr_type_code = cn.box_type
+        WHERE
+        sc.tenant_id = #{data.tenantId}
+        AND se.tenant_id = #{data.tenantId}
+        AND sc.is_deleted = '0'
+        AND se.is_deleted = '0'
+        <if test="data.branchId != null and data.branchId != ''">
+            and se.branch_id = #{data.branchId}
+        </if>
+        <if test="data.mblno != null and data.mblno != ''">
+            and se.mblno like concat('%', #{data.mblno}, '%')
+        </if>
+        <if test="data.hblno != null and data.hblno != ''">
+            and se.hblno like concat('%', #{data.hblno}, '%')
+        </if>
+        <if test="data.corpName != null and data.corpName != ''">
+            and se.corp_cn_name like concat('%', #{data.corpName}, '%')
+        </if>
+        <if test="data.vesselCnName != null and data.vesselCnName != ''">
+            and se.vessel_cn_name like concat('%', #{data.vesselCnName}, '%')
+        </if>
+        <if test="data.voyageNo != null and data.voyageNo != ''">
+            and se.data.voyage_no like concat('%', #{data.voyageNo}, '%')
+        </if>
+        <if test="data.polName != null and data.polName != ''">
+            and se.pol_cn_name like concat('%', #{data.polName}, '%')
+        </if>
+        <if test="data.podName != null and data.podName != ''">
+            and se.pod_cn_name like concat('%', #{data.podName}, '%')
+        </if>
+        <if test="data.billType != null and data.billType != ''">
+            and se.bill_type = #{data.billType}
+        </if>
+        <if test='data.actualEtdList != null and data.actualEtdList[0] != null and data.actualEtdList[0]!= ""'>
+            and se.actual_etd &gt;= #{data.actualEtdList[0]}
+        </if>
+        <if test='data.actualEtdList != null and data.actualEtdList[1] != null and data.actualEtdList[1]!= ""'>
+            and se.actual_etd &lt;= #{data.actualEtdList[1]}
+        </if>
+        <if test='data.whether != null and data.whether == "0"'>
+            and sc.pod_station_cname is null
+        </if>
+        <if test='data.whether != null and data.whether == "1"'>
+            and sc.pod_station_cname is not null
+        </if>
+    </update>
 
 
     <select id="selectContainersPage" resultMap="containersResultMap">

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

@@ -22,6 +22,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.vo.ContainersVO;
 import org.springblade.los.excel.BoxAndLeadSealNoExcel;
+import org.springblade.los.excel.UpdatePodStationExcel;
 
 import java.util.List;
 
@@ -86,4 +87,8 @@ public interface IContainersService extends IService<Containers> {
 	R submitList(List<Containers> containers);
 
 	R verifyData(String billId);
+
+	IPage<UpdatePodStationExcel> updatePodStationPage(IPage<UpdatePodStationExcel> page, UpdatePodStationExcel excel);
+
+	List<UpdatePodStationExcel> updatePodStationList(UpdatePodStationExcel excel);
 }

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

@@ -21,6 +21,7 @@ import org.springblade.los.business.sea.entity.SeaContainerNumberItem;
 import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.excel.UpdatePodStationExcel;
 
 import java.util.List;
 

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

@@ -46,7 +46,6 @@ import org.springblade.los.basic.vessels.entity.BVessels;
 import org.springblade.los.basic.vessels.mapper.VesselsMapper;
 import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
-import org.springblade.los.business.amends.entity.Amends;
 import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
@@ -1168,12 +1167,21 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(Bills::getIsDeleted, 0)
 				.in(Bills::getId, idArr));
 			for (Bills item : billsList) {
-				if (!item.getQuantity().equals(item.getCfsQuantity())) {
+			/*	if (!item.getQuantity().equals(item.getCfsQuantity())) {
 					throw new RuntimeException("分单号:" + item.getBillNo() + "请先配箱后再操作");
-				}
+				}*/
 				if (ObjectUtils.isNotNull(item.getMasterId()) && item.getMasterId() != 0) {
 					throw new RuntimeException("分单号:" + item.getBillNo() + "已添加主单,请勿重复添加");
 				}
+				if (3 == item.getBillStatus()) {
+					throw new RuntimeException("分单已完成,操作失败");
+				}
+				if (1 == item.getBillStatus()) {
+					throw new RuntimeException("分单已退舱,操作失败");
+				}
+				if (item.getStatus() > 0 && item.getStatus() < 3) {
+					throw new RuntimeException("分单提交请核,操作失败");
+				}
 				item.setMblno(bills.getMblno());
 				item.setEtd(bills.getEtd());
 				item.setEta(bills.getEta());
@@ -1697,6 +1705,20 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					item.setUpdateUser(AuthUtil.getUserId());
 				}
 				this.updateBatchById(billsList);
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.in(FeeCenter::getPid, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+				if (feeCenterList.isEmpty()) {
+					throw new RuntimeException("未查到分单费用明细,先维护分单费用");
+				}
+				for (Bills item : billsList) {
+					List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()))
+						.collect(Collectors.toList());
+					if (feeCenters.isEmpty()) {
+						throw new RuntimeException("未查到分单编号:" + item.getBillNo() + "费用明细,先维护分单费用");
+					}
+				}
 				idList.addAll(billsList.stream().map(Bills::getId).collect(Collectors.toList()));
 			}
 		}
@@ -3402,6 +3424,31 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (billsList.isEmpty()) {
 			throw new RuntimeException("未查到单据信息");
 		}
+		List<Long> idMList = billsList.stream().filter(e-> "MM".equals(e.getBillType())).map(Bills::getId).collect(Collectors.toList());
+		if (!idMList.isEmpty()){
+			List<Bills> billsHList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getBranchId, AuthUtil.getDeptId())
+				.apply("find_in_set(id,'" + billsIds + "')"));
+			if (billsHList.isEmpty()) {
+				throw new RuntimeException("未查到单据信息");
+			}
+			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0)
+				.in(FeeCenter::getPid, billsHList.stream().map(Bills::getId).collect(Collectors.toList())));
+			if (feeCenterList.isEmpty()) {
+				throw new RuntimeException("未查到分单费用明细,先维护分单费用");
+			}
+			for (Bills item : billsHList) {
+				List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId()))
+					.collect(Collectors.toList());
+				if (feeCenters.isEmpty()) {
+					throw new RuntimeException("未查到分单编号:" + item.getBillNo() + "费用明细,先维护分单费用");
+				}
+			}
+		}
 		Integer actId = null;
 		String processType = "";
 		String checkType = "";

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

@@ -32,12 +32,12 @@ import org.springblade.los.business.sea.entity.ContainersBills;
 import org.springblade.los.business.sea.entity.ContainersCommodity;
 import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.los.business.sea.mapper.ContainersMapper;
-import org.springblade.los.business.sea.mapper.PreContainersMapper;
 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.los.excel.UpdatePodStationExcel;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -67,8 +67,6 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 
 	private final IContainersCommodityService containersCommodityService;
 
-	private final PreContainersMapper preContainersMapper;
-
 	@Override
 	public IPage<ContainersVO> selectContainersPage(IPage<ContainersVO> page, ContainersVO containers) {
 		return page.setRecords(baseMapper.selectContainersPage(page, containers));
@@ -669,4 +667,22 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 		return R.data(mapList);
 	}
 
+	@Override
+	public IPage<UpdatePodStationExcel> updatePodStationPage(IPage<UpdatePodStationExcel> page, UpdatePodStationExcel excel) {
+		excel.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			excel.setBranchId(AuthUtil.getDeptId());
+		}
+		return page.setRecords(baseMapper.updatePodStationPage(page, excel));
+	}
+
+	@Override
+	public List<UpdatePodStationExcel> updatePodStationList(UpdatePodStationExcel excel) {
+		excel.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			excel.setBranchId(AuthUtil.getDeptId());
+		}
+		return baseMapper.updatePodStationList(excel);
+	}
+
 }

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

@@ -39,6 +39,7 @@ import org.springblade.los.business.sea.mapper.SeaContainerNumberItemMapper;
 import org.springblade.los.business.sea.service.IPreContainersService;
 import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
 import org.springblade.los.business.sea.vo.SeaContainerNumberItemVO;
+import org.springblade.los.excel.UpdatePodStationExcel;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springframework.stereotype.Service;

+ 129 - 0
blade-service/blade-los/src/main/java/org/springblade/los/excel/UpdatePodStationExcel.java

@@ -0,0 +1,129 @@
+package org.springblade.los.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/5/20
+ */
+@Data
+public class UpdatePodStationExcel {
+
+	/**
+	 * 客户
+	 */
+	@ExcelProperty(value = "客户")
+	private String corpName;
+	/**
+	 * mblno
+	 */
+	@ExcelProperty(value = "mblno")
+	private String mblno;
+	/**
+	 * hblno
+	 */
+	@ExcelProperty(value = "hblno")
+	private String hblno;
+	/**
+	 * 船名
+	 */
+	@ExcelProperty(value = "船名")
+	private Date vesselCnName;
+	/**
+	 * 航次
+	 */
+	@ExcelProperty(value = "航次")
+	private String voyageNo;
+
+	/**
+	 * 起运港
+	 */
+	@ExcelProperty(value = "起运港")
+	private String polName;
+
+	/**
+	 * 卸货港
+	 */
+	@ExcelProperty(value = "卸货港")
+	private String podName;
+
+	/**
+	 * 放箱号
+	 */
+	@ExcelProperty(value = "放箱号")
+	private String containerNumber;
+	/**
+	 * 箱属
+	 */
+	@ExcelProperty(value = "箱属")
+	private String boxBelongsTo;
+	/**
+	 * 放箱号类型
+	 */
+	@ExcelProperty(value = "放箱号类型")
+	private String busType;
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号")
+	private String cntrNo;
+
+	/**
+	 * 箱型
+	 */
+	@ExcelProperty(value = "箱型")
+	private String cntrTypeCode;
+
+	/**
+	 * pod场站
+	 */
+	@ExcelProperty(value = "pod场站")
+	private String podStationCname;
+	/**
+	 * 单据类型
+	 */
+	@ExcelIgnore
+	private String billType;
+
+	/**
+	 * 实际开船日期
+	 */
+	@ExcelIgnore
+	private List<String> actualEtdList;
+	/**
+	 * pod场站是否录入
+	 */
+	@ExcelIgnore
+	private String whether;
+	/**
+	 * 主表id
+	 */
+	@ExcelIgnore
+	private String id;
+	/**
+	 * 配箱id
+	 */
+	@ExcelIgnore
+	private String containersId;
+
+
+	/**
+	 * 租户
+	 */
+	@ExcelIgnore
+	private String tenantId;
+	/**
+	 * 分公司 Id
+	 */
+	@ExcelIgnore
+	private String branchId;
+
+}

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

@@ -103,16 +103,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public R submit(FeeCenter feeCenter) {
-		String deptId;
-		String branchId;
+
 		String deptName = "";
-		if (ObjectUtils.isNull(feeCenter.getBranchId())) {
-			deptId = AuthUtil.getDeptId();
-			branchId = AuthUtil.getDeptId();
-		} else {
-			deptId = feeCenter.getBranchId();
-			branchId = feeCenter.getBranchId();
-		}
+		String deptId = AuthUtil.getDeptId();
+		String branchId = AuthUtil.getDeptId();
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(branchId)) {
 			R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
@@ -228,6 +222,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			if (sonItemsList.isEmpty()) {
 				throw new RuntimeException("未查到模板明细");
 			}
+			String deptName = "";
+			String branchId = AuthUtil.getDeptId();
+			if (ObjectUtils.isNotNull(branchId)) {
+				R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
+				if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+					deptName = res.getData();
+				}
+			}
 			int count = 1;
 			for (FeesTemplateSonItems items : sonItemsList) {
 				FeesTemplateItems templateItems = losBFeesTemplate.getFeesTemplateItemsList().stream().filter(e -> e.getId().equals(items.getPpid()))
@@ -236,8 +238,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					throw new RuntimeException("模版数据错误,请联系管理员");
 				}
 				FeeCenter feeCenter = new FeeCenter();
-				feeCenter.setBranchId(bills.getBranchId());
-				feeCenter.setBranchName(bills.getBranchName());
+				feeCenter.setBranchId(branchId);
+				feeCenter.setBranchName(deptName);
 				feeCenter.setPid(bills.getId());
 				feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
 				feeCenter.setBillNo(bills.getBillNo());
@@ -361,7 +363,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					}
 					feeCenter.setQuantity(new BigDecimal(quantity + ""));
 					feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("箱量".equals(items.getQuantityRule())) {
+				} else if ("箱量".equals(items.getQuantityRule())) {
 					if (preContainers.isEmpty()) {
 						text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
 						continue;
@@ -514,7 +516,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					}
 					feeCenter.setQuantity(new BigDecimal(quantity + ""));
 					feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("箱量".equals(items.getQuantityRule())) {
+				} else if ("箱量".equals(items.getQuantityRule())) {
 					if (preContainers.isEmpty()) {
 						text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
 						continue;
@@ -568,16 +570,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				bills = billsMapper.selectById(list.get(0).getPid());
 				status = true;
 			}
-			String deptId;
-			String branchId;
+
 			String deptName = "";
-			if (ObjectUtils.isNull(bills.getBranchId())) {
-				deptId = AuthUtil.getDeptId();
-				branchId = AuthUtil.getDeptId();
-			} else {
-				deptId = bills.getBranchId();
-				branchId = bills.getBranchId();
-			}
+			String deptId = AuthUtil.getDeptId();
+			String branchId = AuthUtil.getDeptId();
 			//获取部门ids对应中文名
 			if (ObjectUtils.isNotNull(branchId)) {
 				R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
@@ -771,16 +767,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 	public R submitListOptimization(List<FeeCenter> list) {
 		List<FeeCenter> feeCenterList = new ArrayList<>();
 		if (ObjectUtils.isNotNull(list) && !list.isEmpty()) {
-			String deptId;
-			String branchId;
+			String deptId = AuthUtil.getDeptId();
+			String branchId = AuthUtil.getDeptId();
 			String deptName = "";
-			if (ObjectUtils.isNull(list.get(0).getBranchId())) {
-				deptId = AuthUtil.getDeptId();
-				branchId = AuthUtil.getDeptId();
-			} else {
-				deptId = list.get(0).getBranchId();
-				branchId = list.get(0).getBranchId();
-			}
 			//获取部门ids对应中文名
 			if (ObjectUtils.isNotNull(branchId)) {
 				R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
@@ -1004,16 +993,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			BigDecimal amountCUsd = new BigDecimal("0.00");
 			BigDecimal amountDLoc = new BigDecimal("0.00");
 			BigDecimal amountCLoc = new BigDecimal("0.00");
-			String deptId;
-			String branchId;
 			String deptName = "";
-			if (ObjectUtils.isNull(list.get(0).getBranchId())) {
-				deptId = AuthUtil.getDeptId();
-				branchId = AuthUtil.getDeptId();
-			} else {
-				deptId = list.get(0).getBranchId();
-				branchId = list.get(0).getBranchId();
-			}
+			String deptId = AuthUtil.getDeptId();
+			String branchId = AuthUtil.getDeptId();
 			if (ObjectUtils.isNotNull(branchId)) {
 				R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
 				if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
@@ -1161,6 +1143,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
 			.eq(PreContainers::getIsDeleted, 0)
 			.apply("find_in_set(pid,'" + billsIds + "')"));
+		String deptName = "";
+		String branchId = AuthUtil.getDeptId();
+		if (ObjectUtils.isNotNull(branchId)) {
+			R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = res.getData();
+			}
+		}
 		List<FeeCenter> list = new ArrayList<>();
 		StringBuilder text = new StringBuilder();
 		for (Bills bills : billsList) {
@@ -1204,12 +1194,6 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					date = bills.getEta();
 				}
 			}
-			String branchId;
-			if (ObjectUtils.isNull(bills.getBranchId())) {
-				branchId = AuthUtil.getDeptId();
-			} else {
-				branchId = bills.getBranchId();
-			}
 			String exrateType = currencyUtils.standardCurrency(branchId);
 			List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 			int count = 1;
@@ -1220,8 +1204,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					throw new RuntimeException("模版数据错误,请联系管理员");
 				}
 				FeeCenter feeCenter = new FeeCenter();
-				feeCenter.setBranchId(bills.getBranchId());
-				feeCenter.setBranchName(bills.getBranchName());
+				feeCenter.setBranchId(branchId);
+				feeCenter.setBranchName(deptName);
 				feeCenter.setPid(bills.getId());
 				feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
 				feeCenter.setBillNo(bills.getBillNo());
@@ -1345,7 +1329,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					}
 					feeCenter.setQuantity(new BigDecimal(quantity + ""));
 					feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
-				} else if ("箱量".equals(items.getQuantityRule())) {
+				} else if ("箱量".equals(items.getQuantityRule())) {
 					if (preContainers.isEmpty()) {
 						text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
 						continue;
@@ -1425,6 +1409,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		if (feesD == null) {
 			throw new RuntimeException("未查到销售价信息,请先维护基础资料");
 		}
+		String deptName = "";
+		String branchId = AuthUtil.getDeptId();
+		if (ObjectUtils.isNotNull(branchId)) {
+			R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = res.getData();
+			}
+		}
 		List<FeeCenter> list = new ArrayList<>();
 		StringBuilder text = new StringBuilder();
 		for (Bills bills : billsList) {
@@ -1471,12 +1463,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					date = bills.getEta();
 				}
 			}
-			String branchId;
-			if (ObjectUtils.isNull(bills.getBranchId())) {
-				branchId = AuthUtil.getDeptId();
-			} else {
-				branchId = bills.getBranchId();
-			}
+
 			String exrateType = currencyUtils.standardCurrency(branchId);
 			List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 			int count = 1;
@@ -1485,12 +1472,16 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
 						curExrateList, preContainers, exrateType, "1");
 					if (feeCenter != null) {
+						feeCenter.setBranchId(branchId);
+						feeCenter.setBranchName(deptName);
 						list.add(feeCenter);
 						count++;
 					}
 					FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
 						curExrateList, preContainers, exrateType, "2");
 					if (feeCenterD != null) {
+						feeCenterD.setBranchId(branchId);
+						feeCenterD.setBranchName(deptName);
 						list.add(feeCenterD);
 						count++;
 					}
@@ -1498,12 +1489,16 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
 						curExrateList, preContainers, exrateType, "1");
 					if (feeCenter != null) {
+						feeCenter.setBranchId(branchId);
+						feeCenter.setBranchName(deptName);
 						list.add(feeCenter);
 						count++;
 					}
 					FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
 						curExrateList, preContainers, exrateType, "3");
 					if (feeCenterD != null) {
+						feeCenterD.setBranchId(branchId);
+						feeCenterD.setBranchName(deptName);
 						list.add(feeCenterD);
 						count++;
 					}
@@ -1511,6 +1506,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "国内直接客户", items,
 						curExrateList, preContainers, exrateType, "4");
 					if (feeCenter != null) {
+						feeCenter.setBranchId(branchId);
+						feeCenter.setBranchName(deptName);
 						list.add(feeCenter);
 						count++;
 					}