Browse Source

贸易代理 2024年8月5日17:20:06

纪新园 1 year ago
parent
commit
90d936736e

+ 7 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/corps/entity/BCorpsBank.java

@@ -158,7 +158,7 @@ public class BCorpsBank implements Serializable {
 	 * 是否已删除(0 否 1是)
 	 * 是否已删除(0 否 1是)
 	 */
 	 */
 	@ApiModelProperty(value = "是否已删除(0 否 1是)")
 	@ApiModelProperty(value = "是否已删除(0 否 1是)")
-	@TableLogic(value = "0",delval = "1")
+	@TableLogic(value = "0", delval = "1")
 	private Integer isDeleted;
 	private Integer isDeleted;
 	/**
 	/**
 	 * 备注
 	 * 备注
@@ -171,5 +171,11 @@ public class BCorpsBank implements Serializable {
 	@ApiModelProperty(value = "租户")
 	@ApiModelProperty(value = "租户")
 	private String tenantId;
 	private String tenantId;
 
 
+	/**
+	 * 助记码
+	 */
+	@ApiModelProperty(value = "助记码")
+	private String mnemonicCode;
+
 
 
 }
 }

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/trade/entity/InOutStorage.java

@@ -164,6 +164,12 @@ public class InOutStorage implements Serializable {
 	@ApiModelProperty(value = "毛重")
 	@ApiModelProperty(value = "毛重")
 	private BigDecimal grossWeight;
 	private BigDecimal grossWeight;
 	/**
 	/**
+	 * 净重 (KGM)
+	 */
+	@ApiModelProperty(value = "净重 (KGM)")
+	private BigDecimal netWeight;
+
+	/**
 	 * 是否保税
 	 * 是否保税
 	 */
 	 */
 	@ApiModelProperty(value = "是否保税")
 	@ApiModelProperty(value = "是否保税")

+ 5 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/ports/controller/BPortsController.java

@@ -39,6 +39,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.basic.packages.entity.BPackages;
 import org.springblade.los.basic.packages.entity.BPackages;
+import org.springblade.los.business.aea.entity.AeaBills;
 import org.springblade.los.excel.BPortsExcel;
 import org.springblade.los.excel.BPortsExcel;
 import org.springblade.los.basic.utils.ExtendedData;
 import org.springblade.los.basic.utils.ExtendedData;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.feign.ISysClient;
@@ -100,7 +101,9 @@ public class BPortsController extends BladeController {
 		lambdaQueryWrapper.eq(BPorts::getTenantId, AuthUtil.getTenantId())
 		lambdaQueryWrapper.eq(BPorts::getTenantId, AuthUtil.getTenantId())
 			.eq(BPorts::getIsDeleted, 0)
 			.eq(BPorts::getIsDeleted, 0)
 			.like(ObjectUtils.isNotNull(bPorts.getCode()), BPorts::getCode, bPorts.getCode())
 			.like(ObjectUtils.isNotNull(bPorts.getCode()), BPorts::getCode, bPorts.getCode())
-			.like(ObjectUtils.isNotNull(bPorts.getCnName()), BPorts::getCnName, bPorts.getCnName())
+			.and(ObjectUtils.isNotNull(bPorts.getCnName()), i -> i.like(BPorts::getCode, bPorts.getCnName()).or()
+				.like(BPorts::getCnName, bPorts.getCnName()).or()
+				.like(BPorts::getEnName, bPorts.getCnName()))
 			.like(ObjectUtils.isNotNull(bPorts.getEnName()), BPorts::getEnName, bPorts.getEnName())
 			.like(ObjectUtils.isNotNull(bPorts.getEnName()), BPorts::getEnName, bPorts.getEnName())
 			.like(ObjectUtils.isNotNull(bPorts.getStatus()), BPorts::getStatus, bPorts.getStatus());
 			.like(ObjectUtils.isNotNull(bPorts.getStatus()), BPorts::getStatus, bPorts.getStatus());
 		String status = sysClient.getParamServiceNew("basic.data.sort");
 		String status = sysClient.getParamServiceNew("basic.data.sort");
@@ -165,7 +168,7 @@ public class BPortsController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入bPorts")
 	@ApiOperation(value = "新增或修改", notes = "传入bPorts")
 	@RepeatSubmit
 	@RepeatSubmit
-	public R submit(@Valid @RequestBody BPorts bPorts) throws Exception{
+	public R submit(@Valid @RequestBody BPorts bPorts) throws Exception {
 		return bPortsService.submit(bPorts);
 		return bPortsService.submit(bPorts);
 	}
 	}
 
 

+ 53 - 26
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/AgentServiceImpl.java

@@ -419,29 +419,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 				}
 				}
 				baseMapper.updateById(agent);
 				baseMapper.updateById(agent);
 			}
 			}
