zhijiezhao 1 年間 前
コミット
462a3ae6f7

+ 169 - 21
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -968,6 +968,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         newOrderDao.insertShortLink(markId, shortLink, url);
         return shortLink;
     }
+
     @Transactional(readOnly = false)
     public boolean getSendSms(int markId, String mobile, String content) throws Exception {
         String config = Global.getConfig("cm.config");
@@ -1456,8 +1457,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                      */
                     if ((1161 != shopOrder.getShopID() && 2 != shopOrder.getOrderType() && !flag &&
                             (!"E1807059160".equals(shopOrder.getSplitCode()) && null != discernPayWay && 1 != discernPayWay))) {
-                                // 订单下线收款, 付款状态与收款状态同步显示
-                                shopOrder.setPayStatus(shopOrder.getReceiptStatus());
+                        // 订单下线收款, 付款状态与收款状态同步显示
+                        shopOrder.setPayStatus(shopOrder.getReceiptStatus());
                     }
                     // 订单已收款才会出现抹平或者多收退余额,(已收再退款或者撤销退款订单即使存在抹平也需要当未抹平重新计算付款)
                     String receiptStatus = shopOrder.getReceiptStatus();
@@ -1774,25 +1775,6 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             int userBeans = user.getUserBeans() + order.getUserBeans();
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
-
-//        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
-//            //查本单是否扣豆子,有就返回
-//            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
-//            if (bean != null) {
-//                //有扣豆子记录
-//                UserBeansHistory beansHistory = new UserBeansHistory();
-//                beansHistory.setUserId(order.getUserID());
-//                beansHistory.setOrderId(order.getOrderID());
-//                beansHistory.setBeansType(16);
-//                beansHistory.setType(1);
-//                beansHistory.setNum(500);
-//                beansHistory.setPushStatus(0);
-//                beansHistory.setAddTime(new Date());
-//                newCmClubDao.insertBeansHistory(beansHistory);
-//                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
-//                cmUserDao.updateUserBeans(order.getUserID(), beans);
-//            }
-//        }
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String current = dateFormat.format(new Date());
         MessageCenter messageCenter = new MessageCenter();
@@ -2887,4 +2869,170 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
         return null;
     }
