fanxw 1 year ago
parent
commit
520a6cfe8a

+ 9 - 0
src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractReceiveServiceImpl.java

@@ -26,6 +26,7 @@ import com.chinaitop.depot.business.model.BusinessContractReceiveExample.Criteri
26
 import com.chinaitop.depot.business.service.BusinessContractReceiveService;
26
 import com.chinaitop.depot.business.service.BusinessContractReceiveService;
27
 import com.chinaitop.depot.business.service.FeignBasicService;
27
 import com.chinaitop.depot.business.service.FeignBasicService;
28
 import com.chinaitop.depot.feignService.DepotKeeperAccountFeignService;
28
 import com.chinaitop.depot.feignService.DepotKeeperAccountFeignService;
29
+import com.chinaitop.depot.utils.ParameterUtil;
29
 
30
 
30
 @Service
31
 @Service
31
 @SuppressWarnings("all")
32
 @SuppressWarnings("all")
@@ -279,10 +280,18 @@ public class BusinessContractReceiveServiceImpl implements BusinessContractRecei
279
 
280
 
280
 		//如果不存在就新增一条不完整的客户
281
 		//如果不存在就新增一条不完整的客户
281
 		if (null == customerId) {//说明这个客户没再库级维护
282
 		if (null == customerId) {//说明这个客户没再库级维护
283
+			//形成客户编码
284
+			StringBuffer sbf = new StringBuffer();
285
+			//把单位ID格式化成3位,不足三位的补0
286
+			String sxm = String.format("%03d", orgId);
287
+			sbf.append("KH-").append(sxm).append("-").append(ParameterUtil.getDateYMDHMS(new Date()));
288
+
282
 			JSONObject json = new JSONObject();
289
 			JSONObject json = new JSONObject();
283
 			json.put("name", customerName);
290
 			json.put("name", customerName);
284
 			json.put("classify", 3153);
291
 			json.put("classify", 3153);
285
 			json.put("sfwz", "1");//客户数据是否完整(0:完整,1:不完整)
292
 			json.put("sfwz", "1");//客户数据是否完整(0:完整,1:不完整)
293
+            json.put("customerNumber", sbf.toString());
294
+
286
 			Map<String, Object> modelMap = feigenKeeperAccountService.save(json.toString(), orgId);
295
 			Map<String, Object> modelMap = feigenKeeperAccountService.save(json.toString(), orgId);
287
 			if ("error".equals(modelMap.get("status"))) {
296
 			if ("error".equals(modelMap.get("status"))) {
288
 				throw new Exception("不完整客户保存异常");
297
 				throw new Exception("不完整客户保存异常");