-			if (ObjectUtils.isNotNull(agent.getFilesCenterList()) && !agent.getFilesCenterList().isEmpty()) {
-				for (FilesCenter item : agent.getFilesCenterList()) {
-					if (item.getId() == null) {
-						item.setBusinessType("MYDL");
-						item.setSerialNo(1);
-						item.setSort(1);
-						item.setBillNo(agent.getBusinessNo());
-						item.setPid(agent.getId());
-						item.setCreateTime(new Date());
-						item.setCreateUser(AuthUtil.getUserId());
-						item.setCreateUserName(AuthUtil.getUserName());
-						if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
-							item.setCreateDept(deptId + "");
-							item.setCreateDeptName(deptName);
-						}
-					} else {
-						item.setUpdateUser(AuthUtil.getUserId());
-						item.setUpdateTime(new Date());
-						item.setUpdateUserName(AuthUtil.getUserName());
-					}
-				}
-				filesCenterService.saveOrUpdateBatch(agent.getFilesCenterList());
-			}
 		}
 		}
 		if ("MYDL-STL".equals(agent.getBusinessType())) {
 		if ("MYDL-STL".equals(agent.getBusinessType())) {
 			LocalDate localDate = new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 			LocalDate localDate = new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
@@ -650,6 +627,29 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 			feeCenterService.saveOrUpdateBatch(feeCenterList);
 			feeCenterService.saveOrUpdateBatch(feeCenterList);
 		}
 		}
 		this.saveOrUpdate(agent);
 		this.saveOrUpdate(agent);
+		if (ObjectUtils.isNotNull(agent.getFilesCenterList()) && !agent.getFilesCenterList().isEmpty()) {
+			for (FilesCenter item : agent.getFilesCenterList()) {
+				if (item.getId() == null) {
+					item.setBusinessType("MYDL");
+					item.setSerialNo(1);
+					item.setSort(1);
+					item.setBillNo(agent.getBusinessNo());
+					item.setPid(agent.getId());
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId + "");
+						item.setCreateDeptName(deptName);
+					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			filesCenterService.saveOrUpdateBatch(agent.getFilesCenterList());
+		}
 		return R.data(agent);
 		return R.data(agent);
 	}
 	}
 
 
@@ -2866,6 +2866,19 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 		stlAgent.setBusinessType("MYDL-STL");
 		stlAgent.setBusinessType("MYDL-STL");
 		stlAgent.setDc(feeCenterList.get(0).getDc());
 		stlAgent.setDc(feeCenterList.get(0).getDc());
 		stlAgent.setBusinessDate(date);
 		stlAgent.setBusinessDate(date);