+
+    public void cancelShopOrder(NewShopOrder shopOrder) {
+        //余额退回原账户
+        CmUser user = cmUserDao.get(order.getUserID().toString());
+        if (order.getBalancePayFee() > 0) {
+            setBalance(user, order.getBalancePayFee(), order);
+            //取消收支记录
+            CmUserBalanceRecord cmUserBalanceRecord = new CmUserBalanceRecord();
+            cmUserBalanceRecord.setUserId(order.getUserID());
+            cmUserBalanceRecord.setOrderId(order.getOrderID());
+            cmUserBalanceRecord.setRemark("取消订单,余额记录无效-后台");
+            cmUserBalanceRecord.setDelFlag("1");
+            cmUserBalanceRecordService.updateBalanceRecord(cmUserBalanceRecord);
+        }
+        order.setStatus("6");//订单状态变成交易关闭 6
+        order.setCloseReason("后台手动关闭");//   订单取消原因
+        newOrderDao.updateStatus(order);
+        //二手订单取消订单,标记未售
+        if ("1".equals(order.getSecondHandOrderFlag())) {
+            List<NewOrderProduct> orderProducts = newOrderProductDao.findListByOrderID(orderID);
+            for (NewOrderProduct orderProduct : orderProducts) {
+                cmSecondHandDetailDao.updatSecondHnadBySold(orderProduct.getProductID());
+            }
+        }
+        //采美豆退回
+        if (order.getUserBeans() != null && order.getUserBeans() > 0) {
+            UserBeansHistory beansHistory = new UserBeansHistory();
+            beansHistory.setUserId(order.getUserID());
+            beansHistory.setOrderId(order.getOrderID());
+            beansHistory.setBeansType(9);
+            beansHistory.setType(1);
+            beansHistory.setNum(order.getUserBeans());
+            beansHistory.setPushStatus(0);
+            beansHistory.setAddTime(new Date());
+            newCmClubDao.insertBeansHistory(beansHistory);
+            int userBeans = user.getUserBeans() + order.getUserBeans();
+            cmUserDao.updateUserBeans(order.getUserID(), userBeans);
+        }
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String current = dateFormat.format(new Date());
+        MessageCenter messageCenter = new MessageCenter();
+        messageCenter.setShopId(null);
+        messageCenter.setClubId(order.getClubID());
+        messageCenter.setUserType(1);
+        messageCenter.setMessageType(1);
+        messageCenter.setOrderMessageType(4);
+        messageCenter.setContent("您的订单已成功取消!");
+        messageCenter.setOrderId(orderID);
+        messageCenter.setTime(current);
+        messageCenterDao.addMessageCenter(messageCenter);
+
+        //优惠券退回
+        if (order.getCouponAmount() > 0 && !"0".equals(order.getStatus())) {
+            CmCouponOrderRecord couponRecord = newOrderDao.findOrderCouponRecord(order.getOrderID());
+            if (couponRecord != null) {
+                CmCouponClub couponClub = cmCouponClubDao.get(couponRecord.getClubCouponId().toString());
+                couponClub.setOrderId(null);
+                couponClub.setReturnedId(0);
+                couponClub.setSource("3");
+                couponClub.setStatus("1");
+                couponClub.setCreateDate(new Date());
+                couponClub.setUseDate(null);
+                couponClub.setDelFlag("0");
+                cmCouponClubDao.insert(couponClub);
+            }
+        }
+
+
+
+
+        Date date = new Date();
+        String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+        String note = "【取消订单】";
+        // 余额退回原账户
+        if (null != shopOrder.getAccountAmount() && MathUtil.compare(shopOrder.getAccountAmount(), 0) > 0) {
+            CmUser user = cmUserDao.get(shopOrder.getUserID().toString());
+            double ableUserMoney = user.getAbleUserMoney();
+            double updateMoney = MathUtil.add(ableUserMoney, shopOrder.getAccountAmount()).doubleValue();
+            // 退回用户可用余额
+            orderClubMapper.updateAbleUserMoneyByUserId(updateMoney, shopOrder.getUserId());
+            log.info(note + ">>>>>>>>>>>可用余额退回原账户(update[user(ableUserMoney)])userId:" + shopOrder.getUserId() + ",shopOrderId:" + shopOrderId);
+            // 取消收支记录
+            BalanceRecordPo balanceRecord = new BalanceRecordPo();
+            balanceRecord.setUserId(shopOrder.getUserId());
+            balanceRecord.setShopOrderId(shopOrderId);
+            balanceRecord.setRemark("取消订单,余额记录无效");
+            balanceRecord.setDelFlag(1);
+            // 取消 余额收支记录
+            orderClubMapper.cancelBalanceRecord(balanceRecord);
+            log.info(note + ">>>>>>>>>>>>取消余额收支记录(update[cm_user_balance_record])shopOrderId:" + shopOrderId);
+        }
+        shopOrder.setStatus(4);
+        // 取消 订单
+        orderClubMapper.cancelMainShopOrder(shopOrder);
+        //二手订单取消订单, 二手商品标记未售
+        if (1 == shopOrder.getSecondHandOrderFlag()) {
+            List<OrderProductPo> orderProducts = orderClubMapper.getShopOrderProductList(shopOrderId);
+            orderProducts.forEach(product -> {
+                // 是否二手商品
+                boolean secondFlag = false;
+                if (null != product.getProductCategory() && 2 == product.getProductCategory()) {
+                    secondFlag = true;
+                }
+                // 二手仪器标记未售
+                if (secondFlag) {
+                    orderClubMapper.updateSecondStatus(product.getProductId(), 0);
+                }
+            });
+        }
+        // 子订单状态
+        List<Integer> shopOrderStatus = orderClubMapper.getShopOrderStatus(shopOrder.getOrderId());
+        boolean flag = false;
+        if (shopOrderStatus.stream().allMatch(s -> s == 4)) {
+            flag = true;
+        }
+        // 退回 采美豆
+        if (null != shopOrder.getUserBeans() && shopOrder.getUserBeans() > 0 && flag) {
+            UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
+            beansHistory.setUserId(shopOrder.getUserId());
+            beansHistory.setOrderId(shopOrder.getOrderId());
+            beansHistory.setBeansType(9);
+            beansHistory.setType(1);
+            beansHistory.setNum(shopOrder.getUserBeans());
+            beansHistory.setPushStatus(0);
+            beansHistory.setAddTime(date);
+            beansHistory.setDelFlag(0);
+            // 用户采美豆
+            Integer userBeans = baseMapper.getUserBeans(shopOrder.getUserId());
+            // 更新用户剩余采美豆数量
+            int beans = userBeans + beansHistory.getNum();
+            productService.updateUserBeans(beansHistory, beans, note);
+        }
+        // 客服确认注册机构,一天内取消有效
+        Integer clubStatus = baseMapper.getClubStatus(shopOrder.getUserId());
+        if (null != clubStatus && 94 == clubStatus) {
+            // 已冻结(客服确认机构)
+            // 查询最后的确认时间
+            Date confirmTime = baseMapper.getClubConfirmTime(shopOrder.getUserId());
+            if (confirmTime != null) {
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(confirmTime);
+                calendar.add(Calendar.DATE, 1);
+                if (calendar.getTime().compareTo(new Date()) > 0) {
+                    // 机构状态修改为:已确认(客服确认机构)
+                    baseMapper.updateUserClubStatus(93, shopOrder.getUserId());
+                    baseMapper.updateClubStatus(93, shopOrder.getUserId());
+                }
+            }
+        }
+        //优惠券退回
+        if (MathUtil.compare(shopOrder.getCouponAmount(), 0) > 0) {
+            CouponOrderRecordPo couponRecord = orderClubMapper.getOrderCouponRecord(shopOrder.getOrderId(), shopOrder.getCouponClubId());
+            if (couponRecord != null) {
+                orderClubMapper.deleteCouponClubById(couponRecord.getClubCouponId());
+                CouponClubPo couponClub = orderClubMapper.getCouponClubById(couponRecord.getClubCouponId());
+                couponClub.setOrderId(null);
+                couponClub.setReturnedId(0);
+                couponClub.setSource(3);
+                couponClub.setStatus("1");
+                couponClub.setCreateDate(new Date());
+                couponClub.setUseDate(null);
+                couponClub.setDelFlag("0");
+                orderClubMapper.insertCouponClub(couponClub);
+            }
+        }
+    }
 }

