|
@@ -325,70 +325,70 @@ public class CmPayShopController extends BaseController {
|
|
|
//子订单的成本方式第一次填写以后就不能修改了
|
|
|
// 固定成本
|
|
|
//if ("1".equals(costType)) {
|
|
|
- // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
|
|
|
- for (NewOrderProduct product : newOrderProducts) {
|
|
|
- Integer orderProductID = product.getOrderProductID();
|
|
|
- Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
|
|
|
- Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
|
|
|
- Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
|
|
|
- if (soZeroCostFlag && costPrice > 0) {
|
|
|
- soZeroCostFlag = false;
|
|
|
- }
|
|
|
- // 在订单商品含税的情况下, 成本计算税费
|
|
|
- if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
|
|
|
- costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
|
|
|
- }
|
|
|
- // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
|
|
|
- Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
|
|
|
- Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
|
|
|
- // 获取已被退款的商品数量
|
|
|
- Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
|
|
|
- returnNum = returnNum == null ? 0 : returnNum;
|
|
|
- NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
|
|
|
- // 修改前
|
|
|
- if (StringUtils.isEmpty(dbcostType)) {
|
|
|
- CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
|
|
|
- cmChangePayShopProduct.setRecondType("1");
|
|
|
- cmChangePayShopProduct.setChangeType("1");
|
|
|
- cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
|
|
|
- cmChangePayShopProduct.setOrderProductId(orderProductID);
|
|
|
- cmChangePayShopProduct.setOrderProductName(product.getName());
|
|
|
- // 同步使用机构税率 作为供应商税率
|
|
|
- cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
|
|
|
- cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
|
|
|
- cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
|
|
|
- cmChangePayShopProductService.save(cmChangePayShopProduct);
|
|
|
- }
|
|
|
-
|
|
|
- orderProduct.setCostPrice(costPrice);
|
|
|
- orderProduct.setOrganizeCostPrice(organizeCostPrice);
|
|
|
- orderProduct.setCmCostPrice(cmCostPrice);
|
|
|
- // 同步使用机构税率 作为供应商税率
|
|
|
- orderProduct.setSupplierTaxRate(supplierTaxRate);
|
|
|
- orderProduct.setTaxRate(product.getTaxRate());
|
|
|
- orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
|
|
|
- orderProducts.add(orderProduct);
|
|
|
- int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
|
|
|
- int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
|
|
|
- totalCostFee += (num + presentNum - returnNum) * costPrice;
|
|
|
- orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
|
|
|
- totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
|
|
|
- // 修改后
|
|
|
+ // List<CmReturnedPurchaseProduct> rL = cmReturnedPurchaseProductService.findReturnedByShopOrderID(Integer.parseInt(shopOrderID));
|
|
|
+ for (NewOrderProduct product : newOrderProducts) {
|
|
|
+ Integer orderProductID = product.getOrderProductID();
|
|
|
+ Double costPrice = product.getCostPrice() == null ? 0d : product.getCostPrice();
|
|
|
+ Double organizeCostPrice = product.getOrganizeCostPrice() == null ? 0d : product.getOrganizeCostPrice();
|
|
|
+ Double cmCostPrice = product.getCmCostPrice() == null ? 0d : product.getCmCostPrice();
|
|
|
+ if (soZeroCostFlag && costPrice > 0) {
|
|
|
+ soZeroCostFlag = false;
|
|
|
+ }
|
|
|
+ // 在订单商品含税的情况下, 成本计算税费
|
|
|
+ if ("0".equals(product.getIncludedTax()) && null != product.getSupplierTaxRate() && product.getSupplierTaxRate() > 0d) {
|
|
|
+ costPrice = MathUtil.add(costPrice, MathUtil.div(MathUtil.mul(costPrice, product.getSupplierTaxRate()), 100)).doubleValue();
|
|
|
+ }
|
|
|
+ // product.setSingleShouldPayTotalTax(MathUtil.div(MathUtil.mul(MathUtil.div(product.getCostPrice(), MathUtil.div(MathUtil.add(product.getTaxRate(), 100),100)), product.getSupplierTaxRate()), 100).doubleValue());
|
|
|
+ Double singleShouldPayTotalTax = product.getSingleShouldPayTotalTax() == null ? 0d : product.getSingleShouldPayTotalTax();
|
|
|
+ Double supplierTaxRate = product.getSupplierTaxRate() == null ? 0d : product.getSupplierTaxRate();
|
|
|
+ // 获取已被退款的商品数量
|
|
|
+ Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(Integer.parseInt(shopOrderID), orderProductID);
|
|
|
+ returnNum = returnNum == null ? 0 : returnNum;
|
|
|
+ NewOrderProduct orderProduct = newOrderProductService.get(String.valueOf(orderProductID));
|
|
|
+ // 修改前
|
|
|
+ if (StringUtils.isEmpty(dbcostType)) {
|
|
|
CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
|
|
|
- cmChangePayShopProduct.setRecondType("2");
|
|
|
- cmChangePayShopProduct.setChangeType(costType);
|
|
|
- cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
|
|
|
+ cmChangePayShopProduct.setRecondType("1");
|
|
|
+ cmChangePayShopProduct.setChangeType("1");
|
|
|
+ cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId));
|
|
|
cmChangePayShopProduct.setOrderProductId(orderProductID);
|
|
|
cmChangePayShopProduct.setOrderProductName(product.getName());
|
|
|
- cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
|
|
|
- cmChangePayShopProduct.setCostPrice(product.getCostPrice());
|
|
|
- cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
|
|
|
+ // 同步使用机构税率 作为供应商税率
|
|
|
+ cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
|
|
|
+ cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
|
|
|
+ cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
|
|
|
cmChangePayShopProductService.save(cmChangePayShopProduct);
|
|
|
}
|
|
|
- //总税费
|
|
|
- shopOrder.setShopTaxFee(totalTaxesFee);
|
|
|
- //商品费
|
|
|
- shopOrder.setShopProductAmount(totalCostFee);
|
|
|
+
|
|
|
+ orderProduct.setCostPrice(costPrice);
|
|
|
+ orderProduct.setOrganizeCostPrice(organizeCostPrice);
|
|
|
+ orderProduct.setCmCostPrice(cmCostPrice);
|
|
|
+ // 同步使用机构税率 作为供应商税率
|
|
|
+ orderProduct.setSupplierTaxRate(supplierTaxRate);
|
|
|
+ orderProduct.setTaxRate(product.getTaxRate());
|
|
|
+ orderProduct.setSingleShouldPayTotalTax(singleShouldPayTotalTax);
|
|
|
+ orderProducts.add(orderProduct);
|
|
|
+ int num = orderProduct.getNum() == null ? 0 : orderProduct.getNum();
|
|
|
+ int presentNum = orderProduct.getPresentNum() == null ? 0 : orderProduct.getPresentNum();
|
|
|
+ totalCostFee += (num + presentNum - returnNum) * costPrice;
|
|
|
+ orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
|
|
|
+ totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
|
|
|
+ // 修改后
|
|
|
+ CmChangePayShopProduct cmChangePayShopProduct = new CmChangePayShopProduct();
|
|
|
+ cmChangePayShopProduct.setRecondType("2");
|
|
|
+ cmChangePayShopProduct.setChangeType(costType);
|
|
|
+ cmChangePayShopProduct.setChangePayShopId(Integer.parseInt(cmChangePayShopRecondId2));
|
|
|
+ cmChangePayShopProduct.setOrderProductId(orderProductID);
|
|
|
+ cmChangePayShopProduct.setOrderProductName(product.getName());
|
|
|
+ cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
|
|
|
+ cmChangePayShopProduct.setCostPrice(product.getCostPrice());
|
|
|
+ cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
|
|
|
+ cmChangePayShopProductService.save(cmChangePayShopProduct);
|
|
|
+ }
|
|
|
+ //总税费
|
|
|
+ shopOrder.setShopTaxFee(totalTaxesFee);
|
|
|
+ //商品费
|
|
|
+ shopOrder.setShopProductAmount(totalCostFee);
|
|
|
//}
|
|
|
// 比例成本
|
|
|
/*if ("2".equals(costType)) {
|
|
@@ -482,40 +482,40 @@ public class CmPayShopController extends BaseController {
|
|
|
}*/
|
|
|
shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
|
|
|
shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
|
|
|
- //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
|
|
|
- NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
|
|
|
- if (soZeroCostFlag) {
|
|
|
- AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
|
|
|
- AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
|
|
|
- newOrder.getNewShopOrders().forEach(item -> {
|
|
|
- if (item.getShopID().equals(998)) {
|
|
|
- freightFlag.set(true);
|
|
|
- } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
|
|
|
- zeroCostFlag.set(false);
|
|
|
- }
|
|
|
- });
|
|
|
- //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
|
|
|
- if (freightFlag.get() && zeroCostFlag.get()) {
|
|
|
- newOrder.getNewShopOrders().forEach(item -> {
|
|
|
- if (item.getShopID().equals(998)) {
|
|
|
- item.setPayStatus("3");
|
|
|
- //更新运费子订单
|
|
|
- newShopOrderService.updatePayStatus(item);
|
|
|
- cmPayShopService.payFreightShopOrder(item);
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (zeroCostFlag.get()) {
|
|
|
- newOrder.setPayStatus("3");
|
|
|
- newOrder.setZeroCostFlag(1);
|
|
|
- } else {
|
|
|
- newOrder.setPayStatus("2");
|
|
|
- newOrder.setZeroCostFlag(0);
|
|
|
- }
|
|
|
- newOrderService.updatePayStatus(newOrder);
|
|
|
- }
|
|
|
- shopOrder.setShopPostFee(freight); //运费
|
|
|
+// //当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
|
|
|
+// NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
|
|
|
+// if (soZeroCostFlag) {
|
|
|
+// AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
|
|
|
+// AtomicReference<Boolean> freightFlag = new AtomicReference<>(false);
|
|
|
+// newOrder.getNewShopOrders().forEach(item -> {
|
|
|
+// if (item.getShopID().equals(998)) {
|
|
|
+// freightFlag.set(true);
|
|
|
+// } else if (!item.getShopOrderID().equals(shopOrder.getShopOrderID()) && 0 == item.getZeroCostFlag()) {
|
|
|
+// zeroCostFlag.set(false);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// //如果含有运费子订单且其他子订单都为0成本,将运费子订单置为已付款
|
|
|
+// if (freightFlag.get() && zeroCostFlag.get()) {
|
|
|
+// newOrder.getNewShopOrders().forEach(item -> {
|
|
|
+// if (item.getShopID().equals(998)) {
|
|
|
+// item.setPayStatus("3");
|
|
|
+// //更新运费子订单
|
|
|
+// newShopOrderService.updatePayStatus(item);
|
|
|
+// cmPayShopService.payFreightShopOrder(item);
|
|
|
+//
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+// if (zeroCostFlag.get()) {
|
|
|
+// newOrder.setPayStatus("3");
|
|
|
+// newOrder.setZeroCostFlag(1);
|
|
|
+// } else {
|
|
|
+// newOrder.setPayStatus("2");
|
|
|
+// newOrder.setZeroCostFlag(0);
|
|
|
+// }
|
|
|
+// newOrderService.updatePayStatus(newOrder);
|
|
|
+// }
|
|
|
+ shopOrder.setSupplierFreight(freight); //运费
|
|
|
shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
|
|
|
shopOrder.setCostType(costType);
|
|
|
shopOrder.setModifyShouldPayNote(modifyShouldPayNote); //备注
|
|
@@ -526,7 +526,7 @@ public class CmPayShopController extends BaseController {
|
|
|
shopOrder.setPayStatus("3");
|
|
|
}
|
|
|
// 付供应商 - 优惠券 - 促销满减优惠
|
|
|
- shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount , MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
|
|
|
+ shopOrder.setShouldPayShopAmount(MathUtil.sub(shouldPayShopAmount, MathUtil.add(shopOrder.getCouponAmount(), shopOrder.getPromotionFullReduction())).doubleValue());
|
|
|
newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
|
|
|
return "redirect:" + Global.getAdminPath() + "/shopOrder/payOrderList";
|
|
|
}
|
|
@@ -633,22 +633,32 @@ public class CmPayShopController extends BaseController {
|
|
|
orderProduct.setShouldPayTotalTax(singleShouldPayTotalTax * (num + presentNum - returnNum));
|
|
|
totalTaxesFee += singleShouldPayTotalTax * (num + presentNum - returnNum);
|
|
|
}
|
|
|
- shopOrder.setShopTaxFee(totalTaxesFee); //总税费
|
|
|
- shopOrder.setShopProductAmount(totalCostFee); //商品费
|
|
|
+ //总税费
|
|
|
+ shopOrder.setShopTaxFee(totalTaxesFee);
|
|
|
+ //商品费
|
|
|
+ shopOrder.setShopProductAmount(totalCostFee);
|
|
|
}
|
|
|
// 比列成本
|
|
|
if ("2".equals(costType)) {
|
|
|
shopOrder.setProportional(proportional);
|
|
|
- shopOrder.setShopTaxFee(0D); //总税费
|
|
|
- Double productAmount = shopOrder.getProductAmount();//子订单金额
|
|
|
- shopOrder.setShopProductAmount(productAmount * proportional / 100); //商品费
|
|
|
+ //总税费
|
|
|
+ shopOrder.setShopTaxFee(0D);
|
|
|
+ //子订单金额
|
|
|
+ Double productAmount = shopOrder.getProductAmount();
|
|
|
+ //商品费
|
|
|
+ shopOrder.setShopProductAmount(productAmount * proportional / 100);
|
|
|
}
|
|
|
- shopOrder.setShopPostFee(freight); //运费
|
|
|
- shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
|
|
|
+ //运费
|
|
|
+ shopOrder.setShopPostFee(freight);
|
|
|
+ //付第三方
|
|
|
+ shopOrder.setShopOtherFee(thirdPartyFee);
|
|
|
shopOrder.setCostType(costType);
|
|
|
- shopOrder.setModifyShouldPayNote(modifyShouldPayNote); //备注
|
|
|
- shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId()); //修改人的用户id
|
|
|
- shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); //修改时间
|
|
|
+ //备注
|
|
|
+ shopOrder.setModifyShouldPayNote(modifyShouldPayNote);
|
|
|
+ //修改人的用户id
|
|
|
+ shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());
|
|
|
+ //修改时间
|
|
|
+ shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|
|
double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee() + shopOrder.getShopTaxFee();
|
|
|
if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount < shopOrder.getPayedShopAmount()) {
|
|
@@ -656,8 +666,9 @@ public class CmPayShopController extends BaseController {
|
|
|
res.put("msg", "付供应商的金额不能小于已付款金额");
|
|
|
return res;
|
|
|
} else {
|
|
|
- if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount())
|
|
|
+ if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
|
|
|
shopOrder.setPayStatus("3");
|
|
|
+ }
|
|
|
shopOrder.setShouldPayShopAmount(shouldPayShopAmount);
|
|
|
}
|
|
|
newShopOrderService.modifyPayShopAmount(shopOrder, orderProducts);
|
|
@@ -681,7 +692,7 @@ public class CmPayShopController extends BaseController {
|
|
|
int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
|
|
|
String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
|
|
Integer substring = Integer.valueOf(format.substring(0, 2));
|
|
|
- ids.forEach(i->{
|
|
|
+ ids.forEach(i -> {
|
|
|
//当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
|
|
|
if ((5 == weekIdx && substring > 14) || 6 == weekIdx || 7 == weekIdx) {
|
|
|
flag.set(1);
|
|
@@ -747,16 +758,13 @@ public class CmPayShopController extends BaseController {
|
|
|
@RequiresPermissions("order:cmPayShop:edit")
|
|
|
@RequestMapping("applyCompile")
|
|
|
public String applyCompile(CmPayShop cmPayShop, Model model) {
|
|
|
- try {
|
|
|
- cmPayShopService.applyDetail(cmPayShop);
|
|
|
- // 获取线下收款账号下拉列表
|
|
|
- List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
|
|
|
- model.addAttribute("offlineCollections", offlineCollections);
|
|
|
- model.addAttribute("cmPayShop", cmPayShop);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.info(e.getMessage());
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ cmPayShopService.applyDetail(cmPayShop);
|
|
|
+ // 获取线下收款账号下拉列表
|
|
|
+ List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
|
|
|
+ model.addAttribute("offlineCollections", offlineCollections);
|
|
|
+ model.addAttribute("cmPayShop", cmPayShop);
|
|
|
+ OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(cmPayShop.getShopOrders().get(0).getShopOrderID());
|
|
|
+ model.addAttribute("otherFee", otherFeeDto);
|
|
|
if (3 == cmPayShop.getPaymentType()) {
|
|
|
return "modules/order/cmPayShopOtherEdit";
|
|
|
}
|
|
@@ -786,13 +794,8 @@ public class CmPayShopController extends BaseController {
|
|
|
@RequiresPermissions("order:cmPayShop:detail")
|
|
|
@RequestMapping("applyDetail")
|
|
|
public String applyDetail(CmPayShop cmPayShop, Model model) {
|
|
|
- try {
|
|
|
- cmPayShopService.applyDetail(cmPayShop);
|
|
|
- model.addAttribute("cmPayShop", cmPayShop);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.info(e.getMessage());
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ cmPayShopService.applyDetail(cmPayShop);
|
|
|
+ model.addAttribute("cmPayShop", cmPayShop);
|
|
|
if (3 == cmPayShop.getPaymentType()) {
|
|
|
return "modules/order/cmPayShopOtherPrintDetail";
|
|
|
}
|
|
@@ -832,16 +835,11 @@ public class CmPayShopController extends BaseController {
|
|
|
@RequiresPermissions("order:cmPayShop:check")
|
|
|
@RequestMapping("toCheck")
|
|
|
public String toCheck(CmPayShop cmPayShop, Model model) {
|
|
|
- try {
|
|
|
- cmPayShopService.applyDetail(cmPayShop);
|
|
|
- // 获取线下收款账号下拉列表
|
|
|
- List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
|
|
|
- model.addAttribute("offlineCollections", offlineCollections);
|
|
|
- model.addAttribute("cmPayShop", cmPayShop);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.info(e.getMessage());
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ cmPayShopService.applyDetail(cmPayShop);
|
|
|
+ // 获取线下收款账号下拉列表
|
|
|
+ List<CmOfflineCollection> offlineCollections = cmOfflineCollectionService.downListData();
|
|
|
+ model.addAttribute("offlineCollections", offlineCollections);
|
|
|
+ model.addAttribute("cmPayShop", cmPayShop);
|
|
|
if (3 == cmPayShop.getPaymentType()) {
|
|
|
return "modules/order/cmPayShopOtherCheck";
|
|
|
}
|
|
@@ -1016,7 +1014,7 @@ public class CmPayShopController extends BaseController {
|
|
|
* 付第三方数据回显
|
|
|
*/
|
|
|
@RequestMapping("shopOtherFeeForm")
|
|
|
- public String shopOtherFeeForm(Integer shopOrderId,Integer payType, Model model) {
|
|
|
+ public String shopOtherFeeForm(Integer shopOrderId, Integer payType, Model model) {
|
|
|
ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
|
|
|
payShopOther.setShopOrderId(shopOrderId);
|
|
|
NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(shopOrderId);
|
|
@@ -1024,6 +1022,13 @@ public class CmPayShopController extends BaseController {
|
|
|
payShopOther.setShopOtherFee(BigDecimal.valueOf(ShopOtherFee));
|
|
|
Double brokerage = shopOrder.getBrokerage();
|
|
|
brokerage = brokerage == null ? 0d : brokerage;
|
|
|
+ /**
|
|
|
+ * 子订单onlinePayWays为空且cmAccountType为1,且子订单利润>0
|
|
|
+ * 1. 当该订单为采美私账订单时,若存在子订单利润(不为0)申请第三方页面(包括部分付款子订单申请和已付款子订单申请)
|
|
|
+ * 2. 金额直接展示子订单利润
|
|
|
+ */
|
|
|
+ OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(shopOrderId);
|
|
|
+ model.addAttribute("otherFee", otherFeeDto);
|
|
|
model.addAttribute("brokerage", brokerage);
|
|
|
model.addAttribute("payShopOther", payShopOther);
|
|
|
model.addAttribute("payType", payType);
|
|
@@ -1037,7 +1042,7 @@ public class CmPayShopController extends BaseController {
|
|
|
public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
|
|
|
cmPayShopService.saveShopOtherFee(payShopOther);
|
|
|
addMessage(redirectAttributes, "保存成功");
|
|
|
- if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType() ) {
|
|
|
+ if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType()) {
|
|
|
return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList?repage";
|
|
|
}
|
|
|
return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
|
|
@@ -1083,6 +1088,8 @@ public class CmPayShopController extends BaseController {
|
|
|
@RequestMapping("shopOtherApplyEdit")
|
|
|
public String shopOtherApplyEdit(Integer payShopId, Model model) {
|
|
|
ChangePayShopOther payShopOther = cmPayShopService.shopOtherApplyEdit(payShopId);
|
|
|
+ OtherFeeDto otherFeeDto = newOrderService.getOtherFeeDto(payShopOther.getShopOrderId());
|
|
|
+ model.addAttribute("otherFee", otherFeeDto);
|
|
|
model.addAttribute("payShopOther", payShopOther);
|
|
|
return "modules/order/cmPayShopOtherForm";
|
|
|
}
|