Kaynağa Gözat

Merge remote-tracking branch 'origin/developer' into developer

Aslee 2 yıl önce
ebeveyn
işleme
3a6cbb06ab
43 değiştirilmiş dosya ile 2647 ekleme ve 981 silme
  1. 15 1
      src/main/java/com/caimei/modules/newhome/dao/NewPageFloorDao.java
  2. 19 10
      src/main/java/com/caimei/modules/newhome/entity/NewPageFloor.java
  3. 32 1
      src/main/java/com/caimei/modules/newhome/service/NewPageFloorService.java
  4. 127 4
      src/main/java/com/caimei/modules/newhome/web/NewPageFloorController.java
  5. 4 0
      src/main/java/com/caimei/modules/order/dao/CmDiscernReceiptDao.java
  6. 1 1
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  7. 82 0
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  8. 11 1
      src/main/java/com/caimei/modules/order/entity/CmReceiptOrderRelation.java
  9. 9 0
      src/main/java/com/caimei/modules/order/entity/ReceiptDetailVo.java
  10. 4 0
      src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java
  11. 24 24
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  12. 3 2
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  13. 9 2
      src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java
  14. 5 0
      src/main/java/com/caimei/modules/product/dao/ProductDao.java
  15. 2 0
      src/main/java/com/caimei/modules/product/dao/ProductNewDao.java
  16. 12 0
      src/main/java/com/caimei/modules/product/entity/CmSecondHandDetail.java
  17. 101 7
      src/main/java/com/caimei/modules/product/entity/Product.java
  18. 60 2
      src/main/java/com/caimei/modules/product/service/ProductNewService.java
  19. 52 0
      src/main/java/com/caimei/modules/product/service/ProductService.java
  20. 110 5
      src/main/java/com/caimei/modules/product/web/CmSecondHandDetailController.java
  21. 7 4
      src/main/java/com/caimei/modules/product/web/ProductNewController.java
  22. 2 1
      src/main/resources/mappings/modules/common/AreaMapper.xml
  23. 92 17
      src/main/resources/mappings/modules/newhome/NewPageFloorMapper.xml
  24. 63 2
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  25. 3 1
      src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml
  26. 2 0
      src/main/resources/mappings/modules/product/CmSecondHandDetailMapper.xml
  27. 227 161
      src/main/resources/mappings/modules/product/ProductMapper.xml
  28. 189 135
      src/main/resources/mappings/modules/product/ProductNewMapper.xml
  29. 202 202
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/applyRefoundForm.jsp
  30. 313 0
      src/main/webapp/WEB-INF/views/modules/newhome/newFloorcontentForm.jsp
  31. 14 3
      src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorForm.jsp
  32. 14 11
      src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorList.jsp
  33. 177 0
      src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorLists.jsp
  34. 139 3
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp
  35. 71 7
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp
  36. 13 15
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp
  37. 23 0
      src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp
  38. 121 14
      src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp
  39. 48 22
      src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp
  40. 125 167
      src/main/webapp/WEB-INF/views/modules/product/cmSecondDetailForm.jsp
  41. 112 148
      src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp
  42. 4 4
      src/main/webapp/WEB-INF/views/modules/user/cmSpForm.jsp
  43. 4 4
      src/main/webapp/WEB-INF/views/modules/userNew/cmSpForm.jsp

+ 15 - 1
src/main/java/com/caimei/modules/newhome/dao/NewPageFloorDao.java

@@ -3,7 +3,9 @@ package com.caimei.modules.newhome.dao;
 import com.caimei.modules.newhome.entity.NewPageFloor;
 import com.caimei.modules.newhome.entity.NewPageFloor;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
 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.CrudDao;
+import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -20,6 +22,16 @@ public interface NewPageFloorDao extends CrudDao<NewPageFloor> {
 
 
     void saveSort(@Param("sort") String sort, @Param("id") String id);
     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);
     NewPageFloorContent findFloorContentByfloorId(Integer floorId);
 
 
     List<NewPageFloorImage> findFloorImage(Integer floorId);
     List<NewPageFloorImage> findFloorImage(Integer floorId);
@@ -31,4 +43,6 @@ public interface NewPageFloorDao extends CrudDao<NewPageFloor> {
     void deleteFloorImage(@Param("floorId") Integer floorId,@Param("status") Integer status);
     void deleteFloorImage(@Param("floorId") Integer floorId,@Param("status") Integer status);
 
 
     void insertFloorImage(NewPageFloorImage floorImage);
     void insertFloorImage(NewPageFloorImage floorImage);
-}
+
+    List<NewPageFloor> floorFindList( NewPageFloor newPageFloor);
+}

+ 19 - 10
src/main/java/com/caimei/modules/newhome/entity/NewPageFloor.java

@@ -10,15 +10,24 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @version 2019-03-14
  * @version 2019-03-14
  */
  */
 public class NewPageFloor extends DataEntity<NewPageFloor> {
 public class NewPageFloor extends DataEntity<NewPageFloor> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
 	private String floorTitle;		// 楼层标题
 	private String floorTitle;		// 楼层标题
 	private String floorDetail;		// 楼层描述
 	private String floorDetail;		// 楼层描述
 	private String type;		// 楼层类型:1:推荐专区、2:团购促销、3:优质供应商、4:商品专题、5:小专题、6:大专题
 	private String type;		// 楼层类型:1:推荐专区、2:团购促销、3:优质供应商、4:商品专题、5:小专题、6:大专题
 	private String sort;		// 排序
 	private String sort;		// 排序
 	private String wwwEnabledStatus;		// Pc端状态 0停用 1启用
 	private String wwwEnabledStatus;		// Pc端状态 0停用 1启用
-	private String crmEnabledStatus;		// CRM端状态 0停用 1启用
-	
+	private String crmEnabledStatus;// CRM端状态 0停用 1启用
+	private Integer floorType;//楼层类别 1,新品楼层
+
+	public Integer getFloorType() {
+		return floorType;
+	}
+
+	public void setFloorType(Integer floorType) {
+		this.floorType = floorType;
+	}
+
 	public NewPageFloor() {
 	public NewPageFloor() {
 		super();
 		super();
 	}
 	}
@@ -35,7 +44,7 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setFloorTitle(String floorTitle) {
 	public void setFloorTitle(String floorTitle) {
 		this.floorTitle = floorTitle;
 		this.floorTitle = floorTitle;
 	}
 	}
-	
+
 	@Length(min=0, max=255, message="楼层描述长度必须介于 0 和 255 之间")
 	@Length(min=0, max=255, message="楼层描述长度必须介于 0 和 255 之间")
 	public String getFloorDetail() {
 	public String getFloorDetail() {
 		return floorDetail;
 		return floorDetail;
@@ -44,7 +53,7 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setFloorDetail(String floorDetail) {
 	public void setFloorDetail(String floorDetail) {
 		this.floorDetail = floorDetail;
 		this.floorDetail = floorDetail;
 	}
 	}
-	
+
 	@Length(min=0, max=1, message="楼层类型:1:推荐专区、2:团购促销、3:优质供应商、4:商品专题、5:小专题、6:大专题长度必须介于 0 和 1 之间")
 	@Length(min=0, max=1, message="楼层类型:1:推荐专区、2:团购促销、3:优质供应商、4:商品专题、5:小专题、6:大专题长度必须介于 0 和 1 之间")
 	public String getType() {
 	public String getType() {
 		return type;
 		return type;
@@ -53,7 +62,7 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setType(String type) {
 	public void setType(String type) {
 		this.type = type;
 		this.type = type;
 	}
 	}
-	
+
 	@Length(min=0, max=11, message="排序长度必须介于 0 和 11 之间")
 	@Length(min=0, max=11, message="排序长度必须介于 0 和 11 之间")
 	public String getSort() {
 	public String getSort() {
 		return sort;
 		return sort;
@@ -62,7 +71,7 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setSort(String sort) {
 	public void setSort(String sort) {
 		this.sort = sort;
 		this.sort = sort;
 	}
 	}
-	
+
 	@Length(min=0, max=1, message="Pc端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	@Length(min=0, max=1, message="Pc端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	public String getWwwEnabledStatus() {
 	public String getWwwEnabledStatus() {
 		return wwwEnabledStatus;
 		return wwwEnabledStatus;
@@ -71,7 +80,7 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setWwwEnabledStatus(String wwwEnabledStatus) {
 	public void setWwwEnabledStatus(String wwwEnabledStatus) {
 		this.wwwEnabledStatus = wwwEnabledStatus;
 		this.wwwEnabledStatus = wwwEnabledStatus;
 	}
 	}
-	
+
 	@Length(min=0, max=1, message="CRM端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	@Length(min=0, max=1, message="CRM端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	public String getCrmEnabledStatus() {
 	public String getCrmEnabledStatus() {
 		return crmEnabledStatus;
 		return crmEnabledStatus;
@@ -80,5 +89,5 @@ public class NewPageFloor extends DataEntity<NewPageFloor> {
 	public void setCrmEnabledStatus(String crmEnabledStatus) {
 	public void setCrmEnabledStatus(String crmEnabledStatus) {
 		this.crmEnabledStatus = crmEnabledStatus;
 		this.crmEnabledStatus = crmEnabledStatus;
 	}
 	}
-	
-}
+
+}

+ 32 - 1
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.NewPageFloor;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorContent;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
+import com.caimei.modules.product.entity.Product;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.AppUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.Page;
@@ -43,6 +44,14 @@ public class NewPageFloorService extends CrudService<NewPageFloorDao, NewPageFlo
         return super.findPage(page, newPageFloor);
         return super.findPage(page, newPageFloor);
     }
     }
 
 
+    public Page<NewPageFloor> floorFindList(Page<NewPageFloor> page, NewPageFloor newPageFloor) {
+        page.setOrderBy("-sort desc,createDate desc");
+        newPageFloor.setPage(page);
+        List<NewPageFloor> payOrderList = newPageFloorDao.floorFindList(newPageFloor);
+        page.setList(payOrderList);
+        return page;
+    }
+
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
     public void save(NewPageFloor newPageFloor) {
     public void save(NewPageFloor newPageFloor) {
         super.save(newPageFloor);
         super.save(newPageFloor);
@@ -58,6 +67,28 @@ public class NewPageFloorService extends CrudService<NewPageFloorDao, NewPageFlo
         newPageFloorDao.saveSort(sort, id);
         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) {
     public NewPageFloorContent findFloorContent(Integer floorId) {
         NewPageFloorContent floorContent = newPageFloorDao.findFloorContentByfloorId(floorId);
         NewPageFloorContent floorContent = newPageFloorDao.findFloorContentByfloorId(floorId);
         List<NewPageFloorImage> floorImageList = newPageFloorDao.findFloorImage(floorId);
         List<NewPageFloorImage> floorImageList = newPageFloorDao.findFloorImage(floorId);
@@ -167,4 +198,4 @@ public class NewPageFloorService extends CrudService<NewPageFloorDao, NewPageFlo
             }
             }
         }
         }
     }
     }
-}
+}

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

@@ -28,6 +28,10 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 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;
 import java.util.Map;
 
 
 import static com.caimei.modules.newhome.web.NewPageQualitySupplierController.isInteger;
 import static com.caimei.modules.newhome.web.NewPageQualitySupplierController.isInteger;
@@ -77,6 +81,14 @@ public class NewPageFloorController extends BaseController {
         return "modules/newhome/newPageFloorList";
         return "modules/newhome/newPageFloorList";
     }
     }
 
 
+
+    @RequestMapping(value = {"lists"})
+    public String lists(NewPageFloor newPageFloor, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<NewPageFloor> page = newPageFloorService.floorFindList(new Page<NewPageFloor>(request, response), newPageFloor);
+        model.addAttribute("page", page);
+        return "modules/newhome/newPageFloorLists";
+    }
+
     @RequiresPermissions("newhome:newPageFloor:view")
     @RequiresPermissions("newhome:newPageFloor:view")
     @RequestMapping(value = "form")
     @RequestMapping(value = "form")
     public String form(NewPageFloor newPageFloor, Model model) {
     public String form(NewPageFloor newPageFloor, Model model) {
@@ -86,23 +98,32 @@ public class NewPageFloorController extends BaseController {
 
 
     @RequiresPermissions("newhome:newPageFloor:edit")
     @RequiresPermissions("newhome:newPageFloor:edit")
     @RequestMapping(value = "save")
     @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)) {
         if (!beanValidator(model, newPageFloor)) {
             return form(newPageFloor, model);
             return form(newPageFloor, model);
         }
         }
         newPageFloorService.save(newPageFloor);
         newPageFloorService.save(newPageFloor);
         cleanRedisCache();
         cleanRedisCache();
         addMessage(redirectAttributes, "保存楼层管理成功");
         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")
     @RequiresPermissions("newhome:newPageFloor:delete")
     @RequestMapping(value = "delete")
     @RequestMapping(value = "delete")
-    public String delete(NewPageFloor newPageFloor, RedirectAttributes redirectAttributes) {
+    public String delete(Integer floor,NewPageFloor newPageFloor, RedirectAttributes redirectAttributes) {
         newPageFloorService.delete(newPageFloor);
         newPageFloorService.delete(newPageFloor);
         cleanRedisCache();
         cleanRedisCache();
         addMessage(redirectAttributes, "删除楼层管理成功");
         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")
     @RequiresPermissions("newhome:newPageHomeimage:edit")
@@ -148,6 +169,18 @@ public class NewPageFloorController extends BaseController {
         return "modules/newhome/newPageFloorContentForm";
         return "modules/newhome/newPageFloorContentForm";
     }
     }
 
 
+    @RequestMapping(value = "ContentPage")
+    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("newPageFloor",newPageFloor);
+        model.addAttribute("Product",product);
+        return "modules/newhome/newFloorcontentForm";
+    }
+
     /**
     /**
      * 批量更新排序值
      * 批量更新排序值
      */
      */
@@ -191,6 +224,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;
+        }
+    }
+
+
     /**
     /**
      * 添加商品
      * 添加商品
      */
      */
@@ -359,4 +434,52 @@ public class NewPageFloorController extends BaseController {
         generateUtils.generateHome();
         generateUtils.generateHome();
 
 
     }
     }
+
+    @RequestMapping(value = "updatshowFlag")
+    public String updatshowFlag(Product product,String floorTitle,Integer floorType, Model model) {
+        model.addAttribute("floorTitle",floorTitle);
+        model.addAttribute("floorType",floorType);
+
+        newPageFloorService.updatshowFlag(product);
+
+       return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
+    @RequestMapping(value = "updateshowTime")
+    public String updateshowTime(Product product,String floorTitle,Integer floorType, Model model) {
+
+        /**
+         * 判断时间更改展示状态
+         */
+        newPageFloorService.updateshowTime(product);
+        int num=0;
+        int nums=0;
+        if(product.getNewshowTime() !=null && product.getNewshowTime()!=""){
+            num= product.getShowTime().compareTo(product.getNewshowTime());
+            if(num>0){
+                product.setShowFlag(1);
+            }else {product.setShowFlag(2);}
+        }else if (product.getAddTime()!=null && product.getAddTime()!=""){
+            nums= product.getShowTime().compareTo(product.getAddTime());
+            if ( nums>0){
+                product.setShowFlag(1);
+            }else {
+                product.setShowFlag(2);
+            }
+        }
+        newPageFloorService.updatshowFlag(product);
+        model.addAttribute("floorTitle",floorTitle);
+        model.addAttribute("floorType",floorType);
+    return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
+    @RequestMapping("/addrecommend")
+    public String addrecommend(Product product,String floorTitle,Integer floorType, Model model) {
+        model.addAttribute("floorTitle",floorTitle);
+        model.addAttribute("floorType",floorType);
+            newPageFloorService.updatrecommend(product);
+
+        return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/ContentPage";
+    }
+
 }
 }

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

@@ -99,4 +99,8 @@ public interface CmDiscernReceiptDao extends CrudDao<CmDiscernReceipt> {
     ReceipCouponInfoVo getCouponInfo(String receiptID);
     ReceipCouponInfoVo getCouponInfo(String receiptID);
 
 
     List<NewShopOrder> getShopOrderInfos(@Param("shopOrderId") String shopOrderId,@Param("orderId") String orderId);
     List<NewShopOrder> getShopOrderInfos(@Param("shopOrderId") String shopOrderId,@Param("orderId") String orderId);
+
+    CmDiscernReceipt orderlist(CmDiscernReceipt cmDiscernReceipt);
+
+
 }
 }

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

@@ -91,5 +91,5 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     List<NewShopOrder> findListByShopOrderId(Integer onlineShopOrderId);
     List<NewShopOrder> findListByShopOrderId(Integer onlineShopOrderId);
 
 
     //查询子订单是 线上 还是 线上
     //查询子订单是 线上 还是 线上
-    Integer payWay(Integer shopOrderID);
+    List<Integer> payWay(Integer shopOrderID);
 }
 }

+ 82 - 0
src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java

@@ -68,6 +68,81 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
 
 
     private Double orderReceivedAmount;//订单已收金额(此收款只计算线上线下收款记录表金额)
     private Double orderReceivedAmount;//订单已收金额(此收款只计算线上线下收款记录表金额)
     private Double returnBalanceAmount;// 退款余额金额
     private Double returnBalanceAmount;// 退款余额金额
+    private Integer newReceiptType;//收款款项二级类别1.上架费2.订单返佣3.认证通会员4.认证通企划
+    private String shopOrderNo;
+    private Integer shopOrderId;//子订单id
+    private Double productAmount;//订单总金额
+    private Double needPayAmount;//应收金额
+    private String shopName;
+    private String checkMan;
+    private String  shopOrderNos;
+    private String jgName;//机构名称
+
+
+
+    public String getJgName() {
+        return jgName;
+    }
+
+    public void setJgName(String jgName) {
+        this.jgName = jgName;
+    }
+
+    public Double getNeedPayAmount() {
+        return needPayAmount;
+    }
+
+    public void setNeedPayAmount(Double needPayAmount) {
+        this.needPayAmount = needPayAmount;
+    }
+
+    public Double getProductAmount() {
+        return productAmount;
+    }
+
+    public void setProductAmount(Double productAmount) {
+        this.productAmount = productAmount;
+    }
+
+    public Integer getShopOrderId() {
+        return shopOrderId;
+    }
+
+    public void setShopOrderId(Integer shopOrderId) {
+        this.shopOrderId = shopOrderId;
+    }
+
+    public String getShopOrderNos() {
+        return shopOrderNos;
+    }
+
+    public void setShopOrderNos(String shopOrderNos) {
+        this.shopOrderNos = shopOrderNos;
+    }
+
+    public String getCheckMan() {
+        return checkMan;
+    }
+
+    public void setCheckMan(String checkMan) {
+        this.checkMan = checkMan;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getShopOrderNo() {
+        return shopOrderNo;
+    }
+
+    public void setShopOrderNo(String shopOrderNo) {
+        this.shopOrderNo = shopOrderNo;
+    }
 
 
     public String getBalanceAccountsRemark() {
     public String getBalanceAccountsRemark() {
         return balanceAccountsRemark;
         return balanceAccountsRemark;
@@ -77,6 +152,13 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
         this.balanceAccountsRemark = balanceAccountsRemark;
         this.balanceAccountsRemark = balanceAccountsRemark;
     }
     }
 
 
+    public Integer getNewReceiptType() {
+        return newReceiptType;
+    }
+
+    public void setNewReceiptType(Integer newReceiptType) {
+        this.newReceiptType = newReceiptType;
+    }
 
 
     public String getBackName() {
     public String getBackName() {
         return backName;
         return backName;

+ 11 - 1
src/main/java/com/caimei/modules/order/entity/CmReceiptOrderRelation.java

@@ -48,6 +48,16 @@ public class CmReceiptOrderRelation extends DataEntity<CmReceiptOrderRelation> {
      */
      */
     private String payWay;
     private String payWay;
 
 
+    private Integer newReceiptType;
+
+    public Integer getNewReceiptType() {
+        return newReceiptType;
+    }
+
+    public void setNewReceiptType(Integer newReceiptType) {
+        this.newReceiptType = newReceiptType;
+    }
+
     public Integer getSplitStatus() {
     public Integer getSplitStatus() {
         return splitStatus;
         return splitStatus;
     }
     }
@@ -165,4 +175,4 @@ public class CmReceiptOrderRelation extends DataEntity<CmReceiptOrderRelation> {
     public void setConfirmType(String confirmType) {
     public void setConfirmType(String confirmType) {
         this.confirmType = confirmType;
         this.confirmType = confirmType;
     }
     }
-}
+}

+ 9 - 0
src/main/java/com/caimei/modules/order/entity/ReceiptDetailVo.java

@@ -32,6 +32,15 @@ public class ReceiptDetailVo {
     private ReceiptVipInfoVo vipInfo;// 一个收款关联一个会员记录
     private ReceiptVipInfoVo vipInfo;// 一个收款关联一个会员记录
     private ReceipCouponInfoVo couponInfo;//优惠券购买记录
     private ReceipCouponInfoVo couponInfo;//优惠券购买记录
     private boolean receiptOrderFlag;// 判断订单中抹平的订单是否是和多个订单一起支付的,
     private boolean receiptOrderFlag;// 判断订单中抹平的订单是否是和多个订单一起支付的,
+    private String shopName;
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
 
 
     public ReceiptVipInfoVo getVipInfo() {
     public ReceiptVipInfoVo getVipInfo() {
         return vipInfo;
         return vipInfo;

+ 4 - 0
src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java

@@ -59,6 +59,10 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
         return super.get(id);
         return super.get(id);
     }
     }
 
 
+    public CmDiscernReceipt orderlist(CmDiscernReceipt cmDiscernReceipt) {
+        return cmDiscernReceiptDao.orderlist(cmDiscernReceipt);
+    }
+
     public List<CmDiscernReceipt> findList(CmDiscernReceipt cmDiscernReceipt) {
     public List<CmDiscernReceipt> findList(CmDiscernReceipt cmDiscernReceipt) {
         return super.findList(cmDiscernReceipt);
         return super.findList(cmDiscernReceipt);
     }
     }

+ 24 - 24
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -275,19 +275,23 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 //主订单总佣金
                 //主订单总佣金
                 Double income = newShopOrderDao.findIncome(so.getOrderID());
                 Double income = newShopOrderDao.findIncome(so.getOrderID());
                 so.setIncome(income);
                 so.setIncome(income);
-               //若成本下降太多导致部分收款的钱,已经大于成本重新计算佣金
-                if("0".equals(newOrder.getOnlinePayFlag()) && so.getShopReceiptStatus()==2){
-                    double mum= so.getProductAmount();
+                //若成本下降太多导致部分收款的钱,已经大于成本重新计算佣金
+                if ("0".equals(newOrder.getOnlinePayFlag()) && so.getShopReceiptStatus() == 2) {
+                    double mum = so.getProductAmount();
                     System.out.println(so.getReceiptTotalFee());
                     System.out.println(so.getReceiptTotalFee());
                     System.out.println(so.getShouldPayShopAmount());
                     System.out.println(so.getShouldPayShopAmount());
                     BigDecimal getShouldPayShopAmount = MathUtil.sub(so.getShouldPayShopAmount(), so.getDifferencePrice());
                     BigDecimal getShouldPayShopAmount = MathUtil.sub(so.getShouldPayShopAmount(), so.getDifferencePrice());
-                    if(so.getReceiptTotalFee()>Double.valueOf(getShouldPayShopAmount.toString())){
+                    if (so.getReceiptTotalFee() > Double.valueOf(getShouldPayShopAmount.toString())) {
                         //子订单佣金
                         //子订单佣金
 
 
-                        mum-= so.getShopOtherFee()+Double.valueOf(getShouldPayShopAmount.toString());
+                        mum -= so.getShopOtherFee() + Double.valueOf(getShouldPayShopAmount.toString());
                         so.setBrokerage(mum);
                         so.setBrokerage(mum);
-                    }else { so.setBrokerage(null);}
-                }else { so.setBrokerage(null);}
+                    } else {
+                        so.setBrokerage(null);
+                    }
+                } else {
+                    so.setBrokerage(null);
+                }
                 //要是不大于成本默认显示
                 //要是不大于成本默认显示
 
 
             }
             }
@@ -321,8 +325,15 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     collect = records.stream().collect(Collectors.summingDouble(CmRefundShopRecord::getRefundAmount));
                     collect = records.stream().collect(Collectors.summingDouble(CmRefundShopRecord::getRefundAmount));
                 }
                 }
                 so.setRefundAmount(collect);
                 so.setRefundAmount(collect);