+ 16 - 1
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -8,11 +8,11 @@ import com.caimei.modules.order.dao.CmPayShopRecordDao;
 import com.caimei.modules.order.entity.*;
 import com.caimei.modules.order.service.CmChangePayShopProductService;
 import com.caimei.modules.order.service.CmChangePayShopRecondService;
+import com.caimei.modules.order.service.CmOrderRemarkService;
 import com.caimei.modules.order.service.NewShopOrderService;
 import com.caimei.modules.user.entity.CmUserOrganize;
 import com.caimei.modules.user.service.CmUserOrganizeService;
 import com.caimei.utils.MathUtil;
-import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
@@ -56,6 +56,8 @@ public class CmShopOrderController extends BaseController {
     private BpClauseService bpClauseService;
     @Resource
     private OrderInvoiceDao orderInvoiceDao;
+    @Resource
+    private CmOrderRemarkService cmOrderRemarkService;
 
     @ModelAttribute
     public NewShopOrder get(@RequestParam(required = false) String id) {
@@ -82,6 +84,19 @@ public class CmShopOrderController extends BaseController {
         if (null != orderInvoice) {
             newShopOrder.setOrderInvoice(orderInvoice);
         }
+        CmOrderRemark cmOrderRemark = new CmOrderRemark();
+        cmOrderRemark.setShopOrderID(newShopOrder.getShopOrderID());
+        List<CmOrderRemark> remarksList = cmOrderRemarkService.findList(cmOrderRemark);
+        if (!org.springframework.util.CollectionUtils.isEmpty(remarksList)) {
+            for (CmOrderRemark cor : remarksList) {
+                String id = cor.getId();
+                List<CmOrderRemarkImage> remarkImgList = cmOrderRemarkService.findRemarkImgList(id);
+                cor.setCmOrderRemarkImageList(remarkImgList);
+                List<CmOrderRemarkFile> remarkFileList = cmOrderRemarkService.findRemarkFile(id);
+                cor.setRemarkFileList(remarkFileList);
+            }
+        }
+        model.addAttribute("remarksList", remarksList);
         return "modules/order/shopOrderDetail";
     }
 

+ 14 - 0
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -746,6 +746,20 @@ public class NewOrderController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
     }
 
+    @RequiresPermissions("order:order:edit")
+    @RequestMapping("cancelShopOrder")
+    public String cancelShopOrder(Integer shopOrderId, RedirectAttributes redirectAttributes) {
+        NewShopOrder shopOrder = newShopOrderDao.get(shopOrderId.toString());
+        boolean cancelFlag = (null != shopOrder && (0 == shopOrder.getStatus() || (1 == shopOrder.getStatus() && "1".equals(shopOrder.getReceiptStatus()))));
+        if (!cancelFlag) {
+            // 非待确认(或待收待发)订单
+            addMessage(redirectAttributes, "订单状态不符");
+            return "redirect:" + Global.getAdminPath() + "/shopOrder/detail/?id=" + shopOrderId;
+        }
+        newOrderService.cancelShopOrder(shopOrder);
+        addMessage(redirectAttributes, "取消订单成功");
+        return "redirect:" + Global.getAdminPath() + "/shopOrder/detail/?id=" + shopOrderId;
+    }
 
     /**
      * 确认收货

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

@@ -117,17 +117,17 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-		<c:if test="${source eq 1 or empty source}">
-            <c:if test="${orderType eq 2}">
-                <li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>
-            </c:if>
-            <c:if test="${orderType ne 2}">
-                <li><a href="${ctx}/order/orderList">订单列表</a></li>
-            </c:if>
-		</c:if>
-		<c:if test="${source eq 2}">
-			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>
-		</c:if>
+<%--		<c:if test="${source eq 1 or empty source}">--%>
+<%--            <c:if test="${orderType eq 2}">--%>
+<%--                <li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>--%>
+<%--            </c:if>--%>
+<%--            <c:if test="${orderType ne 2}">--%>
+<%--                <li><a href="${ctx}/order/orderList">订单列表</a></li>--%>
+<%--            </c:if>--%>
+<%--		</c:if>--%>
+<%--		<c:if test="${source eq 2}">--%>
+<%--			<li><a href="${ctx}/order/detail?id=${orderID}">订单详情</a></li>--%>
+<%--		</c:if>--%>
 		<li><a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">订单备注</a></li>
 		<li  class="active"><a href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${orderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
 	</ul><br/>

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

@@ -27,17 +27,17 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<c:if test="${source eq 1 or empty source}">
-			<c:if test="${orderType eq 2}">
-				<li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>
-			</c:if>
-			<c:if test="${orderType ne 2}">
-				<li><a href="${ctx}/order/orderList">订单列表</a></li>
-			</c:if>
-		</c:if>
-		<c:if test="${source eq 2}">
-			<li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/order/detail?id=${orderID}">订单详情</a></li>
-		</c:if>
+<%--		<c:if test="${source eq 1 or empty source}">--%>
+<%--			<c:if test="${orderType eq 2}">--%>
+<%--				<li><a href="${ctx}/hehe/new/order/orderList">订单列表</a></li>--%>
+<%--			</c:if>--%>
+<%--			<c:if test="${orderType ne 2}">--%>
+<%--				<li><a href="${ctx}/order/orderList">订单列表</a></li>--%>
+<%--			</c:if>--%>
+<%--		</c:if>--%>
+<%--		<c:if test="${source eq 2}">--%>
+<%--			<li><a href="${ctx}${orderType == 2 ?'/hehe/new':''}/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}&shopOrderID=${shopOrderID}&source=${source}&orderType=${orderType}">添加订单备注</a></li>
 	</ul><br/>

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

@@ -256,7 +256,7 @@
                                        value="${product.cmCostPrice}"/></td>
                             <td width="20%">
                                 <c:choose>
-                                    <c:when test="${product.includedTax ne '' and product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2}">
+                                    <c:when test="${product.includedTax ne '' and ((product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2) or product.includedTax eq 1 )}">
                                         <label style="text-align: center">-----</label>
                                     </c:when>
                                     <c:otherwise>

+ 189 - 51
src/main/webapp/WEB-INF/views/modules/order/shopOrderDetail.jsp

@@ -367,6 +367,31 @@
             color: red
         }
 
+        .remarks {
+            border: 1px solid black;
+            position: fixed;
+            top: 15%; /* 距离顶部的距离 */
+            left: 20%; /* 距离左侧的距离 */
+            right: 20%;
+            padding: 10px;
+            background-color: white;
+            display: none;
+        }
+
+        .remarkButton {
+            position: absolute;
+            left: 0px;
+            top: 50%;
+            background-color: lightblue;
+        }
+
+        .remarkShow {
+            position: fixed;
+            right: 0px;
+            top: 50%;
+            background-color: lightblue;
+        }
+
         .weishaIcon {
             background: darkorange;
             color: white;
@@ -392,6 +417,17 @@
             float: none;
             margin-left: 3px;
         }
