Browse Source

2024年3月29日11:38:53

纪新园 1 year ago
parent
commit
78a018e243
13 changed files with 145 additions and 31 deletions
  1. 2 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/ContainersCommodity.java
  2. 3 3
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/PreContainers.java
  3. 31 0
      blade-service/blade-los/src/main/java/org/springblade/los/Util/LosSpecialHandle.java
  4. 66 0
      blade-service/blade-los/src/main/java/org/springblade/los/Util/StringTools.java
  5. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/service/impl/BFeesServiceImpl.java
  6. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/vessels/service/impl/BVesselsServiceImpl.java
  7. 6 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java
  8. 6 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  9. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  10. 6 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  11. 12 9
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java
  12. 6 6
      blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java
  13. 1 1
      blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java

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

@@ -263,7 +263,7 @@ public class ContainersCommodity implements Serializable {
 	 * Emergency 温度
 	 */
 	@ApiModelProperty(value = "Emergency 温度")
-	private BigDecimal dgEmerTemperature;
+	private String dgEmerTemperature;
 	/**
 	 * Emergency 温度单位 C=摄氏度 F=华氏度
 	 */
@@ -273,7 +273,7 @@ public class ContainersCommodity implements Serializable {
 	 * Control 温度
 	 */
 	@ApiModelProperty(value = "Control 温度")
-	private BigDecimal dgCtrlTemperature;
+	private String dgCtrlTemperature;
 	/**
 	 * Control 温度单位 C=摄氏度 F=华氏度
 	 */

+ 3 - 3
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/PreContainers.java

@@ -134,7 +134,7 @@ public class PreContainers implements Serializable {
 	 * 温度
 	 */
 	@ApiModelProperty(value = "温度")
-	private BigDecimal temperature;
+	private String temperature;
 	/**
 	 * 温度单位 C=摄氏度 F=华氏度
 	 */
@@ -144,12 +144,12 @@ public class PreContainers implements Serializable {
 	 * 通风度
 	 */
 	@ApiModelProperty(value = "通风度")
-	private BigDecimal ventilation;
+	private String ventilation;
 	/**
 	 * 湿度
 	 */
 	@ApiModelProperty(value = "湿度")
-	private BigDecimal humidity;
+	private String humidity;
 	/**
 	 * 是否货主自有箱 SOC 箱(0 否 1是)
 	 */

+ 31 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/LosSpecialHandle.java

@@ -0,0 +1,31 @@
+package org.springblade.los.Util;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/1/30
+ */
+@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface LosSpecialHandle {
+
+	/**
+	 * 注释
+	 */
+	String massage();
+
+	/**
+	 * 去除前后空格
+	 */
+	boolean space();
+
+	/**
+	 * 转换大写
+	 */
+	boolean conversion();
+
+}

+ 66 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/StringTools.java

@@ -0,0 +1,66 @@
+package org.springblade.los.Util;
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import org.apache.poi.ss.formula.functions.T;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/29
+ */
+public class StringTools {
+
+
+	/**
+	 * 字符串英文字母转换成大写并去除前后空格
+	 *
+	 * @param data 字符串
+	 * @return 结果
+	 */
+	public static String handle(String data) {
+		if (ObjectUtils.isNotNull(data)) {
+			return data.trim().toLowerCase();
+		} else {
+			return data;
+		}
+	}
+
+	public static T a(T data) throws Exception {
+		Class<?> inttraSoDtoClass = data.getClass();
+
+		Field[] fileds = inttraSoDtoClass.getDeclaredFields();
+		for (Field field : fileds) {
+			String name = field.getName();
+			System.out.println("字段名:" + name);
+			// 设置访问权限为true,否则无法获取private字段的值
+			field.setAccessible(true);
+			Object value = field.get(data);
+			System.out.println("字段值:" + value);
+			Class<T> clazz = T.class;
+			Field field1 = clazz.getDeclaredField(name);
+			Annotation[] annotations = field1.getAnnotations(); // 获取字段上的所有注解
+			for (Annotation annotation : annotations) {
+				if (annotation instanceof LosSpecialHandle) {
+					LosSpecialHandle myAnnotation = (LosSpecialHandle) annotation;
+					boolean conversion = myAnnotation.conversion();
+					boolean space = myAnnotation.space();
+					if (conversion) {
+						if (ObjectUtils.isNotNull(value)) {
+							value = value.toString().toLowerCase();
+						}
+					}
+					if (space) {
+						if (ObjectUtils.isNotNull(value)) {
+							value = value.toString().trim();
+						}
+					}
+					System.out.println("注解值:" + myAnnotation.conversion());
+					System.out.println("注解值:" + myAnnotation.space());
+				}
+			}
+		}
+		return data;
+	}
+}

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

@@ -150,6 +150,8 @@ public class BFeesServiceImpl extends ServiceImpl<FeesMapper, BFees> implements
 				);
 				if (bAccElements != null) {
 					bFees.setAccElementName(bAccElements.getCnName());
+					bFees.setElementsCode(bAccElements.getCode());
+					bFees.setElementsEnName(bAccElements.getEnName());
 					bFees.setAccElementId(bAccElements.getId());
 				} else {
 					throw new RuntimeException("财务核算要素未查到");

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/vessels/service/impl/BVesselsServiceImpl.java

@@ -26,6 +26,7 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.los.Util.IDeptUtils;
+import org.springblade.los.Util.StringTools;
 import org.springblade.los.basic.corps.entity.BCorps;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.units.entity.BUnits;
@@ -70,9 +71,11 @@ public class BVesselsServiceImpl extends ServiceImpl<VesselsMapper, BVessels> im
 			bVessels.setCreateTime(new Date());
 			bVessels.setCreateUser(AuthUtil.getUserId());
 			bVessels.setCreateUserName(AuthUtil.getUserName());
+			bVessels.setCnName(StringTools.handle(bVessels.getCnName()));
 			if (baseMapper.selectCount(new LambdaQueryWrapper<BVessels>()
 				.eq(BVessels::getTenantId, AuthUtil.getTenantId())
 				.eq(BVessels::getIsDeleted, 0)
+
 				.eq(BVessels::getCnName, bVessels.getCnName())) > 0) {
 				throw new RuntimeException("船名已存在");
 			}

+ 6 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java

@@ -760,7 +760,10 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 		if ("1".equals(status)) {
 			List<FeeCenter> feeCenterListPS = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("PS")).collect(Collectors.toList());
 			List<FeeCenter> feeCenterListKY = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("空运费")).collect(Collectors.toList());
-			if (!feeCenterListPS.isEmpty()&& !feeCenterListKY.isEmpty()) {
+			if (!feeCenterListPS.isEmpty() && feeCenterListKY.isEmpty()) {
+				throw new RuntimeException("PS费与空运费需同时存在,当前缺少空运费用信息");
+			}
+			if (!feeCenterListPS.isEmpty()) {
 				BigDecimal amountHYD = feeCenterList.stream()
 					.filter(e -> e.getFeeCnName().equals("空运费") && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
 					.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -793,11 +796,11 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 				} else {
 					throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 				}
-			}else if (feeCenterListPS.isEmpty() && !feeCenterListKY.isEmpty()) {
+			}/*else if (feeCenterListPS.isEmpty() && !feeCenterListKY.isEmpty()) {
 				throw new RuntimeException("PS费与海运费需同时存在,当前缺少PS费用信息");
 			} else if (!feeCenterListPS.isEmpty()) {
 				throw new RuntimeException("PS费与海运费需同时存在,当前缺少海运费用信息");
-			}
+			}*/
 		}
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {

+ 6 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java

@@ -318,7 +318,10 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 			}
 			List<FeeCenter> feeCenterListPS = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("PS")).collect(Collectors.toList());
 			List<FeeCenter> feeCenterListKH = feeCenterList.stream().filter(e -> e.getFeeCnName().equals(type)).collect(Collectors.toList());
-			if (!feeCenterListPS.isEmpty() && !feeCenterListKH.isEmpty()) {
+			if (!feeCenterListPS.isEmpty() && feeCenterListKH.isEmpty()) {
+				throw new RuntimeException("PS费与" + type + "需同时存在,当前缺少" + type + "用信息");
+			}
+			if (!feeCenterListPS.isEmpty()) {
 				BigDecimal amountHYD = feeCenterList.stream()
 					.filter(e -> e.getFeeCnName().equals("海运费") && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
 					.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -366,11 +369,11 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 				} else {
 					throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 				}
-			} else if (feeCenterListPS.isEmpty() && !feeCenterListKH.isEmpty()) {
+			} /*else if (feeCenterListPS.isEmpty() && !feeCenterListKH.isEmpty()) {
 				throw new RuntimeException("PS费与" + type + "需同时存在,当前缺少PS费用信息");
 			} else if (!feeCenterListPS.isEmpty()) {
 				throw new RuntimeException("PS费与" + type + "需同时存在,当前缺少海运费用信息");
-			}
+			}*/
 			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
 			if (!financeProcess.isSuccess()) {
 				throw new SecurityException("操作失败,请联系管理员");

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -86,7 +86,7 @@ public class BillsController extends BladeController {
 			Bills::getAmountDrLoc, Bills::getAmountCrLoc, Bills::getAmountProfitLoc, Bills::getCheckCrStatusDescr, Bills::getCheckDrStatusDescr,
 			Bills::getStlCrStatusDescr, Bills::getStlDrStatusDescr, Bills::getInvoiceCrStatusDescr, Bills::getInvoiceDrStatusDescr, Bills::getCreateUserName,
 			Bills::getCreateTime, Bills::getUpdateUserName, Bills::getUpdateTime, Bills::getStatus, Bills::getBillStatus,
-			Bills::getAccountStatus, Bills::getRemarks, Bills::getPackingUnit, Bills::getBillDate, Bills::getTeamName,Bills::getCreateUser,Bills::getTeu);
+			Bills::getAccountStatus, Bills::getRemarks, Bills::getPackingUnit, Bills::getBillDate, Bills::getTeamName,Bills::getCreateUser,Bills::getTeu,Bills::getIssueType);
 		lambdaQueryWrapper.eq(Bills::getIsDeleted, 0)
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.and(i -> i.isNull(Bills::getMasterId).or()

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

@@ -1107,7 +1107,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if ("1".equals(status)) {
 			List<FeeCenter> feeCenterListPS = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("PS")).collect(Collectors.toList());
 			List<FeeCenter> feeCenterListHY = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("海运费")).collect(Collectors.toList());
-			if (!feeCenterListPS.isEmpty() && !feeCenterListHY.isEmpty()) {
+			if (!feeCenterListPS.isEmpty() && feeCenterListHY.isEmpty()) {
+				throw new RuntimeException("PS费与海运费需同时存在,当前缺少海运费用信息");
+			}
+			if (!feeCenterListPS.isEmpty()) {
 				BigDecimal amountHYD = feeCenterList.stream()
 					.filter(e -> e.getFeeCnName().equals("海运费") && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
 					.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -1140,11 +1143,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				} else {
 					throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 				}
-			} else if (feeCenterListPS.isEmpty() && !feeCenterListHY.isEmpty()) {
+			} /*else if (!feeCenterListPS.isEmpty() && feeCenterListHY.isEmpty()) {
 				throw new RuntimeException("PS费与海运费需同时存在,当前缺少PS费用信息");
 			} else if (!feeCenterListPS.isEmpty()) {
 				throw new RuntimeException("PS费与海运费需同时存在,当前缺少海运费用信息");
-			}
+			}*/
 		}
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {

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

@@ -83,9 +83,9 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 		String deptName = "";
 		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
-		if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
-			deptId = deptUtils.getDeptPid()+"";
-			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid()+"");
+		if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
+			deptId = deptUtils.getDeptPid() + "";
+			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid() + "");
 			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
 				deptName = String.join(",", res.getData());
 			}
@@ -95,6 +95,9 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 		if (bills == null) {
 			throw new RuntimeException("未找到单据信息");
 		}
+		preContainers.setMeasurement(ObjectUtils.isNotNull(preContainers.getMeasurement()) ? preContainers.getMeasurement() : new BigDecimal("0.00"));
+		preContainers.setGrossWeight(ObjectUtils.isNotNull(preContainers.getGrossWeight()) ? preContainers.getGrossWeight() : new BigDecimal("0.00"));
+		preContainers.setQuantity(ObjectUtils.isNotNull(preContainers.getNumber()) ? preContainers.getNumber().intValue() : 0);
 		teu = ObjectUtils.isNotNull(bills.getTeu()) ? bills.getTeu() : 0;
 		List<PreContainers> preContainersList = baseMapper.selectList(new LambdaQueryWrapper<PreContainers>()
 			.select(PreContainers::getId, PreContainers::getMeasurement, PreContainers::getNumber, PreContainers::getGrossWeight)
@@ -107,7 +110,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			preContainers.setCreateTime(new Date());
 			preContainers.setCreateUser(AuthUtil.getUserId());
 			preContainers.setCreateUserName(AuthUtil.getUserName());
-			if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
+			if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
 				preContainers.setBranchId(branchId);
 				preContainers.setCreateDept(deptId);
 				preContainers.setCreateDeptName(deptName);
@@ -186,7 +189,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			containers.setCreateUser(AuthUtil.getUserId());
 			containers.setCreateUserName(AuthUtil.getUserName());
 			containers.setCyCntrCode(ediCode);
-			if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
+			if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
 				containers.setBranchId(branchId);
 				containers.setCreateDept(deptId);
 				containers.setCreateDeptName(deptName);
@@ -253,9 +256,9 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 		String deptName = "";
 		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
-		if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
-			deptId = deptUtils.getDeptPid()+"";
-			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid()+"");
+		if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
+			deptId = deptUtils.getDeptPid() + "";
+			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid() + "");
 			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
 				deptName = String.join(",", res.getData());
 			}
