|
@@ -398,7 +398,7 @@ public class CmPayShopController extends BaseController {
|
|
shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
|
|
shopOrder.setPayStatus(soZeroCostFlag ? "3" : "1");
|
|
shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
|
|
shopOrder.setZeroCostFlag(soZeroCostFlag ? 1 : 0);
|
|
//当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
|
|
//当子订单0成本时,若主订单中其他子订单(除了运费子订单)都为0成本,设主订单为已付款,否则设为部分付款
|
|
- NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
|
|
|
|
|
|
+ NewOrder newOrder = newOrderService.get(shopOrder.getOrderID().toString());
|
|
if (soZeroCostFlag) {
|
|
if (soZeroCostFlag) {
|
|
|
|
|
|
AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
|
|
AtomicReference<Boolean> zeroCostFlag = new AtomicReference<>(true);
|
|
@@ -434,7 +434,6 @@ public class CmPayShopController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
shopOrder.setShopPostFee(freight); //运费
|
|
shopOrder.setShopPostFee(freight); //运费
|
|
shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
|
|
shopOrder.setShopOtherFee(thirdPartyFee); //付第三方
|
|
shopOrder.setCostType(costType);
|
|
shopOrder.setCostType(costType);
|
|
@@ -617,20 +616,20 @@ public class CmPayShopController extends BaseController {
|
|
|
|
|
|
@RequestMapping("settleTime")
|
|
@RequestMapping("settleTime")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public Map<String, Object> settleTime(@RequestParam("shopOrderId")Integer shopOrderId) {
|
|
|
|
|
|
+ public Map<String, Object> settleTime(@RequestParam("shopOrderId") Integer shopOrderId) {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
Calendar instance = Calendar.getInstance();
|
|
Calendar instance = Calendar.getInstance();
|
|
- int flag=0;
|
|
|
|
|
|
+ int flag = 0;
|
|
int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
|
|
int weekIdx = instance.get(Calendar.DAY_OF_WEEK) - 1;
|
|
String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
|
String format = new SimpleDateFormat("HH:mm:ss").format(new Date());
|
|
Integer substring = Integer.valueOf(format.substring(0, 2));
|
|
Integer substring = Integer.valueOf(format.substring(0, 2));
|
|
//当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
|
|
//当前时间周五下午到周日都返回1不能结算,其他时间看够不够24小时
|
|
- if((5==weekIdx&&substring>14)||6==weekIdx||7==weekIdx){
|
|
|
|
- flag=1;
|
|
|
|
- }else{
|
|
|
|
- Integer val=newOrderDao.getSplitTime(shopOrderId);
|
|
|
|
- if(val<0){
|
|
|
|
- flag=1;
|
|
|
|
|
|
+ if ((5 == weekIdx && substring > 14) || 6 == weekIdx || 7 == weekIdx) {
|
|
|
|
+ flag = 1;
|
|
|
|
+ } else {
|
|
|
|
+ Integer val = newOrderDao.getSplitTime(shopOrderId);
|
|
|
|
+ if (val < 0) {
|
|
|
|
+ flag = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
map.put("flag", flag);
|
|
map.put("flag", flag);
|
|
@@ -675,7 +674,7 @@ public class CmPayShopController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("splitEdit")
|
|
@RequestMapping("splitEdit")
|
|
- public String splitEdit(String[] shopOrderIDs, RedirectAttributes redirectAttributes,Model model) {
|
|
|
|
|
|
+ public String splitEdit(String[] shopOrderIDs, RedirectAttributes redirectAttributes, Model model) {
|
|
splitAccountService.SplitAccount(shopOrderIDs[0]);
|
|
splitAccountService.SplitAccount(shopOrderIDs[0]);
|
|
|
|
|
|
// Page<NewShopOrder> page = newShopOrderService.findSplitList(new Page<NewShopOrder>(),new NewShopOrder());
|
|
// Page<NewShopOrder> page = newShopOrderService.findSplitList(new Page<NewShopOrder>(),new NewShopOrder());
|
|
@@ -822,14 +821,15 @@ public class CmPayShopController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("settlement")
|
|
@RequestMapping("settlement")
|
|
- public String settlement(Double settleAmount, String shopOrderId,RedirectAttributes redirectAttributes) throws Exception {
|
|
|
|
|
|
+ public String settlement(Double settleAmount, String shopOrderId, RedirectAttributes redirectAttributes) throws Exception {
|
|
Double shouldPayShopAmount = newOrderDao.findShouldPayShopAmount(shopOrderId);
|
|
Double shouldPayShopAmount = newOrderDao.findShouldPayShopAmount(shopOrderId);
|
|
Double settleSum = newOrderDao.findSettleSum(shopOrderId);
|
|
Double settleSum = newOrderDao.findSettleSum(shopOrderId);
|
|
- if(settleSum>=shouldPayShopAmount){
|
|
|
|
|
|
+ if (settleSum >= shouldPayShopAmount) {
|
|
addMessage(redirectAttributes, "此订单已结算完毕!");
|
|
addMessage(redirectAttributes, "此订单已结算完毕!");
|
|
return "redirect:" + Global.getAdminPath() + "/shopOrder/settlement";
|
|
return "redirect:" + Global.getAdminPath() + "/shopOrder/settlement";
|
|
}
|
|
}
|
|
- if(settleSum>=shouldPayShopAmount){}
|
|
|
|
|
|
+ if (settleSum >= shouldPayShopAmount) {
|
|
|
|
+ }
|
|
Integer SDJSS = (Integer) redisService.get("SDJSS");
|
|
Integer SDJSS = (Integer) redisService.get("SDJSS");
|
|
//验锁
|
|
//验锁
|
|
if (null != SDJSS && SDJSS > 0) {
|
|
if (null != SDJSS && SDJSS > 0) {
|