|
@@ -118,7 +118,7 @@ public class PJCorprClient implements IPJCorpClient {
|
|
|
for (PjOrderItems e : list) {
|
|
for (PjOrderItems e : list) {
|
|
|
if (!pjGoodsDescList.isEmpty()) {
|
|
if (!pjGoodsDescList.isEmpty()) {
|
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(item -> item.getId().equals(e.getGoodsId())).findFirst().orElse(null);
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(item -> item.getId().equals(e.getGoodsId())).findFirst().orElse(null);
|
|
|
- if (goodsDesc != null) {
|
|
|
|
|
|
|
+ if (goodsDesc != null && new BigDecimal("0.00").compareTo(goodsDesc.getIntegral()) != 0) {
|
|
|
goodsIds.add(goodsDesc.getId());
|
|
goodsIds.add(goodsDesc.getId());
|
|
|
integral= integral.add(goodsDesc.getIntegral().multiply(e.getGoodsNum()));
|
|
integral= integral.add(goodsDesc.getIntegral().multiply(e.getGoodsNum()));
|
|
|
//客户门店积分
|
|
//客户门店积分
|
|
@@ -127,27 +127,29 @@ public class PJCorprClient implements IPJCorpClient {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
System.out.println("=========积分处理完成数据==========");
|
|
System.out.println("=========积分处理完成数据==========");
|
|
|
- corpsDescMapper.updateByIdPointsBalance(corpsDesc);
|
|
|
|
|
- PjIntegralDetail integralDetail = new PjIntegralDetail();
|
|
|
|
|
- integralDetail.setCreateTime(new Date());
|
|
|
|
|
- integralDetail.setCreateUserName(order.getCreateUserName());
|
|
|
|
|
- integralDetail.setCreateUser(order.getCreateUser());
|
|
|
|
|
- integralDetail.setTenantId(tenantId);
|
|
|
|
|
- integralDetail.setType("购买获取");
|
|
|
|
|
- integralDetail.setSrcId(order.getId());
|
|
|
|
|
- integralDetail.setSrcNo(order.getOrdNo());
|
|
|
|
|
- integralDetail.setCorpId(order.getCustomerId());
|
|
|
|
|
- integralDetail.setCorpName(order.getCustomerName());
|
|
|
|
|
- integralDetail.setIntegral(integral);
|
|
|
|
|
- integralDetail.setGoodsName(order.getGoodsNameJoin());
|
|
|
|
|
- StringBuilder goodsId = new StringBuilder();
|
|
|
|
|
- for (Long item : goodsIds) {
|
|
|
|
|
- goodsId.append(item).append(",");
|
|
|
|
|
- }
|
|
|
|
|
- if (goodsId.length() > 0) {
|
|
|
|
|
- integralDetail.setGoodsId(goodsId.substring(0, goodsId.length() - 1));
|
|
|
|
|
|
|
+ if (new BigDecimal("0.00").compareTo(integral) != 0){
|
|
|
|
|
+ corpsDescMapper.updateByIdPointsBalance(corpsDesc);
|
|
|
|
|
+ PjIntegralDetail integralDetail = new PjIntegralDetail();
|
|
|
|
|
+ integralDetail.setCreateTime(new Date());
|
|
|
|
|
+ integralDetail.setCreateUserName(order.getCreateUserName());
|
|
|
|
|
+ integralDetail.setCreateUser(order.getCreateUser());
|
|
|
|
|
+ integralDetail.setTenantId(tenantId);
|
|
|
|
|
+ integralDetail.setType("购买获取");
|
|
|
|
|
+ integralDetail.setSrcId(order.getId());
|
|
|
|
|
+ integralDetail.setSrcNo(order.getOrdNo());
|
|
|
|
|
+ integralDetail.setCorpId(order.getCustomerId());
|
|
|
|
|
+ integralDetail.setCorpName(order.getCustomerName());
|
|
|
|
|
+ integralDetail.setIntegral(integral);
|
|
|
|
|
+ integralDetail.setGoodsName(order.getGoodsNameJoin());
|
|
|
|
|
+ StringBuilder goodsId = new StringBuilder();
|
|
|
|
|
+ for (Long item : goodsIds) {
|
|
|
|
|
+ goodsId.append(item).append(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (goodsId.length() > 0) {
|
|
|
|
|
+ integralDetail.setGoodsId(goodsId.substring(0, goodsId.length() - 1));
|
|
|
|
|
+ }
|
|
|
|
|
+ integralDetailList.add(integralDetail);
|
|
|
}
|
|
}
|
|
|
- integralDetailList.add(integralDetail);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
System.out.println("=========循环未找到明细数据==========");
|
|
System.out.println("=========循环未找到明细数据==========");
|
|
|
}
|
|
}
|
|
@@ -222,7 +224,7 @@ public class PJCorprClient implements IPJCorpClient {
|
|
|
for (PjOrderItems e : list) {
|
|
for (PjOrderItems e : list) {
|
|
|
if (!pjGoodsDescList.isEmpty()) {
|
|
if (!pjGoodsDescList.isEmpty()) {
|
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(item -> item.getId().equals(e.getGoodsId())).findFirst().orElse(null);
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(item -> item.getId().equals(e.getGoodsId())).findFirst().orElse(null);
|
|
|
- if (goodsDesc != null) {
|
|
|
|
|
|
|
+ if (goodsDesc != null&& new BigDecimal("0.00").compareTo(goodsDesc.getIntegral()) != 0) {
|
|
|
integral= integral.add(goodsDesc.getIntegral().multiply(e.getGoodsNum()));
|
|
integral= integral.add(goodsDesc.getIntegral().multiply(e.getGoodsNum()));
|
|
|
goodsIds.add(goodsDesc.getId());
|
|
goodsIds.add(goodsDesc.getId());
|
|
|
//客户门店积分
|
|
//客户门店积分
|
|
@@ -231,27 +233,29 @@ public class PJCorprClient implements IPJCorpClient {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
System.out.println("=========积分处理完成数据==========");
|
|
System.out.println("=========积分处理完成数据==========");
|
|
|
- corpsDescMapper.updateByIdPointsBalance(corpsDesc);
|
|
|
|
|
- PjIntegralDetail integralDetail = new PjIntegralDetail();
|
|
|
|
|
- integralDetail.setCreateTime(new Date());
|
|
|
|
|
- integralDetail.setCreateUserName(order.getCreateUserName());
|
|
|
|
|
- integralDetail.setCreateUser(order.getCreateUser());
|
|
|
|
|
- integralDetail.setTenantId(tenantId);
|
|
|
|
|
- integralDetail.setType("积分退回");
|
|
|
|
|
- integralDetail.setSrcId(order.getId());
|
|
|
|
|
- integralDetail.setSrcNo(order.getOrdNo());
|
|
|
|
|
- integralDetail.setCorpId(order.getCustomerId());
|
|
|
|
|
- integralDetail.setCorpName(order.getCustomerName());
|
|
|
|
|
- integralDetail.setIntegral(integral);
|
|
|
|
|
- integralDetail.setGoodsName(order.getGoodsNameJoin());
|
|
|
|
|
- StringBuilder goodsId = new StringBuilder();
|
|
|
|
|
- for (Long item : goodsIds) {
|
|
|
|
|
- goodsId.append(item).append(",");
|
|
|
|
|
- }
|
|
|
|
|
- if (goodsId.length() > 0) {
|
|
|
|
|
- integralDetail.setGoodsId(goodsId.substring(0, goodsId.length() - 1));
|
|
|
|
|
|
|
+ if (new BigDecimal("0.00").compareTo(integral) != 0){
|
|
|
|
|
+ corpsDescMapper.updateByIdPointsBalance(corpsDesc);
|
|
|
|
|
+ PjIntegralDetail integralDetail = new PjIntegralDetail();
|
|
|
|
|
+ integralDetail.setCreateTime(new Date());
|
|
|
|
|
+ integralDetail.setCreateUserName(order.getCreateUserName());
|
|
|
|
|
+ integralDetail.setCreateUser(order.getCreateUser());
|
|
|
|
|
+ integralDetail.setTenantId(tenantId);
|
|
|
|
|
+ integralDetail.setType("积分退回");
|
|
|
|
|
+ integralDetail.setSrcId(order.getId());
|
|
|
|
|
+ integralDetail.setSrcNo(order.getOrdNo());
|
|
|
|
|
+ integralDetail.setCorpId(order.getCustomerId());
|
|
|
|
|
+ integralDetail.setCorpName(order.getCustomerName());
|
|
|
|
|
+ integralDetail.setIntegral(integral);
|
|
|
|
|
+ integralDetail.setGoodsName(order.getGoodsNameJoin());
|
|
|
|
|
+ StringBuilder goodsId = new StringBuilder();
|
|
|
|
|
+ for (Long item : goodsIds) {
|
|
|
|
|
+ goodsId.append(item).append(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (goodsId.length() > 0) {
|
|
|
|
|
+ integralDetail.setGoodsId(goodsId.substring(0, goodsId.length() - 1));
|
|
|
|
|
+ }
|
|
|
|
|
+ integralDetailList.add(integralDetail);
|
|
|
}
|
|
}
|
|
|
- integralDetailList.add(integralDetail);
|
|
|
|
|
} else {
|
|
} else {
|
|
|
System.out.println("=========循环未找到明细数据==========");
|
|
System.out.println("=========循环未找到明细数据==========");
|
|
|
}
|
|
}
|