@@ -295,7 +298,7 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 				preContainers.setCreateTime(new Date());
 				preContainers.setCreateUser(AuthUtil.getUserId());
 				preContainers.setCreateUserName(AuthUtil.getUserName());
-				if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
+				if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
 					preContainers.setBranchId(branchId);
 					preContainers.setCreateDept(deptId);
 					preContainers.setCreateDeptName(deptName);

+ 6 - 6
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java

@@ -403,10 +403,10 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 				map.put("sizeType", ediCode);
 				map.put("cntrQty", item.getQuantity());
 				map.put("isSoc", item.getIsSoc());
-				map.put("temperature", RegularUtils.formatTempNumber(item.getTemperature(), 3));
+				map.put("temperature", RegularUtils.formatTempNumber(new BigDecimal(item.getTemperature()), 3));
 				map.put("temperatureUnit", item.getTemperatureUnit());
-				map.put("ventilation", RegularUtils.formatTempNumber(item.getVentilation(), 3));
-				map.put("humidity", RegularUtils.formatTempNumber(item.getHumidity(), 3));
+				map.put("ventilation", RegularUtils.formatTempNumber(new BigDecimal(item.getVentilation()), 3));
+				map.put("humidity", RegularUtils.formatTempNumber(new BigDecimal(item.getHumidity()), 3));
 				preCntrs.add(map);
 			} else {
 				throw new RuntimeException("箱型数据错误");
@@ -454,10 +454,10 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 				map.put("isSoc", item.getIsSoc());
 				PreContainers preContainers = preContainersList.stream().filter(e -> e.getCntrTypeCode().equals(item.getCntrTypeCode())).findFirst().orElse(null);
 				if (preContainers != null) {
-					map.put("temperature", RegularUtils.formatTempNumber(preContainers.getTemperature(), 3));
+					map.put("temperature", RegularUtils.formatTempNumber(new BigDecimal(preContainers.getTemperature()), 3));
 					map.put("temperatureUnit", preContainers.getTemperatureUnit());
-					map.put("ventilation", RegularUtils.formatTempNumber(preContainers.getVentilation(), 3));
-					map.put("humidity", RegularUtils.formatTempNumber(preContainers.getHumidity(), 3));
+					map.put("ventilation", RegularUtils.formatTempNumber(new BigDecimal(preContainers.getVentilation()), 3));
+					map.put("humidity", RegularUtils.formatTempNumber(new BigDecimal(preContainers.getHumidity()), 3));
 				}else{
 					map.put("temperature", "");
 					map.put("temperatureUnit", "");

+ 1 - 1
blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java

@@ -65,7 +65,7 @@ public class SybPayService {
 		params.put("validtime", validtime);
 		params.put("acct", acct);
 		params.put("notify_url", notify_url);
-		params.put("limit_pay", limit_pay);
+//		params.put("limit_pay", limit_pay);
 		params.put("sub_appid", sub_appid);
 		params.put("goods_tag", goods_tag);
 		params.put("benefitdetail", benefitdetail);