Parcourir la source

联合丽格 组织管理bugfix

kaick il y a 2 ans
Parent
commit
a8992d794d
23 fichiers modifiés avec 427 ajouts et 230 suppressions
  1. 1 1
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  2. 1 1
      src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java
  3. 1 1
      src/main/java/com/caimei/modules/weisha/dao/CmMallUserDao.java
  4. 5 0
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java
  5. 3 0
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java
  6. 2 2
      src/main/java/com/caimei/modules/weisha/entity/CmOrganizeStore.java
  7. 1 1
      src/main/java/com/caimei/modules/weisha/service/CmMallUserService.java
  8. 2 0
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java
  9. 57 53
      src/main/java/com/caimei/modules/weisha/web/CmMallOrganizeController.java
  10. 53 15
      src/main/java/com/caimei/modules/weisha/web/CmMallUserController.java
  11. 6 1
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java
  12. 17 1
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java
  13. 1 1
      src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml
  14. 9 2
      src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml
  15. 4 1
      src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml
  16. 19 3
      src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml
  17. 2 1
      src/main/webapp/WEB-INF/views/modules/weisha/CmMallUserList.jsp
  18. 90 29
      src/main/webapp/WEB-INF/views/modules/weisha/cmMallUserForm.jsp
  19. 41 36
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductForm.jsp
  20. 43 27
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductList.jsp
  21. 2 4
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreForm.jsp
  22. 49 35
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreFormGet.jsp
  23. 18 15
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreList.jsp

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

@@ -142,7 +142,7 @@ public class NewOrder extends DataEntity<NewOrder> {
     private String rebateFee; // 返佣服务费
     private String rebateFee; // 返佣服务费
     private String associationType;//订单关联方式: 1手动 2自动
     private String associationType;//订单关联方式: 1手动 2自动
     private Double ableUserMoney; //当前下单用户可用余额
     private Double ableUserMoney; //当前下单用户可用余额
-    private String organizeStoreName;//组织门店名称
+    private String organizeStoreName;//组织机构名称
     /**
     /**
      * 优惠券机构关联ID
      * 优惠券机构关联ID
      */
      */

+ 1 - 1
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -1105,7 +1105,7 @@ public class AgencyController extends BaseController {
         }
         }
         return map;
         return map;
     }
     }
-
+//11111111q
     /**
     /**
      * 机构审核
      * 机构审核
      *
      *

+ 1 - 1
src/main/java/com/caimei/modules/weisha/dao/CmMallUserDao.java

@@ -40,7 +40,7 @@ public interface CmMallUserDao {
      * 获取相同用户名的用户
      * 获取相同用户名的用户
      * @return
      * @return
      */
      */
-    Integer getRepeat(@Param("account") String account);
+    Integer getRepeat(@Param("account") String account,@Param("id") String id);
 
 
     /**
     /**
      * 添加组织后台用户
      * 添加组织后台用户

+ 5 - 0
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java

@@ -96,6 +96,11 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
      * @param id
      * @param id
      */
      */
     void deleteProduct(@Param("id") String id);
     void deleteProduct(@Param("id") String id);
