huangzhiguo 2 anni fa
parent
commit
1df3bd4c94
25 ha cambiato i file con 2151 aggiunte e 304 eliminazioni
  1. 56 0
      src/main/java/com/caimei/modules/weisha/dao/CmMallUserDao.java
  2. 75 3
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java
  3. 8 1
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java
  4. 171 0
      src/main/java/com/caimei/modules/weisha/entity/CmMallUser.java
  5. 84 13
      src/main/java/com/caimei/modules/weisha/entity/CmOrganizeProduct.java
  6. 199 0
      src/main/java/com/caimei/modules/weisha/entity/CmOrganizeSku.java
  7. 75 11
      src/main/java/com/caimei/modules/weisha/entity/CmOrganizeStore.java
  8. 113 0
      src/main/java/com/caimei/modules/weisha/service/CmMallUserService.java
  9. 158 46
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java
  10. 22 6
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java
  11. 158 0
      src/main/java/com/caimei/modules/weisha/web/CmMallUserController.java
  12. 40 16
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java
  13. 24 7
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java
  14. 16 16
      src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml
  15. 80 0
      src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml
  16. 204 19
      src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml
  17. 113 20
      src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml
  18. 1 1
      src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyList.jsp
  19. 120 0
      src/main/webapp/WEB-INF/views/modules/weisha/CmMallUserList.jsp
  20. 5 4
      src/main/webapp/WEB-INF/views/modules/weisha/cmMallOrganizeList.jsp
  21. 107 0
      src/main/webapp/WEB-INF/views/modules/weisha/cmMallUserForm.jsp
  22. 152 105
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductForm.jsp
  23. 17 12
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductList.jsp
  24. 70 7
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreForm.jsp
  25. 83 17
      src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreList.jsp

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

@@ -0,0 +1,56 @@
+package com.caimei.modules.weisha.dao;
+
+import com.caimei.modules.weisha.entity.CmMallOrganize;
+import com.caimei.modules.weisha.entity.CmMallUser;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/8
+ */
+@MyBatisDao
+public interface CmMallUserDao {
+
+    CmMallOrganize get(Integer id);
+    /**
+     * 组织后台用户
+     * @param cmMallUser
+     * @return
+     */
+    List<CmMallUser> getMallUser(CmMallUser cmMallUser);
+
+    /**
+     * 商品上、下架
+     */
+    void updateproduct(@Param("validFlag") Integer validFlag, @Param("id") Integer id);
+
+    /**
+     * 获取用户信息
+     * @param id
+     * @return
+     */
+    CmMallUser getMallUserById(@Param("id") Integer id);
+
+    /**
+     * 获取相同用户名的用户
+     * @return
+     */
+    Integer getRepeat(@Param("account") String account);
+
+    /**
+     * 添加组织后台用户
+     * @param cmMallUser
+     */
+    void insertMallUser(CmMallUser cmMallUser);
+
+    /**
+     * 修改组织后台用户
+     * @param cmMallUser
+     */
+    void updateMallUser(CmMallUser cmMallUser);
+}

+ 75 - 3
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java

@@ -1,10 +1,10 @@
 package com.caimei.modules.weisha.dao;
 
+import com.caimei.modules.product.entity.CmSku;
 import com.caimei.modules.product.entity.Product;
-import com.caimei.modules.weisha.entity.OrganizeProductLadderPrice;
+import com.caimei.modules.weisha.entity.*;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.weisha.entity.CmOrganizeProduct;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -16,6 +16,23 @@ import java.util.List;
  */
 @MyBatisDao
 public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
+    /**
+     * 商品信息
+     * @param cmOrganizeProduct
+     * @return
+     */
+    List<CmOrganizeProduct> getOrganizeProductList(CmOrganizeProduct cmOrganizeProduct);
+
+    /**
+     * 外部商城sku信息
+     * @return
+     */
+    List<CmOrganizeSku> getOrganizeSku(@Param("productIds") List<Integer> productIds);
+
+    /**
+     * 商品上、下架
+     */
+    void updateproduct(@Param("validFlag") Integer validFlag, @Param("id") Integer id);
 
     /**
      * 查询组织商品列表
@@ -24,6 +41,61 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
      */
     List<Product> findProductList(Product product);
 
+    /**
+     * 获取组织信息
+     * @param id
+     * @return
+     */
+    CmMallOrganize getOrganizeInfo(@Param("id") Integer id);
+    /**
+     * 获取商品、供应商信息
+     * @param productIds
+     * @return
+     */
+    List<CmOrganizeProduct> getShopInfo(@Param("productIds") List<String> productIds);
+
+    /**
+     * sku信息
+     * @param productId
+     * @return
+     */
+    List<CmSku> getSkuInfo(@Param("productId") String productId);
+
+    /**
+     * 添加组织商品
+     * @param cmOrganizeProduct
+     */
+    void insertMallProduct(CmOrganizeProduct cmOrganizeProduct);
+
+    /**
+     * 组织商城sku添加
+     * @param organizeSku
+     */
+    void insertMallSku(CmOrganizeSku organizeSku);
+
+    /**
+     * 修改外部商城商品
+     * @param cmOrganizeProduct
+     */
+    void updateMallProduct(CmOrganizeProduct cmOrganizeProduct);
+
+    /**
+     * 修改外部商城商品Sku
+     * @param organizeSku
+     */
+    void updateMallProductSku(CmOrganizeSku organizeSku);
+    /**
+     * 组织商品详情
+     * @param id
+     * @return
+     */
+    CmOrganizeProduct getProductInfo(@Param("id") String id);
+
+    /**
+     * 删除商品
+     * @param id
+     */
+    void deleteProduct(@Param("id") String id);
     /**
      * 根据商品Id查询商品信息
      * @param productId
@@ -74,4 +146,4 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
      * @param ladderPriceFlag
      */
     void updateLadderPriceFlag(@Param("productId") String productId,@Param("ladderPriceFlag") int ladderPriceFlag);
-}
+}

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

@@ -3,6 +3,7 @@ package com.caimei.modules.weisha.dao;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.weisha.entity.CmOrganizeStore;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,7 +15,13 @@ import java.util.List;
 @MyBatisDao
 public interface CmOrganizeStoreDao extends CrudDao<CmOrganizeStore> {
 
+    List<Integer> getOrganizeUser(@Param("organizeId") Integer organizeId);
+
+    void cleanWx(@Param("userId") Integer userId);
+
+    CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
+
     List<CmOrganizeStore> findListByMobile(CmOrganizeStore cmOrganizeStore);
 
     String findOrganizeNameById(Integer organizeId);
-}
+}

+ 171 - 0
src/main/java/com/caimei/modules/weisha/entity/CmMallUser.java

@@ -0,0 +1,171 @@
+package com.caimei.modules.weisha.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/8
+ */
+public class CmMallUser extends DataEntity<CmMallUser> {
+    private String id;
+    /**
+     * 登录名(包含英文字母、数字、下划线)
+     */
+    private String account;
+    /**
+     * 账号名称
+     */
+    private String accountName;
+    /**
+     * 用户登录密码
+     */
+    private String password;
+    /**
+     * 验证密码
+     */
+    private String confirmPassword;
+    /**
+     * 随机盐
+     */
+    private String salt;
+    /**
+     * 组织ID,具体对应cm_mall_organize表ID
+     */
+    private Integer organizeId;
+    /**
+     * 是否上线 1 已上线 2 已下线
+     */
+    private Integer status;
+    /**
+     * 添加时间
+     */
+    private Date addTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 0 有效  其它无效
+     */
+    private String delFlag;
+    /**
+     * 开始时间
+     */
+    private String startTime;
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getConfirmPassword() {
+        return confirmPassword;
+    }
+
+    public void setConfirmPassword(String confirmPassword) {
+        this.confirmPassword = confirmPassword;
+    }
+
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
+    public Integer getOrganizeId() {
+        return organizeId;
+    }
+
+    public void setOrganizeId(Integer organizeId) {
+        this.organizeId = organizeId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    @Override
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+}

+ 84 - 13
src/main/java/com/caimei/modules/weisha/entity/CmOrganizeProduct.java

@@ -13,11 +13,12 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @version 2021-03-19
  */
 public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private Integer organizeId;		// 组织Id
 	private Integer productId;		// 商品Id
 	private Integer ladderPriceFlag;		// 启用阶梯价格标识 0否 1是
+	private Double normalPrice;		// 市场价
 	private Double price;		// 机构价
 	private Integer includedTax;		// 是否含税   0不含税,1含税,2未知
 	private Integer invoiceType;		// 发票类型(基于是否含税基础)   1增值税专用发票,2增值税普通发票, 3不能开票
@@ -26,11 +27,17 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	private Integer minBuyNumber;		// 最小起订量
 	private Integer costType;		// 成本价类型:1固定成本 2比例成本
 	private Double costPrice;		// 成本价
+	private Double retailPrice;		// 售价
 	private Double costProportional;		// 比例成本百分比
 	private Integer status;		// 商品状态:0已下架,1已上架
 	private Date addTime;		// 添加时间
+	private Date updateTime;	// 更新时间
+	private String delFlag;	// 0 有效 其它无效
+	private Double supplierTaxPoint; 	// 供应商税率
+	private Double taxPoint; 	// 机构税率
 
-
+	private List<CmOrganizeSku> sku;		// sku信息
+	private String skus;	// sku json
 	private String productName;		//商品名称
 	private String productImage;	//商品图片
 	private String shopName;		//供应商名称
@@ -52,7 +59,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setOrganizeId(Integer organizeId) {
 		this.organizeId = organizeId;
 	}
-	
+
 	public Integer getProductId() {
 		return productId;
 	}
@@ -60,7 +67,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setProductId(Integer productId) {
 		this.productId = productId;
 	}
-	
+
 	public Integer getLadderPriceFlag() {
 		return ladderPriceFlag;
 	}
@@ -68,7 +75,15 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setLadderPriceFlag(Integer ladderPriceFlag) {
 		this.ladderPriceFlag = ladderPriceFlag;
 	}
-	
+
+	public Double getNormalPrice() {
+		return normalPrice;
+	}
+
+	public void setNormalPrice(Double normalPrice) {
+		this.normalPrice = normalPrice;
+	}
+
 	public Double getPrice() {
 		return price;
 	}
@@ -76,7 +91,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setPrice(Double price) {
 		this.price = price;
 	}
-	
+
 	public Integer getIncludedTax() {
 		return includedTax;
 	}
@@ -84,7 +99,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setIncludedTax(Integer includedTax) {
 		this.includedTax = includedTax;
 	}
-	
+
 	public Integer getInvoiceType() {
 		return invoiceType;
 	}
@@ -92,7 +107,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setInvoiceType(Integer invoiceType) {
 		this.invoiceType = invoiceType;
 	}
-	
+
 	public Integer getMinBuyNumber() {
 		return minBuyNumber;
 	}
@@ -100,7 +115,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setMinBuyNumber(Integer minBuyNumber) {
 		this.minBuyNumber = minBuyNumber;
 	}
-	
+
 	public Integer getCostType() {
 		return costType;
 	}
@@ -108,7 +123,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setCostType(Integer costType) {
 		this.costType = costType;
 	}
-	
+
 	public Double getCostPrice() {
 		return costPrice;
 	}
@@ -116,7 +131,15 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setCostPrice(Double costPrice) {
 		this.costPrice = costPrice;
 	}
-	
+
+	public Double getRetailPrice() {
+		return retailPrice;
+	}
+
+	public void setRetailPrice(Double retailPrice) {
+		this.retailPrice = retailPrice;
+	}
+
 	public Double getCostProportional() {
 		return costProportional;
 	}
@@ -132,7 +155,7 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	public Date getAddTime() {
 		return addTime;
@@ -142,6 +165,38 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 		this.addTime = addTime;
 	}
 
+	public Double getSupplierTaxPoint() {
+		return supplierTaxPoint;
+	}
+
+	public void setSupplierTaxPoint(Double supplierTaxPoint) {
+		this.supplierTaxPoint = supplierTaxPoint;
+	}
+
+	public Double getTaxPoint() {
+		return taxPoint;
+	}
+
+	public void setTaxPoint(Double taxPoint) {
+		this.taxPoint = taxPoint;
+	}
+
+	public List<CmOrganizeSku> getSku() {
+		return sku;
+	}
+
+	public String getSkus() {
+		return skus;
+	}
+
+	public void setSkus(String skus) {
+		this.skus = skus;
+	}
+
+	public void setSku(List<CmOrganizeSku> sku) {
+		this.sku = sku;
+	}
+
 	public String getProductName() {
 		return productName;
 	}
@@ -198,5 +253,21 @@ public class CmOrganizeProduct extends DataEntity<CmOrganizeProduct> {
 		this.unit = unit;
 	}
 
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
 
-}
+	@Override
+	public String getDelFlag() {
+		return delFlag;
+	}
+
+	@Override
+	public void setDelFlag(String delFlag) {
+		this.delFlag = delFlag;
+	}
+}

