فهرست منبع

6月小版本

Duan_xu 2 سال پیش
والد
کامیت
8ab3173d6b

+ 13 - 4
src/main/java/com/caimei/modules/newhome/web/NewPageFloorController.java

@@ -98,23 +98,32 @@ public class NewPageFloorController extends BaseController {
 
     @RequiresPermissions("newhome:newPageFloor:edit")
     @RequestMapping(value = "save")
-    public String save(NewPageFloor newPageFloor, Model model, RedirectAttributes redirectAttributes) {
+    public String save(Integer floor,NewPageFloor newPageFloor, Model model, RedirectAttributes redirectAttributes) {
         if (!beanValidator(model, newPageFloor)) {
             return form(newPageFloor, model);
         }
         newPageFloorService.save(newPageFloor);
         cleanRedisCache();
         addMessage(redirectAttributes, "保存楼层管理成功");
-        return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/?repage";
+        if(floor!=null){
+            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/lists";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor";
+        }
+
     }
 
     @RequiresPermissions("newhome:newPageFloor:delete")
     @RequestMapping(value = "delete")
-    public String delete(NewPageFloor newPageFloor, RedirectAttributes redirectAttributes) {
+    public String delete(Integer floor,NewPageFloor newPageFloor, RedirectAttributes redirectAttributes) {
         newPageFloorService.delete(newPageFloor);
         cleanRedisCache();
         addMessage(redirectAttributes, "删除楼层管理成功");
-        return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/?repage";
+        if(floor!=null){
+            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/lists";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/?repage";
+        }
     }
 
     @RequiresPermissions("newhome:newPageHomeimage:edit")

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

@@ -30,6 +30,8 @@ public interface ProductNewDao extends CrudDao<Product> {
 
     void updateByPrimaryKeySelective(Product product);
 
+    Integer newFloorId();
+
     List<ProductImage> getImageList(@Param("productId") Integer productId);
 
     void updateImageSort(@Param("productImageID") Integer productImageID, @Param("sortIndex")  Integer sortIndex);

+ 25 - 3
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -234,17 +234,37 @@ public class Product extends DataEntity<Product> {
      * 新品商品状态  1.已审核  2.未参与   3.审核未通过
      */
     private Integer newvalidFlag;
-
+/**
+ * 新品展示状态
+ */
     private Integer showFlag;
-
+    /**
+     * 展示结束时间
+     */
     private String showTime;
-
+    /**
+     * 展示开始时间
+     */
     private String newshowTime;
 
     //1.重点推荐
     private Integer recommend;
 
 
+    /**
+     * 新品参与状态1.参与 2.未参与
+     */
+    private Integer newProductType;
+
+
+    public Integer getNewProductType() {
+        return newProductType;
+    }
+
+    public void setNewProductType(Integer newProductType) {
+        this.newProductType = newProductType;
+    }
+
     public Integer getShowFlag() {
         return showFlag;
     }
@@ -262,6 +282,8 @@ public class Product extends DataEntity<Product> {
     }
 
 
+
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     public String getNewshowTime() {
         return newshowTime;

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

@@ -208,7 +208,9 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         product.setBeforeValidFlag(beforeValidFlag);
         product.setNewvalidFlag(newvalidFlag);
         product.setShowTime(showtime);
+        product.setFloorId( productNewDao.newFloorId());
         productNewDao.updateByPrimaryKeySelective(product);
+
     }
 
     public Map<String, Object> findPromotionStatus(String validFlag, Integer productId) {

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

@@ -405,6 +405,7 @@ public class ProductService extends CrudService<ProductDao, Product> {
             if(StringUtils.isNotBlank(product.getCostProportional())){
                 product.setSqlCostProportional(Double.valueOf(product.getCostProportional()));
             }
+            //保存商品信息
             productDao.insert(product);
             productDetailInfo.setProductID(product.getProductID());
             // 保存商品图片

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

@@ -863,7 +863,9 @@ public class ProductNewController extends BaseController {
                     validFlag = "2";
                 }
             }
+
             productNewService.auditProduct(validFlag,newvalidFlag,showtime, beforeValidFlag, productID);
+
             map.put("success", true);
             map.put("msg", "操作成功");
             int valid = new Integer(validFlag);

+ 7 - 3
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -404,7 +404,7 @@
                             splitCode,
                             productDetail,
                             announType,
-                            newvalidFlag)
+							newProductType)
         VALUES (#{brandID},
                 #{bigTypeID},
                 #{smallTypeID},
@@ -479,7 +479,7 @@
                 #{splitCode},
                 #{productDetail},
                 #{announType},
-                #{newvalidFlag})
+                #{newProductType})
     </insert>
 
     <update id="update">
@@ -539,7 +539,7 @@
             costCheckFlag        = #{costCheckFlag},
             precisehKey          = #{precisehKey},
             actSort              = #{actSort},
-            newvalidFlag=#{newvalidFlag}
+			newProductType=#{newProductType}
 
         WHERE productID = #{id}
     </update>
@@ -1669,6 +1669,9 @@
             <if test="newvalidFlag !=null">
                 newvalidFlag=#{newvalidFlag},
             </if>
+			<if test="newProductType !=null">
+				newProductType=#{newProductType},
+			</if>
             splitCode = #{splitCode}
         </set>
         where productID = #{productID}
@@ -1932,6 +1935,7 @@
 				</foreach>
 			</if>
 		and a.newvalidFlag = 1
+	  and a.newProductType = 1
 
 		</where>
 		<choose>

+ 15 - 0
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -6,6 +6,7 @@
         <result property="name" column="name"/>
     </resultMap>
     <sql id="productColumns">
+        a.newProductType,
         a.newvalidFlag,
         a.announType,
         a.productID AS "id",
@@ -222,6 +223,12 @@
                 <if test="announType !=null and announType!= ''">
                     AND a.announType=#{announType}
                 </if>
+            <if test="newvalidFlag !=null and newvalidFlag!= ''">
+                AND a.newvalidFlag=#{newvalidFlag}
+            </if>
+                <if test="newProductType !=null and newProductType!= ''">
+            AND a.newProductType=#{newProductType}
+        </if>
             <if test="contactName !=null and contactName !=''">
                 AND (cshd.contactName LIKE concat('%',#{contactName},'%') or cshd.companyName LIKE concat('%',#{contactName},'%'))
             </if>
@@ -469,9 +476,17 @@
         insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
         values (#{productID}, #{shopID}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex});
     </insert>
+
+    <select id="newFloorId" resultType="java.lang.Integer">
+        select id from new_page_floor where floorType=1 limit 1
+    </select>
+
     <update id="updateByPrimaryKeySelective" parameterType="com.caimei.modules.product.entity.Product">
         update product
         <set>
+            <if test="floorId != null and floorId != ''">
+                floorId=#{floorId},
+            </if>
             <if test="newvalidFlag != null and newvalidFlag != '' ">
                 newvalidFlag=#{newvalidFlag},
             </if>

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

@@ -168,7 +168,7 @@ debugger
 			console.log(newshowTime)
 			$.jBox.confirm("确定下线该商品吗?下线后该商品将不展示在商城新品区域","提示",function(v,h,f){
 				if(v === 1){
-					window.location.href="${ctx}/newhome/newPageFloor/updatshowFlag?recommend=0&showFlag=4&productID="+productID+"&newshowTime="+newshowTime+"&ShowTime="+ShowTime+"&addTime"+addTime;
+					window.location.href="${ctx}/newhome/newPageFloor/updatshowFlag?showFlag=3&productID="+productID+"&newshowTime="+newshowTime+"&ShowTime="+ShowTime+"&addTime"+addTime;
 				}
 			} ,{ buttons: {  '确定': 1,'取消':2}});
 		}
@@ -247,7 +247,7 @@ debugger
 					<c:if test="${list.showFlag eq 2}">
 						<font color="#ff8c00">展示过期</font>
 					</c:if>
-					<c:if test="${list.showFlag eq 4}">
+					<c:if test="${list.showFlag eq 3}">
 						<font color="red">已下线</font>
 					</c:if></td>
 

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorForm.jsp

@@ -30,7 +30,7 @@
 		<li><a href="${ctx}/newhome/newPageFloor/">楼层管理列表</a></li>
 		<li class="active"><a href="${ctx}/newhome/newPageFloor/form?id=${newPageFloor.id}">楼层管理${not empty newPageFloor.id?'编辑':'添加'}</a></li>
 	</ul><br/>
-	<form:form id="inputForm" modelAttribute="newPageFloor" action="${ctx}/newhome/newPageFloor/save" method="post" class="form-horizontal">
+	<form:form id="inputForm" modelAttribute="newPageFloor" action="${ctx}/newhome/newPageFloor/save?floor=${newPageFloor.floorType}" method="post" class="form-horizontal">
 		<form:hidden path="id"/>
 		<sys:message content="${message}"/>
 		<div class="control-group">

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorLists.jsp

@@ -163,7 +163,7 @@
     				<a href="${ctx}/newhome/newPageFloor/form?id=${newPageFloor.id}">编辑</a>
                     <a href="${ctx}/newhome/newPageFloor/ContentPage?floorId=${newPageFloor.id}&floorTitle=${newPageFloor.floorTitle}&floorType=${newPageFloor.floorType}">内容</a>
     				<shiro:hasPermission name="newhome:newPageFloor:delete">
-					<a href="${ctx}/newhome/newPageFloor/delete?id=${newPageFloor.id}" onclick="return confirmx('确定删除该楼层吗?', this.href)">删除</a>
+					<a href="${ctx}/newhome/newPageFloor/delete?floor=1&id=${newPageFloor.id}" onclick="return confirmx('确定删除该楼层吗?', this.href)">删除</a>
 					</shiro:hasPermission>
 				</td></shiro:hasPermission>
 			</tr>

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

@@ -238,7 +238,7 @@
             </div>
         </c:if>
     </div>
-    <c:if test="${vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7 and vo.receiptType != 8}">
+    <c:if test="${cmDiscernReceipt.newReceiptType eq 2 or vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7 and vo.receiptType != 8}">
         <h5>关联订单</h5>
         <div class="receipt-order-form">
             <c:forEach items="${vo.orderInfos}" var="orderInfo">

+ 7 - 8
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp

@@ -53,13 +53,12 @@
     </style>
     <script type="text/javascript">
         $(document).ready(function () {
-            $("#receiptType").mouseover(function(){
-                console.log( $("#receiptType").val())
-                $("#mark-info").show();
-                $("#receiptType").mouseout(function(){
-                    $("#mark-info").hide();
-                });
-            });
+            var receiptType = $("#receiptType").val();
+            if (receiptType == 2) {
+                $(".secondType").show();
+            } else {
+                $(".secondType").hide();
+            }
         });
             $("#receipt").hover(function(){
                 console.log(1);
@@ -271,7 +270,7 @@
                     <c:if test="${cmDiscernReceipt.receiptStatus == 4}"><font color="red">审核未通过</font></c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 5}"><font color="red">收款撤销</font></c:if>
                 </c:if>
-                <c:if test="${cmDiscernReceipt.payWay == 2}">
+                <c:if test="${cmDiscernReceipt.payWay == 2 && cmDiscernReceipt.newReceiptType != 3}">
                     <c:if test="${cmDiscernReceipt.receiptStatus == 1}"><strong>待确认</strong></c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 2}">已确认</c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 3}">审核通过</c:if>

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -746,11 +746,11 @@
         <tr>
             <th><span class="red">*</span>首页新品展示:</th>
             <td colspan="3">
-                <label><input type="radio" name="newvalidFlag" value="0"
-                              ${product.newvalidFlag == "0" ? "checked" : ""}>参与新品展示<b
+                <label><input type="radio" name="newProductType" value="1"
+                              ${product.newProductType == "1" ? "checked" : ""}>参与新品展示<b
                         class="line">|</b></label>
-                <label><input type="radio" name="newvalidFlag" value="2"
-                             ${product.newvalidFlag == "1" ? "" : "checked"}>不参与新品展示</label>
+                <label><input type="radio" name="newProductType" value="2"
+                             ${product.newProductType == "2" ? "" : "checked"}>不参与新品展示</label>
             </td>
         </tr>
         <tr>

+ 49 - 22
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -124,6 +124,23 @@
 						<form:options items="${brandList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
 					</form:select>
 				</div>
+				<div class="item">
+					<label>新品参与状态:</label>
+					<form:select path="newProductType" class="input-medium">
+						<form:option value="" label="请选择"/>
+						<form:option value="1" label="参与"/>
+						<form:option value="2" label="未参与"/>
+					</form:select>
+				</div>
+				<div class="item">
+					<label>新品审核状态:</label>
+					<form:select path="newvalidFlag" class="input-medium">
+						<form:option value="" label="请选择"/>
+						<form:option value="1" label="审核通过"/>
+						<form:option value="2" label="审核未通过"/>
+						<form:option value="3" label="待审核"/>
+					</form:select>
+				</div>
 				<div class="item">
 					<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
 					&nbsp;&nbsp;&nbsp;&nbsp;<input class="btn btn-primary" onclick="window.location='${ctx}/product/new/productEdit?shopType=2'" value="发布特殊供应商商品"/>
@@ -149,7 +166,8 @@
 				<th>价格可见度</th>
 				<th>线上分帐号</th>
 				<th>状态</th>
-				<th>新品展示审核状态</th>
+				<th>新品参与状态</th>
+				<th>新品审核状态</th>
 				<th>提交时间</th>
 				<shiro:hasPermission name="product:product:edit"><th>操作</th></shiro:hasPermission>
 			</tr>
@@ -255,20 +273,29 @@
 					</c:if>
 				</td>
 			    <td>
+
+					<c:if test="${product.newProductType eq 2}">
+						<font color="darkorange">未参与</font>
+					</c:if>
+					<c:if test="${product.newProductType eq null}">
+						<font color="red">___</font>
+					</c:if>
+					<c:if test="${product.newProductType eq 1}">
+						<font color="darkorange">参与</font>
+					</c:if>
+				</td>
+				<td>
 					<c:if test="${product.newvalidFlag eq 1}">
 						<font color="green">审核通过</font>
 					</c:if>
-					<c:if test="${product.newvalidFlag eq 2}">
-						<font color="darkorange">未参与</font>
-					</c:if>
 					<c:if test="${product.newvalidFlag eq 3}">
+						<font color="green">待审核</font>
+					</c:if>
+					<c:if test="${product.newvalidFlag eq 2}">
 						<font color="red">审核未通过</font>
 					</c:if>
 					<c:if test="${product.newvalidFlag eq null}">
-						<font color="red">未进行过此操作</font>
-					</c:if>
-					<c:if test="${product.newvalidFlag eq 0}">
-						<font color="darkorange">参与</font>
+						<font color="red">___</font>
 					</c:if>
 				</td>
 				<td>
@@ -317,8 +344,9 @@
                                 <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}','${product.showTime}','${product.addTime}')">审核</a>
+									<c:if test="${(product.newProductType != 1 || product.newProductType eq null)}"> <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}','${product.newProductType}')">上架审核</a></c:if>
                                 </c:if>
+								<c:if test="${product.newProductType eq 1 ||  product.newvalidFlag != 1}"><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}','${product.newProductType}','${product.validFlag}')">新品展示审核</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>
                                 </c:if>
@@ -532,7 +560,7 @@
     }
 
     // 审核(正常)
-    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag,showtime,addtime) {
+    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag,showtime,addtime,newProductType,validFlag) {
     	// 商品成本判断
     	if(null == costCheckFlag || "" == costCheckFlag){
     		alertx("成本价未填写,请编辑成本价后再审核");
@@ -569,22 +597,15 @@
 				+ "        <option value='2'>审核通过</option>"
 				+ "        <option value='8'>审核未通过</option>"
 				+ "    <select/>"
-				+ "</div>";
+				+ "</div>"
+		         + "</div>";
         var html = "<div id='auditBox'>"
-					+ "<div class='bd-row'>"
-					+ "    <span><font color='red'>*</font>商品上架审核:</span>"
-					+ "    <select name='validFlag' id='validFlag'>"
-			    	+ "        <option value=''>请选择</option>"
-					+ "        <option value='2'>审核通过</option>"
-					+ "        <option value='8'>审核未通过</option>"
-					+ "    <select/>"
-					+ "</div>"
 				+ "<div class='bd-row'>"
 				+ "    <span><font color='red'>*</font>新品展示审核:</span>"
 				+ "    <select name='newvalidFlag' id='newvalidFlag'>"
 				+ "        <option value=''>请选择</option>"
 				+ "        <option value='1'>审核通过</option>"
-				+ "        <option value='3'>审核未通过</option>"
+				+ "        <option value='2'>审核未通过</option>"
 				+ "    <select/> "
 				+ "</div>"
 				+ "    <span id='err' hidden=hidden style='color: red'>请选择审核结果</span>"
@@ -606,7 +627,10 @@
 			data.setDate(data.getDate()+90);
 			var dtime = new Date(data);
 			commTime = dtime.toLocaleString()
-
+			if(validFlag == 2 && newProductType == 1){
+				f.validFlag=validFlag;
+				console.log("t"+f.validFlag)
+			}
             $.post("${ctx}/product/new/auditProduct", {
             	'productID': id,
                 'validFlag': f.validFlag,
@@ -621,8 +645,11 @@
                 }
             }, "JSON");
         };
-		if(newvalidFlag !=2){
+		debugger
+		console.log(validFlag+"f"+newProductType)
+		if(validFlag == 2 && newProductType == 1){
 			$.jBox(html, {title: "审核", submit: submit});
+
 		}else {
 			$.jBox(htmls, {title: "审核", submit: submit});
 		}

+ 22 - 3
src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp

@@ -132,6 +132,7 @@
         <th>来源</th>
         <th>交易价</th>
         <th>线上分帐号</th>
+        <th>发布类型</th>
         <th>分类</th>
         <th>商品状态</th>
         <th>交易状态</th>
@@ -208,6 +209,16 @@
             <td>
                     ${product.splitCode}
             </td>
+
+            <td>
+                <c:if test="${product.announType eq 1}">
+                    二手预成交商品
+                </c:if>
+                <c:if test="${product.announType eq 2}">
+                    二手估价商品
+                </c:if>
+            </td>
+
             <td>
                 ${product.secondHandType eq 1?'二手仪器':product.secondHandType eq 2?'临期产品':'其他'}
                 <c:if test="${product.secondHandType eq 1}">
@@ -408,7 +419,7 @@
     }
 
     // 审核(二手)
-    function auditThisBySencodeProduct(id,costPrice,price){
+    function auditThisBySencodeProduct(id,costPrice,price,costProportional){
 
         var html = "<div id='auditBox'>"
             + "<div class='bd-row'>"
@@ -419,9 +430,17 @@
             + "    <select/>"
             + "</div>"
             + "</div>";
+
+        var htmls = "<div id='auditBox'>"
+            + "<div class='bd-row'>"
+            + " <span><font color='red'>*</font>审核通过前请先填写交易价和成本</span>"
+            + "</div>"
+            + "</div>";
         var submit = function (v, h, f) {
-            if(costPrice =='' || price == ''){
-                $.jBox.tip("审核通过前请先填写交易价和成本", 'error', {focusId: "validFlag"});
+            console.log(costPrice+"sa"+price+"s"+costProportional)
+            if(((costPrice ==0.00 || costPrice ==undefined) && (price == undefined || price == '')) || ((costProportional == '' || costProportional == undefined) &&  (price == undefined || price == ''))){
+                $.jBox(htmls, {title: "提示"});
+                // $.jBox.tip("审核通过前请先填写交易价和成本", 'error', {focusId: "validFlag"});
                 return false;
             }