Browse Source

6月小版本

Duan_xu 2 năm trước cách đây
mục cha
commit
325ee017f3

+ 11 - 0
src/main/java/com/caimei/modules/newhome/dao/NewPageFloorDao.java

@@ -3,6 +3,7 @@ package com.caimei.modules.newhome.dao;
 import com.caimei.modules.newhome.entity.NewPageFloor;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
+import com.caimei.modules.product.entity.Product;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
@@ -21,6 +22,16 @@ public interface NewPageFloorDao extends CrudDao<NewPageFloor> {
 
     void saveSort(@Param("sort") String sort, @Param("id") String id);
 
+    void savesortIndex(@Param("sortIndex") String sortIndex, @Param("productID") String productID);
+
+    void updateshowTime(Product product);
+
+    void updatshowFlag(Product product);
+
+    void updatrecommend(Product product);
+
+    Integer countrecommend();
+
     NewPageFloorContent findFloorContentByfloorId(Integer floorId);
 
     List<NewPageFloorImage> findFloorImage(Integer floorId);

+ 23 - 0
src/main/java/com/caimei/modules/newhome/service/NewPageFloorService.java

@@ -6,6 +6,7 @@ import com.caimei.modules.newhome.dao.NewPageFloorDao;
 import com.caimei.modules.newhome.entity.NewPageFloor;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
+import com.caimei.modules.product.entity.Product;
 import com.caimei.utils.AppUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
@@ -66,6 +67,28 @@ public class NewPageFloorService extends CrudService<NewPageFloorDao, NewPageFlo
         newPageFloorDao.saveSort(sort, id);
     }
 
+    @Transactional(readOnly = false)
+    public void savesortIndex(String sortIndex, String productID) {
+        newPageFloorDao.savesortIndex(sortIndex, productID);
+    }
+
+    @Transactional(readOnly = false)
+    public void updateshowTime(Product product) {
+        newPageFloorDao.updateshowTime(product);
+    }
+    @Transactional(readOnly = false)
+    public void updatshowFlag(Product product) {
+        newPageFloorDao.updatshowFlag(product);
+    }
+    @Transactional(readOnly = false)
+    public void updatrecommend(Product product) {
+        newPageFloorDao.updatrecommend(product);
+    }
+
+    public Integer countrecommend(){
+       return newPageFloorDao.countrecommend();
+    }
+
     public NewPageFloorContent findFloorContent(Integer floorId) {
         NewPageFloorContent floorContent = newPageFloorDao.findFloorContentByfloorId(floorId);
         List<NewPageFloorImage> floorImageList = newPageFloorDao.findFloorImage(floorId);

+ 99 - 1
src/main/java/com/caimei/modules/newhome/web/NewPageFloorController.java

@@ -28,6 +28,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -158,9 +161,13 @@ public class NewPageFloorController extends BaseController {
     }
 
     @RequestMapping(value = "ContentPage")
-    public String ContentPage(NewPageFloor newPageFloor,Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
+    public String ContentPage(NewPageFloor newPageFloor,Product product, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception{
         Page<Product> list =productService.newfindProductImage(new Page<Product>(request, response),product);
+        Integer count= newPageFloorService.countrecommend();
+        model.addAttribute("count",count);
         model.addAttribute("page", list);
+        model.addAttribute("date", new Date());
+//        model.addAttribute("addtime", pro.getAddTime());
         return "modules/newhome/newFloorcontentForm";
     }
 
@@ -207,6 +214,48 @@ public class NewPageFloorController extends BaseController {
         }
     }
 
+
+    @RequestMapping(value = "batchSavesortIndex")
+    @ResponseBody
+    public Map<String, Object> batchSavesortIndex(String sortList) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            String[] newPageLists = sortList.split(",");
+            for (String list : newPageLists) {
+                String[] split = list.split("-");
+                if (split.length == 1 || split.length < 1) {
+                    String id = split[0];
+                    String sortIndex = null;
+                    newPageFloorService.savesortIndex(sortIndex, id);
+                } else {
+                    String id = split[0];
+                    String sortIndex = split[1];
+                    if (isInteger(sortIndex)) {
+                        if (StringUtils.equals("0", sortIndex)) {
+                            map.put("success", false);
+                            map.put("msg", "排序值只能填写大于等于1的整数");
+                            return map;
+                        }
+                        newPageFloorService.savesortIndex(sortIndex, id);
+                    } else {
+                        map.put("success", false);
+                        map.put("msg", "排序值只能为数字");
+                        return map;
+                    }
+                }
+            }
+            cleanRedisCache();
+            map.put("success", true);
+            map.put("msg", "更新排序成功");
+            return map;
+        } catch (Exception e) {
+            map.put("success", false);
+            map.put("msg", "更新排序失败");
+            return map;
+        }
+    }
+
+
     /**
      * 添加商品
      */
@@ -375,4 +424,53 @@ public class NewPageFloorController extends BaseController {
         generateUtils.generateHome();
 
     }
