|
@@ -408,12 +408,38 @@ public class K3CustomerLogic {
|
|
|
return k3CustomerVOIPage;
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void add(KingDeeCustomer kingDeeCustomer) {
|
|
|
+
|
|
|
+
|
|
|
+ if (kingDeeCustomerService.lambdaQuery().eq(KingDeeCustomer::getNumber,kingDeeCustomer.getNumber()).count() > 0) {
|
|
|
+ throw new RemoteServiceException("存在相同编号的经销商");
|
|
|
+ }
|
|
|
+
|
|
|
+ kingDeeCustomer.setId(kingDeeCustomer.getNumber());
|
|
|
+
|
|
|
kingDeeCustomer.insert();
|
|
|
+
|
|
|
+ //初始化经销商钱包
|
|
|
+
|
|
|
+ walletLogic.initByK3Customer(kingDeeCustomer.getId());
|
|
|
}
|
|
|
|
|
|
public void updateCustomer(KingDeeCustomer kingDeeCustomer) {
|
|
|
+ if (kingDeeCustomerService.lambdaQuery().eq(KingDeeCustomer::getNumber,kingDeeCustomer.getNumber())
|
|
|
+ .ne(KingDeeCustomer::getId,kingDeeCustomer.getId())
|
|
|
+ .count() > 0) {
|
|
|
+ throw new RemoteServiceException("存在相同编号的经销商");
|
|
|
+ }
|
|
|
+
|
|
|
+ kingDeeCustomer.setId(kingDeeCustomer.getNumber());
|
|
|
+
|
|
|
kingDeeCustomer.updateById();
|
|
|
+
|
|
|
+ //初始化经销商钱包
|
|
|
+
|
|
|
+ walletLogic.initByK3Customer(kingDeeCustomer.getId());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void importData(List<Object> datas) {
|
|
@@ -431,6 +457,7 @@ public class K3CustomerLogic {
|
|
|
|
|
|
KingDeeCustomer kingDeeCustomer = new KingDeeCustomer();
|
|
|
kingDeeCustomer.setNumber((String) row.get(0));
|
|
|
+ kingDeeCustomer.setId((String) row.get(0));
|
|
|
kingDeeCustomer.setName((String)row.get(1));
|
|
|
|
|
|
if (StringUtils.isEmpty((String) row.get(0)) || StringUtils.isEmpty((String) row.get(1)))
|
|
@@ -465,6 +492,11 @@ public class K3CustomerLogic {
|
|
|
|
|
|
}
|
|
|
|
|
|
- kingDeeCustomerService.saveBatch(kingDeeCustomers);
|
|
|
+ kingDeeCustomerService.saveOrUpdateBatch(kingDeeCustomers);
|
|
|
+
|
|
|
+
|
|
|
+ //初始化经销商钱包
|
|
|
+
|
|
|
+ walletLogic.initByK3Customer(null);
|
|
|
}
|
|
|
}
|