+                so.setWaitPayShop((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
                 if ("1".equals(cmPayShopRecord.getStatus())) {
                 if ("1".equals(cmPayShopRecord.getStatus())) {
-                    so.setWaitPayShop(so.getShouldPayShopAmount() - (so.getPayedShopAmount() == null ? 0D : (so.getPayedShopAmount() - collect)));
+                    if (so.getDifferenceType() != null && so.getDifferenceType() == 1) {
+                        BigDecimal waitPayShop = MathUtil.add(so.getWaitPayShop(), so.getDifferencePrice());
+                        so.setWaitPayShop(waitPayShop.doubleValue());
+                    } else if (so.getDifferenceType() != null && so.getDifferenceType() == 2) {
+                        BigDecimal waitPayShop = MathUtil.sub(so.getWaitPayShop(), so.getDifferencePrice());
+                        so.setWaitPayShop(waitPayShop.doubleValue());
+                    }
                 } else {
                 } else {
                     so.setWaitPayShop(cmPayShopRecord.getPayAmount());
                     so.setWaitPayShop(cmPayShopRecord.getPayAmount());
                 }
                 }
@@ -944,7 +955,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         BigDecimal waitPayShop = BigDecimal.ZERO;
         BigDecimal waitPayShop = BigDecimal.ZERO;
         if (shopOrder != null) {
         if (shopOrder != null) {
             payShopDifference.setPayStatus(shopOrder.getPayStatus());
             payShopDifference.setPayStatus(shopOrder.getPayStatus());
-            waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
+            waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getDifferencePrice());
             NewCmShop shop = newCmShopDao.get(shopOrder.getShopID().toString());
             NewCmShop shop = newCmShopDao.get(shopOrder.getShopID().toString());
             payShopDifference.setBankAccount(shop.getBankAccount());
             payShopDifference.setBankAccount(shop.getBankAccount());
             payShopDifference.setBankAccountName(shop.getBankAccountName());
             payShopDifference.setBankAccountName(shop.getBankAccountName());
@@ -955,7 +966,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             payShopDifference.setRebateAmount(BigDecimal.valueOf(rebateAmount));
             payShopDifference.setRebateAmount(BigDecimal.valueOf(rebateAmount));
             payShopDifference.setType(shopOrder.getDifferenceType());
             payShopDifference.setType(shopOrder.getDifferenceType());
             payShopDifference.setDifferencePrice(shopOrder.getDifferencePrice());
             payShopDifference.setDifferencePrice(shopOrder.getDifferencePrice());
-            payShopDifference.setShopReceiptStatus( shopOrder.getShopReceiptStatus());
+            payShopDifference.setShopReceiptStatus(shopOrder.getShopReceiptStatus());
         }
         }
         payShopDifference.setWaitPayShop(waitPayShop);
         payShopDifference.setWaitPayShop(waitPayShop);
         return payShopDifference;
         return payShopDifference;
@@ -1039,6 +1050,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
 
 
         //待付供应商金额
         //待付供应商金额
         BigDecimal waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
         BigDecimal waitPayShop = MathUtil.sub(shopOrder.getShouldPayShopAmount(), shopOrder.getPayedShopAmount());
+//       List<Integer> payWay= newShopOrderDao.payWay(shopOrderId);
+//       if(payWay==1 && shopOrder.getShopReceiptStatus()==2) {
         if (payShopDifference.getType() == 2 && MathUtil.compare(differencePrice, waitPayShop) > 0) {
         if (payShopDifference.getType() == 2 && MathUtil.compare(differencePrice, waitPayShop) > 0) {
             //多付且差价大于待付金额,会发生供应商退款操作
             //多付且差价大于待付金额,会发生供应商退款操作
             BigDecimal waitRefund = MathUtil.sub(differencePrice, waitPayShop);
             BigDecimal waitRefund = MathUtil.sub(differencePrice, waitPayShop);
@@ -1097,14 +1110,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 throw new Exception("退款金额异常");
                 throw new Exception("退款金额异常");
             }
             }
         }
         }
+//       }
         payShopDifference.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
         payShopDifference.setModifyUserId(Integer.parseInt(UserUtils.getUser().getId()));
         cmPayShopRecordDao.insertDifference(payShopDifference);
         cmPayShopRecordDao.insertDifference(payShopDifference);
         if (!("3".equals(shopOrder.getPayStatus()) && 1 == payShopDifference.getType())) {
         if (!("3".equals(shopOrder.getPayStatus()) && 1 == payShopDifference.getType())) {
             newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
             newShopOrderDao.updateByDifferencePrice(payShopDifference.getType(), differencePrice, shopOrderId);
         }
         }
-
-
-
     }
     }
 
 
     public ChangePayShopOther shopOtherApplyEdit(Integer payShopId) {
     public ChangePayShopOther shopOtherApplyEdit(Integer payShopId) {
@@ -1293,17 +1304,6 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     newOrderDao.insertSettleRecord(settleRecord);
                     newOrderDao.insertSettleRecord(settleRecord);
                     // 修改cm_split_account settlestatus
                     // 修改cm_split_account settlestatus
                     newOrderDao.updateSettleStatus(shopOrderId, 3);
                     newOrderDao.updateSettleStatus(shopOrderId, 3);
-                    //计算供应商成本,结算金额,修改结算状态
-                    Double shouldPayShopAmount = newOrderDao.findShouldPayShopAmount(shopOrderId);
-                    //计算供应商成本,结算金额,修改结算状态
-                    Double settleSum = newOrderDao.findSettleSum(shopOrderId);
-                    if (shouldPayShopAmount > settleSum) {
-                        //成本>结算金额,部分结算
-                        newOrderDao.updateShopOrderSettleStatus(shopOrderId, 2);
-                    } else {
-                        //成本=结算金额 全部结算
-                        newOrderDao.updateShopOrderSettleStatus(shopOrderId, 3);
-                    }
                 }
                 }
                 //解锁
                 //解锁
                 redisService.remove("SDJSS");
                 redisService.remove("SDJSS");

+ 3 - 2
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -292,7 +292,8 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             } else {
             } else {
                 so.setReceiptStatus("1");
                 so.setReceiptStatus("1");
             }
             }
-            Double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(so.getOrderID().toString());
+            double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(so.getOrderID().toString());
+
             so.setReceiptTotalFee(receiptTotalFee);
             so.setReceiptTotalFee(receiptTotalFee);
 
 
             //第一次收款收款时间
             //第一次收款收款时间
@@ -693,7 +694,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         return newShopOrderDao.findSettleRecord(shopOrderID);
         return newShopOrderDao.findSettleRecord(shopOrderID);
     }
     }
 
 
-    public Integer payWay(Integer shoprderID){
+    public List<Integer> payWay(Integer shoprderID){
         return newShopOrderDao.payWay(shoprderID);
         return newShopOrderDao.payWay(shoprderID);
     }
     }
 }
 }

+ 9 - 2
src/main/java/com/caimei/modules/order/web/CmDiscernReceiptController.java

@@ -99,11 +99,14 @@ public class CmDiscernReceiptController extends BaseController {
             model.addAttribute("endTime", cmDiscernReceipt.getEndTime());
             model.addAttribute("endTime", cmDiscernReceipt.getEndTime());
             cmDiscernReceipt.setEndTime(cmDiscernReceipt.getEndTime().trim() + " 23:59:59");
             cmDiscernReceipt.setEndTime(cmDiscernReceipt.getEndTime().trim() + " 23:59:59");
         }
         }
+//        String list=cmDiscernReceiptService.discern(cmDiscernReceipt.getId());
+//        logger.info("+++++++++++++++++"+cmDiscernReceipt.getId());
         Page<CmDiscernReceipt> page = cmDiscernReceiptService.findPage(new Page<CmDiscernReceipt>(request, response), cmDiscernReceipt);
         Page<CmDiscernReceipt> page = cmDiscernReceiptService.findPage(new Page<CmDiscernReceipt>(request, response), cmDiscernReceipt);
         //获取组织列表
         //获取组织列表
         List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
         List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
+
         model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
         model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
-        //
+//        model.addAttribute("list", list);
         model.addAttribute("page", page);
         model.addAttribute("page", page);
         return "modules/order/cmDiscernReceiptList";
         return "modules/order/cmDiscernReceiptList";
     }
     }
@@ -140,7 +143,11 @@ public class CmDiscernReceiptController extends BaseController {
     @RequestMapping(value = "detail")
     @RequestMapping(value = "detail")
     public String detail(CmDiscernReceipt cmDiscernReceipt, Model model) {
     public String detail(CmDiscernReceipt cmDiscernReceipt, Model model) {
         ReceiptDetailVo vo = cmDiscernReceiptService.detail(cmDiscernReceipt);
         ReceiptDetailVo vo = cmDiscernReceiptService.detail(cmDiscernReceipt);
+        CmDiscernReceipt op=cmDiscernReceiptService.orderlist(cmDiscernReceipt);
         model.addAttribute("vo", vo);
         model.addAttribute("vo", vo);
+        model.addAttribute("op", op);
+        model.addAttribute("checkMan",cmDiscernReceipt.getCheckMan());
+
         return "modules/order/cmDiscernReceiptForm";
         return "modules/order/cmDiscernReceiptForm";
     }
     }
 
 
@@ -1368,4 +1375,4 @@ public class CmDiscernReceiptController extends BaseController {
         }
         }
         return Double.parseDouble(data);
         return Double.parseDouble(data);
     }
     }
-}
+}

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

@@ -17,6 +17,7 @@ public interface ProductDao extends CrudDao<Product> {
     List<ActType> getAllActType();
     List<ActType> getAllActType();
 
 
 
 
+
     int saveSort(@Param("sort") String sort, @Param("id") String id);
     int saveSort(@Param("sort") String sort, @Param("id") String id);
 
 
     int findLadderPriceByNum(@Param("productID") String productID);
     int findLadderPriceByNum(@Param("productID") String productID);
@@ -172,6 +173,10 @@ public interface ProductDao extends CrudDao<Product> {
 
 
     List<Product> findProductImage(Product product);
     List<Product> findProductImage(Product product);
 
 
+    List<Product> newfindProductImage(Product product);
+
+    Product productList(Product product);
+
     void insertProductDetailInfo(ProductDetailInfo productDetailInfo);
     void insertProductDetailInfo(ProductDetailInfo productDetailInfo);
 
 
     String findProductDetail(Integer productID);
     String findProductDetail(Integer productID);

+ 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);
     void updateByPrimaryKeySelective(Product product);
 
 
+    Integer newFloorId();
+
     List<ProductImage> getImageList(@Param("productId") Integer productId);
     List<ProductImage> getImageList(@Param("productId") Integer productId);
 
 
     void updateImageSort(@Param("productImageID") Integer productImageID, @Param("sortIndex")  Integer sortIndex);
     void updateImageSort(@Param("productImageID") Integer productImageID, @Param("sortIndex")  Integer sortIndex);

+ 12 - 0
src/main/java/com/caimei/modules/product/entity/CmSecondHandDetail.java

@@ -98,6 +98,18 @@ public class CmSecondHandDetail extends DataEntity<CmSecondHandDetail> {
     private String image5;
     private String image5;
     private String editFlag;//编辑标记,1是编辑,其他都不是
     private String editFlag;//编辑标记,1是编辑,其他都不是
     private String visibility;     //商品可见度:(3:所有人可见,2:普通机构可见,1:会员机构可见)
     private String visibility;     //商品可见度:(3:所有人可见,2:普通机构可见,1:会员机构可见)
+    /*
+     *发布类型1.二手预成交商品 2.二手估价商品
+     */
+    private Integer announType;
+
+    public Integer getAnnounType() {
+        return announType;
+    }
+
+    public void setAnnounType(Integer announType) {
+        this.announType = announType;
+    }
 
 
     public String getSplitCode() {
     public String getSplitCode() {
         return splitCode;
         return splitCode;

+ 101 - 7
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.beans.Transient;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -224,6 +225,106 @@ public class Product extends DataEntity<Product> {
      */
      */
     private Integer searchType;
     private Integer searchType;
 
 
+    /*
+    *发布类型1.二手预成交商品 2.二手估价商品
+     */
+    private Integer announType;
+
+    /**
+     * 新品商品状态  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;
+    }
+
+    public void setShowFlag(Integer showFlag) {
+        this.showFlag = showFlag;
+    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public String getShowTime() {
+        return 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;
+    }
+
+    public void setRecommend(Integer recommend) {
+        this.recommend = recommend;
+    }
+
+    public Integer getNewvalidFlag() {
+        return newvalidFlag;
+    }
+
+    public void setNewvalidFlag(Integer newvalidFlag) {
+        this.newvalidFlag = newvalidFlag;
+    }
+
+    public String getBeautyActFlag() {
+        return beautyActFlag;
+    }
+
+    public void setBeautyActFlag(String beautyActFlag) {
+        this.beautyActFlag = beautyActFlag;
+    }
+
+    public Integer getAnnounType() {
+        return announType;
+    }
+
+    public void setAnnounType(Integer announType) {
+        this.announType = announType;
+    }
+
     public Double getSqlCostProportional() {
     public Double getSqlCostProportional() {
         return sqlCostProportional;
         return sqlCostProportional;
     }
     }
@@ -513,13 +614,6 @@ public class Product extends DataEntity<Product> {
         this.priceFlag = priceFlag;
         this.priceFlag = priceFlag;
     }
     }
 
 
-    public String getbeautyActFlag() {
-        return beautyActFlag;
-    }
-
-    public void setbeautyActFlag(String beautyActFlag) {
-        this.beautyActFlag = beautyActFlag;
-    }
 
 
     public String getLadderPriceFlag() {
     public String getLadderPriceFlag() {
         return ladderPriceFlag;
         return ladderPriceFlag;

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

@@ -8,6 +8,9 @@ import com.caimei.modules.hehe.entity.CmHeheActivityProduct;
 import com.caimei.modules.hehe.entity.CmHeheCollageProduct;
 import com.caimei.modules.hehe.entity.CmHeheCollageProduct;
 import com.caimei.modules.hehe.entity.CmHeheFloorProduct;
 import com.caimei.modules.hehe.entity.CmHeheFloorProduct;
 import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.hehe.entity.CmHeheProduct;
+import com.caimei.modules.newhome.dao.NewPageFloorDao;
+import com.caimei.modules.newhome.entity.NewPageFloorImage;
+import com.caimei.modules.opensearch.GenerateUtils;
 import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.dao.ProductNewDao;
 import com.caimei.modules.product.dao.ProductNewDao;
@@ -16,6 +19,7 @@ import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.caimei.modules.user.dao.NewCmShopDao;
 import com.caimei.modules.user.dao.NewCmShopDao;
 import com.caimei.po.ProductImage;
 import com.caimei.po.ProductImage;
 import com.caimei.po.ProductLadderPrice;
 import com.caimei.po.ProductLadderPrice;
+import com.caimei.redis.RedisService;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.service.CrudService;
@@ -24,6 +28,7 @@ import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.modules.sys.entity.User;
 import com.thinkgem.jeesite.modules.sys.entity.User;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
@@ -45,6 +50,10 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
     @Autowired
     @Autowired
     ProductNewDao productNewDao;
     ProductNewDao productNewDao;
     @Autowired
     @Autowired
+    RedisService redisService;
+    @Autowired
+    GenerateUtils generateUtils;
+    @Autowired
     ProductDao productDao;
     ProductDao productDao;
     @Autowired
     @Autowired
     private CmPromotionDao cmPromotionDao;
     private CmPromotionDao cmPromotionDao;
@@ -59,8 +68,11 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
     @Autowired
     @Autowired
     private CmHeheFloorProductDao cmHeheFloorProductDao;
     private CmHeheFloorProductDao cmHeheFloorProductDao;
     @Autowired
     @Autowired
+    private NewPageFloorDao newPageFloorDao;
+    @Autowired
     private ProductService productService;
     private ProductService productService;
-
+    @Value("${wwwServer}")
+    private String domain;
     @Override
     @Override
     public Product get(String id) {
     public Product get(String id) {
         return super.get(id);
         return super.get(id);
@@ -201,12 +213,58 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         }
         }
     }
     }
 
 
-    public void auditProduct(String validFlag, String beforeValidFlag, Integer productID) {
+    public void auditProduct(String validFlag,Integer newvalidFlag,String showtime, String beforeValidFlag, Integer productID) throws Exception{
         Product product = new Product();
         Product product = new Product();
         product.setProductID(productID);
         product.setProductID(productID);
         product.setValidFlag(validFlag);
         product.setValidFlag(validFlag);
         product.setBeforeValidFlag(beforeValidFlag);
         product.setBeforeValidFlag(beforeValidFlag);
+        product.setNewvalidFlag(newvalidFlag);
+        product.setShowTime(showtime);
+        SimpleDateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String createDates = formatters.format(new Date());
+        product.setNewshowTime(createDates);
+
+        NewPageFloorImage floorImage=new NewPageFloorImage();
+        floorImage.setFloorId(productNewDao.newFloorId());
+        floorImage.setImage(product.getMainImage());
+        floorImage.setProductId(productID);
+        floorImage.setShopName(product.getShopName());
+        String link="";
+
+        if(domain.contains("-b")){
+            link="https://www-b.caimei365.com/product-"+productID+".html";
+        }else if(domain.contains("localhost")){
+           link="http://localhost:8081/product-"+productID+".html";
+        }else {
+            link="https://www.caimei365.com/product-"+productID+".html";
+        }
+        floorImage.setLink(link);
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String createDate = formatter.format(new Date());
+        floorImage.setCreateDate(createDate);
+        floorImage.setName(product.getName());
+        newPageFloorDao.insertFloorImage(floorImage);
+        product.setFloorId( productNewDao.newFloorId());
         productNewDao.updateByPrimaryKeySelective(product);
         productNewDao.updateByPrimaryKeySelective(product);
+        cleanRedisCache();
+
+    }
+    public void cleanRedisCache() {
+        //清除活动专题缓存
+        redisService.removePattern("getPageFloorData*");
+        //清除活动专题缓存
+        redisService.removePattern("activityData*");
+        //清除产品仪器缓存
+        redisService.removePattern("instrumentData*");
+        redisService.removePattern("insCommodityData*");
+        //首页缓存
+        String homeData = "getHomeData*";
+        redisService.removePattern(homeData);
+        redisService.removePattern("getHomeCommodityData*");
+        // 重新生成静态首页
+
+        generateUtils.generateHome();
+
     }
     }
 
 
     public Map<String, Object> findPromotionStatus(String validFlag, Integer productId) {
     public Map<String, Object> findPromotionStatus(String validFlag, Integer productId) {

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

@@ -4,6 +4,7 @@ import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.brand.dao.CmBrandDao;
 import com.caimei.modules.brand.dao.CmBrandDao;
 import com.caimei.modules.brand.entity.CmBrand;
 import com.caimei.modules.brand.entity.CmBrand;
 import com.caimei.modules.common.utils.UploadUtils;
 import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.newhome.dao.NewPageFloorDao;
 import com.caimei.modules.product.dao.*;
 import com.caimei.modules.product.dao.*;
 import com.caimei.modules.product.entity.*;
 import com.caimei.modules.product.entity.*;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.caimei.modules.sys.utils.UploadImageUtils;
@@ -45,6 +46,8 @@ public class ProductService extends CrudService<ProductDao, Product> {
     private CmTinytypeDao cmTinytypeDao;
     private CmTinytypeDao cmTinytypeDao;
     @Resource
     @Resource
     private ProductNewDao productNewDao;
     private ProductNewDao productNewDao;
+    @Autowired
+    NewPageFloorDao newPageFloorDao;
 
 
     @Override
     @Override
     public Product get(String id) {
     public Product get(String id) {
@@ -388,6 +391,14 @@ public class ProductService extends CrudService<ProductDao, Product> {
             }
             }
         }
         }
         product.setQualificationImg(res);
         product.setQualificationImg(res);
+        if(product.getNewProductType()==1){
+            product.setShowFlag(1);
+        }else if(product.getNewProductType()==2){
+            product.setShowFlag(3);
+        }
+        if(product.getVisibility()==null){
+            product.setVisibility("3");
+        }
 //        if(StringUtils.isNotBlank(product.getSplitCode())&&"0".equals(product.getSplitCode())){
 //        if(StringUtils.isNotBlank(product.getSplitCode())&&"0".equals(product.getSplitCode())){
 //            product.setSplitCode(null);
 //            product.setSplitCode(null);
 //        }
 //        }
@@ -405,6 +416,10 @@ public class ProductService extends CrudService<ProductDao, Product> {
             if(StringUtils.isNotBlank(product.getCostProportional())){
             if(StringUtils.isNotBlank(product.getCostProportional())){
                 product.setSqlCostProportional(Double.valueOf(product.getCostProportional()));
                 product.setSqlCostProportional(Double.valueOf(product.getCostProportional()));
             }
             }
+
+
+
+            //保存商品信息
             productDao.insert(product);
             productDao.insert(product);
             productDetailInfo.setProductID(product.getProductID());
             productDetailInfo.setProductID(product.getProductID());
             // 保存商品图片
             // 保存商品图片
@@ -550,6 +565,43 @@ public class ProductService extends CrudService<ProductDao, Product> {
         return productPage;
         return productPage;
     }
     }
 
 
+    public Page<Product> newfindProductImage(Page<Product> page, Product product) {
+        product.setPage(page);
+        List<Product> productList = productDao.newfindProductImage(product);
+        int num=0;
+
+        for (int i=0;i<productList.size();i++){
+            Date currentTime = new Date();
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                String dateString = formatter.format(currentTime);
+            /**
+             *如果有设置展示开始时间就当前时间判断,如果没有就用商品创建时间判断当前时间;
+             */
+                if(productList.get(i).getShowTime()!=null){
+                    num=productList.get(i).getShowTime().compareTo(dateString);
+                }else if(productList.get(i).getAddTime()!=null) {
+                    num=productList.get(i).getAddTime().compareTo(dateString);
+                }
+            if(num<0){
+              product.setShowFlag(2);
+                product.setRecommend(0);
+                product.setProductID(productList.get(i).getProductID());
+                newPageFloorDao.updatshowFlag(product);
+                //这里主要是解决页面上加载数据冲突问题没有调用get方法不会空指针异常?
+                product.setProductID(null);
+                product.setShowFlag(null);
+            }
+
+        }
+        page.setList(productList);
+        return page;
+   }
+
+    public Product productList(Product product){
+
+        return productDao.productList(product);
+    }
+
     public String findProductDetail(Integer productID) {
     public String findProductDetail(Integer productID) {
         return productDao.findProductDetail(productID);
         return productDao.findProductDetail(productID);
     }
     }

+ 110 - 5
src/main/java/com/caimei/modules/product/web/CmSecondHandDetailController.java

@@ -29,6 +29,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.InitBinder;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -193,7 +194,100 @@ public class CmSecondHandDetailController extends BaseController {
         model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
         model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
         return "modules/product/cmSecondHandDetailForm";
         return "modules/product/cmSecondHandDetailForm";
     }
     }
-//   http://192.168.2.101/api/2022%E5%B9%B4/2022%E5%B9%B4%E5%B0%8F%E9%9C%80%E6%B1%82
+    @RequestMapping(value = "cmSecondDetailForm")
+    public String cmSecondDetailForm(CmSecondHandDetail cmSecondHandDetail,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
+        // 解析二手商品小分类
+        List<BigType> bigTypeList = new ArrayList<>();
+        String instrumentType = cmSecondHandDetail.getInstrumentType();
+        if (StringUtils.isNoneEmpty(instrumentType)) {
+            String[] split = instrumentType.split(",");
+            int length = split.length;
+            bigTypeList = initList(bigTypeList, length, split);
+        }
+        cmSecondHandDetail.setBigTypeList(bigTypeList);
+
+        // 初始化品牌
+        List<CmBrand> brandList = cmBrandService.getList();
+        model.addAttribute("brandList", brandList);
+
+        // 构造类型
+        List<BigType> typeList = new ArrayList<>();
+        BigType bigType = new BigType();
+        /*BigType bigType1 = new BigType();
+        BigType bigType2 = new BigType();*/
+        bigType.setId("1");
+        bigType.setName("美容仪器");
+/*        bigType1.setId("2");
+        bigType1.setName("重光电");
+        bigType2.setId("3");
+        bigType2.setName("耗材配件");*/
+        typeList.add(bigType);
+        /*typeList.add(bigType1);
+        typeList.add(bigType2);*/
+        model.addAttribute("typeList", typeList);
+
+        //初始化城市信息
+        Integer townId = cmSecondHandDetail.getTownId();
+        if (null != townId) {
+            Address addByTownId = cmSecondHandTransactionService.getAddByTownId(townId);
+            if (null != addByTownId) {
+                String province = addByTownId.getProvince();
+                String city = addByTownId.getCity();
+                String town = addByTownId.getTown();
+                cmSecondHandDetail.setProvince(province);
+                cmSecondHandDetail.setCity(city);
+                cmSecondHandDetail.setTown(town);
+            }
+        }
+
+        // 初始化到期时间
+        Date onLineDate = cmSecondHandDetail.getOnLineDate();
+        if (null != onLineDate) {
+            // 计算是否还在180天内有效
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(onLineDate);
+            //设置为day月前
+            ca.add(Calendar.MONTH, 3);
+            onLineDate = ca.getTime();
+            cmSecondHandDetail.setOnLineDate(onLineDate);
+        }
+
+        // 初始化商品图片
+        List<String> imaglist = new ArrayList<String>();
+        List<ProductImage> imageList = productNewService.getImageList(cmSecondHandDetail.getProductID());
+        if (CollectionUtils.isNotEmpty(imageList) && imageList.size() > 0) {
+            for (int i = 1; i <= imageList.size(); i++) {
+                if (i == 1) {
+                    cmSecondHandDetail.setImage1(imageList.get(i - 1).getImage());
+                }
+                if (i == 2) {
+                    cmSecondHandDetail.setImage2(imageList.get(i - 1).getImage());
+                }
+                if (i == 3) {
+                    cmSecondHandDetail.setImage3(imageList.get(i - 1).getImage());
+                }
+                if (i == 4) {
+                    cmSecondHandDetail.setImage4(imageList.get(i - 1).getImage());
+                }
+                if (i == 5) {
+                    cmSecondHandDetail.setImage5(imageList.get(i - 1).getImage());
+                }
+                imaglist.add(imageList.get(i - 1).getImage());
+            }
+        }
+        cmSecondHandDetail.setImageList(imaglist);
+
+        if (StringUtils.isNotBlank(cmSecondHandDetail.getOssName()) && StringUtils.isNotBlank(cmSecondHandDetail.getFileName())) {
+            String ossUrl = OSSUtils.getOssUrl(cmSecondHandDetail.getOssName());
+            cmSecondHandDetail.setUrl(ossUrl);
+        }
+
+        cmSecondHandDetailService.setValue(cmSecondHandDetail);
+        List<SplitCode> splitCodeList = productNewDao.findSecondSplitCode(cmSecondHandDetail.getId());
+        model.addAttribute("splitCodeList",splitCodeList);
+        model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
+        return "modules/product/cmSecondDetailForm";
+    }
 
 
     @RequiresPermissions("product:cmSecondHandDetail:edit")
     @RequiresPermissions("product:cmSecondHandDetail:edit")
     @RequestMapping(value = "save")
     @RequestMapping(value = "save")
@@ -202,7 +296,7 @@ public class CmSecondHandDetailController extends BaseController {
             return form(cmSecondHandDetail, model);
             return form(cmSecondHandDetail, model);
         }
         }
         String cardNumber = cmSecondHandDetail.getCardNumber();
         String cardNumber = cmSecondHandDetail.getCardNumber();
-        if(StringUtils.isBlank(cardNumber)){
+        if(StringUtils.isBlank(cardNumber) && cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
             addMessage(redirectAttributes,"请填写收款卡号");
             addMessage(redirectAttributes,"请填写收款卡号");
             model.addAttribute("cmSecondHandDetail",cmSecondHandDetail);
             model.addAttribute("cmSecondHandDetail",cmSecondHandDetail);
             return "redirect:" + Global.getAdminPath() + "/product/new/list?searchProductCategory=2";
             return "redirect:" + Global.getAdminPath() + "/product/new/list?searchProductCategory=2";
@@ -221,13 +315,21 @@ public class CmSecondHandDetailController extends BaseController {
             cmSecondHandDetailService.insertShop(shopVo);
             cmSecondHandDetailService.insertShop(shopVo);
             shopId = shopVo.getShopID();
             shopId = shopVo.getShopID();
         }
         }
-        String[] ids = request.getParameterValues("ids");
-        List<String> fileTypes = Arrays.asList(ids);
+        String[] ids=null;
+        List<String> fileTypes =null;
+        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
+         ids = request.getParameterValues("ids");
+         fileTypes = Arrays.asList(ids);
+        }
+
         String validFlag = cmSecondHandDetail.getValidFlag();
         String validFlag = cmSecondHandDetail.getValidFlag();
         Date date = new Date();
         Date date = new Date();
         String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
         String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
         // 保存二手商品关键信息
         // 保存二手商品关键信息
         Product product = new Product();
         Product product = new Product();
+        System.out.println(cmSecondHandDetail.getAnnounType());
+        product.setAnnounType(cmSecondHandDetail.getAnnounType());
+
         product.setProductID(cmSecondHandDetail.getProductID());
         product.setProductID(cmSecondHandDetail.getProductID());
         product.setBrandID(cmSecondHandDetail.getBrandID());
         product.setBrandID(cmSecondHandDetail.getBrandID());
         // 二手商品类型
         // 二手商品类型
@@ -356,9 +458,12 @@ public class CmSecondHandDetailController extends BaseController {
             String imageUrl = getImageUrl(licenseImage);
             String imageUrl = getImageUrl(licenseImage);
             cmSecondHandDetail.setLicenseImage(imageUrl);
             cmSecondHandDetail.setLicenseImage(imageUrl);
         }
         }