+
+    @RequestMapping(value = "updatshowFlag")
+    public String updatshowFlag(Product product) {
+        int num=0;
+        int nums=0;
+if(product.getNewshowTime() !=null && product.getNewshowTime()!=""){
+    num= new Date(product.getShowTime()).compareTo(new Date(product.getNewshowTime()));
+    if(num==-1){
+        product.setShowFlag(2);
+    }
+}else if (product.getAddTime()!=null && product.getAddTime()!=""){
+    nums= new Date(product.getShowTime()).compareTo(new Date(product.getAddTime()));
+    if ( nums==-1){
+        product.setShowFlag(2);
+    }
+}
+        newPageFloorService.updatshowFlag(product);
+        return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
+    @RequestMapping(value = "updateshowTime")
+    public String updateshowTime(Product product) {
+        newPageFloorService.updateshowTime(product);
+        int num=0;
+        int nums=0;
+        if(product.getNewshowTime() !=null && product.getNewshowTime()!=""){
+            num= new Date(product.getShowTime()).compareTo(new Date(product.getNewshowTime()));
+            if(num>0){
+                product.setShowFlag(1);
+            }
+        }else if (product.getAddTime()!=null && product.getAddTime()!=""){
+            nums= new Date(product.getShowTime()).compareTo(new Date(product.getAddTime()));
+            if ( nums>0){
+                product.setShowFlag(1);
+            }
+        }
+        newPageFloorService.updatshowFlag(product);
+
+    return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
+    @RequestMapping("/addrecommend")
+    public String addrecommend(Product product, Model model) {
+
+            newPageFloorService.updatrecommend(product);
+
+        return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
 }

+ 2 - 0
src/main/java/com/caimei/modules/product/dao/ProductDao.java

@@ -175,6 +175,8 @@ public interface ProductDao extends CrudDao<Product> {
 
     List<Product> newfindProductImage(Product product);
 
+    Product productList(Product product);
+
     void insertProductDetailInfo(ProductDetailInfo productDetailInfo);
 
     String findProductDetail(Integer productID);

+ 17 - 11
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -7,6 +7,7 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
 
 import java.beans.Transient;
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -236,7 +237,9 @@ public class Product extends DataEntity<Product> {
 
     private Integer showFlag;
 
-    private Date showTime;
+    private String showTime;
+
+    private String newshowTime;
 
     //1.重点推荐
     private Integer recommend;
@@ -249,15 +252,25 @@ public class Product extends DataEntity<Product> {
     public void setShowFlag(Integer showFlag) {
         this.showFlag = showFlag;
     }
-
-    public Date getShowTime() {
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public String getShowTime() {
         return showTime;
     }
 
-    public void setShowTime(Date showTime) {
+    public void setShowTime(String showTime) {
         this.showTime = showTime;
     }
 
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public String getNewshowTime() {
+        return newshowTime;
+    }
+
+    public void setNewshowTime(String newshowTime) {
+        this.newshowTime = newshowTime;
+    }
+
     public Integer getRecommend() {
         return recommend;
     }
@@ -579,13 +592,6 @@ public class Product extends DataEntity<Product> {
         this.priceFlag = priceFlag;
     }
 
-    public String getbeautyActFlag() {
-        return beautyActFlag;
-    }
-
-    public void setbeautyActFlag(String beautyActFlag) {
-        this.beautyActFlag = beautyActFlag;
-    }
 
     public String getLadderPriceFlag() {
         return ladderPriceFlag;

+ 2 - 1
src/main/java/com/caimei/modules/product/service/ProductNewService.java

@@ -201,12 +201,13 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         }
     }
 
-    public void auditProduct(String validFlag,Integer newvalidFlag, String beforeValidFlag, Integer productID) {
+    public void auditProduct(String validFlag,Integer newvalidFlag,String showtime, String beforeValidFlag, Integer productID) throws Exception{
         Product product = new Product();
         product.setProductID(productID);
         product.setValidFlag(validFlag);
         product.setBeforeValidFlag(beforeValidFlag);
         product.setNewvalidFlag(newvalidFlag);
+        product.setShowTime(showtime);
         productNewDao.updateByPrimaryKeySelective(product);
     }
 

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

@@ -550,12 +550,18 @@ public class ProductService extends CrudService<ProductDao, Product> {
         return productPage;
     }
 
-    public Page<Product> newfindProductImage(Page<Product> Page, Product product) {
+    public Page<Product> newfindProductImage(Page<Product> page, Product product) {
         List<Product> productList = productDao.newfindProductImage(product);
-        Page.setList(productList);
-        return Page;
+        product.setPage(page);
+        page.setList(productList);
+        return page;
    }
 
+    public Product productList(Product product){
+
+        return productDao.productList(product);
+    }
+
     public String findProductDetail(Integer productID) {
         return productDao.findProductDetail(productID);
     }

+ 4 - 4
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -831,7 +831,7 @@ public class ProductNewController extends BaseController {
 
     @RequestMapping("auditProduct")
     @ResponseBody
-    public Map<String, Object> auditProduct(String validFlag,Integer newvalidFlag, Integer productID, String remarks) {
+    public Map<String, Object> auditProduct(String validFlag,Integer newvalidFlag,String showtime, Integer productID, String remarks) {
         Map<String, Object> map = Maps.newLinkedHashMap();
         try {
             if (StringUtils.isBlank(validFlag) || null == productID) {
@@ -863,7 +863,7 @@ public class ProductNewController extends BaseController {
                     validFlag = "2";
                 }
             }
-            productNewService.auditProduct(validFlag,newvalidFlag, beforeValidFlag, productID);
+            productNewService.auditProduct(validFlag,newvalidFlag,showtime, beforeValidFlag, productID);
             map.put("success", true);
             map.put("msg", "操作成功");
             int valid = new Integer(validFlag);
@@ -898,7 +898,7 @@ public class ProductNewController extends BaseController {
             if (null == validFlag || "".equals(validFlag) || null == productID) {
                 throw new Exception("参数错误!");
             }
-            productNewService.auditProduct(validFlag,null,null, productID);
+            productNewService.auditProduct(validFlag,null,null,null, productID);
             map.put("success", true);
             map.put("msg", "操作成功");
             // 更新二手商品上架信息
@@ -956,7 +956,7 @@ public class ProductNewController extends BaseController {
 
             }
             // 更新商品库上下架状态
-            productNewService.auditProduct(validFlag,null, null, productId);
+            productNewService.auditProduct(validFlag,null, null,null, productId);
             map.put("success", true);
             cleanRedisCache();
         } catch (Exception e) {

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

@@ -167,6 +167,34 @@
 		WHERE id = #{id}
 	</update>
 
+	<update id="savesortIndex">
+		UPDATE product SET
+			sortIndex = #{sortIndex}
+		WHERE productID = #{productID}
+	</update>
+	<update id="updateshowTime">
+		UPDATE product SET
+			newshowTime=#{newshowTime},
+			showTime = #{showTime}
+		WHERE productID = #{productID}
+	</update>
+	<update id="updatshowFlag">
+		UPDATE product SET
+		showFlag=#{showFlag}
+		WHERE productID = #{productID}
+	</update>
+
+	<update id="updatrecommend">
+		UPDATE product SET
+			recommend=#{recommend}
+		WHERE productID = #{productID}
+	</update>
+
+	<select id="countrecommend" resultType="java.lang.Integer">
+		SELECT COUNT(recommend) FROM product
+		WHERE recommend=1
+	</select>
+
 	<select id="findFloorContentByfloorId" resultType="com.caimei.modules.newhome.entity.NewPageFloorContent">
 		SELECT
 		  npfc.*,

+ 49 - 0
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -90,6 +90,7 @@
         a.newvalidFlag,
         a.showFlag,
         a.showTime,
+        a.newshowTime,
         a.recommend
     </sql>
 
@@ -1905,6 +1906,54 @@
 			</otherwise>
 		</choose>
 	</select>
+
+	<select id="newfindProductImage" resultType="com.caimei.modules.product.entity.Product">
+		SELECT
+		<include refid="productColumns"/>
+		FROM product a
+		<include refid="productJoins"/>
+		<where>
+			<if test="productID !=null">
+				AND a.productID=#{productID}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE concat('%',#{name},'%')
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.name LIKE concat('%',#{shopName},'%')
+			</if>
+			<if test="showFlag !=null and showFlag !=''">
+				AND a.showFlag=#{showFlag}
+			</if>
+			<if test="ids != null and ids.size() > 0">
+				AND a.productID NOT IN
+				<foreach collection="ids" close=")" separator="," open="(" item="id">
+					#{id}
+				</foreach>
+			</if>
+		and a.newvalidFlag = 1
+
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+		</choose>
+			order by a.sortIndex desc
+	</select>
+
+	<select id="productList" resultType="com.caimei.modules.product.entity.Product">
+		SELECT
+		*
+		FROM product a
+		<where>
+		 a.newvalidFlag=1
+			<if test="productID !=null and productID !=''">
+		  and a.productID=#{productID}
+			</if>
+		</where>
+	</select>
+
 	<select id="findProductDetail" resultType="java.lang.String">
 		select productDetail from product where productID = #{productID}
 	</select>

+ 7 - 1
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -668,8 +668,14 @@
                 machineType = #{machineType},
             </if>
             <if test="commodityType != null and commodityType != ''">
-                commodityType = #{commodityType}
+                commodityType = #{commodityType},
             </if>
+            <if test="showTime!= '' and showTime!=null">
+                showTime=#{showTime},
+            </if>
+        <if test="newvalidFlag == 1">
+            showFlag=1
+        </if>
         </set>
         where productID = #{productID}
     </update>

+ 204 - 203
src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp

@@ -6,7 +6,7 @@
     <title>申请退款退货</title>
     <meta name="decorator" content="default"/>
     <style>
-         .form-horizontal .controls{margin-left:0}
+        .form-horizontal .controls{margin-left:0}
         #increase,#decrease,.lineNum{width:30px;height:30px}
         .lineNum{text-align:center}
         .dateInput input{width:150px}
@@ -26,7 +26,7 @@
         .upload-content .conList ol li{width:114px;min-height:80px;text-align:center;background:#fff;position:relative;top:120px}
         .hide-pic{display:none !important}
         .upload-tips{margin:10px 0}
-         .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
+        .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
     </style>
     <script type="text/javascript">
         $(document).ready(function () {
@@ -173,7 +173,7 @@
         }
 
         function showBankInfo() {
-                if (${!returnOnline}){
+            if (${!returnOnline}){
                 var obj = document.getElementsByClassName("refundOfflineFee"),
                     blockEle = $('.refund-details-block');
                 if(obj){
@@ -266,15 +266,15 @@
     <table id="contentTable" class="table table-striped table-bordered table-condensed">
         <tr>
             <td><b>退款编号:</b>
-                ${empty returnedNo?'':(returnedNo)}
+                    ${empty returnedNo?'':(returnedNo)}
             </td>
             <c:if test="${cmReturnedPurchase.refundType eq 1 or cmReturnedPurchase.refundType eq 2}">
-            <td><b>退款模式:</b>
-                <form:select path="refundType" class="input-medium" id="refundType" onchange="changeType()">
-                    <form:option value="1">按商品金额退款</form:option>
-                    <form:option value="2">自定义金额退款</form:option>
-                </form:select>
-            </td>
+                <td><b>退款模式:</b>
+                    <form:select path="refundType" class="input-medium" id="refundType" onchange="changeType()">
+                        <form:option value="1">按商品金额退款</form:option>
+                        <form:option value="2">自定义金额退款</form:option>
+                    </form:select>
+                </td>
             </c:if>
             <c:if test="${cmReturnedPurchase.refundType eq 3}">
                 <td><b>退款模式:</b>
@@ -287,12 +287,12 @@
                     ${returnTime}
             </td>
             <c:if test="${cmReturnedPurchase.refundType eq 1}">
-            <td id="spt"><b>申请金额:</b>
-                <span class="refundFee"><fmt:formatNumber value="${empty cmReturnedPurchase.refundFee?'0.00':(cmReturnedPurchase.refundFee)}" pattern="#0.00"/></span>元
-            </td>
-            <td id="zdy" hidden><b>申请金额:</b>
-                <from:input id="freeRefundFee" path="freeRefundFee" onkeyup="num(this)"   placeholder="¥0.00" value="${empty cmReturnedPurchase.freeRefundFee?'':(cmReturnedPurchase.freeRefundFee)}"></from:input>
-            </td>
+                <td id="spt"><b>申请金额:</b>
+                    <span class="refundFee"><fmt:formatNumber value="${empty cmReturnedPurchase.refundFee?'0.00':(cmReturnedPurchase.refundFee)}" pattern="#0.00"/></span>元
+                </td>
+                <td id="zdy" hidden><b>申请金额:</b>
+                    <from:input id="freeRefundFee" path="freeRefundFee" onkeyup="num(this)"   placeholder="¥0.00" value="${empty cmReturnedPurchase.freeRefundFee?'':(cmReturnedPurchase.freeRefundFee)}"></from:input>
+                </td>
             </c:if>
             <c:if test="${cmReturnedPurchase.refundType eq 2 or cmReturnedPurchase.refundType eq 3}">
                 <td id="spt" hidden><b>申请金额:</b>
@@ -339,11 +339,11 @@
                         <from:input path="refundOfflineFee" onkeyup="num(this)"   placeholder="¥0.00" value="${empty cmReturnedPurchase.refundOfflineFee?'':(cmReturnedPurchase.refundOfflineFee)}"></from:input>
                         <c:if test="${order.rechargeGoods ne 1 && order.rechargeGoods ne 2}">
                             <c:if test="${cmReturnedPurchase.refundBalanceFee>0}">
-                            <input class="check-item-review refundBalanceFee" checked type="checkbox"/>
+                                <input class="check-item-review refundBalanceFee" checked type="checkbox"/>
+                            </c:if>
+                            <c:if test="${empty cmReturnedPurchase.refundBalanceFee or cmReturnedPurchase.refundBalanceFee eq 0}">
+                                <input class="check-item-review refundBalanceFee" type="checkbox"/>
                             </c:if>
-                        <c:if test="${empty cmReturnedPurchase.refundBalanceFee or cmReturnedPurchase.refundBalanceFee eq 0}">
-                            <input class="check-item-review refundBalanceFee" type="checkbox"/>
-                        </c:if>
                             账户余额
                             <from:input path="refundBalanceFee" onkeyup="num(this)" placeholder="¥0.00" value="${empty cmReturnedPurchase.refundBalanceFee?'':(cmReturnedPurchase.refundBalanceFee)}"></from:input>
                         </c:if>
@@ -355,7 +355,7 @@
                         <from:input path="bankAccountName"  value="${empty cmReturnedPurchase.bankAccountName?'':(cmReturnedPurchase.bankAccountName)}"></from:input>
                         <font color="red">*</font>账号:
                         <from:input path="bankAccountNo"  value="${empty cmReturnedPurchase.bankAccountNo?'':(cmReturnedPurchase.bankAccountNo)}"></from:input>
-                        <%--<br>&nbsp;&nbsp;&nbsp;&nbsp;--%>
+                            <%--<br>&nbsp;&nbsp;&nbsp;&nbsp;--%>
                         <font color="red">*</font>开户行:
                         <from:input path="openBank"  value="${empty cmReturnedPurchase.openBank?'':(cmReturnedPurchase.openBank)}"></from:input>
                         <font color="red">*</font>账户类型:
@@ -515,199 +515,199 @@
         </tr>
         <tr>
             <td>
-            机构:${order.buyer}<c:if test="${order.organizeID == 3}"></c:if>
+                机构:${order.buyer}<c:if test="${order.organizeID == 3}"></c:if>
             </td>
             <td>
-            收货人:${order.bpOrderUserinfo.shouHuoRen}(${order.bpOrderUserinfo.mobile})
+                收货人:${order.bpOrderUserinfo.shouHuoRen}(${order.bpOrderUserinfo.mobile})
             </td>
             <td  colspan="2">
-            地址:${order.bpOrderUserinfo.province}${order.bpOrderUserinfo.city}${order.bpOrderUserinfo.town}${order.bpOrderUserinfo.address}
+                地址:${order.bpOrderUserinfo.province}${order.bpOrderUserinfo.city}${order.bpOrderUserinfo.town}${order.bpOrderUserinfo.address}
             </td>
         </tr>
     </table>
-        <c:forEach items="${order.newShopOrders}" var="shopOrder" varStatus="status">
-            <c:if test="${!shopOrder.defaultStatus}">
-                <table id="shopOrderTable${status.index}" class="table shopOrderTable table-striped table-bordered table-condensed">
-                    <thead></thead>
+    <c:forEach items="${order.newShopOrders}" var="shopOrder" varStatus="status">
+        <c:if test="${!shopOrder.defaultStatus}">
+            <table id="shopOrderTable${status.index}" class="table shopOrderTable table-striped table-bordered table-condensed">
+                <thead></thead>
+                <tr>
+                    <td style="width: 300px;">
+                        子订单号(ID):${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})
+                    </td>
+                    <td  style="width: 275px;">
+                        子订单金额:¥<fmt:formatNumber type="number" value="${shopOrder.totalAmount}" pattern="0.00" maxFractionDigits="2" />
+                    </td>
+                    <td>
+                        收款状态:${fns:getDictLabel(shopOrder.shopReceiptStatus,'receiptStatus' ,'' )}
+                    </td>
+                    <td>
+                        发货状态:${fns:getDictLabel(shopOrder.sendOutStatus,'sendOutStatus' ,'' )}
+                    </td>
+                    <td>
+                        付款状态:${fns:getDictLabel(shopOrder.payStatus,'payStatus' ,'' )}
+                    </td>
+                    <td>
+                        供应商:${shopOrder.shopName} &nbsp;&nbsp;
+                        <c:if test="${not empty shopOrder.commercialCode}">
+                            <font color="red" class="businessNumber">(商户号:&nbsp;&nbsp;${shopOrder.commercialCode})</font>
+                        </c:if>
+                    </td>
+                </tr>
+                <c:if test="${order.onlinePayFlag eq 0}">
                     <tr>
-                        <td style="width: 300px;">
-                            子订单号(ID):${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})
-                        </td>
-                        <td  style="width: 275px;">
-                            子订单金额:¥<fmt:formatNumber type="number" value="${shopOrder.totalAmount}" pattern="0.00" maxFractionDigits="2" />
-                        </td>
                         <td>
-                            收款状态:${fns:getDictLabel(shopOrder.shopReceiptStatus,'receiptStatus' ,'' )}
+                            商品总额:¥<fmt:formatNumber type="number" value="${shopOrder.needPayAmount}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         <td>
-                            发货状态:${fns:getDictLabel(shopOrder.sendOutStatus,'sendOutStatus' ,'' )}
+                            优惠:¥<fmt:formatNumber type="number" value="${shopOrder.eachDiscount}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         <td>
-                            付款状态:${fns:getDictLabel(shopOrder.payStatus,'payStatus' ,'' )}
+                            应付金额:¥<fmt:formatNumber type="number" value="${shopOrder.realPay}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         <td>
-                            供应商:${shopOrder.shopName} &nbsp;&nbsp;
-                            <c:if test="${not empty shopOrder.commercialCode}">
-                                <font color="red" class="businessNumber">(商户号:&nbsp;&nbsp;${shopOrder.commercialCode})</font>
-                            </c:if>
+                            已付金额:¥<fmt:formatNumber type="number" value="${shopOrder.receiptAmount}" pattern="0.00" maxFractionDigits="2" />
+                        </td>
+                        <td colspan="2">
+                            待付金额:¥<fmt:formatNumber type="number" value="${shopOrder.restAmount}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                     </tr>
-                    <c:if test="${order.onlinePayFlag eq 0}">
-                        <tr>
-                            <td>
-                                商品总额:¥<fmt:formatNumber type="number" value="${shopOrder.needPayAmount}" pattern="0.00" maxFractionDigits="2" />
-                            </td>
-                            <td>
-                                优惠:¥<fmt:formatNumber type="number" value="${shopOrder.eachDiscount}" pattern="0.00" maxFractionDigits="2" />
-                            </td>
-                            <td>
-                                应付金额:¥<fmt:formatNumber type="number" value="${shopOrder.realPay}" pattern="0.00" maxFractionDigits="2" />
-                            </td>
-                            <td>
-                                已付金额:¥<fmt:formatNumber type="number" value="${shopOrder.receiptAmount}" pattern="0.00" maxFractionDigits="2" />
-                            </td>
-                            <td colspan="2">
-                                待付金额:¥<fmt:formatNumber type="number" value="${shopOrder.restAmount}" pattern="0.00" maxFractionDigits="2" />
-                            </td>
-                        </tr>
-                    </c:if>
-                        <c:forEach items="${shopOrder.newOrderProducts}" var="newOrderProduct" varStatus="productStatus">
+                </c:if>
+                <c:forEach items="${shopOrder.newOrderProducts}" var="newOrderProduct" varStatus="productStatus">
                     <tr>
-                            <td colspan="5">
-                                <table id="newOrderProductTable" class="table table-striped table-bordered table-condensed">
-                                    <tr>
-                                        <td rowspan="4" style="width: 295px;height: 125px">
-                                            <img style="width: 100px;height: 100px" src="${newOrderProduct.image}">
-                                            <font title="${newOrderProduct.name}">${fns:abbr(newOrderProduct.name,30)}</font>
-                                        </td>
-                                        <td style="width: 275px;">
-                                            单价:¥<fmt:formatNumber type="number" value="${newOrderProduct.price}"  pattern="0.00" maxFractionDigits="2" />
-                                            <c:if test="${order.collageFlag eq 1}"><font color="red">(拼团价)</font></c:if>
-                                        </td>
-                                        <td >
-                                            折扣 :${newOrderProduct.discount}%
-                                        </td>
-                                        <td >
-                                            折后单价 :¥<span class="discountPrice"><fmt:formatNumber type="number" value="${newOrderProduct.discountPrice}" pattern="0.00" maxFractionDigits="2" /></span>
-                                        </td>
-                                        <td >
-                                            数量(赠品):${newOrderProduct.num}(${newOrderProduct.presentNum})
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td style="width: 275px;">
-                                            税率:${newOrderProduct.taxRate}%
-                                        </td>
-                                        <td>
-                                            税费:¥<span class="addedValueTax"><fmt:formatNumber type="number" value="${newOrderProduct.addedValueTax}" pattern="0.00" maxFractionDigits="2" /></span>
-                                        </td>
-                                        <td colspan="2">
-                                            总额:¥<fmt:formatNumber type="number" value="${newOrderProduct.shouldPayFee}"  pattern="0.00" maxFractionDigits="2" />
-                                        </td>
-                                    </tr>
-                                    <tr>
+                        <td colspan="5">
+                            <table id="newOrderProductTable" class="table table-striped table-bordered table-condensed">
+                                <tr>
+                                    <td rowspan="4" style="width: 295px;height: 125px">
+                                        <img style="width: 100px;height: 100px" src="${newOrderProduct.image}">
+                                        <font title="${newOrderProduct.name}">${fns:abbr(newOrderProduct.name,30)}</font>
+                                    </td>
+                                    <td style="width: 275px;">
+                                        单价:¥<fmt:formatNumber type="number" value="${newOrderProduct.price}"  pattern="0.00" maxFractionDigits="2" />
+                                        <c:if test="${order.collageFlag eq 1}"><font color="red">(拼团价)</font></c:if>
+                                    </td>
+                                    <td >
+                                        折扣 :${newOrderProduct.discount}%
+                                    </td>
+                                    <td >
+                                        折后单价 :¥<span class="discountPrice"><fmt:formatNumber type="number" value="${newOrderProduct.discountPrice}" pattern="0.00" maxFractionDigits="2" /></span>
+                                    </td>
+                                    <td >
+                                        数量(赠品):${newOrderProduct.num}(${newOrderProduct.presentNum})
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="width: 275px;">
+                                        税率:${newOrderProduct.taxRate}%
+                                    </td>
+                                    <td>
+                                        税费:¥<span class="addedValueTax"><fmt:formatNumber type="number" value="${newOrderProduct.addedValueTax}" pattern="0.00" maxFractionDigits="2" /></span>
+                                    </td>
+                                    <td colspan="2">
+                                        总额:¥<fmt:formatNumber type="number" value="${newOrderProduct.shouldPayFee}"  pattern="0.00" maxFractionDigits="2" />
+                                    </td>
+                                </tr>
+                                <tr>
                                         <%--已发货=商品数量-未出库数量--%>
-                                        <td><font color="red">已发货:<span id="shipped${status.index}${productStatus.index}">${newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore}</span></font></td>
-                                        <input type="hidden" id="returning${status.index}${productStatus.index}" value="${newOrderProduct.returningPurchaseProductNum}"/>
+                                    <td><font color="red">已发货:<span id="shipped${status.index}${productStatus.index}">${newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore}</span></font></td>
+                                    <input type="hidden" id="returning${status.index}${productStatus.index}" value="${newOrderProduct.returningPurchaseProductNum}"/>
                                         <%--已退货=所有退货数量总和--%>
-                                        <td><font color="red"><span>已退货:<span id="returned${status.index}${productStatus.index}">${newOrderProduct.returnedPurchaseProductNum}</span></span></font></td>
-                                        <td colspan="4"><font color="red"><span>本次退货:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} presentNum="${newOrderProduct.presentNum}" id="applicationReturnedNum${status.index}${productStatus.index}" class="refundGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationReturnedNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore -newOrderProduct.returnedPurchaseProductNum) }" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input tuihuo" type="text" onchange="setApplicationReturnedNum(${status.index},${productStatus.index})"></span></font></td>
-                                    </tr>
-                                    <tr>
+                                    <td><font color="red"><span>已退货:<span id="returned${status.index}${productStatus.index}">${newOrderProduct.returnedPurchaseProductNum}</span></span></font></td>
+                                    <td colspan="4"><font color="red"><span>本次退货:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} presentNum="${newOrderProduct.presentNum}" id="applicationReturnedNum${status.index}${productStatus.index}" class="refundGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationReturnedNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore -newOrderProduct.returnedPurchaseProductNum) }" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input tuihuo" type="text" onchange="setApplicationReturnedNum(${status.index},${productStatus.index})"></span></font></td>
+                                </tr>
+                                <tr>
                                         <%--待发货=未出库数量-取消数量--%>
-                                        <td><font color="red">待发货:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.notOutStore - newOrderProduct.cancelProductNum}</span></font></td>
+                                    <td><font color="red">待发货:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.notOutStore - newOrderProduct.cancelProductNum}</span></font></td>
                                         <%--已取消数量=所有已取消数量总和--%>
-                                        <td><font color="red">已取消:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.cancelProductNum}</span></font></td>
-                                        <td colspan="4"><font color="red"><span>本次取消:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} id="applicationCancelNum${status.index}${productStatus.index}" class="cancelGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationCancelNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.notOutStore - newOrderProduct.cancelProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input cancel" type="text" onchange="setApplicationCancelNum(${status.index},${productStatus.index})"></span></font></td>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopOrderID" value="${newOrderProduct.shopOrderID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].productID" value="${newOrderProduct.productID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].orderProductID" value="${newOrderProduct.orderProductID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopID" value="${newOrderProduct.shopID}"/>
-                                    </tr>
-                                </table>
-                            </td>
+                                    <td><font color="red">已取消:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.cancelProductNum}</span></font></td>
+                                    <td colspan="4"><font color="red"><span>本次取消:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} id="applicationCancelNum${status.index}${productStatus.index}" class="cancelGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationCancelNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.notOutStore - newOrderProduct.cancelProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input cancel" type="text" onchange="setApplicationCancelNum(${status.index},${productStatus.index})"></span></font></td>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopOrderID" value="${newOrderProduct.shopOrderID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].productID" value="${newOrderProduct.productID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].orderProductID" value="${newOrderProduct.orderProductID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopID" value="${newOrderProduct.shopID}"/>
+                                </tr>
+                            </table>
+                        </td>
                     </tr>
-                        </c:forEach>
+                </c:forEach>
 
 
-                </table>
-            </c:if>
-            <%--默认状态代码--%>
-            <c:if test="${shopOrder.defaultStatus}">
-                <table id="shopOrderTable${status.index}" class="table shopOrderTable table-striped table-bordered table-condensed">
-                    <thead></thead>
+            </table>
+        </c:if>
+        <%--默认状态代码--%>
+        <c:if test="${shopOrder.defaultStatus}">
+            <table id="shopOrderTable${status.index}" class="table shopOrderTable table-striped table-bordered table-condensed">
+                <thead></thead>
+                <tr>
+                    <td style="width: 300px;">
+                        子订单号(ID):${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})
+                    </td>
+                    <td  style="width: 275px;">
+                        子订单金额:¥<fmt:formatNumber type="number" value="${shopOrder.totalAmount}" pattern="0.00" maxFractionDigits="2" />
+                    </td>
+                    <td>
+                        发货状态:${fns:getDictLabel(shopOrder.sendOutStatus,'sendOutStatus' ,'' )}
+                    </td>
+                    <td>
+                        付款状态:${fns:getDictLabel(shopOrder.payStatus,'payStatus' ,'' )}
+                    </td>
+                    <td>
+                        供应商:${shopOrder.shopName}
+                    </td>
+                </tr>
+                <c:forEach items="${shopOrder.newOrderProducts}" var="newOrderProduct" varStatus="productStatus">
                     <tr>
-                        <td style="width: 300px;">
-                            子订单号(ID):${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})
-                        </td>
-                        <td  style="width: 275px;">
-                            子订单金额:¥<fmt:formatNumber type="number" value="${shopOrder.totalAmount}" pattern="0.00" maxFractionDigits="2" />
-                        </td>
-                        <td>
-                            发货状态:${fns:getDictLabel(shopOrder.sendOutStatus,'sendOutStatus' ,'' )}
-                        </td>
-                        <td>
-                            付款状态:${fns:getDictLabel(shopOrder.payStatus,'payStatus' ,'' )}
-                        </td>
-                        <td>
-                            供应商:${shopOrder.shopName}
+                        <td colspan="5">
+                            <table id="newOrderProductTable" class="table table-striped table-bordered table-condensed">
+                                <tr>
+                                    <td rowspan="4" style="width: 295px;height: 125px">
+                                        <img style="width: 100px;height: 100px" src="${newOrderProduct.image}">
+                                        <font title="${newOrderProduct.name}">${fns:abbr(newOrderProduct.name,30)}</font>
+                                    </td>
+                                    <td style="width: 275px;">
+                                        单价:¥<fmt:formatNumber type="number" value="${newOrderProduct.price}"  pattern="0.00" maxFractionDigits="2" />
+                                    </td>
+                                    <td>
+                                        折扣 :${newOrderProduct.discount}%
+                                    </td>
+                                    <td>
+                                        折后单价 :¥<span class="discountPrice"><fmt:formatNumber type="number" value="${newOrderProduct.discountPrice}" pattern="0.00" maxFractionDigits="2" /></span>
+                                    </td>
+                                    <td>
+                                        数量(赠品):${newOrderProduct.num}(${newOrderProduct.presentNum})
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td style="width: 275px;">
+                                        税率:${newOrderProduct.taxRate}%
+                                    </td>
+                                    <td>
+                                        税费:¥<span class="addedValueTax"><fmt:formatNumber type="number" value="${newOrderProduct.addedValueTax}" pattern="0.00" maxFractionDigits="2" /></span>
+                                    </td>
+                                    <td colspan="2">
+                                        总额:¥<fmt:formatNumber type="number" value="${newOrderProduct.shouldPayFee}"  pattern="0.00" maxFractionDigits="2" />
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td><font color="red">已发货:<span id="shipped${status.index}${productStatus.index}">${newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore}</span></font></td>
+                                    <input type="hidden" id="returning${status.index}${productStatus.index}" value="${newOrderProduct.returningPurchaseProductNum}"/>
+                                    <td><font color="red"><span>已退货:<span id="returned${status.index}${productStatus.index}">${newOrderProduct.returnedPurchaseProductNum}</span></span></font></td>
+                                    <td colspan="4"><font color="red"><span>本次退货:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} presentNum="${newOrderProduct.presentNum}" id="applicationReturnedNum${status.index}${productStatus.index}" class="refundGoodsInput1 shopOrderInput1 refundGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationReturnedNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore - newOrderProduct.returnedPurchaseProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input tuihuo" type="text" onchange="setApplicationReturnedNum(${status.index},${productStatus.index})"></span></font></td>
+                                </tr>
+                                <tr>
+                                    <td><font color="red">待发货:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.notOutStore - newOrderProduct.cancelProductNum}</span></font></td>
+                                    <td><font color="red">已取消:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.cancelProductNum}</span></font></td>
+                                    <td colspan="4"><font color="red"><span>本次取消:<input ${newOrderProduct.presentNum>0 or (order.onlinfePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} id="applicationCancelNum${status.index}${productStatus.index}" class="cancelGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationCancelNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.notOutStore - newOrderProduct.cancelProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input cancel" type="text" onchange="setApplicationCancelNum(${status.index},${productStatus.index})"></span></font></td>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopOrderID" value="${newOrderProduct.shopOrderID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].productID" value="${newOrderProduct.productID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].orderProductID" value="${newOrderProduct.orderProductID}"/>
+                                    <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopID" value="${newOrderProduct.shopID}"/>
+                                </tr>
+                            </table>
                         </td>
                     </tr>
-                    <c:forEach items="${shopOrder.newOrderProducts}" var="newOrderProduct" varStatus="productStatus">
-                        <tr>
-                            <td colspan="5">
-                                <table id="newOrderProductTable" class="table table-striped table-bordered table-condensed">
-                                    <tr>
-                                        <td rowspan="4" style="width: 295px;height: 125px">
-                                            <img style="width: 100px;height: 100px" src="${newOrderProduct.image}">
-                                            <font title="${newOrderProduct.name}">${fns:abbr(newOrderProduct.name,30)}</font>
-                                        </td>
-                                        <td style="width: 275px;">
-                                            单价:¥<fmt:formatNumber type="number" value="${newOrderProduct.price}"  pattern="0.00" maxFractionDigits="2" />
-                                        </td>
-                                        <td>
-                                            折扣 :${newOrderProduct.discount}%
-                                        </td>
-                                        <td>
-                                            折后单价 :¥<span class="discountPrice"><fmt:formatNumber type="number" value="${newOrderProduct.discountPrice}" pattern="0.00" maxFractionDigits="2" /></span>
-                                        </td>
-                                        <td>
-                                            数量(赠品):${newOrderProduct.num}(${newOrderProduct.presentNum})
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td style="width: 275px;">
-                                            税率:${newOrderProduct.taxRate}%
-                                        </td>
-                                        <td>
-                                            税费:¥<span class="addedValueTax"><fmt:formatNumber type="number" value="${newOrderProduct.addedValueTax}" pattern="0.00" maxFractionDigits="2" /></span>
-                                        </td>
-                                        <td colspan="2">
-                                            总额:¥<fmt:formatNumber type="number" value="${newOrderProduct.shouldPayFee}"  pattern="0.00" maxFractionDigits="2" />
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td><font color="red">已发货:<span id="shipped${status.index}${productStatus.index}">${newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore}</span></font></td>
-                                        <input type="hidden" id="returning${status.index}${productStatus.index}" value="${newOrderProduct.returningPurchaseProductNum}"/>
-                                        <td><font color="red"><span>已退货:<span id="returned${status.index}${productStatus.index}">${newOrderProduct.returnedPurchaseProductNum}</span></span></font></td>
-                                        <td colspan="4"><font color="red"><span>本次退货:<input ${newOrderProduct.presentNum>0 or (order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} presentNum="${newOrderProduct.presentNum}" id="applicationReturnedNum${status.index}${productStatus.index}" class="refundGoodsInput1 shopOrderInput1 refundGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationReturnedNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.num + newOrderProduct.presentNum - newOrderProduct.notOutStore - newOrderProduct.returnedPurchaseProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input tuihuo" type="text" onchange="setApplicationReturnedNum(${status.index},${productStatus.index})"></span></font></td>
-                                    </tr>
-                                    <tr>
-                                        <td><font color="red">待发货:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.notOutStore - newOrderProduct.cancelProductNum}</span></font></td>
-                                        <td><font color="red">已取消:<span id="toBeShipped${status.index}${productStatus.index}">${newOrderProduct.cancelProductNum}</span></font></td>
-                                        <td colspan="4"><font color="red"><span>本次取消:<input ${newOrderProduct.presentNum>0 or (order.onlinfePayFlag eq 0 and shopOrder.shopID eq 998)?"readonly":""} id="applicationCancelNum${status.index}${productStatus.index}" class="cancelGoodsInput shopOrderInput" name="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].applicationCancelNum" value="${(order.onlinePayFlag eq 0 and shopOrder.shopID eq 998)?0:(newOrderProduct.notOutStore - newOrderProduct.cancelProductNum)}" oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input cancel" type="text" onchange="setApplicationCancelNum(${status.index},${productStatus.index})"></span></font></td>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopOrderID" value="${newOrderProduct.shopOrderID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].productID" value="${newOrderProduct.productID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].orderProductID" value="${newOrderProduct.orderProductID}"/>
-                                        <form:hidden path="cmReturnedPurchaseProductList[${status.index}][${productStatus.index}].shopID" value="${newOrderProduct.shopID}"/>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </c:forEach>
-                </table>
-            </c:if>
+                </c:forEach>
             </table>
+        </c:if>
+        </table>
         <%--默认状态代码--%>
         <c:if test="${shopOrder.defaultStatus}">
             <table id="shopOrderTable${status.index}"
@@ -826,11 +826,12 @@
                             </table>
                         </td>
                     </tr>
-
+                </c:forEach>
             </table>
         </c:if>
+    </c:forEach>
     <div class="form-actions">
-                <input id="btnSubmit" class="btn btn-primary" type="submit" value="申 请"/>&nbsp;
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="申 请"/>&nbsp;
 
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
     </div>
@@ -989,23 +990,23 @@
             }
             wrapper.parent().append(wrapper.clone());
             wrapper.remove();
-			$(".conList").each(function(i,ele){
-				if($(ele).find("input.input-xlarge").val()){
-					$(ele).next().removeClass("hide-pic")
-				}
-			})
+            $(".conList").each(function(i,ele){
+                if($(ele).find("input.input-xlarge").val()){
+                    $(ele).next().removeClass("hide-pic")
+                }
+            })
+        });
+        $(window).on("load", function(){
+            setTimeout(function(){
+                $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
+                    if($(ele).val()){
+                        $(ele).next().find("li").css("z-index","99");
+                        $(ele).parents(".conList").find(".cancel-upload").show();
+                        $(ele).parents(".conList").next().removeClass("hide-pic")
+                    }
+                })
+            },500);
         });
-		$(window).on("load", function(){
-			setTimeout(function(){
-				$("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
-					if($(ele).val()){
-						$(ele).next().find("li").css("z-index","99");
-						$(ele).parents(".conList").find(".cancel-upload").show();
-						$(ele).parents(".conList").next().removeClass("hide-pic")
-					}
-				})
-			},500);
-		});
 
         //初始化支付方式选中
         blockEle = $('.refund-details-block');

+ 101 - 29
src/main/webapp/WEB-INF/views/modules/newhome/newFloorcontentForm.jsp

@@ -69,32 +69,59 @@
 			obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
 		}
 
-		function offoce(){
+		function offoce(productID,date,newshowTime,ShowTime,addTime){
 			var html = "<div id='auditBox'>"
 					+ "<div class='bd-row'>"
 					+ "    <span><font color='red'>*</font>展示时间:</span>"
-					+ "   <input type='text' name='showTime' class='input-medium required'/>"
+					+ "   <input type='text' name='yat'/>"
 					+ "<span>天</span>"
 					+ "</div>"
+					+ "<span  id='err' hidden=hidden style='color: red'>请输入天数</span>"
 					+ "</div>";
-			<%--var submit = function (v, h, f) {--%>
-			<%--	if (f.auditStatus == '') {--%>
-			<%--		$.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});--%>
-			<%--		return false;--%>
-			<%--	}--%>
-			<%--	$.post("${ctx}/product/new/auditProductBySencondProduct", {--%>
-			<%--		'productID': id,--%>
-			<%--		'validFlag': f.validFlag--%>
-			<%--	}, function (data) {--%>
-			<%--		if (true == data.success) {--%>
-			<%--			$.jBox.tip(data.msg, 'info');--%>
-			<%--			$("#searchForm").submit();--%>
-			<%--		} else {--%>
-			<%--			$.jBox.tip(data.msg, 'error');--%>
-			<%--		}--%>
-			<%--	}, "JSON");--%>
-			<%--};--%>
-			$.jBox(html, {title: "提示"});
+			var submit = function (v, h, f) {
+
+				if (f.yat == '' || f.yat == null) {
+					$("#err").show()
+					return false;
+				}else {
+					$("#err").hide()
+				}
+debugger
+				var time = new Date();
+				var y = time.getFullYear();
+				var m = time.getMonth() + 1;
+				m = m < 10 ? ('0' + m) : m;
+				var d = time.getDate();
+				d =  d< 10 ? ('0' + d) : d;
+				var h = time.getHours();
+				var minute = time.getMinutes();
+				minute = minute < 10 ? ('0' + minute) : minute;
+				var s=time.getSeconds();
+				d=time.getTime()+1000*60*60*24*f.yat;
+				var unixTimestamp = new Date(d);
+				commonTime = unixTimestamp.toLocaleString()
+
+				var data=new Date(date);
+				data.getTime()+1000*60*60*24;
+				var dtime = new Date(data);
+				commTime = dtime.toLocaleString()
+
+				// d=time.setDate(Number(d) + Number(f.yat)).toLocaleString().replace(/\//g, "-");
+
+				// d=time.setTime(time.getTime() + 1000 * 60 * 60 * (f.yat*24))
+
+				//对天数进行加
+				window.location.href="${ctx}/newhome/newPageFloor/updateshowTime?newshowTime="+commTime+"&productID="+productID+"&showTime="+commonTime+"&addTime"+addTime;
+				<%--$.post("${ctx}/newhome/newPageFloor/updateshowTime", {//y+'-'+m+'-'+d+'  '+h+':'+minute+':'+s--%>
+				<%--	'newshowTime':commTime,--%>
+				<%--	'productID':productID,--%>
+				<%--	'showTime':commonTime,--%>
+				<%--	'newshowTime':newshowTime,--%>
+				<%--	'addTime':addTime--%>
+
+				<%--}, "JSON");--%>
+			};
+			$.jBox(html, {title: "提示",submit:submit});
 		}
 
 