+ 199 - 0
src/main/java/com/caimei/modules/weisha/entity/CmOrganizeSku.java

@@ -0,0 +1,199 @@
+package com.caimei.modules.weisha.entity;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/6
+ */
+public class CmOrganizeSku {
+    private Integer id;
+    /**
+     * 商品Id
+     */
+    private Integer productId;
+    /**
+     * 外部商城SkuId
+     */
+    private Integer organId;
+    /**
+     * 采美SkuId
+     */
+    private Integer skuId;
+    /**
+     * 外部商城productId
+     */
+    private Integer mallProductId;
+    /**
+     * 外部商城起订量
+     */
+    private Integer minBuyNumber;
+    /**
+     * 外部商城售价
+     */
+    private Double price;
+    /**
+     * 包装规格
+     */
+    private String unit;
+    /**
+     * 机构价
+     */
+    private String clubPrice;
+    /**
+     * 成本类型:1固定成本 2比例成本
+     */
+    private String costCheckFlag;
+    /**
+     * 成本价
+     */
+    private Double costPrice;
+    /**
+     * 比例成本百分比
+     */
+    private Double costProportional;
+    /**
+     * 采美起订量
+     */
+    private Integer cmMinBuyNumber;
+    /**
+     * 分账组织佣金比例
+     */
+    private Double organizePercent;
+    /**
+     * 分账供应商成本比例
+     */
+    private Double shopPercent;
+    /**
+     * 分账采美佣金比例
+     */
+    private Double cmPercent;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getSkuId() {
+        return skuId;
+    }
+
+    public void setSkuId(Integer skuId) {
+        this.skuId = skuId;
+    }
+
+    public Integer getMallProductId() {
+        return mallProductId;
+    }
+
+    public void setMallProductId(Integer mallProductId) {
+        this.mallProductId = mallProductId;
+    }
+
+    public Integer getMinBuyNumber() {
+        return minBuyNumber;
+    }
+
+    public void setMinBuyNumber(Integer minBuyNumber) {
+        this.minBuyNumber = minBuyNumber;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getClubPrice() {
+        return clubPrice;
+    }
+
+    public void setClubPrice(String clubPrice) {
+        this.clubPrice = clubPrice;
+    }
+
+    public String getCostCheckFlag() {
+        return costCheckFlag;
+    }
+
+    public void setCostCheckFlag(String costCheckFlag) {
+        this.costCheckFlag = costCheckFlag;
+    }
+
+    public Double getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(Double costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public Double getCostProportional() {
+        return costProportional;
+    }
+
+    public void setCostProportional(Double costProportional) {
+        this.costProportional = costProportional;
+    }
+
+    public Integer getCmMinBuyNumber() {
+        return cmMinBuyNumber;
+    }
+
+    public void setCmMinBuyNumber(Integer cmMinBuyNumber) {
+        this.cmMinBuyNumber = cmMinBuyNumber;
+    }
+
+    public Double getOrganizePercent() {
+        return organizePercent;
+    }
+
+    public void setOrganizePercent(Double organizePercent) {
+        this.organizePercent = organizePercent;
+    }
+
+    public Double getShopPercent() {
+        return shopPercent;
+    }
+
+    public void setShopPercent(Double shopPercent) {
+        this.shopPercent = shopPercent;
+    }
+
+    public Double getCmPercent() {
+        return cmPercent;
+    }
+
+    public void setCmPercent(Double cmPercent) {
+        this.cmPercent = cmPercent;
+    }
+}

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

@@ -12,8 +12,10 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @version 2021-06-29
  */
 public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
-	
+
 	private static final long serialVersionUID = 1L;
+	private Integer userId;		// 用户Id
+	private Integer clubId;		// 机构Id
 	private Integer organizeId;		// 组织id
 	private String name;		// 门店名称
 	private String linkMan;		// 联系人
@@ -24,6 +26,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	private String address;		// 详细地址
 	private Integer status;		// 门店状态:1已上线,2已下线
 	private Date addTime;		// 添加时间
+	private  Integer isWx; 		// 是否绑定微信
 
 	private String startTime;	// 查询条件,开始时间
 	private String endTime;	// 查询条件,结束时间
@@ -31,6 +34,11 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	private String cityName;		//市
 	private String townName;		//区
 
+	private String medicalPracticeLicenseImg;	// 医疗执业许可证
+	private String socialCreditCode;	// 营业执照编号
+	private String headpic;		// 门头照
+	private String businessLicenseImage;	// 营业执照
+
 	public CmOrganizeStore() {
 		super();
 	}
@@ -39,6 +47,22 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 		super(id);
 	}
 
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
+	public Integer getClubId() {
+		return clubId;
+	}
+
+	public void setClubId(Integer clubId) {
+		this.clubId = clubId;
+	}
+
 	public Integer getOrganizeId() {
 		return organizeId;
 	}
@@ -46,7 +70,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setOrganizeId(Integer organizeId) {
 		this.organizeId = organizeId;
 	}
-	
+
 	@Length(min=0, max=30, message="门店名称长度必须介于 0 和 30 之间")
 	public String getName() {
 		return name;
@@ -55,7 +79,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setName(String name) {
 		this.name = name;
 	}
-	
+
 	@Length(min=0, max=15, message="联系人长度必须介于 0 和 15 之间")
 	public String getLinkMan() {
 		return linkMan;
@@ -64,7 +88,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setLinkMan(String linkMan) {
 		this.linkMan = linkMan;
 	}
-	
+
 	@Length(min=0, max=15, message="手机号长度必须介于 0 和 15 之间")
 	public String getMobile() {
 		return mobile;
@@ -73,7 +97,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setMobile(String mobile) {
 		this.mobile = mobile;
 	}
-	
+
 	public Integer getProvinceId() {
 		return provinceId;
 	}
@@ -81,7 +105,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setProvinceId(Integer provinceId) {
 		this.provinceId = provinceId;
 	}
-	
+
 	public Integer getCityId() {
 		return cityId;
 	}
@@ -89,7 +113,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setCityId(Integer cityId) {
 		this.cityId = cityId;
 	}
-	
+
 	public Integer getTownId() {
 		return townId;
 	}
@@ -97,7 +121,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setTownId(Integer townId) {
 		this.townId = townId;
 	}
-	
+
 	@Length(min=0, max=255, message="详细地址长度必须介于 0 和 255 之间")
 	public String getAddress() {
 		return address;
@@ -106,7 +130,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setAddress(String address) {
 		this.address = address;
 	}
-	
+
 	public Integer getStatus() {
 		return status;
 	}
@@ -114,7 +138,7 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	public Date getAddTime() {
 		return addTime;
@@ -124,6 +148,14 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 		this.addTime = addTime;
 	}
 
+	public Integer getIsWx() {
+		return isWx;
+	}
+
+	public void setIsWx(Integer isWx) {
+		this.isWx = isWx;
+	}
+
 	public String getStartTime() {
 		return startTime;
 	}
@@ -163,4 +195,36 @@ public class CmOrganizeStore extends DataEntity<CmOrganizeStore> {
 	public void setTownName(String townName) {
 		this.townName = townName;
 	}
-}
+
+	public String getMedicalPracticeLicenseImg() {
+		return medicalPracticeLicenseImg;
+	}
+
+	public void setMedicalPracticeLicenseImg(String medicalPracticeLicenseImg) {
+		this.medicalPracticeLicenseImg = medicalPracticeLicenseImg;
+	}
+
+	public String getSocialCreditCode() {
+		return socialCreditCode;
+	}
+
+	public void setSocialCreditCode(String socialCreditCode) {
+		this.socialCreditCode = socialCreditCode;
+	}
+
+	public String getHeadpic() {
+		return headpic;
+	}
+
+	public void setHeadpic(String headpic) {
+		this.headpic = headpic;
+	}
+
+	public String getBusinessLicenseImage() {
+		return businessLicenseImage;
+	}
+
+	public void setBusinessLicenseImage(String businessLicenseImage) {
+		this.businessLicenseImage = businessLicenseImage;
+	}
+}

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

@@ -0,0 +1,113 @@
+package com.caimei.modules.weisha.service;
+
+import com.caimei.modules.weisha.dao.CmMallUserDao;
+import com.caimei.modules.weisha.entity.CmMallOrganize;
+import com.caimei.modules.weisha.entity.CmMallUser;
+import com.caimei.utils.MD5Util;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/8
+ */
+@Service
+public class CmMallUserService {
+
+    @Autowired private CmMallUserDao cmMallUserDao;
+
+    /**
+     * 初始化组织信息
+     * @param id
+     * @return
+     */
+    public CmMallOrganize get(Integer id) {
+        CmMallOrganize cmMallOrganize = cmMallUserDao.get(id);
+        return cmMallOrganize;
+    }
+    /**
+     * 组织用户列表
+     * @param page
+     * @param cmMallUser
+     * @return
+     */
+    public Page<CmMallUser> getMallUser(Page<CmMallUser> page, CmMallUser cmMallUser) {
+        cmMallUser.setPage(page);
+//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:dd:ss");
+        List<CmMallUser> mallUser = cmMallUserDao.getMallUser(cmMallUser);
+        /*for (CmMallUser user : mallUser) {
+
+        }*/
+        page.setList(mallUser);
+        return page;
+    }
+
+    /**
+     * 用户上线下
+     * @param validFlag
+     * @param id
+     */
+    public void updateproduct(Integer validFlag, Integer id) {
+        cmMallUserDao.updateproduct(validFlag, id);
+    }
+    /**
+     * 用户信息回显
+     * @param id
+     * @return
+     */
+    public CmMallUser getMallUserInfo(Integer id) {
+        CmMallUser mallUserById = cmMallUserDao.getMallUserById(id);
+        mallUserById.setConfirmPassword(mallUserById.getPassword());
+        return mallUserById;
+    }
+
+    public void save(CmMallUser cmMallUser) throws Exception{
+        // 密码添加  随机盐
+        UUID uuid = UUID.randomUUID();
+        String[] split = uuid.toString().split("-");
+        String newPassword = cmMallUser.getPassword() + split[0];
+        String s = MD5Util.MD5(newPassword);
+        cmMallUser.setPassword(s);
+        cmMallUser.setSalt(split[0]);
+        cmMallUser.setUpdateTime(new Date());
+        if (null == cmMallUser.getId()) {
+            // 添加组织后台用户信息
+            cmMallUser.setAddTime(new Date());
+            cmMallUser.setDelFlag("0");
+
+            cmMallUserDao.insertMallUser(cmMallUser);
+        } else {
+            // 修改组织后台用户信息
+            cmMallUserDao.updateMallUser(cmMallUser);
+        }
+    }
+
+    /**
+     * 重置密码
+     * @throws Exception
+     */
+    public void repeatPassword(String password, String id) throws Exception {
+        CmMallUser cmMallUser = new CmMallUser();
+        // 密码添加  随机盐
+        UUID uuid = UUID.randomUUID();
+        String[] split = uuid.toString().split("-");
+        String newPassword = password + split[0];
+        String s = MD5Util.MD5(newPassword);
+        cmMallUser.setId(id);
+        cmMallUser.setPassword(s);
+        cmMallUser.setSalt(split[0]);
+        cmMallUser.setUpdateTime(new Date());
+        // 修改组织后台用户信息
+        cmMallUserDao.updateMallUser(cmMallUser);
+    }
+}

+ 158 - 46
src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java

@@ -1,12 +1,16 @@
 package com.caimei.modules.weisha.service;
 
 import java.text.DecimalFormat;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.modules.product.entity.CmSku;
 import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.product.entity.Sku;
 import com.caimei.modules.weisha.dao.CmOrganizePromotionDao;
-import com.caimei.modules.weisha.entity.OrganizeProductLadderPrice;
+import com.caimei.modules.weisha.entity.*;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.StringUtils;
 import com.thinkgem.jeesite.common.config.Global;
@@ -15,7 +19,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.weisha.entity.CmOrganizeProduct;
 import com.caimei.modules.weisha.dao.CmOrganizeProductDao;
 
 import javax.annotation.Resource;
@@ -36,11 +39,11 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 	public CmOrganizeProduct get(String id) {
 		return super.get(id);
 	}
-	
+
 	public List<CmOrganizeProduct> findList(CmOrganizeProduct cmOrganizeProduct) {
 		return super.findList(cmOrganizeProduct);
 	}
-	
+
 	public Page<CmOrganizeProduct> findPage(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
 		cmOrganizeProduct.setPage(page);
 		List<CmOrganizeProduct> productList = cmOrganizeProductDao.findList(cmOrganizeProduct);
@@ -64,42 +67,85 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 		page.setList(productList);
 		return page;
 	}
-	
-	@Transactional(readOnly = false)
-	public void save(CmOrganizeProduct cmOrganizeProduct) {
-		super.save(cmOrganizeProduct);
-		//保存阶梯价格列表
-		List<OrganizeProductLadderPrice> ladderPriceList = cmOrganizeProduct.getLadderPriceList();
-		if (1 == cmOrganizeProduct.getLadderPriceFlag()) {
-			for (int i = 0; i < ladderPriceList.size(); i++) {
-				Integer buyNum = ladderPriceList.get(i).getBuyNum();
-				Double buyPrice = ladderPriceList.get(i).getBuyPrice();
-				String ladderId = ladderPriceList.get(i).getId();
-				String delFlag = ladderPriceList.get(i).getDelFlag();
-				if ("0".equals(delFlag) && null != buyNum && null != buyPrice && !"".equals(buyPrice)) {
-					ladderPriceList.get(i).setProductId(Integer.parseInt(cmOrganizeProduct.getId()));
-					ladderPriceList.get(i).setLadderNum(i + 1);
-					if (StringUtils.isNotBlank(ladderId)) {
-						cmOrganizeProductDao.updateLadderPrice(ladderPriceList.get(i));
-					} else {
-						cmOrganizeProductDao.insertLadderPrice(ladderPriceList.get(i));
+	public Page<CmOrganizeProduct> organizeProductList(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
+		cmOrganizeProduct.setPage(page);
+		// 商品信息
+		List<CmOrganizeProduct> productList = cmOrganizeProductDao.getOrganizeProductList(cmOrganizeProduct);
+		// sku
+		List<Integer> productIds = null;
+		if (null != productList) {
+			productIds = productList.stream().map(p -> p.getProductId()).collect(Collectors.toList());
+		}
+		List<CmOrganizeSku> organizeSku = cmOrganizeProductDao.getOrganizeSku(productIds);
+		String wwwServer = Global.getConfig("wwwServer");
+		// 设置商品规sku
+		productList.forEach(product->{
+			product.setProductImage(AppUtils.getImageURL("product", product.getProductImage(), 0, wwwServer));
+			if (null != organizeSku) {
+				product.setSku(organizeSku.stream().filter(s -> s.getProductId().equals(product.getProductId())).collect(Collectors.toList()));
+			}
+			/*for (CmOrganizeSku sku : organizeSku) {
+				if (sku.getProductId() == product.getProductId()) {
+					if (null != sku.getUnit()) {
+						product.setUnit(sku.getUnit());
 					}
-				} else {
-					if (StringUtils.isNotBlank(ladderId)) {
-						cmOrganizeProductDao.deleteLadderPriceById(ladderId);
-					} else {
-						break;
+					if (null != sku.getPrice()) {
+						product.setPrice(sku.getPrice());
+					}
+					if (null != sku.getMinBuyNumber()) {
+						product.setMinBuyNumber(sku.getMinBuyNumber());
 					}
 				}
+			}*/
+		});
+		page.setList(productList);
+		return page;
+	}
+
+	@Transactional(readOnly = false)
+	public void updateproduct(Integer validFlag, Integer id) {
+		cmOrganizeProductDao.updateproduct(validFlag, id);
+	}
+
+	@Transactional(readOnly = false)
+	public void saveProduct(CmOrganizeProduct cmOrganizeProduct) {
+
+		// 保存商品信息
+		List<CmSku> skuInfo = cmOrganizeProductDao.getSkuInfo(cmOrganizeProduct.getProductId().toString());
+		// 解析sku
+		try {
+			JSONArray jsonArray = JSONArray.parseArray(cmOrganizeProduct.getSkus());
+			List<CmOrganizeSku> cmOrganizeSkus = jsonArray.toJavaList(CmOrganizeSku.class);
+
+			// 获取最小值
+			List<Double> priceList = cmOrganizeSkus.stream().map(s -> s.getPrice()).collect(Collectors.toList());
+			List<Integer> numberList = cmOrganizeSkus.stream().map(s -> s.getMinBuyNumber()).collect(Collectors.toList());
+			Double minPrice = Collections.min(priceList);
+			Integer minNumber = Collections.min(numberList);
+			// 若是阶梯价商品,则起订量重置为1
+			List<CmSku> collect = skuInfo.stream().filter(s -> 1 == s.getLadderPriceFlag()).collect(Collectors.toList());
+			if (collect.size() > 0) {
+				cmOrganizeProduct.setMinBuyNumber(1);
+			} else {
+				cmOrganizeProduct.setMinBuyNumber(skuInfo.get(0).getMinBuyNumber());
+			}
+			// 设置起订量,价格
+			cmOrganizeProduct.setPrice(minPrice);
+			cmOrganizeProduct.setMinBuyNumber(minNumber);
+			cmOrganizeProductDao.updateMallProduct(cmOrganizeProduct);
+			// 保存商品sku
+			for (CmOrganizeSku sku : cmOrganizeSkus) {
+				cmOrganizeProductDao.updateMallProductSku(sku);
 			}
+		} catch (Exception e) {
+			e.printStackTrace();
 		}
 	}
-	
+
 	@Transactional(readOnly = false)
-	public void delete(CmOrganizeProduct cmOrganizeProduct) {
+	public void deleteProduct(CmOrganizeProduct cmOrganizeProduct) {
 		//删除商品对应的促销活动
-		cmOrganizePromotionDao.deletePromotionByProductId(cmOrganizeProduct.getId());
-		super.delete(cmOrganizeProduct);
+		cmOrganizeProductDao.deleteProduct(cmOrganizeProduct.getId());
 	}
 
     public Page findProductPage(Page<Product> productPage, Product product) {
@@ -115,16 +161,62 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 
 	@Transactional(readOnly = false)
 	public void addProducts(Integer organizeId, String productIds) {
+		// 商品Id集合
 		String[] productIdArr = productIds.split(",");
+		// 获取商品、供应商信息
+		List<CmOrganizeProduct> shopInfo = cmOrganizeProductDao.getShopInfo(Arrays.asList(productIdArr));
+		// 获取组织信息
+		CmMallOrganize organizeInfo = cmOrganizeProductDao.getOrganizeInfo(organizeId);
 		for (String productId : productIdArr) {
 			if (StringUtils.isNotBlank(productId)) {
-				CmOrganizeProduct cmOrganizeProduct = cmOrganizeProductDao.findProductByProductId(productId);
+				List<CmSku> skuInfo = cmOrganizeProductDao.getSkuInfo(productId);
+				CmOrganizeProduct cmOrganizeProduct = new CmOrganizeProduct();
+				CmOrganizeSku skuEntity = new CmOrganizeSku();
 				cmOrganizeProduct.setProductId(Integer.parseInt(productId));
 				cmOrganizeProduct.setOrganizeId(organizeId);
+				cmOrganizeProduct.setNormalPrice(skuInfo.get(0).getNormalPrice());
+				cmOrganizeProduct.setCostPrice(skuInfo.get(0).getCostPrice());
+				cmOrganizeProduct.setLadderPriceFlag(1);
+				cmOrganizeProduct.setRetailPrice(skuInfo.get(0).getPrice());
+				// 若是阶梯价商品,则起订量重置为1
+				List<CmSku> collect = skuInfo.stream().filter(s -> 1 == s.getLadderPriceFlag()).collect(Collectors.toList());
+				if (collect.size() > 0) {
+					cmOrganizeProduct.setMinBuyNumber(1);
+				} else {
+					cmOrganizeProduct.setMinBuyNumber(skuInfo.get(0).getMinBuyNumber());
+				}
+				cmOrganizeProduct.setStatus(1);
 				cmOrganizeProduct.setAddTime(new Date());
+				cmOrganizeProduct.setUpdateDate(new Date());
+				cmOrganizeProduct.setDelFlag("0");
 				//保存组织商品
-				cmOrganizeProductDao.insert(cmOrganizeProduct);
-				if (cmOrganizeProduct.getLadderPriceFlag() == 1) {
+				cmOrganizeProductDao.insertMallProduct(cmOrganizeProduct);
+				// 组织sku数据保存
+				for (CmSku sku : skuInfo) {
+					skuEntity.setSkuId(sku.getSkuId());
+					skuEntity.setProductId(sku.getProductId());
+					skuEntity.setMallProductId(Integer.parseInt(cmOrganizeProduct.getId()));
+					skuEntity.setMinBuyNumber(sku.getMinBuyNumber());
+					skuEntity.setPrice(sku.getPrice());
+					// 设置默认分帐比例
+					// 联合丽格商品 采美佣金 2% 付组织 98%
+					// 其他供应商商品 采美佣金 3% 联合丽格 17% 供应商 80%
+					for (CmOrganizeProduct organizeProduct : shopInfo) {
+						if (organizeProduct.getProductId().equals(sku.getProductId())) {
+							if (organizeInfo.getId().equals(organizeId.toString())) {
+								skuEntity.setCmPercent(2.00);
+								skuEntity.setOrganizePercent(98.00);
+								skuEntity.setShopPercent(0.00);
+							} else {
+								skuEntity.setCmPercent(3.00);
+								skuEntity.setOrganizePercent(17.00);
+								skuEntity.setShopPercent(80.00);
+							}
+						}
+					}
+					cmOrganizeProductDao.insertMallSku(skuEntity);
+				}
+				/*if (cmOrganizeProduct.getLadderPriceFlag() == 1) {
 					//查询对应采美商品的阶梯价格列表
 					List<OrganizeProductLadderPrice> ladderPriceList = cmOrganizeProductDao.findFormerLadderPriceList(productId);
 					if (ladderPriceList != null && ladderPriceList.size() > 0) {
@@ -135,7 +227,7 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 					}else {
 						cmOrganizeProductDao.updateLadderPriceFlag(cmOrganizeProduct.getId(), 0);
 					}
-				}
+				}*/
 			}
 		}
 
@@ -146,13 +238,33 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 		cmOrganizeProductDao.updateStatus(id, status);
 	}
 
-	public List<OrganizeProductLadderPrice> findLadderPrice(String id) {
-		List<OrganizeProductLadderPrice> ladderPriceList = cmOrganizeProductDao.findLadderPrice(id);
-		if (ladderPriceList != null) {
-			ladderPriceList.forEach(ladderPrice->{
-				ladderPrice.setDelFlag("0");
-			});
+	/**
+	 * 组织商品编辑回显
+	 * @param id
+	 * @return
+	 */
+	public CmOrganizeProduct findLadderPrice(String id) {
+		// 商品数据详情
+		CmOrganizeProduct productInfo = cmOrganizeProductDao.getProductInfo(id);
+		// 商品sku
+		List<Integer> productIds = new ArrayList<>();
+		String wwwServer = Global.getConfig("wwwServer");
+		if (productInfo != null) {
+			productInfo.setProductImage(AppUtils.getImageURL("product", productInfo.getProductImage(),0, wwwServer));
+
+			productIds.add(productInfo.getProductId());
+			List<CmOrganizeSku> organizeSku = cmOrganizeProductDao.getOrganizeSku(productIds);
+			productInfo.setSku(organizeSku);
 		}
-		return ladderPriceList;
+		return productInfo;
 	}
-}
+
+	/**
+	 * 保存组织商品信息
+	 * @param cmOrganizeProduct
+	 */
+	public void saveOrganizeProduct(CmOrganizeProduct cmOrganizeProduct) {
+
+	}
+
+}

+ 22 - 6
src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java

@@ -2,6 +2,10 @@ package com.caimei.modules.weisha.service;
 
 import java.util.List;
 
+import com.caimei.utils.AppKeys;
+import com.caimei.utils.AppUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -19,26 +23,38 @@ import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 @Transactional(readOnly = true)
 public class CmOrganizeStoreService extends CrudService<CmOrganizeStoreDao, CmOrganizeStore> {
 
+	@Autowired private CmOrganizeStoreDao cmOrganizeStoreDao;
+
 	public CmOrganizeStore get(String id) {
 		return super.get(id);
 	}
-	
+
 	public List<CmOrganizeStore> findList(CmOrganizeStore cmOrganizeStore) {
 		return super.findList(cmOrganizeStore);
 	}
-	
+
 	public Page<CmOrganizeStore> findPage(Page<CmOrganizeStore> page, CmOrganizeStore cmOrganizeStore) {
 		return super.findPage(page, cmOrganizeStore);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void save(CmOrganizeStore cmOrganizeStore) {
 		super.save(cmOrganizeStore);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(CmOrganizeStore cmOrganizeStore) {
 		super.delete(cmOrganizeStore);
 	}
-	
-}
+
+
+	public CmOrganizeStore gtClubInfo(CmOrganizeStore cmOrganizeStore) {
+		CmOrganizeStore cmOrganizeStores = cmOrganizeStoreDao.getclubInfo(cmOrganizeStore);
+		String wwwServer = Global.getConfig("wwwServer");
+		//营业执照
+		cmOrganizeStores.setBusinessLicenseImage(AppUtils.getImageURL("clubBusinessLicenseImage", cmOrganizeStores.getBusinessLicenseImage(), 0, wwwServer));
+		//门头照
+		cmOrganizeStores.setHeadpic(AppUtils.getImageURL("club", cmOrganizeStores.getHeadpic(), AppKeys.CLUB_LOGO_SIZE, wwwServer));
+		return cmOrganizeStores;
+	}
+}

+ 158 - 0
src/main/java/com/caimei/modules/weisha/web/CmMallUserController.java

@@ -0,0 +1,158 @@
+package com.caimei.modules.weisha.web;
+
+import com.caimei.modules.weisha.dao.CmMallUserDao;
+import com.caimei.modules.weisha.entity.CmMallOrganize;
+import com.caimei.modules.weisha.entity.CmMallUser;
+import com.caimei.modules.weisha.service.CmMallUserService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/8
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/weisha/cmMallUser")
+public class CmMallUserController  extends BaseController {
+
+    @Autowired private CmMallUserService cmMallUserService;
+    @Autowired private CmMallUserDao cmMallUserDao;
+
+    /**
+     * 组织后台用户列表
+     * @param cmMallUser
+     * @param model
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/getMallUser")
+    public String getMallUser(CmMallUser cmMallUser, Model model, HttpServletRequest request, HttpServletResponse response) {
+
+        if (null == cmMallUser.getOrganizeId()) {
+            return "redirect:"+ Global.getAdminPath()+"/weisha/cmMallOrganize/";
+        }
+        // 组织用户信息
+        Page<CmMallUser> page = cmMallUserService.getMallUser(new Page<>(request, response), cmMallUser);
+        // 组织信息
+        CmMallOrganize cmMallOrganize = cmMallUserService.get(cmMallUser.getOrganizeId());
+        model.addAttribute("page", page);
+        model.addAttribute("cmMallOrganize", cmMallOrganize);
+
+        return "modules/weisha/CmMallUserList";
+    }
+
+    /**
+     * 修改用户上下线
+     * @param status
+     * @param id
+     * @param model
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping(value = "/updateValidFlag")
+    public String updateProduct(Integer status, Integer id, Integer organizeId,Model model, RedirectAttributes redirectAttributes) {
+        if (null == status) {
+            model.addAttribute("参数不能为空");
+            return "redirect:"+Global.getAdminPath()+"/weisha/cmMallUser/getMallUser?repage&organizeId="+organizeId;
+        }
+        if (null == id) {
+            model.addAttribute("参数不能为空");
+            return "redirect:"+Global.getAdminPath()+"/weisha/cmMallUser/getMallUser?repage&organizeId="+organizeId;
+        }
+        cmMallUserService.updateproduct(status, id);
+        addMessage(redirectAttributes, "用户状态修改成功");
+        return "redirect:"+Global.getAdminPath()+"/weisha/cmMallUser/getMallUser?repage&organizeId="+organizeId;
+    }
+
+    /**
+     * 编辑回显
+     * @param id
+     * @param organizeId
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "/mallUserForm")
+    public String mallUserForm(Integer id, Integer organizeId, Model model) {
+        // 用户信息
+        CmMallUser mallUserInfo = null;
+        if (null != id) {
+            mallUserInfo = cmMallUserService.getMallUserInfo(id);
+        } else {
+            mallUserInfo = new CmMallUser();
+            mallUserInfo.setOrganizeId(organizeId);
+        }
+        model.addAttribute("mallUserInfo", mallUserInfo);
+        return "modules/weisha/cmMallUserForm";
+    }
+
+    /**
+     * 保存用户信息
+     * @param cmMallUser
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "/save")
+    public String save(CmMallUser cmMallUser, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        String password = cmMallUser.getPassword();
+        String confirmPassword = cmMallUser.getConfirmPassword();
+        if (!StringUtils.equals(password, confirmPassword)) {
+            addMessage(redirectAttributes,"两次输入的密码不一致");
+            if (null != cmMallUser.getId()) {
+                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/mallUserForm?id=" + cmMallUser.getId();
+            } else {
+                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/mallUserForm";
+            }
+        }
+        // 添加操作 获取用户名是否已存在
+        if (null == cmMallUser.getId()) {
+            Integer repeat = cmMallUserDao.getRepeat(cmMallUser.getAccount());
+            if (null != repeat) {
+                model.addAttribute("用户名已存在,请勿重复添加");
+                return "redirect:" + Global.getAdminPath() + "/weisha/cmMallUser/mallUserForm";
+            }
+        }
+        // 保存用户信息
+        cmMallUserService.save(cmMallUser);
+        model.addAttribute("组织后台用户保存成功");
+        return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId="+cmMallUser.getOrganizeId();
+    }
+
+    /**
+     * 重置密码
+     * @param password
+     * @param id
+     * @param organizeId
+     * @param model
+     * @return
+     * @throws Exception
+     */
+    @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;
+        }
+        cmMallUserService.repeatPassword(password, id);
+        model.addAttribute("密码重置完成");
+        return "redirect:" + Global.getAdminPath() +"/weisha/cmMallUser/getMallUser?organizeId=" + organizeId;
+    }
+}

+ 40 - 16
src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.product.entity.ProductDetailInfo;
 import com.caimei.modules.weisha.entity.CmMallOrganize;
+import com.caimei.modules.weisha.entity.CmMallUser;
 import com.caimei.modules.weisha.entity.OrganizeProductLadderPrice;
 import com.caimei.modules.weisha.service.CmMallOrganizeService;
 import com.caimei.po.ProductLadderPrice;
@@ -44,7 +45,7 @@ public class CmOrganizeProductController extends BaseController {
 	private CmOrganizeProductService cmOrganizeProductService;
 	@Autowired
 	private CmMallOrganizeService cmMallOrganizeService;
-	
+
 	@ModelAttribute
 	public CmOrganizeProduct get(@RequestParam(required=false) String id) {
 		CmOrganizeProduct entity = null;
@@ -56,10 +57,10 @@ public class CmOrganizeProductController extends BaseController {
 		}
 		return entity;
 	}
-	
+
 	@RequestMapping(value = {"list", ""})
 	public String list(CmOrganizeProduct cmOrganizeProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmOrganizeProduct> page = cmOrganizeProductService.findPage(new Page<CmOrganizeProduct>(request, response), cmOrganizeProduct); 
+		Page<CmOrganizeProduct> page = cmOrganizeProductService.organizeProductList(new Page<CmOrganizeProduct>(request, response), cmOrganizeProduct);
 		model.addAttribute("page", page);
 		model.addAttribute("organizeId", cmOrganizeProduct.getOrganizeId());
 		CmMallOrganize cmMallOrganize = cmMallOrganizeService.get(cmOrganizeProduct.getOrganizeId().toString());
@@ -67,29 +68,52 @@ public class CmOrganizeProductController extends BaseController {
 		return "modules/weisha/cmOrganizeProductList";
 	}
 
-	@RequestMapping(value = "form")
+	/**
+	 * 修改商品上下线
+	 * @param status
+	 * @param id
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequestMapping(value = "/updateValidFlag")
+	public String updateProduct(Integer status, Integer id, Integer organizeId,Model model, RedirectAttributes redirectAttributes) {
+		if (null == status) {
+			model.addAttribute("参数不能为空");
+			return "redirect:"+ Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+		}
+		if (null == id) {
+			model.addAttribute("参数不能为空");
+			return "redirect:"+ Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+		}
+		cmOrganizeProductService.updateproduct(status, id);
+		addMessage(redirectAttributes, "商品状态修改成功");
+		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+	}
+
+	@RequestMapping(value = "/form")
 	public String form(CmOrganizeProduct cmOrganizeProduct, Model model) {
 		if (null != cmOrganizeProduct.getId()) {
-			List<OrganizeProductLadderPrice> ladderPriceList = cmOrganizeProductService.findLadderPrice(cmOrganizeProduct.getId());
-			cmOrganizeProduct.setLadderPriceList(ladderPriceList);
+			cmOrganizeProduct = cmOrganizeProductService.findLadderPrice(cmOrganizeProduct.getId());
+//			cmOrganizeProduct.setLadderPriceList(ladderPriceList);
+		} else {
+			return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeProduct/?repage&organizeId="+cmOrganizeProduct.getOrganizeId();
 		}
 		model.addAttribute("cmOrganizeProduct", cmOrganizeProduct);
+		model.addAttribute("organizeId", cmOrganizeProduct.getOrganizeId());
 		return "modules/weisha/cmOrganizeProductForm";
 	}
 
-	@RequestMapping(value = "save")
-	public String save(CmOrganizeProduct cmOrganizeProduct, Model model, RedirectAttributes redirectAttributes) {
-			if (!beanValidator(model, cmOrganizeProduct)){
-			return form(cmOrganizeProduct, model);
-		}
-		cmOrganizeProductService.save(cmOrganizeProduct);
+	@RequestMapping(value = "/save")
+	public void save(CmOrganizeProduct cmOrganizeProduct, Model model, RedirectAttributes redirectAttributes) {
+
+		cmOrganizeProductService.saveProduct(cmOrganizeProduct);
 		addMessage(redirectAttributes, "保存组织商品成功");
-		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + cmOrganizeProduct.getOrganizeId();
 	}
-	
+
 	@RequestMapping(value = "delete")
 	public String delete(CmOrganizeProduct cmOrganizeProduct, RedirectAttributes redirectAttributes) {
-		cmOrganizeProductService.delete(cmOrganizeProduct);
+		cmOrganizeProductService.deleteProduct(cmOrganizeProduct);
 		addMessage(redirectAttributes, "删除组织商品成功");
 		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + cmOrganizeProduct.getOrganizeId();
 	}
@@ -139,4 +163,4 @@ public class CmOrganizeProductController extends BaseController {
 		map.put("msg", (status == 1 ? "上架" : "下架") + "组织商品成功");
 		return map;
 	}
-}
+}

+ 24 - 7
src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java

@@ -59,7 +59,7 @@ public class CmOrganizeStoreController extends BaseController {
 		}
 		return entity;
 	}
-	
+
 	@RequestMapping(value = {"list", ""})
 	public String list(CmOrganizeStore cmOrganizeStore, HttpServletRequest request, HttpServletResponse response, Model model) {
 		if (null != cmOrganizeStore.getStartTime() && !"".equals(cmOrganizeStore.getStartTime()) && !cmOrganizeStore.getStartTime().endsWith("00:00:00")) {
@@ -70,7 +70,15 @@ public class CmOrganizeStoreController extends BaseController {
 			model.addAttribute("endTime", cmOrganizeStore.getEndTime());
 			cmOrganizeStore.setEndTime(cmOrganizeStore.getEndTime().trim() + " 23:59:59");
 		}
-		Page<CmOrganizeStore> page = cmOrganizeStoreService.findPage(new Page<CmOrganizeStore>(request, response), cmOrganizeStore); 
+		Page<CmOrganizeStore> page = cmOrganizeStoreService.findPage(new Page<CmOrganizeStore>(request, response), cmOrganizeStore);
+		List<Integer> organizeUser = cmOrganizeStoreDao.getOrganizeUser(cmOrganizeStore.getOrganizeId());
+		page.getList().forEach(p -> {
+			if (organizeUser.contains(p.getUserId())) {
+				p.setIsWx(1);
+			} else {
+				p.setIsWx(0);
+			}
+		});
 		model.addAttribute("page", page);
 		String organizeName = cmOrganizeStoreDao.findOrganizeNameById(cmOrganizeStore.getOrganizeId());
 		model.addAttribute("organizeName", organizeName);
@@ -79,8 +87,10 @@ public class CmOrganizeStoreController extends BaseController {
 
 	@RequestMapping(value = "form")
 	public String form(CmOrganizeStore cmOrganizeStore, Model model) {
-		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
-		Integer provinceId = cmOrganizeStore.getProvinceId();
+//		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
+		CmOrganizeStore clubInfo = cmOrganizeStoreService.gtClubInfo(cmOrganizeStore);
+		model.addAttribute("clubInfo", clubInfo);
+		/*Integer provinceId = cmOrganizeStore.getProvinceId();
 		Integer townId = cmOrganizeStore.getTownId();
 		Integer cityId = cmOrganizeStore.getCityId();
 		//控制编辑异常时候的会显地址下拉框
@@ -95,10 +105,17 @@ public class CmOrganizeStoreController extends BaseController {
 		if (null != townId && townId > 0) {
 			Town town = areaDao.loadTownByID(townId);
 			cmOrganizeStore.setTownName(town.getName());
-		}
+		}*/
 		return "modules/weisha/cmOrganizeStoreForm";
 	}
 
+	@RequestMapping(value = "/cleanWx")
+	public String cleanWx(CmOrganizeStore cmOrganizeStore) {
+		// 解绑微信 设置删除
+		cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
+		return "redirect"+Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
+	}
+
 	@RequestMapping(value = "save")
 	public String save(CmOrganizeStore cmOrganizeStore, Model model, RedirectAttributes redirectAttributes) {
 		if (!beanValidator(model, cmOrganizeStore)){
@@ -121,7 +138,7 @@ public class CmOrganizeStoreController extends BaseController {
 		cmOrganizeStoreService.save(cmOrganizeStore);
 		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeStore/?repage&organizeId=" + cmOrganizeStore.getOrganizeId();
 	}
-	
+
 	@RequestMapping(value = "delete")
 	public String delete(CmOrganizeStore cmOrganizeStore, RedirectAttributes redirectAttributes) {
 		cmOrganizeStoreService.delete(cmOrganizeStore);
@@ -129,4 +146,4 @@ public class CmOrganizeStoreController extends BaseController {
 		return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeStore/?repage";
 	}
 
-}
+}

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

@@ -1,7 +1,7 @@
 <?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">
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallOrganizeDao">
-    
+
 	<sql id="cmMallOrganizeColumns">
 		a.id AS "id",
 		a.organizeName AS "organizeName",
@@ -18,25 +18,25 @@
 		a.addTime AS "addTime",
 		a.delFlag AS "delFlag"
 	</sql>
-	
+
 	<sql id="cmMallOrganizeJoins">
 	</sql>
-    
+
 	<select id="get" resultType="CmMallOrganize">
-		SELECT 
+		SELECT
 			<include refid="cmMallOrganizeColumns"/>
 		FROM cm_mall_organize a
 		<include refid="cmMallOrganizeJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmMallOrganize">
-		SELECT 
+		SELECT
 			<include refid="cmMallOrganizeColumns"/>
 		FROM cm_mall_organize a
 		<include refid="cmMallOrganizeJoins"/>
 		<where>
-			id > 2
+			id > 0
 			<if test="organizeName != null and organizeName != ''">
 				AND a.organizeName = #{organizeName}
 			</if>
@@ -59,15 +59,15 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmMallOrganize">
-		SELECT 
+		SELECT
 			<include refid="cmMallOrganizeColumns"/>
 		FROM cm_mall_organize a
 		<include refid="cmMallOrganizeJoins"/>
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -76,7 +76,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="CmMallOrganize"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_mall_organize(
 			organizeName,
@@ -108,9 +108,9 @@
 			0
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_mall_organize SET 	
+		UPDATE cm_mall_organize SET
 			organizeName = #{organizeName},
 			organizeLinkName = #{organizeLinkName},
 			mobile = #{mobile},
@@ -141,5 +141,5 @@
 			AND a.id != #{id}
 		</if>
 	</select>
-	
-</mapper>
+
+</mapper>

+ 80 - 0
src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml

@@ -0,0 +1,80 @@
+<?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">
+<mapper namespace="com.caimei.modules.weisha.dao.CmMallUserDao">
+
+    <select id="get" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+        select * from cm_mall_organize where id = #{id}
+    </select>
+    <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
+        SELECT
+        id,
+        organizeID,
+        status,
+        account,
+        accountName,
+        addTime,
+        updateTime
+        FROM cm_mall_admin_user
+        <where>
+            organizeID = #{organizeId} and delFlag = 0
+            <if test="account != null and account != ''">
+                and account like concat('%',#{account},'%')
+            </if>
+            <if test="accountName != null and accountName !=''">
+                and accountName like concat('%',#{accountName},'%')
+            </if>
+            <if test="status != null and status != ''">
+                and status = #{status}
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and addTime <![CDATA[ >= ]]> #{startTime} and addTime <![CDATA[ <= ]]> #{endTime}
+            </if>
+        </where>
+    </select>
+    <update id="updateproduct">
+        update cm_mall_admin_user
+        set status = #{validFlag}
+        where id = #{id}
+    </update>
+    <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
+        SELECT
+            id,
+            organizeID,
+            account,
+            accountName,
+            password,
+            salt,
+            addTime,
+            updateTime
+        FROM cm_mall_admin_user
+        where id = #{id}
+    </select>
+    <select id="getRepeat" resultType="java.lang.Integer">
+        select id from cm_mall_admin_user where account like concat('%',#{account},'%') limit 1
+    </select>
+    <insert id="insertMallUser">
+        INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, ADDTIME, updateTime, delFlag)
+        VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{addTime}, #{updateTime}, #{delFlag})
+    </insert>
+    <update id="updateMallUser">
+        update cm_mall_admin_user
+        <set>
+            <if test="account != null and account != ''">
+                account = #{account},
+            </if>
+            <if test="accountName != null and accountName != ''">
+                accountName = #{accountName},
+            </if>
+            <if test="password != null and password != ''">
+                password = #{password},
+            </if>
+            <if test="organizeId != null and organizeId != ''">
+                organizeID = #{organizeId},
+            </if>
+            <if test="updateTime != null and updateTime != ''">
+                updateTime = #{updateTime}
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+</mapper>

+ 204 - 19
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -1,7 +1,7 @@
 <?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">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeProductDao">
-    
+
 	<sql id="cmOrganizeProductColumns">
 		a.id AS "id",
 		a.organizeId AS "organizeId",
@@ -21,25 +21,25 @@
 		a.delFlag AS "delFlag",
 		p.name AS "productName",
 		p.mainImage AS "productImage",
-		p.unit,
+# 		p.unit,
 		s.name AS "shopName"
 	</sql>
-	
+
 	<sql id="cmOrganizeProductJoins">
 		left join product p on a.productId = p.productID
 		left join shop s on p.shopID = s.shopID
 	</sql>
-    
+
 	<select id="get" resultType="CmOrganizeProduct">
-		SELECT 
+		SELECT
 			<include refid="cmOrganizeProductColumns"/>
 		FROM cm_organize_product a
 		<include refid="cmOrganizeProductJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmOrganizeProduct">
-		SELECT 
+		SELECT
 			<include refid="cmOrganizeProductColumns"/>
 		FROM cm_organize_product a
 		<include refid="cmOrganizeProductJoins"/>
@@ -70,15 +70,15 @@
 		</where>
 		order by a.addTime desc
 	</select>
-	
+
 	<select id="findAllList" resultType="CmOrganizeProduct">
-		SELECT 
+		SELECT
 			<include refid="cmOrganizeProductColumns"/>
 		FROM cm_organize_product a
 		<include refid="cmOrganizeProductJoins"/>
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -87,11 +87,85 @@
 			</otherwise>
 		</choose>
 	</select>
+	<select id="getOrganizeProductList" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+		SELECT
+			cmop.id,
+			cmop.productID,
+			p.name as productName,
+			p.mainImage as productImage,
+			s.name as shopName,
+			cmop.validFlag as status,
+			p.includedTax,
+			p.invoiceType,
+			cmop.addTime
+		FROM cm_mall_organize_products cmop
+				 LEFT JOIN product p ON p.productId = cmop.productId
+				 LEFT JOIN shop s ON s.shopID = p.shopID
+		<where>
+			cmop.delFlag = 0
+			<if test="productId != null and productId != ''">
+				AND cmop.productId = #{productId}
+			</if>
+			<if test="productName != null and productName != ''">
+				and p.name like concat('%',#{productName},'%')
+			</if>
+			<if test="shopName != null and shopName != ''">
+				and s.name like concat('%',#{shopName},'%')
+			</if>
+			<if test="includedTax != null">
+				AND p.includedTax = #{includedTax}
+			</if>
+			<if test="status != null and status != ''">
+				AND cmop.validFlag = #{status}
+			</if>
+			<if test="invoiceType != null">
+				AND p.invoiceType = #{invoiceType}
+			</if>
+			<if test="organizeId != null">
+				AND cmop.organizeID = #{organizeId}
+			</if>
+		</where>
+		order by cmop.addTime desc
+	</select>
+	<select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
+		SELECT
+		    cmps.id,
+			cmps.productId,
+			cmps.id,
+			cmps.skuId,
+			cmps.minBuyNumber,
+			cmps.price,
+			cs.unit,
+			cs.price as clubPrice,
+			cs.costCheckFlag as costCheckFlag,
+			cs.costPrice as costPrice,
+			cs.costProportional as costProportional,
+			cs.minBuyNumber AS cmMinBuyNumber,
+		   cmps.organizePercent,
+		   cmps.shopPercent,
+		   cmps.cmPercent
+		FROM cm_mall_product_sku cmps
+				 LEFT JOIN cm_sku cs ON cmps.skuId = cs.skuId
+		<where>
+			<if test="productIds.size() > 0">
+				cmps.productId in
+				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
+					#{productId}
+				</foreach>
+			</if>
+		</where>
+	</select>
+	<update id="updateproduct">
+		update cm_mall_organize_products
+		set validFlag = #{validFlag}
+		where id = #{id}
+	</update>
 	<select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
-		select p.productID, p.mainImage, p.name, p.price, s.name as shopName, IF(cop.productId is not null, 0, 1) as validFlag
+		select p.productID, p.mainImage, p.name,
+		       s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag
 		from product p
-				 left join cm_organize_product cop on p.productID = cop.productId and cop.organizeId = #{organizeId} and cop.delFlag = 0
-				 left join shop s on p.shopID = s.shopID
+			 left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
+			 left join shop s on p.shopID = s.shopID
 		<where>
 		 	p.productCategory = 1
 			<if test="productID != null">
@@ -106,8 +180,10 @@
 		</where>
 	</select>
 	<select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		select productID as productId, ladderPriceFlag,price as price,ifnull(includedTax,2) as includedTax,invoiceType,taxPoint as clubTaxPoint,supplierTaxPoint as shopTaxPoint,minBuyNumber,costCheckFlag as costType,
-		       costPrice,costProportional
+		select productID as productId, # ladderPriceFlag, price as price,
+		 	   ifnull(includedTax,2) as includedTax,invoiceType,taxPoint as clubTaxPoint,supplierTaxPoint as shopTaxPoint # minBuyNumber,
+		       # costCheckFlag as costType,
+		       # costPrice,costProportional
 		from product
 		where productID = #{productId}
 	</select>
@@ -118,7 +194,116 @@
 			resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
 		select ladderNum,buyNum,buyPrice from product_ladder_price where productId = #{productId}
 	</select>
-
+	<select id="getOrganizeInfo" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+		select a.id AS "id",
+			   a.organizeName AS "organizeName",
+			   a.organizeLinkName AS "organizeLinkName",
+			   a.mobile AS "mobile",
+			   a.status AS "status",
+			   a.contactNumber AS "contactNumber",
+			   a.systemName AS "systemName",
+			   a.systemImage AS "systemImage",
+			   a.introduction AS "introduction",
+			   a.afterSale AS "afterSale",
+			   a.shoppingNotes AS "shoppingNotes",
+			   a.updateTime AS "updateTime",
+			   a.addTime AS "addTime",
+			   a.delFlag AS "delFlag"
+			   from cm_mall_organize a
+			where a.id = #{id}
+	</select>
+	<select id="getShopInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+		SELECT
+			p.productId,
+			p.name AS productName,
+			s.name AS shopName
+		FROM product p
+		LEFT JOIN shop s ON p.shopId = s.shopId
+		<where>
+			<if test="productIds.size()>0">
+				productId in
+				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
+					#{productId}
+				</foreach>
+			</if>
+		</where>
+	</select>
+	<select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
+		SELECT
+			skuId,
+			productId,
+			normalPrice,
+			price,
+			costPrice,
+			ladderPriceFlag,
+			minBuyNumber
+		FROM cm_sku
+		where productId = #{productId}
+		order by normalPrice
+	</select>
+	<insert id="insertMallProduct" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO  cm_mall_organize_products (organizeID, productID, normalPrice, costPrice, ladderPriceFlag, retailPrice, minBuyNumber, validFlag, ADDTIME, updateTime, delFlag)
+		VALUES(#{organizeId}, #{productId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{retailPrice}, #{minBuyNumber}, #{status},#{addTime}, #{updateTime}, #{delFlag})
+	</insert>
+	<insert id="insertMallSku">
+		INSERT INTO cm_mall_product_sku(skuId, productId, mallProductId, minBuyNumber, price)
+		VALUES (#{skuId}, #{productId}, #{mallProductId}, #{minBuyNumber}, #{price})
+	</insert>
+	<update id="updateMallProduct">
+		update cm_mall_organize_products
+		<set>
+			<if test="retailPrice != null and retailPrice != ''">
+				retailPrice = #{retailPrice},
+			</if>
+			<if test="minBuyNumber != null and minBuyNumber != ''">
+				minBuyNumber = #{minBuyNumber}
+			</if>
+		</set>
+		where id =#{id}
+	</update>
+	<update id="updateMallProductSku">
+		update cm_mall_product_sku
+		<set>
+			<if test="price != null and price != ''">
+				price = #{price},
+			</if>
+			<if test="minBuyNumber != null and minBuyNumber != ''">
+				minBuyNumber = #{minBuyNumber},
+			</if>
+			<if test="organizePercent != null and organizePercent != ''">
+				organizePercent = #{organizePercent},
+			</if>
+			<if test="shopPercent != null and shopPercent != ''">
+				shopPercent = #{shopPercent},
+			</if>
+			<if test="cmPercent != null and cmPercent != ''">
+				cmPercent = #{cmPercent}
+			</if>
+		</set>
+		where id =#{id}
+	</update>
+	<select id="getProductInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+		SELECT cmop.id,
+		       cmop.organizeID AS organizeId,
+			   p.productID AS productId,
+			   p.mainImage AS productImage,
+			   p.name AS productName,
+			   s.name AS shopName,
+			   IF(cmop.productId IS NOT NULL, 0, 1) AS validFlag,
+			   p.includedTax,
+			   p.invoiceType,
+			   p.taxPoint,
+			   p.supplierTaxPoint
+		FROM product p
+				 LEFT JOIN cm_mall_organize_products cmop ON p.productID = cmop.productId
+				 LEFT JOIN shop s ON p.shopID = s.shopID
+		WHERE p.productCategory = 1  AND cmop.id = #{id}
+	</select>
+	<update id="deleteProduct">
+		update cm_mall_organize_products
+		set delFlag = 1
+		where id = #{id}
+	</update>
 	<insert id="insert" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_organize_product(
 			organizeId,
@@ -158,7 +343,7 @@
 	</insert>
 
 	<update id="update">
-		UPDATE cm_organize_product SET 	
+		UPDATE cm_organize_product SET
 			ladderPriceFlag = #{ladderPriceFlag},
 			price = #{price},
 			includedTax = #{includedTax},
@@ -196,4 +381,4 @@
 		delete from organize_product_ladder_price where id = #{ladderId}
 	</delete>
 
-</mapper>
+</mapper>

+ 113 - 20
src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml

@@ -1,7 +1,7 @@
 <?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">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeStoreDao">
-    
+
 	<sql id="cmOrganizeStoreColumns">
 		a.id AS "id",
 		a.organizeId AS "organizeId",
@@ -15,39 +15,60 @@
 		a.status AS "status",
 		a.addTime AS "addTime"
 	</sql>
-	
+	<sql id="cmOrganizeUserinfo">
+		u.userID AS userID,
+		c.clubID as clubID,
+		u.userOrganizeID AS organizeId,
+		c.name AS NAME,
+		c.linkMan AS linkMan,
+		c.contractMobile AS mobile,
+		c.provinceId AS provinceId,
+		c.cityId AS cityId,
+		c.townId AS townId,
+		c.address AS address,
+		c.status AS STATUS,
+		c.addTime AS ADDTIME
+	</sql>
+	<sql id="addressName">
+		p.name AS provinceName,
+		ct.name AS cityName,
+		t.name AS townName
+	</sql>
+
 	<sql id="cmOrganizeStoreJoins">
+		LEFT JOIN province p ON c.provinceId = p.provinceID
+		LEFT JOIN city ct ON c.cityId = ct.cityID
+		LEFT JOIN town t ON c.townId = t.townID
 	</sql>
-    
+
 	<select id="get" resultType="CmOrganizeStore">
-		SELECT 
+		SELECT
 			<include refid="cmOrganizeStoreColumns"/>
 		FROM cm_organize_store a
 		<include refid="cmOrganizeStoreJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
-	<select id="findList" resultType="CmOrganizeStore">
-		SELECT 
+
+	<!--<select id="findList" resultType="CmOrganizeStore">
+		SELECT
 			<include refid="cmOrganizeStoreColumns"/>
 		FROM cm_organize_store a
 		<include refid="cmOrganizeStoreJoins"/>
 		<where>
-			
 			<if test="name != null and name != ''">
-				AND a.name LIKE 
+				AND a.name LIKE
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
 			</if>
 			<if test="linkMan != null and linkMan != ''">
-				AND a.linkMan LIKE 
+				AND a.linkMan LIKE
 					<if test="dbName == 'oracle'">'%'||#{linkMan}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{linkMan}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{linkMan},'%')</if>
 			</if>
 			<if test="mobile != null and mobile != ''">
-				AND a.mobile LIKE 
+				AND a.mobile LIKE
 					<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
@@ -73,16 +94,88 @@
 				order by a.addTime desc
 			</otherwise>
 		</choose>
+	</select>-->
+	<select id="findList" resultType="CmOrganizeStore">
+		SELECT
+		<include refid="cmOrganizeUserinfo"/>,
+		<include refid="addressName"/>
+		FROM USER u
+		LEFT JOIN club c ON c.userId = u.userId
+		<include refid="cmOrganizeStoreJoins"/>
+		<where>
+			<if test="name != null and name != ''">
+				AND c.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="linkMan != null and linkMan != ''">
+				AND c.linkMan LIKE
+				<if test="dbName == 'oracle'">'%'||#{linkMan}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{linkMan}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{linkMan},'%')</if>
+			</if>
+			<if test="mobile != null and mobile != ''">
+				AND c.contractMobile LIKE
+				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
+			</if>
+			<if test="status != null and status != ''">
+				AND c.status = #{status}
+			</if>
+			<if test="startTime != null and startTime != ''">
+				AND c.addTime >= #{startTime}
+			</if>
+			<if test="endTime != null and endTime != ''">
+				AND c.addTime <![CDATA[   <=  ]]> #{endTime}
+			</if>
+			<if test="organizeId != null">
+				and u.userOrganizeID = #{organizeId}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				order by c.addTime desc
+			</otherwise>
+		</choose>
+	</select>
+	<select id="getOrganizeUser" resultType="java.lang.Integer">
+		SELECT DISTINCT userID FROM  cm_mall_operation_user WHERE userOrganizeID = #{organizeId} AND delFlag = 0
+	</select>
+
+	<update id="cleanWx">
+		update cm_mall_operation_user
+		set delFlag = 1
+		where userId = #{userId}
+	</update>
+	<select id="getclubInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
+		select
+		c.clubId,
+		c.name,
+		c.linkMan,
+		c.contractMobile as mobile,
+		c.address,
+		c.medicalPracticeLicenseImg,
+		c.socialCreditCode,
+		c.headpic,
+		c.businessLicenseImage,
+		<include refid="addressName"/>
+		from club c
+		<include refid="cmOrganizeStoreJoins"/>
+		where clubID = #{clubId}
 	</select>
-	
 	<select id="findAllList" resultType="CmOrganizeStore">
-		SELECT 
+		SELECT
 			<include refid="cmOrganizeStoreColumns"/>
 		FROM cm_organize_store a
 		<include refid="cmOrganizeStoreJoins"/>
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -130,9 +223,9 @@
 			#{addTime}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_organize_store SET 	
+		UPDATE cm_organize_store SET
 			organizeId = #{organizeId},
 			name = #{name},
 			linkMan = #{linkMan},
@@ -144,10 +237,10 @@
 			status = #{status}
 		WHERE id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		DELETE FROM cm_organize_store
 		WHERE id = #{id}
 	</delete>
-	
-</mapper>
+
+</mapper>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/userNew/cmAgencyList.jsp

@@ -62,7 +62,7 @@
     <div class="flex-wrap">
         <div class="item">
             <label>机构ID:</label>
-            <form:input path="clubID"  htmlEscape="false" maxlength="50" class="input-medium"/>
+            <form:input path="clubID" type="text" onkeyup="this.value=value.replace(/[^\d]/g,'')" htmlEscape="false" maxlength="50" class="input-medium"/>
         </div>
         <div class="item">
             <label>机构名称:</label>

+ 120 - 0
src/main/webapp/WEB-INF/views/modules/weisha/CmMallUserList.jsp

@@ -0,0 +1,120 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>组织后台用户</title>
+    <meta name="decorator" content="default"/>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
+    <li class="active"><a href="${ctx}/weisha/cmMallUser/getMallUser?organizeId=${cmMallOrganize.id}">后台用户</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmMallUser" action="${ctx}/weisha/cmMallUser/getMallUser" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <input id="organizeId" name="organizeId" type="hidden" value="${cmMallOrganize.id}"/>
+    <div class="ul-form">
+        <label>姓名:</label>
+        <form:input path="account" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>手机号:</label>
+        <form:input path="accountName" htmlEscape="false" maxlength="11" class="input-medium" onchange="onlynum(this)"/>
+        <label>状态:</label>
+        <form:select path="status" class="input-medium">
+            <form:option value="" label="请选择"/>
+            <form:option value="1" label="已上线"/>
+            <form:option value="2" label="已下线"/>
+        </form:select>
+        <label>添加时间:</label>
+        <input name="startTime" type="text" maxlength="20" class="input-mini Wdate"
+               value="<fmt:formatDate value="${cmOrganizeBuyer.startTime}" pattern="yyyy-MM-dd"/>"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> 至
+        <input name="endTime" type="text" maxlength="20" class="input-mini Wdate"
+               value="<fmt:formatDate value="${cmOrganizeBuyer.endTime}" pattern="yyyy-MM-dd"/>"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+
+        &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        &nbsp;&nbsp;<input class="btn btn-primary" style="width: 80px" onclick="window.location='${ctx}/weisha/cmMallUser/mallUserForm?organizeId=${cmMallOrganize.id}'" value="添加"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<font color="blue">当前组织:${cmMallOrganize.organizeName}</font>
+<table class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr>
+        <th>姓名</th>
+        <th>手机号(登录账号)</th>
+        <th>状态</th>
+        <th>添加时间</th>
+        <th>操作</th>
+    </tr>
+    </thead>
+    <c:forEach items="${page.list}" var="page">
+        <tbody>
+        <tr>
+            <td>${page.account eq null ? "" : page.account}</td>
+            <td>${page.accountName eq null ? "" : page.accountName}</td>
+            <td>
+                <c:if test="${page.status eq 1}">
+                    <font color="green">已上线</font>&nbsp;&nbsp;
+                    <a href="${ctx}/weisha/cmMallUser/updateValidFlag?status=2&id=${page.id}&organizeId=${cmMallOrganize.id}" onclick="return confirmx('确定下线该用户吗?',this.href)">下线</a>
+                </c:if>
+                <c:if test="${page.status eq 2}">
+                    <font color="red">已下线</font>&nbsp;&nbsp;
+                    <a href="${ctx}/weisha/cmMallUser/updateValidFlag?status=1&id=${page.id}&organizeId=${cmMallOrganize.id}" onclick="return confirmx('确定上线该用户吗?',this.href)">上线</a>
+                </c:if>
+            </td>
+            <td><fmt:formatDate value="${page.addTime}" pattern="yyyy-MM-dd HH:dd:ss"></fmt:formatDate></td>
+            <td>
+                <a href="${ctx}/weisha/cmMallUser/mallUserForm?id=${page.id}&organizeId=${cmMallOrganize.id}">编辑</a>
+                <a href="javascript: void(0)" onclick="updatePwd(${page.id})">重置密码</a>
+            </td>
+        </tr>
+        </tbody>
+    </c:forEach>
+</table>
+<div class="pagination">${page}</div>
+
+<c:if test="${empty page.list}"><p style="text-align: center;"><font  color="#1e90ff">暂无数据……</font></p></c:if>
+    <script>
+        function page(n,s){
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        // 修改密码
+        function updatePwd(id) {
+            var organizeId = $("#organizeId").val();
+            var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
+            var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
+                "<input type='password' id='newPwd' name='newPwd' placeholder='请输入8-16位字母数字组合' rows='1' cols='12'/>" +
+                "</br><font color='red'>*</font>确认密码:" +
+                "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
+            var submit = function (v, h, f) {
+                // 密码
+                if (!regPwd.test(f.newPwd)) {
+                    $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
+                    return false;
+                }
+                if (f.newPwd !== f.surePwd) {
+                    $.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
+                    return false;
+                }
+                $.post("${ctx}/weisha/cmMallUser/repeatPassword", {'password': f.newPwd, 'id': id, 'organizeId': organizeId}, function (data) {
+                    if (true == data.success) {
+                        $.jBox.tip(data.msg, 'info');
+                        $("#searchForm").submit();
+                    } else {
+                        $.jBox.tip(data.msg, 'error');
+                    }
+                }, "JSON");//这里返回的类型有:json,html,xml,text
+            };
+            $.jBox(html, {title: "确定修改密码?", submit: submit});
+        }
+    </script>
+</body>
+</html>
+

+ 5 - 4
src/main/webapp/WEB-INF/views/modules/weisha/cmMallOrganizeList.jsp

@@ -116,10 +116,11 @@
 				</td>
 					<td>
 						<a href="${ctx}/weisha/cmMallOrganize/form?id=${cmUserOrganize.id}">编辑</a>
-						<a href="${ctx}/weisha/cmOrganizeBuyer?organizeId=${cmUserOrganize.id}">采购员</a>
-						<a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmUserOrganize.id}">门店列表</a>
+<%--						<a href="${ctx}/weisha/cmOrganizeBuyer?organizeId=${cmUserOrganize.id}">采购员</a>--%>
+						<a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmUserOrganize.id}">机构列表</a>
 						<a href="${ctx}/weisha/cmOrganizeProduct/list?organizeId=${cmUserOrganize.id}">商品列表</a>
-						<a href="${ctx}/weisha/cmOrganizePromotions/list?organizeId=${cmUserOrganize.id}&type=1">促销活动</a>
+						<a href="${ctx}/weisha/cmMallUser/getMallUser?organizeId=${cmUserOrganize.id}">后台用户</a>
+<%--						<a href="${ctx}/weisha/cmOrganizePromotions/list?organizeId=${cmUserOrganize.id}&type=1">促销活动</a>--%>
 					</td>
 			</tr>
 		</c:forEach>
@@ -169,4 +170,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 107 - 0
src/main/webapp/WEB-INF/views/modules/weisha/cmMallUserForm.jsp

@@ -0,0 +1,107 @@
+<%@ 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>
+        .control-group{
+            width: 100%;
+            height: 60px;
+            border-bottom: none;
+            box-sizing: border-box;
+            padding: 10px 0;
+        }
+        .control-label{
+            width: 100px;
+            text-align: right;
+            float: left;
+            line-height: 40px;
+            margin-right: 5px;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/weisha/cmMallOrganize">组织列表</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>
+</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}" />
+    <div class="ul-form">
+        <div class="control-group">
+            <label class="control-label">姓名:</label>
+            <div class="controls">
+                <form:input path="account" class="input-xlarge required" maxlength="11" />
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label">手机号:</label>
+            <div class="controls">
+                    <form:input path="accountName" class="input-xlarge required" maxlength="11" />
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label">状态:</label>
+            <div class="controls">
+                <form:select path="status">
+                    <form:option value="1" label="上线" />
+                    <form:option value="2" label="下线" />
+                </form:select>
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label">密码:</label>
+            <div class="controls">
+                <form:input path="password" type="password" id="password" class="input-xlarge required" maxlength="16" />
+            </div>
+        </div>
+        <div class="control-group">
+            <label class="control-label">确认密码:</label>
+            <div class="controls">
+                <form:input path="confirmPassword" type="password" id="confirmPassword" class="input-xlarge required" maxlength="16" />
+            </div>
+        </div>
+        <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)"/>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<script  type="text/javascript">
+    function userSubmit() {
+        var form = $("#searchForm");
+        var account = $("#account").val();
+        var password = $("#password").val();
+        var confirmPassword = $("#confirmPassword").val();
+        var accountName = $("#accountName").val();
+        debugger
+        if (null == account || "" == account) {
+            top.$.jBox.confirm("请输入姓名",'提示');
+            return;
+        }
+        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;
+            }
+        } else {
+            top.$.jBox.confirm("请输入正确格式的密码",'提示');
+            return;
+        }
+        if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
+            top.$.jBox.confirm("请输入正确的手机号",'提示');
+            return;
+        }
+        // debugger
+        if (password !== confirmPassword) {
+            top.$.jBox.confirm("两次密码不一致",'提示');
+            return;
+        }
+        form.submit();
+    }
+</script>
+</body>
+</html>

+ 152 - 105
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductForm.jsp

@@ -5,101 +5,7 @@
 	<title>组织商品管理</title>
 	<meta name="decorator" content="default"/>
 	<script type="text/javascript">
-		$(document).ready(function() {
-			//$("#name").focus();
-			$("#inputForm").validate({
-				submitHandler: function(form){
-					var costType = $("input[name='costType']:checked").val();
-					if(costType*1===1){
-						if ($("#costPrice").val() == '') {
-							alertx("请输入成本价");
-							return false;
-						};
-					}else{
-						if ($("#costProportional").val() == '') {
-							alertx("请输入成本比例");
-							return false;
-						};
-					}
-					if ($('#minBuyNumber:visible').length>0){
-						var minBuyNumber = $('#minBuyNumber').val();
-						if(minBuyNumber<=0 || minBuyNumber == ''){
-							alertx("请输入起订量");
-							return false;
-						}
-					}
-					if ($('input[name="ladderPriceList[0].buyNum"]:visible').length>0){
-						var buyNum = $('input[name="ladderPriceList[0].buyNum"]').val();
-						var buyPrice = $('input[name="ladderPriceList[0].buyPrice"]').val();
-						if(buyNum<=0 || buyNum == '' || buyPrice<=0 || buyPrice == ''){
-							alertx("请输入正确的阶梯价格");
-							return false;
-						}
-					}
-					if ($('input[name="ladderPriceList[1].buyNum"]:visible').length>0){
-						var buyNum1 = $('input[name="ladderPriceList[1].buyNum"]').val();
-						var buyPrice1 = $('input[name="ladderPriceList[1].buyPrice"]').val();
-						if(buyNum1<=0 || buyNum1 == '' || buyPrice1<=0 || buyPrice1 == ''){
-							alertx("请输入正确的阶梯价格");
-							return false;
-						}
-					}
-					if ($('input[name="ladderPriceList[2].buyNum"]:visible').length>0){
-						var buyNum2 = $('input[name="ladderPriceList[2].buyNum"]').val();
-						var buyPrice2 = $('input[name="ladderPriceList[2].buyPrice"]').val();
-						if(buyNum2<=0 || buyNum2 == '' || buyPrice2<=0 || buyPrice2 == ''){
-							alertx("请输入正确的阶梯价格");
-							return false;
-						}
-					}
-					var includedTax = $("input[name='includedTax']:checked").val();
-					if(includedTax == '' || includedTax == null){
-						alertx("请选择是否含税");
-						return false;
-					}
-					var invoiceType = $("input[name='invoiceType']:checked").val();
-					if ((includedTax == 0 || includedTax == 1) && (invoiceType == 1 || invoiceType == 2)) {
-						var clubTaxPoint = $("#clubTaxPoint").val();
-						var shopTaxPoint = $("#shopTaxPoint").val();
-						if (clubTaxPoint == '' || clubTaxPoint == null) {
-							alertx("请输入机构税率");
-							return false;
-						}
-						if (shopTaxPoint == '' || shopTaxPoint == null) {
-							alertx("请输入供应商税率");
-							return false;
-						}
-					}
-					if (includedTax != ${cmOrganizeProduct.includedTax} || invoiceType != ${cmOrganizeProduct.invoiceType}) {
-						top.$.jBox.confirm("目前含税信息为:${cmOrganizeProduct.includedTax eq 0?'不含税':cmOrganizeProduct.includedTax eq 1?'含税':'未知'}${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'-开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'-开增值税普通发票':'不开发票'},确定修改为:" + (includedTax == 0 ? '不含税' : includedTax == 1 ? '含税' : '未知') + (includedTax == 2 ? '' : invoiceType == 1 ? '-开增值税专用发票' : invoiceType == 2 ? '-开增值税普通发票' : '-不能开票') + "吗?", '保存商品提示', function (v, h, f) {
-							if (v == 'ok') {
-								// 提交订单
-								loading('正在提交,请稍等...');
-								form.submit();
-							}
-						}, {
-							buttonsFocus: 1, closed: function () {
-								if (typeof closed == 'function') {
-									closed();
-								}
-							}
-						});
-					} else {
-						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);
-					}
-				}
-			});
-		});
+
 	</script>
 	<style>
 		.line{margin:0 15px;}
@@ -107,18 +13,103 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${cmOrganizeProduct.organizeId}">商品列表</a></li>
-		<li class="active"><a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}">商品编辑</a></li>
+		<li><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}">商品列表</a></li>
+		<li class="active"><a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}">商品编辑</a></li>
 	</ul><br/>
 	<form:form id="inputForm" modelAttribute="cmOrganizeProduct" action="${ctx}/weisha/cmOrganizeProduct/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<form:hidden path="organizeId"/>
+		<form:hidden path="id" id="id"/>
+		<form:hidden path="organizeId" id="organizeId"/>
+		<form:hidden path="productId" id="productId"/>
+		<form:hidden path="productName"/>
+		<form:hidden path="productImage"/>
+		<form:hidden path="shopName"/>
+		<form:hidden path="includedTax"/>
+		<form:hidden path="invoiceType"/>
+		<form:hidden path="taxPoint"/>
+		<form:hidden path="supplierTaxPoint"/>
 		<sys:message content="${message}"/>
+		<div class="control-group">
+			<label class="control-label">商品Id:</label>
+			<div class="controls">${cmOrganizeProduct.productId}</div>
+		</div>
 		<div class="control-group">
 			<label class="control-label">商品名称:</label>
 			<div class="controls">${cmOrganizeProduct.productName}</div>
 		</div>
 		<div class="control-group">
+			<label class="control-label">商品图片:</label>
+			<div class="controls"><img src="${cmOrganizeProduct.productImage}" width="50px" height="50px"></div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">供应商:</label>
+			<div class="controls">${cmOrganizeProduct.shopName}</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">是否含税:</label>
+			<div class="controls">
+					${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
+					${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
+
+			</div>
+		</div>
+		<div class="control-group" id="clubTaxPointDiv">
+			<label class="control-label">机构税率:</label>
+			<div class="controls">${cmOrganizeProduct.taxPoint}%</div>
+		</div>
+		<div class="control-group" id="shopTaxPointDiv">
+			<label class="control-label">供应商税率:</label>
+			<div class="controls">${cmOrganizeProduct.supplierTaxPoint}%</div>
+		</div>
+		<div class="control-group" id="shopTaxPointDiv">
+			<table class="table table-striped table-bordered table-condensed">
+				<thead>
+					<tr>
+						<th>商品规格</th>
+						<th>起订量</th>
+						<th>机构价</th>
+						<th>成本类型</th>
+						<th>成本价 / 比例成本</th>
+						<th>小程序价格</th>
+						<th>采美佣金</th>
+						<th>付组织</th>
+						<th>付供应商</th>
+					</tr>
+				</thead>
+				<tbody>
+					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
+						<tr class="tr_skus" data-skuId="${sku.id}">
+							<td>${sku.unit eq null?"未知":sku.unit}</td>
+							<td>
+								<input class="sku_minNum" value="${sku.minBuyNumber}" />
+							</td>
+							<td>${sku.clubPrice eq null?"":sku.clubPrice}</td>
+							<td>${sku.costCheckFlag == 1?"固定成本":sku.costCheckFlag == 2?"比例成本":""}</td>
+							<td>
+								<c:if test="${sku.costCheckFlag == 1}">
+									¥&nbsp;&nbsp;${sku.costPrice}
+								</c:if>
+								<c:if test="${sku.costCheckFlag == 2}">
+									${sku.costProportional}%
+								</c:if>
+							</td>
+							<td>
+								<input class="sku_price" value="${sku.price}" />
+							</td>
+							<td>
+								<input class="sku_cmPecrcent" value="${sku.cmPercent}" />%
+							</td>
+							<td>
+								<input class="sku_organizePercent" value="${sku.organizePercent}" />%
+							</td>
+							<td>
+								<input class="sku_shopPercent" value="${sku.shopPercent}" />%
+							</td>
+						</tr>
+					</c:forEach>
+				</tbody>
+			</table>
+		</div>
+		<%--<div class="control-group">
 			<label class="control-label">商品展示价格:</label>
 			<div class="controls">
 				<form:radiobutton path="ladderPriceFlag" value="0" label="不使用阶梯价格" onclick="changeLadderPrice()" class="required" /><b class="line">|</b>
@@ -215,16 +206,18 @@
 			<div class="controls">
 				<form:input path="costProportional" htmlEscape="false"  maxlength="11" class="short  number" /> %
 			</div>
-		</div>
+		</div>--%>
 		<div class="form-actions">
-			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
+			<input id="btnSubmit" class="btn btn-primary" type="button" onclick="submitProduct()" value="保 存"/>
 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
 		</div>
 	</form:form>
 
 	<script type="text/javascript">
-		var ladderPriceFlag = ${cmOrganizeProduct.ladderPriceFlag};
-		$(function () {
+		var skus = new Array();
+		var form = $('#inputForm')
+		<%--var ladderPriceFlag = ${cmOrganizeProduct.ladderPriceFlag};--%>
+		/*$(function () {
 			//初始化含税信息
 			var includedTax = $("input[name='includedTax']:checked").val();
 			var invoiceType = $("input[name='invoiceType']:checked").val();
@@ -467,9 +460,63 @@
 			$("#ladderPrice3").addClass("hide");
 			$("#ladderPrice2").find(".showBtn").removeClass("hide");
 			$("#delFlag3").val("1");
-		});
+		});*/
+		function submitProduct() {
+			gettTrskus()
+			var id = $('#id').val()
+			var productId = $('#productId').val()
+			var organizeId = $('#organizeId').val()
+			$.ajax({
+				url: '${ctx}/weisha/cmOrganizeProduct/save',
+				data: {
+					'id': id,
+					'productId': productId,
+					'organizeId': organizeId,
+					'skus': JSON.stringify(skus)
+				},
+				type: 'POST',
+				async: false,
+				success: function (data) {
+					window.location.href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}"
+				},
+				error: function (json) {
+					window.location.href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
+				}
+			})
+		}
+		function gettTrskus(){
+			$('.tr_skus').each(function (dom,index) {
+				var that = $(this)
+				var sku_Id = that.attr('data-skuId')
+				var sku_minNum = that.find('.sku_minNum').val()
+				var sku_price = that.find('.sku_price').val()
+				var sku_cmPecrcent = that.find('.sku_cmPecrcent').val()
+				var sku_organizePercent = that.find('.sku_organizePercent').val()
+				var sku_shopPercent = that.find('.sku_shopPercent').val()
+				if (null == sku_minNum) {
+					top.$.jBox.confirm("请输入起订量",'提示');
+					return;
+				}
+				if (null == sku_price) {
+					top.$.jBox.confirm("请输入小程序价格",'提示');
+					return;
+				}
+				if (null == sku_cmPecrcent || null == sku_organizePercent || null == sku_shopPercent) {
+					top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例",'提示');
+					return;
+				}
+				if (100.00 != (sku_cmPecrcent*1+sku_organizePercent*1+sku_shopPercent*1)) {
+					top.$.jBox.confirm("每个商品三个比例之和需要等于100%",'提示');
+					return;
+				}
+				skus.push({'id':sku_Id,'minBuyNumber': sku_minNum,'price': sku_price,'cmPercent': sku_cmPecrcent,'organizePercent': sku_organizePercent,'shopPercent': sku_shopPercent})
+
+				console.log('sku_Id',sku_Id,sku_minNum,sku_price)
+			})
+
+		}
 	</script>
 
 </body>
 
-</html>
+</html>

+ 17 - 12
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductList.jsp

@@ -96,16 +96,18 @@
 
 
 		// 商品下架、下架
-		function updateStatus(id,status) {
+		function updateStatus(id,status,organizeId) {
 			var submit = function (v, h, f) {
 				if (v == true) {
-					$.post("${ctx}/weisha/cmOrganizeProduct/updateStatus", {
+					$.post("${ctx}/weisha/cmOrganizeProduct/updateValidFlag", {
 						'id': id,
-						'status': status
+						'status': status,
+						'organizeId': organizeId
 					}, function (data) {
 						if (true == data.success) {
+							<%--window.location='${ctx}/weisha/cmOrganizeProduct/?organizeId='+organizeId;--%>
 							$.jBox.tip(data.msg, 'info');
-							<%--window.location.href="${ctx}/product/new/list";--%>
+							window.location.href="${ctx}/weisha/cmOrganizeProduct/list?organizeId="+organizeId;
 							setTimeout(function () {
 								$("#searchForm").submit();
 							},1000)
@@ -148,7 +150,7 @@
 				<form:select path="status" class="input-small">
 					<form:option value="" label="请选择"/>
 					<form:option value="1" label="已上架"/>
-					<form:option value="0" label="已下架"/>
+					<form:option value="2" label="已下架"/>
 				</form:select>
 			<label>是否含税:</label>
 				<form:select path="includedTax" onchange="changeIncludedTax(true)" class="input-small">
@@ -181,7 +183,7 @@
 				<th>商品图片</th>
 				<th>商品名称</th>
 				<th>供应商名称</th>
-				<th>售价</th>
+				<th>规格-售价</th>
 				<th>是否含税</th>
 				<th>商品状态</th>
 				<th>添加时间</th>
@@ -204,7 +206,10 @@
 					${cmOrganizeProduct.shopName}
 				</td>
 				<td>
-					${cmOrganizeProduct.price}
+					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
+						${sku.unit eq null?"未知":sku.unit}&nbsp;&nbsp;-&nbsp;&nbsp;${sku.clubPrice eq null?"未知":sku.clubPrice}<br>
+					</c:forEach>
+					<%--${cmOrganizeProduct.price}--%>
 				</td>
 				<td>
 					${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
@@ -217,14 +222,14 @@
 					<fmt:formatDate value="${cmOrganizeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				<td>
-    				<a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}">编辑</a>
-    				<a href="javascript:;" onclick=updateStatus('${cmOrganizeProduct.id}',${cmOrganizeProduct.status eq 1?0:1})>${cmOrganizeProduct.status eq 1?'下架':'上架'}</a>
-					<a href="${ctx}/weisha/cmOrganizeProduct/delete?id=${cmOrganizeProduct.id}" onclick="return confirmx('确认要删除该商品吗?删除后需要重新添加', this.href)">删除</a>
+    				<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>
 				</td>
-			</tr>
+			</tr> <%-- updateStatus('${cmOrganizeProduct.id}',${cmOrganizeProduct.status eq 1?2:1},${organizeId})>${cmOrganizeProduct.status eq 1?'下架':'上架'}--%>
 		</c:forEach>
 		</tbody>
 	</table>
 	<div class="pagination">${page}</div>
 </body>
-</html>
+</html>

+ 70 - 7
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreForm.jsp

@@ -42,12 +42,75 @@
 	<ul class="nav nav-tabs">
 		<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?organizeId=${cmOrganizeStore.organizeId}&id=${cmOrganizeStore.id}">${not empty cmOrganizeStore.id?'编辑':'上线'}门店</a></li>
+		<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a></li>
 	</ul><br/>
-	<form:form id="inputForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<form:hidden path="organizeId"/>
-		<input type="hidden" id="curProvince" name="curProvince" value="${cmOrganizeStore.provinceName}" disabled="disabled">
+	<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">
+			<c:if test="${clubInfo.name ne null and clubInfo.name ne ''}">
+				<p>机构名称:
+					<span>
+						${clubInfo.name}
+					</span>
+				</p>
+			</c:if>
+			<c:if test="${clubInfo.linkMan ne null and clubInfo.linkMan ne ''}">
+				<p>联系人:
+					<span>
+							${clubInfo.linkMan}
+					</span>
+				</p>
+			</c:if>
+			<c:if test="${clubInfo.mobile ne null and clubInfo.mobile ne ''}">
+				<p>手机号:
+					<span>
+							${clubInfo.mobile}
+					</span>
+				</p>
+			</c:if>
+			<p>机构地址:
+				<span>
+					<c:if test="${clubInfo.provinceName ne null}">
+						${clubInfo.provinceName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.cityName ne null}">
+						${clubInfo.cityName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.townName ne null}">
+						${clubInfo.townName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.address ne null}">
+						${clubInfo.address}
+					</c:if>
+				</span>
+			</p>
+			<p>营业执照编号:<span>${clubInfo.socialCreditCode}</span></p>
+			<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>
+			</c:if>
+			<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>
+			</c:if>
+			<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>
+			</c:if>
+		</div>
+		<div class="form-actions">
+			<input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+		</div>
+		<%--<input type="hidden" id="curProvince" name="curProvince" value="${cmOrganizeStore.provinceName}" disabled="disabled">
 		<input type="hidden" id="curCity" name="curCity" value="${cmOrganizeStore.cityName}" disabled="disabled">
 		<input type="hidden" id="curTown" name="curTown" value="${cmOrganizeStore.townName}" disabled="disabled">
 		<sys:message content="${message}"/>
@@ -89,7 +152,7 @@
 		<div class="form-actions">
 			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
-		</div>
+		</div>--%>
 	</form:form>
 <script>
 	/**
@@ -211,4 +274,4 @@
 
 </script>
 </body>
-</html>
+</html>

+ 83 - 17
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreList.jsp

@@ -8,17 +8,7 @@
 		.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;
-        }
-	</script>
+
 </head>
 <body>
 	<ul class="nav nav-tabs">
@@ -62,7 +52,9 @@
 				<th>门店名称</th>
 				<th>联系人</th>
 				<th>手机号</th>
+				<th>机构地址</th>
 				<th>状态</th>
+				<th>微信绑定</th>
 				<th>添加时间</th>
 				<th>操作</th>
 			</tr>
@@ -80,25 +72,99 @@
 					${cmOrganizeStore.mobile}
 				</td>
 				<td>
-					<c:if test="${cmOrganizeStore.status eq 1}">
+					<c:if test="${cmOrganizeStore.provinceName ne null}">
+						${cmOrganizeStore.provinceName}
+					</c:if>
+					-
+					<c:if test="${cmOrganizeStore.cityName ne null}">
+						 ${cmOrganizeStore.cityName}
+					</c:if>
+					-
+					<c:if test="${cmOrganizeStore.townName ne null}">
+						 ${cmOrganizeStore.townName}
+					</c:if>
+					-
+					<c:if test="${cmOrganizeStore.address ne null}">
+						 ${cmOrganizeStore.address}
+					</c:if>
+				</td>
+				<td>
+					<c:if test="${cmOrganizeStore.status eq 90}">
 						<font color="green">已上线</font>
-						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.id}&status=2"   onclick="return confirmx('确定下线该门店吗?', this.href)">下线</a>
+						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.userId}&status=91" onclick="return confirmx('确定下线该机构吗?下线后机构将不能登录小程序。?', this.href)">下线</a>
 					</c:if>
-					<c:if test="${cmOrganizeStore.status eq 2}">
+					<c:if test="${cmOrganizeStore.status eq 91}">
 						<font color="red">已下线</font>
-						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.id}&status=1" onclick="return confirmx('确定上线该门店吗?', this.href)" >上线</a>
+						<a href="${ctx}/weisha/cmOrganizeStore/save?id=${cmOrganizeStore.userId}&status=90" onclick="return confirmx('确定上线该机构吗??', this.href)" >上线</a>
+					</c:if>
+					<c:if test="${cmOrganizeStore.status eq 92}">
+						<font color="black">审核未通过</font>
+					</c:if>
+					<c:if test="${cmOrganizeStore.status eq 1}">
+						<font color="black">待审核</font>
+					</c:if>
+				</td>
+				<td>
+					<c:if test="${cmOrganizeStore.isWx eq 1}">
+						<font color="green">已绑定</font>
+					</c:if>
+					<c:if test="${cmOrganizeStore.isWx eq 0}">
+						<font color="#ff8c00">未绑定</font>
 					</c:if>
 				</td>
 				<td>
 					<fmt:formatDate value="${cmOrganizeStore.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				<td>
-    				<a href="${ctx}/weisha/cmOrganizeStore/form?id=${cmOrganizeStore.id}">编辑</a>
+    				<a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a>
+					<c:if test="${cmOrganizeStore.isWx eq 1}">
+    					<a href="${ctx}/weisha/cmOrganizeStore/cleanWx?userId=${cmOrganizeStore.userId}" onclick="return confirmx('确定解绑该机构微信吗?解绑后将不能自动登录小程序。', this.href)">解绑微信</a>
+					</c:if>
+					<a href="javascript: void(0)" onclick="updatePwd(${cmOrganizeStore.userId})">重置密码</a>
 				</td>
 			</tr>
 		</c:forEach>
 		</tbody>
 	</table>
 	<div class="pagination">${page}</div>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+			return false;
+		}
+		// 修改密码
+		function updatePwd(id) {
+			var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
+			var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
+					"<input type='password' id='newPwd' name='newPwd' placeholder='请输入8-16位字母数字组合' rows='1' cols='12'/>" +
+					"</br><font color='red'>*</font>确认密码:" +
+					"<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
+			var submit = function (v, h, f) {
+				// 密码
+				if (!regPwd.test(f.newPwd)) {
+					$.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
+					return false;
+				}
+				if (f.newPwd !== f.surePwd) {
+					$.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
+					return false;
+				}
+				$.post("${ctx}/new/user/agency/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
+					if (true == data.success) {
+						$.jBox.tip(data.msg, 'info');
+						$("#searchForm").submit();
+					} else {
+						$.jBox.tip(data.msg, 'error');
+					}
+				}, "JSON");//这里返回的类型有:json,html,xml,text
+			};
+			$.jBox(html, {title: "确定修改密码?", submit: submit});
+		}
+	</script>
 </body>
-</html>
+</html>