+        cmSecondHandDetail.setAnnounType(2);
         // 保存二手详细信息
         // 保存二手详细信息
         cmSecondHandDetailService.save(cmSecondHandDetail);
         cmSecondHandDetailService.save(cmSecondHandDetail);
-        cmSecondHandDetailService.saveFileType(product.getProductID(), cmSecondHandDetail.getId(), fileTypes);
+        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2) {
+            cmSecondHandDetailService.saveFileType(product.getProductID(), cmSecondHandDetail.getId(), fileTypes);
+        }
         if (null != product.getProductID()) {
         if (null != product.getProductID()) {
             //删除之前图片再添加
             //删除之前图片再添加
             productNewService.deleteImageByProductId(product.getProductID());
             productNewService.deleteImageByProductId(product.getProductID());

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

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

+ 2 - 1
src/main/resources/mappings/modules/common/AreaMapper.xml

@@ -28,7 +28,8 @@
 		,c.townId as "townID"
 		,c.townId as "townID"
 		FROM province a
 		FROM province a
 			RIGHT JOIN city b ON a.provinceId = b.provinceId
 			RIGHT JOIN city b ON a.provinceId = b.provinceId
-			RIGHT JOIN town c ON b.cityId = c.cityId WHERE c.townId = #{townId}
+			RIGHT JOIN town c ON b.cityId = c.cityId WHERE  c.townId = #{townId}
+
 	</select>
 	</select>
 
 
 	<select id="loadCityById" resultType="com.caimei.modules.common.entity.City">
 	<select id="loadCityById" resultType="com.caimei.modules.common.entity.City">

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

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.newhome.dao.NewPageFloorDao">
 <mapper namespace="com.caimei.modules.newhome.dao.NewPageFloorDao">
-    
+
 	<sql id="newPageFloorColumns">
 	<sql id="newPageFloorColumns">
 		a.id AS "id",
 		a.id AS "id",
 		a.floorTitle AS "floorTitle",
 		a.floorTitle AS "floorTitle",
@@ -14,26 +14,28 @@
 		a.createDate AS "createDate",
 		a.createDate AS "createDate",
 		a.updateBy AS "updateBy.id",
 		a.updateBy AS "updateBy.id",
 		a.updateDate AS "updateDate",
 		a.updateDate AS "updateDate",
-		a.delFlag AS "delFlag"
+		a.delFlag AS "delFlag",
+        a.floorType AS "floorType"
 	</sql>
 	</sql>
-	
+
 	<sql id="newPageFloorJoins">
 	<sql id="newPageFloorJoins">
 	</sql>
 	</sql>
-    
+
 	<select id="get" resultType="NewPageFloor">
 	<select id="get" resultType="NewPageFloor">
-		SELECT 
+		SELECT
 			<include refid="newPageFloorColumns"/>
 			<include refid="newPageFloorColumns"/>
 		FROM new_page_floor a
 		FROM new_page_floor a
 		<include refid="newPageFloorJoins"/>
 		<include refid="newPageFloorJoins"/>
 		WHERE a.id = #{id}
 		WHERE a.id = #{id}
 	</select>
 	</select>
-	
+
 	<select id="findList" resultType="NewPageFloor">
 	<select id="findList" resultType="NewPageFloor">
-		SELECT 
+		SELECT
 			<include refid="newPageFloorColumns"/>
 			<include refid="newPageFloorColumns"/>
 		FROM new_page_floor a
 		FROM new_page_floor a
 		<include refid="newPageFloorJoins"/>
 		<include refid="newPageFloorJoins"/>
 		<where>
 		<where>
+			and floorType IS NULL
 			AND delFlag = 0
 			AND delFlag = 0
 		</where>
 		</where>
 		<choose>
 		<choose>
@@ -44,15 +46,38 @@
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>
-	
+
+
+	<select id="floorFindList" resultType="NewPageFloor">
+		SELECT
+		<include refid="newPageFloorColumns"/>
+		FROM new_page_floor a
+		<include refid="newPageFloorJoins"/>
+
+		<where>
+			and floorType
+
+			AND delFlag = 0
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+
+
+
 	<select id="findAllList" resultType="NewPageFloor">
 	<select id="findAllList" resultType="NewPageFloor">
-		SELECT 
+		SELECT
 			<include refid="newPageFloorColumns"/>
 			<include refid="newPageFloorColumns"/>
 		FROM new_page_floor a
 		FROM new_page_floor a
 		<include refid="newPageFloorJoins"/>
 		<include refid="newPageFloorJoins"/>
 		<where>
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
 				ORDER BY ${page.orderBy}
@@ -61,7 +86,7 @@
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>
-	
+
 	<insert id="insert" parameterType="NewPageFloor"  keyProperty="id" useGeneratedKeys="true">
 	<insert id="insert" parameterType="NewPageFloor"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO new_page_floor(
 		INSERT INTO new_page_floor(
 			floorTitle,
 			floorTitle,
@@ -70,6 +95,9 @@
 			<if test="sort != null and sort != ''" >
 			<if test="sort != null and sort != ''" >
 				sort,
 				sort,
 			</if>
 			</if>
+		<if test="floorType != null and floorType != ''" >
+			floorType,
+		</if>
 			wwwEnabledStatus,
 			wwwEnabledStatus,
 			crmEnabledStatus,
 			crmEnabledStatus,
 			createBy,
 			createBy,
@@ -84,6 +112,9 @@
 			<if test="sort != null and sort != ''" >
 			<if test="sort != null and sort != ''" >
 				#{sort},
 				#{sort},
 			</if>
 			</if>
+		<if test="floorType != null and floorType != ''" >
+			#{floorType},
+		</if>
 			#{wwwEnabledStatus},
 			#{wwwEnabledStatus},
 			#{crmEnabledStatus},
 			#{crmEnabledStatus},
 			#{createBy.id},
 			#{createBy.id},
@@ -93,13 +124,14 @@
 			#{delFlag}
 			#{delFlag}
 		)
 		)
 	</insert>
 	</insert>
-	
+
 	<update id="update">
 	<update id="update">
-		UPDATE new_page_floor SET 	
+		UPDATE new_page_floor SET
 			floorTitle = #{floorTitle},
 			floorTitle = #{floorTitle},
 			floorDetail = #{floorDetail},
 			floorDetail = #{floorDetail},
 			type = #{type},
 			type = #{type},
 			sort = #{sort},
 			sort = #{sort},
+			floorType=#{floorType},
 			wwwEnabledStatus = #{wwwEnabledStatus},
 			wwwEnabledStatus = #{wwwEnabledStatus},
 			crmEnabledStatus = #{crmEnabledStatus},
 			crmEnabledStatus = #{crmEnabledStatus},
 			createBy = #{createBy.id},
 			createBy = #{createBy.id},
@@ -109,7 +141,7 @@
 			delFlag = #{delFlag}
 			delFlag = #{delFlag}
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</update>
-	
+
 	<delete id="delete">
 	<delete id="delete">
 		UPDATE new_page_floor SET delFlag = 1
 		UPDATE new_page_floor SET delFlag = 1
 		WHERE id = #{id}
 		WHERE id = #{id}
@@ -136,6 +168,35 @@
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</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},
+		recommend=#{recommend}
+		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 id="findFloorContentByfloorId" resultType="com.caimei.modules.newhome.entity.NewPageFloorContent">
 		SELECT
 		SELECT
 		  npfc.*,
 		  npfc.*,
@@ -147,6 +208,20 @@
 		  npf.id = #{floorId}
 		  npf.id = #{floorId}
 	</select>
 	</select>
 
 
+<!--	<select id="findFloorContentById" resultType="com.caimei.modules.newhome.entity.NewPageFloorContent">-->
+<!--		SELECT-->
+<!--			npfc.*,-->
+<!--			npf.floorTitle AS floorTitle-->
+<!--		FROM product pro-->
+<!--		    LEFT JOIN new_page_floor_content npfc ON npfc.productId=pro.productID-->
+<!--			LEFT join new_page_floor npf ON npfc.floorId = npf.id-->
+
+<!--		WHERE-->
+<!--			npf.id = #{floorId}-->
+<!--	</select>-->
+
+
+
 	<select id="findFloorImage" resultType="com.caimei.modules.newhome.entity.NewPageFloorImage">
 	<select id="findFloorImage" resultType="com.caimei.modules.newhome.entity.NewPageFloorImage">
 		SELECT
 		SELECT
 		  a.id,
 		  a.id,
@@ -239,5 +314,5 @@
 			#{sort}, #{createDate}, #{centreId}, #{displaySort}
 			#{sort}, #{createDate}, #{centreId}, #{displaySort}
 		  )
 		  )
 	</insert>
 	</insert>
-	
-</mapper>
+
+</mapper>

+ 63 - 2
src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml

@@ -33,7 +33,8 @@
 		a.reviewDate AS "reviewDate",
 		a.reviewDate AS "reviewDate",
 		a.cancelDate AS "cancelDate",
 		a.cancelDate AS "cancelDate",
 		a.updateDate AS "updateDate",
 		a.updateDate AS "updateDate",
-		a.delFlag AS "delFlag"
+		a.delFlag AS "delFlag",
+        a.newReceiptType
 	</sql>
 	</sql>
 
 
     <sql id="cmDiscernReceiptJoins">
     <sql id="cmDiscernReceiptJoins">
@@ -59,10 +60,63 @@
         select  IFNULL(sum(amount),0) from cm_user_balance_record where balanceType = 2 and  receiptId = #{receiptId} and delFlag = 0;
         select  IFNULL(sum(amount),0) from cm_user_balance_record where balanceType = 2 and  receiptId = #{receiptId} and delFlag = 0;
     </select>
     </select>
 
 
+    <select id="discern" resultType="String">
+        SELECT
+            u.userID,
+            csp.id AS receiptID,
+            cms.orderID,
+            cms.shopOrderID,
+            cms.shopOrderNo,
+            cms.orderType as orderType,
+            s.name AS shopName,
+            cms.productAmount,
+            cmo.orderNo,
+            u.userName,
+            u.name AS jgName,
+            cmo.confirmTime,
+            cms.receiptAmount,
+            cms.needPayAmount
+        FROM cm_shop_order cms
+                 LEFT JOIN shop s ON s.shopID = cms.shopID
+                 LEFT JOIN cm_order cmo ON cmo.orderID = cms.orderID
+                 LEFT JOIN `user` u ON u.userID = cms.userID
+                 LEFT JOIN cm_discern_receipt csp ON csp.shopOrderID = cms.shopOrderID
+    </select>
+
+    <select id="orderlist" resultType="CmDiscernReceipt">
+        SELECT
+            u.userID,
+            csp.id AS receiptID,
+            cms.orderID,
+            cms.shopOrderID,
+            cms.shopOrderNo,
+            cms.orderType as orderType,
+            s.name AS shopName,
+            cms.productAmount,
+            cmo.orderNo,
+            u.userName,
+               u.name AS jgName,
+            cmo.confirmTime,
+            cms.receiptAmount,
+            cms.needPayAmount
+        FROM cm_shop_order cms
+                 LEFT JOIN shop s ON s.shopID = cms.shopID
+                 LEFT JOIN cm_order cmo ON cmo.orderID = cms.orderID
+                 LEFT JOIN `user` u ON u.userID = cms.userID
+                 LEFT JOIN cm_discern_receipt csp ON csp.shopOrderID = cms.shopOrderID
+                   where csp.id=#{id}
+    </select>
+
+
     <select id="findList" resultType="CmDiscernReceipt">
     <select id="findList" resultType="CmDiscernReceipt">
         -- 	relationType值为1是为子订单ID,为2时为主订单ID)
         -- 	relationType值为1是为子订单ID,为2时为主订单ID)
         SELECT
         SELECT
         <include refid="cmDiscernReceiptColumns"/>,
         <include refid="cmDiscernReceiptColumns"/>,