+		if ("D".equals(stlAgent.getDc())) {
+			stlAgent.setDomesticConsigneeId(agent.getDomesticConsigneeId());
+			stlAgent.setDomesticConsigneeCname(agent.getDomesticConsigneeCname());
+			stlAgent.setDomesticBankMnemonicCode(agent.getDomesticBankMnemonicCode());
+			stlAgent.setDomesticBank(agent.getDomesticBank());
+			stlAgent.setDomesticCurrency(agent.getDomesticCurrency());
+		} else {
+			stlAgent.setAbroadConsignorId(agent.getAbroadConsignorId());
+			stlAgent.setAbroadConsignorCname(agent.getAbroadConsignorCname());
+			stlAgent.setAbroadBankMnemonicCode(agent.getAbroadBankMnemonicCode());
+			stlAgent.setAbroadBank(agent.getAbroadBank());
+			stlAgent.setAbroadCurrency(agent.getAbroadCurrency());
+		}
 		stlAgent.setGoodsValue(feeCenterList.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 		stlAgent.setGoodsValue(feeCenterList.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 		stlAgent.setPaymentInUsd(feeCenterList.stream().filter(e -> "SFK,WK".contains(e.getFeeCode()))
 		stlAgent.setPaymentInUsd(feeCenterList.stream().filter(e -> "SFK,WK".contains(e.getFeeCode()))
 			.map(FeeCenter::getAmountLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
 			.map(FeeCenter::getAmountLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -3271,13 +3284,18 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 							.eq(Agent::getBusinessType, "MYDL-STL")
 							.eq(Agent::getBusinessType, "MYDL-STL")
 							.in(Agent::getId, stlPids));
 							.in(Agent::getId, stlPids));
 					}
 					}
+				} else {
+					throw new RuntimeException("请先维护首款,尾款费用信息");
+				}
+				if (agentList.isEmpty()) {
+					throw new RuntimeException("请先确认首款,尾款收费");
 				}
 				}
 				AgentSKReport agentSKReport = new AgentSKReport();
 				AgentSKReport agentSKReport = new AgentSKReport();
 				List<Map<String, Object>> mapList = new ArrayList<>();
 				List<Map<String, Object>> mapList = new ArrayList<>();
 				List<Long> stlPids = feeCenterList.stream().filter(e -> "SFK".equals(e.getFeeCode())
 				List<Long> stlPids = feeCenterList.stream().filter(e -> "SFK".equals(e.getFeeCode())
-					&& "D".equals(e.getDc())).map(FeeCenter::getStlPid)
+						&& "D".equals(e.getDc())).map(FeeCenter::getStlPid)
 					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
-				List<Agent> agentList1 = agentList.stream().filter(e-> stlPids.contains(e.getId())).collect(Collectors.toList());
+				List<Agent> agentList1 = agentList.stream().filter(e -> stlPids.contains(e.getId())).collect(Collectors.toList());
 				for (Agent item : agentList1) {
 				for (Agent item : agentList1) {
 					Map<String, Object> map1 = new HashMap<>();
 					Map<String, Object> map1 = new HashMap<>();
 					map1.put("time", dateFormat.format(item.getBusinessDate()));
 					map1.put("time", dateFormat.format(item.getBusinessDate()));
@@ -3319,6 +3337,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 					agentSKReport.setPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setRemainingAmount(new BigDecimal("0.00"));
 					agentSKReport.setRemainingAmount(new BigDecimal("0.00"));
+					throw new RuntimeException("未查到应收首款费用信息");
 				}
 				}
 				agentSKReport.setSumAmount(agentSKReport.getAmount().add(agentSKReport.getPostElectricFee()
 				agentSKReport.setSumAmount(agentSKReport.getAmount().add(agentSKReport.getPostElectricFee()
 					.add(agentSKReport.getServiceCharge()).subtract(ObjectUtils.isNotNull(agentSKReport.getRemainingAmount())
 					.add(agentSKReport.getServiceCharge()).subtract(ObjectUtils.isNotNull(agentSKReport.getRemainingAmount())
@@ -3346,6 +3365,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 					agentSKReport.setRealityAmount(new BigDecimal("0.00"));
 					agentSKReport.setRealityAmount(new BigDecimal("0.00"));
 					agentSKReport.setRealityPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setRealityPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setRealityServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setRealityServiceCharge(new BigDecimal("0.00"));
+					throw new RuntimeException("未查到应付首款费用信息");
 				}
 				}
 				agentSKReport.setRealitySumAmount(agentSKReport.getRealityAmount().add(agentSKReport.getRealityPostElectricFee()
 				agentSKReport.setRealitySumAmount(agentSKReport.getRealityAmount().add(agentSKReport.getRealityPostElectricFee()
 					.add(agentSKReport.getRealityServiceCharge())));
 					.add(agentSKReport.getRealityServiceCharge())));
@@ -3397,13 +3417,18 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 							.eq(Agent::getBusinessType, "MYDL-STL")
 							.eq(Agent::getBusinessType, "MYDL-STL")
 							.in(Agent::getId, stlPids));
 							.in(Agent::getId, stlPids));
 					}
 					}
