|
@@ -489,73 +489,88 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
@Transactional(readOnly = false)
|
|
|
public void checkPass(CmPayShop cmPayShop) throws Exception {
|
|
|
List<CmPayShopRecord> records = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
|
|
|
- //修改每一条子订单的已付款金额
|
|
|
- for (CmPayShopRecord record : records) {
|
|
|
- NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
- Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
|
|
|
- wipePayment = wipePayment != null ? wipePayment : 0d;
|
|
|
- // 本次付款金额 + 抹平金额 + 原来已经付过的金额
|
|
|
- BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
|
|
|
- // 总共要付的金额
|
|
|
- BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
|
|
|
- //判断是否有差价金额
|
|
|
- if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
|
|
|
- shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
|
|
|
- } else if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 2) {
|
|
|
- shouldPayFee = MathUtil.sub(shouldPayFee, shopOrder.getDifferencePrice());
|
|
|
- }
|
|
|
- if (MathUtil.compare(payedFee, shouldPayFee) == -1) {
|
|
|
- // (本次付款金额 + 抹平金额 + 原来已经付过的金额) < 总共要付的金额
|
|
|
- shopOrder.setPayStatus("2");
|
|
|
- //那么主订单肯定也是部分付款
|
|
|
- newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
- } else if (MathUtil.compare(payedFee, shouldPayFee) == 0) {
|
|
|
- // 本次付款金额 + 原来已经付过的金额 近似于 总共要付的金额相等
|
|
|
- shopOrder.setPayStatus("3");
|
|
|
- } else {
|
|
|
- logger.info("已付款金额:" + shopOrder.getPayedShopAmount() + "本次付款金额:" + record.getPayAmount() + "付供应商:" + shouldPayFee + "付款id:" + cmPayShop.getId());
|
|
|
- logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
|
|
|
- throw new Exception("付款金额异常, 付款金额大于待付款金额");
|
|
|
- }
|
|
|
- shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
|
|
|
- shopOrder.setPaying("0"); //退出付款进行状态
|
|
|
- newShopOrderDao.update(shopOrder);
|
|
|
- record.setStatus("1");
|
|
|
- record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
- record.setPayType(cmPayShop.getPayType());
|
|
|
- cmPayShopRecordDao.update(record);
|
|
|
- List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
|
|
|
- boolean f = true;
|
|
|
- for (String p : payStatus) {
|
|
|
- if (!"3".equals(p)) {
|
|
|
- //不是所有的子订单都全部付款了
|
|
|
- f = false;
|
|
|
- break;
|
|
|
+ User currentUser = UserUtils.getUser();
|
|
|
+ if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
|
|
|
+ //修改每一条子订单的已付款金额
|
|
|
+ for (CmPayShopRecord record : records) {
|
|
|
+ NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
+ Double wipePayment = cmPayShopRecordDao.sumWipePaymentNoStatus(Integer.valueOf(record.getShopOrderID()));
|
|
|
+ wipePayment = wipePayment != null ? wipePayment : 0d;
|
|
|
+ // 本次付款金额 + 抹平金额 + 原来已经付过的金额
|
|
|
+ BigDecimal payedFee = MathUtil.add(MathUtil.add(record.getPayAmount(), wipePayment), shopOrder.getPayedShopAmount());
|
|
|
+ // 总共要付的金额
|
|
|
+ BigDecimal shouldPayFee = BigDecimal.valueOf(shopOrder.getShouldPayShopAmount());
|
|
|
+ //判断是否有差价金额
|
|
|
+ if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 1) {
|
|
|
+ shouldPayFee = MathUtil.add(shouldPayFee, shopOrder.getDifferencePrice());
|
|
|
+ } else if (shopOrder.getDifferenceType() != null && shopOrder.getDifferenceType() == 2) {
|
|
|
+ shouldPayFee = MathUtil.sub(shouldPayFee, shopOrder.getDifferencePrice());
|
|
|
+ }
|
|
|
+ if (MathUtil.compare(payedFee, shouldPayFee) == -1) {
|
|
|
+ // (本次付款金额 + 抹平金额 + 原来已经付过的金额) < 总共要付的金额
|
|
|
+ shopOrder.setPayStatus("2");
|
|
|
+ //那么主订单肯定也是部分付款
|
|
|
+ newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
+ } else if (MathUtil.compare(payedFee, shouldPayFee) == 0) {
|
|
|
+ // 本次付款金额 + 原来已经付过的金额 近似于 总共要付的金额相等
|
|
|
+ shopOrder.setPayStatus("3");
|
|
|
+ } else {
|
|
|
+ logger.info("已付款金额:" + shopOrder.getPayedShopAmount() + "本次付款金额:" + record.getPayAmount() + "付供应商:" + shouldPayFee + "付款id:" + cmPayShop.getId());
|
|
|
+ logger.info("check ----> 付款金额异常, 付款金额大于待付款金额");
|
|
|
+ throw new Exception("付款金额异常, 付款金额大于待付款金额");
|
|
|
}
|
|
|
+ shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : shopOrder.getPayedShopAmount() + record.getPayAmount());
|
|
|
+ shopOrder.setPaying("0"); //退出付款进行状态
|
|
|
+ newShopOrderDao.update(shopOrder);
|
|
|
+ record.setStatus("1");
|
|
|
+ record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
+ record.setPayType(cmPayShop.getPayType());
|
|
|
+ cmPayShopRecordDao.update(record);
|
|
|
+ List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
|
|
|
+ boolean f = true;
|
|
|
+ for (String p : payStatus) {
|
|
|
+ if (!"3".equals(p)) {
|
|
|
+ //不是所有的子订单都全部付款了
|
|
|
+ f = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (f) //所有的子订单都是全部付款
|
|
|
+ newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
|
|
|
+ else
|
|
|
+ newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
}
|
|
|
- if (f) //所有的子订单都是全部付款
|
|
|
- newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
|
|
|
- else
|
|
|
- newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
- }
|
|
|
- User currentUser = UserUtils.getUser();
|
|
|
- cmPayShop.setReviewer(currentUser.getId());
|
|
|
- cmPayShop.setReviewTime(DateUtils.getDateTime());
|
|
|
- cmPayShop.setPayTime(DateUtils.getDateTime());
|
|
|
- cmPayShop.setStatus("1");
|
|
|
- cmPayShopDao.update(cmPayShop);
|
|
|
- if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
- //如果使用了余额付款 往余额记录表里面写入记录的cm_rebate_record
|
|
|
- CmRebateRecord r = new CmRebateRecord();
|
|
|
- r.setType("2");
|
|
|
- r.setShopId(cmPayShop.getShopID());
|
|
|
- r.setPayShopID(cmPayShop.getId());
|
|
|
- r.setShopOrderId(StringUtil.join(records.stream().map(CmPayShopRecord::getShopOrderID).toArray(), ","));
|
|
|
- r.setRebateAmount(cmPayShop.getBalancePayFee());
|
|
|
- r.setOperatTime(DateUtils.formatDateTime(new Date()));
|
|
|
- cmRebateRecordDao.insert(r);
|
|
|
- //扣除供应商余额
|
|
|
- newCmShopDao.updateRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
|
|
|
+ cmPayShop.setReviewer(currentUser.getId());
|
|
|
+ cmPayShop.setReviewTime(DateUtils.getDateTime());
|
|
|
+ cmPayShop.setPayTime(DateUtils.getDateTime());
|
|
|
+ cmPayShop.setStatus("1");
|
|
|
+ cmPayShopDao.update(cmPayShop);
|
|
|
+ if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
+ //如果使用了余额付款 往余额记录表里面写入记录的cm_rebate_record
|
|
|
+ CmRebateRecord r = new CmRebateRecord();
|
|
|
+ r.setType("2");
|
|
|
+ r.setShopId(cmPayShop.getShopID());
|
|
|
+ r.setPayShopID(cmPayShop.getId());
|
|
|
+ r.setShopOrderId(StringUtil.join(records.stream().map(CmPayShopRecord::getShopOrderID).toArray(), ","));
|
|
|
+ r.setRebateAmount(cmPayShop.getBalancePayFee());
|
|
|
+ r.setOperatTime(DateUtils.formatDateTime(new Date()));
|
|
|
+ cmRebateRecordDao.insert(r);
|
|
|
+ //扣除供应商余额
|
|
|
+ newCmShopDao.updateRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //付第三方与付供应商差价
|
|
|
+ records.forEach(record->{
|
|
|
+ record.setStatus("1");
|
|
|
+ record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
+ record.setPayType(cmPayShop.getPayType());
|
|
|
+ cmPayShopRecordDao.update(record);
|
|
|
+ });
|
|
|
+ cmPayShop.setReviewer(currentUser.getId());
|
|
|
+ cmPayShop.setReviewTime(DateUtils.getDateTime());
|
|
|
+ cmPayShop.setPayTime(DateUtils.getDateTime());
|
|
|
+ cmPayShop.setStatus("1");
|
|
|
+ cmPayShopDao.update(cmPayShop);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -573,11 +588,13 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
cmPayShopDao.update(cmPayShop);
|
|
|
//付款记录 修改状态
|
|
|
cmPayShopRecordDao.updateStatusByPayShopID("2", cmPayShop.getId());
|
|
|
- //子订单退出付款状态
|
|
|
- newShopOrderDao.outPaying(cmPayShop.getId());
|
|
|
- //退还子订单可用余额
|
|
|
- if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
- newCmShopDao.backAbleRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
|
|
|
+ if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
|
|
|
+ //子订单退出付款状态
|
|
|
+ newShopOrderDao.outPaying(cmPayShop.getId());
|
|
|
+ //退还子订单可用余额
|
|
|
+ if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
+ newCmShopDao.backAbleRebateAmount(cmPayShop.getBalancePayFee(), Integer.valueOf(cmPayShop.getShopID()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -613,70 +630,86 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
public void rollBackApply(CmPayShop cmPayShop) throws Exception {
|
|
|
//回滚付款单审核通过的所有操作
|
|
|
List<CmPayShopRecord> records = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
|
|
|
- //修改每一条子订单的已付款金额
|
|
|
- for (CmPayShopRecord record : records) {
|
|
|
- NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
- shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
|
|
|
- if (shopOrder.getPayedShopAmount() == 0D) {
|
|
|
- // 本次付款金额 + 原来已经付过的金额 < 总共要付的金额
|
|
|
- shopOrder.setPayStatus("1");
|
|
|
+ if (cmPayShop.getPaymentType() == null || cmPayShop.getPaymentType() == 1) {
|
|
|
+ //修改每一条子订单的已付款金额
|
|
|
+ for (CmPayShopRecord record : records) {
|
|
|
+ NewShopOrder shopOrder = newShopOrderDao.get(record.getShopOrderID());
|
|
|
+ shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() - record.getPayAmount());
|
|
|
+ if (shopOrder.getPayedShopAmount() == 0D) {
|
|
|
+ // 本次付款金额 + 原来已经付过的金额 < 总共要付的金额
|
|
|
+ shopOrder.setPayStatus("1");
|
|
|
+ List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
|
|
|
+ boolean f = true;
|
|
|
+ for (String p : payStatus) {
|
|
|
+ if (p != null && !"1".equals(p)) {
|
|
|
+ //是部分付款或者已付款的子订单 那么主订单就是部分付款了
|
|
|
+ f = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (f)
|
|
|
+ newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
|
|
|
+ else
|
|
|
+ newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
+ } else if (shopOrder.getPayedShopAmount() > 0D) {
|
|
|
+ // 本次付款金额 + 原来已经付过的金额 近似于 总共要付的金额相等
|
|
|
+ shopOrder.setPayStatus("2");
|
|
|
+ newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
+ } else {
|
|
|
+ logger.info("rollBackApply ----> 付款金额异常, 付款金额大于待付款金额");
|
|
|
+ throw new Exception("付款金额异常, 退款金额大于已付款金额");
|
|
|
+ }
|
|
|
+ shopOrder.setPaying("1"); //进入付款进行状态
|
|
|
+ newShopOrderDao.update(shopOrder);
|
|
|
+ record.setStatus("0");
|
|
|
+ record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
+ record.setPayType(cmPayShop.getPayType());
|
|
|
+ cmPayShopRecordDao.update(record);
|
|
|
+
|
|
|
+ // 还原主订单的状态 ----
|
|
|
List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
|
|
|
boolean f = true;
|
|
|
for (String p : payStatus) {
|
|
|
- if (p != null && !"1".equals(p)) {
|
|
|
- //是部分付款或者已付款的子订单 那么主订单就是部分付款了
|
|
|
+ if (!"1".equals(p)) {
|
|
|
+ //不是所有的子订单都没有付款
|
|
|
f = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if (f)
|
|
|
+ if (f) //所有的子订单都是没有付款
|
|
|
newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
|
|
|
else
|
|
|
newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
- } else if (shopOrder.getPayedShopAmount() > 0D) {
|
|
|
- // 本次付款金额 + 原来已经付过的金额 近似于 总共要付的金额相等
|
|
|
- shopOrder.setPayStatus("2");
|
|
|
- newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
- } else {
|
|
|
- logger.info("rollBackApply ----> 付款金额异常, 付款金额大于待付款金额");
|
|
|
- throw new Exception("付款金额异常, 退款金额大于已付款金额");
|
|
|
+
|
|
|
}
|
|
|
- shopOrder.setPaying("1"); //进入付款进行状态
|
|
|
- newShopOrderDao.update(shopOrder);
|
|
|
- record.setStatus("0");
|
|
|
- record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
- record.setPayType(cmPayShop.getPayType());
|
|
|
- cmPayShopRecordDao.update(record);
|
|
|
-
|
|
|
- // 还原主订单的状态 ----
|
|
|
- List<String> payStatus = newShopOrderDao.findPayStatusByOrderID(shopOrder.getOrderID());
|
|
|
- boolean f = true;
|
|
|
- for (String p : payStatus) {
|
|
|
- if (!"1".equals(p)) {
|
|
|
- //不是所有的子订单都没有付款
|
|
|
- f = false;
|
|
|
- break;
|
|
|
- }
|
|
|
+ cmPayShop.setStatus("0");
|
|
|
+ cmPayShop.setPayTime(null);
|
|
|
+ cmPayShop.setReviewer(null);
|
|
|
+ cmPayShop.setReviewTime(null);
|
|
|
+ cmPayShop.setPayType(null);
|
|
|
+ cmPayShopDao.update(cmPayShop);
|
|
|
+ if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
+ //如果使用了余额付款 删除之前往这里面插入的记录 往余额记录表里面写入记录的cm_rebate_record
|
|
|
+ cmRebateRecordDao.deleteByPayShopID(cmPayShop.getId());
|
|
|
+ //使用了余额,退还余额 但是不退可用余额
|
|
|
+ NewCmShop shop = newCmShopDao.get(cmPayShop.getShopID());
|
|
|
+ shop.setRebateAmount(shop.getRebateAmount() + cmPayShop.getBalancePayFee());
|
|
|
+ newCmShopDao.update(shop);
|
|
|
}
|
|
|
- if (f) //所有的子订单都是没有付款
|
|
|
- newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
|
|
|
- else
|
|
|
- newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
|
|
|
-
|
|
|
- }
|
|
|
- cmPayShop.setStatus("0");
|
|
|
- cmPayShop.setPayTime(null);
|
|
|
- cmPayShop.setReviewer(null);
|
|
|
- cmPayShop.setReviewTime(null);
|
|
|
- cmPayShop.setPayType(null);
|
|
|
- cmPayShopDao.update(cmPayShop);
|
|
|
- if (cmPayShop.getBalancePayFee() != null && cmPayShop.getBalancePayFee() > 0D) {
|
|
|
- //如果使用了余额付款 删除之前往这里面插入的记录 往余额记录表里面写入记录的cm_rebate_record
|
|
|
- cmRebateRecordDao.deleteByPayShopID(cmPayShop.getId());
|
|
|
- //使用了余额,退还余额 但是不退可用余额
|
|
|
- NewCmShop shop = newCmShopDao.get(cmPayShop.getShopID());
|
|
|
- shop.setRebateAmount(shop.getRebateAmount() + cmPayShop.getBalancePayFee());
|
|
|
- newCmShopDao.update(shop);
|
|
|
+ } else {
|
|
|
+ //付第三方或者付供应商差价
|
|
|
+ records.forEach(record -> {
|
|
|
+ record.setStatus("0");
|
|
|
+ record.setPayTime(DateUtils.formatDateTime(new Date()));
|
|
|
+ record.setPayType(cmPayShop.getPayType());
|
|
|
+ cmPayShopRecordDao.update(record);
|
|
|
+ });
|
|
|
+ cmPayShop.setStatus("0");
|
|
|
+ cmPayShop.setPayTime(null);
|
|
|
+ cmPayShop.setReviewer(null);
|
|
|
+ cmPayShop.setReviewTime(null);
|
|
|
+ cmPayShop.setPayType(null);
|
|
|
+ cmPayShopDao.update(cmPayShop);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -722,12 +755,6 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
if (shopOtherList != null && shopOtherList.size() > 0) {
|
|
|
payShopOther = shopOtherList.get(0);
|
|
|
}
|
|
|
- NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
|
|
|
- if (shopOrder != null) {
|
|
|
- payShopOther.setOrderId(shopOrder.getOrderID());
|
|
|
- payShopOther.setOrderNo(shopOrder.getOrderNo());
|
|
|
- payShopOther.setShopOrderNo(shopOrder.getShopOrderNo());
|
|
|
- }
|
|
|
return payShopOther;
|
|
|
}
|
|
|
|
|
@@ -771,7 +798,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
payShop.setPayTime(time);
|
|
|
payShop.setStatus("0");
|
|
|
payShop.setDelFlag("0");
|
|
|
- cmPayShopDao.insert(payShop);
|
|
|
+ if (payShopOther.getPayShopId() == null) {
|
|
|
+ cmPayShopDao.insert(payShop);
|
|
|
+ } else {
|
|
|
+ payShop.setId(payShopOther.getPayShopId().toString());
|
|
|
+ cmPayShopDao.update(payShop);
|
|
|
+ }
|
|
|
|
|
|
CmPayShopRecord payShopRecord = new CmPayShopRecord();
|
|
|
payShopRecord.setShopID(shopOrder.getShopID().toString());
|
|
@@ -780,11 +812,16 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
payShopRecord.setPayAmount(payAmount);
|
|
|
payShopRecord.setWipePayment(0d);
|
|
|
payShopRecord.setPaymentType(3);
|
|
|
- payShopRecord.setPayTime(time);
|
|
|
payShopRecord.setPayShopID(payShop.getId());
|
|
|
payShopRecord.setStatus("0");
|
|
|
payShopRecord.setDelFlag("0");
|
|
|
- cmPayShopRecordDao.insert(payShopRecord);
|
|
|
+ if (payShopOther.getPayShopId() == null) {
|
|
|
+ cmPayShopRecordDao.insert(payShopRecord);
|
|
|
+ } else {
|
|
|
+ List<CmPayShopRecord> payShopRecords = cmPayShopRecordDao.findByPayShopID(payShopOther.getPayShopId().toString());
|
|
|
+ payShopRecord.setId(payShopRecords.get(0).getId());
|
|
|
+ cmPayShopRecordDao.update(payShopRecord);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public ChangePayShopDifference differencePriceForm(Integer shopOrderId) {
|
|
@@ -889,4 +926,24 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
|
cmPayShopRecordDao.insertDifference(payShopDifference);
|
|
|
newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
|
|
|
}
|
|
|
+
|
|
|
+ public ChangePayShopOther shopOtherApplyEdit(Integer payShopId) {
|
|
|
+ ChangePayShopOther payShopOther = new ChangePayShopOther();
|
|
|
+ List<CmPayShopRecord> shopRecords = cmPayShopRecordDao.findByPayShopID(payShopId.toString());
|
|
|
+ if (shopRecords != null && shopRecords.size() > 0) {
|
|
|
+ Integer shopOrderId = Integer.valueOf(shopRecords.get(0).getShopOrderID());
|
|
|
+ List<ChangePayShopOther> shopOtherList = cmPayShopRecordDao.findShopOtherFee(shopOrderId);
|
|
|
+ if (shopOtherList != null && shopOtherList.size() > 0) {
|
|
|
+ payShopOther = shopOtherList.get(0);
|
|
|
+ }
|
|
|
+ NewShopOrder shopOrder = newShopOrderDao.findByShopOrderID(shopOrderId);
|
|
|
+ if (shopOrder != null) {
|
|
|
+ payShopOther.setOrderId(shopOrder.getOrderID());
|
|
|
+ payShopOther.setOrderNo(shopOrder.getOrderNo());
|
|
|
+ payShopOther.setShopOrderNo(shopOrder.getShopOrderNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ payShopOther.setPayShopId(payShopId);
|
|
|
+ return payShopOther;
|
|
|
+ }
|
|
|
}
|