+        cso_s.orderID AS orderID,
+        cso_s.shopOrderNo as shopOrderNos,
+        cso.shopOrderId as shopOrderId,
+          s.checkMan,
+        s.name AS shopName,
         (case when crr.relationType = '1' then u_cr.userName else u.userName
         (case when crr.relationType = '1' then u_cr.userName else u.userName
         end) AS "userName",
         end) AS "userName",
         (case when crr.relationType = '1' then u_cr.name else u.name
         (case when crr.relationType = '1' then u_cr.name else u.name
@@ -79,6 +133,9 @@
         left join cm_shop_order cso on cso.shopOrderID = crr.orderID
         left join cm_shop_order cso on cso.shopOrderID = crr.orderID
         left join cm_order cso_cr on cso.orderID = cso_cr.orderID
         left join cm_order cso_cr on cso.orderID = cso_cr.orderID
         LEFT JOIN USER u_cr ON u_cr.userID = cso_cr.userID
         LEFT JOIN USER u_cr ON u_cr.userID = cso_cr.userID
+            -- 供应商
+        LEFT JOIN shop s ON s.shopID = cso.shopID
+        LEFT JOIN cm_shop_order cso_s ON cso_s.shopOrderID = a.shopOrderID
         <where>
         <where>
             <if test="id != null and id != '' and id != 0 ">
             <if test="id != null and id != '' and id != 0 ">
                 AND a.id = #{id}
                 AND a.id = #{id}
@@ -104,6 +161,9 @@
             <if test="receiptType != null and receiptType != ''">
             <if test="receiptType != null and receiptType != ''">
                 AND a.receiptType = #{receiptType}
                 AND a.receiptType = #{receiptType}
             </if>
             </if>
+        <if test="newReceiptType !=null and newReceiptType !=''">
+             and newReceiptType=#{newReceiptType}
+        </if>
             <if test="receiptStatus != null and receiptStatus != ''">
             <if test="receiptStatus != null and receiptStatus != ''">
                 AND a.receiptStatus = #{receiptStatus}
                 AND a.receiptStatus = #{receiptStatus}
             </if>
             </if>
@@ -548,7 +608,8 @@
 	    cdr.cancelReason AS cancelReason,
 	    cdr.cancelReason AS cancelReason,
 	    cdr.payWay AS payWay,
 	    cdr.payWay AS payWay,
 	    rup.name AS confirmer,
 	    rup.name AS confirmer,
-	    cdr.rebateRemarks AS rebateRemarks
+	    cdr.rebateRemarks AS rebateRemarks,
+        cdr.shopName as shopName
 	    from
 	    from
 		cm_discern_receipt cdr
 		cm_discern_receipt cdr
 		left join receipt_user_permission rup on cdr.confirmUserPermissionID = rup.id
 		left join receipt_user_permission rup on cdr.confirmUserPermissionID = rup.id

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

@@ -93,8 +93,10 @@
 
 
 	<select id="findByReceiptID" resultType="CmReceiptOrderRelation">
 	<select id="findByReceiptID" resultType="CmReceiptOrderRelation">
 		select
 		select
-		<include refid="cmReceiptOrderRelationColumns"/>
+		<include refid="cmReceiptOrderRelationColumns"/>,
+		b.newReceiptType
 		from  cm_receipt_order_relation a
 		from  cm_receipt_order_relation a
+		left join cm_discern_receipt b on a.receiptID = b.id
 		where a.receiptID = #{receiptID}
 		where a.receiptID = #{receiptID}
 		and a.delFlag = 0
 		and a.delFlag = 0
 	</select>
 	</select>

+ 2 - 0
src/main/resources/mappings/modules/product/CmSecondHandDetailMapper.xml

@@ -249,6 +249,8 @@
 			fileName = #{fileName},
 			fileName = #{fileName},
 			ossName = #{ossName},
 			ossName = #{ossName},
 			commitmentImage = #{commitmentImage}
 			commitmentImage = #{commitmentImage}
+
+
 		WHERE productID = #{productID}
 		WHERE productID = #{productID}
 	</update>
 	</update>
 
 

+ 227 - 161
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -85,8 +85,15 @@
 		a.trainingType as "trainingType",
 		a.trainingType as "trainingType",
 		a.trainingFee as "trainingFee",
 		a.trainingFee as "trainingFee",
 		a.commodityType as "commodityType",
 		a.commodityType as "commodityType",
-		a.splitCode
-	</sql>
+		a.splitCode,
+        a.announType,
+        ifnull(a.newvalidFlag,0),
+         ifnull(a.newProductType,2),
+        a.showFlag,
+        a.showTime,
+        a.newshowTime,
+        a.recommend
+    </sql>
 
 
 	<sql id="productJoins">
 	<sql id="productJoins">
 		LEFT JOIN shop s on s.shopID = a.shopID
 		LEFT JOIN shop s on s.shopID = a.shopID
@@ -323,161 +330,162 @@
 		</choose>
 		</choose>
 	</select>
 	</select>
 
 
-	<insert id="insert" parameterType="Product"  keyProperty="productID"  keyColumn="productID" useGeneratedKeys="true">
-		INSERT INTO product(
-			brandID,
-			bigTypeID,
-			smallTypeID,
-			tinyTypeID,
-			selfTypeID,
-			shopID,
-			aliasName,
-			name,
-			searchKey,
-			normalPrice,
-			price,
-			priceFlag,
-			beautyActFlag,
-			ladderPriceFlag,
-		    <if test="stock !=''">
-			stock,
-			</if>
-			hasSkuFlag,
-			mainImage,
-			propertiesInfo,
-			addTime,
-			updateTime,
-			weekSellNumber,
-			beforeValidFlag,
-			validFlag,
-			favoriteTimes,
-			commentScore,
-			commentTimes,
-			selfRecommendFlag,
-			sysRecommendFlag,
-			sortIndex,
-			featuredFlag,
-			featuredSortIndex,
-			productCode,
-			unit,
-			synToERPFlag,
-			allAreaFlag,
-			provinceIDs,
-			serviceNumber,
-			maxBuyNumber,
-			minBuyNumber,
-			packageCount,
-			byFlag,
-			normalProductFlag,
-			wholeSaleProductFlag,
-			promotionProductFlag,
-			groupBuyProductFlag,
-			step,
-			actFlag,
-			actType,
-			actSort,
-			onlineTime,
-			downlineTime,
-			freePostFlag,
-			costPrice,
-			costProportional,
-			costCheckFlag,
-			precisehKey,
-			visibility,
-			productType,
-			qualificationImg,
-			invoiceType,
-			taxPoint,
-			supplierTaxPoint,
-			tags,
-			recommendType,
-			machineType,
-			includedTax,
-			commodityType,
-			trainingMethod,
-			trainingType,
-			trainingFee,
-			productDescribe,
-			splitCode,
-			productDetail
-		) VALUES (
-					 #{brandID},
-					 #{bigTypeID},
-					 #{smallTypeID},
-					 #{tinyTypeID},
-					 #{selfTypeID},
-					 #{shopID},
-		          	 #{aliasName},
-					 #{name},
-					 #{searchKey},
-					 #{normalPrice},
-					 #{price},
-					 #{priceFlag},
-					 #{beautyActFlag},
-					 #{ladderPriceFlag},
-					 <if test="stock !=''">
-					 #{stock},
-					 </if>
-					 #{hasSkuFlag},
-					 #{mainImage},
-					 #{propertiesInfo},
-					 #{addTime},
-					 #{updateTime},
-					 #{weekSellNumber},
-					 #{beforeValidFlag},
-					 #{validFlag},
-					 #{favoriteTimes},
-					 #{commentScore},
-					 #{commentTimes},
-					 #{selfRecommendFlag},
-					 #{sysRecommendFlag},
-					 #{sortIndex},
-					 #{featuredFlag},
-					 #{featuredSortIndex},
-					 #{productCode},
-					 #{unit},
-					 #{synToERPFlag},
-					 #{allAreaFlag},
-					 #{provinceIDs},
-					 #{serviceNumber},
-					 #{maxBuyNumber},
-					 #{minBuyNumber},
-					 #{packageCount},
-					 #{byFlag},
-					 #{normalProductFlag},
-					 #{wholeSaleProductFlag},
-					 #{promotionProductFlag},
-					 #{groupBuyProductFlag},
-					 #{step},
-					 #{actFlag},
-					 #{actType},
-		          	 #{actSort},
-					 #{onlineTime},
-					 #{downlineTime},
-					 #{freePostFlag},
-					 #{SqlCostPrice},
-					 #{sqlCostProportional},
-					 #{costCheckFlag},
-					 #{precisehKey},
-		         	 #{visibility},
-		         	 #{productType},
-					 #{qualificationImg},
-					 #{invoiceType},
-					 #{sqlTaxPoint},
-					 #{sqlSupplierTaxPoint},
-					 #{tags},
-					 #{recommendType},
-					 #{machineType},
-					 #{includedTax},
-					 #{commodityType},
-					 #{trainingMethod},
-					 #{trainingType},
-					 #{trainingFee},
-		          	 #{productDescribe},
-					 #{splitCode},
-					 #{productDetail}
-						 )
-	</insert>
+    <insert id="insert" parameterType="Product" keyProperty="productID" keyColumn="productID" useGeneratedKeys="true">
+        INSERT INTO product(brandID,
+                            bigTypeID,
+                            smallTypeID,
+                            tinyTypeID,
+                            selfTypeID,
+                            shopID,
+                            aliasName,
+                            name,
+                            searchKey,
+                            normalPrice,
+                            price,
+                            priceFlag,
+                            beautyActFlag,
+                            ladderPriceFlag,
+                             <if test="stock !=''">
+	                        	stock,
+                            </if>
+                            hasSkuFlag,
+                            mainImage,
+                            propertiesInfo,
+                            addTime,
+                            updateTime,
+                            weekSellNumber,
+                            beforeValidFlag,
+                            validFlag,
+                            favoriteTimes,
+                            commentScore,
+                            commentTimes,
+                            selfRecommendFlag,
+                            sysRecommendFlag,
+                            sortIndex,
+                            featuredFlag,
+                            featuredSortIndex,
+                            productCode,
+                            unit,
+                            synToERPFlag,
+                            allAreaFlag,
+                            provinceIDs,
+                            serviceNumber,
+                            maxBuyNumber,
+                            minBuyNumber,
+                            packageCount,
+                            byFlag,
+                            normalProductFlag,
+                            wholeSaleProductFlag,
+                            promotionProductFlag,
+                            groupBuyProductFlag,
+                            step,
+                            actFlag,
+                            actType,
+                            actSort,
+                            onlineTime,
+                            downlineTime,
+                            freePostFlag,
+                            costPrice,
+                            costProportional,
+                            costCheckFlag,
+                            precisehKey,
+                            visibility,
+                            productType,
+                            qualificationImg,
+                            invoiceType,
+                            taxPoint,
+                            supplierTaxPoint,
+                            tags,
+                            recommendType,
+                            machineType,
+                            includedTax,
+                            commodityType,
+                            trainingMethod,
+                            trainingType,
+                            trainingFee,
+                            productDescribe,
+                            splitCode,
+                            productDetail,
+                            announType,
+							newProductType,
+							showFlag)
+        VALUES (#{brandID},
+                #{bigTypeID},
+                #{smallTypeID},
+                #{tinyTypeID},
+                #{selfTypeID},
+                #{shopID},
+                #{aliasName},
+                #{name},
+                #{searchKey},
+                #{normalPrice},
+                #{price},
+                #{priceFlag},
+                #{beautyActFlag},
+                #{ladderPriceFlag},
+                #{stock},
+                #{hasSkuFlag},
+                #{mainImage},
+                #{propertiesInfo},
+                #{addTime},
+                #{updateTime},
+                #{weekSellNumber},
+                #{beforeValidFlag},
+                #{validFlag},
+                #{favoriteTimes},
+                #{commentScore},
+                #{commentTimes},
+                #{selfRecommendFlag},
+                #{sysRecommendFlag},
+                #{sortIndex},
+                #{featuredFlag},
+                #{featuredSortIndex},
+                #{productCode},
+                #{unit},
+                #{synToERPFlag},
+                #{allAreaFlag},
+                #{provinceIDs},
+                #{serviceNumber},
+                #{maxBuyNumber},
+                #{minBuyNumber},
+                #{packageCount},
+                #{byFlag},
+                #{normalProductFlag},
+                #{wholeSaleProductFlag},
+                #{promotionProductFlag},
+                #{groupBuyProductFlag},
+                #{step},
+                #{actFlag},
+                #{actType},
+                #{actSort},
+                #{onlineTime},
+                #{downlineTime},
+                #{freePostFlag},
+                #{SqlCostPrice},
+                #{sqlCostProportional},
+                #{costCheckFlag},
+                #{precisehKey},
+                #{visibility},
+                #{productType},
+                #{qualificationImg},
+                #{invoiceType},
+                #{sqlTaxPoint},
+                #{sqlSupplierTaxPoint},
+                #{tags},
+                #{recommendType},
+                #{machineType},
+                #{includedTax},
+                #{commodityType},
+                #{trainingMethod},
+                #{trainingType},
+                #{trainingFee},
+                #{productDescribe},
+                #{splitCode},
+                #{productDetail},
+                #{announType},
+                #{newProductType},
+                #{showFlag})
+    </insert>
 
 
 	<update id="update">
 	<update id="update">
 		UPDATE product SET
 		UPDATE product SET
@@ -535,10 +543,60 @@
 						   costProportional = #{costProportional},
 						   costProportional = #{costProportional},
 						   costCheckFlag = #{costCheckFlag},
 						   costCheckFlag = #{costCheckFlag},
 						   precisehKey = #{precisehKey},
 						   precisehKey = #{precisehKey},
-						   actSort = #{actSort}
+						   actSort = #{actSort},
+		                   <if test="newProductType ==2">
+							   newvalidFlag=null,
+						   </if>
+						   newProductType=#{newProductType}
+
 		WHERE productID = #{id}
 		WHERE productID = #{id}
 	</update>
 	</update>
+	<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="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
+			and a.newProductType = 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>
 	<update id="updateActive">
 	<update id="updateActive">
 		UPDATE product
 		UPDATE product
 		<set>
 		<set>
@@ -931,7 +989,8 @@
 		`invoiceType`,
 		`invoiceType`,
 		`recommendType`,
 		`recommendType`,
 		`combinationID`,
 		`combinationID`,
-		`combinationSort`
+		`combinationSort`,
+		announType
 		)
 		)
 		VALUES
 		VALUES
 		(
 		(
@@ -1007,7 +1066,8 @@
 		#{invoiceType},
 		#{invoiceType},
 		#{recommendType},
 		#{recommendType},
 		#{combinationID},
 		#{combinationID},
-		#{combinationSort}
+		#{combinationSort},
+		#{announType}
 		)
 		)
 	</insert>
 	</insert>
 
 
@@ -1653,7 +1713,13 @@
 			<if test="trainingFee != null">
 			<if test="trainingFee != null">
 				trainingFee = #{trainingFee},
 				trainingFee = #{trainingFee},
 			</if>
 			</if>
-				splitCode = #{splitCode}
+			<if test="newProductType ==2">
+				newvalidFlag=null,
+			</if>
+			newProductType=#{newProductType},
+			showFlag=#{showFlag},
+			announType=#{announType},
+			splitCode = #{splitCode}
 		</set>
 		</set>
 		where productID = #{productID}
 		where productID = #{productID}
 	</update>
 	</update>

+ 189 - 135
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -6,6 +6,9 @@
         <result property="name" column="name"/>
         <result property="name" column="name"/>
     </resultMap>
     </resultMap>
     <sql id="productColumns">
     <sql id="productColumns">
+        a.newvalidFlag,
+      ifnull(a.newProductType,2) as newProductType,
+        ifnull(a.announType,1) as announType,
         a.productID AS "id",
         a.productID AS "id",
         a.productID AS "productID",
         a.productID AS "productID",
         a.brandID AS "brandID",
         a.brandID AS "brandID",
@@ -118,7 +121,7 @@
         INNER JOIN smalltype AS c ON b.`smallTypeID` = c.`smallTypeID`
         INNER JOIN smalltype AS c ON b.`smallTypeID` = c.`smallTypeID`
         INNER JOIN bigtype AS d ON c.`bigTypeID` = d.`bigTypeID`
         INNER JOIN bigtype AS d ON c.`bigTypeID` = d.`bigTypeID`
     </sql>
     </sql>
-	<select id="get" resultType="Product">
+    <select id="get" resultType="Product">
         SELECT
         SELECT
         <include refid="productColumns"/>
         <include refid="productColumns"/>
         FROM product a
         FROM product a
@@ -127,7 +130,11 @@
     </select>
     </select>
 
 
     <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
     <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
-        select * from cm_product_related_parameters where productId =  #{productId}  and delFlag = 0 LIMIT 50
+        select *
+        from cm_product_related_parameters
+        where productId = #{productId}
+          and delFlag = 0
+        LIMIT 50
     </select>
     </select>
 
 
     <select id="findList" resultType="Product">
     <select id="findList" resultType="Product">
@@ -137,6 +144,7 @@
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         LEFT JOIN cm_product_activity cp on cp.productId = a.productID
         LEFT JOIN cm_product_activity cp on cp.productId = a.productID
         <where>
         <where>
+
             <if test="id !=null and id !=''">
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
                 AND a.productID=#{id}
             </if>
             </if>
@@ -152,6 +160,7 @@
             <if test="tinyTypeID != null and tinyTypeID != 0">
             <if test="tinyTypeID != null and tinyTypeID != 0">
                 AND a.tinyTypeID = #{tinyTypeID}
                 AND a.tinyTypeID = #{tinyTypeID}
             </if>
             </if>
+
             <if test="productCategory != null and productCategory != ''">
             <if test="productCategory != null and productCategory != ''">
                 AND a.productCategory = #{productCategory}
                 AND a.productCategory = #{productCategory}
                 <if test="productCategory == 2">
                 <if test="productCategory == 2">
@@ -217,8 +226,18 @@
             <if test="publishIdentity != null and publishIdentity !=''">
             <if test="publishIdentity != null and publishIdentity !=''">
                 AND cshd.publishIdentity = #{publishIdentity}
                 AND cshd.publishIdentity = #{publishIdentity}
             </if>
             </if>
+            <if test="announType !=null and announType!= '' and productCategory == 2">
+                AND a.announType=#{announType}
+            </if>
+            <if test="newvalidFlag !=null and newvalidFlag!= ''">
+                AND a.newvalidFlag=#{newvalidFlag}
+            </if>
+            <if test="newProductType !=null">
+                AND a.newProductType=#{newProductType}
+            </if>
             <if test="contactName !=null and contactName !=''">
             <if test="contactName !=null and contactName !=''">
-                AND (cshd.contactName LIKE concat('%',#{contactName},'%') or cshd.companyName LIKE concat('%',#{contactName},'%'))
+                AND (cshd.contactName LIKE concat('%',#{contactName},'%') or cshd.companyName LIKE
+                concat('%',#{contactName},'%'))
             </if>
             </if>
             <if test="sqlMap !=null and sqlMap !=''">
             <if test="sqlMap !=null and sqlMap !=''">
                 ${sqlMap.dsf}
                 ${sqlMap.dsf}
@@ -259,7 +278,7 @@
         select *
         select *
         from productimage
         from productimage
         where productID = #{productId}
         where productID = #{productId}
-        ORDER BY mainFlag DESC ,sortIndex is null,sortIndex  ASC
+        ORDER BY mainFlag DESC, sortIndex is null, sortIndex ASC
     </select>
     </select>
     <select id="getImageById" resultType="com.caimei.po.ProductImage">
     <select id="getImageById" resultType="com.caimei.po.ProductImage">
         select *
         select *
@@ -267,10 +286,14 @@
         where productImageID = #{productImageID}
         where productImageID = #{productImageID}
     </select>
     </select>
     <select id="getValidFlagByProductId" resultType="java.lang.String">
     <select id="getValidFlagByProductId" resultType="java.lang.String">
-        select validFlag from product where productID = #{productID}
+        select validFlag
+        from product
+        where productID = #{productID}
     </select>
     </select>
     <select id="getBeforeValidFlagByProductId" resultType="java.lang.String">
     <select id="getBeforeValidFlagByProductId" resultType="java.lang.String">
-        select beforeValidFlag from product where productID = #{productID}
+        select beforeValidFlag
+        from product
+        where productID = #{productID}
     </select>
     </select>
 
 
     <insert id="insert" parameterType="Product" keyProperty="id" useGeneratedKeys="true">
     <insert id="insert" parameterType="Product" keyProperty="id" useGeneratedKeys="true">
@@ -387,68 +410,68 @@
     </insert>
     </insert>
     <update id="update">
     <update id="update">
         UPDATE product
         UPDATE product
-        SET productID                   = #{id},
-            brandID                     = #{brandID},
-            tinyTypeID                  = #{tinyTypeID},
-            productCategory             = #{productCategory},
-            selfTypeID                  = #{selfTypeID},
-            shopID                      = #{shopID},
-            name                        = #{name},
-            searchKey                   = #{searchKey},
-            normalPrice                 = #{normalPrice},
-            price                       = #{price},
-            priceFlag                   = #{priceFlag},
-            beautyActFlag               = #{beautyActFlag},
-            ladderPriceFlag             = #{ladderPriceFlag},
-            stock                       = #{stock},
-            hasSkuFlag                  = #{hasSkuFlag},
-            mainImage                   = #{mainImage},
-            propertiesInfo              = #{propertiesInfo},
-            addTime                     = #{addTime},
-            updateTime                  = #{updateTime},
-            sellNumber                  = #{sellNumber},
-            weekSellNumber              = #{weekSellNumber},
-            beforeValidFlag             = #{beforeValidFlag},
-            validFlag                   = #{validFlag},
-            favoriteTimes               = #{favoriteTimes},
-            commentScore                = #{commentScore},
-            commentTimes                = #{commentTimes},
-            selfRecommendFlag           = #{selfRecommendFlag},
-            sysRecommendFlag            = #{sysRecommendFlag},
-            sortIndex                   = #{sortIndex},
-            featuredFlag                = #{featuredFlag},
-            featuredSortIndex           = #{featuredSortIndex},
-            productCode                 = #{productCode},
-            unit                        = #{unit},
-            synToERPFlag                = #{synToERPFlag},
-            allAreaFlag                 = #{allAreaFlag},
-            provinceIDs                 = #{provinceIDs},
-            serviceNumber               = #{serviceNumber},
-            maxBuyNumber                = #{maxBuyNumber},
-            minBuyNumber                = #{minBuyNumber},
-            packageCount                = #{packageCount},
-            byFlag                      = #{byFlag},
-            normalProductFlag           = #{normalProductFlag},
-            wholeSaleProductFlag        = #{wholeSaleProductFlag},
-            promotionProductFlag        = #{promotionProductFlag},
-            groupBuyProductFlag         = #{groupBuyProductFlag},
-            step                        = #{step},
-            actFlag                     = #{actFlag},
-            actType                     = #{actType},
-            onlineTime                  = #{onlineTime},
-            downlineTime                = #{downlineTime},
-            freePostFlag                = #{freePostFlag},
-            costPrice                   = #{costPrice},
-            costProportional            = #{costProportional},
-            costCheckFlag               = #{costCheckFlag},
-            precisehKey                 = #{precisehKey},
-            actSort                     = #{actSort},
-            productType                 = #{productType},
-            qualificationImg            = #{qualificationImg},
-            includedTax                 = #{includedTax},
-            invoiceType                 = #{invoiceType},
-            taxPoint                    = #{taxPoint},
-            supplierTaxPoint            = #{supplierTaxPoint}
+        SET productID            = #{id},
+            brandID              = #{brandID},
+            tinyTypeID           = #{tinyTypeID},
+            productCategory      = #{productCategory},
+            selfTypeID           = #{selfTypeID},
+            shopID               = #{shopID},
+            name                 = #{name},
+            searchKey            = #{searchKey},
+            normalPrice          = #{normalPrice},
+            price                = #{price},
+            priceFlag            = #{priceFlag},
+            beautyActFlag        = #{beautyActFlag},
+            ladderPriceFlag      = #{ladderPriceFlag},
+            stock                = #{stock},
+            hasSkuFlag           = #{hasSkuFlag},
+            mainImage            = #{mainImage},
+            propertiesInfo       = #{propertiesInfo},
+            addTime              = #{addTime},
+            updateTime           = #{updateTime},
+            sellNumber           = #{sellNumber},
+            weekSellNumber       = #{weekSellNumber},
+            beforeValidFlag      = #{beforeValidFlag},
+            validFlag            = #{validFlag},
+            favoriteTimes        = #{favoriteTimes},
+            commentScore         = #{commentScore},
+            commentTimes         = #{commentTimes},
+            selfRecommendFlag    = #{selfRecommendFlag},
+            sysRecommendFlag     = #{sysRecommendFlag},
+            sortIndex            = #{sortIndex},
+            featuredFlag         = #{featuredFlag},
+            featuredSortIndex    = #{featuredSortIndex},
+            productCode          = #{productCode},
+            unit                 = #{unit},
+            synToERPFlag         = #{synToERPFlag},
+            allAreaFlag          = #{allAreaFlag},
+            provinceIDs          = #{provinceIDs},
+            serviceNumber        = #{serviceNumber},
+            maxBuyNumber         = #{maxBuyNumber},
+            minBuyNumber         = #{minBuyNumber},
+            packageCount         = #{packageCount},
+            byFlag               = #{byFlag},
+            normalProductFlag    = #{normalProductFlag},
+            wholeSaleProductFlag = #{wholeSaleProductFlag},
+            promotionProductFlag = #{promotionProductFlag},
+            groupBuyProductFlag  = #{groupBuyProductFlag},
+            step                 = #{step},
+            actFlag              = #{actFlag},
+            actType              = #{actType},
+            onlineTime           = #{onlineTime},
+            downlineTime         = #{downlineTime},
+            freePostFlag         = #{freePostFlag},
+            costPrice            = #{costPrice},
+            costProportional     = #{costProportional},
+            costCheckFlag        = #{costCheckFlag},
+            precisehKey          = #{precisehKey},
+            actSort              = #{actSort},
+            productType          = #{productType},
+            qualificationImg     = #{qualificationImg},
+            includedTax          = #{includedTax},
+            invoiceType          = #{invoiceType},
+            taxPoint             = #{taxPoint},
+            supplierTaxPoint     = #{supplierTaxPoint}
         WHERE productID = #{id}
         WHERE productID = #{id}
     </update>
     </update>
 
 
@@ -464,9 +487,24 @@
         insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
         insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
         values (#{productID}, #{shopID}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex});
         values (#{productID}, #{shopID}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex});
     </insert>
     </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 id="updateByPrimaryKeySelective" parameterType="com.caimei.modules.product.entity.Product">
         update product
         update product
         <set>
         <set>
+            <if test="floorId != null and floorId != ''">
+                floorId=#{floorId},
+            </if>
+            <if test="newvalidFlag != null and newvalidFlag != '' ">
+                newvalidFlag=#{newvalidFlag},
+            </if>
+
             <if test="brandID != null and brandID != ''">
             <if test="brandID != null and brandID != ''">
                 brandID = #{brandID},
                 brandID = #{brandID},
             </if>
             </if>
@@ -659,78 +697,92 @@
                 machineType = #{machineType},
                 machineType = #{machineType},
             </if>
             </if>
             <if test="commodityType != null and commodityType != ''">
             <if test="commodityType != null and commodityType != ''">
-                commodityType = #{commodityType}
+                commodityType = #{commodityType},
+            </if>
+            <if test="showTime!= '' and showTime!=null">
+                showTime=#{showTime},
+            </if>
+            <if test="newshowTime !=null">
+                newshowTime=#{newshowTime},
+            </if>
+            <if test="newvalidFlag == 1">
+                showFlag=1
+            </if>
+            <if test="newvalidFlag == 2">
+                showFlag=4
             </if>
             </if>
         </set>
         </set>
         where productID = #{productID}
         where productID = #{productID}
     </update>
     </update>
     <update id="updateImageSort">
     <update id="updateImageSort">
-		update productimage set sortIndex = #{sortIndex}
-		where productImageID = #{productImageID}
+        update productimage
+        set sortIndex = #{sortIndex}
+        where productImageID = #{productImageID}
+    </update>
+    <update id="cancelImageMainFlag">
+        update productimage
+        set mainFlag = 0
+        where productID = #{productID}
+          and mainFlag = 1
+    </update>
+    <update id="setImageMainFlag">
+        update productimage
+        set mainFlag = 1
+        where productImageID = #{productImageID}
     </update>
     </update>
-	<update id="cancelImageMainFlag">
-		update productimage set mainFlag = 0
-		where productID = #{productID}
-		and mainFlag = 1
-	</update>
-	<update id="setImageMainFlag">
-		update productimage set mainFlag = 1
-		where productImageID = #{productImageID}
-	</update>
     <update id="setProductImage">
     <update id="setProductImage">
-        UPDATE product SET mainImage = #{mainImage}
+        UPDATE product
+        SET mainImage = #{mainImage}
         WHERE productID = #{productID}
         WHERE productID = #{productID}
     </update>
     </update>
     <delete id="deleteImage">
     <delete id="deleteImage">
-		DELETE FROM productimage
-		WHERE productImageID = #{productImageID}
-	</delete>
+        DELETE
+        FROM productimage
+        WHERE productImageID = #{productImageID}
+    </delete>
     <delete id="mulDeleteImage">
     <delete id="mulDeleteImage">
-		DELETE FROM productimage
-		WHERE productImageID IN
-		<foreach collection="idList" item="productImageID" index="index" open="(" separator="," close=")">
+        DELETE FROM productimage
+        WHERE productImageID IN
+        <foreach collection="idList" item="productImageID" index="index" open="(" separator="," close=")">
             #{productImageID}
             #{productImageID}
         </foreach>
         </foreach>
     </delete>
     </delete>
 
 
     <delete id="deleteParameters">
     <delete id="deleteParameters">
-        DELETE FROM cm_product_related_parameters WHERE productId = #{productId}
+        DELETE
+        FROM cm_product_related_parameters
+        WHERE productId = #{productId}
     </delete>
     </delete>
 
 
     <delete id="deleteImageByProductId">
     <delete id="deleteImageByProductId">
-        DELETE FROM productimage WHERE productID = #{productID}
+        DELETE
+        FROM productimage
+        WHERE productID = #{productID}
     </delete>
     </delete>
 
 
-    <insert id="insertParameters"  parameterType="com.caimei.modules.product.entity.ProductParameters">
-        insert into
-        cm_product_related_parameters
+    <insert id="insertParameters" parameterType="com.caimei.modules.product.entity.ProductParameters">
+        insert into cm_product_related_parameters
         (productId,
         (productId,
-        paramsName,
-        paramsContent,
-        delFlag)
-       values
-       (#{productId},
-        #{paramsName},
-        #{paramsContent},
-        #{delFlag})
+         paramsName,
+         paramsContent,
+         delFlag)
+        values (#{productId},
+                #{paramsName},
+                #{paramsContent},
+                #{delFlag})
     </insert>
     </insert>
 
 
     <insert id="insertStatusRecord">
     <insert id="insertStatusRecord">
-        INSERT INTO `product_status_record` (
-          `productId`,
-          `modifyUserId`,
-          `validFlag`,
-          `remarks`,
-          `addTime`
-        )
-        VALUES
-          (
-            #{productId},
-            #{modifyUserId},
-            #{validFlag},
-            #{remarks},
-            #{addTime}
-          )
+        INSERT INTO `product_status_record` (`productId`,
+                                             `modifyUserId`,
+                                             `validFlag`,
+                                             `remarks`,
+                                             `addTime`)
+        VALUES (#{productId},
+                #{modifyUserId},
+                #{validFlag},
+                #{remarks},
+                #{addTime})
     </insert>
     </insert>
     <insert id="addProductData">
     <insert id="addProductData">
         update product
         update product
@@ -742,36 +794,38 @@
     </insert>
     </insert>
 
 
     <select id="findAllStatusRemarks" resultType="com.caimei.modules.product.entity.ProductStatusRecord">
     <select id="findAllStatusRemarks" resultType="com.caimei.modules.product.entity.ProductStatusRecord">
-        SELECT
-          id,
-          `productId`,
-          `modifyUserId`,
-          `validFlag`,
-          `remarks`,
-          `addTime`
-        FROM
-          `product_status_record`
-        WHERE
-          productId = #{productId}
-        ORDER BY
-          addTime DESC
+        SELECT id,
+               `productId`,
+               `modifyUserId`,
+               `validFlag`,
+               `remarks`,
+               `addTime`
+        FROM `product_status_record`
+        WHERE productId = #{productId}
+        ORDER BY addTime DESC
     </select>
     </select>
     <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
     <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
-        select shopId,commercialCode as splitCode,codeDetail as codeRemark
+        select shopId, commercialCode as splitCode, codeDetail as codeRemark
         from cm_shop_splitcode
         from cm_shop_splitcode
-        where shopId=#{shopID}
+        where shopId = #{shopID}
     </select>
     </select>
     <select id="findSplitCodeByProduct" resultType="java.lang.String">
     <select id="findSplitCodeByProduct" resultType="java.lang.String">
-        select splitCode from product where productID = #{productID}
+        select splitCode
+        from product
+        where productID = #{productID}
     </select>
     </select>
     <select id="getShopIdByName" resultType="java.lang.Integer">
     <select id="getShopIdByName" resultType="java.lang.Integer">
-        select shopID from shop where name like concat('%',#{shopName},'%') order by shopID desc limit 1
+        select shopID
+        from shop
+        where name like concat('%', #{shopName}, '%')
+        order by shopID desc
+        limit 1
     </select>
     </select>
     <select id="findSecondSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
     <select id="findSecondSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
-        select css.shopId,css.commercialCode as splitCode,css.codeDetail as codeRemark
+        select css.shopId, css.commercialCode as splitCode, css.codeDetail as codeRemark
         from cm_shop_splitcode css
         from cm_shop_splitcode css
-        left join product p on p.shopID = css.shopId
-        where p.productID=#{id}
+                 left join product p on p.shopID = css.shopId
+        where p.productID = #{id}
     </select>
     </select>
 </mapper>
 </mapper>
 
 

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

@@ -6,7 +6,7 @@
     <title>申请退款退货</title>
     <title>申请退款退货</title>
     <meta name="decorator" content="default"/>
     <meta name="decorator" content="default"/>
     <style>
     <style>
-         .form-horizontal .controls{margin-left:0}
+        .form-horizontal .controls{margin-left:0}
         #increase,#decrease,.lineNum{width:30px;height:30px}
         #increase,#decrease,.lineNum{width:30px;height:30px}
         .lineNum{text-align:center}
         .lineNum{text-align:center}
         .dateInput input{width:150px}
         .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}
         .upload-content .conList ol li{width:114px;min-height:80px;text-align:center;background:#fff;position:relative;top:120px}
         .hide-pic{display:none !important}
         .hide-pic{display:none !important}
         .upload-tips{margin:10px 0}
         .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>
     </style>
     <script type="text/javascript">
     <script type="text/javascript">
         $(document).ready(function () {
         $(document).ready(function () {
@@ -173,7 +173,7 @@
         }
         }
 
 
         function showBankInfo() {
         function showBankInfo() {
-                if (${!returnOnline}){
+            if (${!returnOnline}){
                 var obj = document.getElementsByClassName("refundOfflineFee"),
                 var obj = document.getElementsByClassName("refundOfflineFee"),
                     blockEle = $('.refund-details-block');
                     blockEle = $('.refund-details-block');
                 if(obj){
                 if(obj){
@@ -266,15 +266,15 @@
     <table id="contentTable" class="table table-striped table-bordered table-condensed">
     <table id="contentTable" class="table table-striped table-bordered table-condensed">
         <tr>
         <tr>
             <td><b>退款编号:</b>
             <td><b>退款编号:</b>
-                ${empty returnedNo?'':(returnedNo)}
+                    ${empty returnedNo?'':(returnedNo)}
             </td>
             </td>
             <c:if test="${cmReturnedPurchase.refundType eq 1 or cmReturnedPurchase.refundType eq 2}">
             <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>
             <c:if test="${cmReturnedPurchase.refundType eq 3}">
             <c:if test="${cmReturnedPurchase.refundType eq 3}">
                 <td><b>退款模式:</b>
                 <td><b>退款模式:</b>
@@ -287,12 +287,12 @@
                     ${returnTime}
                     ${returnTime}
             </td>
             </td>
             <c:if test="${cmReturnedPurchase.refundType eq 1}">
             <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>
             <c:if test="${cmReturnedPurchase.refundType eq 2 or cmReturnedPurchase.refundType eq 3}">
             <c:if test="${cmReturnedPurchase.refundType eq 2 or cmReturnedPurchase.refundType eq 3}">
                 <td id="spt" hidden><b>申请金额:</b>
                 <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>
                         <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="${order.rechargeGoods ne 1 && order.rechargeGoods ne 2}">
                             <c:if test="${cmReturnedPurchase.refundBalanceFee>0}">
                             <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>
-                        <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>
                             <from:input path="refundBalanceFee" onkeyup="num(this)" placeholder="¥0.00" value="${empty cmReturnedPurchase.refundBalanceFee?'':(cmReturnedPurchase.refundBalanceFee)}"></from:input>
                         </c:if>
                         </c:if>
@@ -355,7 +355,7 @@
                         <from:input path="bankAccountName"  value="${empty cmReturnedPurchase.bankAccountName?'':(cmReturnedPurchase.bankAccountName)}"></from:input>
                         <from:input path="bankAccountName"  value="${empty cmReturnedPurchase.bankAccountName?'':(cmReturnedPurchase.bankAccountName)}"></from:input>
                         <font color="red">*</font>账号:
                         <font color="red">*</font>账号:
                         <from:input path="bankAccountNo"  value="${empty cmReturnedPurchase.bankAccountNo?'':(cmReturnedPurchase.bankAccountNo)}"></from:input>
                         <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>开户行:
                         <font color="red">*</font>开户行:
                         <from:input path="openBank"  value="${empty cmReturnedPurchase.openBank?'':(cmReturnedPurchase.openBank)}"></from:input>
                         <from:input path="openBank"  value="${empty cmReturnedPurchase.openBank?'':(cmReturnedPurchase.openBank)}"></from:input>
                         <font color="red">*</font>账户类型:
                         <font color="red">*</font>账户类型:
@@ -515,199 +515,199 @@
         </tr>
         </tr>
         <tr>
         <tr>
             <td>
             <td>
-            机构:${order.buyer}<c:if test="${order.organizeID == 3}"></c:if>
+                机构:${order.buyer}<c:if test="${order.organizeID == 3}"></c:if>
             </td>
             </td>
             <td>
             <td>
-            收货人:${order.bpOrderUserinfo.shouHuoRen}(${order.bpOrderUserinfo.mobile})
+                收货人:${order.bpOrderUserinfo.shouHuoRen}(${order.bpOrderUserinfo.mobile})
             </td>
             </td>
             <td  colspan="2">
             <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>
             </td>
         </tr>
         </tr>
     </table>
     </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>
                     <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>
                         <td>
-                            收款状态:${fns:getDictLabel(shopOrder.shopReceiptStatus,'receiptStatus' ,'' )}
+                            商品总额:¥<fmt:formatNumber type="number" value="${shopOrder.needPayAmount}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         </td>
                         <td>
                         <td>
-                            发货状态:${fns:getDictLabel(shopOrder.sendOutStatus,'sendOutStatus' ,'' )}
+                            优惠:¥<fmt:formatNumber type="number" value="${shopOrder.eachDiscount}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         </td>
                         <td>
                         <td>
-                            付款状态:${fns:getDictLabel(shopOrder.payStatus,'payStatus' ,'' )}
+                            应付金额:¥<fmt:formatNumber type="number" value="${shopOrder.realPay}" pattern="0.00" maxFractionDigits="2" />
                         </td>
                         </td>
                         <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>
                         </td>
                     </tr>
                     </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>
                     <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>
                     </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>
                     <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>
                         </td>
                     </tr>
                     </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>
             </table>
+        </c:if>
+        </table>
         <%--默认状态代码--%>
         <%--默认状态代码--%>
         <c:if test="${shopOrder.defaultStatus}">
         <c:if test="${shopOrder.defaultStatus}">
             <table id="shopOrderTable${status.index}"
             <table id="shopOrderTable${status.index}"
@@ -831,7 +831,7 @@
         </c:if>
         </c:if>
     </c:forEach>
     </c:forEach>
     <div class="form-actions">
     <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)"/>
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
     </div>
     </div>
@@ -990,23 +990,23 @@
             }
             }
             wrapper.parent().append(wrapper.clone());
             wrapper.parent().append(wrapper.clone());
             wrapper.remove();
             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');
         blockEle = $('.refund-details-block');

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

@@ -0,0 +1,313 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<html>
+<head>
+	<title>固定楼层内容管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+            var tb=document.getElementById('contentTable');
+            // var rows=tb.rows;
+            for(var j=1;j<tb.rows.length; j++){
+                 // te=(tb.rows[j].cells[4].innerHTML,tb.rows[j].cells[4].innerHTML);
+                console.log(tb.rows[j].cells[4].innerHTML.slice(33))
+            }
+            // alert($("#span").text());
+		});
+		function page(n, s) {
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+			return false;
+		}
+        //PC端状态修改
+        function updateEnabledStatus(status,ids){
+            var msg='确定启用该楼层吗?';
+            if('0'==status){
+                msg='确定停用该楼层吗?';
+            }
+            top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+                if(v=='ok'){
+                    $.post("${ctx}/newhome/newPageFloor/updateEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
+                        if(true==data.success){
+                            $.jBox.tip(data.msg, 'info');
+                        } else {
+                            $.jBox.tip(data.msg,'error');
+                        }
+                        window.location = "${ctx}/newhome/newPageFloor/";
+                    },"JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return;
+            },{buttonsFocus:1,persistent: true});
+        }
+
+		function dateFormat(fmt, date) {
+			let ret;
+			const opt = {
+				"Y+": date.getFullYear().toString(),        // 年
+				"m+": (date.getMonth() + 1).toString(),     // 月
+				"d+": date.getDate().toString(),            // 日
+				"H+": date.getHours().toString(),           // 时
+				"M+": date.getMinutes().toString(),         // 分
+				"S+": date.getSeconds().toString()          // 秒
+				// 有其他格式化字符需求可以继续添加,必须转化成字符串
+			};
+			for (let k in opt) {
+				ret = new RegExp("(" + k + ")").exec(fmt);
+				if (ret) {
+					fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
+				};
+			};
+			return fmt;
+		}
+
+
+
+
+		//CRM端状态修改
+        function updateCrmEnabledStatusByIds(status,ids){
+            var msg='确定启用该楼层吗?';
+            if('0'==status){
+                msg='确定停用该楼层吗?';
+            }
+            top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+                if(v=='ok'){
+                    $.post("${ctx}/newhome/newPageFloor/updateCrmEnabledStatusByIds",{'crmEnabledStatus':status,'ids':ids}, function(data) {
+                        if(true==data.success){
+                            $.jBox.tip(data.msg, 'info');
+                        } else {
+                            $.jBox.tip(data.msg,'error');
+                        }
+                        window.location = "${ctx}/newhome/newPageFloor/";
+                    },"JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return;
+            },{buttonsFocus:1,persistent: true});
+        }
+
+		/**
+		 * @param obj
+		 * jquery控制input只能输入数字
+		 */
+		function onlynum(obj) {
+			obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+		}
+
+		function offoce(productID,date,ShowTime,addTime,floorTitle,floorType){
+			var html = "<div id='auditBox'>"
+					+ "<div class='bd-row'>"
+					+ "<span style='margin-left: 5px;size: 30px'>更改时间后,将从此刻的时间开始重新计算</span>"
+					+ "<br>"
+					+ "    <span><font color='red'>*</font>展示时间:</span>"
+					+ "   <input type='text' onkeyup='onlynum(this)' class='input-mini' name='yat'/>"
+					+ "<span>天</span>"
+					+ "</div>"
+					+ "<span  id='err' hidden=hidden style='color: red'>请输入天数</span>"
+					+ "</div>";
+			var submit = function (v, h, f) {
+					if(v==true){
+				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 =dateFormat("YYYY-mm-dd HH:MM:SS",unixTimestamp);
+
+				var data=new Date(date);
+				data.getTime()+1000*60*60*24;
+				var dtime = new Date(data);
+				commTime = dateFormat("YYYY-mm-dd HH:MM:SS",dtime);
+						console.log(window.location.href="${ctx}/newhome/newPageFloor/updateshowTime?newshowTime="+commTime+"&productID="+productID+"&showTime="+commonTime+"&addTime="+addTime+"&floorTitle="+floorTitle+"&floorType="+floorType)
+				window.location.href="${ctx}/newhome/newPageFloor/updateshowTime?newshowTime="+commTime+"&productID="+productID+"&showTime="+commonTime+"&addTime="+addTime+"&floorTitle="+floorTitle+"&floorType="+floorType;
+					}
+			};
+			// $.jBox.confirm(html, {title: "提示",submit:submit});
+			$.jBox.confirm(html, "提示", submit, {buttons: {'确认': true, '取消': false}});
+		}
+
+
+
+		//批量保存排序
+		function batchSaveSort() {
+			var items = new Array();
+			var $items = $('.check-item');
+			$items.each(function(){
+				items.push($(this).val());
+			});
+			debugger
+			//保存批量排序
+			$.post("${ctx}/newhome/newPageFloor/batchSavesortIndex?sortList="+items, function(data) {
+
+					window.location.href = "${ctx}/newhome/newPageFloor/ContentPage?floorId=${newPageFloor.id}&floorTitle=${newPageFloor.floorTitle}&floorType=${newPageFloor.floorType}";
+
+			},"JSON");//这里返回的类型有:json,html,xml,text
+		}
+
+		//修改排序值
+		function changeSort(id,sortThis) {
+			var value = sortThis.value;
+			$("#preferredProductSort"+id).val(id+"-"+value);
+		}
+
+		function offocea(productID,newshowTime,ShowTime,addTime,floorTitle,floorType) {
+			$.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+"&floorTitle="+floorTitle+"&floorType="+floorType;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offoceb(productID,newshowTime,ShowTime,addTime,floorTitle,floorType) {
+			console.log(newshowTime)
+			$.jBox.confirm("确定下线该商品吗?下线后该商品将不展示在商城新品区域","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/updatshowFlag?showFlag=5&productID="+productID+"&newshowTime="+newshowTime+"&ShowTime="+ShowTime+"&addTime"+addTime+"&floorTitle="+floorTitle+"&floorType="+floorType;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offocec(productID,floorTitle,floorType) {
+			$.jBox.confirm("确定取消重点推荐吗?","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/addrecommend?recommend=0&productID="+productID+"&floorTitle="+floorTitle+"&floorType="+floorType;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+		function offoced(productID,floorTitle,floorType) {
+			$.jBox.confirm("确定将该商品设为重点推荐吗?推荐后商品将在商城新品区域重点展示","提示",function(v,h,f){
+				if(v === 1){
+					window.location.href="${ctx}/newhome/newPageFloor/addrecommend?recommend=1&productID="+productID+"&floorTitle="+floorTitle+"&floorType="+floorType;
+				}
+			} ,{ buttons: {  '确定': 1,'取消':2}});
+		}
+
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/newhome/newPageFloor/lists">固定楼层管理列表</a></li>
+		<li class="active"><a href="${ctx}/newhome/newPageFloor/ContentPage?floorId=${newPageFloor.id}&floorTitle=${newPageFloor.floorTitle}&floorType=${newPageFloor.floorType}">内容</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="Product" action="${ctx}/newhome/newPageFloor/ContentPage?floorId=${newPageFloor.id}&floorTitle=${newPageFloor.floorTitle}&floorType=${newPageFloor.floorType}">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<c:if test="${not empty floorTitle}">
+			楼层名称:&nbsp;<span style="color: #0bbbee">${floorTitle}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >楼层类型:</span>&nbsp;<span style="color: #0bbbee"><c:if test="${floorType eq 1}">新品橱窗</c:if></span>
+		</c:if>
+		<c:if test="${not empty newPageFloor.floorTitle}">
+		楼层名称:&nbsp;<span style="color: #0bbbee">${newPageFloor.floorTitle}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >楼层类型:</span>&nbsp;<span style="color: #0bbbee"><c:if test="${newPageFloor.floorType eq 1}">新品橱窗</c:if></span>
+		</c:if>
+		<div class="ul-form">
+
+			<label>商品ID:</label>
+			<form:input path="productID" onkeyup="onlynum(this)" name="productID" maxlength="50" class="input-medium"/>
+			<label>商品名称:</label>
+			<form:input path="name" name="name" maxlength="50" class="input-medium"/>
+			<label>供应商:</label>
+			<form:input path="shopName" name="shopName" maxlength="50" class="input-medium"/>
+			<label>展示状态:</label>
+			<form:select path="showFlag" class="input-small">
+				<form:option  value="0">请选择</form:option>
+				<form:option value="1">已展示</form:option>
+				<form:option value="2">展示过期</form:option>
+				<form:option value="3">未参与</form:option>
+				<form:option value="4">审核未通过</form:option>
+				<form:option value="5">已下线</form:option>
+			</form:select>
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<input class="btn btn-primary" style="width:  70px" onclick="batchSaveSort()"  value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+		</div>
+
+	</form:form>
+
+	<sys:message content="${message}"/>
+    <table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>商品ID</th>
+				<th>商品名称</th>
+				<th>供应商</th>
+				<th>展示状态</th>
+				<th>展示时间</th>
+				<th>排序</th>
+				<th>重点推荐</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+
+		<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}">
+						<font color="green">已展示</font>
+					</c:if>
+					<c:if test="${list.showFlag eq 2}">
+						<font color="#ff8c00">展示过期</font>
+					</c:if>
+					<c:if test="${list.showFlag eq 3}">
+						<font color="red">未参与</font>
+					</c:if>
+					<c:if test="${list.showFlag eq 4}">
+						<font color="red">审核未通过</font>
+					</c:if>
+					<c:if test="${list.showFlag eq 5}">
+						<font color="red">已下线</font>
+					</c:if>
+				</td>
+				<td>
+					<c:if test="${not empty list.newshowTime}">
+					${list.newshowTime}~${list.showTime}
+					</c:if>
+				</td>
+				<td>
+					<c:if test="${not empty list.sortIndex && list.sortIndex!=0}">
+					<input  id="sort" type="text" name="sortIndex" style="width:50px;" value="${list.sortIndex}"  onkeyup="onlynum(this)"  onchange="changeSort(${list.productID},this)"></td>
+				</c:if>
+				<c:if test="${empty list.sortIndex || list.sortIndex==0}">
+					<input  id="sort" type="text" name="sortIndex" style="width:50px;" value="1"  onkeyup="onlynum(this)"  onchange="changeSort(${list.productID},this)"></td>
+				</c:if>
+				<td>
+					<c:if test="${list.recommend eq 1}"><img src="/static/images/yes.gif" width="15px" border="none"/></c:if>
+				</td>
+				<td>
+					<c:if test="${list.showFlag eq 5}"><a class="red" href="javascript:void(0);" onclick="offocea(${list.productID},'${list.newshowTime}','${list.showTime}','${list.addTime}','${newPageFloor.floorTitle}','${newPageFloor.floorType}')">上线商品</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}','${newPageFloor.floorTitle}','${newPageFloor.floorType}')">下线商品</a>	</c:if>
+					<c:if test="${list.recommend eq 1}"><a class="red" href="javascript:void(0);" onclick="offocec(${list.productID},'${newPageFloor.floorTitle}','${newPageFloor.floorType}')">取消重点推荐</a> </c:if>
+					<c:if test="${list.recommend != 1 && count<5 && list.showFlag != 5}"><a class="red" href="javascript:void(0);" onclick="offoced('${list.productID}','${newPageFloor.floorTitle}','${newPageFloor.floorType}')">设为重点推荐</a></c:if>
+		         <c:if test="${list.showFlag !=5}"> <a class="red" href="javascript:void(0);" onclick="offoce('${list.productID}',new Date,'${list.newshowTime}','${list.addTime}','${newPageFloor.floorTitle}','${newPageFloor.floorType}')">更改展示时间</a></c:if>
+               </td>
+</c:forEach>
+			</tr>
+
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

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

@@ -30,9 +30,9 @@
 		<li><a href="${ctx}/newhome/newPageFloor/">楼层管理列表</a></li>
 		<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>
 		<li class="active"><a href="${ctx}/newhome/newPageFloor/form?id=${newPageFloor.id}">楼层管理${not empty newPageFloor.id?'编辑':'添加'}</a></li>
 	</ul><br/>
 	</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"/>
 		<form:hidden path="id"/>
-		<sys:message content="${message}"/>		
+		<sys:message content="${message}"/>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>楼层标题:</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>楼层标题:</label>
 			<div class="controls">
 			<div class="controls">
@@ -45,6 +45,17 @@
 				<form:input path="floorDetail" htmlEscape="false" maxlength="30" class="input-xlarge required"/>
 				<form:input path="floorDetail" htmlEscape="false" maxlength="30" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
+      <c:if test="${not empty newPageFloor.floorType || newPageFloor.floorType eq 0 }">
+		<div class="control-group crmstatus" style="" >
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>楼层类型:</label>
+			<div class="controls">
+				<form:select path="floorType" class="input-xlarge required">
+					<form:option value="" label="请选择"></form:option>
+					<form:option value="1" label="新品橱窗"></form:option>
+				</form:select>
+			</div>
+		</div>
+	</c:if>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<div class="controls">
 			<div class="controls">
@@ -73,4 +84,4 @@
 		</div>
 		</div>
 	</form:form>
 	</form:form>
 </body>
 </body>
-</html>
+</html>

+ 14 - 11
src/main/webapp/WEB-INF/views/modules/newhome/newPageFloorList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	</style>
 	<script type="text/javascript">
 	<script type="text/javascript">
 		$(document).ready(function() {
 		$(document).ready(function() {
-			
+
 		});
 		});
 		function page(n,s){
 		function page(n,s){
 			$("#pageNo").val(n);
 			$("#pageNo").val(n);
@@ -96,7 +96,8 @@
 </head>
 </head>
 <body>
 <body>
 	<ul class="nav nav-tabs">
 	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/newhome/newPageFloor/">楼层管理列表</a></li>
+		<li class="active"><a href="${ctx}/newhome/newPageFloor/">自由楼层管理列表</a></li>
+		<li><a href="${ctx}/newhome/newPageFloor/lists">固定楼层管理列表</a></li>
 	</ul>
 	</ul>
 	<form:form action="" class="breadcrumb form-search">
 	<form:form action="" class="breadcrumb form-search">
 		<input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
 		<input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
@@ -154,19 +155,21 @@
 						</a>
 						</a>
 					</c:if>
 					</c:if>
 				</shiro:hasPermission></td>
 				</shiro:hasPermission></td>
-				<td><input  id="sort" name="sort" style="width:50px;" value="${newPageFloor.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${newPageFloor.id},this)"></td>
+				<td><input type="text" id="sort" name="sort" style="width:50px;" value="${newPageFloor.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${newPageFloor.id},this)"></td>
 				<td><fmt:formatDate value="${newPageFloor.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td><fmt:formatDate value="${newPageFloor.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
-				<shiro:hasPermission name="newhome:newPageFloor:edit"><td>
-    				<a href="${ctx}/newhome/newPageFloor/form?id=${newPageFloor.id}">编辑</a>
-                    <a href="${ctx}/newhome/newPageFloor/goContentPage?floorId=${newPageFloor.id}">内容</a>
-    				<shiro:hasPermission name="newhome:newPageFloor:delete">
-					<a href="${ctx}/newhome/newPageFloor/delete?id=${newPageFloor.id}" onclick="return confirmx('确定删除该楼层吗?', this.href)">删除</a>
-					</shiro:hasPermission>
-				</td></shiro:hasPermission>
+				<shiro:hasPermission name="newhome:newPageFloor:edit">
+					<td>
+    					<a href="${ctx}/newhome/newPageFloor/form?id=${newPageFloor.id}">编辑</a>
+                    	<a href="${ctx}/newhome/newPageFloor/goContentPage?floorId=${newPageFloor.id}">内容</a>
+    					<shiro:hasPermission name="newhome:newPageFloor:delete">
+							<a href="${ctx}/newhome/newPageFloor/delete?id=${newPageFloor.id}" onclick="return confirmx('确定删除该楼层吗?', this.href)">删除</a>
+						</shiro:hasPermission>
+					</td>
+				</shiro:hasPermission>
 			</tr>
 			</tr>
 		</c:forEach>
 		</c:forEach>
 		</tbody>
 		</tbody>
 	</table>
 	</table>
 	<div class="pagination">${page}</div>
 	<div class="pagination">${page}</div>
 </body>
 </body>
-</html>
+</html>

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

@@ -0,0 +1,177 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>固定楼层管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+        //PC端状态修改
+        function updateEnabledStatus(status,ids){
+            var msg='确定启用该楼层吗?';
+            if('0'==status){
+                msg='确定停用该楼层吗?';
+            }
+            top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+                if(v=='ok'){
+                    $.post("${ctx}/newhome/newPageFloor/updateEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
+                        if(true==data.success){
+                            $.jBox.tip(data.msg, 'info');
+                        } else {
+                            $.jBox.tip(data.msg,'error');
+                        }
+                        window.location = "${ctx}/newhome/newPageFloor/";
+                    },"JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return;
+            },{buttonsFocus:1,persistent: true});
+        }
+
+
+        //CRM端状态修改
+        function updateCrmEnabledStatusByIds(status,ids){
+            var msg='确定启用该楼层吗?';
+            if('0'==status){
+                msg='确定停用该楼层吗?';
+            }
+            top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+                if(v=='ok'){
+                    $.post("${ctx}/newhome/newPageFloor/updateCrmEnabledStatusByIds",{'crmEnabledStatus':status,'ids':ids}, function(data) {
+                        if(true==data.success){
+                            $.jBox.tip(data.msg, 'info');
+                        } else {
+                            $.jBox.tip(data.msg,'error');
+                        }
+                        window.location = "${ctx}/newhome/newPageFloor/lists";
+                    },"JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return;
+            },{buttonsFocus:1,persistent: true});
+        }
+
+		/**
+		 * @param obj
+		 * jquery控制input只能输入数字
+		 */
+		function onlynum(obj) {
+			obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+		}
+
+		//批量保存排序
+		function batchSaveSort() {
+			var items = new Array();
+			var $items = $('.check-item');
+			$items.each(function(){
+				items.push($(this).val());
+			});
+			//保存批量排序
+			$.post("${ctx}/newhome/newPageFloor/batchSaveSort?sortList="+items, function(data) {
+				if(true==data.success){
+					$.jBox.tip(data.msg, 'info');
+					window.location.href = "${ctx}/newhome/newPageFloor/lists";
+				} else {
+					$.jBox.tip(data.msg,'error');
+				}
+			},"JSON");//这里返回的类型有:json,html,xml,text
+		}
+
+		//修改排序值
+		function changeSort(id,sortThis) {
+			var value = sortThis.value;
+			$("#preferredProductSort"+id).val(id+"-"+value);
+		}
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/newhome/newPageFloor/">自由楼层管理列表</a></li>
+		<li class="active"><a href="${ctx}/newhome/newPageFloor/lists">固定楼层管理列表</a></li>
+	</ul>
+	<form:form action="" class="breadcrumb form-search">
+		<input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
+		<input class="btn btn-primary" style="width: 70px" onclick="window.location='${ctx}/newhome/newPageFloor/form?floorType=0'" value="添加楼层"/>
+		<div style="margin-top: 10px">
+			<label><font color="#a9a9a9">注:排序值越小越靠前</font></label>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>ID</th>
+				<th>楼层名称</th>
+				<th>描述</th>
+				<th>楼层类型</th>
+				<th>网站状态</th>
+				<th>小程序状态</th>
+				<th>排序</th>
+				<th>创建时间</th>
+				<shiro:hasPermission name="newhome:newPageFloor:edit"><th>操作</th></shiro:hasPermission>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="newPageFloor">
+			<tr>
+				<input class="check-item" type="hidden" id="preferredProductSort${newPageFloor.id}" value='${newPageFloor.id}-${newPageFloor.sort}'/>
+				<td>${newPageFloor.id}</td>
+				<td>${newPageFloor.floorTitle}</td>
+				<td>${newPageFloor.floorDetail}</td>
+				<td><c:if test="${newPageFloor.floorType eq 1}">新品橱窗</c:if></td>
+				<td><shiro:hasPermission name="newhome:newPageFloor:edit">
+					<c:if test="${newPageFloor.wwwEnabledStatus eq 1 }">
+						<font color="green">已启用</font>
+						<a href="javascript:void(0);" onclick="updateEnabledStatus('0','${newPageFloor.id}');" >
+							停用
+						</a>
+					</c:if>
+					<c:if test="${newPageFloor.wwwEnabledStatus ne 1 }">
+						<font color="red">已停用</font>
+						<a href="javascript:void(0)" onclick="updateEnabledStatus('1','${newPageFloor.id}');">
+							启用
+						</a>
+					</c:if>
+				</shiro:hasPermission></td>
+				<td><shiro:hasPermission name="newhome:newPageFloor:edit">
+					<c:if test="${newPageFloor.crmEnabledStatus eq 1 }">
+						<font color="green">已启用</font>
+						<a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${newPageFloor.id}');" >
+							停用
+						</a>
+					</c:if>
+					<c:if test="${newPageFloor.crmEnabledStatus ne 1 }">
+						<font color="red">已停用</font>
+						<a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${newPageFloor.id}');">
+							启用
+						</a>
+					</c:if>
+				</shiro:hasPermission></td>
+				<td><input type="text" id="sort" name="sort" style="width:50px;" value="${newPageFloor.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${newPageFloor.id},this)"></td>
+				<td><fmt:formatDate value="${newPageFloor.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+				<shiro:hasPermission name="newhome:newPageFloor:edit">
+					<td>
+    				<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?floor=1&id=${newPageFloor.id}" onclick="return confirmx('确定删除该楼层吗?', this.href)">删除</a>
+					</shiro:hasPermission>
+					</td>
+				</shiro:hasPermission>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

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

@@ -37,7 +37,7 @@
 
 
         .receipt-order-title {
         .receipt-order-title {
             line-height: 30px;
             line-height: 30px;
-            margin: 10px 0;
+            margin: 0px 0;
             white-space: nowrap;
             white-space: nowrap;
         }
         }
 
 
@@ -101,7 +101,7 @@
 
 
         .not-order-reason {
         .not-order-reason {
             margin-top: 15px;
             margin-top: 15px;
-            display: inline-block;
+            /*display: inline-block;*/
             margin-left: 0 !important;
             margin-left: 0 !important;
         }
         }
 
 
@@ -164,6 +164,10 @@
                         </c:if>
                         </c:if>
 						<c:if test="${vo.receiptType == 2}">
 						<c:if test="${vo.receiptType == 2}">
                             非订单款
                             非订单款
+                            <c:if test="${cmDiscernReceipt.newReceiptType eq 1}">-上架费</c:if>
+                            <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-订单返佣</c:if>
+                            <c:if test="${cmDiscernReceipt.newReceiptType eq 3}">-认证通会员</c:if>
+                            <c:if test="${cmDiscernReceipt.newReceiptType eq 4}">-认证通企划</c:if>
                         </c:if>
                         </c:if>
 						<c:if test="${vo.receiptType == 3}">
 						<c:if test="${vo.receiptType == 3}">
                             <c:if test="${vo.payType == 10}">
                             <c:if test="${vo.payType == 10}">
@@ -223,11 +227,138 @@
             <div class="not-order-type">
             <div class="not-order-type">
                 <span><label>确认人:</label> ${vo.confirmer}</span>
                 <span><label>确认人:</label> ${vo.confirmer}</span>
                 <span><label>确认时间: </label>${vo.confirmTime}</span>
                 <span><label>确认时间: </label>${vo.confirmTime}</span>
+                <c:if test="${ vo.shopName != null && cmDiscernReceipt.newReceiptType != 2 }"> <br> <span class="not-order-reason"><label>关联供应商:</label>${vo.shopName}</span></c:if>
+                <c:if test="${vo.shopName == null && cmDiscernReceipt.newReceiptType != 2}"> <br> <span class="not-order-reason"><label>关联供应商:</label>无</span> <br></c:if>
                 <br>
                 <br>
-                <span class="not-order-reason"><label>确认原因:</label>${vo.noOrderReason}</span>
+                <c:if test="${not empty vo.noOrderReason}">
+                   <label>备注信息:</label>${vo.noOrderReason}
+                </c:if>
+
             </div>
             </div>
         </c:if>
         </c:if>
     </div>
     </div>
+    <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">
+        <h5>关联订单</h5>
+            <div class="receipt-order-form">
+                <div class="receipt-order-row2">
+                        <span class="font-blue"><label>子订单编号:</label>
+                               <a href="${ctx}/order/detail?id=${op.orderID}">${op.shopOrderNo}(${op.shopOrderId})</a></span>
+                    <span><label>订单金额:</label>¥<fmt:formatNumber
+                            value="${op.productAmount}"
+                            pattern="#0.00"/></span>
+                    <span>
+                         <span><label>供应商:</label>${op.shopName}</span>
+                    <span>
+                        <hr style="margin: 10px;"/>
+                </div>
+
+                <div class="receipt-order-row3">
+
+                         <span class="font-blue"><label>订单编号:</label><a
+                                 href="${ctx}/order/detail?id=${op.orderID}">${op.orderNo}(${op.orderID})</a></span>
+
+                        <span><label>订单金额:</label>¥<fmt:formatNumber
+                                value="${op.productAmount}"
+                                pattern="#0.00"/></span>
+
+                            <span><label>应收金额:</label>¥<fmt:formatNumber value="${op.needPayAmount}"
+                                                                         pattern="#0.00"/></span>
+                            <span>
+                            <label>已收金额:</label>¥<fmt:formatNumber
+                                    value="${empty op.receiptAmount ? 0 : op.receiptAmount}"
+                                    pattern="#0.00"/>
+                            </span>
+                    <span><label>机构名称:</label>${op.jgName}</span>
+                </div>
+
+               <label>订单类型:</label><c:if test="${op.orderType eq 0}">普通订单</c:if>
+                    <c:if test="${op.orderType eq 1}">协销订单</c:if>
+
+                <span><label>下单日期:</label>${cmDiscernReceipt.confirmDate}</span>
+
+            </div>
+        <c:if test="${not empty orderInfo.receiptRecordVo}">
+        <div class="receipt-order-form">
+        <div class="receipt-order-row4">
+            <div><h5><label>订单收款记录:</label></h5></div>
+            <c:forEach items="${orderInfo.receiptRecordVo}" var="receiptRecord" varStatus="index">
+                <div class="row4-wrapper">
+                    <span class="row4-order-no">${index.index + 1}、</span>
+                    <span class="row4-time">${receiptRecord.receiptTime}</span>
+                    <c:if test="${receiptRecord.payWay == 1}">
+                        <%--线上收款--%>
+                        <span>线上&nbsp;${fns:getPayTypeStr(receiptRecord.payType)}</span>
+                        <span>${receiptRecord.receiptAmount}</span>
+                        <span><label>交易号:</label>${receiptRecord.mbOrderId}</span>
+                    </c:if>
+                    <c:if test="${receiptRecord.payWay == 2}">
+                        <span>线下&nbsp;${fns:getPayTypeStr(receiptRecord.payType)}</span>
+                        <span>${receiptRecord.receiptAmount}</span>
+                        <c:if test="${not empty receiptRecord.confirmUserPermissionID}">
+                            <span>${receiptRecord.confirmUserName}确认(${receiptRecord.confirmDate})</span>
+                        </c:if>
+                        <c:if test="${not empty receiptRecord.reviewUserPermissionID}">
+                                    <span>
+                                        <c:if test="${receiptRecord.receiptStatus eq 4}">
+                                            ${receiptRecord.reviewUserName}审核不通过(${receiptRecord.reviewDate})
+                                        </c:if>
+                                        <c:if test="${receiptRecord.receiptStatus ne 4}">
+                                            ${receiptRecord.reviewUserName}审核通过(${receiptRecord.reviewDate})
+                                        </c:if>
+                                    </span>
+                        </c:if>
+                    </c:if>
+                    <c:if test="${receiptRecord.payWay == 3}">
+                        <%--余额抵扣--%>
+                        <span><a
+                                href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${orderInfo.userID}"
+                                style="text-decoration: underline">${fns:getPayTypeStr(receiptRecord.payType)}</a></span>
+                        <span><a
+                                href="${ctx}/user/cmUserBalanceRecord/userBalanceRecord?userId=${orderInfo.userID}"
+                                style="text-decoration: underline">${receiptRecord.receiptAmount}</a></span>
+                    </c:if>
+                    <span>
+    <%--                        一款多单的时候直接显示再订单上即可,无需收款记录显示--%>
+                                <c:if test="${!vo.receiptOrderFlag}">
+                                    <c:if test="${receiptRecord.confirmType eq 1 || receiptRecord.confirmType eq  2 || receiptRecord.confirmType eq 3}">
+                                        <label>抹平明细:</label>
+                                        <c:if test="${receiptRecord.confirmType eq 1}">
+                                                <font color="red">(少收抹平:
+                                                    ¥<fmt:formatNumber
+                                                            value="${orderInfo.payableAmount - (empty receiptRecord.orderReceivedAmount ? 0 : receiptRecord.orderReceivedAmount)}"
+                                                            pattern="#0.00"/>元)
+                                                </font>
+                                        </c:if>
+                                        <c:if test="${receiptRecord.confirmType eq 2}">
+                                                <font color="red">(多收抹平:
+                                                    ¥<fmt:formatNumber
+                                                            value="${(empty receiptRecord.orderReceivedAmount ? 0 : receiptRecord.orderReceivedAmount) - orderInfo.payableAmount}"
+                                                            pattern="#0.00"/>元)
+                                                </font>
+                                        </c:if>
+                                        <c:if test="${receiptRecord.confirmType eq 3}">
+                                                <font color="red">(多收退余额${receiptRecord.associationType eq 2 ? "(自动)" : ""}:
+                                                    ¥<fmt:formatNumber
+                                                            value="${(empty receiptRecord.returnBalanceAmount ? 0 : receiptRecord.returnBalanceAmount)}"
+                                                            pattern="#0.00"/>元)
+                                                </font>
+                                        </c:if>
+                                    </c:if>
+                                </c:if>
+                                </span>
+                    <span>
+                                    ${receiptRecord.receiptAmount}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${vo.confirmer} 确认 ${vo.confirmTime}
+                                </span>
+                </div>
+            </c:forEach>
+        </div>
+        </div>
+        </c:if>
+    </c:if>
+
+
+
+
     <c:if test="${vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7 and vo.receiptType != 8}">
     <c:if test="${vo.receiptType != 2 and vo.receiptType != 6 and vo.receiptType != 7 and vo.receiptType != 8}">
         <h5>关联订单</h5>
         <h5>关联订单</h5>
         <div class="receipt-order-form">
         <div class="receipt-order-form">
@@ -247,6 +378,7 @@
                                                                              pattern="#0.00"/></span>
                                                                              pattern="#0.00"/></span>
                                 <span><label>已退金额:</label>¥<fmt:formatNumber value="${orderInfo.refundsAmount}"
                                 <span><label>已退金额:</label>¥<fmt:formatNumber value="${orderInfo.refundsAmount}"
                                                                              pattern="#0.00"/></span>
                                                                              pattern="#0.00"/></span>
+
                             </c:if>
                             </c:if>
                         </div>
                         </div>
                     </c:if>
                     </c:if>
@@ -263,6 +395,7 @@
                             <label>已收金额:</label>¥<fmt:formatNumber
                             <label>已收金额:</label>¥<fmt:formatNumber
                                     value="${empty orderInfo.receiptAmount ? 0 : orderInfo.receiptAmount}"
                                     value="${empty orderInfo.receiptAmount ? 0 : orderInfo.receiptAmount}"
                                     pattern="#0.00"/>
                                     pattern="#0.00"/>
+
                             <span>
                             <span>
                                     <c:forEach items="${orderInfo.receiptRecordVo}" var="receiptRecord"
                                     <c:forEach items="${orderInfo.receiptRecordVo}" var="receiptRecord"
                                                varStatus="index">
                                                varStatus="index">
@@ -406,6 +539,9 @@
                                     </c:if>
                                     </c:if>
                                 </c:if>
                                 </c:if>
                                 </span>
                                 </span>
+                                <span>
+                                    ${receiptRecord.receiptAmount}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${vo.confirmer} 确认 ${vo.confirmTime}
+                                </span>
                             </div>
                             </div>
                         </c:forEach>
                         </c:forEach>
                     </div>
                     </div>

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

@@ -46,12 +46,26 @@
         .check-btn-wrapper input:last-child {
         .check-btn-wrapper input:last-child {
             margin-left: 10px;
             margin-left: 10px;
         }
         }
+        .select-ele input-medium:hover .options {
+            display: block;
+        }
         .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>
     </style>
     <script type="text/javascript">
     <script type="text/javascript">
         $(document).ready(function () {
         $(document).ready(function () {
-
+            var receiptType = $("#receiptType").val();
+            if (receiptType == 2) {
+                $(".secondType").show();
+            } else {
+                $(".secondType").hide();
+            }
         });
         });
+            $("#receipt").hover(function(){
+                console.log(1);
+                $("#mark-info").show();
+            },function(){
+                $("#mark-info").hide();
+            })
 
 
         function page(n, s) {
         function page(n, s) {
             $("#pageNo").val(n);
             $("#pageNo").val(n);
@@ -74,6 +88,17 @@
         function onlynum(obj) {
         function onlynum(obj) {
             obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
             obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
         }
         }
+
+
+        function changeReceiptType(){
+            debugger
+            var receiptType = $("#receiptType").val();
+            if (receiptType == 2) {
+                $(".secondType").show();
+            } else {
+                $(".secondType").hide();
+            }
+        }
     </script>
     </script>
 </head>
 </head>
 <body>
 <body>
@@ -103,17 +128,26 @@
                               htmlEscape="false"/>
                               htmlEscape="false"/>
             </form:select>
             </form:select>
             <label>收款类别:</label>
             <label>收款类别:</label>
-            <form:select path="receiptType" class="select-ele input-medium">
+            <form:select path="receiptType" class="select-ele input-medium" onchange="changeReceiptType()">
                 <form:option value="" label="全部"/>
                 <form:option value="" label="全部"/>
                 <form:options items="${fns:getDictList('receiptType')}" itemLabel="label" itemValue="value"
                 <form:options items="${fns:getDictList('receiptType')}" itemLabel="label" itemValue="value"
                               htmlEscape="false"/>
                               htmlEscape="false"/>
             </form:select>
             </form:select>
+            <form:select path="newReceiptType" class="select-ele input-medium secondType" style="display: none">
+                <form:option value="" label="全部"/>
+                <form:option value="1" label="上架费"/>
+                <form:option value="2" label="订单返佣"/>
+                <form:option value="3" label="认证通会员"/>
+                <form:option value="4" label="认证通企划"/>
+            </form:select>
+
             <label>收款状态:</label>
             <label>收款状态:</label>
             <form:select path="receiptStatus" class="select-ele input-medium">
             <form:select path="receiptStatus" class="select-ele input-medium">
                 <form:option value="" label="全部"/>
                 <form:option value="" label="全部"/>
                 <form:options items="${fns:getDictList('discernReceiptStatus')}" itemLabel="label" itemValue="value"
                 <form:options items="${fns:getDictList('discernReceiptStatus')}" itemLabel="label" itemValue="value"
                               htmlEscape="false"/>
                               htmlEscape="false"/>
             </form:select>
             </form:select>
+
             <label>收款账号:</label>
             <label>收款账号:</label>
             <form:select path="payType" class="select-ele input-medium">
             <form:select path="payType" class="select-ele input-medium">
                 <form:option value="" label="全部"/>
                 <form:option value="" label="全部"/>
@@ -189,6 +223,7 @@
             <td>${cmDiscernReceipt.receiptDate}</td>
             <td>${cmDiscernReceipt.receiptDate}</td>
             <td><fmt:formatNumber type="number" pattern="#,##0.00"
             <td><fmt:formatNumber type="number" pattern="#,##0.00"
                                   value="${cmDiscernReceipt.receiptAmount}"/></td>
                                   value="${cmDiscernReceipt.receiptAmount}"/></td>
+            <c:if test="${cmDiscernReceipt.receiptType != 2}">
             <td>
             <td>
                 <c:if test="${cmDiscernReceipt.payWay == '1'}">
                 <c:if test="${cmDiscernReceipt.payWay == '1'}">
                     线上
                     线上
@@ -203,10 +238,38 @@
                     ---
                     ---
                 </c:if>
                 </c:if>
             </td>
             </td>
-            <td>${fns:getDictLabel(cmDiscernReceipt.receiptType, 'receiptType', null)}</td>
+            </c:if>
+            <c:if test="${cmDiscernReceipt.receiptType == 2}">
+                <td>
+                    <c:if test="${cmDiscernReceipt.payWay == '1'}">
+                        线上
+                    </c:if>
+                    <c:if test="${cmDiscernReceipt.payWay == '2'}">
+                        线下
+                    </c:if>
+                    <c:if test="${cmDiscernReceipt.payWay != '1' && cmDiscernReceipt.payWay != '2'&& cmDiscernReceipt.payWay != '3'}">
+                        ---
+                    </c:if>
+                </td>
+            </c:if>
+            <td>
+                    ${fns:getDictLabel(cmDiscernReceipt.receiptType, 'receiptType', null)}
+                <c:if test="${cmDiscernReceipt.newReceiptType eq 1}">-上架费</c:if>
+                        <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-订单返佣</c:if>
+                        <c:if test="${cmDiscernReceipt.newReceiptType eq 3}">-认证通会员</c:if>
+                        <c:if test="${cmDiscernReceipt.newReceiptType eq 4}">-认证通企划</c:if>
+            </td>
             <td>${fns:getDictLabel(cmDiscernReceipt.payType, 'payType', null)}</td>
             <td>${fns:getDictLabel(cmDiscernReceipt.payType, 'payType', null)}</td>
             <td>
             <td>
-                <c:if test="${cmDiscernReceipt.payWay == 2}">
+                <c:if test="${cmDiscernReceipt.payWay == 2 && cmDiscernReceipt.newReceiptType == 3}">
+                    <c:if test="${empty cmDiscernReceipt.receiptStatus}"><strong>____</strong></c:if>
+                    <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>
+                    <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 && cmDiscernReceipt.newReceiptType != 3}">
                     <c:if test="${cmDiscernReceipt.receiptStatus == 1}"><strong>待确认</strong></c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 1}"><strong>待确认</strong></c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 2}">已确认</c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 2}">已确认</c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 3}">审核通过</c:if>
                     <c:if test="${cmDiscernReceipt.receiptStatus == 3}">审核通过</c:if>
@@ -236,15 +299,16 @@
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
             </td>
             </td>
-            <td>
-                <c:if test="${cmDiscernReceipt.receiptType != 6}">${cmDiscernReceipt.orders}</c:if>
+           <td>   <%--  <a href="${ctx}/order/detail?id=${cmDiscernReceipt.orderID}">${cmDiscernReceipt.shopOrderNo}(${cmDiscernReceipt.orderID})</a>--%>
+                <c:if test="${cmDiscernReceipt.newReceiptType eq 2}"><a href="${ctx}/order/detail?id=${cmDiscernReceipt.orderID}">${cmDiscernReceipt.shopOrderNos}(${cmDiscernReceipt.orderID})</a></c:if>
+                <c:if test="${cmDiscernReceipt.receiptType != 6 && cmDiscernReceipt.newReceiptType != 2}">${cmDiscernReceipt.orders}</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 6}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 6}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
                 <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>
             </td>
             </td>
             <shiro:hasPermission name="order:cmDiscernReceipt:edit">
             <shiro:hasPermission name="order:cmDiscernReceipt:edit">
                 <td>
                 <td>
-                    <a href="${ctx}/order/cmDiscernReceipt/detail?id=${cmDiscernReceipt.id}">查看详情</a>
+                    <a href="${ctx}/order/cmDiscernReceipt/detail?checkMan=${cmDiscernReceipt.checkMan}&shopName=${cmDiscernReceipt.shopName}&id=${cmDiscernReceipt.id}">查看详情</a>
                 </td>
                 </td>
             </shiro:hasPermission>
             </shiro:hasPermission>
         </tr>
         </tr>

+ 13 - 15
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -505,7 +505,7 @@
                             <font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
                             <font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
                         </c:if>
                         </c:if>
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
                         <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
-                            <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                            <font color="black"><fmt:formatNumber value="${s.shouldPayShopAmount-s.differencePrice}" type="number" pattern="#,##0.00"/></font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
                         </c:if>
                         </c:if>
                     </td>
                     </td>
                     <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
                     <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
@@ -592,7 +592,7 @@
                 <a id="applyShopOtherFee" href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${s.shopOrderID}">付第三方申请</a>
                 <a id="applyShopOtherFee" href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${s.shopOrderID}">付第三方申请</a>
                 <c:if test="${s.paying ne '1' and s.payStatus eq '1' and !s.modifyPayable}">
                 <c:if test="${s.paying ne '1' and s.payStatus eq '1' and !s.modifyPayable}">
                     <shiro:hasPermission name="order:cmPayShop:modifyPay">
                     <shiro:hasPermission name="order:cmPayShop:modifyPay">
-                        <a id="applypayWay"  href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
+                        <a onclick="applypayWay(${s.shopReceiptStatus},${s.payWay})"  href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
                     </shiro:hasPermission>
                     </shiro:hasPermission>
                 </c:if>
                 </c:if>
                 <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
                 <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
@@ -693,6 +693,17 @@
 <div class="pagination">${page}</div>
 <div class="pagination">${page}</div>
 
 
 <script>
 <script>
+    //线上支付的子订单不能直接修改成本
+    function applypayWay(shopReceiptStatus,payWay) {
+        console.log(payWay);
+        console.log(shopReceiptStatus);
+        if (payWay == 1 && shopReceiptStatus==2) {
+            alertx('线上支付的子订单不能直接修改成本!');
+            window.event.returnValue=false;
+            // return false;
+        }
+    }
+
     (function () {
     (function () {
         var payTableEle = $('.pay-table'),
         var payTableEle = $('.pay-table'),
             payProductEle = $('.pay-product-item');
             payProductEle = $('.pay-product-item');
@@ -899,21 +910,8 @@
             window.location.href = '${ctx}/order/cmPayShop/applyEdit' + params;
             window.location.href = '${ctx}/order/cmPayShop/applyEdit' + params;
         });
         });
 
 
-        //付第三方
 
 
-        $('#applypayWay').on('click', function () {
 
 
-            var shopReceiptStatus=$('#shopReceiptStatus').val();
-            var payWay=$('#payWay').val();
-            console.log(payWay)
-            debugger
-            console.log(shopReceiptStatus)
-
-             if (payWay == 1 && shopReceiptStatus==2) {
-                alertx('线上支付的子订单不能直接修改成本!');
-                return false;
-             }
-            });
 
 
             $('#applyShopOtherFee').on('click', function () {
             $('#applyShopOtherFee').on('click', function () {
             if (checked.length > 1) {
             if (checked.length > 1) {

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

@@ -743,6 +743,29 @@
                               onchange="changeAreaFlag()" ${product.allAreaFlag == "1" ? "" : "checked"}>指定区域</label>
                               onchange="changeAreaFlag()" ${product.allAreaFlag == "1" ? "" : "checked"}>指定区域</label>
             </td>
             </td>
         </tr>
         </tr>
+        <tr>
+
+            <th><span class="red">*</span>首页新品展示:</th>
+            <td colspan="3">
+            <c:if test="${product.newProductType==1}">
+                <input type="radio" checked="checked" name="newProductType" value="1" class="required" />参与新品展示
+                <input type="radio" name="newProductType" value="2" class="required" />不参与新品展示
+            </c:if>
+            <c:if test="${empty product.newProductType || product.newProductType==2}">
+                <input type="radio" name="newProductType" value="1" class="required" />参与新品展示
+                <input type="radio" checked="checked" name="newProductType" value="2" class="required" />不参与新品展示
+            </c:if>
+            </td>
+<%--            <td colspan="3">--%>
+<%--                <label><input type="radio" name="newProductType" value="1"--%>
+<%--                              ${product.newProductType == "1" ? "checked" : ""}>参与新品展示<b--%>
+<%--                        class="line">|</b></label>--%>
+<%--                <label><input type="radio" name="newProductType" value="2"--%>
+<%--                             ${product.newProductType == "2" ? "" : "checked"}>不参与新品展示</label>--%>
+<%--            </td>--%>
+        </tr>
+
+
         <tr>
         <tr>
             <th>商品说明:</th>
             <th>商品说明:</th>
             <td colspan="3">
             <td colspan="3">

+ 121 - 14
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:options items="${brandList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
 					</form:select>
 					</form:select>
 				</div>
 				</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">
 				<div class="item">
 					<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
 					<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="发布特殊供应商商品"/>
 					&nbsp;&nbsp;&nbsp;&nbsp;<input class="btn btn-primary" onclick="window.location='${ctx}/product/new/productEdit?shopType=2'" value="发布特殊供应商商品"/>
@@ -148,7 +165,9 @@
 				<th>商品可见度</th>
 				<th>商品可见度</th>
 				<th>价格可见度</th>
 				<th>价格可见度</th>
 				<th>线上分帐号</th>
 				<th>线上分帐号</th>
-				<th>状态</th>
+				<th>商品状态</th>
+				<th>新品参与状态</th>
+				<th>新品审核状态</th>
 				<th>提交时间</th>
 				<th>提交时间</th>
 				<shiro:hasPermission name="product:product:edit"><th>操作</th></shiro:hasPermission>
 				<shiro:hasPermission name="product:product:edit"><th>操作</th></shiro:hasPermission>
 			</tr>
 			</tr>
@@ -253,6 +272,32 @@
 						<font color="darkorange">已冻结</font>
 						<font color="darkorange">已冻结</font>
 					</c:if>
 					</c:if>
 				</td>
 				</td>
+			    <td>
+
+					<c:if test="${product.newProductType eq 2}">
+						<font >未参与</font>
+					</c:if>
+					<c:if test="${product.newProductType eq null}">
+						<font >未参与</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 0}">
+						<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>
+				</td>
 				<td>
 				<td>
 					<c:if test="${empty product.addTime}">
 					<c:if test="${empty product.addTime}">
 						---
 						---
@@ -275,7 +320,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>--%>
 <%--                                   <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已冻结)--%>
                                    <%--待审核或审核未通过才需要审核( 1待审核 2已上架 3已下架 8审核未通过 9已冻结)--%>
                                     <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
                                     <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>
                                     <%--已上架的才可以下架--%>
                                     <%--已上架的才可以下架--%>
                                     <c:if test="${product.validFlag eq 2}">
                                     <c:if test="${product.validFlag eq 2}">
@@ -299,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/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>
                                 <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}">
                                 <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}')">审核</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}','${product.newProductType}')">上架审核</a>
                                 </c:if>
                                 </c:if>
+								<c:if test="${product.newProductType eq 1 &&  product.newvalidFlag != 1 && product.validFlag == 2}"><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}">
                                 <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>
                                     <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 10)">冻结</a>
                                 </c:if>
                                 </c:if>
@@ -428,6 +474,27 @@
 		})
 		})
 	});
 	});
 
 
+	function dateFormat(fmt, date) {
+		let ret;
+		const opt = {
+			"Y+": date.getFullYear().toString(),        // 年
+			"m+": (date.getMonth() + 1).toString(),     // 月
+			"d+": date.getDate().toString(),            // 日
+			"H+": date.getHours().toString(),           // 时
+			"M+": date.getMinutes().toString(),         // 分
+			"S+": date.getSeconds().toString()          // 秒
+			// 有其他格式化字符需求可以继续添加,必须转化成字符串
+		};
+		for (let k in opt) {
+			ret = new RegExp("(" + k + ")").exec(fmt);
+			if (ret) {
+				fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
+			};
+		};
+		return fmt;
+	}
+
+
 	function showTips(title, text) {
 	function showTips(title, text) {
 		$('.tips-popup h4').text(title);
 		$('.tips-popup h4').text(title);
 		$('.tips-popup p').text(text);
 		$('.tips-popup p').text(text);
@@ -496,6 +563,8 @@
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;
                 return false;
             }
             }
+
+
             $.post("${ctx}/product/new/auditProductBySencondProduct", {
             $.post("${ctx}/product/new/auditProductBySencondProduct", {
             	'productID': id,
             	'productID': id,
                 'validFlag': f.validFlag
                 'validFlag': f.validFlag
@@ -512,7 +581,7 @@
     }
     }
 
 
     // 审核(正常)
     // 审核(正常)
-    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional) {
+    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag,showtime,addtime,newProductType,validFlag) {
     	// 商品成本判断
     	// 商品成本判断
     	if(null == costCheckFlag || "" == costCheckFlag){
     	if(null == costCheckFlag || "" == costCheckFlag){
     		alertx("成本价未填写,请编辑成本价后再审核");
     		alertx("成本价未填写,请编辑成本价后再审核");
@@ -532,6 +601,10 @@
     	}
     	}
 
 
 
 
+
+
+
+
         // 0:待审核,1:审核通过,2:审核失败
         // 0:待审核,1:审核通过,2:审核失败
         if(status == 0 && name != "" ){
         if(status == 0 && name != "" ){
             alertx("该商品的品牌:"+name+",尚未审核。请先审核通过该品牌再审核商品");
             alertx("该商品的品牌:"+name+",尚未审核。请先审核通过该品牌再审核商品");
@@ -541,24 +614,50 @@
             alertx("该商品的品牌:"+name+",审核未通过。请通知供应商重新编辑提交品牌再审核商品或者直接修改品牌信息审核通过后再审核商品");
             alertx("该商品的品牌:"+name+",审核未通过。请通知供应商重新编辑提交品牌再审核商品或者直接修改品牌信息审核通过后再审核商品");
             return;
             return;
         }
         }
-
+		var htmls = "<div id='auditBox'>"
+				+ "<div class='bd-row'>"
+				+ "    <span><font color='red'>*</font>商品上架审核:</span>"
+				+ "    <select name='validFlag' id='validFlag'>"
+				+ "        <option value='2'>审核通过</option>"
+				+ "        <option value='8'>审核未通过</option>"
+				+ "    <select/>"
+				+ "</div>"
+		         + "</div>";
         var html = "<div id='auditBox'>"
         var html = "<div id='auditBox'>"
-					+ "<div class='bd-row'>"
-					+ "    <span><font color='red'>*</font>审核:</span>"
-					+ "    <select name='validFlag' id='validFlag'>"
-					+ "        <option value='2'>审核通过</option>"
-					+ "        <option value='8'>审核未通过</option>"
-					+ "    <select/>"
-					+ "</div>"
+				+ "   <span><font color='red'>*</font>新品展示审核:</span>  "
+				+ "  <select name='newvalidFlag' id='newvalidFlag'> "
+				+ "        <option value='1'>审核通过</option>"
+				+ "        <option value='2'>审核未通过</option>"
+				+ "    <select/> "
 				 + "</div>";
 				 + "</div>";
+
         var submit = function (v, h, f) {
         var submit = function (v, h, f) {
             if (f.auditStatus == '') {
             if (f.auditStatus == '') {
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;
                 return false;
             }
             }
+			if (f.newvalidFlag == '' && f.validFlag == '') {
+				$("#err").show()
+				return false;
+			}else {
+				$("#err").hide()
+			}
+			debugger
+			var data=new Date();
+			data.setDate(data.getDate()+90);
+			var dtime = new Date(data);
+			commTime = dateFormat("YYYY-mm-dd HH:MM:SS",dtime);
+			if(validFlag == 2 && newProductType == 1){
+				f.validFlag=validFlag;
+
+			}
+			console.log(f.newvalidFlag)
+			console.log("t"+f.validFlag)
             $.post("${ctx}/product/new/auditProduct", {
             $.post("${ctx}/product/new/auditProduct", {
             	'productID': id,
             	'productID': id,
-                'validFlag': f.validFlag
+                'validFlag': f.validFlag,
+				'newvalidFlag': f.newvalidFlag,
+				'showtime': commTime
             }, function (data) {
             }, function (data) {
                 if (true == data.success) {
                 if (true == data.success) {
                     $.jBox.tip(data.msg, 'info');
                     $.jBox.tip(data.msg, 'info');
@@ -568,7 +667,15 @@
                 }
                 }
             }, "JSON");
             }, "JSON");
         };
         };
-        $.jBox(html, {title: "审核", submit: submit});
+		debugger
+		console.log(validFlag+"f"+newProductType)
+		if(validFlag == 2 && newProductType == 1){
+			$.jBox(html, {title: "审核", submit: submit});
+
+		}else {
+			$.jBox(htmls, {title: "审核", submit: submit});
+		}
+
     }
     }
 
 
 	function validChange(id, flag) {
 	function validChange(id, flag) {

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

@@ -19,12 +19,14 @@
 <body>
 <body>
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
     <li class="active"><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
     <li class="active"><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
-    <li><a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">添加二手商品</a></li>
+    <li><a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">添加二手预成交商品</a></li>
+    <li><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加</a></li>
 </ul>
 </ul>
 <form:form id="searchForm" modelAttribute="product" action="${ctx}/product/new/list" method="post" class="breadcrumb form-search">
 <form:form id="searchForm" modelAttribute="product" action="${ctx}/product/new/list" method="post" class="breadcrumb form-search">
     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
     <input id="searchProductCategory" name="searchProductCategory" value="2" type="hidden">
     <input id="searchProductCategory" name="searchProductCategory" value="2" type="hidden">
+
     <div class="ul-form">
     <div class="ul-form">
         <div class="flex-wrap">
         <div class="flex-wrap">
             <div class="item">
             <div class="item">
@@ -102,6 +104,14 @@
                 <label>卖家:</label>
                 <label>卖家:</label>
                 <form:input path="contactName" htmlEscape="false" maxlength="30" class="input-medium"/>
                 <form:input path="contactName" htmlEscape="false" maxlength="30" class="input-medium"/>
             </div>
             </div>
+            <div class="item">
+                <label>发布类型:</label>
+                <form:select path="announType" class="input-medium">
+                    <form:option value="" label="请选择"/>
+                    <form:option value="1" label="二手预成交商品"/>
+                    <form:option value="2" label="二手估价商品"/>
+                </form:select>
+            </div>
             <div class="item">
             <div class="item">
                 <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
                 <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
             </div>
             </div>
@@ -120,10 +130,9 @@
         <th>卖家</th>
         <th>卖家</th>
         <th>采美对接人</th>
         <th>采美对接人</th>
         <th>来源</th>
         <th>来源</th>
-        <th>市场价</th>
         <th>交易价</th>
         <th>交易价</th>
-        <th>采购价</th>
         <th>线上分帐号</th>
         <th>线上分帐号</th>
+        <th>发布类型</th>
         <th>分类</th>
         <th>分类</th>
         <th>商品状态</th>
         <th>商品状态</th>
         <th>交易状态</th>
         <th>交易状态</th>
@@ -196,28 +205,20 @@
                     小程序-协销
                     小程序-协销
                 </c:if>
                 </c:if>
             </td>
             </td>
+            <td>${product.price}</td>
             <td>
             <td>
-                    <%--市场价为空不显示--%>
-                <c:if test="${empty product.normalPrice}">
-                    ---
-                </c:if>
-                <c:if test="${not empty product.normalPrice}">
-                    ${product.normalPrice}
-                </c:if>
+                    ${product.splitCode}
             </td>
             </td>
-            <td>${product.price}</td>
+
             <td>
             <td>
-                    <%--采购价为空不显示--%>
-                <c:if test="${empty product.originalPrice}">
-                    ---
+                <c:if test="${product.announType eq 1}">
+                    二手预成交商品
                 </c:if>
                 </c:if>
-                <c:if test="${not empty product.originalPrice}">
-                    ${product.originalPrice}
+                <c:if test="${product.announType eq 2}">
+                    二手估价商品
                 </c:if>
                 </c:if>
             </td>
             </td>
-            <td>
-                    ${product.splitCode}
-            </td>
+
             <td>
             <td>
                 ${product.secondHandType eq 1?'二手仪器':product.secondHandType eq 2?'临期产品':'其他'}
                 ${product.secondHandType eq 1?'二手仪器':product.secondHandType eq 2?'临期产品':'其他'}
                 <c:if test="${product.secondHandType eq 1}">
                 <c:if test="${product.secondHandType eq 1}">
@@ -261,12 +262,19 @@
                 <c:if test="${product.productCategory eq 2}">
                 <c:if test="${product.productCategory eq 2}">
                     <c:if test="${product.validFlag ne 0}">
                     <c:if test="${product.validFlag ne 0}">
                         <td class="todo">
                         <td class="todo">
-                            <a href="${ctx}/product/cmSecondHandDetail/form?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}&editFlag=${editFlag}">商品编辑</a>
+                        <c:if test="${product.announType eq 1}">
+                            <a href="${ctx}/product/cmSecondHandDetail/form?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}&editFlag=${editFlag}&fileTypes=999">商品编辑</a>
+                        </c:if>
+                            <c:if test="${product.announType eq 2}">
+                                <a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?id=${product.id}&searchProductCategory=2&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}">商品编辑</a>
+                                <a href="${ctx}/product/cmSecondHandDetail/form?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}&editFlag=${editFlag}&fileTypes=999">转为预成交商品</a>
+<%--                                <a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">转为预成交商品</a>--%>
+                            </c:if>
                             <a href="${ctx}/product/cmSecondHandTransaction/toRecommend?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>
                             <a href="${ctx}/product/cmSecondHandTransaction/toRecommend?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>
                                 <%--                                   <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>--%>
                                 <%--                                   <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已冻结)--%>
                                 <%--待审核或审核未通过才需要审核( 1待审核 2已上架 3已下架 8审核未通过 9已冻结)--%>
                             <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
                             <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.price})">审核</a>
                             </c:if>
                             </c:if>
                                 <%--已上架的才可以下架--%>
                                 <%--已上架的才可以下架--%>
                             <c:if test="${product.validFlag eq 2}">
                             <c:if test="${product.validFlag eq 2}">
@@ -301,6 +309,8 @@
                             <c:if test="${product.validFlag eq 9}">
                             <c:if test="${product.validFlag eq 9}">
                                 <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 2)">解除冻结</a>
                                 <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 2)">解除冻结</a>
                             </c:if>
                             </c:if>
+
+
                             <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 0)" >删除</a>
                             <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 0)" >删除</a>
                         </td>
                         </td>
                     </c:if>
                     </c:if>
@@ -409,7 +419,8 @@
     }
     }
 
 
     // 审核(二手)
     // 审核(二手)
