Browse Source

联合丽格V1.0.2

kaick 1 year ago
parent
commit
4be2697df6
48 changed files with 689 additions and 456 deletions
  1. 2 2
      src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java
  2. 1 0
      src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java
  3. 10 1
      src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java
  4. 36 6
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  5. 5 1
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  6. 6 6
      src/main/java/com/caimei/modules/order/web/CmOrderRemarkController.java
  7. 22 12
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  8. 27 0
      src/main/java/com/caimei/modules/product/entity/Product.java
  9. 30 11
      src/main/java/com/caimei/modules/product/service/ProductNewService.java
  10. 3 0
      src/main/java/com/caimei/modules/product/service/ProductService.java
  11. 18 15
      src/main/resources/mappings/modules/archive/CmProductArchiveMapper.xml
  12. 6 3
      src/main/resources/mappings/modules/bulkpurchase/PurchaseProductMapper.xml
  13. 5 0
      src/main/resources/mappings/modules/hehe/CmHeheActivityProductMapper.xml
  14. 16 13
      src/main/resources/mappings/modules/hehe/CmHeheCollageMapper.xml
  15. 4 1
      src/main/resources/mappings/modules/hehe/CmHeheCollageProductMapper.xml
  16. 12 11
      src/main/resources/mappings/modules/hehe/CmHeheCouponMapper.xml
  17. 15 14
      src/main/resources/mappings/modules/hehe/CmHeheDiscountMapper.xml
  18. 3 0
      src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml
  19. 1 1
      src/main/resources/mappings/modules/newhome/NewPageFloorMapper.xml
  20. 141 128
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  21. 4 4
      src/main/resources/mappings/modules/order/CmOrderRemarkMapper.xml
  22. 2 1
      src/main/resources/mappings/modules/order/CmReturnedPurchaseProductMapper.xml
  23. 3 0
      src/main/resources/mappings/modules/order/OrderMapper.xml
  24. 14 6
      src/main/resources/mappings/modules/order/OrderProductMapper.xml
  25. 1 1
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  26. 1 0
      src/main/resources/mappings/modules/product/CmOrganizeProductInfoMapper.xml
  27. 4 2
      src/main/resources/mappings/modules/product/CmProductCombinationMapper.xml
  28. 15 8
      src/main/resources/mappings/modules/product/CmPromotionMapper.xml
  29. 7 4
      src/main/resources/mappings/modules/product/CmSecondHandDetailMapper.xml
  30. 5 2
      src/main/resources/mappings/modules/product/RepeatPurchasePriceMapper.xml
  31. 5 0
      src/main/resources/mappings/modules/svip/CmSvipProductMapper.xml
  32. 1 0
      src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml
  33. 3 0
      src/main/resources/mappings/modules/user/NewCmClubMapper.xml
  34. 1 0
      src/main/resources/mappings/modules/user/VisitRemarkMapper.xml
  35. 8 2
      src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml
  36. 4 3
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp
  37. 1 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/addOrderRemarksForm.jsp
  38. 9 9
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp
  39. 109 107
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReturnRecord.jsp
  40. 12 3
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp
  41. 4 2
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp
  42. 1 1
      src/main/webapp/WEB-INF/views/modules/order/cmOrderRemarksFormNew.jsp
  43. 0 1
      src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp
  44. 1 1
      src/main/webapp/WEB-INF/views/modules/order/cmRebateRecordForm.jsp
  45. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmSettlementList.jsp
  46. 3 3
      src/main/webapp/WEB-INF/views/modules/order/cmSplitAccountList.jsp
  47. 104 67
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  48. 1 1
      src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp

+ 2 - 2
src/main/java/com/caimei/modules/bulkpurchase/web/CmRefundsProductController.java