+
+        .jumpRemark {
+            text-decoration: none;
+            color: white;
+        }
+
+        #addButton {
+            position: absolute;
+            right: 1%;
+            top: 10%;
+        }
     </style>
     <script type="text/javascript" src="${ctxStatic}/QRCode/jquery.qrcode.min.js"></script>
     <script type="text/javascript" src="static/common/clipboard.min.js"></script>
@@ -526,7 +562,11 @@
                         <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">发货记录</a>
                         <a href="${ctx}/bulkpurchase/cmRefundsProduct/toShopOrderRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}&from=2">收付款记录</a>
                         <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByShopOrder.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">退款(退货)记录</a>
-                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&shopOrderID=${order.shopOrderID}">订单备注</a>
+                        <c:if test="${order.status == 0}">
+                            <a href="${ctx}/order/cancelOrder?orderID=${order.orderID}"
+                               onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
+                        </c:if>
+<%--                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2&shopOrderID=${order.shopOrderID}">订单备注</a>--%>
                     </shiro:hasPermission>
                 </div>
             </div>
@@ -536,7 +576,77 @@
 
 </table>
 <textarea id="copyValue" style="display: none"></textarea>
-
+<div class="remarks">
+    <div class="remarkButton">
+        订单备注
+        <a onclick="hideRemarks();">收起</a>
+    </div>
+    <button id="addButton" class="btn btn-primary" onclick="">
+        添加备注
+        <%--        <a class="jumpRemark"--%>
+        <%--           href="${ctx}/order/cmOrderRemark/toAddRemarksViewNew.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}&orderType=${order.orderType}">添加备注</a>--%>
+    </button>
+    <c:if test="${not empty remarksList}">
+        <div style="overflow-x: hidden;word-break:break-all">
+            <c:forEach items="${remarksList}" var="list" varStatus="remark">
+                <div class="td clear">
+                    <div style="font-weight: bold;width: 100%;float: left;">
+                        <span style="float: left;">${list.sysUserName}[${list.no}]</span>
+                        <span style="float: left;margin-left:10px;"><fmt:formatDate value="${list.createDate}"
+                                                                                    pattern="yyyy-MM-dd HH:mm"/></span>
+                    </div>
+                    <div class="td-text" style="width: 100%;float: left;margin-top: 20px;">
+                        <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">
+                            备注内容:
+                        </div>
+                        <div style="width: 1000px;float: left;margin: 10px 0;">
+                                ${list.remarks}
+                        </div>
+                    </div>
+                    <div class="td-text"
+                         style="width: 100%;float: left;margin-top: 20px;border-bottom:1px dashed #999999;padding: 10px 0;">
+                        <c:if test="${not empty list.cmOrderRemarkImageList}">
+                            <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">
+                                图片:
+                            </div>
+                            <div style="width: 1000px;float: left;">
+                                <c:forEach items="${list.cmOrderRemarkImageList}" var="remarkImageList"
+                                           varStatus="remarkImage">
+                                    <a href="${remarkImageList.remarkImage}" target="_blank">
+                                        <img class="enlarge-pic" style="height: 150px;width: 150px;margin-top: 10px"
+                                             src="${remarkImageList.remarkImage}">&nbsp;
+                                    </a>
+                                </c:forEach>
+                            </div>
+                        </c:if>
+                    </div>
+                    <div class="td-text"
+                         style="width: 100%;float: left;margin-top: 20px;border-bottom:1px dashed #999999;padding: 10px 0;">
+                        <c:if test="${not empty list.remarkFileList}">
+                            <div style="width: 100px;font-weight: bold;margin: 10px 0;float: left;text-align: right;margin-right: 10px;">
+                                文件:
+                            </div>
+                            <div style="width: 1000px;float: left;margin: 10px 0;">
+                                <c:forEach items="${list.remarkFileList}" var="item" varStatus="remarkFile">
+                                    <p>${item.name}&nbsp;&nbsp;&nbsp;&nbsp;<a
+                                            href="${ctx}/order/cmOrderRemark/downFile?fileId=${item.id}">下载</a></p>
+                                </c:forEach>
+                            </div>
+                        </c:if>
+                    </div>
+                </div>
+            </c:forEach>
+        </div>
+    </c:if>
+    <c:if test="${empty remarksList}">
+        <font size="3" style="text-align: center;display: block;line-height: 80px;" color="#0066CC">暂无备注信息,有需要请您前往添加订单备注。</font>
+    </c:if>
+</div>
+<div class="remarkShow">
+    订单备注
+<%--    <a onclick="showRemark();">展开</a>--%>
+    <a onclick="openRemarks(${order.orderID},${order.shopOrderID})">展开</a>
+</div>
 <div class="order-rows">
     <tr>
         <span><label>子订单状态:</label>${fns:getDictLabel(order.status,"shopStatus","" )}</span>