-    function auditThisBySencodeProduct(id,costPrice){
+    function auditThisBySencodeProduct(id,costPrice,price,costProportional){
+
         var html = "<div id='auditBox'>"
         var html = "<div id='auditBox'>"
             + "<div class='bd-row'>"
             + "<div class='bd-row'>"
             + "    <span><font color='red'>*</font>审核:</span>"
             + "    <span><font color='red'>*</font>审核:</span>"
@@ -419,7 +430,22 @@
             + "    <select/>"
             + "    <select/>"
             + "</div>"
             + "</div>"
             + "</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) {
         var submit = function (v, h, f) {
+            console.log(f.validFlag)
+            if(f.validFlag ==2) {
+                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;
+                }
+            }
+
             if (f.auditStatus == '') {
             if (f.auditStatus == '') {
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;
                 return false;

+ 125 - 167
src/main/webapp/WEB-INF/views/modules/product/cmSecondDetailForm.jsp

@@ -13,10 +13,7 @@
                 submitHandler: function (form) {
                 submitHandler: function (form) {
                     var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
                     var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
                     var find = $("input[name='ids']:checked").val();
                     var find = $("input[name='ids']:checked").val();
-                    if (!find >= 1) {
-                        alertx("请选择商品包含的文件!");
-                        return false;
-                    }
+
                     var publishIdentity = $("input[name='publishIdentity']:checked").val();
                     var publishIdentity = $("input[name='publishIdentity']:checked").val();
                     console.log(publishIdentity);
                     console.log(publishIdentity);
                     if (!publishIdentity > 0) {
                     if (!publishIdentity > 0) {
@@ -301,15 +298,16 @@
 <body>
 <body>
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
-    <li class="active"><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm">二手估价商品添加 / 编辑</a></li>
+    <li class="active"><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加</a></li>
 </ul>
 </ul>
 <br/>
 <br/>
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
-           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
+           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&announType=2&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
            method="post" class="form-horizontal">
            method="post" class="form-horizontal">
     <form:hidden path="id"/>
     <form:hidden path="id"/>
     <form:hidden path="validFlag"/>
     <form:hidden path="validFlag"/>
     <form:hidden path="payType"/>
     <form:hidden path="payType"/>
+    <input value="2" type="hidden" id="announType">
     <sys:message content="${message}"/>
     <sys:message content="${message}"/>
     <%--		新增加不需要显示--%>
     <%--		新增加不需要显示--%>
     <c:if test="${ not empty cmSecondHandDetail.id}">
     <c:if test="${ not empty cmSecondHandDetail.id}">
@@ -341,7 +339,7 @@
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <div class="controls" style="margin-top: 5px">
         <div class="controls" style="margin-top: 5px">
-            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/>
+            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/> <span style="color: red">(请填写真实的二手卖家姓名)</span>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
@@ -351,22 +349,7 @@
             <form:radiobutton path="sold" value="1" label="已售"/>
             <form:radiobutton path="sold" value="1" label="已售"/>
         </div>
         </div>
     </div>
     </div>
-    <%--	<div class="control-group">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款状态:</label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<form:select path="payStatus" class="input-mini required">--%>
-    <%--				<form:option value="3" checked="true">无需付款</form:option>--%>
-    <%--				<form:option value="1">待付款</form:option>--%>
-    <%--				<form:option value="2">已付款</form:option>--%>
-    <%--			</form:select>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
-    <%--	<div class="control-group payAmount">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款金额:¥ </label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<input id="payAmount" name="payAmount"  maxlength="11" style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px" onkeyup="num(this)" value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.payAmount}' pattern='0.00'/>"  class="input-xlarge required"/>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
+
     <div class="control-group">
     <div class="control-group">
         <label class="control-label">浏览量:</label>
         <label class="control-label">浏览量:</label>
         <div class="controls">
         <div class="controls">
@@ -384,12 +367,12 @@
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>分类:</label>
         <label class="control-label"><font color="red">*</font>分类:</label>
         <div class="controls c-s" style="margin-top: 5px">
         <div class="controls c-s" style="margin-top: 5px">
-            <form:radiobutton path="secondHandType" value="1" label="二手仪器"/>
-            <form:radiobutton path="secondHandType" value="3" label="其他"/>
+            <form:radiobutton path="secondHandType" name="secondHandType" value="1" label="二手仪器"/>
+            <form:radiobutton path="secondHandType" name="secondHandType" value="3" label="其他"/>
         </div>
         </div>
         <div class="controls c-s bigTypeList" style="margin-left: 181px">
         <div class="controls c-s bigTypeList" style="margin-left: 181px">
-<%--            <form:checkboxes path="bigTypeList" items="" itemLabel="name" itemValue="id" htmlEscape="false"--%>
-<%--                             class="input-small  stylema required"/>--%>
+            <form:checkboxes path="bigTypeList" items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"
+                             class="input-small  stylema required"/>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
@@ -404,17 +387,17 @@
         </div>
         </div>
     </div>
     </div>
     <c:if test="${not empty cmSecondHandDetail.id}">
     <c:if test="${not empty cmSecondHandDetail.id}">
-    <div class="control-group">
-        <label class="control-label">线上分账账号:</label>
-        <div class="controls">
-            <form:select path="splitCode" class="select-ele input-medium">
-                <form:option value="" label="请选择"/>
-                <c:forEach items="${splitCodeList}" var="splitCodeList" varStatus="index">
-                    <form:option value="${splitCodeList.splitCode}" label="${splitCodeList.codeRemark}"/>
-                </c:forEach>
-            </form:select>
+        <div class="control-group">
+            <label class="control-label">线上分账账号:</label>
+            <div class="controls">
+                <form:select path="splitCode" class="select-ele input-medium">
+                    <form:option value="" label="请选择"/>
+                    <c:forEach items="${splitCodeList}" var="splitCodeList" varStatus="index">
+                        <form:option value="${splitCodeList.splitCode}" label="${splitCodeList.codeRemark}"/>
+                    </c:forEach>
+                </form:select>
+            </div>
         </div>
         </div>
-    </div>
     </c:if>
     </c:if>
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>商品品牌:</label>
         <label class="control-label"><font color="red">*</font>商品品牌:</label>
@@ -443,12 +426,7 @@
             <form:input path="fixedYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>
             <form:input path="fixedYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>
         </div>
         </div>
     </div>
     </div>
-<%--    <div class="control-group maturityYears showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>产品到期日期:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="maturityYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group" id="gsmc">
     <div class="control-group" id="gsmc">
         <label class="control-label"><font color="red">*</font>公司名称:</label>
         <label class="control-label"><font color="red">*</font>公司名称:</label>
         <div class="controls">
         <div class="controls">
@@ -469,30 +447,7 @@
             </label>
             </label>
         </div>
         </div>
     </div>
     </div>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>市场价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="normalPrice" name="normalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.normalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>采购价/原价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="originalPrice" name="originalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.originalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>数量:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="stock" htmlEscape="false" class="input-xlarge  number"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>成本:</label>
         <label class="control-label"><font color="red">*</font>成本:</label>
         <div class="controls">
         <div class="controls">
@@ -596,11 +551,11 @@
             <form:select path="city" class="input-xlarge required" id="city" onchange="loadTown()"
             <form:select path="city" class="input-xlarge required" id="city" onchange="loadTown()"
                          style="width:100px;">
                          style="width:100px;">
                 <form:option value="" label="市" cityId=""/>
                 <form:option value="" label="市" cityId=""/>
-            </form:select>&nbsp;&nbsp;
+            </form:select>&nbsp;&nbsp;   <%--required--%>
             <form:select path="town" class="input-xlarge required" id="town" style="width:100px;">
             <form:select path="town" class="input-xlarge required" id="town" style="width:100px;">
                 <form:option value="" label="区"/>
                 <form:option value="" label="区"/>
             </form:select>&nbsp;&nbsp;
             </form:select>&nbsp;&nbsp;
-            <form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
+            <form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge "/>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
@@ -687,6 +642,106 @@
     </div>
     </div>
 </form:form>
 </form:form>
 <script>
 <script>
+    $(function () {
+
+
+        // 加载地址
+        loadProvince();
+
+        // 初始化付款状态
+        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
+            //待支付情况下不能填写付款金额
+            $('.payAmount').hide();
+            $('#payAmount').removeClass('required');
+        }
+
+        if ($('#payStatus').val() == '2') {
+            //已支付情况下需要填写付款金额, 而且必填
+            $('.payAmount').show();
+            $('#payAmount').addClass('required');
+        }
+
+        // 价格控制
+        if (val == 1 || val == 3) {
+            $('.showClassDiv').hide();
+        }
+        if (val == 2) {
+            $('.showClassDiv').show();
+        }
+
+        //	修改支付状态
+        $('#payStatus').change(function () {
+                var val = $("#payStatus").val();
+                if (val == 1 || val == 3) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').hide();
+                    $('#payAmount').removeClass('required');
+                }
+                if (val == 2) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').show();
+                    $('#payAmount').addClass('required');
+                }
+            }
+        );
+
+
+        // 初始化分类
+        var val = $("input[name ='secondHandType']:checked").val();
+        console.log(val)
+        // 分类控制
+        if (val == 2 || val == 3 || val == undefined) {
+            $('.bigTypeList').hide();
+        }
+        if (val == 1) {
+            $('.bigTypeList').show();
+        }
+    // 修改分类
+    $("input[name='secondHandType']").change(function () {
+        var val = $(this).val();
+        console.log(val)
+        // 分类控制
+        if (val == 2 || val == 3) {
+            $('.bigTypeList').hide();
+        }
+        if (val == 1) {
+            $('.bigTypeList').show();
+        }
+
+        // 价格控制
+        if (val == 1 || val == 3) {
+            $('.showClassDiv').hide();
+        }
+        if (val == 2) {
+            $('.showClassDiv').show();
+        }
+
+
+    });
+        $('#brandID').change(function () {
+            var val = $(this).val();
+            console.log(val)
+            if (val == '161') {
+                //显示输入框
+                $("#brandName").show();
+            }
+            if (val != '161') {
+                //隐藏输入框
+                $("#brandName").hide();
+            }
+        });
+        //初始化
+        var val = $("#brandID option:selected").val();
+        if (val == '161') {
+            //显示输入框
+            $("#brandName").show();
+        }
+        if (val != '161') {
+            //隐藏输入框
+            $("#brandName").hide();
+        }
+    });
+
 
 
     //图片初始化
     //图片初始化
     $(function () {
     $(function () {
@@ -758,7 +813,6 @@
             eval(str + '()');
             eval(str + '()');
         });
         });
         $('body').on('click', '.cancel-upload', function () {
         $('body').on('click', '.cancel-upload', function () {
-            debugger
             var wrapper = $(this).closest('.conList');
             var wrapper = $(this).closest('.conList');
             wrapper.find('li').css('z-index', '-1');
             wrapper.find('li').css('z-index', '-1');
             wrapper.find('input').val('');
             wrapper.find('input').val('');
@@ -893,103 +947,6 @@
             });
             });
         })
         })
     });
     });