@@ -620,7 +620,7 @@ public class CmRefundsProductController extends BaseController {
             cmReturnedPurchase.setOrderType(Integer.valueOf(order.getOrderType()));
             List<CmReturnedPurchase> dataList = cmReturnedPurchaseService.getReturnedPurchaseList(cmReturnedPurchase);
             for (CmReturnedPurchase returnedPurchase : dataList) {
-                List<ShopOrderReturned> shopOrderReturneds = returnedPurchase.getShopOrderReturnedList().stream().filter(newShopOrder -> newShopOrder.getShopOrderID() == cmReturnedPurchase.getShopOrderID()).collect(Collectors.toList());
+                List<ShopOrderReturned> shopOrderReturneds = returnedPurchase.getShopOrderReturnedList().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
                 returnedPurchase.setShopOrderReturnedList(shopOrderReturneds);
             }
 
@@ -705,7 +705,7 @@ public class CmRefundsProductController extends BaseController {
     public String toRefundRecord(CmReturnedPurchase cmReturnedPurchase, String from, HttpServletRequest request, HttpServletResponse response, Model model) {
         NewOrder newOrder = newOrderService.get(cmReturnedPurchase.getOrderID().toString());
         //过滤子订单
-        List<NewShopOrder> newShopOrders = newOrder.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID() == cmReturnedPurchase.getShopOrderID()).collect(Collectors.toList());
+        List<NewShopOrder> newShopOrders = newOrder.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(cmReturnedPurchase.getShopOrderID())).collect(Collectors.toList());
         newOrder.setNewShopOrders(newShopOrders);
 //        List<CmReceiptOrderRelation> listRelation = cmReceiptOrderRelationService.findByOrderID(newOrder.getOrderID().toString());
         List<CmReceiptOrderRelation> listRelation = cmReceiptOrderRelationService.findByShopOrderIds(Arrays.asList(cmReturnedPurchase.getShopOrderID()));

+ 1 - 0
src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java

@@ -69,6 +69,7 @@ public interface CmDiscernReceiptDao extends CrudDao<CmDiscernReceipt> {
     List<CmMainReceiptExport> exportPayment(CmDiscernReceipt cmDiscernReceipt);
 
     Double findOrderReceipt(@Param("orderID") Integer orderID);
+    Double findShoOrderIDReceipt(@Param("shopOrderID") Integer orderID);
 
     List<CmMainReceiptExport> gathering(@Param("orderID") Integer orderID);
 

+ 10 - 1
src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java

@@ -54,6 +54,8 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
     private CmRefundShopRecordDao cmRefundShopRecordDao;
     @Resource
     private CmUserBalanceRecordDao cmUserBalanceRecordDao;
+    @Resource
+    private CmDiscernReceiptService cmDiscernReceiptService;
 
     public CmDiscernReceipt get(String id) {
         return super.get(id);
@@ -140,7 +142,10 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
         }
 //        vo.setReceiptOrderFlag(receiptOrderFlag);//设置一款多单状态
         List<ReceiptOrderInfoVo> orderInfos = new ArrayList<>(); //一个收款可能会关联了一个或多个订单
-        orderInfos.add(cmDiscernReceiptDao.getOrderInfoByShopOrderID(cmDiscernReceipt.getShopOrderId().toString()));
+        ReceiptOrderInfoVo receiptOrderInfoVo = cmDiscernReceiptDao.getOrderInfoByShopOrderID(cmDiscernReceipt.getShopOrderId().toString());
+        BigDecimal add = MathUtil.add(receiptOrderInfoVo.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(cmDiscernReceipt.getShopOrderId()));
+        receiptOrderInfoVo.setReceiptAmount(add.toString());
+        orderInfos.add(receiptOrderInfoVo);
 //        for (CmReceiptOrderRelation relation : relations) {
 //            ReceiptOrderInfoVo roi = null; //这是通过订单列表上的一条收款记录对应的多个订单中的一个订单
 //            if ("1".equals(relation.getRelationType())) { // relation.orderID 指的是子订单id
@@ -398,6 +403,10 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
         Double receiptAmount = cmDiscernReceiptDao.findOrderReceipt(orderID);
         return receiptAmount;
     }
+    public Double findShoOrderIDReceipt(Integer shopOrderID) {
+        Double receiptAmount = cmDiscernReceiptDao.findShoOrderIDReceipt(shopOrderID);
+        return receiptAmount;
+    }
 
     public List<CmMainReceiptExport> gathering(Integer orderID) {
         List<CmMainReceiptExport> gathering = cmDiscernReceiptDao.gathering(orderID);

+ 36 - 6
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -69,6 +69,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     @Resource
     private NewOrderDao newOrderDao;
     @Resource
+    private CmDiscernReceiptService cmDiscernReceiptService;
+    @Resource
     private NewOrderProductDao newOrderProductDao;
     @Resource
     private OrderInvoiceService orderInvoiceService;
@@ -1299,21 +1301,49 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             }
             if (CollectionUtils.isNotEmpty(shopOrders)) {
                 for (NewShopOrder shopOrder : shopOrders) {
+                    BigDecimal add = MathUtil.add(shopOrder.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(shopOrder.getShopOrderID()));
+                    shopOrder.setReceiptAmount(add.doubleValue());
+                    BigDecimal sub = MathUtil.sub((shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount()).doubleValue()
+                            , shopOrder.getReceiptAmount().doubleValue());
+                    shopOrder.setRestAmount(sub.doubleValue());
+
+                    if (1 == shopOrder.getStatus()) {
+                        if ("1".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(11);
+                        } else if ("1".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(12);
+                        } else if ("1".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(13);
+                        } else if ("2".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(21);
+                        } else if ("2".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(22);
+                        } else if ("2".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(23);
+                        } else if ("3".equals(shopOrder.getReceiptStatus()) && "1".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(31);
+                        } else if ("3".equals(shopOrder.getReceiptStatus()) && "2".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(32);
+                        } else if ("3".equals(shopOrder.getReceiptStatus()) && "3".equals(shopOrder.getSendOutStatus())) {
+                            shopOrder.setStatus(33);
+                        }
+                    }
+                    //拼接运费
                     Double ColdChina = Double.valueOf(700);
                     String PostageInfo = null;
-                    if (null!=shopOrder.getIsColdChina()&&shopOrder.getIsColdChina()==1) {
-                        if ("-1" == shopOrder.getShopPostFlag()) {
+                    if (null != shopOrder.getIsColdChina() && shopOrder.getIsColdChina() == 1) {
+                        if ("2" == shopOrder.getShopPostFlag()) {
                             // 到付
-                            PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina()==1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 到付)";
+                            PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 到付)";
                         } else if ("0" == shopOrder.getShopPostFlag()) {
                             // 包邮
-                            PostageInfo = "¥" + ColdChina+ "(" + (shopOrder.getIsColdChina()==1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
+                            PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
                         } else {
                             // 有运费
-                            PostageInfo = "¥" + MathUtil.add(shopOrder.getShopPostFee(), ColdChina) + "(" + (shopOrder.getIsColdChina()==1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + shopOrder.getShopPostFee()+ ")";
+                            PostageInfo = "¥" + MathUtil.add(shopOrder.getShopPostFee(), ColdChina) + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + shopOrder.getShopPostFee() + ")";
                         }
                     } else {
-                        PostageInfo = shopOrder.getShopPostFlag() == "-1" ? "到付" : shopOrder.getShopPostFlag() == "0" ? "包邮" : "¥" + shopOrder.getShopPostFee();
+                        PostageInfo = shopOrder.getShopPostFlag().equals("2") ? "到付" : shopOrder.getShopPostFlag().equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();
                     }
 
                     //支付凭证

+ 5 - 1
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -164,10 +164,14 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
      *
      * @param orderID
      */
-    public List<LogisticsInfoVo> logisticsDetails(Integer orderID, String logisticsBatchID) {
+    public List<LogisticsInfoVo> logisticsDetails(Integer orderID,Integer shopOrderID ,String logisticsBatchID) {
         List<LogisticsInfoVo> result = new ArrayList<>();
         //查询这个子订单所有的发货批次记录
         List<LogisticsBatch> lbs = logisticsBatchDao.findBatch(orderID, logisticsBatchID);
+        if(null!=shopOrderID){
+            lbs=lbs.stream().filter(s -> s.getShopOrderID().equals(shopOrderID)).collect(Collectors.toList());
+        }
+
         for (LogisticsBatch l : lbs) {
             LogisticsInfoVo liv = new LogisticsInfoVo();
             // 每一批的发货商品记录

+ 6 - 6
src/main/java/com/caimei/modules/order/web/CmOrderRemarkController.java

@@ -98,10 +98,8 @@ public class CmOrderRemarkController extends BaseController {
 
     //订单备注新
     @RequestMapping(value = "remarksViewNew")
-    public String remarksViewNew(Integer orderID, Model model, String source, Integer orderType) {
+    public String remarksViewNew(CmOrderRemark remark, Model model, String source, Integer orderType) {
         //通过商品ID获取对应备注信息
-        CmOrderRemark remark = new CmOrderRemark();
-        remark.setOrderID(orderID);
         List<CmOrderRemark> remarksList = cmOrderRemarkService.findList(remark);
         if (!CollectionUtils.isEmpty(remarksList)) {
             for (CmOrderRemark cor : remarksList) {
@@ -114,15 +112,17 @@ public class CmOrderRemarkController extends BaseController {
         }
         //设置展示信息
         model.addAttribute("remarksList", remarksList);
-        model.addAttribute("orderID", orderID);
+        model.addAttribute("orderID", remark.getOrderID());
+        model.addAttribute("shopOrderID", remark.getShopOrderID());
         model.addAttribute("source", source);
         model.addAttribute("orderType", orderType);
         return "modules/order/cmOrderRemarksFormNew";
     }
 
     @RequestMapping(value = "toAddRemarksViewNew")
-    public String toAddRemarksViewNew(Integer orderID, Model model, String source, Integer orderType) {
+    public String toAddRemarksViewNew(Integer orderID,@RequestParam(required = false) Integer shopOrderID, Model model, String source, Integer orderType) {
         model.addAttribute("orderID", orderID);
+        model.addAttribute("shopOrderID", shopOrderID);
         model.addAttribute("source", source);
         model.addAttribute("orderType", orderType);
         return "modules/bulkpurchase/addOrderRemarksForm";
@@ -233,7 +233,7 @@ public class CmOrderRemarkController extends BaseController {
             addMessage(redirectAttributes, "添加失败");
         }
         model.addAttribute("source", source);
-        return remarksViewNew(cmOrderRemark.getOrderID(), model, source, cmOrderRemark.getOrderType());
+        return remarksViewNew(cmOrderRemark, model, source, cmOrderRemark.getOrderType());
     }
 
 

+ 22 - 12
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -601,12 +601,20 @@ public class NewOrderController extends BaseController {
      */
     @RequiresPermissions("order:order:confirmOrder")
     @RequestMapping("confirmOrder")
-    public String confirmOrder(Integer orderID, Model model, RedirectAttributes redirectAttributes) {
+    public String confirmOrder(Integer orderID, Integer shopOrderID, Model model, RedirectAttributes redirectAttributes) {
         NewOrder order = newOrderService.get(orderID + "");
-        if (StringUtils.isNotEmpty(order.getStatus()) && Integer.parseInt(order.getStatus()) > 0) {
-            addMessage(redirectAttributes, "订单状态异常,请刷新后重试!");
-            return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
-        }
+        //过滤子订单
+        List<NewShopOrder>  newShopOrders= order.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(shopOrderID)).collect(Collectors.toList());
+        order.setNewShopOrders(newShopOrders);
+
+//        if (StringUtils.isNotEmpty(order.getStatus()) && Integer.parseInt(order.getStatus()) > 0) {
+//            addMessage(redirectAttributes, "订单状态异常,请刷新后重试!");
+//            return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
+//        }
+//        if (newShopOrders.get(0).getStatus()!=null && newShopOrders.get(0).getStatus() > 0) {
+//            addMessage(redirectAttributes, "订单状态异常,请刷新后重试!");
+//            return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
+//        }
         //优惠券确认消耗
         CmCouponOrderRecord orderRecord = order.getCouponOrderRecord();
         if (order.getCouponAmount() > 0 && orderRecord != null) {
@@ -622,11 +630,13 @@ public class NewOrderController extends BaseController {
         if ("6".equals(order.getOrderSubmitType())) {
             userID = order.getUserID();
         } else {
-            Integer clubId = order.getClubID();
+//            Integer clubId = order.getClubID();
+            Integer clubId = newShopOrders.get(0).getClubID();
             ClubModel clubByUserId = clubDao.getClubByUserId(Integer.parseInt(clubId.toString()));
             userID = clubByUserId.getUserID();
         }
-        List<NewOrderProduct> orderProduct = order.getOrderProduct();
+//        List<NewOrderProduct> orderProduct = order.getOrderProduct();
+        List<NewOrderProduct> orderProduct = order.getNewShopOrders().get(0).getNewOrderProducts();
         if (CollectionUtils.isNotEmpty(orderProduct) && orderProduct.size() > 0) {
             for (NewOrderProduct op : orderProduct) {
                 String isActProduct = op.getIsActProduct();
@@ -714,10 +724,11 @@ public class NewOrderController extends BaseController {
         msg.setMessageTypeID("1");
         msg.setReadFlag("0");
         cmMessageService.save(msg);
-        newOrderService.confirmOrder(orderID);
+        newOrderService.confirmOrder(orderID,shopOrderID);
 
         //确认订单的时候将用户余额修改为抵扣之后金额(协销下单,后台下单--待确认订单)注意用户自己下单的时候直接则两个金额同时减少,取消同时回滚
-        Double balancePayFee = order.getBalancePayFee();
+//        Double balancePayFee = order.getBalancePayFee();
+        Double balancePayFee = order.getNewShopOrders().get(0).getAccountAmount();
         CmUser u = cmUserService.get(userID + "");
         if (null != u && null != balancePayFee) {
             Double userMoney = u.getUserMoney();
@@ -1212,7 +1223,6 @@ public class NewOrderController extends BaseController {
         if(order.getShopOrderID()!=null){
             List<NewShopOrder>  newShopOrders= order.getNewShopOrders().stream().filter(newShopOrder -> newShopOrder.getShopOrderID().equals(order.getShopOrderID())).collect(Collectors.toList());
             order.setNewShopOrders(newShopOrders);
-//            order.getNewShopOrders().get(0).setPostageInfo();
         }
         BpClause bpClause = new BpClause();
         bpClause.setEnabledStatus("1");
@@ -1420,9 +1430,9 @@ public class NewOrderController extends BaseController {
      */
     @RequiresPermissions("order:order:edit")
     @RequestMapping("logisticsDetails")
-    public String logisticsDetails(Integer orderID, String logisticsBatchID, Model model, Integer orderType) {
+    public String logisticsDetails(Integer orderID,@RequestParam(required = false) Integer shopOrderID , String logisticsBatchID, Model model, Integer orderType) {
         List<LogisticsInfoVo> logisticsInfoVos = new ArrayList<>();
-        logisticsInfoVos = newShopOrderService.logisticsDetails(orderID, logisticsBatchID);
+        logisticsInfoVos = newShopOrderService.logisticsDetails(orderID, shopOrderID , logisticsBatchID);
 
         model.addAttribute("orderID", orderID);
         model.addAttribute("orderType", orderType);

+ 27 - 0
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -15,6 +15,7 @@ public class Product extends DataEntity<Product> {
     private String name;
     private String shopName;//供应商名称
     private String validFlag; //0暂存中 1待审核 2已上架 3已下架 8 审核不通过 9已冻结
+    private String organizeNameValidFlag; //商品待审核组织名称
     private String[] validFlagString; //0暂存中 1待审核 2已上架 3已下架 8 审核不通过 9已冻结
     private Integer preferredFlag; //新品上线(001) 优惠商品(010) 常用商品(100),三者同时存在111
     private String displayOnCRMFlag; //是否在crm可以被搜索到 1是 0否
@@ -215,6 +216,18 @@ public class Product extends DataEntity<Product> {
      */
     private List<ProductLadderPrice> ladderPriceList;
 
+
+
+    /**
+     * 功能描述:
+     * @auther: Kaick
+     * @date: 2023/6/26 16:14
+     * @param null
+     * @return 其他平台商品状态
+     */
+
+    private List<CmOrganizeProductInfo> cmOrganizeProductInfos;
+
     /**
      * 搜索类型:1采美商品,2呵呵商城商品
      */
@@ -286,6 +299,20 @@ public class Product extends DataEntity<Product> {
     private Integer orderProductID;
     //税率
     private Double taxRate;
+    public List<CmOrganizeProductInfo> getCmOrganizeProductInfos() {
+        return cmOrganizeProductInfos;
+    }
+
+    public void setCmOrganizeProductInfos(List<CmOrganizeProductInfo> cmOrganizeProductInfos) {
+        this.cmOrganizeProductInfos = cmOrganizeProductInfos;
+    }
+    public String getOrganizeNameValidFlag() {
+        return organizeNameValidFlag;
+    }
+
+    public void setOrganizeNameValidFlag(String organizeNameValidFlag) {
+        this.organizeNameValidFlag = organizeNameValidFlag;
+    }
 
     public String getLabelIds() {
         return labelIds;

+ 30 - 11
src/main/java/com/caimei/modules/product/service/ProductNewService.java

@@ -37,6 +37,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
@@ -94,6 +95,7 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         page.setPageSize(20);
         entity.setPage(page);
         List<Product> list = dao.findList(entity);
+
         list.forEach(p -> {
             String ids = p.getGroundMall().replaceAll("##", ",");
             String organizeName = "";
@@ -108,6 +110,13 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
                 organizeNames.add(organizeName);
             }
             p.setOrganizeNames(organizeNames);
+            //其他平台商品状态
+            CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
+            cmOrganizeProductInfo.setProductId(p.getProductID());
+            p.setCmOrganizeProductInfos(cmOrganizeProductInfoMapper.getCmOrganizeProductInfoList(cmOrganizeProductInfo));
+            List<CmOrganizeProductInfo> infoList = p.getCmOrganizeProductInfos().stream().filter(s -> s.getValidFlag().equals(1)||s.getValidFlag().equals(8)).collect(Collectors.toList());
+            p.setOrganizeNameValidFlag(infoList.size()==0?null:infoList.size()>1?"2":"1");
+
             CmSku sku = null;
             if (p.getGroundMall().contains("0")) {
                 sku = productDao.findSku(p.getProductID());
@@ -117,7 +126,7 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
             if (null != sku) {
                 p.setPrice(sku.getPrice());
                 p.setNormalPrice(sku.getNormalPrice());
-                Integer costCheckFlag = sku.getCostCheckFlag();
+                Integer costCheckFlag = 2;//
                 p.setCostCheckFlag(costCheckFlag.toString());
                 if (1 == costCheckFlag) {
                     p.setCostPrice(sku.getCostPrice()!=null?sku.getCostPrice().toString():null);
@@ -144,11 +153,13 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
 
     public void fastSave(Product product) {
         productNewDao.updateByPrimaryKeySelective(product);
-        CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
-        cmOrganizeProductInfo.setOrganizeId(0);
-        cmOrganizeProductInfo.setProductId(product.getProductID());
-        cmOrganizeProductInfo.setValidFlag(Integer.valueOf(product.getValidFlag()));
-        cmOrganizeProductInfoMapper.updateCmOrganizeProductInfo(cmOrganizeProductInfo);
+        if (StringUtils.isNotBlank(product.getValidFlag())) {
+            CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
+            cmOrganizeProductInfo.setOrganizeId(0);
+            cmOrganizeProductInfo.setProductId(product.getProductID());
+            cmOrganizeProductInfo.setValidFlag(Integer.valueOf(product.getValidFlag()));
+            cmOrganizeProductInfoMapper.updateCmOrganizeProductInfo(cmOrganizeProductInfo);
+        }
     }
 
     public List<ProductImage> getImageList(Integer productId) {
@@ -283,11 +294,19 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         newPageFloorDao.insertFloorImage(floorImage);
         product.setFloorId(productNewDao.newFloorId());
         productNewDao.updateByPrimaryKeySelective(product);
-        CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
-        cmOrganizeProductInfo.setOrganizeId(0);
-        cmOrganizeProductInfo.setProductId(product.getProductID());
-        cmOrganizeProductInfo.setValidFlag(Integer.valueOf(product.getValidFlag()));
-        cmOrganizeProductInfoMapper.updateCmOrganizeProductInfo(cmOrganizeProductInfo);
+        if (StringUtils.isNotBlank(product.getValidFlag())) {
+            CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
+            cmOrganizeProductInfo.setProductId(product.getProductID());
+            if (!(product.getValidFlag().equals("2") || product.getValidFlag().equals("8"))) {
+                cmOrganizeProductInfo.setOrganizeId(0);
+            }else if(product.getValidFlag().equals("8")){
+                cmOrganizeProductInfo.setValidFlag(1);
+                List<CmOrganizeProductInfo> cmOrganizeProductInfoList = cmOrganizeProductInfoMapper.getCmOrganizeProductInfoList(cmOrganizeProductInfo);
+                cmOrganizeProductInfo.setOrganizeId(cmOrganizeProductInfoList.size()>1?null:4);
+            }
+            cmOrganizeProductInfo.setValidFlag(Integer.valueOf(product.getValidFlag()));
+            cmOrganizeProductInfoMapper.updateCmOrganizeProductInfo(cmOrganizeProductInfo);
+        }
         cleanRedisCache();
 
     }

+ 3 - 0
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -329,12 +329,15 @@ public class ProductService extends CrudService<ProductDao, Product> {
                     listMall.add(c);
                 }
             });
+            //listMall排序
+            listMall.sort(Comparator.naturalOrder());
             String strip = StringUtils.strip(listMall.toString(), "[]");
             product.setGroundMall(strip.replaceAll(",", "##").trim());
             cmOrganizeProductInfoMapper.delNotCmOrganizeProductInfoByOrganizeIds(listMall.toArray(new Integer[listMall.size()]),product.getProductID());
             listMall.forEach(s -> {
                 CmOrganizeProductInfo cmOrganizeProductInfoOrganizeId = new CmOrganizeProductInfo();
                 cmOrganizeProductInfoOrganizeId.setOrganizeId(s);
+                cmOrganizeProductInfoOrganizeId.setProductId(product.getProductID());
                 if ( null == cmOrganizeProductInfoMapper.getByCmOrganizeProductInfo(cmOrganizeProductInfoOrganizeId)){
                     CmOrganizeProductInfo cmOrganizeProductInfo = new CmOrganizeProductInfo();
                     cmOrganizeProductInfo.setOrganizeId(s);

+ 18 - 15
src/main/resources/mappings/modules/archive/CmProductArchiveMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.archive.dao.CmProductArchiveDao">
-    
+
 	<sql id="cmProductArchiveColumns">
 		a.id AS "id",
 		a.productId AS "productId",
@@ -16,24 +16,25 @@
 		a.labelIds
 	</sql>
 
-    
+
 	<select id="get" resultType="CmProductArchive">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveColumns"/>
 		FROM cm_product_archive a
 		left join product p on a.productId = p.productID
 		left join shop s on p.shopID = s.shopID
 		WHERE a.id = #{id}
+		group by p.productID
 	</select>
-	
+
 	<select id="findList" resultType="CmProductArchive">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveColumns"/>
 		FROM cm_product_archive a
 		left join product p on a.productId = p.productID
 	    left join shop s on p.shopID = s.shopID
 		<where>
-			
+
 			<if test="productName != null and productName != ''">
 				AND (a.productName LIKE
 					<if test="dbName == 'oracle'">'%'||#{productName}||'%'</if>
@@ -58,16 +59,17 @@
 				AND a.productClassify = #{productClassify}
 			</if>
 		</where>
+		group by p.productID
 		order by a.addTime desc
 	</select>
-	
+
 	<select id="findAllList" resultType="CmProductArchive">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveColumns"/>
 		FROM cm_product_archive a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -109,6 +111,7 @@
 				</foreach>
 			</if>
 		</where>
+		group by a.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -144,9 +147,9 @@
 			#{labelIds}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_product_archive SET 	
+		UPDATE cm_product_archive SET
 			productId = #{productId},
 			productName = #{productName},
 			shopName = #{shopName},
@@ -158,10 +161,10 @@
 		    labelIds = #{labelIds}
 		WHERE id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		DELETE FROM cm_product_archive
 		WHERE id = #{id}
 	</delete>
-	
-</mapper>
+
+</mapper>

+ 6 - 3
src/main/resources/mappings/modules/bulkpurchase/PurchaseProductMapper.xml

@@ -12,7 +12,6 @@
 		left join cm_svip_product csp on a.productID = csp.productId
 		left join cm_svip_user csu on csu.userId = #{userId} and csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
 		<where>
-			a.groundMall like CONCAT('%', copi.organizeId, '%')
 			<if test="purchaseProductName != null and purchaseProductName != ''">
 				AND a.name LIKE concat('%',#{purchaseProductName},'%')
 			</if>
@@ -27,6 +26,7 @@
 			AND a.productID != 999
 			and a.productCategory = 1
 		</where>
+		group by a.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -49,7 +49,7 @@
 		left join cm_sku cs on a.productID=cs.productId and copi.organizeId = cs.organizeId
 		left join cm_second_hand_detail cshd on cshd.productID = a.productID
 		<where>
-			a.groundMall like CONCAT('%', copi.organizeId, '%')
+			 cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
 			<if test="purchaseProductName != null and purchaseProductName != ''">
 				AND a.name LIKE concat('%',#{purchaseProductName},'%')
 			</if>
@@ -65,6 +65,7 @@
 			and a.productCategory = 2
 			and cshd.sold != 1
 		</where>
+		group by a.productID
 	</select>
 
 	<select id="findLadderPriceList" resultType="com.caimei.po.ProductLadderPrice">
@@ -84,7 +85,9 @@
 				 left join cm_svip_user csu
 						   on csu.userId = #{userId} and csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
 				 left join (select csps.productId,csps.priceType from cm_svip_product_sku csps left join cm_sku cs on csps.skuId=cs.skuId
-							where csps.productId=#{productId} order by cs.price asc limit 1) ccs on csp.productId=ccs.productId
+							where csps.productId=#{productId}
+							  and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+							order by cs.price asc limit 1) ccs on csp.productId=ccs.productId
 		where csp.productId = #{productId};
 	</select>
 

+ 5 - 0
src/main/resources/mappings/modules/hehe/CmHeheActivityProductMapper.xml

@@ -25,6 +25,7 @@
         FROM cm_hehe_activity_product a
         <include refid="cmHeheActivityProductJoins"/>
         WHERE a.id = #{id}
+        group by p.productID
     </select>
 
     <select id="findList" resultType="CmHeheActivityProduct">
@@ -43,6 +44,7 @@
                 AND s.name LIKE CONCAT('%',#{shopName},'%')
             </if>
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -61,6 +63,7 @@
         <where>
 
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -134,6 +137,7 @@
         <if test="shopName != null and shopName != ''">
             AND s.name LIKE CONCAT('%',#{shopName,jdbcType=VARCHAR},'%')
         </if>
+        group by p.productID
     </select>
 
     <select id="findActivityLadder" resultType="com.caimei.modules.hehe.entity.CmHeHeActivityLadder">
@@ -192,6 +196,7 @@
                  left join cm_hehe_sku chs on chds.skuId = chs.skuId
                  left join cm_sku cs on chs.skuId = cs.skuId
         where chds.productId = #{productId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
     <select id="findDiscountBySku" resultType="com.caimei.modules.product.entity.CmSku">

+ 16 - 13
src/main/resources/mappings/modules/hehe/CmHeheCollageMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.hehe.dao.CmHeheCollageDao">
-    
+
 	<sql id="cmHeheCollageColumns">
 		a.id AS "id",
 		a.productId AS "productId",
@@ -14,23 +14,24 @@
 		p.name as productName,
 		s.name as shopName
 	</sql>
-	
+
 	<sql id="cmHeheCollageJoins">
 		left join product p on a.productId = p.productID
 		left join cm_hehe_product hp on p.productID = hp.productId
 		left join shop s on p.shopID = s.shopID
 	</sql>
-    
+
 	<select id="get" resultType="CmHeheCollage">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCollageColumns"/>
 		FROM cm_hehe_collage a
 		<include refid="cmHeheCollageJoins"/>
 		WHERE a.id = #{id}
+		group by p.productID
 	</select>
-	
+
 	<select id="findList" resultType="CmHeheCollage">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCollageColumns"/>
 		FROM cm_hehe_collage a
 		<include refid="cmHeheCollageJoins"/>
@@ -49,6 +50,7 @@
 				and s.name like concat('%',#{shopName},'%')
 			</if>
 		</where>
+		group by p.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -58,15 +60,16 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmHeheCollage">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCollageColumns"/>
 		FROM cm_hehe_collage a
 		<include refid="cmHeheCollageJoins"/>
 		<where>
-			
-		</where>		
+
+		</where>
+		group by p.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -121,9 +124,9 @@
 			#{price}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_hehe_collage SET 	
+		UPDATE cm_hehe_collage SET
 			productId = #{productId},
 			price = #{price}
 		WHERE id = #{id}
@@ -154,4 +157,4 @@
 			orderID = #{orderId}
 	</delete>
 
-</mapper>
+</mapper>

+ 4 - 1
src/main/resources/mappings/modules/hehe/CmHeheCollageProductMapper.xml

@@ -27,6 +27,7 @@
         FROM cm_hehe_collage_product a
         <include refid="cmHeheCollageProductJoins"/>
         WHERE a.id = #{id}
+        group by p.productID
     </select>
 
     <select id="findList" resultType="CmHeheCollageProduct">
@@ -49,6 +50,7 @@
                 and s.name like concat('%',#{shopName},'%')
             </if>
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -67,6 +69,7 @@
         <where>
 
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -172,4 +175,4 @@
         WHERE id = #{id}
     </delete>
 
-</mapper>
+</mapper>

+ 12 - 11
src/main/resources/mappings/modules/hehe/CmHeheCouponMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.hehe.dao.CmHeheCouponDao">
-    
+
 	<sql id="cmHeheCouponColumns">
 		a.id AS "id",
 		a.name AS "name",
@@ -22,14 +22,14 @@
 	</sql>
 
 	<select id="get" resultType="CmHeheCoupon">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCouponColumns"/>
 		FROM cm_hehe_coupon a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmHeheCoupon">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCouponColumns"/>
 		FROM cm_hehe_coupon a
 		<where>
@@ -38,7 +38,7 @@
 				AND a.couponType = #{couponType}
 			</if>
 			<if test="name != null and name != ''">
-				AND a.name LIKE 
+				AND a.name LIKE
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
@@ -63,14 +63,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmHeheCoupon">
-		SELECT 
+		SELECT
 			<include refid="cmHeheCouponColumns"/>
 		FROM cm_hehe_coupon a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -102,6 +102,7 @@
 				LEFT JOIN shop s ON p.shopID = s.shopID
 		WHERE
 			cca.couponId = #{couponId}
+		group by p.productID
 		ORDER BY
 			- cca.sort DESC
 	</select>
@@ -288,7 +289,7 @@
 	</insert>
 
 	<update id="update">
-		UPDATE cm_hehe_coupon SET 	
+		UPDATE cm_hehe_coupon SET
 			name = #{name},
 			couponAmount = #{couponAmount},
 			touchPrice = #{touchPrice},
@@ -340,4 +341,4 @@
 		update cm_hehe_coupon_product set productId = #{newProductId} where productId = #{oldProductId}
 	</update>
 
-</mapper>
+</mapper>

+ 15 - 14
src/main/resources/mappings/modules/hehe/CmHeheDiscountMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.hehe.dao.CmHeheDiscountDao">
-    
+
 	<sql id="cmHeheDiscountColumns">
 		a.id AS "id",
 		a.title AS "title",
@@ -12,20 +12,20 @@
 	</sql>
 
 	<select id="get" resultType="CmHeheDiscount">
-		SELECT 
+		SELECT
 			<include refid="cmHeheDiscountColumns"/>
 		FROM cm_hehe_discount a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmHeheDiscount">
-		SELECT 
+		SELECT
 			<include refid="cmHeheDiscountColumns"/>
 		FROM cm_hehe_discount a
 		<where>
-			
+
 			<if test="title != null and title != ''">
-				AND a.title LIKE 
+				AND a.title LIKE
 					<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
@@ -43,14 +43,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmHeheDiscount">
-		SELECT 
+		SELECT
 			<include refid="cmHeheDiscountColumns"/>
 		FROM cm_hehe_discount a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -59,7 +59,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="CmHeheDiscount"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_hehe_discount(
 			title,
@@ -75,9 +75,9 @@
 			NOW()
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_hehe_discount SET 	
+		UPDATE cm_hehe_discount SET
 			title = #{title},
 			discount = #{discount},
 			status = #{status},
@@ -167,6 +167,7 @@
 				LEFT JOIN shop s ON p.shopID = s.shopID
 		WHERE
 			cca.discountId = #{discountId}
+		group by p.productID
 		ORDER BY
 			- cca.sort DESC
 	</select>
@@ -182,4 +183,4 @@
     <select id="findAllUserIds" resultType="java.lang.String">
         select group_concat(userId) from cm_hehe_discount_user;
     </select>
-</mapper>
+</mapper>

+ 3 - 0
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -176,6 +176,7 @@
                 </foreach>
             </if>
         </where>
+        group by a.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -209,6 +210,7 @@
                 </foreach>
             </if>
         </where>
+        group by a.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -301,6 +303,7 @@
         from cm_sku cs
                  left join cm_hehe_sku chs on cs.skuId = chs.skuId
         where cs.productId = #{productId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         order by chs.price asc
         limit 1
     </select>

+ 1 - 1
src/main/resources/mappings/modules/newhome/NewPageFloorMapper.xml

@@ -232,7 +232,7 @@
 		  left join cm_organize_product_info copi on copi.productId = p.productID
 		WHERE
 		  a.floorId = #{floorId}
-		and p.groundMall like CONCAT('%', copi.organizeId, '%')
+		group by p.productID
 	</select>
 
 	<insert id="insertFloorContent">

+ 141 - 128
src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml

@@ -86,124 +86,126 @@
 
 
     <select id="findList" resultType="CmDiscernReceipt">
-        (SELECT
-        <include refid="cmDiscernReceiptColumns"/>,
-        cso.orderId AS orderID,
-        cso.shopOrderNo as shopOrderNo,
-        cso.shopOrderId as shopOrderId,
-        cof.bankAccount AS bankNameType,
-        s.checkMan,
-        s.name AS shopName,
-        u.userName AS "userName",
-        u.name AS "name",
-        IF(crr.relationType = '6',(SELECT NAME FROM USER mu WHERE mu.userId=ccb.userId),'') AS "backname",
-        cr.organizeID AS organizeID
-        FROM cm_discern_receipt a
+<!--        (SELECT-->
+<!--        <include refid="cmDiscernReceiptColumns"/>,-->
+<!--        cso.orderId AS orderID,-->
+<!--        cso.shopOrderNo as shopOrderNo,-->
+<!--        cso.shopOrderId as shopOrderId,-->
+<!--        cof.bankAccount AS bankNameType,-->
+<!--        s.checkMan,-->
+<!--        s.name AS shopName,-->
+<!--        u.userName AS "userName",-->
+<!--        u.name AS "name",-->
+<!--        IF(crr.relationType = '6',(SELECT NAME FROM USER mu WHERE mu.userId=ccb.userId),'') AS "backname",-->
+<!--        cr.organizeID AS organizeID-->
+<!--        FROM cm_discern_receipt a-->
 
-        LEFT JOIN cm_receipt_order_relation crr ON crr.receiptId = a.id AND crr.delFlag = '0'
-        LEFT JOIN cm_coupon_buyrecord ccb ON crr.couponRecordId=ccb.id
-        LEFT JOIN cm_order cr ON cr.orderId = crr.orderId
-        LEFT JOIN cm_shop_order cso ON cso.orderId = cr.orderId
-        LEFT JOIN shop s ON s.shopID = cso.shopID
-        left join user u on u.userID = cr.userID
-        LEFT JOIN club c ON cr.userId = c.userId
-        LEFT JOIN cm_offline_collection cof ON a.payType = cof.type
-        <where>
-            crr.relationType != 1
-            <if test="id != null and id != '' and id != 0 ">
-                AND a.id = #{id}
-            </if>
-            <if test="organizeID != null and organizeID != 9999 ">
-                AND cr.organizeID = #{organizeID}
-            </if>
-            <if test="organizeID == 9999 ">
-                AND cr.orderType = 2
-            </if>
-            <if test="startTime != null and startTime != ''">
-                AND (a.receiptDate &gt; #{startTime} OR a.receiptDate = #{startTime})
-            </if>
-            <if test="endTime != null and endTime != ''">
-                AND (a.receiptDate &lt; #{endTime} OR a.receiptDate = #{endTime})
-            </if>
-            <if test="payWay != null and payWay != ''">
-                AND a.payWay = #{payWay}
-            </if>
-            <if test="payType != null and payType != ''">
-                AND a.payType = #{payType}
-            </if>
-            <if test="receiptType != null and receiptType != ''">
-                <if test="receiptType==2 and newReceiptType==3">
-                    and (a.receiptType = 9)
-                    or a.receiptType = #{receiptType}
-                </if>
-                <if test="receiptType!=2">
-                    AND a.receiptType = #{receiptType}
-                </if>
-                AND a.receiptType = #{receiptType}
-            </if>
-            <if test="newReceiptType !=null">
-                <if test="newReceiptType==3">
-                    and a.newReceiptType =3
-                </if>
-                <if test="newReceiptType != 3">
-                    and a.newReceiptType=#{newReceiptType}
-                </if>
-            </if>
+<!--        LEFT JOIN cm_receipt_order_relation crr ON crr.receiptId = a.id AND crr.delFlag = '0'-->
+<!--        LEFT JOIN cm_coupon_buyrecord ccb ON crr.couponRecordId=ccb.id-->
+<!--&#45;&#45;         LEFT JOIN cm_order cr ON cr.orderId = crr.orderId-->
+<!--&#45;&#45;         LEFT JOIN cm_shop_order cso ON cso.orderId = cr.orderId-->
+<!--        LEFT JOIN cm_shop_order cso ON cso.shopOrderId = crr.shopOrderId or cso.orderId = crr.orderId-->
+<!--        LEFT JOIN cm_order cr ON cr.orderId = cso.orderId-->
+<!--        LEFT JOIN shop s ON s.shopID = cso.shopID-->
+<!--        left join user u on u.userID = cr.userID-->
+<!--        LEFT JOIN club c ON cr.userId = c.userId-->
+<!--        LEFT JOIN cm_offline_collection cof ON a.payType = cof.type-->
+<!--        <where>-->
+<!--            crr.relationType != 1-->
+<!--            <if test="id != null and id != '' and id != 0 ">-->
+<!--                AND a.id = #{id}-->
+<!--            </if>-->
+<!--            <if test="organizeID != null and organizeID != 9999 ">-->
+<!--                AND cr.organizeID = #{organizeID}-->
+<!--            </if>-->
+<!--            <if test="organizeID == 9999 ">-->
+<!--                AND cr.orderType = 2-->
+<!--            </if>-->
+<!--            <if test="startTime != null and startTime != ''">-->
+<!--                AND (a.receiptDate &gt; #{startTime} OR a.receiptDate = #{startTime})-->
+<!--            </if>-->
+<!--            <if test="endTime != null and endTime != ''">-->
+<!--                AND (a.receiptDate &lt; #{endTime} OR a.receiptDate = #{endTime})-->
+<!--            </if>-->
+<!--            <if test="payWay != null and payWay != ''">-->
+<!--                AND a.payWay = #{payWay}-->
+<!--            </if>-->
+<!--            <if test="payType != null and payType != ''">-->
+<!--                AND a.payType = #{payType}-->
+<!--            </if>-->
+<!--            <if test="receiptType != null and receiptType != ''">-->
+<!--                <if test="receiptType==2 and newReceiptType==3">-->
+<!--                    and (a.receiptType = 9)-->
+<!--                    or a.receiptType = #{receiptType}-->
+<!--                </if>-->
+<!--                <if test="receiptType!=2">-->
+<!--                    AND a.receiptType = #{receiptType}-->
+<!--                </if>-->
+<!--                AND a.receiptType = #{receiptType}-->
+<!--            </if>-->
+<!--            <if test="newReceiptType !=null">-->
+<!--                <if test="newReceiptType==3">-->
+<!--                    and a.newReceiptType =3-->
+<!--                </if>-->
+<!--                <if test="newReceiptType != 3">-->
+<!--                    and a.newReceiptType=#{newReceiptType}-->
+<!--                </if>-->
+<!--            </if>-->
 
-            <if test="receiptStatus != null and receiptStatus != ''">
-                AND a.receiptStatus = #{receiptStatus}
-            </if>
-            <if test="orderNo != null and orderNo != ''">
-                AND ((cr.orderNo like concat('%',#{orderNo},'%')) OR (cso.shopOrderNo like concat('%',#{orderNo},'%')))
-            </if>
-            <if test="orderID != null and orderID != ''">
-                AND (cr.orderID = #{orderID} )
-            </if>
-            <if test="shopOrderId != null and shopOrderId != ''">
-                AND (cso.shopOrderId = #{shopOrderId} )
-            </if>
-            <if test="userName != null and userName != ''">
-                AND (u.userName LIKE concat('%',#{userName},'%') or u.name LIKE concat('%',#{userName},'%'))
-            </if>
-            <if test="receiptProgress != null and receiptProgress != ''">
-                and (case when crr.relationType = '1' then
-                cso_cr.receiptStatus
-                else
-                cr.receiptStatus
-                end) = #{receiptProgress}
-            </if>
-            <if test="receiptOrderType != null and receiptOrderType != ''">
-                and (case when crr.relationType = '1' then
-                cso.orderType
-                else
-                cr.orderType
-                end) = #{receiptOrderType}
-            </if>
-            <if test="associationNum != null and associationNum != ''">
-                <if test="associationNum == 1">
-                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0') = 1
-                </if>
-                <if test="associationNum == 2">
-                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0')
-                    <![CDATA[ > ]]> 1
-                </if>
-            </if>
-            <if test="paYee !=null and paYee != ''">
-                <if test="paYee == '采美'">
-                    and a.payWay = 3
-                    OR a.payWay = 2
-                    AND a.newReceiptType != 3 AND a.payWay = 2
-                </if>
-                <if test="payWay==1">
-                    and s.name=#{paYee}
-                </if>
+<!--            <if test="receiptStatus != null and receiptStatus != ''">-->
+<!--                AND a.receiptStatus = #{receiptStatus}-->
+<!--            </if>-->
+<!--            <if test="orderNo != null and orderNo != ''">-->
+<!--                AND ((cr.orderNo like concat('%',#{orderNo},'%')) OR (cso.shopOrderNo like concat('%',#{orderNo},'%')))-->
+<!--            </if>-->
+<!--            <if test="orderID != null and orderID != ''">-->
+<!--                AND (cr.orderID = #{orderID} )-->
+<!--            </if>-->
+<!--            <if test="shopOrderId != null and shopOrderId != ''">-->
+<!--                AND (cso.shopOrderId = #{shopOrderId} )-->
+<!--            </if>-->
+<!--            <if test="userName != null and userName != ''">-->
+<!--                AND (u.userName LIKE concat('%',#{userName},'%') or u.name LIKE concat('%',#{userName},'%'))-->
+<!--            </if>-->
+<!--            <if test="receiptProgress != null and receiptProgress != ''">-->
+<!--                and (case when crr.relationType = '1' then-->
+<!--                cso_cr.receiptStatus-->
+<!--                else-->
+<!--                cr.receiptStatus-->
+<!--                end) = #{receiptProgress}-->
+<!--            </if>-->
+<!--            <if test="receiptOrderType != null and receiptOrderType != ''">-->
+<!--                and (case when crr.relationType = '1' then-->
+<!--                cso.orderType-->
+<!--                else-->
+<!--                cr.orderType-->
+<!--                end) = #{receiptOrderType}-->
+<!--            </if>-->
+<!--            <if test="associationNum != null and associationNum != ''">-->
+<!--                <if test="associationNum == 1">-->
+<!--                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0') = 1-->
+<!--                </if>-->
+<!--                <if test="associationNum == 2">-->
+<!--                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0')-->
+<!--                    <![CDATA[ > ]]> 1-->
+<!--                </if>-->
+<!--            </if>-->
+<!--            <if test="paYee !=null and paYee != ''">-->
+<!--                <if test="paYee == '采美'">-->
+<!--                    and a.payWay = 3-->
+<!--                    OR a.payWay = 2-->
+<!--                    AND a.newReceiptType != 3 AND a.payWay = 2-->
+<!--                </if>-->
+<!--                <if test="payWay==1">-->
+<!--                    and s.name=#{paYee}-->
+<!--                </if>-->
+
+<!--            </if>-->
+<!--            and a.delFlag = '0'-->
+<!--        </where>  group by a.id order by a.id desc -->
+<!--      )-->
+<!--        union-->
 
-            </if>
-            and a.delFlag = '0'
-        </where>
-      )
-        union
-        (
         SELECT
         <include refid="cmDiscernReceiptColumns"/>,
         cso.orderId AS orderID,
@@ -220,14 +222,17 @@
 
         LEFT JOIN cm_receipt_order_relation crr ON crr.receiptId = a.id AND crr.delFlag = '0'
         LEFT JOIN cm_coupon_buyrecord ccb ON crr.couponRecordId=ccb.id
-        LEFT JOIN cm_order cr ON cr.orderId = crr.orderId
-        LEFT JOIN cm_shop_order cso ON cso.shopOrderId = cr.orderId
+--         LEFT JOIN cm_order cr ON cr.orderId = crr.orderId
+--         LEFT JOIN cm_shop_order cso ON cso.shopOrderId = cr.orderId
+        LEFT JOIN cm_shop_order cso ON cso.shopOrderId = crr.shopOrderId or cso.orderId = crr.orderId
+        LEFT JOIN cm_order cr ON cr.orderId = cso.orderId
         LEFT JOIN shop s ON s.shopID = cso.shopID
         left join user u on u.userID = cr.userID
         LEFT JOIN club c ON cr.userId = c.userId
         LEFT JOIN cm_offline_collection cof ON a.payType = cof.type
         <where>
-            crr.relationType = 1
+--             crr.relationType = 1
+             a.delFlag = '0'
             <if test="id != null and id != '' and id != 0 ">
                 AND a.id = #{id}
             </if>
@@ -317,9 +322,10 @@
                 </if>
 
             </if>
-            and a.delFlag = '0'
+
         </where>
-     )
+        group by a.id order by a.id desc
+
     </select>
 
     <select id="findAllList" resultType="CmDiscernReceipt">
@@ -740,14 +746,15 @@
 			co.payTotalFee AS orderAmount,
 			co.payableAmount AS payableAmount,
 		    co.onlinePayFlag,
-			(select
-			 sum(o.needPayAmount)
-			 from  cm_receipt_order_relation cror
-			 left join cm_shop_order o on cror.orderID = o.shopOrderID
-			 left join cm_discern_receipt cdr on cdr.id = cror.receiptID
-			 where o.orderID = cso.orderID and cror.delFlag = '0' and cdr.delFlag = '0'
-			 and cdr.receiptStatus = '2'
-			) AS receiptAmount,
+            cso.receiptAmount AS receiptAmount,
+-- 			(select
+-- 			 sum(o.needPayAmount)
+-- 			 from  cm_receipt_order_relation cror
+-- 			 left join cm_shop_order o on cror.orderID = o.shopOrderID
+-- 			 left join cm_discern_receipt cdr on cdr.id = cror.receiptID
+-- 			 where o.orderID = cso.orderID and cror.delFlag = '0' and cdr.delFlag = '0'
+-- 			 and cdr.receiptStatus = '2'
+-- 			) AS receiptAmount,
 			bou.name AS customerName,
             cso.orderStatusFlag AS orderStatusFlag,
             cso.receiptStatus AS receiptStatus,
@@ -970,6 +977,12 @@
 		where cror.orderID = #{orderID} and cror.delFlag = '0' and cror.relationType = '2'
 		and cdr.delFlag = '0' and cdr.receiptStatus = '3' and cdr.payWay != '3'
 	</select>
+    <select id="findShoOrderIDReceipt" resultType="double">
+        select sum(associateAmount) from cm_receipt_order_relation cror
+                                             left join cm_discern_receipt cdr on cror.receiptID = cdr.id
+        where cror.shopOrderID = #{shopOrderID} and cror.delFlag = '0' and cror.relationType = '2'
+          and cdr.delFlag = '0' and cdr.receiptStatus = '3' and cdr.payWay != '3'
+	</select>
 
     <select id="gathering" resultType="com.caimei.modules.order.entity.CmMainReceiptExport">
 		SELECT

+ 4 - 4
src/main/resources/mappings/modules/order/CmOrderRemarkMapper.xml

@@ -29,10 +29,10 @@
 		LEFT JOIN sys_user su ON su.id = a.createBy
 		<if test="shopOrderID != null">
 			<where>
-				<if test="orderID != null and orderID != ''">
-					AND (a.orderID = #{orderID} AND a.shopOrderID is null)
-				</if>
-				or (a.orderID = #{orderID} AND a.shopOrderID = #{shopOrderID})
+<!--				<if test="orderID != null and orderID != ''">-->
+<!--					AND (a.orderID = #{orderID} AND a.shopOrderID is null)-->
+<!--				</if>-->
+				AND a.shopOrderID = #{shopOrderID}
 			</where>
 		</if>
 		<if test="shopOrderID == null">

+ 2 - 1
src/main/resources/mappings/modules/order/CmReturnedPurchaseProductMapper.xml

@@ -38,6 +38,7 @@
 		left join shop d on d.shopID = a.shopID
 		<where>
 			  c.groundMall like CONCAT('%', cs.organizeId, '%')
+			and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
             <if test="returnedID != null and returnedID != ''">
                 AND a.returnedID = #{returnedID}
             </if>
@@ -164,7 +165,7 @@
 				AND b.orderID = #{orderID}
 			</if>
 			<if test="returnTime != null and returnTime != ''">
-				AND b.returnTime <![CDATA[  <  ]]> #{returnTime}
+				AND b.returnTime <![CDATA[  <=  ]]> #{returnTime}
 			</if>
 			AND b.status in(1,2)
             and b.delFlag = 0

+ 3 - 0
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -1073,6 +1073,7 @@
         AND co.orderType != 2
         AND cso.refundStatus = 1
         AND p.splitCode != 'E1807059160'
+        group by p.productID
     </select>
 
     <select id="getOrderProductByOrderId" resultType="com.caimei.modules.order.entity.OrderProductVo">
@@ -1126,6 +1127,7 @@
                  LEFT JOIN cm_order co ON cop.orderId = co.orderId
         WHERE co.orderID = #{orderId}
           AND IF(co.userBeans = 0, 1 = 1, cop.shopid != 998)
+        group by p.productID
         ORDER BY cop.discountPrice DESC
     </select>
 
@@ -1303,6 +1305,7 @@
                  left join cm_order co on co.orderID = cop.orderID
         WHERE cop.shopOrderID = #{shopOrderId}
           AND IF(co.userBeans = 0, 1 = 1, cop.shopid != 998)
+        group by p.productID
         ORDER BY cop.discountPrice DESC
     </select>
     <select id="getShopOrderByOrderId" resultType="com.caimei.modules.order.entity.ShopOrderVo">

+ 14 - 6
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -75,7 +75,7 @@
 		a.orderPromotionsId AS orderPromotionsId,
 		a.`actPreferential` AS `actPreferential`,
 		a.`preferential` AS `preferential`,
-		(select mainImage from product p where p.productID = a.productID) AS image,
+		(select mainImage from product p where p.productID = a.productID group by p.productID) AS image,
 		a.`discountFee` AS `discountFee`,
 		a.`productUnit` AS `productUnit`,
 		a.`productImage` AS `productImage`,
@@ -99,8 +99,8 @@
     </sql>
 
     <sql id="orderProductJoins">
-        left join cm_sku cs on cs.skuId = a.skuId
-		LEFT JOIN product p ON p.productID = a.productID  and  p.groundMall like CONCAT('%', cs.organizeId, '%')
+        left join cm_sku cs on cs.skuId = a.skuId and cs.organizeId=a.organizeID
+		LEFT JOIN product p ON p.productID = a.productID
     </sql>
 
     <select id="get" resultType="NewOrderProduct">
@@ -109,6 +109,7 @@
         FROM cm_order_product a
         <include refid="orderProductJoins"/>
         WHERE a.orderProductID = #{orderProductID}
+        group by p.productID
     </select>
 
     <select id="findListByShopOrderID" resultType="NewOrderProduct">
@@ -119,6 +120,7 @@
         <include refid="orderProductJoins"/>
         LEFT JOIN cm_second_hand_detail csdh ON csdh.productID = a.productID
         WHERE a.shopOrderID = #{shopOrderID}
+        group by p.productID
     </select>
     <select id="findListProductOrderID"  resultType="com.caimei.modules.order.entity.NewOrderProduct">
         SELECT
@@ -128,6 +130,7 @@
         <include refid="orderProductJoins"/>
         LEFT JOIN cm_second_hand_detail csdh ON csdh.productID = a.productID
         WHERE a.orderID = #{orderID}
+        group by p.productID
     </select>
 
     <select id="getListByShopOrderID" resultType="NewOrderProduct">
@@ -144,6 +147,7 @@
         FROM cm_order_product a
         <include refid="orderProductJoins"/>
         WHERE a.orderID = #{orderID}
+        group by p.productID
     </select>
 
     <select id="findAllList" resultType="NewOrderProduct">
@@ -165,6 +169,7 @@
                 AND a.payStatus = #{payStatus}
             </if>
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -411,6 +416,7 @@
         LEFT JOIN shop s on s.shopID = a.shopID
         where a.orderID = #{orderID}
         -- AND a.productID != 999
+        group by p.productID
     </select>
 
     <!--通过订单ID获取订单商品并以供应商分组-->
@@ -483,6 +489,7 @@
         FROM cm_order_product a
         <include refid="orderProductJoins"/>
         WHERE a.orderProductID = #{orderProductID}
+        group by p.productID
     </select>
 
     <select id="getGroupOrderProductIdS" resultType="String">
@@ -554,7 +561,8 @@
                  left join product p on p.productID = cop.productID
                  left join cm_order co on co.orderID = cop.orderID
                  left join user u on u.userID = co.userID
-        where cop.shopOrderID = #{shopOrderID}   and  p.groundMall like CONCAT('%', cs.organizeId, '%')
+        where cop.shopOrderID = #{shopOrderID}   and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+        group by p.productID
     </select>
 
     <select id="CountReturnedPurchaseProduct" resultType="java.lang.Integer">
@@ -597,12 +605,12 @@
     <select id="findPriceBySku" resultType="java.lang.Double">
         select price
         from cm_sku
-        where skuId = #{skuId}
+        where skuId = #{skuId} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
     <select id="findSkuIdByProductId" resultType="java.lang.String">
         select skuId
         from cm_sku
-        where productId = #{productID}
+        where productId = #{productID} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 </mapper>

+ 1 - 1
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -30,7 +30,7 @@
             a.splitCode,
             a.realPay AS realPay,
             a.eachDiscount AS eachDiscount,
-            a.receiptAmount AS receiptAmount,
+            ifnull(a.receiptAmount,0) AS receiptAmount,
             (ifnull(a.realPay,0) - ifnull(a.receiptAmount,0)) as restAmount,
             a.receiptStatus as shopReceiptStatus,
 			a.canRefundAmount AS  canRefundAmount,

+ 1 - 0
src/main/resources/mappings/modules/product/CmOrganizeProductInfoMapper.xml

@@ -22,6 +22,7 @@
             <if test="productId != null "> and cm_organize_product_info.productId = #{productId}</if>
             <if test="validFlag != null "> and cm_organize_product_info.validFlag = #{validFlag}</if>
         </where>
+        order BY cm_organize_product_info.organizeId asc
         limit 0,1
     </select>
 

+ 4 - 2
src/main/resources/mappings/modules/product/CmProductCombinationMapper.xml

@@ -56,6 +56,7 @@
 		where
 			 combinationID = #{id}
 			 and a.productCategory = 1
+		group by a.productID
 		ORDER BY combinationSort!= 0 desc,combinationSort asc
 
 	</select>
@@ -129,7 +130,7 @@
 		left join cm_organize_product_info copi on copi.productId = a.productID
 		left join shop s on a.shopId = s.shopID
 		<where>
-			a.groundMall like CONCAT('%', copi.organizeId, '%')
+
 			<if test="productID !=null and productID !=''">
 				AND a.productID=#{productID}
 			</if>
@@ -146,10 +147,11 @@
 				<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
 			</if>
 -- 			AND a.validFlag in (2,3,9)
-			AND copi.validFlag in (2,3,9)
+			 copi.validFlag in (2,3,9)
 			and a.combinationID is null
 			and a.productCategory = 1
 		</where>
+		group by a.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}

+ 15 - 8
src/main/resources/mappings/modules/product/CmPromotionMapper.xml

@@ -97,7 +97,9 @@
 
     <select id="findPromotionProduct" resultType="com.caimei.modules.product.entity.Product">
         SELECT p.*,
-               (select price from cm_sku where productId = p.productId order by price asc limit 1) as price,
+               (select price from cm_sku cs where cs.productId = p.productId
+                and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+                order by price asc limit 1) as price,
                cp.reducedPrice                                                                     AS "reducedPrice",
                s.name                                                                              AS "shopName"
         FROM cm_promotions cp
@@ -107,6 +109,7 @@
                  LEFT JOIN shop s ON s.shopID = p.shopID
         WHERE cp.id = #{id}
           and p.productCategory = 1
+        group by p.productID
     </select>
 
     <select id="findGiftProduct" resultType="com.caimei.modules.product.entity.Product">
@@ -123,8 +126,9 @@
                  left join cm_sku cs on cpg.skuId = cs.skuId
                  LEFT JOIN product p ON cpg.productId = p.productID
                  LEFT JOIN shop s ON s.shopID = p.shopID
-        WHERE cp.id = #{id} and p.groundMall like CONCAT('%', cs.organizeId, '%')
+        WHERE cp.id = #{id} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
           and p.productCategory = 1
+        group by p.productID
     </select>
 
     <select id="findGiftPurchaseProduct" resultType="com.caimei.modules.bulkpurchase.entity.PurchaseProduct">
@@ -148,8 +152,9 @@
                  left join cm_sku cs on cpg.skuId = cs.skuId
                  LEFT JOIN product p ON cpg.productId = p.productID
                  LEFT JOIN shop s ON s.shopID = p.shopID
-        WHERE cp.id = #{id} and p.groundMall like CONCAT('%', cs.organizeId, '%')
+        WHERE cp.id = #{id} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
           and p.productCategory = 1
+        group by p.productID
     </select>
 
     <select id="findPromotionShops" resultType="com.caimei.modules.product.entity.Shop">
@@ -172,7 +177,7 @@
         <where>
             p.productCategory = 1
             and copi.validFlag = 2
-            and p.priceFlag != 1 and p.groundMall like CONCAT('%', copi.organizeId, '%')
+            and p.priceFlag != 1
             <if test="productID != null">
                 AND p.productID = #{productID}
             </if>
@@ -381,6 +386,7 @@
             or prp.supplierId = #{shopId})
           and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
           and pr.delFlag not in ('1', '2')
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         order by pr.type desc
         limit 1
     </select>
@@ -437,8 +443,9 @@
 
     <select id="getPresentPriceById" resultType="java.lang.Double">
         select price
-        from cm_sku
+        from cm_sku cs
         where skuId = #{skuId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
     <select id="findProductIdByPromotion" resultType="java.lang.Integer">
@@ -461,15 +468,15 @@
                  LEFT JOIN cm_promotions_product cpp ON cp.id = cpp.promotionsId
                  LEFT JOIN cm_sku cs ON cpp.productId = cs.productId
                  LEFT JOIN cm_promotion_sku cps ON cs.skuId = cps.skuId
-        WHERE cp.id = #{id}
+        WHERE cp.id = #{id} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
     <select id="getPromotionSkusByProduct" resultType="com.caimei.modules.product.entity.CmSku">
-        SELECT cs.unit, cs.costCheckFlag, cs.costPrice, cs.shopPercent, cps.touchPrice
+        SELECT cs.skuId,cs.unit, cs.costCheckFlag, cs.costPrice, cs.shopPercent, cps.touchPrice
                       , cs.organizeId
         FROM cm_sku cs
                  LEFT JOIN cm_promotion_sku cps ON cs.skuId = cps.skuId
-        WHERE cs.productId = #{productIds}
+        WHERE cs.productId = #{productIds} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
     <delete id="deletePromotion">

+ 7 - 4
src/main/resources/mappings/modules/product/CmSecondHandDetailMapper.xml

@@ -56,7 +56,7 @@
 
     <sql id="cmSecondHandDetailJoins">
         left join product p on p.productID = a.productID
-		left join cm_sku cs on p.productId=cs.productId and p.groundMall like CONCAT('%', cs.organizeId, '%')
+		left join cm_sku cs on p.productId=cs.productId and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </sql>
 
     <select id="get" resultType="CmSecondHandDetail">
@@ -67,7 +67,7 @@
         <include refid="cmSecondHandDetailJoins"/>
         left join cm_organize_product_info copi on copi.productId = a.productID
         WHERE a.productID = #{id}
-        and a.groundMall like CONCAT('%', copi.organizeId, '%')
+        group by p.productID
     </select>
 
     <select id="findList" resultType="CmSecondHandDetail">
@@ -77,11 +77,12 @@
         <include refid="cmSecondHandDetailJoins"/>
         left join cm_organize_product_info copi on copi.productId = a.productID
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID != null and productID != ''">
                 AND a.productID = #{productID}
             </if>
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -98,8 +99,9 @@
         <include refid="cmSecondHandDetailJoins"/>
         left join cm_organize_product_info copi on copi.productId = p.productID
         <where>
-            p.groundMall like CONCAT('%', copi.organizeId, '%')
+
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -121,6 +123,7 @@
                  left join product p on cshd.productId = p.productId
                  left join shop s on s.shopID = p.shopID
         where p.productID = #{productID}
+        group by p.productID
     </select>
 
     <select id="findFlieTypes" resultType="java.lang.Integer">

+ 5 - 2
src/main/resources/mappings/modules/product/RepeatPurchasePriceMapper.xml

@@ -16,8 +16,8 @@
 	</sql>
 
 	<sql id="repeatPurchasePriceJoins">
-		left join cm_sku cs on cs.skuId=a.skuId
-		left join product as b on cs.productId = b.productID and b.groundMall like CONCAT('%', cs.organizeId, '%')
+		left join cm_sku cs on cs.skuId=a.skuId and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+		left join product as b on cs.productId = b.productID
 		left join user as c on a.userId = c.userId
 	</sql>
 
@@ -32,6 +32,7 @@
 		<include refid="repeatPurchasePriceJoins"/>
 		where a.id = #{id}
 		AND a.delFlag = 0
+		group by b.productID
 	</select>
 
 	<select id="getRepeatPurchasePrice" resultType="RepeatPurchasePrice">
@@ -51,6 +52,7 @@
 			AND a.delFlag = 0
 			and b.productCategory = 1
 		</where>
+		group by b.productID
 	</select>
 
 	<select id="findList" resultType="RepeatPurchasePrice">
@@ -131,6 +133,7 @@
 			a.delFlag = 0
 			and b.productCategory = 1
 		</where>
+		group by b.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}

+ 5 - 0
src/main/resources/mappings/modules/svip/CmSvipProductMapper.xml

@@ -55,6 +55,7 @@
         FROM cm_svip_product a
         <include refid="cmSvipProductJoins"/>
         WHERE a.id = #{id}
+        group by p.productID
     </select>
 
     <select id="findList" resultType="CmSvipProduct">
@@ -91,6 +92,7 @@
                 and a.status=1
             </if>
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -109,6 +111,7 @@
         <where>
 
         </where>
+        group by p.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -152,6 +155,7 @@
                 <if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
             </if>
         </where>
+        group by a.productID
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
@@ -184,6 +188,7 @@
         from cm_svip_product_sku csps
         left join cm_sku cs on cs.productId = csps.productId
         where csps.productId = #{productId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         order by cs.price asc
         limit 1
     </select>

+ 1 - 0
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -164,6 +164,7 @@
                 AND p.name like concat('%',#{productName},'%')
             </if>
         </where>
+        group by p.productID
         ORDER BY accessTime DESC
     </select>
     <select id="pageType" resultType="com.caimei.modules.user.entity.CmPageType">

+ 3 - 0
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -541,6 +541,7 @@
                 and ccr.reportID=#{reportID}
             </if>
         </where>
+        group by p.productID
         ORDER BY ADDTIME DESC
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -650,6 +651,7 @@
                 and ccr.addTime <![CDATA[  <  ]]> #{endAddTime}
             </if>
         </where>
+        group by p.productID
         ORDER BY ccr.`addTime` DESC
     </select>
 
@@ -696,6 +698,7 @@
             </if>
             and ccr.remarks IS NOT NULL
         </where>
+        group by p.productID
         ORDER BY ADDTIME DESC
     </select>
 

+ 1 - 0
src/main/resources/mappings/modules/user/VisitRemarkMapper.xml

@@ -107,6 +107,7 @@
             </if>
             and ccr.remarks IS NOT NULL
         </where>
+        group by p.productID
         ORDER BY ADDTIME DESC
     </select>
     <select id="findClassName" resultType="java.lang.String">

+ 8 - 2
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -45,7 +45,7 @@
         LEFT JOIN shop s ON s.shopID = p.shopID
         LEFT JOIN cm_sku cmps ON cmop.productID=cmps.productId and cmps.organizeId = cmop.organizeId
         <where>
-            p.groundMall like CONCAT('%', copi.organizeId, '%')
+            and cmps.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cmps.productId)
             <if test="productId != null and productId != ''">
                 AND cmop.productId = #{productId}
             </if>
@@ -68,6 +68,7 @@
                 AND cmop.organizeID = #{organizeId}
             </if>
         </where>
+        group by p.productID
     </select>
 
     <select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
@@ -86,6 +87,7 @@
 --         FROM cm_mall_product_sku cmps
         FROM cm_sku cmps
         <where>
+            and cmps.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cmps.productId)
             <if test="productIds.size() > 0">
                 cmps.productId in
                 <foreach collection="productIds" item="productId" open="(" separator="," close=")">
@@ -114,6 +116,7 @@
             p.productCategory = 1 AND copi.validFlag not in ( 0,1,8 ) and s.shopType != 2 and copi.productId is null
             AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
             AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
+            and k.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=k.productId)
             <if test="productID != null">
                 AND p.productID = #{productID}
             </if>
@@ -179,6 +182,7 @@
                 </foreach>
             </if>
         </where>
+        group by p.productID
     </select>
 
     <select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
@@ -190,8 +194,9 @@
                costPrice,
                ladderPriceFlag,
                minBuyNumber
-        FROM cm_sku
+        FROM cm_sku cs
         where productId = #{productId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         order by normalPrice
     </select>
 
@@ -259,6 +264,7 @@
                  LEFT JOIN shop s ON p.shopID = s.shopID
         WHERE p.productCategory = 1
           AND cmop.id = #{id} and p.groundMall like CONCAT('%', copi.organizeId, '%')
+        group by p.productID
     </select>
 
     <update id="deleteProduct">

+ 4 - 3
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -82,8 +82,9 @@
 			//添加视频资料
 			var url = '';
 			var title = '';
+			var titleName=id!=''?'编辑':'添加'
 			url = "${ctx}/archive/cmProductArchiveContent/form?type=" + type + "&productArchiveId=" + productArchiveId + '&id=' + id;
-			title = type == 2?"添加视频文件":"添加文件资料";
+			title = type == 2?titleName+"视频文件":titleName+"文件资料";
 			top.$.jBox("iframe:" + url, {
 				iframeScrolling: 'yes',
 				width: 800,
@@ -153,4 +154,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/addOrderRemarksForm.jsp

@@ -134,6 +134,7 @@
 <br/>
 <form:form id="inputForm" modelAttribute="cmOrderRemark" action="${ctx}/order/cmOrderRemark/addRemarksViewNew?source=${source}" method="post" class="form-horizontal">
 		<form:hidden path="orderID" value="${orderID}"/>
+		<form:hidden path="shopOrderID" value="${shopOrderID}"/>
 		<form:hidden path="fileIds" id="fileIds"/>
         <form:hidden path="orderType" value="${orderType}" />
 		<sys:message content="${message}"/>

+ 9 - 9
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderConfirmReturnRecord.jsp

@@ -185,9 +185,7 @@
                     </c:if>
                     <br>
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                    <c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
-                        线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
-                                               value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+
 <%--                        采美退款银行:${cmReturnedPurchase.bankNameType}--%>
 <%--                        <c:if test="${cmReturnedPurchase.payType == '1'}">--%>
 <%--                            建设银行7297--%>
@@ -210,13 +208,15 @@
 <%--                        <c:if test="${cmReturnedPurchase.payType == '7'}">--%>
 <%--                            华夏银行2400--%>
 <%--                        </c:if>--%>
-                    </c:if>
                     <c:if test="${empty cmReturnedPurchase.refundFee or cmReturnedPurchase.refundFee eq 0}">
                         暂无支付方式
                     </c:if>
                 </c:if>
                 <c:if test="${empty cmReturnedPurchase.returnedWay}">
-                    ----
+                    <c:if test="${not empty cmReturnedPurchase.refundOfflineFee && cmReturnedPurchase.refundOfflineFee ne 0 }">
+                        线下转账:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                               value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;&nbsp;&nbsp;
+                    </c:if>
                 </c:if>
                     <%--存在线下打款才显示银行信息--%>
                 <br>
@@ -414,13 +414,13 @@
                         </td>
                         <td>
                             退款状态:
-                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 1}">
+                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 1}">
                                 <font>无退款</font>
                             </c:if>
-                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 2}">
+                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 2}">
                                 <font>退款中</font>
                             </c:if>
-                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 3}">
+                            <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 3}">
                                 <font>已退款</font>
                             </c:if>
                         </td>
@@ -503,7 +503,7 @@
                         </tr>
                         <tr>
                             <td><font
-                                    color="red">待发货:${cmReturnedPurchaseProduct.notOutStore - cmReturnedPurchaseProduct.cancelProductNum}</font>
+                                    color="red">待发货:${cmReturnedPurchaseProduct.notOutStore}</font>
                             </td>
                             <td><font color="red">已取消:<span
                                     id="applicationCancelNum${shopOrderReturnedStatus.index}${cmReturnedPurchaseProductStatus.index}">${cmReturnedPurchaseProduct.cancelProductNum}</span></font>

+ 109 - 107
src/main/webapp/WEB-INF/views/modules/bulkpurchase/orderReturnRecord.jsp

@@ -167,105 +167,105 @@
         <c:if test="${cmReturnedPurchaseStatus.index ne 0}">
             <hr style="height:5px;border:none;border-top:5px ridge green;"/>
         </c:if>
-        <%--审核模块--%>
-        <c:if test="${not empty cmReturnedPurchase.confirmReturnTime}">
-            <table id="contentTable" class="table table-striped table-bordered table-condensed">
-                <tr>
-                    <td colspan="2">
-                        <b>审核信息</b>
-                    </td>
-                </tr>
-                <tr>
-                    <td>
-                        审核人:${cmReturnedPurchase.reviewUserName}<br>
-                        审核时间:${cmReturnedPurchase.confirmReturnTime}<br>
-                            <%--<textarea id='remarks' readonly name='reviewRemarks' rows='4' cols='50' style="width: 709px" maxlength="200" >${cmReturnedPurchase.reviewRemarks}</textarea><br>--%>
-                        审核备注:
-                        <c:if test="${not empty cmReturnedPurchase.reviewRemarks}">
-                            ${cmReturnedPurchase.reviewRemarks}
-                        </c:if>
-                        <c:if test="${empty cmReturnedPurchase.reviewRemarks}">
-                            无
-                        </c:if>
-                        <br>
-                        <c:if test="${not empty cmReturnedPurchase.reviewImage1 || not empty cmReturnedPurchase.reviewImage2  || not empty cmReturnedPurchase.reviewImage3  || not empty cmReturnedPurchase.reviewImage4  || not empty cmReturnedPurchase.reviewImage5}">
-                            审核凭证:
-                            <c:if test="${not empty cmReturnedPurchase.reviewImage1}">
-                                <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                     src="${cmReturnedPurchase.reviewImage1}">
-                            </c:if>
-                            <c:if test="${not empty cmReturnedPurchase.reviewImage2}">
-                                <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                     src="${cmReturnedPurchase.reviewImage2}">
-                            </c:if>
-                            <c:if test="${not empty cmReturnedPurchase.reviewImage3}">
-                                <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                     src="${cmReturnedPurchase.reviewImage3}">
-                            </c:if>
-                            <c:if test="${not empty cmReturnedPurchase.reviewImage4}">
-                                <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                     src="${cmReturnedPurchase.reviewImage4}">
-                            </c:if>
-                            <c:if test="${not empty cmReturnedPurchase.reviewImage5}">
-                                <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                     src="${cmReturnedPurchase.reviewImage5}">
-                            </c:if>
-                        </c:if>
-                    </td>
-                </tr>
-            </table>
-        </c:if>
+<%--        &lt;%&ndash;审核模块&ndash;%&gt;--%>
+<%--        <c:if test="${not empty cmReturnedPurchase.confirmReturnTime}">--%>
+<%--            <table id="contentTable" class="table table-striped table-bordered table-condensed">--%>
+<%--                <tr>--%>
+<%--                    <td colspan="2">--%>
+<%--                        <b>审核信息</b>--%>
+<%--                    </td>--%>
+<%--                </tr>--%>
+<%--                <tr>--%>
+<%--                    <td>--%>
+<%--                        审核人:${cmReturnedPurchase.reviewUserName}<br>--%>
+<%--                        审核时间:${cmReturnedPurchase.confirmReturnTime}<br>--%>
+<%--                            &lt;%&ndash;<textarea id='remarks' readonly name='reviewRemarks' rows='4' cols='50' style="width: 709px" maxlength="200" >${cmReturnedPurchase.reviewRemarks}</textarea><br>&ndash;%&gt;--%>
+<%--                        审核备注:--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.reviewRemarks}">--%>
+<%--                            ${cmReturnedPurchase.reviewRemarks}--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${empty cmReturnedPurchase.reviewRemarks}">--%>
+<%----%>
+<%--                        </c:if>--%>
+<%--                        <br>--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.reviewImage1 || not empty cmReturnedPurchase.reviewImage2  || not empty cmReturnedPurchase.reviewImage3  || not empty cmReturnedPurchase.reviewImage4  || not empty cmReturnedPurchase.reviewImage5}">--%>
+<%--                            审核凭证:--%>
+<%--                            <c:if test="${not empty cmReturnedPurchase.reviewImage1}">--%>
+<%--                                <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                     src="${cmReturnedPurchase.reviewImage1}">--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${not empty cmReturnedPurchase.reviewImage2}">--%>
+<%--                                <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                     src="${cmReturnedPurchase.reviewImage2}">--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${not empty cmReturnedPurchase.reviewImage3}">--%>
+<%--                                <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                     src="${cmReturnedPurchase.reviewImage3}">--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${not empty cmReturnedPurchase.reviewImage4}">--%>
+<%--                                <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                     src="${cmReturnedPurchase.reviewImage4}">--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${not empty cmReturnedPurchase.reviewImage5}">--%>
+<%--                                <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                     src="${cmReturnedPurchase.reviewImage5}">--%>
+<%--                            </c:if>--%>
+<%--                        </c:if>--%>
+<%--                    </td>--%>
+<%--                </tr>--%>
+<%--            </table>--%>
+<%--        </c:if>--%>
 
-        <%--申请模块--%>
-        <table id="contentTable" class="table table-striped table-bordered table-condensed">
-            <tr>
-                <td colspan="2">
-                    <b>申请信息</b>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    申请人:${cmReturnedPurchase.applicationUserName}<br>
-                    申请时间:${cmReturnedPurchase.returnTime}<br>
+<%--        &lt;%&ndash;申请模块&ndash;%&gt;--%>
+<%--        <table id="contentTable" class="table table-striped table-bordered table-condensed">--%>
+<%--            <tr>--%>
+<%--                <td colspan="2">--%>
+<%--                    <b>申请信息</b>--%>
+<%--                </td>--%>
+<%--            </tr>--%>
+<%--            <tr>--%>
+<%--                <td>--%>
+<%--                    申请人:${cmReturnedPurchase.applicationUserName}<br>--%>
+<%--                    申请时间:${cmReturnedPurchase.returnTime}<br>--%>
 
-                    退款备注:
-                    <c:if test="${empty cmReturnedPurchase.remarks}">
-                        无
-                    </c:if>
-                    <c:if test="${not empty cmReturnedPurchase.remarks}">
-                        ${cmReturnedPurchase.remarks}
-                    </c:if>
-                    <br>
-                    <c:if test="${not empty cmReturnedPurchase.image1 || not empty cmReturnedPurchase.image2 || not empty cmReturnedPurchase.image3 || not empty cmReturnedPurchase.image4 || not empty cmReturnedPurchase.image5}">
-                        申请凭证:
-                        <c:if test="${not empty cmReturnedPurchase.image1}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image1}">
-                        </c:if>
-                        <c:if test="${not empty cmReturnedPurchase.image2}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image2}">
-                        </c:if>
-                        <c:if test="${empty cmReturnedPurchase.image3}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image3}">
-                        </c:if>
-                        <c:if test="${not empty cmReturnedPurchase.image3}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image3}">
-                        </c:if>
-                        <c:if test="${not empty cmReturnedPurchase.image4}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image4}">
-                        </c:if>
-                        <c:if test="${not empty cmReturnedPurchase.image5}">
-                            <img class="enlarge-pic" style="height: 70px;width: 65px"
-                                 src="${cmReturnedPurchase.image5}">
-                        </c:if>
-                    </c:if>
-                </td>
-            </tr>
-        </table>
+<%--                    退款备注:--%>
+<%--                    <c:if test="${empty cmReturnedPurchase.remarks}">--%>
+<%----%>
+<%--                    </c:if>--%>
+<%--                    <c:if test="${not empty cmReturnedPurchase.remarks}">--%>
+<%--                        ${cmReturnedPurchase.remarks}--%>
+<%--                    </c:if>--%>
+<%--                    <br>--%>
+<%--                    <c:if test="${not empty cmReturnedPurchase.image1 || not empty cmReturnedPurchase.image2 || not empty cmReturnedPurchase.image3 || not empty cmReturnedPurchase.image4 || not empty cmReturnedPurchase.image5}">--%>
+<%--                        申请凭证:--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.image1}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image1}">--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.image2}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image2}">--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${empty cmReturnedPurchase.image3}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image3}">--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.image3}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image3}">--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.image4}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image4}">--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${not empty cmReturnedPurchase.image5}">--%>
+<%--                            <img class="enlarge-pic" style="height: 70px;width: 65px"--%>
+<%--                                 src="${cmReturnedPurchase.image5}">--%>
+<%--                        </c:if>--%>
+<%--                    </c:if>--%>
+<%--                </td>--%>
+<%--            </tr>--%>
+<%--        </table>--%>
 
         <div id="enlarge-box">
             <img src="" alt="">
@@ -283,9 +283,9 @@
                     <span class="refundFee"><fmt:formatNumber
                             value="${empty cmReturnedPurchase.refundFee?'0.00':(cmReturnedPurchase.refundFee)}"
                             pattern="#0.00"/></span>元&nbsp;&nbsp;&nbsp;
-                    <c:if test="${order.organizeID != 4}">
+<%--                    <c:if test="${order.organizeID != 4}">--%>
                         (账户余额抵扣:${order.balancePayFee})
-                    </c:if>
+<%--                    </c:if>--%>
                 </td>
 <%--                <td><b>退款审核状态:</b>--%>
 <%--                    <c:if test="${empty cmReturnedPurchase.status}">--%>
@@ -355,7 +355,8 @@
                         </c:if>
                     </c:if>
                     <c:if test="${empty cmReturnedPurchase.returnedWay}">
-                        ----
+                        线下退回:<fmt:formatNumber type="number" pattern="#,##0.00"
+                                               value="${cmReturnedPurchase.refundOfflineFee}"/>元&nbsp;&nbsp;
                     </c:if>
                         <%--存在线下打款才显示银行信息--%>
                     <br>
@@ -577,7 +578,8 @@
                                 </td>
                                 <td style="width: 250px;">子订单金额:${shopOrderReturneds.productAmount}</td>
                                 <td>
-                                        <%--                                        收款状态:${fns:getDictLabel(shopOrderReturneds.shopReceiptStatus,'receiptStatus' ,'' )}--%>
+                                                                                收款状态:
+<%--                                        ${fns:getDictLabel(shopOrderReturneds.shopReceiptStatus,'receiptStatus' ,'' )}--%>
                                     <c:if test="${shopOrderReturneds.shopReceiptStatus == 1}">
                                         <font color="red">待收款</font>
                                     </c:if>
@@ -614,13 +616,13 @@
                                 </td>
                                 <td>
                                     退款状态:
-                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 1}">
+                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 1}">
                                         <font>无退款</font>
                                     </c:if>
-                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 2}">
-                                        <font>退款中</font>
-                                    </c:if>
-                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).orderStatusFlag == 3}">
+<%--                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 2}">--%>
+<%--                                        <font>退款中</font>--%>
+<%--                                    </c:if>--%>
+                                    <c:if test="${order.newShopOrders.get(shopOrderReturnedStatus.index).refundStatus == 3}">
                                         <font>已退款</font>
                                     </c:if>
                                 </td>
@@ -694,7 +696,7 @@
                                 </tr>
                                 <tr>
                                     <td><font
-                                            color="red">待发货:${cmReturnedPurchaseProduct.notOutStore - cmReturnedPurchaseProduct.cancelProductNum}</font>
+                                            color="red">待发货:${cmReturnedPurchaseProduct.notOutStore }</font>
                                     </td>
                                     <td><font color="red">已取消:<span
                                             id="applicationCancelNum${shopOrderReturnedStatus.index}${cmReturnedPurchaseProductStatus.index}">${cmReturnedPurchaseProduct.cancelProductNum}</span></font>

+ 12 - 3
src/main/webapp/WEB-INF/views/modules/bulkpurchase/refundRecord.jsp

@@ -457,7 +457,11 @@
                     <%--    </c:if>--%>
             </td>
             <td>
-                应收总额:¥${shopOrder.realPay}
+                应收总额:¥
+                <c:if test="${shopOrder.realPay!=null}"><fmt:formatNumber value="${shopOrder.realPay}"
+                                                                                  type="currency"/></c:if>
+                <c:if test="${shopOrder.realPay==null}"><fmt:formatNumber value="${shopOrder.needPayAmount}"
+                                                                          type="currency"/></c:if>
             </td>
                 <%--    <c:if test="${order.organizeID != 4}">--%>
                 <%--        <td>--%>
@@ -510,9 +514,14 @@
         <c:forEach items="${receipt}" var="receipt" varStatus="s">
             <tr>
                 <td>${s.index + 1}</td>
-                <td><a href="${ctx}/order/cmDiscernReceipt/detail?id=${receipt.receiptID}"
+                <td><a href="${ctx}/order/cmDiscernReceipt/detail?id=${receipt.receiptID}&shopOrderId=${receipt.shopOrderId}"
                        style="cursor: pointer">${receipt.receiptID}</a></td>
-                <td>${receipt.payType}</td>
+<%--                <td>${receipt.payType}</td>--%>
+                <td>
+                    <c:if test="${receipt.payWay==1}">线上收款</c:if>
+                    <c:if test="${receipt.payWay==2}">线下收款</c:if>
+                    <c:if test="${receipt.payWay==3}">余额抵扣</c:if>
+                </td>
                 <td><fmt:formatNumber value="${receipt.associateAmount}" type="currency"/></td>
                 <td>${receipt.receiptDate}</td>
             </tr>

+ 4 - 2
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp

@@ -412,8 +412,10 @@
                                                                          pattern="#0.00"/></span>
                             <span>
                             <label>子订单已收金额:</label>¥<fmt:formatNumber
-                                    value="${empty orderInfo.receiptAmount ? 0 : orderInfo.payedShopAmount}"
+                                    value="${orderInfo.receiptAmount}"
+
                                     pattern="#0.00"/>
+<%--                                    value="${empty orderInfo.receiptAmount ? 0 : orderInfo.payedShopAmount}"--%>
 
                             <span>
                                     <c:forEach items="${orderInfo.receiptRecordVo}" var="receiptRecord"
@@ -617,7 +619,7 @@
         </div>
     </c:if>
 
-    <c:if test="${organizeID == 4&& voucherVo ne null }">
+    <c:if test="${ voucherVo ne null }">
         <div class="order-rows">
 
             <label>线下支付凭证:</label>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmOrderRemarksFormNew.jsp

@@ -39,7 +39,7 @@
 			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>
 		</c:if>
 		<li class="active"><a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">订单备注</a></li>
-		<li><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
+		<li><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&shopOrderID=${shopOrderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
 	</ul><br/>
 	<form:form id="inputForm" modelAttribute="cmOrderRemark" action="${ctx}" method="post" class="form-horizontal">
 	<sys:message content="${message}"/>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp

@@ -42,7 +42,6 @@
 <%--		<shiro:hasPermission name="order:cmPayShop:view">--%>
 <%--            <li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>--%>
 <%--			<li onclick="sessionStorage.removeItem('checkedIndexArr')"><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
-<%--        </shiro:hasPermission>--%>
 		<shiro:hasPermission name="order:cmPayShop:split">
 			<li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
 		</shiro:hasPermission>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmRebateRecordForm.jsp

@@ -54,7 +54,7 @@
 					<td><fmt:formatNumber value="${record.rebateAmount}" type="currency"/></td>
 					<td>
 						<c:if test="${record.type == '1'}">
-							<a href="${ctx}/order/cmDiscernReceipt/detail?id=${record.receiptID}">口头返佣订单</a>
+							<a href="${ctx}/order/cmDiscernReceipt/detail?id=${record.receiptID}&shopOrderId=${record.shopOrderId}">口头返佣订单</a>
 						</c:if>
 						<c:if test="${record.type == '2'}">
 							<a href="${ctx}/order/cmPayShop/applyDetail?id=${record.payShopID}">余额抵扣付款</a>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/order/cmSettlementList.jsp

@@ -292,9 +292,9 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
-    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+<%--    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>--%>
+<%--    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>--%>
+<%--    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
     <shiro:hasPermission name="order:cmPayShop:split">
         <li><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
     </shiro:hasPermission>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/order/cmSplitAccountList.jsp

@@ -292,9 +292,9 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-     <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
-     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+<%--     <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>--%>
+<%--     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>--%>
+<%--     <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
      <shiro:hasPermission name="order:cmPayShop:split">
          <li class="active tab-li"><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
      </shiro:hasPermission>

+ 104 - 67
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -250,8 +250,8 @@
             background: #fff;
             width: 125px;
             position: absolute;
-            left: 816px;
-            top: 65px;
+            left: 826px;
+            top: 5px;
             padding: 10px;
             border: 1px solid #666;
             -webkit-border-radius: 5px;
@@ -833,47 +833,73 @@
         <span><label>子订单号(ID):</label>${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</span>
         <span><label>子订单金额:</label><fmt:formatNumber
                 value="${order.onlinePayFlag eq 0?shopOrder.realPay:shopOrder.needPayAmount}" type="currency"/></span>
-        <td style="position: relative;"><a class="operation-btn btn">功能</a>
-            <div class="operation-block">
-                <shiro:hasPermission name="order:order:edit">
-                    <%--包含订单充值商品就不显示--%>
-                    <c:if test="${order.status == 0}">
-                        <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}"
-                           onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
-                    </c:if>
-                </shiro:hasPermission>
+        <td style="position: relative;"><a class="operation-btn btn"
+                                           onclick="operation(${shopOrder.shopOrderID})">功能</a>
+            <div style="position: relative;">
+                <div class="operation-block ${shopOrder.shopOrderID}">
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <c:if test="${shopOrder.status == 0}">
+                            <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}"
+                               onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
+                        </c:if>
+                    </shiro:hasPermission>
 
 
-                <shiro:hasPermission name="order:order:edit">
-                    <%--包含订单充值商品就不显示--%>
-                    <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>
-                    <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&from=2">收付款记录</a>
-                    <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}">退款(退货)记录</a>
-                    <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
-                </shiro:hasPermission>
+                    <shiro:hasPermission name="order:order:edit">
+                        <%--包含订单充值商品就不显示--%>
+                        <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}">发货记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}&from=2">收付款记录</a>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByOrderID.rpc?orderID=${order.orderID}&shopOrderID=${shopOrder.shopOrderID}">退款(退货)记录</a>
+                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&shopOrderID=${shopOrder.shopOrderID}">订单备注</a>
+                    </shiro:hasPermission>
+                </div>
             </div>
         </td>
         </tr>
-        <br/>
         <span>商品总额:<fmt:formatNumber value="${shopOrder.productAmount}" type="currency"/></span>
         <span>运费:
                     ${shopOrder.postageInfo}
             </span>
         <span>子订单总额:<fmt:formatNumber value="${shopOrder.totalAmount}" type="currency"/></span>
-        <span>优惠:<fmt:formatNumber value="${shopOrder.eachDiscount}" type="currency"/></span>
-        <span>应收金额:<fmt:formatNumber value="${shopOrder.realPay}" type="currency"/></span>
+            <%--        <span>优惠:<fmt:formatNumber value="${shopOrder.eachDiscount}" type="currency"/></span>--%>
+        <span>应收金额:
+            <c:if test="${shopOrder.realPay!=null}"><fmt:formatNumber value="${shopOrder.realPay}"
+                                                                      type="currency"/></c:if>
+            <c:if test="${shopOrder.realPay==null}"><fmt:formatNumber value="${shopOrder.needPayAmount}"
+                                                                      type="currency"/></c:if>
+        </span>
         <span>
                 已收金额:<fmt:formatNumber value="${shopOrder.receiptAmount}" type="currency"/>
                 <c:if test="${shopOrder.useBalanceFlag eq 1 and shopOrder.accountAmount ne null}">(余额抵扣¥${shopOrder.accountAmount})</c:if>
-                <c:if test="${order.organizeID != 4&&shopOrder.commercialCode eq 'E1807059160' && (order.receiptStatus == 2 || order.receiptStatus == 3)}">
-                    <font color="red">(采美信息线上收款)</font>
-                </c:if>
+<%--                <c:if test="${order.organizeID != 4&&shopOrder.commercialCode eq 'E1807059160' && (order.receiptStatus == 2 || order.receiptStatus == 3)}">--%>
+<%--                    <font color="red">(采美信息线上收款)</font>--%>
+<%--                </c:if>--%>
 
             </span>
         <span>待收金额:<fmt:formatNumber value="${shopOrder.restAmount}" type="currency"/></span>
         <br/>
         <span>子订单状态:
-
+ <c:if test="${shopOrder.status eq 11 || shopOrder.status eq 12 || shopOrder.status eq 13 ||shopOrder.status eq 21 ||shopOrder.status eq 22 ||
+				shopOrder.status eq 23 || shopOrder.status eq 31 ||shopOrder.status eq 32 ||shopOrder.status eq 33}">
+     交易中
+ </c:if>
+<%--            <c:if test="${shopOrder.status eq 0 || shopOrder.status eq 4 || shopOrder.status eq 5 || shopOrder.status eq 6 || shopOrder.status eq 7}">--%>
+<%--                ${fns:getDictLabel(shopOrder.status,"order_status","" )}--%>
+<%--                <c:if test="${shopOrder.status eq 0}">--%>
+<%--                    <span id="time" style="color: red"></span>--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${shopOrder.status eq 6}">--%>
+<%--                    <font color="red">(--%>
+<%--                            <c:if test="${shopOrder.closeTime ne null}">--%>
+<%--                                ${shopOrder.closeTime}--%>
+<%--                            </c:if>--%>
+<%--                            <c:if test="${shopOrder.closeReason ne null}">--%>
+<%--                                , ${shopOrder.closeReason}--%>
+<%--                            </c:if>--%>
+<%--                    )</font>--%>
+<%--                </c:if>--%>
+<%--            </c:if>--%>
 <%--            订单状态 0:待确认 1:已确认 2:交易完成 3:订单完成 4:已关闭 5:交易全退--%>
                             <c:if test="${shopOrder.status == 0}">
                                 <font color="red">待确认</font>
@@ -906,17 +932,7 @@
                                 <font color="green">已收款</font>
                             </c:if>
                         </span>
-        <span>付款状态:
-                            <c:if test="${shopOrder.payStatus == 1}">
-                                <font color="red">待付款</font>
-                            </c:if>
-                            <c:if test="${shopOrder.payStatus == 2}">
-                                <font color="#ff8c00">部分付款</font>
-                            </c:if>
-                            <c:if test="${shopOrder.payStatus == 3}">
-                                <font color="green">已付款</font>
-                            </c:if>
-                        </span>
+
         <span>发货状态:
                             <c:if test="${shopOrder.sendOutStatus == 1}">
                                 <font color="red">待发货</font>
@@ -928,18 +944,29 @@
                                 <font color="green">已发货</font>
                             </c:if>
                         </span>
+        <span>付款状态:
+                            <c:if test="${shopOrder.payStatus == 1}">
+                                <font color="red">待付款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.payStatus == 2}">
+                                <font color="#ff8c00">部分付款</font>
+                            </c:if>
+                            <c:if test="${shopOrder.payStatus == 3}">
+                                <font color="green">已付款</font>
+                            </c:if>
+                        </span>
         <span>
                                 退款状态:
-                                <c:if test="${shopOrder.orderStatusFlag == 1}">
+                                <c:if test="${shopOrder.refundStatus == 1}">
                                     <font>无退款</font>
                                 </c:if>
-                                <c:if test="${shopOrder.orderStatusFlag == 2}">
-                                    <font>退款中</font>
-                                </c:if>
+<%--                                <c:if test="${shopOrder.refundStatus == 2}">--%>
+<%--                                    <font>退款中</font>--%>
+<%--                                </c:if>--%>
 <%--                                <c:if test="${shopOrder.orderStatusFlag == 2}">--%>
 <%--                                    <font>部分退款</font>--%>
 <%--                                </c:if>--%>
-                                <c:if test="${shopOrder.orderStatusFlag == 3}">
+                                <c:if test="${shopOrder.refundStatus == 3}">
                                     <font>已退款</font>
                                 </c:if>
                             </span>
@@ -1057,17 +1084,17 @@
                         </a>
                     </c:if>
                     </span>
-                    <c:if test="${order.organizeID != 4}">
-                        <span>折扣: ${op.discount}%</span>
-                        <span>折后单价:
-                        <c:if test="${op.productPromotion.mode eq 1}">
-                                    <label style="text-decoration: line-through"><fmt:formatNumber
-                                            value="${op.discountPrice}" type="currency"/></label></span>
-                        </c:if>
-                        <c:if test="${op.productPromotion.mode ne 1}">
-                            <fmt:formatNumber value="${op.discountPrice}" type="currency"/></span>
-                        </c:if>
-                    </c:if>
+<%--                    <c:if test="${order.organizeID != 4}">--%>
+<%--                        <span>折扣: ${op.discount}%</span>--%>
+<%--                        <span>折后单价:--%>
+<%--                        <c:if test="${op.productPromotion.mode eq 1}">--%>
+<%--                                    <label style="text-decoration: line-through"><fmt:formatNumber--%>
+<%--                                            value="${op.discountPrice}" type="currency"/></label></span>--%>
+<%--                        </c:if>--%>
+<%--                        <c:if test="${op.productPromotion.mode ne 1}">--%>
+<%--                            <fmt:formatNumber value="${op.discountPrice}" type="currency"/></span>--%>
+<%--                        </c:if>--%>
+<%--                    </c:if>--%>
                     <span>数量:  x${op.num}</span>
 
                     <br>
@@ -1161,7 +1188,7 @@
         </div>
     </div>
 
-    <c:if test="${order.organizeID == 4&& shopOrder.voucherVo ne null }">
+    <c:if test="${ shopOrder.voucherVo ne null }">
         <div class="order-rows">
 
             <label>线下支付凭证:</label>
@@ -1298,20 +1325,20 @@
 <%--</c:if>--%>
 <script type="text/javascript">
     (function () {
-        $('body').click(function (e) {
-            var target = $(e.target),
-                $block = $('.operation-block');
-            if (target.is('.operation-btn')) {
-                if ($block.css('display') === 'none') {
-                    $block.show();
-                } else {
-                    $block.hide();
-                }
-            }
-            if (!target.is('.operation-block') && !target.is('.operation-btn')) {
-                $block.hide();
-            }
-        });
+        // $('body').click(function (e) {
+        //     var target = $(e.target),
+        //         $block = $('.operation-block');
+        //     if (target.is('.operation-btn')) {
+        //         if ($block.css('display') === 'none') {
+        //             $block.show();
+        //         } else {
+        //             $block.hide();
+        //         }
+        //     }
+        //     if (!target.is('.operation-block') && !target.is('.operation-btn')) {
+        //         $block.hide();
+        //     }
+        // });
 
         $('.clauseId').each(function () {
             var self = $(this);
@@ -1333,6 +1360,16 @@
         })
     })();
 
+    function operation(shopOrderID) {
+        var operationBlok = $('.' + shopOrderID)
+        if (operationBlok.css('display') == 'none') {
+            $('.operation-block').hide()
+            operationBlok.show()
+        } else {
+            operationBlok.hide()
+        }
+    }
+
     function openClauseInfo(index) {
         var content = $("#clauseContent" + index).val();
         if (content == '') {

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp

@@ -359,7 +359,7 @@
                                                 name="info" ${product.storeStatus?'':'checked'}
                                                 value='${product.productID}'/></th>
                         <td><img src="${product.mainImage}" width="50px" height="50px"></td>
-                        <td>${product.name}</td>
+                        <td>${product.skuId}${product.name}</td>
                         <td>${product.shopName}</td>
                         <td>${product.price}</td>
                         <td>