fanxw il y a 1 an
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 26
 import com.chinaitop.depot.business.service.BusinessContractReceiveService;
27 27
 import com.chinaitop.depot.business.service.FeignBasicService;
28 28
 import com.chinaitop.depot.feignService.DepotKeeperAccountFeignService;
29
+import com.chinaitop.depot.utils.ParameterUtil;
29 30
 
30 31
 @Service
31 32
 @SuppressWarnings("all")
@@ -279,10 +280,18 @@ public class BusinessContractReceiveServiceImpl implements BusinessContractRecei
279 280
 
280 281
 		//如果不存在就新增一条不完整的客户
281 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 289
 			JSONObject json = new JSONObject();
283 290
 			json.put("name", customerName);
284 291
 			json.put("classify", 3153);
285 292
 			json.put("sfwz", "1");//客户数据是否完整(0:完整,1:不完整)
293
+            json.put("customerNumber", sbf.toString());
294
+
286 295
 			Map<String, Object> modelMap = feigenKeeperAccountService.save(json.toString(), orgId);
287 296
 			if ("error".equals(modelMap.get("status"))) {
288 297
 				throw new Exception("不完整客户保存异常");