-    $(function () {
-        // 加载地址
-        loadProvince();
-
-        // 初始化付款状态
-        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
-            //待支付情况下不能填写付款金额
-            $('.payAmount').hide();
-            $('#payAmount').removeClass('required');
-        }
-
-        if ($('#payStatus').val() == '2') {
-            //已支付情况下需要填写付款金额, 而且必填
-            $('.payAmount').show();
-            $('#payAmount').addClass('required');
-        }
-
-        // 初始化分类
-        var val = $("input[name ='secondHandType']:checked").val();
-        // 分类控制
-        if (val == 2 || val == 3 || val == undefined) {
-            $('.bigTypeList').hide();
-        }
-        if (val == 1) {
-            $('.bigTypeList').show();
-        }
-
-
-        // 价格控制
-        if (val == 1 || val == 3) {
-            $('.showClassDiv').hide();
-        }
-        if (val == 2) {
-            $('.showClassDiv').show();
-        }
-
-
-        $('#brandID').change(function () {
-            var val = $(this).val();
-            if (val == '161') {
-                //显示输入框
-                $("#brandName").show();
-            }
-            if (val != '161') {
-                //隐藏输入框
-                $("#brandName").hide();
-            }
-        });
-
-        //初始化
-        var val = $("#brandID option:selected").val();
-        if (val == '161') {
-            //显示输入框
-            $("#brandName").show();
-        }
-        if (val != '161') {
-            //隐藏输入框
-            $("#brandName").hide();
-        }
-
-        //	修改支付状态
-        $('#payStatus').change(function () {
-                var val = $("#payStatus").val();
-                if (val == 1 || val == 3) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').hide();
-                    $('#payAmount').removeClass('required');
-                }
-                if (val == 2) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').show();
-                    $('#payAmount').addClass('required');
-                }
-            }
-        );
-        // 修改分类
-        $("input[name='secondHandType']").change(function () {
-            var val = $(this).val();
-            // 分类控制
-            if (val == 2 || val == 3) {
-                $('.bigTypeList').hide();
-            }
-            if (val == 1) {
-                $('.bigTypeList').show();
-            }
-
-            // 价格控制
-            if (val == 1 || val == 3) {
-                $('.showClassDiv').hide();
-            }
-            if (val == 2) {
-                $('.showClassDiv').show();
-            }
-
-        });
-
-    });
 
 
     /**
     /**
      * 加载省份
      * 加载省份
@@ -1152,6 +1109,7 @@
                     }
                     }
 
 
                     var secondHandType = $("input[name ='secondHandType']:checked").val();
                     var secondHandType = $("input[name ='secondHandType']:checked").val();
+                    console.log(secondHandType)
                     if (secondHandType == 2) {
                     if (secondHandType == 2) {
                         var maturityYears = $("#maturityYears").val();
                         var maturityYears = $("#maturityYears").val();
                         // (验证到期时期)
                         // (验证到期时期)

+ 112 - 148
src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp

@@ -302,13 +302,13 @@
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
     <li class="active"><a
     <li class="active"><a
-            href="${ctx}/product/cmSecondHandDetail/form?id=${cmSecondHandDetail.id}">二手商品<shiro:hasPermission
+            href="${ctx}/product/cmSecondHandDetail/form?id=${cmSecondHandDetail.id}">二手预成商品<shiro:hasPermission
             name="product:cmSecondHandDetail:edit">${not empty cmSecondHandDetail.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission
             name="product:cmSecondHandDetail:edit">${not empty cmSecondHandDetail.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission
             name="product:cmSecondHandDetail:edit">查看</shiro:lacksPermission></a></li>
             name="product:cmSecondHandDetail:edit">查看</shiro:lacksPermission></a></li>
 </ul>
 </ul>
 <br/>
 <br/>
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
-           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
+           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&announType=1&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
            method="post" class="form-horizontal">
            method="post" class="form-horizontal">
     <form:hidden path="id"/>
     <form:hidden path="id"/>
     <form:hidden path="validFlag"/>
     <form:hidden path="validFlag"/>
@@ -344,7 +344,7 @@
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <div class="controls" style="margin-top: 5px">
         <div class="controls" style="margin-top: 5px">
-            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/>
+            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/><span style="color: red">(请填写真实的二手卖家姓名)</span>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
@@ -354,22 +354,7 @@
             <form:radiobutton path="sold" value="1" label="已售"/>
             <form:radiobutton path="sold" value="1" label="已售"/>
         </div>
         </div>
     </div>
     </div>
-    <%--	<div class="control-group">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款状态:</label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<form:select path="payStatus" class="input-mini required">--%>
-    <%--				<form:option value="3" checked="true">无需付款</form:option>--%>
-    <%--				<form:option value="1">待付款</form:option>--%>
-    <%--				<form:option value="2">已付款</form:option>--%>
-    <%--			</form:select>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
-    <%--	<div class="control-group payAmount">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款金额:¥ </label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<input id="payAmount" name="payAmount"  maxlength="11" style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px" onkeyup="num(this)" value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.payAmount}' pattern='0.00'/>"  class="input-xlarge required"/>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
+
     <div class="control-group">
     <div class="control-group">
         <label class="control-label">浏览量:</label>
         <label class="control-label">浏览量:</label>
         <div class="controls">
         <div class="controls">
@@ -446,12 +431,7 @@
             <form:input path="fixedYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>
             <form:input path="fixedYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>
         </div>
         </div>
     </div>
     </div>
-<%--    <div class="control-group maturityYears showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>产品到期日期:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="maturityYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group" id="gsmc">
     <div class="control-group" id="gsmc">
         <label class="control-label"><font color="red">*</font>公司名称:</label>
         <label class="control-label"><font color="red">*</font>公司名称:</label>
         <div class="controls">
         <div class="controls">
@@ -472,30 +452,7 @@
             </label>
             </label>
         </div>
         </div>
     </div>
     </div>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>市场价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="normalPrice" name="normalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.normalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>采购价/原价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="originalPrice" name="originalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.originalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>数量:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="stock" htmlEscape="false" class="input-xlarge  number"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group">
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>成本:</label>
         <label class="control-label"><font color="red">*</font>成本:</label>
         <div class="controls">
         <div class="controls">
@@ -635,15 +592,15 @@
         <form:input path="townId" Id="townId" type="hidden" value="${cmSecondHandDetail.townId}"/>
         <form:input path="townId" Id="townId" type="hidden" value="${cmSecondHandDetail.townId}"/>
         <label class="control-label"><font color="red">*</font>联系地址:</label>
         <label class="control-label"><font color="red">*</font>联系地址:</label>
         <div>
         <div>
-            <form:select path="province" class="input-xlarge required" id="province"
+            <form:select path="province" class="input-xlarge " id="province"
                          onchange="loadCity()" style="width:100px;">
                          onchange="loadCity()" style="width:100px;">
                 <form:option value="" label="省" provinceId=""/>
                 <form:option value="" label="省" provinceId=""/>
             </form:select>&nbsp;&nbsp;
             </form:select>&nbsp;&nbsp;
-            <form:select path="city" class="input-xlarge required" id="city" onchange="loadTown()"
+            <form:select path="city" class="input-xlarge " id="city" onchange="loadTown()"
                          style="width:100px;">
                          style="width:100px;">
                 <form:option value="" label="市" cityId=""/>
                 <form:option value="" label="市" cityId=""/>
             </form:select>&nbsp;&nbsp;
             </form:select>&nbsp;&nbsp;
-            <form:select path="town" class="input-xlarge required" id="town" style="width:100px;">
+            <form:select path="town" class="input-xlarge " id="town" style="width:100px;">
                 <form:option value="" label="区"/>
                 <form:option value="" label="区"/>
             </form:select>&nbsp;&nbsp;
             </form:select>&nbsp;&nbsp;
             <form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
             <form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
@@ -766,6 +723,109 @@
     </div>
     </div>
 </form:form>
 </form:form>
 <script>
 <script>
+    debugger
+    $(function () {
+            // 加载地址
+            loadProvince();
+
+            // 初始化付款状态
+            if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
+                //待支付情况下不能填写付款金额
+                $('.payAmount').hide();
+                $('#payAmount').removeClass('required');
+            }
+
+            if ($('#payStatus').val() == '2') {
+                //已支付情况下需要填写付款金额, 而且必填
+                $('.payAmount').show();
+                $('#payAmount').addClass('required');
+            }
+
+            // 初始化分类
+            var val = $("input[name ='secondHandType']:checked").val();
+            // 分类控制
+            if (val == 2 || val == 3 || val == undefined) {
+                $('.bigTypeList').hide();
+            }
+            if (val == 1) {
+                $('.bigTypeList').show();
+            }
+
+
+            // 价格控制
+            if (val == 1 || val == 3) {
+                $('.showClassDiv').hide();
+            }
+            if (val == 2) {
+                $('.showClassDiv').show();
+            }
+
+
+            $('#brandID').change(function () {
+                var val = $(this).val();
+                if (val == '161') {
+                    //显示输入框
+                    $("#brandName").show();
+                }
+                if (val != '161') {
+                    //隐藏输入框
+                    $("#brandName").hide();
+                }
+            });
+
+            //初始化
+            var val = $("#brandID option:selected").val();
+            if (val == '161') {
+                //显示输入框
+                $("#brandName").show();
+            }
+            if (val != '161') {
+                //隐藏输入框
+                $("#brandName").hide();
+            }
+
+            //	修改支付状态
+            $('#payStatus').change(function () {
+                    var val = $("#payStatus").val();
+                    if (val == 1 || val == 3) {
+                        //待支付情况下不能填写付款金额
+                        $('.payAmount').hide();
+                        $('#payAmount').removeClass('required');
+                    }
+                    if (val == 2) {
+                        //待支付情况下不能填写付款金额
+                        $('.payAmount').show();
+                        $('#payAmount').addClass('required');
+                    }
+                }
+            );
+            // 修改分类
+            $("input[name='secondHandType']").change(function () {
+                var val = $(this).val();
+                // 分类控制
+                if (val == 2 || val == 3) {
+                    $('.bigTypeList').hide();
+                }
+                if (val == 1) {
+                    $('.bigTypeList').show();
+                }
+
+                // 价格控制
+                if (val == 1 || val == 3) {
+                    $('.showClassDiv').hide();
+                }
+                if (val == 2) {
+                    $('.showClassDiv').show();
+                }
+
+            });
+
+        });
+
+
+
+
+
 
 
     //图片初始化
     //图片初始化
     $(function () {
     $(function () {
@@ -972,103 +1032,7 @@
             });
             });
         })
         })
     });
     });
-    $(function () {
-        // 加载地址
-        loadProvince();
-
-        // 初始化付款状态
-        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
-            //待支付情况下不能填写付款金额
-            $('.payAmount').hide();
-            $('#payAmount').removeClass('required');
-        }
-
-        if ($('#payStatus').val() == '2') {
-            //已支付情况下需要填写付款金额, 而且必填
-            $('.payAmount').show();
-            $('#payAmount').addClass('required');
-        }
-
-        // 初始化分类
-        var val = $("input[name ='secondHandType']:checked").val();
-        // 分类控制
-        if (val == 2 || val == 3 || val == undefined) {
-            $('.bigTypeList').hide();
-        }
-        if (val == 1) {
-            $('.bigTypeList').show();
-        }
-
-
-        // 价格控制
-        if (val == 1 || val == 3) {
-            $('.showClassDiv').hide();
-        }
-        if (val == 2) {
-            $('.showClassDiv').show();
-        }
-
-
-        $('#brandID').change(function () {
-            var val = $(this).val();
-            if (val == '161') {
-                //显示输入框
-                $("#brandName").show();
-            }
-            if (val != '161') {
-                //隐藏输入框
-                $("#brandName").hide();
-            }
-        });
 
 
-        //初始化
-        var val = $("#brandID option:selected").val();
-        if (val == '161') {
-            //显示输入框
-            $("#brandName").show();
-        }
-        if (val != '161') {
-            //隐藏输入框
-            $("#brandName").hide();
-        }
-
-        //	修改支付状态
-        $('#payStatus').change(function () {
-                var val = $("#payStatus").val();
-                if (val == 1 || val == 3) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').hide();
-                    $('#payAmount').removeClass('required');
-                }
-                if (val == 2) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').show();
-                    $('#payAmount').addClass('required');
-                }
-            }
-        );
-        // 修改分类
-        $("input[name='secondHandType']").change(function () {
-            var val = $(this).val();
-            // 分类控制
-            if (val == 2 || val == 3) {
-                $('.bigTypeList').hide();
-            }
-            if (val == 1) {
-                $('.bigTypeList').show();
-            }
-
-            // 价格控制
-            if (val == 1 || val == 3) {
-                $('.showClassDiv').hide();
-            }
-            if (val == 2) {
-                $('.showClassDiv').show();
-            }
-
-        });
-
-    });
 
 
     /**
     /**
      * 加载省份
      * 加载省份

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/user/cmSpForm.jsp

@@ -55,25 +55,25 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>协销名称</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>协销名称</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="linkMan" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="linkMan" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>手机号</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>手机号</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="mobile" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="mobile" type="number" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>登录密码</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>登录密码</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="password" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="password" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>确认密码</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>确认密码</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="passWordConfirm" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="passWordConfirm" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">

+ 4 - 4
src/main/webapp/WEB-INF/views/modules/userNew/cmSpForm.jsp

@@ -64,25 +64,25 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>协销名称</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>协销名称</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="linkMan" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="linkMan" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>手机号</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>手机号</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="mobile" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="mobile" type="number" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>登录密码</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>登录密码</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="password" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="password" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>确认密码</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>确认密码</label>
 			<div class="controls">
 			<div class="controls">
-				<input name="passWordConfirm" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
+				<input name="passWordConfirm" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">