+    /**
+     * 删除商品sku
+     * @param id
+     */
+    void deleteMallProductSku(@Param("id") String id);
     /**
     /**
      * 根据商品Id查询商品信息
      * 根据商品Id查询商品信息
      * @param productId
      * @param productId

+ 3 - 0
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java

@@ -19,6 +19,9 @@ public interface CmOrganizeStoreDao extends CrudDao<CmOrganizeStore> {
 
 
     void cleanWx(@Param("userId") Integer userId);
     void cleanWx(@Param("userId") Integer userId);
 
 
+    void clubStatus(@Param("id") Integer id,@Param("status") Integer status);
+    void userStatus(@Param("id") Integer id,@Param("status") Integer status);
+
     CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
     CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
 
 
     List<CmOrganizeStore> findListByMobile(CmOrganizeStore cmOrganizeStore);
     List<CmOrganizeStore> findListByMobile(CmOrganizeStore cmOrganizeStore);

+ 2 - 2
src/main/java/com/caimei/modules/weisha/entity/CmOrganizeStore.java

@@ -17,7 +17,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	private Integer userId;		// 用户Id
 	private Integer userId;		// 用户Id
 	private Integer clubId;		// 机构Id
 	private Integer clubId;		// 机构Id
 	private Integer organizeId;		// 组织id
 	private Integer organizeId;		// 组织id
-	private String name;		// 门店名称
+	private String name;		// 机构名称
 	private String linkMan;		// 联系人
 	private String linkMan;		// 联系人
 	private String mobile;		// 手机号
 	private String mobile;		// 手机号
 	private Integer provinceId;		// 省id
 	private Integer provinceId;		// 省id
@@ -71,7 +71,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 		this.organizeId = organizeId;
 		this.organizeId = organizeId;
 	}
 	}
 
 
-	@Length(min=0, max=30, message="门店名称长度必须介于 0 和 30 之间")
+	@Length(min=0, max=30, message="机构名称长度必须介于 0 和 30 之间")
 	public String getName() {
 	public String getName() {
 		return name;
 		return name;
 	}
 	}

+ 1 - 1
src/main/java/com/caimei/modules/weisha/service/CmMallUserService.java

@@ -80,7 +80,7 @@ public class CmMallUserService {
         cmMallUser.setPassword(s);
         cmMallUser.setPassword(s);
         cmMallUser.setSalt(split[0]);
         cmMallUser.setSalt(split[0]);
         cmMallUser.setUpdateTime(new Date());
         cmMallUser.setUpdateTime(new Date());
-        if (null == cmMallUser.getId()) {
+        if (null == cmMallUser.getId()||"" == cmMallUser.getId()) {
             // 添加组织后台用户信息
             // 添加组织后台用户信息
             cmMallUser.setAddTime(new Date());
             cmMallUser.setAddTime(new Date());
             cmMallUser.setDelFlag("0");
             cmMallUser.setDelFlag("0");

+ 2 - 0
src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java

@@ -146,6 +146,8 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 	public void deleteProduct(CmOrganizeProduct cmOrganizeProduct) {
 	public void deleteProduct(CmOrganizeProduct cmOrganizeProduct) {
 		//删除商品对应的促销活动
 		//删除商品对应的促销活动
 		cmOrganizeProductDao.deleteProduct(cmOrganizeProduct.getId());
 		cmOrganizeProductDao.deleteProduct(cmOrganizeProduct.getId());
+		//删除商品对应的促销活动sku
+		cmOrganizeProductDao.deleteMallProductSku(cmOrganizeProduct.getId());
 	}
 	}
 
 
     public Page findProductPage(Page<Product> productPage, Product product) {
     public Page findProductPage(Page<Product> productPage, Product product) {

+ 57 - 53
src/main/java/com/caimei/modules/weisha/web/CmMallOrganizeController.java

@@ -88,7 +88,10 @@ public class CmMallOrganizeController extends BaseController {
         NewCmClub newCmClub = new NewCmClub();
         NewCmClub newCmClub = new NewCmClub();
         if (StringUtils.isNotEmpty(cmMallOrganize.getId())) {
         if (StringUtils.isNotEmpty(cmMallOrganize.getId())) {
             cmUser = cmUserDao.findUserByOrganizeId(Integer.parseInt(cmMallOrganize.getId()));
             cmUser = cmUserDao.findUserByOrganizeId(Integer.parseInt(cmMallOrganize.getId()));
-            newCmClub = newCmClubService.getclubByUserId(cmUser.getUserID());
+            if(cmUser!=null){
+                //获取会所资料信息
+                newCmClub = newCmClubService.getclubByUserId(cmUser.getUserID());
+            }
         }
         }
         //判断该会所手机号是否已存在
         //判断该会所手机号是否已存在
         cmUser.setBindMobile(cmMallOrganize.getMobile());
         cmUser.setBindMobile(cmMallOrganize.getMobile());
@@ -98,59 +101,60 @@ public class CmMallOrganizeController extends BaseController {
             return form(cmMallOrganize, model);
             return form(cmMallOrganize, model);
         }
         }
         cmMallOrganizeService.save(cmMallOrganize);
         cmMallOrganizeService.save(cmMallOrganize);
-
-        //添加用户信息(新增或修改通用)
-        cmUser.setUserOrganizeID(Integer.parseInt(cmMallOrganize.getId()));
-        cmUser.setName(cmMallOrganize.getOrganizeName());
-        cmUser.setLinkMan(cmMallOrganize.getOrganizeLinkName());
-        cmUser.setUserName(cmMallOrganize.getOrganizeLinkName());
-        newCmClub.setName(cmMallOrganize.getOrganizeName());
-        newCmClub.setLinkMan(cmMallOrganize.getOrganizeLinkName());
-        newCmClub.setContractMobile(cmMallOrganize.getMobile());
-        if (StringUtil.isNotBlank(cmMallOrganize.getOrganizeName())) {
-            //添加用户新增信息
-            if (null == cmUser.getUserID()) {//新增
-                cmUser.setClubStatus("1".equals(cmMallOrganize.getStatus()) ? "90" : "91");
-                cmUser.setRegisterUserTypeID("4");//设置为会所
-                cmUser.setUserIdentity(4);
-                cmUser.setServiceProviderStatus("90");//设置默认协销状态
-                cmUser.setServiceProviderID("1342");
-                cmUser.setAuditTime(currentDate);
-                cmUser.setAuditStatus("1");//审核通过
-                cmUser.setAuditNote("后台添加用户系统默认审核通过");
-                cmUser.setRegisterTime(currentDate);
-                cmUser.setLoginTime(currentDate);
-                cmUser.setAccount(cmMallOrganize.getMobile() + RandomCodeGenerator.generateAccount(2));
-                cmUser.setPassword("weisha");
-                cmUser.setBindMobile(cmMallOrganize.getMobile());
-                cmUser.setUserMoney(0d);
-                cmUser.setAbleUserMoney(0d);
-                cmUser.setValidFlag("1");
-                cmUser.setAgreeFlag("1");
-                cmUser.setUserPermission(5);
-                cmUserService.insert(cmUser);//插入新的用户数据
+        if (cmUser != null&&newCmClub!=null) {
+            //添加用户信息(新增或修改通用)
+            cmUser.setUserOrganizeID(Integer.parseInt(cmMallOrganize.getId()));
+            cmUser.setName(cmMallOrganize.getOrganizeName());
+            cmUser.setLinkMan(cmMallOrganize.getOrganizeLinkName());
+            cmUser.setUserName(cmMallOrganize.getOrganizeLinkName());
+            newCmClub.setName(cmMallOrganize.getOrganizeName());
+            newCmClub.setLinkMan(cmMallOrganize.getOrganizeLinkName());
+            newCmClub.setContractMobile(cmMallOrganize.getMobile());
+            if (StringUtil.isNotBlank(cmMallOrganize.getOrganizeName())) {
+                //添加用户新增信息
+                if (null == cmUser.getUserID()) {//新增
+                    cmUser.setClubStatus("1".equals(cmMallOrganize.getStatus()) ? "90" : "91");
+                    cmUser.setRegisterUserTypeID("4");//设置为会所
+                    cmUser.setUserIdentity(4);
+                    cmUser.setServiceProviderStatus("90");//设置默认协销状态
+                    cmUser.setServiceProviderID("1342");
+                    cmUser.setAuditTime(currentDate);
+                    cmUser.setAuditStatus("1");//审核通过
+                    cmUser.setAuditNote("后台添加用户系统默认审核通过");
+                    cmUser.setRegisterTime(currentDate);
+                    cmUser.setLoginTime(currentDate);
+                    cmUser.setAccount(cmMallOrganize.getMobile() + RandomCodeGenerator.generateAccount(2));
+                    cmUser.setPassword("weisha");
+                    cmUser.setBindMobile(cmMallOrganize.getMobile());
+                    cmUser.setUserMoney(0d);
+                    cmUser.setAbleUserMoney(0d);
+                    cmUser.setValidFlag("1");
+                    cmUser.setAgreeFlag("1");
+                    cmUser.setUserPermission(5);
+                    cmUserService.insert(cmUser);//插入新的用户数据
+                }
+                //添加会所表信息
+                if (null == newCmClub.getClubID()) {
+                    newCmClub.setStatus("1".equals(cmMallOrganize.getStatus()) ? 90 : 91);
+                    newCmClub.setUserID(cmUser.getUserID());
+                    newCmClub.setDefaultServiceProviderID(AppKeys.DEFAULT_SPID);
+                    newCmClub.setSpID(AppKeys.DEFAULT_SPID);
+                    newCmClub.setMainServiceProviderID(AppKeys.DEFAULT_SPID);
+                    newCmClub.setAddTime(currentDate);
+                    newCmClub.setDefaultServiceProviderUpdTime(currentDate);
+                    newCmClubService.insert(newCmClub);
+
+                    //更新用户绑定关系
+                    cmUser.setClubID(String.valueOf(newCmClub.getClubID()));
+                    String nick = cmUser.getUserID() + "_" + RandomCodeGenerator.generateCodeString(4).toLowerCase();
+
+                    //更新会所绑定关系
+                    newCmClub.setUserID(cmUser.getUserID());
+                }
+                cmUserService.update(cmUser);//更新用户表数据(编辑数据,或新增数据更新)
+
+                newCmClubService.update(newCmClub);//更新会所表数据(编辑数据,或新增数据更新)
             }
             }
-            //添加会所表信息
-            if (null == newCmClub.getClubID()) {
-                newCmClub.setStatus("1".equals(cmMallOrganize.getStatus()) ? 90 : 91);
-                newCmClub.setUserID(cmUser.getUserID());
-                newCmClub.setDefaultServiceProviderID(AppKeys.DEFAULT_SPID);
-                newCmClub.setSpID(AppKeys.DEFAULT_SPID);
-                newCmClub.setMainServiceProviderID(AppKeys.DEFAULT_SPID);
-                newCmClub.setAddTime(currentDate);
-                newCmClub.setDefaultServiceProviderUpdTime(currentDate);
-                newCmClubService.insert(newCmClub);
-
-                //更新用户绑定关系
-                cmUser.setClubID(String.valueOf(newCmClub.getClubID()));
-                String nick = cmUser.getUserID() + "_" + RandomCodeGenerator.generateCodeString(4).toLowerCase();
-
-                //更新会所绑定关系
-                newCmClub.setUserID(cmUser.getUserID());
-            }
-            cmUserService.update(cmUser);//更新用户表数据(编辑数据,或新增数据更新)
-
-            newCmClubService.update(newCmClub);//更新会所表数据(编辑数据,或新增数据更新)
         }
         }
 
 
         addMessage(redirectAttributes, "保存组织成功");
         addMessage(redirectAttributes, "保存组织成功");

+ 53 - 15
src/main/java/com/caimei/modules/weisha/web/CmMallUserController.java

@@ -1,21 +1,28 @@
 package com.caimei.modules.weisha.web;
 package com.caimei.modules.weisha.web;
 
 
+import com.caimei.modules.user.aop.OperationLogAnnotation;
+import com.caimei.modules.user.entity.CmUser;
 import com.caimei.modules.weisha.dao.CmMallUserDao;
 import com.caimei.modules.weisha.dao.CmMallUserDao;
 import com.caimei.modules.weisha.entity.CmMallOrganize;
 import com.caimei.modules.weisha.entity.CmMallOrganize;
 import com.caimei.modules.weisha.entity.CmMallUser;
 import com.caimei.modules.weisha.entity.CmMallUser;
 import com.caimei.modules.weisha.service.CmMallUserService;
 import com.caimei.modules.weisha.service.CmMallUserService;
+import com.caimei.utils.MD5Util;
+import com.google.common.collect.Maps;
 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.utils.StringUtils;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import com.thinkgem.jeesite.common.web.BaseController;
+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.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
 
 
 /**
 /**
  * Description
  * Description
@@ -120,39 +127,70 @@ public class CmMallUserController  extends BaseController {
         }
         }
         // 添加操作 获取用户名是否已存在
         // 添加操作 获取用户名是否已存在
         if (null == cmMallUser.getId()) {
         if (null == cmMallUser.getId()) {
-            Integer repeat = cmMallUserDao.getRepeat(cmMallUser.getAccount());
+            Integer repeat = cmMallUserDao.getRepeat(cmMallUser.getAccount(), null);
             if (null != repeat) {
             if (null != repeat) {
                 model.addAttribute("用户名已存在,请勿重复添加");
                 model.addAttribute("用户名已存在,请勿重复添加");
-                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/mallUserForm";
+                addMessage(redirectAttributes, "用户名已存在,请勿重复添加");
+//                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/mallUserForm";
+                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/getMallUser?organizeId=" + cmMallUser.getOrganizeId();
+
             }
             }
         }
         }
         // 保存用户信息
         // 保存用户信息
         cmMallUserService.save(cmMallUser);
         cmMallUserService.save(cmMallUser);
         model.addAttribute("组织后台用户保存成功");
         model.addAttribute("组织后台用户保存成功");
-        return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId="+cmMallUser.getOrganizeId();
+        addMessage(redirectAttributes, "组织后台用户保存成功");
+        return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/getMallUser?organizeId=" + cmMallUser.getOrganizeId();
     }
     }
 
 
+    /**
+     * 添加操作 获取用户名是否已存在
+     *
+     * @param cmMallUser
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping(value = "/account")
+    public Integer account(CmMallUser cmMallUser, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        // 添加操作 获取用户名是否已存在
+        Integer repeat = cmMallUserDao.getRepeat(cmMallUser.getAccount(), cmMallUser.getId());
+        if (null != repeat) {
+            return 0;
+        }
+        return 1;
+    }
+
+
     /**
     /**
      * 重置密码
      * 重置密码
+     *
      * @param password
      * @param password
      * @param id
      * @param id
      * @param organizeId
      * @param organizeId
-     * @param model
+     * @param
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
+    @RequiresPermissions("user:newCmClub:edit")
+    @ResponseBody
+    @OperationLogAnnotation(operType = "修改密码", operModul = "修改密码")
     @RequestMapping(value = "/repeatPassword")
     @RequestMapping(value = "/repeatPassword")
-    public String repeatPassword(String password, String id, Integer organizeId, Model model) throws Exception {
-        if (null == id) {
-            model.addAttribute("参数Id不能为空");
-            return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId=" + organizeId;
-        }
-        if (null == password) {
-            model.addAttribute("参数password不能为空");
-            return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId=" + organizeId;
+    public Map<String, Object> repeatPassword(String password, String id, Integer organizeId,HttpServletRequest request, HttpServletResponse response) throws Exception {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            cmMallUserService.repeatPassword(password, id);
+//        model.addAttribute("密码重置完成");
+            map.put("success", true);
+            map.put("msg", "密码重置完成");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
         }
         }
-        cmMallUserService.repeatPassword(password, id);
-        model.addAttribute("密码重置完成");
-        return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId=" + organizeId;
+        return map;
     }
     }
 }
 }
+//11111111q

+ 6 - 1
src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java

@@ -87,12 +87,17 @@ public class CmOrganizeProductController extends BaseController {
 			return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 			return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 		}
 		}
 		cmOrganizeProductService.updateproduct(status, id);
 		cmOrganizeProductService.updateproduct(status, id);
-		addMessage(redirectAttributes, "组织商品上架/下架成功");
+		if (status == 1) {
+			addMessage(redirectAttributes, "组织商品上架成功");
+		}else {
+			addMessage(redirectAttributes, "组织商品下架成功");
+		}
 		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 	}
 	}
 
 
 	@RequestMapping(value = "/form")
 	@RequestMapping(value = "/form")
 	public String form(CmOrganizeProduct cmOrganizeProduct, Model model) {
 	public String form(CmOrganizeProduct cmOrganizeProduct, Model model) {
+		model.addAttribute("cmOrganizeProductFront", cmOrganizeProduct);
 		if (null != cmOrganizeProduct.getId()) {
 		if (null != cmOrganizeProduct.getId()) {
 			cmOrganizeProduct = cmOrganizeProductService.findLadderPrice(cmOrganizeProduct.getId());
 			cmOrganizeProduct = cmOrganizeProductService.findLadderPrice(cmOrganizeProduct.getId());
 //			cmOrganizeProduct.setLadderPriceList(ladderPriceList);
 //			cmOrganizeProduct.setLadderPriceList(ladderPriceList);

+ 17 - 1
src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java

@@ -136,7 +136,17 @@ public class CmOrganizeStoreController extends BaseController {
 	public String cleanWx(CmOrganizeStore cmOrganizeStore) {
 	public String cleanWx(CmOrganizeStore cmOrganizeStore) {
 		// 解绑微信 设置删除
 		// 解绑微信 设置删除
 		cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
 		cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
-		return "redirect" + Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
+//		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
+		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
+
+	}
+	@RequestMapping(value = "status")
+	public String status(CmOrganizeStore cmOrganizeStore) {
+		// 机构 上线、下线
+		cmOrganizeStoreDao.clubStatus(cmOrganizeStore.getUserId(),cmOrganizeStore.getStatus());
+		cmOrganizeStoreDao.userStatus(cmOrganizeStore.getUserId(),cmOrganizeStore.getStatus());
+		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
+
 	}
 	}
 
 
 	@RequestMapping(value = "save")
 	@RequestMapping(value = "save")
@@ -168,5 +178,11 @@ public class CmOrganizeStoreController extends BaseController {
 		addMessage(redirectAttributes, "删除门店成功");
 		addMessage(redirectAttributes, "删除门店成功");
 		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
 		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
 	}
 	}
+	@RequestMapping(value = "update")
+	public String update(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
+		cmOrganizeStoreService.delete(cmOrganizeStore);
+		addMessage(redirectAttributes, "删除门店成功");
+		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
+	}
 
 
 }
 }

+ 1 - 1
src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml

@@ -38,7 +38,7 @@
 		<where>
 		<where>
 			id > 0
 			id > 0
 			<if test="organizeName != null and organizeName != ''">
 			<if test="organizeName != null and organizeName != ''">
-				AND a.organizeName = #{organizeName}
+				AND a.organizeName LIKE concat('%',#{organizeName},'%')
 			</if>
 			</if>
 			<if test="organizeLinkName != null and organizeLinkName != ''">
 			<if test="organizeLinkName != null and organizeLinkName != ''">
 				AND a.organizeLinkName = #{organizeLinkName}
 				AND a.organizeLinkName = #{organizeLinkName}

+ 9 - 2
src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml

@@ -50,7 +50,11 @@
         where id = #{id}
         where id = #{id}
     </select>
     </select>
     <select id="getRepeat" resultType="java.lang.Integer">
     <select id="getRepeat" resultType="java.lang.Integer">
-        select id from cm_mall_admin_user where account like concat('%',#{account},'%') limit 1
+        select id from cm_mall_admin_user where account =#{account}
+        <if test="id != null and id != ''">
+         and  id != #{id}
+        </if>
+                                                limit 1
     </select>
     </select>
     <insert id="insertMallUser">
     <insert id="insertMallUser">
         INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, ADDTIME, updateTime, delFlag)
         INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, ADDTIME, updateTime, delFlag)
@@ -72,7 +76,10 @@
                 organizeID = #{organizeId},
                 organizeID = #{organizeId},
             </if>
             </if>
             <if test="updateTime != null and updateTime != ''">
             <if test="updateTime != null and updateTime != ''">
-                updateTime = #{updateTime}
+                updateTime = #{updateTime},
+            </if>
+            <if test="salt != null and salt != ''">
+                salt = #{salt}
             </if>
             </if>
         </set>
         </set>
         where id = #{id}
         where id = #{id}

+ 4 - 1
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -171,7 +171,7 @@
 			 left join shop s on p.shopID = s.shopID
 			 left join shop s on p.shopID = s.shopID
 		 	 left join cm_sku k on p.productID = k.productId
 		 	 left join cm_sku k on p.productID = k.productId
 		<where>
 		<where>
-		 	p.productCategory = 1  and cmop.productId is null
+			p.productCategory = 1  AND p.validFlag not in ( 0,1,8 )  and s.shopType != 2  and  cmop.productId is null
 			AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
 			AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
 			AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
 			AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
 			<if test="productID != null">
 			<if test="productID != null">
@@ -385,6 +385,9 @@
 	<delete id="delete">
 	<delete id="delete">
 		UPDATE cm_organize_product set delFlag = 1 where id = #{id}
 		UPDATE cm_organize_product set delFlag = 1 where id = #{id}
 	</delete>
 	</delete>
+	<delete id="deleteMallProductSku">
+		delete from  cm_mall_product_sku where mallProductId = #{id}
+	</delete>
 	<delete id="deleteLadderPriceById">
 	<delete id="deleteLadderPriceById">
 		delete from organize_product_ladder_price where id = #{ladderId}
 		delete from organize_product_ladder_price where id = #{ladderId}
 	</delete>
 	</delete>

+ 19 - 3
src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml

@@ -45,7 +45,9 @@
 		SELECT
 		SELECT
 			<include refid="cmOrganizeStoreColumns"/>
 			<include refid="cmOrganizeStoreColumns"/>
 		FROM cm_organize_store a
 		FROM cm_organize_store a
-		<include refid="cmOrganizeStoreJoins"/>
+		LEFT JOIN province p ON a.provinceId = p.provinceID
+		LEFT JOIN city ct ON a.cityId = ct.cityID
+		LEFT JOIN town t ON a.townId = t.townID
 		WHERE a.id = #{id}
 		WHERE a.id = #{id}
 	</select>
 	</select>
 
 
@@ -152,8 +154,21 @@
 		set delFlag = 1
 		set delFlag = 1
 		where userId = #{userId}
 		where userId = #{userId}
 	</update>
 	</update>
+	<update id="clubStatus">
+		update club
+		set status = #{status}
+		where userId = #{id};
+
+	</update>
+	<update id="userStatus">
+		update USER
+		set clubStatus = #{status}
+		where userId = #{id};
+
+	</update>
 	<select id="getclubInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
 	<select id="getclubInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
 		select
 		select
+		u.userOrganizeID AS organizeId,
 		c.clubId,
 		c.clubId,
 		c.name,
 		c.name,
 		c.linkMan,
 		c.linkMan,
@@ -166,12 +181,13 @@
 		<include refid="addressName"/>
 		<include refid="addressName"/>
 		from club c
 		from club c
 		<include refid="cmOrganizeStoreJoins"/>
 		<include refid="cmOrganizeStoreJoins"/>
-		where clubID = #{clubId}
+		LEFT JOIN USER u ON c.userId = u.userId
+		where c.clubID = #{clubId}
 	</select>
 	</select>
 	<select id="findAllList" resultType="CmOrganizeStore">
 	<select id="findAllList" resultType="CmOrganizeStore">
 		SELECT
 		SELECT
 			<include refid="cmOrganizeStoreColumns"/>
 			<include refid="cmOrganizeStoreColumns"/>
-		FROM cm_organize_store a
+		FROM cm_organize_store c
 		<include refid="cmOrganizeStoreJoins"/>
 		<include refid="cmOrganizeStoreJoins"/>
 		<where>
 		<where>
 
 

+ 2 - 1
src/main/webapp/WEB-INF/views/modules/weisha/CmMallUserList.jsp

@@ -95,6 +95,7 @@
                 "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
                 "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
             var submit = function (v, h, f) {
             var submit = function (v, h, f) {
                 // 密码
                 // 密码
+                debugger
                 if (!regPwd.test(f.newPwd)) {
                 if (!regPwd.test(f.newPwd)) {
                     $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
                     $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
                     return false;
                     return false;
@@ -106,7 +107,7 @@
                 $.post("${ctx}/weisha/cmMallUser/repeatPassword", {'password': f.newPwd, 'id': id, 'organizeId': organizeId}, function (data) {
                 $.post("${ctx}/weisha/cmMallUser/repeatPassword", {'password': f.newPwd, 'id': id, 'organizeId': organizeId}, function (data) {
                     if (true == data.success) {
                     if (true == data.success) {
                         $.jBox.tip(data.msg, 'info');
                         $.jBox.tip(data.msg, 'info');
-                        $("#searchForm").submit();
+                        // $("#searchForm").submit();
                     } else {
                     } else {
                         $.jBox.tip(data.msg, 'error');
                         $.jBox.tip(data.msg, 'error');
                     }
                     }

+ 90 - 29
src/main/webapp/WEB-INF/views/modules/weisha/cmMallUserForm.jsp

@@ -5,20 +5,25 @@
     <title>组织用户信息</title>
     <title>组织用户信息</title>
     <meta name="decorator" content="default"/>
     <meta name="decorator" content="default"/>
     <style>
     <style>
-        .control-group{
+        .control-group {
             width: 100%;
             width: 100%;
             height: 60px;
             height: 60px;
             border-bottom: none;
             border-bottom: none;
             box-sizing: border-box;
             box-sizing: border-box;
             padding: 10px 0;
             padding: 10px 0;
         }
         }
-        .control-label{
+
+        .control-label {
             width: 100px;
             width: 100px;
             text-align: right;
             text-align: right;
             float: left;
             float: left;
             line-height: 40px;
             line-height: 40px;
             margin-right: 5px;
             margin-right: 5px;
         }
         }
+
+        .red {
+            color: red;
+        }
     </style>
     </style>
 </head>
 </head>
 <body>
 <body>
@@ -27,50 +32,106 @@
     <li><a href="${ctx}/weisha/cmMallUser/getMallUser?organizeId=${cmMallOrganize.id}">后台用户</a></li>
     <li><a href="${ctx}/weisha/cmMallUser/getMallUser?organizeId=${cmMallOrganize.id}">后台用户</a></li>
     <li class="active"><a href="${ctx}/weisha/cmMallUser/mallUserForm?id=${mallUserInfo.id}&organizeId=${mallUserInfo.organizeId}">${mallUserInfo.id eq null ? "添加" : "编辑"}</a></li>
     <li class="active"><a href="${ctx}/weisha/cmMallUser/mallUserForm?id=${mallUserInfo.id}&organizeId=${mallUserInfo.organizeId}">${mallUserInfo.id eq null ? "添加" : "编辑"}</a></li>
 </ul>
 </ul>
-<form:form id="searchForm" modelAttribute="mallUserInfo" action="${ctx}/weisha/cmMallUser/save" method="post" class="breadcrumb form-search">
-    <form:hidden path="organizeId" value="${mallUserInfo.organizeId}" />
+<form:form id="searchForm" modelAttribute="mallUserInfo" action="${ctx}/weisha/cmMallUser/save" method="post"
+           class="breadcrumb form-search">
+    <form:hidden path="id"  value="${mallUserInfo.id}"/>
+    <form:hidden path="organizeId" value="${mallUserInfo.organizeId}"/>
     <div class="ul-form">
     <div class="ul-form">
         <div class="control-group">
         <div class="control-group">
-            <label class="control-label">姓名:</label>
+            <label class="control-label"><span class="red">*</span>姓名:</label>
             <div class="controls">
             <div class="controls">
-                <form:input path="account" class="input-xlarge required" maxlength="11" />
+                <form:input path="account" htmlEscape="false" class="input-xlarge required" maxlength="11"
+                            placeholder="最多10个字"/>
             </div>
             </div>
         </div>
         </div>
         <div class="control-group">
         <div class="control-group">
-            <label class="control-label">手机号:</label>
+            <label class="control-label"><span class="red">*</span>手机号:</label>
             <div class="controls">
             <div class="controls">
-                    <form:input path="accountName" class="input-xlarge required" maxlength="11" />
+                <form:input path="accountName" htmlEscape="false"  class="input-xlarge required" maxlength="11" placeholder="请输入手机号"/>
             </div>
             </div>
         </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">
                 <form:select path="status">
                 <form:select path="status">
-                    <form:option value="1" label="上线" />
-                    <form:option value="2" label="下线" />
+                    <form:option value="1" label="上线"/>
+                    <form:option value="2" label="下线"/>
                 </form:select>
                 </form:select>
             </div>
             </div>
         </div>
         </div>
         <div class="control-group">
         <div class="control-group">
-            <label class="control-label">密码:</label>
+            <label class="control-label"><span class="red">*</span>密码:</label>
             <div class="controls">
             <div class="controls">
-                <form:input path="password" type="password" id="password" class="input-xlarge required" maxlength="16" />
+                <form:input path="password" htmlEscape="false"  type="password" id="password" class="input-xlarge required" maxlength="16"
+                            placeholder="请输入8-16字母和数字的组合"/>
             </div>
             </div>
         </div>
         </div>
         <div class="control-group">
         <div class="control-group">
-            <label class="control-label">确认密码:</label>
+            <label class="control-label"><span class="red">*</span>确认密码:</label>
             <div class="controls">
             <div class="controls">
-                <form:input path="confirmPassword" type="password" id="confirmPassword" class="input-xlarge required" maxlength="16" />
+                <form:input path="confirmPassword" type="password" id="confirmPassword" class="input-xlarge required"
+                            maxlength="16" placeholder="请再次输入密码"/>
             </div>
             </div>
         </div>
         </div>
         <div class="control-group">
         <div class="control-group">
-        &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="保 存" onclick="userSubmit()"/>
-        &nbsp;&nbsp;<input class="btn btn-primary" type="button"  value="返回" onclick="history.go(-1)"/>
+            &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
+            &nbsp;&nbsp;<input class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/>
         </div>
         </div>
         <div class="clearfix"></div>
         <div class="clearfix"></div>
     </div>
     </div>
 </form:form>
 </form:form>
-<script  type="text/javascript">
+<script type="text/javascript">
+    $(document).ready(function () {
+
+        //$("#name").focus();
+        $("#searchForm").validate({
+            submitHandler: function (form) {
+                var account = 0
+                var password = $("#password").val();
+                var confirmPassword = $("#confirmPassword").val();
+                var accountName = $("#accountName").val();
+                debugger
+                $.ajax({
+                    type: 'get',
+                    dataType: 'json',
+                    data:$("#searchForm").serialize(),
+                    url: '${ctx}/weisha/cmMallUser/account',
+                    async: false,
+                    success: function (data) {
+                        account = data
+                    }
+                });
+                if (account == 0) {
+                    top.$.jBox.confirm("用户名已存在,请勿重复添加", '提示');
+                    return false;
+                }
+                // if (password.length >= 8 && password.length <= 16 ) {
+                if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/.test(password))) {
+                    top.$.jBox.confirm("请输入正确格式的密码", '提示');
+                    return false;
+                    // }
+                } else if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
+                    top.$.jBox.confirm("请输入正确的手机号", '提示');
+                    return false;
+                } else if (password !== confirmPassword) {
+                    top.$.jBox.confirm("两次密码不一致", '提示');
+                    return false;
+                }
+                loading('正在提交,请稍等...');
+                form.submit();
+            },
+            errorContainer: "#messageBox",
+            errorPlacement: function (error, element) {
+                $("#messageBox").text("输入有误,请先更正。");
+                if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                    error.appendTo(element.parent().parent());
+                } else {
+                    error.insertAfter(element);
+                }
+            }
+        });
+    });
+
     function userSubmit() {
     function userSubmit() {
         var form = $("#searchForm");
         var form = $("#searchForm");
         var account = $("#account").val();
         var account = $("#account").val();
@@ -79,28 +140,28 @@
         var accountName = $("#accountName").val();
         var accountName = $("#accountName").val();
         debugger
         debugger
         if (null == account || "" == account) {
         if (null == account || "" == account) {
-            top.$.jBox.confirm("请输入姓名",'提示');
-            return;
+            top.$.jBox.confirm("请输入姓名", '提示');
+            return false;
         }
         }
-        if (password.length >= 8 && password.length <= 16 ) {
+        if (password.length >= 8 && password.length <= 16) {
             if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/.test(password))) {
             if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/.test(password))) {
-                top.$.jBox.confirm("请输入正确格式的密码",'提示');
-                return;
+                top.$.jBox.confirm("请输入正确格式的密码", '提示');
+                return false;
             }
             }
         } else {
         } else {
-            top.$.jBox.confirm("请输入正确格式的密码",'提示');
-            return;
+            top.$.jBox.confirm("请输入正确格式的密码", '提示');
+            return false;
         }
         }
         if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
         if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
-            top.$.jBox.confirm("请输入正确的手机号",'提示');
-            return;
+            top.$.jBox.confirm("请输入正确的手机号", '提示');
+            return false;
         }
         }
         // debugger
         // debugger
         if (password !== confirmPassword) {
         if (password !== confirmPassword) {
-            top.$.jBox.confirm("两次密码不一致",'提示');
-            return;
+            top.$.jBox.confirm("两次密码不一致", '提示');
+            return false;
         }
         }
-        form.submit();
+        // form.submit();
     }
     }
 </script>
 </script>
 </body>
 </body>

+ 41 - 36
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductForm.jsp

@@ -1,6 +1,7 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 <html>
 <html>
 <head>
 <head>
 	<title>组织商品管理</title>
 	<title>组织商品管理</title>
@@ -121,30 +122,30 @@
 		</div>
 		</div>
 	</div>
 	</div>
 	<div class="control-group" id="shopTaxPointDiv">
 	<div class="control-group" id="shopTaxPointDiv">
-		<table class="table table-striped table-bordered table-condensed">
+		<table align="center" class="table table-striped table-bordered table-condensed">
 			<thead>
 			<thead>
 			<tr>
 			<tr>
-				<th>商品规格</th>
-				<th>起订量</th>
-				<th>机构价</th>
-				<th>成本类型</th>
-				<th>成本价 / 比例成本</th>
-				<th>小程序价格</th>
-				<th>采美佣金</th>
-				<th>付组织</th>
-				<th>付供应商</th>
+				<th style="text-align: center">商品规格</th>
+				<th style="text-align: center">起订量</th>
+				<th style="text-align: center">机构价</th>
+				<th style="text-align: center">成本类型</th>
+				<th style="text-align: center">成本价 / 比例成本</th>
+				<th style="text-align: center">小程序价格</th>
+				<th style="text-align: center">采美佣金</th>
+				<th style="text-align: center">付组织</th>
+				<th style="text-align: center">付供应商</th>
 			</tr>
 			</tr>
 			</thead>
 			</thead>
 			<tbody>
 			<tbody>
 			<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
 			<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
 				<tr class="tr_skus" data-skuId="${sku.id}">
 				<tr class="tr_skus" data-skuId="${sku.id}">
-					<td>${sku.unit eq null?"未知":sku.unit}</td>
-					<td>
-						<input class="sku_minNum" value="${sku.minBuyNumber}" style="width: 100px"/>
+					<td style="text-align: center">${sku.unit eq null?"未知":sku.unit}</td>
+					<td style="text-align: center">
+						<input type="number" class="sku_minNum" value="${sku.minBuyNumber}" style="width: 100px"/>
 					</td>
 					</td>
-					<td>${sku.clubPrice eq null?"":sku.clubPrice}</td>
-					<td>${sku.costCheckFlag == 1?"固定成本":sku.costCheckFlag == 2?"比例成本":""}</td>
-					<td>
+					<td style="text-align: center">${sku.clubPrice eq null?"":sku.clubPrice}</td>
+					<td style="text-align: center">${sku.costCheckFlag == 1?"固定成本":sku.costCheckFlag == 2?"比例成本":""}</td>
+					<td style="text-align: center">
 						<c:if test="${sku.costCheckFlag == 1}">
 						<c:if test="${sku.costCheckFlag == 1}">
 							¥&nbsp;&nbsp;${sku.costPrice}
 							¥&nbsp;&nbsp;${sku.costPrice}
 						</c:if>
 						</c:if>
@@ -152,17 +153,17 @@
 							${sku.costProportional}%
 							${sku.costProportional}%
 						</c:if>
 						</c:if>
 					</td>
 					</td>
-					<td>
-						<input class="sku_price" value="${sku.price}" style="width: 100px"/>
+					<td style="text-align: center">
+						<input type="number"  class="sku_price" value="${sku.price}" style="width: 100px"/>
 					</td>
 					</td>
-					<td>
-						<input class="sku_cmPecrcent" value="${sku.cmPercent}" style="width: 100px"/>%
+					<td style="text-align: center">
+						<input  type="number" class="sku_cmPecrcent" value="${sku.cmPercent}" style="width: 100px"/>%
 					</td>
 					</td>
-					<td>
-						<input class="sku_organizePercent" value="${sku.organizePercent}" style="width: 100px"/>%
+					<td style="text-align: center">
+						<input  type="number" class="sku_organizePercent" value="${sku.organizePercent}" style="width: 100px"/>%
 					</td>
 					</td>
-					<td>
-						<input class="sku_shopPercent" value="${sku.shopPercent}" style="width: 100px"/>%
+					<td style="text-align: center">
+						<input type="number"  class="sku_shopPercent" value="${sku.shopPercent}" style="width: 100px "/>%
 					</td>
 					</td>
 				</tr>
 				</tr>
 			</c:forEach>
 			</c:forEach>
@@ -539,14 +540,13 @@
 					type: 'POST',
 					type: 'POST',
 					async: false,
 					async: false,
 					success: function (data) {
 					success: function (data) {
-						loading('保存组织商品成功'+data);
+						loading('保存组织商品成功');
 						setTimeout(function () {
 						setTimeout(function () {
-							window.location.href = "${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}"
+							window.location.href = "${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}&productName=${cmOrganizeProductFront.productName}&shopName=${cmOrganizeProductFront.shopName}&includedTax=${cmOrganizeProductFront.includedTax}&status=${cmOrganizeProduct.status}";
 						}, 1000);
 						}, 1000);
 					},
 					},
 					error: function (json) {
 					error: function (json) {
-						console.log(json)
-						alertx('输入有误,请先更正。'+json, function () {
+						alertx('输入有误,请先更正。', function () {
 							window.location.href = "${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
 							window.location.href = "${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
 						});
 						});
 					}
 					}
@@ -556,7 +556,7 @@
 
 
 		function gettTrskus() {
 		function gettTrskus() {
 			var con = true
 			var con = true
-			 $('.tr_skus').each(function (dom, index) {
+			$('.tr_skus').each(function (dom, index) {
 				var that = $(this)
 				var that = $(this)
 				var sku_Id = that.attr('data-skuId')
 				var sku_Id = that.attr('data-skuId')
 				var sku_minNum = that.find('.sku_minNum').val()
 				var sku_minNum = that.find('.sku_minNum').val()
@@ -564,24 +564,29 @@
 				var sku_cmPecrcent = that.find('.sku_cmPecrcent').val()
 				var sku_cmPecrcent = that.find('.sku_cmPecrcent').val()
 				var sku_organizePercent = that.find('.sku_organizePercent').val()
 				var sku_organizePercent = that.find('.sku_organizePercent').val()
 				var sku_shopPercent = that.find('.sku_shopPercent').val()
 				var sku_shopPercent = that.find('.sku_shopPercent').val()
-				if (null == sku_minNum) {
+				if (null == sku_minNum || "" == sku_minNum) {
 					top.$.jBox.confirm("请输入起订量", '提示');
 					top.$.jBox.confirm("请输入起订量", '提示');
-					con=  false;
+					con = false;
 					return
 					return
 				}
 				}
-				if (null == sku_price) {
+				if (null == sku_price || "" == sku_price) {
 					top.$.jBox.confirm("请输入小程序价格", '提示');
 					top.$.jBox.confirm("请输入小程序价格", '提示');
-					con=  false;
+					con = false;
 					return
 					return
 				}
 				}
-				if (null == sku_cmPecrcent || null == sku_organizePercent || null == sku_shopPercent) {
+				if ("" == sku_cmPecrcent || "" == sku_organizePercent || "" == sku_shopPercent) {
 					top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例", '提示');
 					top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例", '提示');
-					con=  false;
+					con = false;
+					return
+				}
+				if (1 > sku_cmPecrcent || 1 > sku_organizePercent || 1 > sku_shopPercent || 1 > sku_price || 1 > sku_minNum) {
+					top.$.jBox.confirm("请输入大于0的整数输入,输入其他字符无效", '提示');
+					con = false;
 					return
 					return
 				}
 				}
 				if (100.00 != (sku_cmPecrcent * 1 + sku_organizePercent * 1 + sku_shopPercent * 1)) {
 				if (100.00 != (sku_cmPecrcent * 1 + sku_organizePercent * 1 + sku_shopPercent * 1)) {
 					top.$.jBox.confirm("每个商品三个比例之和需要等于100%", '提示');
 					top.$.jBox.confirm("每个商品三个比例之和需要等于100%", '提示');
-					con= false;
+					con = false;
 					return
 					return
 				}
 				}
 				skus.push({
 				skus.push({

+ 43 - 27
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductList.jsp

@@ -21,7 +21,14 @@
 			$("#searchForm").submit();
 			$("#searchForm").submit();
         	return false;
         	return false;
         }
         }
-
+		function updateEnabled(id) {
+			debugger
+			var productName = $('#productName').val()
+			var shopName = $('#shopName').val()
+			var includedTax = $('#includedTax').val()
+			var status = $('#status').val()
+			window.location.href = "${ctx}/weisha/cmOrganizeProduct/form/?organizeId=${organizeId}&id="+id+"&productName="+productName+"&shopName="+shopName+"&includedTax="+includedTax+"&status="+status+"";
+		}
 
 
 		//选择添加商品
 		//选择添加商品
 		function showSelect() {
 		function showSelect() {
@@ -135,30 +142,31 @@
 		<li class="active"><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}">商品列表</a></li>
 		<li class="active"><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}">商品列表</a></li>
 		<shiro:hasPermission name="weisha:cmOrganizeProduct:edit"><li><a href="${ctx}/weisha/cmOrganizeProduct/form">组织商品添加</a></li></shiro:hasPermission>
 		<shiro:hasPermission name="weisha:cmOrganizeProduct:edit"><li><a href="${ctx}/weisha/cmOrganizeProduct/form">组织商品添加</a></li></shiro:hasPermission>
 	</ul>
 	</ul>
-	<form:form id="searchForm" modelAttribute="cmOrganizeProduct" action="${ctx}/weisha/cmOrganizeProduct/" method="post" class="breadcrumb form-search">
+	<form:form id="searchForm" modelAttribute="cmOrganizeProduct" action="${ctx}/weisha/cmOrganizeProduct/"
+			   method="post" class="breadcrumb form-search">
 		<form:hidden path="organizeId"/>
 		<form:hidden path="organizeId"/>
 		<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}"/>
 		<div class="ul-form">
 		<div class="ul-form">
-<%--			 <label>商品ID:</label>--%>
-<%--				<form:input path="id" htmlEscape="false" class="input-medium" onkeyup="onlynum(this)"/>--%>
+				<%--			 <label>商品ID:</label>--%>
+				<%--				<form:input path="id" htmlEscape="false" class="input-medium" onkeyup="onlynum(this)"/>--%>
 			<label>商品名称:</label>
 			<label>商品名称:</label>
-				<form:input path="productName" htmlEscape="false" class="input-large"/>
+			<form:input id="productName" path="productName" htmlEscape="false" class="input-large"/>
 			<label>供应商名称:</label>
 			<label>供应商名称:</label>
-				<form:input path="shopName" htmlEscape="false" class="input-large"/>
+			<form:input id="shopName" path="shopName" htmlEscape="false" class="input-large"/>
 			<label>商品状态:</label>
 			<label>商品状态:</label>
-				<form:select path="status" class="input-small">
-					<form:option value="" label="请选择"/>
-					<form:option value="1" label="已上架"/>
-					<form:option value="2" label="已下架"/>
-				</form:select>
+			<form:select id="status" path="status" class="input-small">
+				<form:option value="" label="请选择"/>
+				<form:option value="1" label="已上架"/>
+				<form:option value="2" label="已下架"/>
+			</form:select>
 			<label>是否含税:</label>
 			<label>是否含税:</label>
-				<form:select path="includedTax" onchange="changeIncludedTax(true)" class="input-small">
-					<form:option value="" label="请选择"/>
-					<form:option value="1" label="含税"/>
-					<form:option value="0" label="不含税"/>
-					<form:option value="2" label="未知"/>
-				</form:select>
+			<form:select id="includedTax" path="includedTax" onchange="changeIncludedTax(true)" class="input-small">
+				<form:option value="" label="请选择"/>
+				<form:option value="1" label="含税"/>
+				<form:option value="0" label="不含税"/>
+				<form:option value="2" label="未知"/>
+			</form:select>
 			<div id="invoiceTypeDiv" style="display: inline" class="hide">
 			<div id="invoiceTypeDiv" style="display: inline" class="hide">
 				<label>发票:</label>
 				<label>发票:</label>
 				<form:select path="invoiceType" class="input-medium">
 				<form:select path="invoiceType" class="input-medium">
@@ -184,7 +192,7 @@
 			<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>
@@ -195,27 +203,27 @@
 		<c:forEach items="${page.list}" var="cmOrganizeProduct" varStatus="idxStatus">
 		<c:forEach items="${page.list}" var="cmOrganizeProduct" varStatus="idxStatus">
 			<tr>
 			<tr>
 				<td>
 				<td>
-					${page.pageNo*idxStatus.index+1}
+						${((page.pageNo-1)*page.pageSize)+idxStatus.index+1}
 				</td>
 				</td>
 				<td>
 				<td>
 					<img src="${cmOrganizeProduct.productImage}" width="50px" height="50px">
 					<img src="${cmOrganizeProduct.productImage}" width="50px" height="50px">
 				</td>
 				</td>
 				<td>
 				<td>
-					${cmOrganizeProduct.productName}
+						${cmOrganizeProduct.productName}
 				</td>
 				</td>
 				<td>
 				<td>
 						${cmOrganizeProduct.shopName}
 						${cmOrganizeProduct.shopName}
 				</td>
 				</td>
 				<td>
 				<td>
 					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
 					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
-						${sku.unit eq null?"未知":sku.unit}&nbsp;&nbsp;-&nbsp;&nbsp;¥${sku.clubPrice eq null?"未知":sku.clubPrice}
+						${sku.unit eq null?"未知":sku.unit}&nbsp;&nbsp;-&nbsp;&nbsp;¥${sku.price eq null?"未知":sku.price}
 						<br>
 						<br>
 					</c:forEach>
 					</c:forEach>
 						<%--${cmOrganizeProduct.price}--%>
 						<%--${cmOrganizeProduct.price}--%>
 				</td>
 				</td>
-				<td>
-						${cmOrganizeProduct.minBuyNumber}
-				</td>
+					<%--				<td>--%>
+					<%--						${cmOrganizeProduct.minBuyNumber}--%>
+					<%--				</td>--%>
 				<td>
 				<td>
 						${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
 						${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
 						${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
 						${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
@@ -227,9 +235,14 @@
 					<fmt:formatDate value="${cmOrganizeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 					<fmt:formatDate value="${cmOrganizeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				</td>
 				<td>
 				<td>
-    				<a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}">编辑</a>
-    				<a href="${ctx}/weisha/cmOrganizeProduct/updateValidFlag?id=${cmOrganizeProduct.id}&status=${cmOrganizeProduct.status eq 1?2:1}&organizeId=${organizeId}" onclick="return confirmx('确定${cmOrganizeProduct.status eq 1?'下架':'上架'}该商品吗?', this.href)">${cmOrganizeProduct.status eq 1?'下架':'上架'}</a>
-					<a href="${ctx}/weisha/cmOrganizeProduct/delete?id=${cmOrganizeProduct.id}&organizeId=${organizeId}" onclick="return confirmx('确认要删除该商品吗?删除后需要重新添加', this.href)">删除</a>
+					<a href="javascript:void(0);" onclick="updateEnabled(${cmOrganizeProduct.id});">
+						编辑
+					</a>
+<%--					<a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}&productName=${cmOrganizeProduct.productName}&shopName=${cmOrganizeProduct.shopName}&includedTax=${cmOrganizeProduct.includedTax}&status=${cmOrganizeProduct.status}">编辑</a>--%>
+					<a href="${ctx}/weisha/cmOrganizeProduct/updateValidFlag?id=${cmOrganizeProduct.id}&status=${cmOrganizeProduct.status eq 1?2:1}&organizeId=${organizeId}"
+					   onclick="return confirmx('确定${cmOrganizeProduct.status eq 1?'下架':'上架'}该商品吗?', this.href)">${cmOrganizeProduct.status eq 1?'下架':'上架'}</a>
+					<a href="${ctx}/weisha/cmOrganizeProduct/delete?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
+					   onclick="return confirmx('确认要删除该商品吗?删除后需要重新添加', this.href)">删除</a>
 				</td>
 				</td>
 			</tr> <%-- updateStatus('${cmOrganizeProduct.id}',${cmOrganizeProduct.status eq 1?2:1},${organizeId})>${cmOrganizeProduct.status eq 1?'下架':'上架'}--%>
 			</tr> <%-- updateStatus('${cmOrganizeProduct.id}',${cmOrganizeProduct.status eq 1?2:1},${organizeId})>${cmOrganizeProduct.status eq 1?'下架':'上架'}--%>
 		</c:forEach>
 		</c:forEach>
@@ -238,3 +251,6 @@
 	<div class="pagination">${page}</div>
 	<div class="pagination">${page}</div>
 </body>
 </body>
 </html>
 </html>
+<script>
+
+</script>

+ 2 - 4
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreForm.jsp

@@ -41,7 +41,7 @@
 <body>
 <body>
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
 	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
 	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
-	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
+	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">机构列表</a></li>
 	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}&id=${cmOrganizeStore.id}">${not empty cmOrganizeStore.id?'编辑':'上线'}门店</a></li>
 	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}&id=${cmOrganizeStore.id}">${not empty cmOrganizeStore.id?'编辑':'上线'}门店</a></li>
 </ul><br/>
 </ul><br/>
 <form:form id="inputForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/save" method="post" class="form-horizontal">
 <form:form id="inputForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/save" method="post" class="form-horizontal">
@@ -52,7 +52,7 @@
 	<input type="hidden" id="curTown" name="curTown" value="${cmOrganizeStore.townName}" disabled="disabled">
 	<input type="hidden" id="curTown" name="curTown" value="${cmOrganizeStore.townName}" disabled="disabled">
 	<sys:message content="${message}"/>
 	<sys:message content="${message}"/>
 	<div class="control-group">
 	<div class="control-group">
-		<label class="control-label">门店名称:</label>
+		<label class="control-label">机构名称:</label>
 		<div class="controls">
 		<div class="controls">
 			<form:input path="name" htmlEscape="false" maxlength="30" class="input-xlarge "/>
 			<form:input path="name" htmlEscape="false" maxlength="30" class="input-xlarge "/>
 		</div>
 		</div>
@@ -196,8 +196,6 @@
 						} else {
 						} else {
 							$("#town").append("<option value='" + data[i].id + "'>" + data[i].name +"</option>");
 							$("#town").append("<option value='" + data[i].id + "'>" + data[i].name +"</option>");
 						}
 						}
-
-
 					}
 					}
 				}
 				}
 
 

+ 49 - 35
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreFormGet.jsp

@@ -8,37 +8,45 @@
 <body>
 <body>
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
 	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
 	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
-	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
-	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a></li>
+	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${clubInfo.organizeId}">机构列表</a></li>
+	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${clubInfo.clubId}">查看资料</a></li>
 </ul>
 </ul>
 <br/>
 <br/>
-<%--<form:form id="inputForm" modelAttribute="clubInfo" action="${ctx}/weisha/cmOrganizeStore/save" method="post"--%>
-<%--		   class="form-horizontal">--%>
-<%--	<form:hidden path="clubId"/>--%>
-<div class="header-main-box">
+<form:form id="inputForm" modelAttribute="clubInfo"  method="post"
+		   class="form-horizontal">
+	<form:hidden path="clubId"/>
+<div >
+
 	<c:if test="${clubInfo.name ne null and clubInfo.name ne ''}">
 	<c:if test="${clubInfo.name ne null and clubInfo.name ne ''}">
-		<p>机构名称:
-			<span>
+
+		<div class="control-group">
+			<label class="control-label">机构名称:</label>
+			<div class="controls"><span>
 					${clubInfo.name}
 					${clubInfo.name}
-			</span>
-		</p>
+			</span></div>
+		</div>
 	</c:if>
 	</c:if>
 	<c:if test="${clubInfo.linkMan ne null and clubInfo.linkMan ne ''}">
 	<c:if test="${clubInfo.linkMan ne null and clubInfo.linkMan ne ''}">
-		<p>联系人:
-			<span>
+		<div class="control-group">
+			<label class="control-label">联系人:</label>
+			<div class="controls"><span>
 					${clubInfo.linkMan}
 					${clubInfo.linkMan}
-			</span>
-		</p>
+			</span></div>
+		</div>
+
 	</c:if>
 	</c:if>
 	<c:if test="${clubInfo.mobile ne null and clubInfo.mobile ne ''}">
 	<c:if test="${clubInfo.mobile ne null and clubInfo.mobile ne ''}">
-		<p>手机号:
-			<span>
+		<div class="control-group">
+			<label class="control-label">手机号:</label>
+			<div class="controls"><span>
 					${clubInfo.mobile}
 					${clubInfo.mobile}
-			</span>
-		</p>
+			</span></div>
+		</div>
+
 	</c:if>
 	</c:if>
-	<p>机构地址:
-		<span>
+	<div class="control-group">
+		<label class="control-label">机构地址:</label>
+		<div class="controls"><span>
 					<c:if test="${clubInfo.provinceName ne null}">
 					<c:if test="${clubInfo.provinceName ne null}">
 						${clubInfo.provinceName}
 						${clubInfo.provinceName}
 					</c:if>
 					</c:if>
@@ -54,33 +62,39 @@
 					<c:if test="${clubInfo.address ne null}">
 					<c:if test="${clubInfo.address ne null}">
 						${clubInfo.address}
 						${clubInfo.address}
 					</c:if>
 					</c:if>
-				</span>
-	</p>
-	<p>营业执照编号:<span>${clubInfo.socialCreditCode}</span></p>
+				</span></div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">营业执照编号:</label>
+		<div class="controls"><span>${clubInfo.socialCreditCode}</span></div>
+	</div>
+
 	<c:if test="${clubInfo.businessLicenseImage ne null and clubInfo.businessLicenseImage ne ''}">
 	<c:if test="${clubInfo.businessLicenseImage ne null and clubInfo.businessLicenseImage ne ''}">
-		<div class="main-box-bt">
-			<p>营业执照:</p>
-			<a class="main-box-img" target="_blank" href="${clubInfo.businessLicenseImage}"><img
-					src="${clubInfo.businessLicenseImage}"/></a>
+		<div class="control-group">
+			<label class="control-label">营业执照:</label>
+			<div class="controls"><a class="main-box-img" target="_blank" href="${clubInfo.businessLicenseImage}"><img
+					src="${clubInfo.businessLicenseImage}" style="width: 120px"/></a></div>
 		</div>
 		</div>
 	</c:if>
 	</c:if>
 	<c:if test="${clubInfo.headpic ne null and clubInfo.headpic ne ''}">
 	<c:if test="${clubInfo.headpic ne null and clubInfo.headpic ne ''}">
-		<div class="flex-p">
-			<p>门头照:</p>
-			<a class="flex-p-img" target="_blank" href="${clubInfo.headpic}"><img src="${clubInfo.headpic}"></a>
+		<div class="control-group">
+			<label class="control-label">门头照:</label>
+			<div class="controls"><a class="flex-p-img" target="_blank" href="${clubInfo.headpic}"><img src="${clubInfo.headpic}"style="width: 120px"></a></div>
 		</div>
 		</div>
+
 	</c:if>
 	</c:if>
 	<c:if test="${clubInfo.medicalPracticeLicenseImg ne null and clubInfo.medicalPracticeLicenseImg ne ''}">
 	<c:if test="${clubInfo.medicalPracticeLicenseImg ne null and clubInfo.medicalPracticeLicenseImg ne ''}">
-		<div class="flex-p">
-			<p>医疗执业许可证:</p>
-			<a class="flex-p-img" target="_blank" href="${clubInfo.medicalPracticeLicenseImg}"><img
-					src="${clubInfo.medicalPracticeLicenseImg}"></a>
+		<div class="control-group">
+			<label class="control-label">医疗执业许可证:</label>
+			<div class="controls"><a class="flex-p-img" target="_blank" href="${clubInfo.medicalPracticeLicenseImg}"><img
+					src="${clubInfo.medicalPracticeLicenseImg}" style="width: 120px"></a></div>
 		</div>
 		</div>
+
 	</c:if>
 	</c:if>
 </div>
 </div>
 <div class="form-actions">
 <div class="form-actions">
 	<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>
-<%--</form:form>--%>
+</form:form>
 </body>
 </body>
 </html>
 </html>

+ 18 - 15
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreList.jsp

@@ -2,7 +2,7 @@
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <html>
 <html>
 <head>
 <head>
-	<title>门店管理</title>
+	<title>机构管理</title>
 	<meta name="decorator" content="default"/>
 	<meta name="decorator" content="default"/>
 	<style type="text/css">
 	<style type="text/css">
 		.table th{text-align: center;}
 		.table th{text-align: center;}
@@ -13,14 +13,14 @@
 <body>
 <body>
 	<ul class="nav nav-tabs">
 	<ul class="nav nav-tabs">
 		<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
 		<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
-		<li class="active"><a href="${ctx}/weisha/cmOrganizeStore?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
+		<li class="active"><a href="${ctx}/weisha/cmOrganizeStore?organizeId=${cmOrganizeStore.organizeId}">机构列表</a></li>
 	</ul>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/" method="post" class="breadcrumb form-search">
 	<form:form id="searchForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/" 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}"/>
 		<form:hidden path="organizeId"/>
 		<form:hidden path="organizeId"/>
 		<div class="ul-form">
 		<div class="ul-form">
-			 <label>门店名称:</label>
+			 <label>机构名称:</label>
 				<form:input path="name" htmlEscape="false" maxlength="30" class="input-medium"/>
 				<form:input path="name" htmlEscape="false" maxlength="30" class="input-medium"/>
 			 <label>联系人:</label>
 			 <label>联系人:</label>
 				<form:input path="linkMan" htmlEscape="false" maxlength="15" class="input-medium"/>
 				<form:input path="linkMan" htmlEscape="false" maxlength="15" class="input-medium"/>
@@ -29,10 +29,12 @@
 			 <label>上线状态:</label>
 			 <label>上线状态:</label>
 			<form:select path="status" class="input-mini">
 			<form:select path="status" class="input-mini">
 				<form:option value="" label="请选择"/>
 				<form:option value="" label="请选择"/>
-				<form:option value="1" label="已上线"/>
-				<form:option value="2" label="已下线"/>
+				<form:option value="1" label="待审核"/>
+				<form:option value="90" label="已上线"/>
+				<form:option value="91" label="已下线"/>
+				<form:option value="92" label="审核未通过"/>
 			</form:select>
 			</form:select>
-			<label>添加时间:</label>
+			<label>注册时间:</label>
 			<input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
 			<input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
 				   value="${startTime}"
 				   value="${startTime}"
 				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
 				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
@@ -40,9 +42,9 @@
 				   value="${endTime}"
 				   value="${endTime}"
 				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
-			<c:if test="${cmOrganizeStore.organizeId!=4}">
-				&nbsp;&nbsp;<input id="btnSubmit1" class="btn btn-primary" style="width: 64px" onclick="window.location='${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}'" value="上线门店"/>
-			</c:if>
+<%--			<c:if test="${cmOrganizeStore.organizeId!=4}">--%>
+<%--				&nbsp;&nbsp;<input id="btnSubmit1" class="btn btn-primary" style="width: 64px" onclick="window.location='${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}'" value="上线门店"/>--%>
+<%--			</c:if>--%>
 			<div class="clearfix"></div>
 			<div class="clearfix"></div>
 		</div>
 		</div>
 	</form:form>
 	</form:form>
@@ -51,13 +53,13 @@
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
 		<thead>
 			<tr>
 			<tr>
-				<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>
 			</tr>
 			</tr>
 		</thead>
 		</thead>
@@ -93,11 +95,11 @@
 				<td>
 				<td>
 					<c:if test="${cmOrganizeStore.status eq 90}">
 					<c:if test="${cmOrganizeStore.status eq 90}">
 						<font color="green">已上线</font>
 						<font color="green">已上线</font>
-						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.userId}&status=91" onclick="return confirmx('确定下线该机构吗?下线后机构将不能登录小程序。', this.href)">下线</a>
+						<a href="${ctx}/weisha/cmOrganizeStore/status?userId=${cmOrganizeStore.userId}&status=91&organizeId=${cmOrganizeStore.organizeId}" onclick="return confirmx('确定下线该机构吗?下线后机构将不能登录小程序。', this.href)">下线</a>
 					</c:if>
 					</c:if>
 					<c:if test="${cmOrganizeStore.status eq 91}">
 					<c:if test="${cmOrganizeStore.status eq 91}">
 						<font color="red">已下线</font>
 						<font color="red">已下线</font>
-						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.userId}&status=90" onclick="return confirmx('确定上线该机构吗?', this.href)" >上线</a>
+						<a href="${ctx}/weisha/cmOrganizeStore/status?userId=${cmOrganizeStore.userId}&status=90&organizeId=${cmOrganizeStore.organizeId}" onclick="return confirmx('确定上线该机构吗?', this.href)" >上线</a>
 					</c:if>
 					</c:if>
 					<c:if test="${cmOrganizeStore.status eq 92}">
 					<c:if test="${cmOrganizeStore.status eq 92}">
 						<font color="black">审核未通过</font>
 						<font color="black">审核未通过</font>
@@ -120,7 +122,7 @@
 				<td>
 				<td>
 					<a href="${ctx}/weisha/cmOrganizeStore/formGet?clubId=${cmOrganizeStore.clubId}">查看资料</a>
 					<a href="${ctx}/weisha/cmOrganizeStore/formGet?clubId=${cmOrganizeStore.clubId}">查看资料</a>
 					<c:if test="${cmOrganizeStore.isWx eq 1}">
 					<c:if test="${cmOrganizeStore.isWx eq 1}">
-						<a href="${ctx}/weisha/cmOrganizeStore/cleanWx?userId=${cmOrganizeStore.userId}"
+						<a href="${ctx}/weisha/cmOrganizeStore/cleanWx?userId=${cmOrganizeStore.userId}&organizeId=${cmOrganizeStore.organizeId}"
 						   onclick="return confirmx('确定解绑该机构微信吗?解绑后将不能自动登录小程序。', this.href)">解绑微信</a>
 						   onclick="return confirmx('确定解绑该机构微信吗?解绑后将不能自动登录小程序。', this.href)">解绑微信</a>
 					</c:if>
 					</c:if>
 					<a href="javascript: void(0)" onclick="updatePwd(${cmOrganizeStore.userId})">重置密码</a>
 					<a href="javascript: void(0)" onclick="updatePwd(${cmOrganizeStore.userId})">重置密码</a>
@@ -142,6 +144,7 @@
 		}
 		}
 		// 修改密码
 		// 修改密码
 		function updatePwd(id) {
 		function updatePwd(id) {
+			debugger
 			var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
 			var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
 			var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
 			var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
 					"<input type='password' id='newPwd' name='newPwd' placeholder='请输入8-16位字母数字组合' rows='1' cols='12'/>" +
 					"<input type='password' id='newPwd' name='newPwd' placeholder='请输入8-16位字母数字组合' rows='1' cols='12'/>" +
@@ -160,7 +163,7 @@
 				$.post("${ctx}/new/user/agency/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
 				$.post("${ctx}/new/user/agency/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
 					if (true == data.success) {
 					if (true == data.success) {
 						$.jBox.tip(data.msg, 'info');
 						$.jBox.tip(data.msg, 'info');
-						$("#searchForm").submit();
+						// $("#searchForm").submit();
 					} else {
 					} else {
 						$.jBox.tip(data.msg, 'error');
 						$.jBox.tip(data.msg, 'error');
 					}
 					}