@@ -107,10 +134,10 @@
 				items.push($(this).val());
 			});
 			//保存批量排序
-			$.post("${ctx}/newhome/newPageFloor/batchSaveSort?sortList="+items, function(data) {
+			$.post("${ctx}/newhome/newPageFloor/batchSavesortIndex?sortList="+items, function(data) {
 				if(true==data.success){
 					$.jBox.tip(data.msg, 'info');
-					window.location.href = "${ctx}/newhome/newPageFloor";
+					window.location.href = "${ctx}/newhome/newPageFloor/ContentPage";
 				} else {
 					$.jBox.tip(data.msg,'error');
 				}
@@ -122,6 +149,38 @@
 			var value = sortThis.value;
 			$("#preferredProductSort"+id).val(id+"-"+value);
 		}
+
+		function offocea(productID,newshowTime,ShowTime,addTime) {
+			$.jBox.confirm("确定上线该商品吗?","提示",function(v,h,f){
+
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/updatshowFlag?showFlag=1&productID="+productID+"&newshowTime="+newshowTime+"&ShowTime="+ShowTime+"&addTime"+addTime;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offoceb(productID,newshowTime,ShowTime,addTime) {
+			console.log(newshowTime)
+			$.jBox.confirm("确定下线该商品吗?下线后该商品将不展示在商城新品区域","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/updatshowFlag?showFlag=3&productID="+productID+"&newshowTime="+newshowTime+"&ShowTime="+ShowTime+"&addTime"+addTime;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offocec(productID) {
+			$.jBox.confirm("确定取消重点推荐吗?","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/addrecommend?recommend=0&productID="+productID;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offoced(productID) {
+			$.jBox.confirm("确定将该商品设为重点推荐吗?推荐后商品将在商城新品区域重点展示","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/addrecommend?recommend=1&productID="+productID;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+
 	</script>
 </head>
 <body>
@@ -169,12 +228,12 @@
 		<tbody>
 		<c:forEach items="${page.list}" var="list">
 			<tr>
-
+				<input class="check-item" type="hidden" id="preferredProductSort${list.productID}" value='${list.productID}-${list.sortIndex}'/>
 				<td>${list.productID}</td>
 				<td>${list.name}</td>
 				<td>${list.shopName}</td>
 				<td>
-					<c:if test="${list.showFlag eq 1 }">
+					<c:if test="${list.showFlag eq 1}">
 						<font color="green">已展示</font>
 					</c:if>
 					<c:if test="${list.showFlag eq 2}">
@@ -183,12 +242,25 @@
 					<c:if test="${list.showFlag eq 3}">
 						<font color="red">已下线</font>
 					</c:if></td>
-				<td><fmt:formatDate value="${list.showTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
-	           <input class="check-item" type="hidden" id="preferredProductSort${newPageFloor.id}" value='${newPageFloor.id}-${list.sortIndex}'/>
-				<td><input  id="sort" name="sort" style="width:50px;" value="${list.sortIndex}"  onkeyup="onlynum(this)"  onchange="changeSort(${newPageFloor.id},this)"></td>
-				<td>${list.recommend}</td>
+
+				<td>
+					<c:if test="${not empty list.newshowTime}">
+					${list.newshowTime}~${list.showTime}
+					</c:if>
+	<c:if test="${not empty list.showTime && list.newshowTime ==null}">
+						${list.addTime}~${list.showTime}
+	</c:if>
+				</td>
+				<td><input  id="sort" name="sortIndex" style="width:50px;" value="${list.sortIndex}"  onkeyup="onlynum(this)"  onchange="changeSort(${list.productID},this)"></td>
+				<td>
+					<c:if test="${list.recommend eq 1}"><img src="/static/images/yes.gif" width="15px" border="none"/></c:if>
+				</td>
 				<td>
-		          <a class="red" href="javascript:void(0);" onclick="offoce()">更改展示时间</a>
+					<c:if test="${list.showFlag eq 3}"><a class="red" href="javascript:void(0);" onclick="offocea(${list.productID},'${list.newshowTime}','${list.showTime}','${list.addTime}')">上线商品</a></c:if>
+					<c:if test="${list.showFlag eq 1 }"><a class="red" href="javascript:void(0);" onclick="offoceb(${list.productID},'${list.newshowTime}','${list.showTime}','${list.addTime}')">下线商品</a>	</c:if>
+					<c:if test="${list.recommend eq 1}"><a class="red" href="javascript:void(0);" onclick="offocec(${list.productID})">取消重点推荐</a> </c:if>
+					<c:if test="${list.recommend != 1 && count<=5}"><a class="red" href="javascript:void(0);" onclick="offoced(${list.productID})">设为重点推荐</a></c:if>
+		          <a class="red" href="javascript:void(0);" onclick="offoce(${list.productID},new Date,'${list.newshowTime}','${list.addTime}')">更改展示时间</a>
                </td>
 </c:forEach>
 			</tr>

+ 12 - 5
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -293,7 +293,7 @@
 <%--                                   <a href="${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">图片管理</a>--%>
                                    <%--待审核或审核未通过才需要审核( 1待审核 2已上架 3已下架 8审核未通过 9已冻结)--%>
                                     <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
-                                        <a class="red" href="javascript:void(0);" onclick="auditThisBySencodeProduct(${product.id},'${product.costPrice}')">审核</a>
+                                        <a class="red" href="javascript:void(0);" onclick="auditThisBySencodeProduct(${product.id},'${product.costPrice}',${product.showTime},${product.addTime})">审核</a>
                                     </c:if>
                                     <%--已上架的才可以下架--%>
                                     <c:if test="${product.validFlag eq 2}">
@@ -317,7 +317,7 @@
                                 <a href="javascript:;" onclick="jumpHref('${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">图片管理</a>
                                 <a href="javascript:;" onclick="jumpHref('${ctx}/product/hehe/edit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">参与呵呵商城</a><br>
                                 <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
-                                    <a class="red" href="javascript:void(0);" onclick="auditThis(${product.id},'${product.brand.name}',${product.brand.status},'${product.costCheckFlag}','${product.costPrice}','${product.costProportional}','${product.newvalidFlag}')">审核</a>
+                                    <a class="red" href="javascript:void(0);" onclick="auditThis(${product.id},'${product.brand.name}',${product.brand.status},'${product.costCheckFlag}','${product.costPrice}','${product.costProportional}','${product.newvalidFlag}','${product.showTime}','${product.addTime}')">审核</a>
                                 </c:if>
                                 <c:if test="${product.validFlag ne 10 && product.validFlag ne 1 && product.validFlag ne 8}">
                                     <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 10)">冻结</a>
@@ -514,6 +514,8 @@
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;
             }
+
+
             $.post("${ctx}/product/new/auditProductBySencondProduct", {
             	'productID': id,
                 'validFlag': f.validFlag
@@ -530,7 +532,7 @@
     }
 
     // 审核(正常)
-    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag) {
+    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag,showtime,addtime) {
     	// 商品成本判断
     	if(null == costCheckFlag || "" == costCheckFlag){
     		alertx("成本价未填写,请编辑成本价后再审核");
@@ -599,12 +601,17 @@
 			}else {
 				$("#err").hide()
 			}
-
+			debugger
+			var data=new Date(addtime);
+			data.setDate(data.getDate()+90);
+			var dtime = new Date(data);
+			commTime = dtime.toLocaleString()
 
             $.post("${ctx}/product/new/auditProduct", {
             	'productID': id,
                 'validFlag': f.validFlag,
-				'newvalidFlag': f.newvalidFlag
+				'newvalidFlag': f.newvalidFlag,
+				'showtime': commTime
             }, function (data) {
                 if (true == data.success) {
                     $.jBox.tip(data.msg, 'info');