+				}else {
+					throw new RuntimeException("请先维护首款,尾款费用信息");
+				}
+				if (agentList.isEmpty()) {
+					throw new RuntimeException("请先确认首款,尾款收费");
 				}
 				}
 				AgentSKReport agentSKReport = new AgentSKReport();
 				AgentSKReport agentSKReport = new AgentSKReport();
 				List<Map<String, Object>> mapList = new ArrayList<>();
 				List<Map<String, Object>> mapList = new ArrayList<>();
 				List<Long> stlPids = feeCenterList.stream().filter(e -> "WK".equals(e.getFeeCode())
 				List<Long> stlPids = feeCenterList.stream().filter(e -> "WK".equals(e.getFeeCode())
 						&& "D".equals(e.getDc())).map(FeeCenter::getStlPid)
 						&& "D".equals(e.getDc())).map(FeeCenter::getStlPid)
 					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					.filter(Objects::nonNull).distinct().collect(Collectors.toList());
-				List<Agent> agentList1 = agentList.stream().filter(e-> stlPids.contains(e.getId())).collect(Collectors.toList());
+				List<Agent> agentList1 = agentList.stream().filter(e -> stlPids.contains(e.getId())).collect(Collectors.toList());
 				for (Agent item : agentList1) {
 				for (Agent item : agentList1) {
 					Map<String, Object> map1 = new HashMap<>();
 					Map<String, Object> map1 = new HashMap<>();
 					map1.put("time", dateFormat.format(item.getBusinessDate()));
 					map1.put("time", dateFormat.format(item.getBusinessDate()));
@@ -3446,6 +3471,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 					agentSKReport.setPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setRemainingAmount(new BigDecimal("0.00"));
 					agentSKReport.setRemainingAmount(new BigDecimal("0.00"));
+					throw new RuntimeException("未查到应收尾款费用信息");
 				}
 				}
 				agentSKReport.setSumAmount(agentSKReport.getAmount().add(agentSKReport.getPostElectricFee()
 				agentSKReport.setSumAmount(agentSKReport.getAmount().add(agentSKReport.getPostElectricFee()
 					.add(agentSKReport.getServiceCharge()).subtract(ObjectUtils.isNotNull(agentSKReport.getRemainingAmount())
 					.add(agentSKReport.getServiceCharge()).subtract(ObjectUtils.isNotNull(agentSKReport.getRemainingAmount())
@@ -3474,6 +3500,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 					agentSKReport.setRealityAmount(new BigDecimal("0.00"));
 					agentSKReport.setRealityAmount(new BigDecimal("0.00"));
 					agentSKReport.setRealityPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setRealityPostElectricFee(new BigDecimal("0.00"));
 					agentSKReport.setRealityServiceCharge(new BigDecimal("0.00"));
 					agentSKReport.setRealityServiceCharge(new BigDecimal("0.00"));
+					throw new RuntimeException("未查到应付尾款费用信息");
 				}
 				}
 				agentSKReport.setRealitySumAmount(agentSKReport.getRealityAmount().add(agentSKReport.getRealityPostElectricFee()
 				agentSKReport.setRealitySumAmount(agentSKReport.getRealityAmount().add(agentSKReport.getRealityPostElectricFee()
 					.add(agentSKReport.getRealityServiceCharge())));
 					.add(agentSKReport.getRealityServiceCharge())));

+ 3 - 2
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/DispatchVehiclesServiceImpl.java

@@ -130,13 +130,14 @@ public class DispatchVehiclesServiceImpl extends ServiceImpl<DispatchVehiclesMap
 		inOutStorage.setPrice(dispatchVehicles.getPrice());
 		inOutStorage.setPrice(dispatchVehicles.getPrice());
 		inOutStorage.setQuantity(dispatchVehicles.getNumber());
 		inOutStorage.setQuantity(dispatchVehicles.getNumber());
 		inOutStorage.setGrossWeight(dispatchVehicles.getGrossWeight());
 		inOutStorage.setGrossWeight(dispatchVehicles.getGrossWeight());
+		inOutStorage.setNetWeight(dispatchVehicles.getNetWeight());
 		inOutStorage.setLicenseNumber(dispatchVehicles.getLicenseNumber());
 		inOutStorage.setLicenseNumber(dispatchVehicles.getLicenseNumber());
 		inOutStorage.setFullName(dispatchVehicles.getFullName());
 		inOutStorage.setFullName(dispatchVehicles.getFullName());
 		inOutStorage.setTel(dispatchVehicles.getContactInformation());
 		inOutStorage.setTel(dispatchVehicles.getContactInformation());
 		inOutStorage.setBillType("RK");
 		inOutStorage.setBillType("RK");
 		inOutStorage.setSurplusQuantity(dispatchVehicles.getNumber());
 		inOutStorage.setSurplusQuantity(dispatchVehicles.getNumber());
-		inOutStorage.setSurplusWeight(dispatchVehicles.getGrossWeight());
-		inOutStorage.setSurplusGoodsAmount(dispatchVehicles.getNumber().multiply(dispatchVehicles.getPrice()));
+		inOutStorage.setSurplusWeight(dispatchVehicles.getNetWeight());
+		inOutStorage.setSurplusGoodsAmount(dispatchVehicles.getNetWeight().multiply(dispatchVehicles.getPrice()));
 		inOutStorage.setHsCode(dispatchVehicles.getHsCode());
 		inOutStorage.setHsCode(dispatchVehicles.getHsCode());
 		inOutStorage.setGoodsName(dispatchVehicles.getGoodsName());
 		inOutStorage.setGoodsName(dispatchVehicles.getGoodsName());
 		inOutStorage.setCreateTime(new Date());
 		inOutStorage.setCreateTime(new Date());

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

@@ -246,7 +246,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			}
 			}
 			inStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
 			inStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
-			inStorage.setSurplusGoodsAmount(inStorage.getSurplusQuantity().multiply(inOutStorage.getPrice()));
+			inStorage.setSurplusGoodsAmount(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
 			inStorage.setUpdateTime(new Date());
 			inStorage.setUpdateTime(new Date());
 			inStorage.setUpdateUser(AuthUtil.getUserId());
 			inStorage.setUpdateUser(AuthUtil.getUserId());
 			inStorage.setUpdateUserName(AuthUtil.getUserName());
 			inStorage.setUpdateUserName(AuthUtil.getUserName());
@@ -385,11 +385,10 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 		outStorage.setUpdateUserName(null);
 		outStorage.setUpdateUserName(null);
 		outStorage.setBillType("CK");
 		outStorage.setBillType("CK");
 		outStorage.setOutQuantity(inOutStorage.getQuantity().subtract(inOutStorage.getOutQuantity()));
 		outStorage.setOutQuantity(inOutStorage.getQuantity().subtract(inOutStorage.getOutQuantity()));
-		outStorage.setOutWeight(inOutStorage.getGrossWeight().subtract(inOutStorage.getOutWeight()));
-		outStorage.setOutWeight(inOutStorage.getGrossWeight().subtract(inOutStorage.getOutWeight()));
+		outStorage.setOutWeight(inOutStorage.getNetWeight().subtract(inOutStorage.getOutWeight()));
 		outStorage.setSurplusQuantity(inOutStorage.getOutQuantity());
 		outStorage.setSurplusQuantity(inOutStorage.getOutQuantity());
 		outStorage.setSurplusWeight(inOutStorage.getOutWeight());
 		outStorage.setSurplusWeight(inOutStorage.getOutWeight());
-		outStorage.setSurplusGoodsAmount(inOutStorage.getOutQuantity().multiply(inOutStorage.getPrice()));
+		outStorage.setSurplusGoodsAmount(inOutStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
 		outStorage.setConfirmDispatchVehicles("0");
 		outStorage.setConfirmDispatchVehicles("0");
 		baseMapper.insert(outStorage);
 		baseMapper.insert(outStorage);
 		inOutStorage.setWhetherInOutStorage("1");
 		inOutStorage.setWhetherInOutStorage("1");