@@ -846,38 +956,38 @@
 <c:if test="${order.organizeID != 4}">
     <div class="order-rows">
         <label>订单对机构是否可见:</label>
-                    <c:if test="${order.orderSeen eq 1}">
-                        <label>可见</label>
-                    </c:if>
-                    <c:if test="${order.orderSeen eq 2}">
-                        <label>不可见</label>
-                    </c:if>
-                    <c:if test="${order.orderSeen ne 1 and order.orderSeen ne 2}">
-                        <label>未定义</label>
-                    </c:if>
+        <c:if test="${order.orderSeen eq 1}">
+            <label>可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen eq 2}">
+            <label>不可见</label>
+        </c:if>
+        <c:if test="${order.orderSeen ne 1 and order.orderSeen ne 2}">
+            <label>未定义</label>
+        </c:if>
     </div>
 </c:if>
 <div class="order-rows">
     <label>发票信息:</label>
-        <c:if test="${order.orderInvoice.type eq 0}">
-            <%--            <input name="invoice" type="radio" checked="checked">--%>
-            <label>不需要发票</label>
-        </c:if>
-        <c:if test="${order.orderInvoice.type eq 1}">
-            <%--            <input name="invoice" type="radio" checked="checked">--%>
-            <label>增值税普通发票</label>
-        </c:if>
-        <c:if test="${order.orderInvoice.type eq 2}">
-            <%--            <input name="invoice" type="radio" checked="checked">--%>
-            <label>增值税专用发票</label>
-        </c:if>
-        <c:if test="${order.orderInvoice.type eq null}">
-            <%--            <input name="invoice" type="radio" checked="checked">--%>
-            <label>不需要发票</label>
-        </c:if>
-        <c:if test="${order.orderInvoice.type == 1}">
-            <br>
-            <div>
+    <c:if test="${order.orderInvoice.type eq 0}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>不需要发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq 1}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>增值税普通发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq 2}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>增值税专用发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type eq null}">
+        <%--            <input name="invoice" type="radio" checked="checked">--%>
+        <label>不需要发票</label>
+    </c:if>
+    <c:if test="${order.orderInvoice.type == 1}">
+        <br>
+        <div>
                     <span>
                         <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
                             个人抬头:
