Przeglądaj źródła

MH 客户资料保存等

wfg 5 miesięcy temu
rodzic
commit
980972d17a

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/service/impl/BCorpsServiceImpl.java

@@ -123,7 +123,7 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 		if (null == bCorps.getInitials() || bCorps.getInitials().isEmpty()) {
 			//获得名称首字母
 			String initials = getSpells(bCorps.getCnName());
-			bCorps.setInitials(initials.substring(0, 1));
+			bCorps.setInitials(initials.length() > 0 ? initials.substring(0, 1) : "");
 		}
 		if (bCorps.getId() == null) {
 			if (!cname.isEmpty()) {
@@ -441,7 +441,7 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 				if (null == bCorps.getInitials() || "".equals(bCorps.getInitials())) {
 					//获得名称首字母
 					String initials = getSpells(bCorps.getCnName());
-					bCorps.setInitials(initials.substring(0, 1));
+					bCorps.setInitials(initials.length() > 0 ? initials.substring(0, 1) : "");
 				}
 				/*if (cname > 0) {
 					throw new RuntimeException("中文名称" + bCorps.getCnName() + "不允许重复");

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

@@ -1926,15 +1926,34 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			item.setApproveTime(null);
 			item.setAuditStatus("0");
 		}
+
+		String branchId = deptUtils.getDeptPid() + "";
+
 		Bills copyBills = new Bills();
 		BeanUtil.copyProperties(detail, copyBills);
 		copyBills.setId(null);
+		copyBills.setCreateTime(new Date());
+		copyBills.setCreateUser(AuthUtil.getUserId());
+		copyBills.setCreateUserName(AuthUtil.getUserName());
+		copyBills.setTenantId(AuthUtil.getTenantId());
+		if (ObjectUtils.isNotNull(branchId)) {
+			copyBills.setBranchId(branchId);
+		}
 		copyBills.setOperatorId(AuthUtil.getUserId());
 		copyBills.setOperatorName(AuthUtil.getUserName());
 		Dept dept = deptUtils.getDept(AuthUtil.getDeptId());
 		if (dept != null) {
+			// 业务创建部门
+			copyBills.setCreateDept(dept.getId() + "");
+			copyBills.setCreateDeptName(dept.getDeptName());
+
+			// 操作部门
 			copyBills.setOperatorDept(dept.getId() + "");
 			copyBills.setOperatorDeptName(dept.getDeptName());
+
+			// 核算部门
+			copyBills.setAccDept(dept.getId() + "");
+			copyBills.setAccDeptName(dept.getDeptName());
 		}
 		copyBills.setBillNo("");
 		copyBills.setMblno("");
@@ -3776,6 +3795,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			copyBills.setId(null);
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
+			/*
 			if ("SE,SI".contains(item.getBusinessType())) {
 				if ("dry".equals(copyBills.getCargoType())) {
 					businessBillNo.setCode(type + "-PH");
@@ -3789,14 +3809,37 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			} else {
 				businessBillNo.setCode(type);
 			}
+			*/
+			businessBillNo.setCode(type);
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 				throw new RuntimeException("生成订单编号失败");
 			}
 			copyBills.setBillNo((String) clientBillNo.getData());
+
+			copyBills.setCreateTime(new Date());
+			copyBills.setCreateUser(AuthUtil.getUserId());
+			copyBills.setCreateUserName(AuthUtil.getUserName());
+
 			copyBills.setOperatorId(AuthUtil.getUserId());
 			copyBills.setOperatorName(AuthUtil.getUserName());
+
+			Dept dept = deptUtils.getDept(AuthUtil.getDeptId());
+			if (dept != null) {
+				// 业务创建部门
+				copyBills.setCreateDept(dept.getId() + "");
+				copyBills.setCreateDeptName(dept.getDeptName());
+
+				// 操作部门
+				copyBills.setOperatorDept(dept.getId() + "");
+				copyBills.setOperatorDeptName(dept.getDeptName());
+
+				// 核算部门
+				copyBills.setAccDept(dept.getId() + "");
+				copyBills.setAccDeptName(dept.getDeptName());
+			}
+
 			copyBills.setBillNo("");
 			copyBills.setMblno("");
 			copyBills.setHblno("");

+ 5 - 5
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/MscZipImportImpl.java

@@ -1076,9 +1076,9 @@ public class MscZipImportImpl extends ServiceImpl<BillsMapper, Bills> implements
 												cargo.setQuantity(getJsonValueAsBigDecimal(joj, "Quantity"));
 												cargo.setGrossWeight(getJsonValueAsBigDecimal(joj, "Weight"));
 												cargo.setMeasurement(getJsonValueAsBigDecimal(joj, "Measurement"));
-												cargo.setCommodityShName(getJsonValueAsString(joj, "ShortDescription"));
-												cargo.setCommodityCnName(getJsonValueAsString(joj, "Commodity"));
-												cargo.setCommodityEnName(getJsonValueAsString(joj, "Commodity"));
+												cargo.setCommodityShName(RegularUtils.copySubstring(getJsonValueAsString(joj, "ShortDescription"), 0, 255));
+												cargo.setCommodityCnName(RegularUtils.copySubstring(getJsonValueAsString(joj, "Commodity"), 0, 500));
+												cargo.setCommodityEnName(RegularUtils.copySubstring(getJsonValueAsString(joj, "Commodity"), 0, 500));
 												cargo.setCommodityDescr(getJsonValueAsString(joj, "ShipperDescription"));
 												cargo.setMarks(getJsonValueAsString(joj, "MarksNumbers"));
 
@@ -1099,11 +1099,11 @@ public class MscZipImportImpl extends ServiceImpl<BillsMapper, Bills> implements
 												billVol = billVol.add(cargo.getMeasurement());
 
 												if(commodityShName.isEmpty()){
-													commodityShName = getJsonValueAsString(joj, "ShortDescription");
+													commodityShName = RegularUtils.copySubstring(getJsonValueAsString(joj, "ShortDescription"), 0, 255);
 												}
 
 												if(commodityEnName.isEmpty()){
-													commodityEnName = getJsonValueAsString(joj, "Commodity");
+													commodityEnName = RegularUtils.copySubstring(getJsonValueAsString(joj, "Commodity"), 0, 500);
 												}
 
 												if(hsCode.isEmpty()){

+ 0 - 1
blade-service/blade-los/src/main/java/org/springblade/los/gmy/service/impl/GmyDataExchangApiServiceImpl.java

@@ -859,7 +859,6 @@ public class GmyDataExchangApiServiceImpl implements IGmyDataExchangApiService {
 					);
 				}
 			}
-
 		}else {
 			message = "没有可导入关贸云报关单!";
 		}