@@ -891,43 +1001,63 @@
                             <span>${order.orderInvoice.corporationTaxNum}</span>
                         </c:if>
                     </span>
-            </div>
-        </c:if>
-        <c:if test="${order.orderInvoice.type == 2}">
-            <table>
-                <tr>
-                    <td><span>单位名称:${order.orderInvoice.invoiceTitle}</span></td>
-                    <td><span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span></td>
-                    <td><span>注册地址:${order.orderInvoice.registeredAddress}</span></td>
-                </tr>
-                <tr>
-                    <td><span>注册电话:${order.orderInvoice.registeredPhone}</span></td>
-                    <td><span>开户银行:${order.orderInvoice.openBank}</span></td>
-                    <td><span>银行账号:${order.orderInvoice.bankAccountNo}</span></td>
-                </tr>
-            </table>
-        </c:if>
+        </div>
+    </c:if>
+    <c:if test="${order.orderInvoice.type == 2}">
+        <table>
+            <tr>
+                <td><span>单位名称:${order.orderInvoice.invoiceTitle}</span></td>
+                <td><span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span></td>
+                <td><span>注册地址:${order.orderInvoice.registeredAddress}</span></td>
+            </tr>
+            <tr>
+                <td><span>注册电话:${order.orderInvoice.registeredPhone}</span></td>
+                <td><span>开户银行:${order.orderInvoice.openBank}</span></td>
+                <td><span>银行账号:${order.orderInvoice.bankAccountNo}</span></td>
+            </tr>
+        </table>
+    </c:if>
 </div>
 <c:if test="${order.organizeID != 4}">
     <div class="order-rows">
         <label>售后条款:</label>
-                    <c:forEach items="${bpClauses}" var="items" varStatus="index">
-                        <c:if test="${items.clauseType ne 0  }">
+        <c:forEach items="${bpClauses}" var="items" varStatus="index">
+            <c:if test="${items.clauseType ne 0  }">
                             <span>
                                 <input id="clauseId${index.index+1}" class="clauseId" name="clauseID" type="radio"
                                        value="${items.id}"${(order.clauseID)==(items.id)?'checked="checked"':''}
                                        class="required" class="clauseId" disabled="disabled">
                                 <input type="hidden" class="clauseContent" id="clauseContent${index.index+1}"
                                        value="${fns:escapeHtml(items.content)}">
-                                <input type="hidden" class="clauseName" id="clauseName${index.index+1}" value="${items.name}">
+                                <input type="hidden" class="clauseName" id="clauseName${index.index+1}"
+                                       value="${items.name}">
                                 <a href="javascript:void(0);"
                                    onclick="openClauseInfo(${index.index+1});"><label>${items.name}</label></a>
                             </span>
-                        </c:if>
-                    </c:forEach>
+            </c:if>
+        </c:forEach>
     </div>
 </c:if>
 <script type="text/javascript">
+
+    function openRemarks(orderId, shopOrderId) {
+        top.$.jBox("iframe:${ctx}/order/cmOrderRemark/remarksViewNew?orderID=" + orderId + "&shopOrderID=" + shopOrderId, {
+            iframeScrolling: 'yes',
+            top: 100,
+            width: 1200,
+            height: 800,
+            persistent: true,
+            title: "订单备注",
+            buttons: {"收起": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                return true;
+            }, closed: function () {/* 窗口关闭后执行的函数 */}
+        });
+    }
+
     (function () {
 
         $('.clauseId').each(function () {
@@ -960,6 +1090,14 @@
         }
     }
 
+    function showRemark() {
+        $(".remarks").show();
+    }
+
+    function hideRemarks() {
+        $(".remarks").hide();
+    }
+
     function openClauseInfo(index) {
         var content = $("#clauseContent" + index).val();
         if (content == '') {