Browse Source

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

huangzhiguo 1 year ago
parent
commit
38f90fe816
69 changed files with 3910 additions and 916 deletions
  1. 139 0
      src/main/java/com/caimei/modules/autoType/controller/CmAutoTypeController.java
  2. 100 0
      src/main/java/com/caimei/modules/autoType/domain/CmAutoType.java
  3. 204 0
      src/main/java/com/caimei/modules/autoType/domain/CmAutoTypeRecord.java
  4. 91 0
      src/main/java/com/caimei/modules/autoType/mapper/CmAutoTypeMapper.java
  5. 91 0
      src/main/java/com/caimei/modules/autoType/mapper/CmAutoTypeRecordMapper.java
  6. 178 0
      src/main/java/com/caimei/modules/autoType/service/CmAutoTypeRecordService.java
  7. 128 0
      src/main/java/com/caimei/modules/autoType/service/CmAutoTypeService.java
  8. 2 2
      src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java
  9. 47 1
      src/main/java/com/caimei/modules/cmpage/entity/CmImage.java
  10. 26 6
      src/main/java/com/caimei/modules/cmpage/service/CmImageService.java
  11. 6 4
      src/main/java/com/caimei/modules/cmpage/web/CmImageController.java
  12. 2 1
      src/main/java/com/caimei/modules/hehe/dao/CmHeheCollageProductDao.java
  13. 5 0
      src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java
  14. 10 5
      src/main/java/com/caimei/modules/hehe/service/CmHeheActivityProductService.java
  15. 15 6
      src/main/java/com/caimei/modules/hehe/service/CmHeheCollageProductService.java
  16. 18 15
      src/main/java/com/caimei/modules/hehe/service/HeheDiscountActivityProductService.java
  17. 38 22
      src/main/java/com/caimei/modules/info/service/InfoService.java
  18. 15 19
      src/main/java/com/caimei/modules/info/web/InfoController.java
  19. 18 16
      src/main/java/com/caimei/modules/info/web/InfoTypeController.java
  20. 40 5
      src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java
  21. 2 1
      src/main/java/com/caimei/modules/newhome/dao/NewPageHomeimageDao.java
  22. 50 0
      src/main/java/com/caimei/modules/newhome/entity/NewPageFirstNavigation.java
  23. 32 0
      src/main/java/com/caimei/modules/newhome/entity/NewPageHomeimage.java
  24. 5 2
      src/main/java/com/caimei/modules/newhome/web/NewPageFirstNavigationController.java
  25. 5 2
      src/main/java/com/caimei/modules/newhome/web/NewPageHomeimageController.java
  26. 2 0
      src/main/java/com/caimei/modules/order/dao/CmPayShopDao.java
  27. 2 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  28. 4 0
      src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java
  29. 37 0
      src/main/java/com/caimei/modules/order/service/CmPayShopService.java
  30. 12 0
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  31. 38 5
      src/main/java/com/caimei/modules/order/web/CmPayShopController.java
  32. 23 0
      src/main/java/com/caimei/modules/order/web/CmShopOrderController.java
  33. 2 1
      src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java
  34. 5 636
      src/main/java/com/caimei/modules/user/entity/NewCmSp.java
  35. 25 57
      src/main/java/com/caimei/modules/user/web/newUser/SpController.java
  36. 43 5
      src/main/java/com/caimei/modules/utils/DateUtil.java
  37. 53 23
      src/main/java/com/caimei/modules/utils/MessageUtil.java
  38. 39 0
      src/main/java/com/caimei/modules/utils/message/WechatTemplateMessage.java
  39. 12 0
      src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java
  40. 167 0
      src/main/resources/mappings/modules/autoType/CmAutoTypeMapper.xml
  41. 200 0
      src/main/resources/mappings/modules/autoType/CmAutoTypeRecordMapper.xml
  42. 16 13
      src/main/resources/mappings/modules/cmpage/CmImageMapper.xml
  43. 1 0
      src/main/resources/mappings/modules/hehe/CmHeheCollageProductMapper.xml
  44. 26 2
      src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml
  45. 16 5
      src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml
  46. 3 0
      src/main/resources/mappings/modules/newhome/NewPageFirstNavigationMapper.xml
  47. 4 1
      src/main/resources/mappings/modules/newhome/NewPageHomeimageMapper.xml
  48. 88 0
      src/main/resources/mappings/modules/order/CmPayShopMapper.xml
  49. 87 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  50. 1 1
      src/main/resources/mappings/modules/serviceteam/CmServiceteamRoleMapper.xml
  51. 7 0
      src/main/resources/mappings/modules/user/CmSpMapper.xml
  52. 11 0
      src/main/resources/mappings/modules/user/NewCmClubMapper.xml
  53. 52 43
      src/main/webapp/WEB-INF/tlds/fns.tld
  54. 218 0
      src/main/webapp/WEB-INF/views/modules/autoType/autoTypeList.jsp
  55. 193 0
      src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordAdd.jsp
  56. 135 0
      src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordClubAdd.jsp
  57. 121 0
      src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordCmImageAdd.jsp
  58. 21 11
      src/main/webapp/WEB-INF/views/modules/baikePage/cmBaikeProductForm.jsp
  59. 13 2
      src/main/webapp/WEB-INF/views/modules/cmpage/cmImageList.jsp
  60. 1 1
      src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp
  61. 6 0
      src/main/webapp/WEB-INF/views/modules/info/infoTypeLandingList.jsp
  62. 18 1
      src/main/webapp/WEB-INF/views/modules/newhome/newPageFirstNavigationList.jsp
  63. 6 0
      src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageList.jsp
  64. 325 0
      src/main/webapp/WEB-INF/views/modules/order/cmPayOtherFormList.jsp
  65. 589 0
      src/main/webapp/WEB-INF/views/modules/order/paidShopOtherList.jsp
  66. 1 0
      src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp
  67. 2 1
      src/main/webapp/WEB-INF/views/modules/userNew/cmSpEdit.jsp
  68. 3 1
      src/main/webapp/WEB-INF/views/modules/userNew/cmSpForm.jsp
  69. 15 0
      src/main/webapp/WEB-INF/views/modules/userNew/cmSpList.jsp

+ 139 - 0
src/main/java/com/caimei/modules/autoType/controller/CmAutoTypeController.java

@@ -0,0 +1,139 @@
+package com.caimei.modules.autoType.controller;
+
+import com.caimei.modules.autoType.domain.CmAutoType;
+import com.caimei.modules.autoType.domain.CmAutoTypeRecord;
+import com.caimei.modules.autoType.service.CmAutoTypeRecordService;
+import com.caimei.modules.autoType.service.CmAutoTypeService;
+import com.caimei.modules.cmpage.entity.CmImage;
+import com.caimei.modules.cmpage.service.CmImageService;
+import com.caimei.modules.info.entity.Info;
+import com.caimei.modules.info.entity.InfoType;
+import com.caimei.modules.info.service.InfoService;
+import com.caimei.modules.info.service.InfoTypeService;
+import com.caimei.modules.user.entity.NewCmClub;
+import com.caimei.modules.user.service.NewCmClubService;
+import com.caimei.modules.utils.DateUtil;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 推荐方式配置Controller
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/autoType")
+public class CmAutoTypeController extends BaseController {
+    @Resource
+    private CmAutoTypeService cmAutoTypeService;
+    @Resource
+    private CmAutoTypeRecordService cmAutoTypeRecordService;
+    @Resource
+    private InfoService infoService;
+    @Resource
+    private InfoTypeService infoTypeService;
+    @Resource
+    private NewCmClubService newCmClubService;
+    @Resource
+    private CmImageService cmImageService;
+
+    @RequestMapping(value = {"list", ""})
+    public String form(CmAutoTypeRecord cmAutoTypeRecord, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != cmAutoTypeRecord.getEndPvCreateTime()) {
+            cmAutoTypeRecord.setEndPvCreateTime(DateUtil.getEndTime(cmAutoTypeRecord.getEndPvCreateTime()));
+        }
+        Page<CmAutoTypeRecord> page = cmAutoTypeRecordService.findPage(new Page<CmAutoTypeRecord>(request, response), cmAutoTypeRecord);
+        CmAutoType byCmAutoType = cmAutoTypeService.getByCmAutoType(new CmAutoType().type(cmAutoTypeRecord.type()));
+        if(null==byCmAutoType){
+            cmAutoTypeService.addCmAutoType(new CmAutoType().type(cmAutoTypeRecord.type()).autoStatus("0"));
+            byCmAutoType = cmAutoTypeService.getByCmAutoType(new CmAutoType().type(cmAutoTypeRecord.type()));
+        }
+        model.addAttribute("cmAutoType", byCmAutoType);
+        model.addAttribute("page", page);
+        return "modules/autoType/autoTypeList";
+    }
+
+    @RequestMapping(value = "findAddPage")
+    public String findAddPage(Info info, Model model, HttpServletRequest request, HttpServletResponse response) {
+        info.setPublishSource(1);
+        Page<Info> page = infoService.findPage(new Page<Info>(request, response), info);
+        InfoType infoType = new InfoType();
+        infoType.setType("1");
+        infoType.setEnabledStatus("1");
+        List<InfoType> typeList = infoTypeService.findList(infoType);
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("page", page);
+        return "modules/autoType/autoTypeRecordAdd";
+    }
+
+
+
+    @RequestMapping(value = "findCmImageAddPage")
+    public String findCmImageAddPage(CmImage cmImage, Model model, HttpServletRequest request, HttpServletResponse response) {
+        cmImage.setType("4");
+        Page<CmImage> page = cmImageService.findPage(new Page<CmImage>(request, response), cmImage);
+        model.addAttribute("page", page);
+        return "modules/autoType/autoTypeRecordCmImageAdd";
+    }
+
+    @RequestMapping(value = "findClubAddPage")
+    public String findClubAddPage(NewCmClub newCmClub, Model model, HttpServletRequest request, HttpServletResponse response) {
+        Page<NewCmClub> page = newCmClubService.findPage(new Page<NewCmClub>(request, response, 20), newCmClub);
+        model.addAttribute("page", page);
+        return "modules/autoType/autoTypeRecordClubAdd";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "updateAutoStatus")
+    public Map<String, Object> updateLanDingStatus(CmAutoType cmAutoType, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            if (cmAutoType == null) {
+                throw new NullPointerException();
+            }
+            cmAutoTypeService.updateCmAutoType(new CmAutoType()
+                    .id(cmAutoType.id())
+                    .autoStatus(cmAutoType.autoStatus())
+            );
+            map.put("success", true);
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
+
+
+    @ResponseBody
+    @RequestMapping(value = "addCmAutoTypeRecord")
+    public Map<String, Object> addCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            if (cmAutoTypeRecord == null) {
+                throw new NullPointerException();
+            }
+            cmAutoTypeRecordService.addCmAutoTypeRecord(cmAutoTypeRecord);
+            map.put("success", true);
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
+}

+ 100 - 0
src/main/java/com/caimei/modules/autoType/domain/CmAutoType.java

@@ -0,0 +1,100 @@
+package com.caimei.modules.autoType.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 推荐方式配置对象 cm_auto_type
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@Accessors(fluent  = true )
+@Data
+@Alias("CmAutoType")
+public class CmAutoType extends DataEntity<CmAutoType> implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 分类:1文章推送, 2活动推送 */
+    private String type;
+
+    /** 推荐方式 0自动推荐 1手动推荐 */
+    private String autoStatus;
+
+    /** 删除状态 0正常,其他删除 */
+    private String delFlag;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @Override
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    @Override
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getAutoStatus() {
+        return autoStatus;
+    }
+
+    public void setAutoStatus(String autoStatus) {
+        this.autoStatus = autoStatus;
+    }
+
+
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+
+

+ 204 - 0
src/main/java/com/caimei/modules/autoType/domain/CmAutoTypeRecord.java

@@ -0,0 +1,204 @@
+package com.caimei.modules.autoType.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 文章-活动推送记录对象 cm_auto_type_record
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@Accessors(fluent = true)
+@Data
+@Alias("CmAutoTypeRecord")
+public class CmAutoTypeRecord extends DataEntity<CmAutoTypeRecord> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 分类:1文章推送(cm_auto_type), 2活动推送(cm_auto_type)
+     */
+    private String type;
+
+    /**
+     * 归属者Id(type字段表Id)
+     */
+    private Integer authorId;
+
+    /**
+     * 推荐方式 0自动推荐 1手动推荐
+     */
+    private String autoStatus;
+
+    /**
+     * 当前Ids
+     */
+    private List<String> thisIds;
+    /**
+     * 机构Ids
+     */
+    private List<String> clubIds;
+    /**
+     * 删除状态 0正常,其他删除
+     */
+    private String delFlag;
+
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 添加时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 开始点击量时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startPvCreateTime;
+    /**
+     * 结束点击量时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endPvCreateTime;
+
+    //文章
+    /**
+     * 引导图
+     */
+    private String image;
+    /**
+     * 标题
+     */
+    private String title;
+
+
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    public List<String> getClubIds() {
+        return clubIds;
+    }
+
+    public void setClubIds(List<String> clubIds) {
+        this.clubIds = clubIds;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public List<String> getThisIds() {
+        return thisIds;
+    }
+
+    public void setThisIds(List<String> thisIds) {
+        this.thisIds = thisIds;
+    }
+
+    @Override
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    @Override
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Date getStartPvCreateTime() {
+        return startPvCreateTime;
+    }
+
+    public void setStartPvCreateTime(Date startPvCreateTime) {
+        this.startPvCreateTime = startPvCreateTime;
+    }
+
+    public Date getEndPvCreateTime() {
+
+        return endPvCreateTime;
+    }
+
+    public void setEndPvCreateTime(Date endPvCreateTime) {
+        this.endPvCreateTime = endPvCreateTime;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getAuthorId() {
+        return authorId;
+    }
+
+    public void setAuthorId(Integer authorId) {
+        this.authorId = authorId;
+    }
+
+    public String getAutoStatus() {
+        return autoStatus;
+    }
+
+    public void setAutoStatus(String autoStatus) {
+        this.autoStatus = autoStatus;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+

+ 91 - 0
src/main/java/com/caimei/modules/autoType/mapper/CmAutoTypeMapper.java

@@ -0,0 +1,91 @@
+package com.caimei.modules.autoType.mapper;
+
+import com.caimei.modules.autoType.domain.CmAutoType;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * 推荐方式配置Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@MyBatisDao
+public interface CmAutoTypeMapper extends CrudDao<CmAutoType>
+{
+    /**
+     * 通过对象查询推荐方式配置列表
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 推荐方式配置集合
+     */
+    List<CmAutoType> getCmAutoTypeList(CmAutoType cmAutoType);
+
+    /**
+     * 通过Id查询推荐方式配置对象
+     *
+     * @param id 推荐方式配置主键
+     * @return 推荐方式配置
+     */
+    CmAutoType getCmAutoTypeById(String id);
+
+    /**
+     * 通过对象查询推荐方式配置对象
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 推荐方式配置
+     */
+    CmAutoType getByCmAutoType(CmAutoType cmAutoType);
+
+    /**
+     * 通过对象查询推荐方式配置Id
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return String
+     */
+    String getById(CmAutoType cmAutoType);
+
+
+    /**
+     * 通过对象查询推荐方式配置记录总数
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 推荐方式配置Integer
+     */
+    int getCount(CmAutoType cmAutoType);
+
+    /**
+     * 新增推荐方式配置
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 结果
+     */
+    int addCmAutoType(CmAutoType cmAutoType);
+
+    /**
+     * 修改推荐方式配置
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 结果
+     */
+    int updateCmAutoType(CmAutoType cmAutoType);
+
+    /**
+     * 删除推荐方式配置
+     *
+     * @param id 推荐方式配置主键
+     * @return 结果
+     */
+    int delCmAutoTypeById(String id);
+
+    /**
+     * 批量删除推荐方式配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int delCmAutoType(CmAutoType cmAutoType);
+
+}

+ 91 - 0
src/main/java/com/caimei/modules/autoType/mapper/CmAutoTypeRecordMapper.java

@@ -0,0 +1,91 @@
+package com.caimei.modules.autoType.mapper;
+
+import com.caimei.modules.autoType.domain.CmAutoTypeRecord;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * 文章-活动推送记录Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@MyBatisDao
+public interface CmAutoTypeRecordMapper extends CrudDao<CmAutoTypeRecord>
+{
+    /**
+     * 通过对象查询文章-活动推送记录列表
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 文章-活动推送记录集合
+     */
+    List<CmAutoTypeRecord> getCmAutoTypeRecordList(CmAutoTypeRecord cmAutoTypeRecord);
+
+    /**
+     * 通过Id查询文章-活动推送记录对象
+     *
+     * @param id 文章-活动推送记录主键
+     * @return 文章-活动推送记录
+     */
+    CmAutoTypeRecord getCmAutoTypeRecordById(String id);
+
+    /**
+     * 通过对象查询文章-活动推送记录对象
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 文章-活动推送记录
+     */
+    CmAutoTypeRecord getByCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord);
+
+    /**
+     * 通过对象查询文章-活动推送记录Id
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return String
+     */
+    String getById(CmAutoTypeRecord cmAutoTypeRecord);
+
+
+    /**
+     * 通过对象查询文章-活动推送记录记录总数
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 文章-活动推送记录Integer
+     */
+    int getCount(CmAutoTypeRecord cmAutoTypeRecord);
+
+    /**
+     * 新增文章-活动推送记录
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 结果
+     */
+    int addCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord);
+
+    /**
+     * 修改文章-活动推送记录
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 结果
+     */
+    int updateCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord);
+
+    /**
+     * 删除文章-活动推送记录
+     *
+     * @param id 文章-活动推送记录主键
+     * @return 结果
+     */
+    int delCmAutoTypeRecordById(String id);
+
+    /**
+     * 批量删除文章-活动推送记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int delCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord);
+
+}

+ 178 - 0
src/main/java/com/caimei/modules/autoType/service/CmAutoTypeRecordService.java

@@ -0,0 +1,178 @@
+package com.caimei.modules.autoType.service;
+
+import com.caimei.modules.autoType.domain.CmAutoTypeRecord;
+import com.caimei.modules.autoType.mapper.CmAutoTypeRecordMapper;
+import com.caimei.modules.cmpage.dao.CmImageDao;
+import com.caimei.modules.cmpage.entity.CmImage;
+import com.caimei.modules.info.dao.InfoDao;
+import com.caimei.modules.info.entity.Info;
+import com.caimei.modules.user.dao.NewCmClubDao;
+import com.caimei.modules.utils.MessageUtil;
+import com.caimei.modules.utils.message.InsideMessage;
+import com.caimei.modules.utils.message.MessageModel;
+import com.caimei.modules.utils.message.MqInfo;
+import com.caimei.modules.utils.message.enums.MessageType;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 文章-活动推送记录Service业务层处理
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@Service
+public class CmAutoTypeRecordService extends CrudService<CmAutoTypeRecordMapper, CmAutoTypeRecord> {
+    @Resource
+    private CmAutoTypeRecordMapper cmAutoTypeRecordMapper;
+    @Resource
+    private NewCmClubDao newCmClubDao;
+    @Resource
+    private InfoDao infoDao;
+    @Resource
+    private CmImageDao cmImageDao;
+    /**
+     * 通过对象查询文章-活动推送记录列表
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 文章-活动推送记录
+     */
+
+    public List<CmAutoTypeRecord> getCmAutoTypeRecordList(CmAutoTypeRecord cmAutoTypeRecord) {
+        return cmAutoTypeRecordMapper.getCmAutoTypeRecordList(cmAutoTypeRecord);
+    }
+
+    /**
+     * 通过Id查询文章-活动推送记录
+     *
+     * @param id 文章-活动推送记录主键
+     * @return 文章-活动推送记录
+     */
+
+    public CmAutoTypeRecord getCmAutoTypeRecordById(String id) {
+        return cmAutoTypeRecordMapper.getCmAutoTypeRecordById(id);
+    }
+
+    /**
+     * 通过对象查询文章-活动推送记录
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 文章-活动推送记录
+     */
+
+    public CmAutoTypeRecord getByCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord) {
+        return cmAutoTypeRecordMapper.getByCmAutoTypeRecord(cmAutoTypeRecord);
+    }
+
+    /**
+     * 通过对象查询文章-活动推送记录Id
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return String
+     */
+
+    public String getById(CmAutoTypeRecord cmAutoTypeRecord) {
+        return cmAutoTypeRecordMapper.getById(cmAutoTypeRecord);
+    }
+
+
+    /**
+     * 通过对象查询文章-活动推送记录记录总数
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return int
+     */
+
+    public int getCount(CmAutoTypeRecord cmAutoTypeRecord) {
+        return cmAutoTypeRecordMapper.getCount(cmAutoTypeRecord);
+    }
+
+    /**
+     * 新增文章-活动推送记录
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 结果
+     */
+    @Async
+    @Transactional(readOnly = false)
+    public void addCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord) {
+        if("0".equals(cmAutoTypeRecord.autoStatus())){
+            try {
+                Thread.sleep(3000);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+        for (String s : cmAutoTypeRecord.thisIds()) {
+            synchronized (cmAutoTypeRecord){
+                cmAutoTypeRecord.authorId(Integer.valueOf(s));
+                cmAutoTypeRecord.setCreateTime(new Date());
+                cmAutoTypeRecordMapper.addCmAutoTypeRecord(cmAutoTypeRecord);           //新增推送记录
+            }
+            String image;
+            String title;
+            int type;
+            if (StringUtils.equals("1", cmAutoTypeRecord.type())) {
+                Info info = infoDao.get(s);
+                image = info.getGuidanceImage();
+                title = info.getTitle();
+                type=5;
+            } else {
+                CmImage cmImage = cmImageDao.get(s);
+                image = cmImage.getImage();
+                title = cmImage.getTitle();
+                type=6;
+            }
+            //站内信 【最新文章/活动推送】
+            MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
+            insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
+                    .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1));
+            List<String> clubIds = CollectionUtils.isEmpty(cmAutoTypeRecord.clubIds()) ? newCmClubDao.getClubIds() : cmAutoTypeRecord.clubIds();
+            for (String clubId : clubIds) {
+                insideMessageMessageModel.info(new InsideMessage()
+                        .userType(1)
+                        .messageType(type)
+                        .mainImage(image)
+                        .content(title)
+                        .thisId(Integer.valueOf(s))
+                        .clubId(Integer.valueOf(clubId))
+                );
+                MessageUtil.sendMessage(insideMessageMessageModel);
+            }
+        }
+    }
+
+    /**
+     * 修改文章-活动推送记录
+     *
+     * @param cmAutoTypeRecord 文章-活动推送记录
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateCmAutoTypeRecord(CmAutoTypeRecord cmAutoTypeRecord) {
+        cmAutoTypeRecord.setUpdateTime(new Date());
+        return cmAutoTypeRecordMapper.updateCmAutoTypeRecord(cmAutoTypeRecord);
+    }
+
+
+    /**
+     * 删除文章-活动推送记录信息
+     *
+     * @param id 文章-活动推送记录主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmAutoTypeRecordById(String id) {
+        return cmAutoTypeRecordMapper.updateCmAutoTypeRecord(new CmAutoTypeRecord().id(id).delFlag("1"));
+        //return cmAutoTypeRecordMapper.delCmAutoTypeRecordById(id);
+    }
+
+}

+ 128 - 0
src/main/java/com/caimei/modules/autoType/service/CmAutoTypeService.java

@@ -0,0 +1,128 @@
+package com.caimei.modules.autoType.service;
+
+import com.caimei.modules.autoType.domain.CmAutoType;
+import com.caimei.modules.autoType.mapper.CmAutoTypeMapper;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 推荐方式配置Service业务层处理
+ *
+ * @author Kaick
+ * @date 2023-11-20
+ */
+@Service
+public class CmAutoTypeService  extends CrudService<CmAutoTypeMapper, CmAutoType>
+{
+    @Resource
+    private CmAutoTypeMapper cmAutoTypeMapper;
+
+    /**
+     * 通过对象查询推荐方式配置列表
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 推荐方式配置
+     */
+
+    public List<CmAutoType> getCmAutoTypeList(CmAutoType cmAutoType)
+    {
+        return cmAutoTypeMapper.getCmAutoTypeList(cmAutoType);
+    }
+
+    /**
+     * 通过Id查询推荐方式配置
+     *
+     * @param id 推荐方式配置主键
+     * @return 推荐方式配置
+     */
+
+    public CmAutoType getCmAutoTypeById(String id)
+    {
+        return cmAutoTypeMapper.getCmAutoTypeById(id);
+    }
+
+    /**
+     * 通过对象查询推荐方式配置
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 推荐方式配置
+     */
+
+    public CmAutoType getByCmAutoType(CmAutoType cmAutoType)
+    {
+        return cmAutoTypeMapper.getByCmAutoType(cmAutoType);
+    }
+
+    /**
+     * 通过对象查询推荐方式配置Id
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return String
+     */
+
+    public String getById(CmAutoType cmAutoType)
+    {
+        return cmAutoTypeMapper.getById(cmAutoType);
+    }
+
+
+    /**
+     * 通过对象查询推荐方式配置记录总数
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return int
+     */
+
+    public int getCount(CmAutoType cmAutoType)
+    {
+        return cmAutoTypeMapper.getCount(cmAutoType);
+    }
+
+    /**
+     * 新增推荐方式配置
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int addCmAutoType(CmAutoType cmAutoType)
+    {
+        cmAutoType.setCreateTime(new Date());
+        return cmAutoTypeMapper.addCmAutoType(cmAutoType);
+    }
+
+    /**
+     * 修改推荐方式配置
+     *
+     * @param cmAutoType 推荐方式配置
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateCmAutoType(CmAutoType cmAutoType)
+    {
+        cmAutoType.setUpdateTime(new Date());
+        return cmAutoTypeMapper.updateCmAutoType(cmAutoType);
+    }
+
+
+
+    /**
+     * 删除推荐方式配置信息
+     *
+     * @param id 推荐方式配置主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmAutoTypeById(String id)
+    {
+        return cmAutoTypeMapper.updateCmAutoType(new CmAutoType().id(id).delFlag("1"));
+        //return cmAutoTypeMapper.delCmAutoTypeById(id);
+    }
+
+}
+

+ 2 - 2
src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java

@@ -146,10 +146,10 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 
         // 管理员审核百科
         if (null != cmBaikeProduct.getAuditFlag() && 1 == cmBaikeProduct.getAuditFlag()) {
-            //站内信
+            //站内信 【审核采美百科推送】
             MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
             insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
-                    .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(0));
+                    .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1));
             if (null != cmBaikeProduct.getAuditStatus() && 2 == cmBaikeProduct.getAuditStatus()) {
                 // 审核通过
                 cmBaikeProduct.setOnlineStatus(2);

+ 47 - 1
src/main/java/com/caimei/modules/cmpage/entity/CmImage.java

@@ -1,6 +1,8 @@
 package com.caimei.modules.cmpage.entity;
 
+import cn.hutool.core.date.DateUtil;
 import com.caimei.modules.product.entity.ActType;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 import org.hibernate.validator.constraints.Length;
 
@@ -52,6 +54,50 @@ public class CmImage extends DataEntity<CmImage> {
      */
     private String createDateStc;
 
+    //点击量统计
+    /** 开始点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startPvCreateTime;
+    /** 结束点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endPvCreateTime;
+    /** 统计分类*/
+    private String statisticsType;
+    /** 点击量*/
+    private Integer pv;
+
+    public Integer getPv() {
+        return pv;
+    }
+
+    public void setPv(Integer pv) {
+        this.pv = pv;
+    }
+
+    public Date getStartPvCreateTime() {
+        return startPvCreateTime;
+    }
+
+    public void setStartPvCreateTime(Date startPvCreateTime) {
+        this.startPvCreateTime = startPvCreateTime;
+    }
+
+    public Date getEndPvCreateTime() {
+
+        return endPvCreateTime;
+    }
+
+    public void setEndPvCreateTime(Date endPvCreateTime) {
+        this.endPvCreateTime = endPvCreateTime;
+    }
+
+    public String getStatisticsType() {
+        return statisticsType;
+    }
+
+    public void setStatisticsType(String statisticsType) {
+        this.statisticsType = statisticsType;
+    }
 
     public String getCrmEnabledStatus() {
         return crmEnabledStatus;
@@ -259,4 +305,4 @@ public class CmImage extends DataEntity<CmImage> {
     public void setAppletsEnabledStatus(String appletsEnabledStatus) {
         this.appletsEnabledStatus = appletsEnabledStatus;
     }
-}
+}

+ 26 - 6
src/main/java/com/caimei/modules/cmpage/service/CmImageService.java

@@ -1,23 +1,27 @@
 package com.caimei.modules.cmpage.service;
 
 import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.autoType.domain.CmAutoType;
+import com.caimei.modules.autoType.domain.CmAutoTypeRecord;
+import com.caimei.modules.autoType.mapper.CmAutoTypeMapper;
+import com.caimei.modules.autoType.service.CmAutoTypeRecordService;
 import com.caimei.modules.brand.utils.ImagePathUtils;
 import com.caimei.modules.cmpage.dao.CmImageDao;
 import com.caimei.modules.cmpage.entity.CmImage;
 import com.caimei.modules.common.utils.UploadUtils;
-import com.caimei.modules.info.entity.Info;
 import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.caimei.modules.user.dao.NewCmClubDao;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -31,11 +35,17 @@ public class CmImageService extends CrudService<CmImageDao, CmImage> {
 
 	@Resource
 	private CmImageDao cmImageDao;
+	@Resource
+	private CmAutoTypeMapper cmAutoTypeMapper;
+	@Resource
+	private CmAutoTypeRecordService cmAutoTypeRecordService;
+	@Resource
+	private NewCmClubDao newCmClubDao;
 
 	public CmImage get(String id) {
 		return super.get(id);
 	}
-	
+
 	public List<CmImage> findList(CmImage cmImage) {
 		return super.findList(cmImage);
 	}
@@ -62,7 +72,7 @@ public class CmImageService extends CrudService<CmImageDao, CmImage> {
 		return cmImageDao.findCentreImageByCentreId(id);
 	}
 
-	
+
 	@Transactional(readOnly = false)
 	public void save(CmImage cmImage, HttpServletRequest request) {
 		String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
@@ -114,9 +124,19 @@ public class CmImageService extends CrudService<CmImageDao, CmImage> {
 				logger.error("图片上传错误:" + e.toString(), e);
 			}
 		}
+
 		super.save(cmImage);
+
+		CmAutoType byCmAutoType = cmAutoTypeMapper.getByCmAutoType(new CmAutoType().type("2").autoStatus("0"));			//获取推送配置
+		if(StringUtils.equals("4",cmImage.getType())&& null!=byCmAutoType) {
+			cmAutoTypeRecordService.addCmAutoTypeRecord(new CmAutoTypeRecord()                            //新增推送记录
+					.type("2")
+					.autoStatus("0")
+					.thisIds(Arrays.asList(cmImage.getId()))
+			);
+		}
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(CmImage cmImage) {
 		super.delete(cmImage);
@@ -163,4 +183,4 @@ public class CmImageService extends CrudService<CmImageDao, CmImage> {
 	public void updateAppletsEnabledStatusByIds(String enabledStatus, String ids) {
 		cmImageDao.updateAppletsEnabledStatusByIds(enabledStatus, ids);
 	}
-}
+}

+ 6 - 4
src/main/java/com/caimei/modules/cmpage/web/CmImageController.java

@@ -3,17 +3,16 @@ package com.caimei.modules.cmpage.web;
 import com.caimei.constants.common.RedisKeyUtil;
 import com.caimei.modules.cmpage.entity.CmImage;
 import com.caimei.modules.cmpage.service.CmImageService;
-import com.caimei.modules.info.entity.Info;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.utils.DateUtil;
 import com.caimei.redis.RedisService;
+import com.caimei.utils.StringUtils;
 import com.google.common.collect.Maps;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
-import com.caimei.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -63,7 +62,10 @@ public class CmImageController extends BaseController {
 	@RequiresPermissions("cmpage:cmImage:view")
 	@RequestMapping(value = {"list", ""})
 	public String list(CmImage cmImage, HttpServletRequest request, HttpServletResponse response, Model model) {
-
+		if (null != cmImage.getEndPvCreateTime()) {
+			cmImage.setEndPvCreateTime(DateUtil.getEndTime(cmImage.getEndPvCreateTime()));
+		}
+		cmImage.setStatisticsType("3");
 		if(StringUtils.equals("5",cmImage.getFlag())){//首页广告图片(【顶层广告】【轮播图】【小专题】)
 			if(StringUtils.isEmpty(cmImage.getType())){
 				cmImage.getSqlMap().put("type", " AND (a.type=5 OR a.type=6 OR a.type=7 OR a.type=9)");

+ 2 - 1
src/main/java/com/caimei/modules/hehe/dao/CmHeheCollageProductDao.java

@@ -33,4 +33,5 @@ public interface CmHeheCollageProductDao extends CrudDao<CmHeheCollageProduct> {
     CmSku getSkuCollage(Integer skuId);
     //展示最低拼团价格
     Double getCollagePrice(Integer productId);
-}
+
+}

+ 5 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -96,4 +96,9 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
     void updateHeHeSkuPrice(@Param("skuId") Integer skuId, @Param("price") Double price);
 
     List<CmLadderPrice> findLadderList(Integer skuId);
+
+    List<String> findMobileByUserYear(Integer num);
+
+    int getMonthCount(@Param("num")Integer num,@Param("type")Integer type);
+
 }

+ 10 - 5
src/main/java/com/caimei/modules/hehe/service/CmHeheActivityProductService.java

@@ -1,6 +1,5 @@
 package com.caimei.modules.hehe.service;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.modules.hehe.dao.CmHeheActivityProductDao;
@@ -9,20 +8,18 @@ import com.caimei.modules.hehe.entity.CmHeHeActivityLadder;
 import com.caimei.modules.hehe.entity.CmHeheActivityProduct;
 import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.product.entity.CmSku;
+import com.caimei.modules.sys.utils.SMSUtils;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.StringUtil;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -104,6 +101,14 @@ public class CmHeheActivityProductService extends CrudService<CmHeheActivityProd
 
     @Transactional(readOnly = false)
     public void addProducts(Integer activityId, String productIds) {
+        int count = cmHeheProductDao.getMonthCount(1,2);
+        if (0 < count) {
+            List<String> mobileByUserYear = cmHeheProductDao.findMobileByUserYear(3);
+            for (String mobile : mobileByUserYear) {
+                //发送短信 【活动商品上架时派送】
+                SMSUtils.sendSms(3,mobile, "【颜选美学】优惠活动商品已上架啦!快去微信搜索“颜选美学”小程序登录下单您心仪的商品吧。关注公众号“颜选美学”获取更多优惠和精彩资讯。");
+            }
+        }
         CmHeheActivityProduct activityProduct = new CmHeheActivityProduct();
         activityProduct.setActivityId(activityId);
         if (StringUtil.isNotBlank(productIds)) {
@@ -141,4 +146,4 @@ public class CmHeheActivityProductService extends CrudService<CmHeheActivityProd
             }
         });
     }
-}
+}

+ 15 - 6
src/main/java/com/caimei/modules/hehe/service/CmHeheCollageProductService.java

@@ -1,19 +1,20 @@
 package com.caimei.modules.hehe.service;
 
-import java.util.List;
+import com.caimei.modules.hehe.dao.CmHeheCollageProductDao;
 import com.caimei.modules.hehe.dao.CmHeheFloorProductDao;
 import com.caimei.modules.hehe.dao.CmHeheProductDao;
+import com.caimei.modules.hehe.entity.CmHeheCollageProduct;
 import com.caimei.modules.product.entity.CmSku;
 import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.sys.utils.SMSUtils;
 import com.caimei.utils.AppUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.hehe.entity.CmHeheCollageProduct;
-import com.caimei.modules.hehe.dao.CmHeheCollageProductDao;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * 呵呵商城拼团商品Service
@@ -54,6 +55,14 @@ public class CmHeheCollageProductService extends CrudService<CmHeheCollageProduc
 
     @Transactional(readOnly = false)
     public void save(CmHeheCollageProduct cmHeheCollageProduct) {
+        int count = cmHeheProductDao.getMonthCount(1,1);
+        if (0 < count) {
+            List<String> mobileByUserYear = cmHeheProductDao.findMobileByUserYear(3);
+            for (String mobile : mobileByUserYear) {
+                //发送短信 【拼团商品上架时派送】
+                SMSUtils.sendSms(3,mobile, "【颜选美学】拼团商品已上架啦!快去微信搜索“颜选美学”小程序登录下单您心仪的商品吧。关注公众号“颜选美学”获取更多优惠和精彩资讯。");
+            }
+        }
         if (!cmHeheCollageProduct.getIsNewRecord()) {
             CmHeheCollageProduct dbProduct = get(cmHeheCollageProduct.getId());
             if (!dbProduct.getProductId().equals(cmHeheCollageProduct.getProductId())) {
@@ -109,4 +118,4 @@ public class CmHeheCollageProductService extends CrudService<CmHeheCollageProduc
     public void updateStatus(Integer id, Integer status) {
         cmHeheCollageProductDao.updateStatus(id, status);
     }
-}
+}

+ 18 - 15
src/main/java/com/caimei/modules/hehe/service/HeheDiscountActivityProductService.java

@@ -1,27 +1,22 @@
 package com.caimei.modules.hehe.service;
 
-import java.util.List;
-
 import com.caimei.modules.hehe.dao.CmHeheActivityProductDao;
 import com.caimei.modules.hehe.dao.CmHeheProductDao;
+import com.caimei.modules.hehe.dao.HeheDiscountActivityProductDao;
 import com.caimei.modules.hehe.entity.CmHeheProduct;
-import com.caimei.modules.hehe.entity.HeheHomeTypeProduct;
+import com.caimei.modules.hehe.entity.HeheDiscountActivityProduct;
 import com.caimei.modules.product.entity.CmSku;
+import com.caimei.modules.sys.utils.SMSUtils;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.StringUtil;
 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;
-
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.hehe.entity.HeheDiscountActivityProduct;
-import com.caimei.modules.hehe.dao.HeheDiscountActivityProductDao;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-
-import static org.apache.struts2.interceptor.DateTextFieldInterceptor.DateWord.s;
+import java.util.List;
 
 /**
  * 限时特价商品Service
@@ -46,11 +41,11 @@ public class HeheDiscountActivityProductService extends CrudService<HeheDiscount
 		heheDiscountActivityProduct.setSkus(activityProductDao.findDiscountSku(heheDiscountActivityProduct.getProductId()));
 		return heheDiscountActivityProduct;
 	}
-	
+
 	public List<HeheDiscountActivityProduct> findList(HeheDiscountActivityProduct heheDiscountActivityProduct) {
 		return super.findList(heheDiscountActivityProduct);
 	}
-	
+
 	public Page<HeheDiscountActivityProduct> findPage(Page<HeheDiscountActivityProduct> page, HeheDiscountActivityProduct heheDiscountActivityProduct) {
 		Page<HeheDiscountActivityProduct> productPage = super.findPage(page, heheDiscountActivityProduct);
 		List<HeheDiscountActivityProduct> list = productPage.getList();
@@ -61,9 +56,17 @@ public class HeheDiscountActivityProductService extends CrudService<HeheDiscount
 		});
 		return productPage;
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void save(HeheDiscountActivityProduct heheDiscountActivityProduct) {
+		int count = cmHeheProductDao.getMonthCount(1,3);
+		if (0 < count) {
+			List<String> mobileByUserYear = cmHeheProductDao.findMobileByUserYear(3);
+			for (String mobile : mobileByUserYear) {
+				//发送短信 【限时特价商品上架时派送】
+				SMSUtils.sendSms(3,mobile, "【颜选美学】特价商品已上架啦!快去微信搜索“颜选美学”小程序登录下单您心仪的商品吧。关注公众号“颜选美学”获取更多优惠和精彩资讯。");
+			}
+		}
 		super.save(heheDiscountActivityProduct);
 		//修改/保存sku的限时特价
 		List<CmSku> skus = heheDiscountActivityProduct.getSkus();
@@ -110,4 +113,4 @@ public class HeheDiscountActivityProductService extends CrudService<HeheDiscount
         productPage.setList(productList);
         return productPage;
     }
-}
+}

+ 38 - 22
src/main/java/com/caimei/modules/info/service/InfoService.java

@@ -1,21 +1,28 @@
 package com.caimei.modules.info.service;
 
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.autoType.domain.CmAutoType;
+import com.caimei.modules.autoType.domain.CmAutoTypeRecord;
+import com.caimei.modules.autoType.mapper.CmAutoTypeMapper;
+import com.caimei.modules.autoType.service.CmAutoTypeRecordService;
 import com.caimei.modules.basesetting.dao.KeywordDao;
-import com.caimei.modules.hehe.entity.cmHeHeUserActivity;
-import com.caimei.modules.live.entity.NewPageLive;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.modules.info.dao.InfoDao;
+import com.caimei.modules.info.dao.InfoLabelDao;
+import com.caimei.modules.info.entity.Info;
+import com.caimei.modules.info.entity.InfoLabel;
 import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.caimei.modules.user.dao.NewCmClubDao;
 import com.caimei.modules.utils.MessageUtil;
-import com.caimei.modules.utils.RequestUtil;
 import com.caimei.modules.utils.message.InsideMessage;
 import com.caimei.modules.utils.message.MessageModel;
 import com.caimei.modules.utils.message.MqInfo;
 import com.caimei.modules.utils.message.enums.MessageType;
-import com.caimei.utils.StringUtil;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -25,17 +32,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.caimei.dfs.image.beens.ImageUploadInfo;
-import com.caimei.modules.brand.utils.ImagePathUtils;
-import com.caimei.modules.info.dao.InfoDao;
-import com.caimei.modules.info.dao.InfoLabelDao;
-import com.caimei.modules.info.entity.Info;
-import com.caimei.modules.info.entity.InfoLabel;
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.thinkgem.jeesite.common.utils.Encodes;
-import com.thinkgem.jeesite.common.utils.StringUtils;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 信息列表Service
@@ -56,6 +57,13 @@ public class InfoService extends CrudService<InfoDao, Info> {
     @Autowired
     private KeywordDao keywordDao;
 
+    @Resource
+    private CmAutoTypeMapper cmAutoTypeMapper;
+    @Resource
+    private CmAutoTypeRecordService cmAutoTypeRecordService;
+    @Resource
+    private NewCmClubDao newCmClubDao;
+
     public Info get(String id) {
         Info info = super.get(id);
         if (null != info) {
@@ -218,10 +226,10 @@ public class InfoService extends CrudService<InfoDao, Info> {
 
         // 管理员审核文章
         if (null != info.getAuditFlag() && 1 == info.getAuditFlag()) {
-            //站内信
+            //站内信 【审核文章推送】
             MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
             insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
-                    .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(0));
+                    .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1));
             if (null != info.getAuditStatus() && 2 == info.getAuditStatus()) {
                 // 审核通过
                 info.setPubdate(new Date());
@@ -251,6 +259,14 @@ public class InfoService extends CrudService<InfoDao, Info> {
         }
         super.save(info);
 
+        CmAutoType byCmAutoType = cmAutoTypeMapper.getByCmAutoType(new CmAutoType().type("1").autoStatus("0"));  //获取推送配置
+        if (null != byCmAutoType) {
+            cmAutoTypeRecordService.addCmAutoTypeRecord(new CmAutoTypeRecord()                                   //新增推送记录
+                    .type("1")
+                    .autoStatus("0")
+                    .thisIds(Arrays.asList(info.getId()))
+            );
+        }
         if (flg) {
             infoDao.insertInfoPraise(info.getId());
         }

+ 15 - 19
src/main/java/com/caimei/modules/info/web/InfoController.java

@@ -1,23 +1,23 @@
 package com.caimei.modules.info.web;
 
-import java.util.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.alibaba.fastjson.JSONArray;
-import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.info.dao.InfoDao;
-import com.caimei.modules.info.entity.CmInfoDocSyn;
 import com.caimei.modules.info.entity.CmRelated;
+import com.caimei.modules.info.entity.Info;
+import com.caimei.modules.info.entity.InfoType;
 import com.caimei.modules.info.service.CmInfoDocSynService;
 import com.caimei.modules.info.service.CmRelatedService;
-import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.info.service.InfoService;
+import com.caimei.modules.info.service.InfoTypeService;
 import com.caimei.modules.opensearch.CoreServiceUitls;
+import com.caimei.modules.opensearch.GenerateUtils;
 import com.caimei.modules.product.dao.KeywordFrequencyDao;
 import com.caimei.modules.product.entity.SearchFrequencyVo;
 import com.caimei.redis.RedisService;
+import com.google.common.collect.Maps;
+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.apache.commons.collections.CollectionUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,15 +29,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.caimei.modules.info.entity.Info;
-import com.caimei.modules.info.entity.InfoType;
-import com.caimei.modules.info.service.InfoService;
-import com.caimei.modules.info.service.InfoTypeService;
-import com.google.common.collect.Maps;
-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 javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
 
 /**
  * 信息列表Controller
@@ -318,6 +313,7 @@ public class InfoController extends BaseController {
             return "redirect:" + Global.getAdminPath() + "/info/infoLabel/list";
         }
         info.setPublishSource(null == info.getPublishSource() ? 1 : info.getPublishSource());
+
         return "redirect:" + Global.getAdminPath() + "/info/info/list?repage&publishSource=" + info.getPublishSource();
     }
 

+ 18 - 16
src/main/java/com/caimei/modules/info/web/InfoTypeController.java

@@ -1,15 +1,18 @@
 package com.caimei.modules.info.web;
 
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.caimei.modules.hehe.util.UploadPicUtils;
+import com.caimei.modules.info.entity.Info;
+import com.caimei.modules.info.entity.InfoType;
+import com.caimei.modules.info.service.InfoService;
+import com.caimei.modules.info.service.InfoTypeService;
 import com.caimei.modules.landing.domain.CmBrandLanding;
 import com.caimei.modules.landing.service.CmBrandLandingService;
 import com.caimei.modules.opensearch.CoreServiceUitls;
+import com.caimei.modules.utils.DateUtil;
+import com.google.common.collect.Maps;
+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.apache.commons.collections.CollectionUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,15 +24,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.info.entity.Info;
-import com.caimei.modules.info.entity.InfoType;
-import com.caimei.modules.info.service.InfoService;
-import com.caimei.modules.info.service.InfoTypeService;
-import com.google.common.collect.Maps;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 信息分类Controller
@@ -184,7 +182,11 @@ public class InfoTypeController extends BaseController {
 
 	@RequestMapping(value = {"infoTypeLandingList" })
 	public String list(CmBrandLanding cmBrandLanding, HttpServletRequest request, HttpServletResponse response, Model model) {
+		if (null != cmBrandLanding.getEndPvCreateTime()) {
+			cmBrandLanding.setEndPvCreateTime(DateUtil.getEndTime(cmBrandLanding.getEndPvCreateTime()));
+		}
 		cmBrandLanding.setType(5);
+		cmBrandLanding.setStatisticsType("2");
 		Page<CmBrandLanding> page = cmBrandLandingService.findPage(new Page<CmBrandLanding>(request, response), cmBrandLanding);
 		model.addAttribute("cmBrandLanding", cmBrandLanding);
 		model.addAttribute("page", page);

+ 40 - 5
src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java

@@ -1,15 +1,14 @@
 package com.caimei.modules.landing.domain;
 
-import java.util.Date;
+import cn.hutool.core.date.DateUtil;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 import lombok.Data;
 import lombok.experimental.Accessors;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.ibatis.type.Alias;
 
 import java.io.Serializable;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -87,12 +86,48 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     /** 文件名称*/
     private List<CmBrandFiles> cmBrandFiles;
     /** 修改时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updateTime;
     /** 添加时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date addTime;
 
+
+    //点击量统计
+    /** 开始点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startPvCreateTime;
+    /** 结束点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endPvCreateTime;
+    /** 统计分类*/
+    private String statisticsType;
+
+    public String getStatisticsType() {
+        return statisticsType;
+    }
+
+    public void setStatisticsType(String statisticsType) {
+        this.statisticsType = statisticsType;
+    }
+
+    public Date getStartPvCreateTime() {
+        return startPvCreateTime;
+    }
+
+    public void setStartPvCreateTime(Date startPvCreateTime) {
+        this.startPvCreateTime = startPvCreateTime;
+    }
+
+    public Date getEndPvCreateTime() {
+        
+        return endPvCreateTime;
+    }
+
+    public void setEndPvCreateTime(Date endPvCreateTime) {
+        this.endPvCreateTime = endPvCreateTime;
+    }
+
     public Integer getPv() {
         return pv;
     }

+ 2 - 1
src/main/java/com/caimei/modules/newhome/dao/NewPageHomeimageDao.java

@@ -6,6 +6,7 @@ import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.newhome.entity.NewPageHomeimage;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -20,7 +21,7 @@ public interface NewPageHomeimageDao extends CrudDao<NewPageHomeimage> {
 
     void updateSort(@Param("id") String id, @Param("sort") String sort);
 
-    List<cmStatisticsType> getBannerStatistics();
+    List<cmStatisticsType> getBannerStatistics(@Param("startPvCreateTime") Date startPvCreateTime, @Param("endPvCreateTime")Date endPvCreateTime);
 
     String findBigSort();
 }

+ 50 - 0
src/main/java/com/caimei/modules/newhome/entity/NewPageFirstNavigation.java

@@ -1,8 +1,12 @@
 package com.caimei.modules.newhome.entity;
 
+import cn.hutool.core.date.DateUtil;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 import org.hibernate.validator.constraints.Length;
 
+import java.util.Date;
+
 /**
  * 新首页一级导航栏Entity
  *
@@ -46,6 +50,52 @@ public class NewPageFirstNavigation extends DataEntity<NewPageFirstNavigation> {
      */
     private String crmEnabledStatus;
 
+
+    //点击量统计
+    /** 开始点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startPvCreateTime;
+    /** 结束点击量时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endPvCreateTime;
+    /** 统计分类*/
+    private String statisticsType;
+    /** 点击量*/
+    private Integer pv;
+
+    public Date getStartPvCreateTime() {
+        return startPvCreateTime;
+    }
+
+    public void setStartPvCreateTime(Date startPvCreateTime) {
+        this.startPvCreateTime = startPvCreateTime;
+    }
+
+    public Date getEndPvCreateTime() {
+        
+        return endPvCreateTime;
+    }
+
+    public void setEndPvCreateTime(Date endPvCreateTime) {
+        this.endPvCreateTime = endPvCreateTime;
+    }
+
+    public String getStatisticsType() {
+        return statisticsType;
+    }
+
+    public void setStatisticsType(String statisticsType) {
+        this.statisticsType = statisticsType;
+    }
+
+    public Integer getPv() {
+        return pv;
+    }
+
+    public void setPv(Integer pv) {
+        this.pv = pv;
+    }
+
     public NewPageFirstNavigation() {
         super();
     }

+ 32 - 0
src/main/java/com/caimei/modules/newhome/entity/NewPageHomeimage.java

@@ -1,9 +1,13 @@
 package com.caimei.modules.newhome.entity;
 
+import cn.hutool.core.date.DateUtil;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.hibernate.validator.constraints.Length;
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 
+import java.util.Date;
+
 /**
  * 新首页轮播图Entity
  * @author ye.qin
@@ -23,6 +27,34 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 	private String crmEnabledStatus;		// CRM端状态 0停用 1启用
 	private Integer count;	// 点击次数
 
+
+	//点击量统计
+	/** 开始点击量时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date startPvCreateTime;
+	/** 结束点击量时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date endPvCreateTime;
+
+	public Date getStartPvCreateTime() {
+		return startPvCreateTime;
+	}
+
+	public void setStartPvCreateTime(Date startPvCreateTime) {
+		this.startPvCreateTime = startPvCreateTime;
+	}
+
+	public Date getEndPvCreateTime() {
+		
+		return endPvCreateTime;
+	}
+
+	public void setEndPvCreateTime(Date endPvCreateTime) {
+		this.endPvCreateTime = endPvCreateTime;
+	}
+
+
+
 	public NewPageHomeimage() {
 		super();
 	}

+ 5 - 2
src/main/java/com/caimei/modules/newhome/web/NewPageFirstNavigationController.java

@@ -1,10 +1,10 @@
 package com.caimei.modules.newhome.web;
 
-import com.caimei.constants.common.RedisKeyUtil;
 import com.caimei.modules.hehe.util.UploadPicUtils;
 import com.caimei.modules.newhome.entity.NewPageFirstNavigation;
 import com.caimei.modules.newhome.service.NewPageFirstNavigationService;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.utils.DateUtil;
 import com.caimei.redis.RedisService;
 import com.google.common.collect.Maps;
 import com.thinkgem.jeesite.common.config.Global;
@@ -13,7 +13,6 @@ import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -66,6 +65,10 @@ public class NewPageFirstNavigationController extends BaseController {
     @RequiresPermissions("newhome:newPageFirstNavigation:view")
     @RequestMapping(value = {"list", ""})
     public String list(NewPageFirstNavigation newPageFirstNavigation, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != newPageFirstNavigation.getEndPvCreateTime()) {
+            newPageFirstNavigation.setEndPvCreateTime(DateUtil.getEndTime(newPageFirstNavigation.getEndPvCreateTime()));
+        }
+        newPageFirstNavigation.setStatisticsType("4");
         Page<NewPageFirstNavigation> page = newPageFirstNavigationService.findPage(new Page<NewPageFirstNavigation>(request, response), newPageFirstNavigation);
         model.addAttribute("page", page);
         model.addAttribute("newPageFirstNavigation", newPageFirstNavigation);

+ 5 - 2
src/main/java/com/caimei/modules/newhome/web/NewPageHomeimageController.java

@@ -6,6 +6,7 @@ import com.caimei.modules.newhome.entity.NewPageHomeimage;
 import com.caimei.modules.newhome.entity.cmStatisticsType;
 import com.caimei.modules.newhome.service.NewPageHomeimageService;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.utils.DateUtil;
 import com.caimei.redis.RedisService;
 import com.caimei.vo.JsonModel;
 import com.google.common.collect.Maps;
@@ -14,7 +15,6 @@ import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -66,9 +66,12 @@ public class NewPageHomeimageController extends BaseController {
 
     @RequestMapping(value = {"list", ""})
     public String list(NewPageHomeimage newPageHomeimage, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != newPageHomeimage.getEndPvCreateTime()) {
+            newPageHomeimage.setEndPvCreateTime(DateUtil.getEndTime(newPageHomeimage.getEndPvCreateTime()));
+        }
         Page<NewPageHomeimage> page = newPageHomeimageService.findPage(new Page<NewPageHomeimage>(request, response), newPageHomeimage);
         // 点击次数
-        List<cmStatisticsType> bannerStatistics = newPageHomeimageDao.getBannerStatistics();
+        List<cmStatisticsType> bannerStatistics = newPageHomeimageDao.getBannerStatistics(newPageHomeimage.getStartPvCreateTime(),newPageHomeimage.getEndPvCreateTime());
         if (bannerStatistics.size() > 0) {
             for (NewPageHomeimage homeimage : page.getList()) {
                 List<cmStatisticsType> collect = bannerStatistics.stream().filter(b -> homeimage.getId().equals(b.getBannerId().toString())).collect(Collectors.toList());

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/CmPayShopDao.java

@@ -35,4 +35,6 @@ public interface CmPayShopDao extends CrudDao<CmPayShop> {
     List<Product> priceNum(@Param("orderNo") String orderNo);
 
     List<CmPayShop> payThirdParties(CmPayShop cmPayShop);
+
+    List<CmPayShop> findOtherList(CmPayShop cmPayShop);
 }

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

@@ -205,4 +205,6 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     OtherFeeDto findCmProfit(Integer shopOrderId);
 
     List<NewShopOrder> findByShopOrderIDsNot(@Param("ids") List<String> ids);
+
+    List<NewShopOrder> findPayOtherList(NewShopOrder shopOrder);
 }

+ 4 - 0
src/main/java/com/caimei/modules/order/entity/ChangePayShopOther.java

@@ -14,6 +14,10 @@ import java.util.Date;
  */
 @Data
 public class ChangePayShopOther implements Serializable {
+    /**
+     * 页面类型 1为账户归属供应商付款列表
+     */
+    private Integer otherType;
     /**
      * 采美中介费开户名
      */

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

@@ -1557,4 +1557,41 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             }
         }
     }
+
+    public Page<CmPayShop> findOtherList(Page<CmPayShop> cmPayShopPage, CmPayShop cmPayShop) {
+        cmPayShop.setPage(cmPayShopPage);
+        List<CmPayShop> payList = cmPayShopDao.findOtherList(cmPayShop);
+        for (CmPayShop payShop : payList) {
+            List<NewShopOrder> newShopOrders = cmPayShopDao.orderList(payShop.getId());
+            payShop.setShopOrders(newShopOrders);
+            if (payShop.getStatus().equals("2")) {
+                List<Integer> ids = new ArrayList<>();
+                for (NewShopOrder newShopOrder : newShopOrders) {
+                    ids.add(newShopOrder.getShopOrderID());
+                }
+                List<Integer> id = cmPayShopDao.hasReapply(payShop.getId(), ids);
+                if (id.isEmpty()) {
+                    //可以重申
+                    payShop.setRePayment("1");
+                } else {
+                    //不能重申
+                    payShop.setRePayment("2");
+                }
+            }
+            newShopOrders.forEach(shopOrder -> {
+                if (null != shopOrder) {
+                    NewOrder order = newOrderDao.findByOrderID(shopOrder.getOrderID());
+                    if (null != order && "2".equals(order.getOrderType())) {
+                        //呵呵商城订单
+                        shopOrder.setOrderType(2);
+                        if (StringUtils.isBlank(shopOrder.getClubName())) {
+                            String name = heHeNewOrderDao.findHeUser(order.getUserID());
+                            shopOrder.setClubName(name);
+                        }
+                    }
+                }
+            });
+        }
+        return cmPayShopPage.setList(payList);
+    }
 }

+ 12 - 0
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -1111,4 +1111,16 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
     public Double findProfit(Integer shopOrderID) {
         return newShopOrderDao.findCmProfit(shopOrderID).getCmProfit();
     }
+
+    public Page<NewShopOrder> findOtherList(Page<NewShopOrder> page, NewShopOrder shopOrder) {
+        shopOrder.setPage(page);
+        if (StringUtils.isNotBlank(shopOrder.getPayStatus())) {
+            String[] split = shopOrder.getPayStatus().split(",");
+            shopOrder.setPs(split);
+        }
+        List<NewShopOrder> payOrderList = newShopOrderDao.findPayOtherList(shopOrder);
+        page.setList(payOrderList);
+        setValue(payOrderList);
+        return page;
+    }
 }

+ 38 - 5
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -112,6 +112,33 @@ public class CmPayShopController extends BaseController {
         return "modules/order/cmPayFormList";
     }
 
+    @RequiresPermissions("order:cmPayShop:view")
+    @RequestMapping(value = "payOtherList")
+    public String payOtherList(CmPayShop cmPayShop, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != cmPayShop.getStartTime() && !"".equals(cmPayShop.getStartTime()) && !cmPayShop.getStartTime().endsWith("00:00:00")) {
+            model.addAttribute("startTime", cmPayShop.getStartTime());
+            cmPayShop.setStartTime(cmPayShop.getStartTime().trim() + " 00:00:00");
+        }
+        if (null != cmPayShop.getEndTime() && !"".equals(cmPayShop.getEndTime()) && !cmPayShop.getEndTime().endsWith("23:59:59")) {
+            model.addAttribute("endTime", cmPayShop.getEndTime());
+            cmPayShop.setEndTime(cmPayShop.getEndTime().trim() + " 23:59:59");
+        }
+        if (null != cmPayShop.getStartTime2() && !"".equals(cmPayShop.getStartTime2()) && !cmPayShop.getStartTime2().endsWith("00:00:00")) {
+            model.addAttribute("startTime2", cmPayShop.getStartTime2());
+            cmPayShop.setStartTime2(cmPayShop.getStartTime2().trim() + " 00:00:00");
+        }
+        if (null != cmPayShop.getEndTime2() && !"".equals(cmPayShop.getEndTime2()) && !cmPayShop.getEndTime2().endsWith("23:59:59")) {
+            model.addAttribute("endTime2", cmPayShop.getEndTime2());
+            cmPayShop.setEndTime2(cmPayShop.getEndTime2().trim() + " 23:59:59");
+        }
+        Page<CmPayShop> page = cmPayShopService.findOtherList(new Page<CmPayShop>(request, response), cmPayShop);
+        //获取组织列表
+        List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
+        model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
+        model.addAttribute("page", page);
+        return "modules/order/cmPayOtherFormList";
+    }
+
     @RequiresPermissions("order:cmPayShop:view")
     @RequestMapping(value = "payList")
     public String payList(CmPayShop cmPayShop, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -524,7 +551,7 @@ public class CmPayShopController extends BaseController {
 //        }
         if (1 == shopOrder.getCmAccountType()) {
             // 所有私账订单子订单利润算为付第三方采美中介费
-           shopOrder.setCmShopOtherFee(newShopOrderService.findProfit(shopOrder.getShopOrderID()));
+            shopOrder.setCmShopOtherFee(newShopOrderService.findProfit(shopOrder.getShopOrderID()));
         }
         shopOrder.setRebateOrder(newShopOrder.getRebateOrder());
         shopOrder.setSupplierFreight(freight); //运费
@@ -1018,7 +1045,7 @@ public class CmPayShopController extends BaseController {
      * 付第三方数据回显
      */
     @RequestMapping("shopOtherFeeForm")
-    public String shopOtherFeeForm(Integer shopOrderId, Integer payType, Model model) {
+    public String shopOtherFeeForm(Integer shopOrderId, Integer payType, Integer otherType, Model model) {
         ChangePayShopOther payShopOther = cmPayShopService.shopOtherFeeForm(shopOrderId);
         payShopOther.setShopOrderId(shopOrderId);
         NewShopOrder shopOrder = newShopOrderService.findByShopOrderID(shopOrderId);
@@ -1037,6 +1064,8 @@ public class CmPayShopController extends BaseController {
         model.addAttribute("shouldPayShopAmount", shopOrder.getShouldPayShopAmount());
         model.addAttribute("payShopOther", payShopOther);
         model.addAttribute("payType", payType);
+        otherType = null == otherType ? 0 : otherType;
+        model.addAttribute("otherType", otherType);
         return "modules/order/shopOtherFeeForm";
     }
 
@@ -1047,10 +1076,14 @@ public class CmPayShopController extends BaseController {
     public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
         cmPayShopService.saveShopOtherFee(payShopOther);
         addMessage(redirectAttributes, "保存成功");
-        if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType()) {
-            return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList?repage";
+        if (null != payShopOther.getOtherType() && 1 == payShopOther.getOtherType()) {
+            return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payOtherList?repage";
+        }else{
+            if ((null != payShopOther.getPayType() && 2 == payShopOther.getPayType()) || 2 == payShopOther.getRedirectType()) {
+                return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList?repage";
+            }
+            return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
         }
-        return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
     }
 
     /**

+ 23 - 0
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -111,6 +111,29 @@ public class CmShopOrderController extends BaseController {
         return "modules/order/cmPayShopList";
     }
 
+
+    @RequiresPermissions("order:cmPayShop:view")
+    @RequestMapping("payOtherList")
+    public String payOtherList(NewShopOrder newShopOrder, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if (null != newShopOrder.getStartTime() && !"".equals(newShopOrder.getStartTime()) && !newShopOrder.getStartTime().endsWith("00:00:00")) {
+            model.addAttribute("startTime", newShopOrder.getStartTime());
+            newShopOrder.setStartTime(newShopOrder.getStartTime().trim() + " 00:00:00");
+        }
+        if (null != newShopOrder.getEndTime() && !"".equals(newShopOrder.getEndTime()) && !newShopOrder.getEndTime().endsWith("23:59:59")) {
+            model.addAttribute("endTime", newShopOrder.getEndTime());
+            newShopOrder.setEndTime(newShopOrder.getEndTime().trim() + " 23:59:59");
+        }
+        Page<NewShopOrder> page = newShopOrderService.findOtherList(new Page<>(request, response), newShopOrder);
+
+        //获取组织列表
+        List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
+        model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
+        model.addAttribute("page", page);
+        model.addAttribute("operatingMode", newShopOrder.getOperatingMode());
+        //已付款子订单页面
+        return "modules/order/paidShopOtherList";
+    }
+
     /**
      * 申请付第三方
      *

+ 2 - 1
src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java

@@ -4,7 +4,6 @@ import com.caimei.modules.consult.entity.type.CmConsulttype;
 import com.caimei.modules.project.model.ServiceProviderModel;
 import com.caimei.modules.user.entity.*;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
 
@@ -96,4 +95,6 @@ public interface NewCmClubDao extends CrudDao<NewCmClub> {
     List<CmBehaviorRecord> selPageLable();
 
     List<easyExcel> findExcelList(ClubStatistics statistics);
+
+    List<String> getClubIds();
 }

+ 5 - 636
src/main/java/com/caimei/modules/user/entity/NewCmSp.java

@@ -1,22 +1,17 @@
 package com.caimei.modules.user.entity;
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
-import org.hibernate.validator.constraints.Length;
-
-import javax.validation.constraints.NotNull;
-import java.beans.Transient;
+import lombok.Data;
 import java.math.BigDecimal;
 import java.util.List;
 
-/**
- * 用户模块重构-协销人员管理Entity
- * @author liwentao
- * @version 2018-06-05
- */
+@Data
 public class NewCmSp extends DataEntity<NewCmSp> {
 
 	private static final long serialVersionUID = 1L;
-	private Integer serviceProviderID;		// serviceProviderID
+
+	private Integer insiderFlag;//内外部协销标记 0内部协销,1外部协销
+	private Integer serviceProviderID;
 	private Integer userID;		// 对应的userId
 	private String name;		// 名称
 	private String linkMan;		// 联系人(默认联系人)
@@ -37,48 +32,6 @@ public class NewCmSp extends DataEntity<NewCmSp> {
 	private Integer nolivelyClub;
 	private BigDecimal livelyClubProportion;
 	private BigDecimal nolivelyClubProportion;
-//	private String nameEn;		// 英文名
-//	private String site;		// 网址
-//	private String logo;		// 头像
-//	private String halfBodyImage;		// 半身照
-//	private String legalPerson;		// 法人代表
-//	private Integer townID;		// 所在县区Id
-//	private String address;		// 地址
-//
-//
-//
-//	private String fax;		// fax
-//	private String zipCode;		// 邮编
-//	private String registeredCapital;		// 注册资金
-//	private String turnover;		// turnover
-//	private String count;		// 团队人数
-//	private String count2;		// count2
-//
-//
-//	private String contractPhone;		// 联系人固定电话
-//	private String contractMobile;		// 联系人手机
-//	private String contractQQ;		// 联系人QQ
-//	private String wechat;		// 联系人微信
-//
-//	private String linkMan2;		// 联系人2
-//	private String duty2;		// 联系人2职务
-//	private String contractPhone2;		// 联系人2固定电话
-//	private String contractMobile2;		// 联系人2手机
-//	private String contractQQ2;		// 联系人2QQ
-//	private String wechat2;		// 联系人2微信
-//	private String contractEmail2;		// 联系人2邮箱
-//	private String info;		// 团队介绍
-//	private Double commissionRate;		// commissionRate
-//	private String provinceIDs;		// 服务区域Id
-//	private String provinceNames;		// 服务区域名称
-//	private Integer level;		// level
-//	private String payFlag;		// payFlag
-//	private String businessLicenseImage;		// 营业执照
-//	private String taxCertificateImage;		// 税务登记证
-//
-//	private Integer serviceLevelID;		// serviceLevelID
-//	private Integer typeID;		// typeID
-
 	private String businessScope;		// 专业领域
 	private String companyImage;		// 形象展示
 	private String cashDeposit;		// cashDeposit
@@ -89,588 +42,4 @@ public class NewCmSp extends DataEntity<NewCmSp> {
 	private String spIdentity; //前台身份展示
 	private String spStatusName; //前台状态展示
 	private String position; //职位 0=协销员工 =协销经理
-
-	public NewCmSp() {
-		super();
-	}
-
-	public NewCmSp(String id){
-		super(id);
-	}
-
-	public List<CmSaleMan> getTeams() {
-		return teams;
-	}
-
-	public Integer getLivelyClub() {
-		return livelyClub;
-	}
-
-	public void setLivelyClub(Integer livelyClub) {
-		this.livelyClub = livelyClub;
-	}
-
-	public Integer getNolivelyClub() {
-		return nolivelyClub;
-	}
-
-	public void setNolivelyClub(Integer nolivelyClub) {
-		this.nolivelyClub = nolivelyClub;
-	}
-
-	public BigDecimal getLivelyClubProportion() {
-		return livelyClubProportion;
-	}
-
-	public void setLivelyClubProportion(BigDecimal livelyClubProportion) {
-		this.livelyClubProportion = livelyClubProportion;
-	}
-
-	public BigDecimal getNolivelyClubProportion() {
-		return nolivelyClubProportion;
-	}
-
-	public void setNolivelyClubProportion(BigDecimal nolivelyClubProportion) {
-		this.nolivelyClubProportion = nolivelyClubProportion;
-	}
-
-	public void setTeams(List<CmSaleMan> teams) {
-		this.teams = teams;
-	}
-
-	@NotNull(message="serviceProviderID不能为空")
-	public Integer getServiceProviderID() {
-		return serviceProviderID;
-	}
-
-	public void setServiceProviderID(Integer serviceProviderID) {
-		this.serviceProviderID = serviceProviderID;
-	}
-
-	public Integer getUserID() {
-		return userID;
-	}
-
-	public void setUserID(Integer userID) {
-		this.userID = userID;
-	}
-
-	@Length(min=0, max=50, message="名称长度必须介于 0 和 50 之间")
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-//	@Length(min=0, max=00, message="英文名长度必须介于 0 和 00 之间")
-//	public String getNameEn() {
-//		return nameEn;
-//	}
-//
-//	public void setNameEn(String nameEn) {
-//		this.nameEn = nameEn;
-//	}
-//
-//	@Length(min=0, max=200, message="网址长度必须介于 0 和 200 之间")
-//	public String getSite() {
-//		return site;
-//	}
-//
-//	public void setSite(String site) {
-//		this.site = site;
-//	}
-//
-//	@Length(min=0, max=200, message="头像长度必须介于 0 和 200 之间")
-//	public String getLogo() {
-//		return logo;
-//	}
-//
-//	public void setLogo(String logo) {
-//		this.logo = logo;
-//	}
-//
-//	@Length(min=0, max=255, message="半身照长度必须介于 0 和 255 之间")
-//	public String getHalfBodyImage() {
-//		return halfBodyImage;
-//	}
-//
-//	public void setHalfBodyImage(String halfBodyImage) {
-//		this.halfBodyImage = halfBodyImage;
-//	}
-//
-//	@Length(min=0, max=20, message="法人代表长度必须介于 0 和 20 之间")
-//	public String getLegalPerson() {
-//		return legalPerson;
-//	}
-//
-//	public void setLegalPerson(String legalPerson) {
-//		this.legalPerson = legalPerson;
-//	}
-//
-//	public Integer getTownID() {
-//		return townID;
-//	}
-//
-//	public void setTownID(Integer townID) {
-//		this.townID = townID;
-//	}
-//
-//	@Length(min=0, max=00, message="地址长度必须介于 0 和 00 之间")
-//	public String getAddress() {
-//		return address;
-//	}
-//
-//	public void setAddress(String address) {
-//		this.address = address;
-//	}
-//
-//	@Length(min=0, max=50, message="联系电话长度必须介于 0 和 50 之间")
-//	public String getContractPhone() {
-//		return contractPhone;
-//	}
-//
-//	public void setContractPhone(String contractPhone) {
-//		this.contractPhone = contractPhone;
-//	}
-//
-//	@Length(min=0, max=20, message="联系手机长度必须介于 0 和 20 之间")
-//	public String getContractMobile() {
-//		return contractMobile;
-//	}
-//
-//	public void setContractMobile(String contractMobile) {
-//		this.contractMobile = contractMobile;
-//	}
-//
-//	@Length(min=0, max=50, message="fax长度必须介于 0 和 50 之间")
-//	public String getFax() {
-//		return fax;
-//	}
-//
-//	public void setFax(String fax) {
-//		this.fax = fax;
-//	}
-//
-//	@Length(min=0, max=0, message="邮编长度必须介于 0 和 0 之间")
-//	public String getZipCode() {
-//		return zipCode;
-//	}
-//
-//	public void setZipCode(String zipCode) {
-//		this.zipCode = zipCode;
-//	}
-//
-//	public String getRegisteredCapital() {
-//		return registeredCapital;
-//	}
-//
-//	public void setRegisteredCapital(String registeredCapital) {
-//		this.registeredCapital = registeredCapital;
-//	}
-//
-//	public String getTurnover() {
-//		return turnover;
-//	}
-//
-//	public void setTurnover(String turnover) {
-//		this.turnover = turnover;
-//	}
-//
-//	@Length(min=0, max=1, message="团队人数长度必须介于 0 和  之间")
-//	public String getCount() {
-//		return count;
-//	}
-//
-//	public void setCount(String count) {
-//		this.count = count;
-//	}
-//
-//	@Length(min=0, max=1, message="count2长度必须介于 0 和  之间")
-//	public String getCount2() {
-//		return count2;
-//	}
-//
-//	public void setCount2(String count2) {
-//		this.count2 = count2;
-//	}
-
-	@Length(min=0, max=50, message="联系人(默认联系人)长度必须介于 0 和 50 之间")
-	public String getLinkMan() {
-		return linkMan;
-	}
-
-	public void setLinkMan(String linkMan) {
-		this.linkMan = linkMan;
-	}
-
-	@Length(min=0, max=50, message="联系人职务长度必须介于 0 和 50 之间")
-	public String getDuty() {
-		return duty;
-	}
-
-	public void setDuty(String duty) {
-		this.duty = duty;
-	}
-
-//	@Length(min=0, max=50, message="联系人固定电话长度必须介于 0 和 50 之间")
-//	public String getContractPhone() {
-//		return contractPhone;
-//	}
-//
-//	public void setContractPhone(String contractPhone) {
-//		this.contractPhone = contractPhone;
-//	}
-//
-//	@Length(min=0, max=20, message="联系人手机长度必须介于 0 和 20 之间")
-//	public String getContractMobile() {
-//		return contractMobile;
-//	}
-//
-//	public void setContractMobile(String contractMobile) {
-//		this.contractMobile = contractMobile;
-//	}
-//
-//	@Length(min=0, max=20, message="联系人QQ长度必须介于 0 和 20 之间")
-//	public String getContractQQ() {
-//		return contractQQ;
-//	}
-//
-//	public void setContractQQ(String contractQQ) {
-//		this.contractQQ = contractQQ;
-//	}
-//
-//	@Length(min=0, max=50, message="联系人微信长度必须介于 0 和 50 之间")
-//	public String getWechat() {
-//		return wechat;
-//	}
-//
-//	public void setWechat(String wechat) {
-//		this.wechat = wechat;
-//	}
-
-	@Length(min=0, max=50, message="联系人邮箱长度必须介于 0 和 50 之间")
-	public String getContractEmail() {
-		return contractEmail;
-	}
-
-	public void setContractEmail(String contractEmail) {
-		this.contractEmail = contractEmail;
-	}
-
-//	@Length(min=0, max=50, message="联系人2长度必须介于 0 和 50 之间")
-//	public String getLinkMan2() {
-//		return linkMan2;
-//	}
-//
-//	public void setLinkMan2(String linkMan2) {
-//		this.linkMan2 = linkMan2;
-//	}
-//
-//	@Length(min=0, max=50, message="联系人2职务长度必须介于 0 和 50 之间")
-//	public String getDuty2() {
-//		return duty2;
-//	}
-//
-//	public void setDuty2(String duty2) {
-//		this.duty2 = duty2;
-//	}
-//
-//	@Length(min=0, max=50, message="联系人2固定电话长度必须介于 0 和 50 之间")
-//	public String getContractPhone2() {
-//		return contractPhone2;
-//	}
-//
-//	public void setContractPhone2(String contractPhone2) {
-//		this.contractPhone2 = contractPhone2;
-//	}
-//
-//	@Length(min=0, max=20, message="联系人2手机长度必须介于 0 和 20 之间")
-//	public String getContractMobile2() {
-//		return contractMobile2;
-//	}
-//
-//	public void setContractMobile2(String contractMobile2) {
-//		this.contractMobile2 = contractMobile2;
-//	}
-//
-//	@Length(min=0, max=20, message="联系人2QQ长度必须介于 0 和 20 之间")
-//	public String getContractQQ2() {
-//		return contractQQ2;
-//	}
-//
-//	public void setContractQQ2(String contractQQ2) {
-//		this.contractQQ2 = contractQQ2;
-//	}
-//
-//	@Length(min=0, max=50, message="联系人2微信长度必须介于 0 和 50 之间")
-//	public String getWechat2() {
-//		return wechat2;
-//	}
-//
-//	public void setWechat2(String wechat2) {
-//		this.wechat2 = wechat2;
-//	}
-//
-//	@Length(min=0, max=50, message="联系人2邮箱长度必须介于 0 和 50 之间")
-//	public String getContractEmail2() {
-//		return contractEmail2;
-//	}
-//
-//	public void setContractEmail2(String contractEmail2) {
-//		this.contractEmail2 = contractEmail2;
-//	}
-//
-//	@Length(min=0, max=500, message="团队介绍长度必须介于 0 和 500 之间")
-//	public String getInfo() {
-//		return info;
-//	}
-//
-//	public void setInfo(String info) {
-//		this.info = info;
-//	}
-//
-//	public Double getCommissionRate() {
-//		return commissionRate;
-//	}
-//
-//	public void setCommissionRate(Double commissionRate) {
-//		this.commissionRate = commissionRate;
-//	}
-//
-//	@Length(min=0, max=300, message="服务区域Id长度必须介于 0 和 300 之间")
-//	public String getProvinceIDs() {
-//		return provinceIDs;
-//	}
-//
-//	public void setProvinceIDs(String provinceIDs) {
-//		this.provinceIDs = provinceIDs;
-//	}
-//
-//	@Length(min=0, max=300, message="服务区域名称长度必须介于 0 和 300 之间")
-//	public String getProvinceNames() {
-//		return provinceNames;
-//	}
-//
-//	public void setProvinceNames(String provinceNames) {
-//		this.provinceNames = provinceNames;
-//	}
-//
-//	public Integer getLevel() {
-//		return level;
-//	}
-//
-//	public void setLevel(Integer level) {
-//		this.level = level;
-//	}
-//
-//	@Length(min=0, max=1, message="payFlag长度必须介于 0 和  之间")
-//	public String getPayFlag() {
-//		return payFlag;
-//	}
-//
-//	public void setPayFlag(String payFlag) {
-//		this.payFlag = payFlag;
-//	}
-//
-//	@Length(min=0, max=200, message="营业执照长度必须介于 0 和 200 之间")
-//	public String getBusinessLicenseImage() {
-//		return businessLicenseImage;
-//	}
-//
-//	public void setBusinessLicenseImage(String businessLicenseImage) {
-//		this.businessLicenseImage = businessLicenseImage;
-//	}
-//
-//	@Length(min=0, max=200, message="税务登记证长度必须介于 0 和 200 之间")
-//	public String getTaxCertificateImage() {
-//		return taxCertificateImage;
-//	}
-//
-//	public void setTaxCertificateImage(String taxCertificateImage) {
-//		this.taxCertificateImage = taxCertificateImage;
-//	}
-
-	@Length(min=0, max=1, message="审核状态长度必须介于 0 和  之间")
-	public String getAuditStatus() {
-		return auditStatus;
-	}
-
-	public void setAuditStatus(String auditStatus) {
-		this.auditStatus = auditStatus;
-	}
-
-	@Length(min=0, max=9, message="审核时间长度必须介于 0 和 9 之间")
-	public String getAuditTime() {
-		return auditTime;
-	}
-
-	public void setAuditTime(String auditTime) {
-		this.auditTime = auditTime;
-	}
-
-	@Length(min=0, max=00, message="审核信息长度必须介于 0 和 00 之间")
-	public String getAuditNote() {
-		return auditNote;
-	}
-
-	public void setAuditNote(String auditNote) {
-		this.auditNote = auditNote;
-	}
-
-	@Length(min=0, max=1, message="是否可用 可用长度必须介于 0 和  之间")
-	public String getValidFlag() {
-		return validFlag;
-	}
-
-	public void setValidFlag(String validFlag) {
-		this.validFlag = validFlag;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	@Length(min=0, max=9, message="创建时间长度必须介于 0 和 9 之间")
-	public String getAddTime() {
-		return addTime;
-	}
-
-	public void setAddTime(String addTime) {
-		this.addTime = addTime;
-	}
-
-//	public Integer getServiceLevelID() {
-//		return serviceLevelID;
-//	}
-//
-//	public void setServiceLevelID(Integer serviceLevelID) {
-//		this.serviceLevelID = serviceLevelID;
-//	}
-//
-//	public Integer getTypeID() {
-//		return typeID;
-//	}
-//
-//	public void setTypeID(Integer typeID) {
-//		this.typeID = typeID;
-//	}
-
-	public Integer getMainServiceProviderID() {
-		return mainServiceProviderID;
-	}
-
-	public void setMainServiceProviderID(Integer mainServiceProviderID) {
-		this.mainServiceProviderID = mainServiceProviderID;
-	}
-
-	@Length(min=0, max=255, message="专业领域长度必须介于 0 和 255 之间")
-	public String getBusinessScope() {
-		return businessScope;
-	}
-
-	public void setBusinessScope(String businessScope) {
-		this.businessScope = businessScope;
-	}
-
-	@Length(min=0, max=255, message="形象展示长度必须介于 0 和 255 之间")
-	public String getCompanyImage() {
-		return companyImage;
-	}
-
-	public void setCompanyImage(String companyImage) {
-		this.companyImage = companyImage;
-	}
-
-	public String getCashDeposit() {
-		return cashDeposit;
-	}
-
-	public void setCashDeposit(String cashDeposit) {
-		this.cashDeposit = cashDeposit;
-	}
-
-	@Length(min=0, max=1, message="experience长度必须介于 0 和  之间")
-	public String getExperience() {
-		return experience;
-	}
-
-	public void setExperience(String experience) {
-		this.experience = experience;
-	}
-
-	@Length(min=0, max=255, message="serviceItem长度必须介于 0 和 255 之间")
-	public String getServiceItem() {
-		return serviceItem;
-	}
-
-	public void setServiceItem(String serviceItem) {
-		this.serviceItem = serviceItem;
-	}
-
-	@Length(min=0, max=255, message="topPerformance长度必须介于 0 和 255 之间")
-	public String getTopPerformance() {
-		return topPerformance;
-	}
-
-	public void setTopPerformance(String topPerformance) {
-		this.topPerformance = topPerformance;
-	}
-
-	@Length(min=0, max=000, message="服务案例长度必须介于 0 和 000 之间")
-	public String getServiceCase() {
-		return serviceCase;
-	}
-
-	public void setServiceCase(String serviceCase) {
-		this.serviceCase = serviceCase;
-	}
-
-	@Transient
-	public String getSpIdentity() {
-		return spIdentity;
-	}
-
-	public void setSpIdentity(String spIdentity) {
-		this.spIdentity = spIdentity;
-	}
-	@Transient
-	public String getSpStatusName() {
-		return spStatusName;
-	}
-
-	public void setSpStatusName(String spStatusName) {
-		this.spStatusName = spStatusName;
-	}
-	@Transient
-	public String getPosition() {
-		return position;
-	}
-
-	public void setPosition(String position) {
-		this.position = position;
-	}
-
-	@Length(min=0, max=50, message="电话长度必须介于 0 和 50 之间")
-	public String getContractPhone() {
-		return contractPhone;
-	}
-
-	public void setContractPhone(String contractPhone) {
-		this.contractPhone = contractPhone;
-	}
-
-	@Length(min=0, max=50, message="电话长度必须介于 0 和 50 之间")
-	public String getContractMobile() {
-		return contractMobile;
-	}
-
-	public void setContractMobile(String contractMobile) {
-		this.contractMobile = contractMobile;
-	}
 }

+ 25 - 57
src/main/java/com/caimei/modules/user/web/newUser/SpController.java

@@ -196,58 +196,20 @@ public class SpController extends BaseController {
 
                             //站内信
                             MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
-                            insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)
-                                    .mqInfo(new MqInfo().topic("MessageLine").delay(1).async(1))
-                                    .info(new InsideMessage()
-                                            .userType(3)
-                                            .messageType(3)
-                                            .shopTieredType(2)
-                                            .name(newCmClub.getName())
-                                            .userName(newCmClub.getLinkMan())
-                                            .mobile(newCmClub.getContractMobile())
-                                            .superUserName(oldServiceprovider.getName())
-                                            .thisId(serviceProvider.getServiceProviderID())
-                                            .clubId(newCmClub.getClubID())
-                                    );
+                            insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE).mqInfo(new MqInfo().topic("MessageLine").delay(1).async(1)).info(new InsideMessage().userType(3).messageType(3).shopTieredType(2).name(newCmClub.getName()).userName(newCmClub.getLinkMan()).mobile(newCmClub.getContractMobile()).superUserName(oldServiceprovider.getName()).thisId(serviceProvider.getServiceProviderID()).clubId(newCmClub.getClubID()));
                             MessageUtil.sendMessage(insideMessageMessageModel);
-                            if(1342!=serviceProvider.getServiceProviderID()){
-                                insideMessageMessageModel.info(new InsideMessage()
-                                        .userType(3)
-                                        .messageType(3)
-                                        .shopTieredType(3)
-                                        .name(newCmClub.getName())
-                                        .userName(newCmClub.getLinkMan())
-                                        .mobile(newCmClub.getContractMobile())
-                                        .superUserName(serviceProvider.getName())
-                                        .thisId(oldServiceprovider.getServiceProviderID())
-                                        .clubId(newCmClub.getClubID())
-                                );
+                            if (1342 != serviceProvider.getServiceProviderID()) {
+                                insideMessageMessageModel.info(new InsideMessage().userType(3).messageType(3).shopTieredType(3).name(newCmClub.getName()).userName(newCmClub.getLinkMan()).mobile(newCmClub.getContractMobile()).superUserName(serviceProvider.getName()).thisId(oldServiceprovider.getServiceProviderID()).clubId(newCmClub.getClubID()));
                                 MessageUtil.sendMessage(insideMessageMessageModel);
-                                insideMessageMessageModel.info(new InsideMessage()
-                                        .userType(1)
-                                        .messageType(3)
-                                        .shopTieredType(6)
-                                        .userName(serviceProvider.getName())
-                                        .mobile(serviceProvider.getContractMobile())
-                                        .clubId(newCmClub.getClubID())
-                                );
+                                insideMessageMessageModel.info(new InsideMessage().userType(1).messageType(3).shopTieredType(6).userName(serviceProvider.getName()).mobile(serviceProvider.getContractMobile()).clubId(newCmClub.getClubID()));
                                 MessageUtil.sendMessage(insideMessageMessageModel);
                                 SMSUtils.sendSms(4, newCmClub.getContractMobile(), "【采美365】因公司内部人员调整需要,采美平台已为您更换客户经理。客户经理【" + serviceProvider.getName() + "】,手机号【" + serviceProvider.getContractMobile() + "】。");
                                 SMSUtils.sendSms(4, serviceProvider.getContractMobile(), "【采美365】系统已为你分配机构客户,请及时跟进。机构名称【" + newCmClub.getName() + "】,联系人【" + newCmClub.getLinkMan() + "】,手机号【" + newCmClub.getContractMobile() + "】,上一任销售【" + oldServiceprovider.getName() + "】。");
                                 SMSUtils.sendSms(4, oldServiceprovider.getContractMobile(), "【采美365】系统已将你的机构客户转移给其他销售人员,你已无权管理该客户。机构名称【" + newCmClub.getName() + "】,联系人【" + newCmClub.getLinkMan() + "】,手机号【" + newCmClub.getContractMobile() + "】,下一任销售【" + serviceProvider.getName() + "】。");
-                            }else {
-                                insideMessageMessageModel.info(new InsideMessage()
-                                        .userType(3)
-                                        .messageType(3)
-                                        .shopTieredType(8)
-                                        .name(newCmClub.getName())
-                                        .userName(newCmClub.getLinkMan())
-                                        .mobile(newCmClub.getContractMobile())
-                                        .thisId(oldServiceprovider.getServiceProviderID())
-                                        .clubId(newCmClub.getClubID())
-                                );
+                            } else {
+                                insideMessageMessageModel.info(new InsideMessage().userType(3).messageType(3).shopTieredType(8).name(newCmClub.getName()).userName(newCmClub.getLinkMan()).mobile(newCmClub.getContractMobile()).thisId(oldServiceprovider.getServiceProviderID()).clubId(newCmClub.getClubID()));
                                 MessageUtil.sendMessage(insideMessageMessageModel);
-                                SMSUtils.sendSms(4, oldServiceprovider.getContractMobile(), "【采美365】系统已将你的机构客户进行回收,你已无权管理该客户。机构名称【" + newCmClub.getName() + "】,联系人【"+ newCmClub.getLinkMan() +"】,手机号【"+ newCmClub.getContractMobile() +"】。");
+                                SMSUtils.sendSms(4, oldServiceprovider.getContractMobile(), "【采美365】系统已将你的机构客户进行回收,你已无权管理该客户。机构名称【" + newCmClub.getName() + "】,联系人【" + newCmClub.getLinkMan() + "】,手机号【" + newCmClub.getContractMobile() + "】。");
                             }
                             // 分配协销发送微信模板消息
                             List<String> openidList = newShopOrderDao.getOpenidListByPermission(serviceProvider.getUnionId());
@@ -351,12 +313,12 @@ public class SpController extends BaseController {
     public String cmSpLivelyClubList(NewCmSp newCmSp, HttpServletRequest request, HttpServletResponse response, Model model) {
         newCmSp.setStatus(90);
         Page<NewCmSp> page = cmSpService.findPage(new Page<NewCmSp>(request, response), newCmSp);
-        page.getList().forEach(s->{
+        page.getList().forEach(s -> {
             Map<String, Object> spUserLoginSum = cmSpService.findSpUserLoginSum(s.getServiceProviderID().toString());
             Integer loginSum = Integer.valueOf(spUserLoginSum.get("loginSum").toString());
             Integer not_loginSum = Integer.valueOf(spUserLoginSum.get("not_loginSum").toString());
             //        机构活跃与不活跃占比计算方法,例如:机构活跃数/机构活跃数+机构不活跃数(60/(60+30)=0.666...),保留小数点后2位,四舍五入,0.67;
-            BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ?(double) loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
+            BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ? (double) loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
             s.setLivelyClub(loginSum);
             s.setNolivelyClub(not_loginSum);
             s.setLivelyClubProportion(livelyClubProportion);
@@ -366,7 +328,7 @@ public class SpController extends BaseController {
         Integer loginSum = Integer.valueOf(spUserLoginSum.get("loginSum").toString());
         Integer not_loginSum = Integer.valueOf(spUserLoginSum.get("not_loginSum").toString());
         //        机构活跃与不活跃占比计算方法,例如:机构活跃数/机构活跃数+机构不活跃数(60/(60+30)=0.666...),保留小数点后2位,四舍五入,0.67;
-        BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ?(double) loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
+        BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ? (double) loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
         model.addAttribute("livelyClub", loginSum);
         model.addAttribute("nolivelyClub", not_loginSum);
         model.addAttribute("livelyClubProportion", livelyClubProportion);
@@ -376,7 +338,6 @@ public class SpController extends BaseController {
     }
 
 
-
     /**
      * 功能描述: 机构活跃分析查看详情
      *
@@ -389,7 +350,7 @@ public class SpController extends BaseController {
      */
     @RequestMapping(value = {"cmSpLivelyClubFrom"})
     public String cmSpLivelyClubFrom(NewCmClub newCmClub, HttpServletRequest request, HttpServletResponse response, Model model) {
-        if (StringUtils.isBlank(newCmClub.getStartLoginTime())&&StringUtils.isBlank(newCmClub.getEndLoginTime())) {
+        if (StringUtils.isBlank(newCmClub.getStartLoginTime()) && StringUtils.isBlank(newCmClub.getEndLoginTime())) {
             Calendar calendar = Calendar.getInstance();
             calendar.add(Calendar.MONTH, -6);
             newCmClub.setStartLoginTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
@@ -400,7 +361,7 @@ public class SpController extends BaseController {
         Integer loginSum = Integer.valueOf(spUserLoginSum.get("loginSum").toString());
         Integer not_loginSum = Integer.valueOf(spUserLoginSum.get("not_loginSum").toString());
         //        机构活跃与不活跃占比计算方法,例如:机构活跃数/机构活跃数+机构不活跃数(60/(60+30)=0.666...),保留小数点后2位,四舍五入,0.67;
-        BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ? (double)loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
+        BigDecimal livelyClubProportion = new BigDecimal((loginSum + not_loginSum) != 0 ? (double) loginSum / (loginSum + not_loginSum) * 100 : 0).setScale(2, RoundingMode.UP);
         model.addAttribute("livelyClub", loginSum);
         model.addAttribute("nolivelyClub", not_loginSum);
         model.addAttribute("livelyClubProportion", livelyClubProportion);
@@ -411,7 +372,6 @@ public class SpController extends BaseController {
     }
 
 
-
     /**
      * 添加协销人员
      *
@@ -482,6 +442,9 @@ public class SpController extends BaseController {
             cmSp.setDuty(com.caimei.constants.UserType.SERVICEPROVIDER.getDesc());
             cmUser.setRegisterUserTypeID(com.caimei.constants.UserType.SERVICEEMPLOYEE.getCode() + "");
         } else {
+            // 0内部协销,2外部协销,user表身份都存协销,外部协销额外字段进行区分
+            Integer flag = "2".equals(duty) ? 1 : 0;
+            cmSp.setInsiderFlag(flag);
             cmSp.setDuty(com.caimei.constants.UserType.SERVICEEMPLOYEE.getDesc());
             cmUser.setRegisterUserTypeID(UserType.SERVICEEMPLOYEE.getCode() + "");
         }
@@ -594,10 +557,11 @@ public class SpController extends BaseController {
         }
         if (cmUser.getRegisterUserTypeID().equals(UserType.SERVICEEMPLOYEE.getCode() + "")) {
             newCmSp.setPosition("0");
+            if (1 == newCmSp.getInsiderFlag()) {
+                newCmSp.setPosition("2");
+            }
         }
         model.addAttribute("newCmSp", newCmSp);
-        positionMap.put("0", UserType.SERVICEEMPLOYEE.getDesc());
-        model.addAttribute("positionMap", positionMap);
         return "modules/userNew/cmSpEdit";
     }
 
@@ -621,11 +585,15 @@ public class SpController extends BaseController {
                 addMessage(model, "已经存在协销经理了");
                 return "redirect:" + Global.getAdminPath() + "/new/user/cmSp/cmSpList/?repage";
             }
-            cmUser.setRegisterUserTypeID(UserType.SERVICEPROVIDER.getCode() + ""); // 设置为协销经理
+            // 设置为协销经理
+            cmUser.setRegisterUserTypeID(UserType.SERVICEPROVIDER.getCode() + "");
         }
 
-        if ("0".equals(newCmSp.getPosition())) {
-            cmUser.setRegisterUserTypeID(UserType.SERVICEEMPLOYEE.getCode() + ""); // 设置为协销员工
+        if ("0".equals(newCmSp.getPosition()) || "2".equals(newCmSp.getPosition())) {
+            // 设置为协销员工
+            cmUser.setRegisterUserTypeID(UserType.SERVICEEMPLOYEE.getCode() + "");
+            Integer flag = "2".equals(newCmSp.getPosition()) ? 1 : 0;
+            newCmSp.setInsiderFlag(flag);
         }
         newCmSp.setName(newCmSp.getLinkMan());
         cmUser.setMobile(newCmSp.getContractMobile());

+ 43 - 5
src/main/java/com/caimei/modules/utils/DateUtil.java

@@ -65,11 +65,49 @@ public class DateUtil {
         return format;
     }
 
-//    public static void main(String[] args) throws ParseException {
-//        String month = "2020-02";
-//        System.out.println(getMinDateMonth(month));
-//        System.out.println(getMaxDateMonth(month));
-//    }
+    /**
+     * 时间yyyy-mm格式
+     *
+     * @return
+     */
+    public static String format(Date date) {
+        String format = new SimpleDateFormat("yyyy-MM").format(date);
+        return format;
+    }
+
+    /**
+     * 获取当天00:00:00的时间戳
+     *
+     * @return 时间戳
+     */
+    public static Date getStartTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        return calendar.getTime();
+    }
+
+    /**
+     * 获取当天23:59:59的时间戳
+     *
+     * @return 时间戳
+     */
+    public static Date getEndTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        return calendar.getTime();
+    }
+
+    //    public static void main(String[] args) throws ParseException {
+    //        String month = "2020-02";
+    //        System.out.println(getMinDateMonth(month));
+    //        System.out.println(getMaxDateMonth(month));
+    //    }
 
 
 }

+ 53 - 23
src/main/java/com/caimei/modules/utils/MessageUtil.java

@@ -1,20 +1,18 @@
 package com.caimei.modules.utils;
 
 import com.alibaba.fastjson.JSONObject;
-import com.caimei.modules.utils.message.InsideMessage;
 import com.caimei.modules.utils.message.MessageModel;
 import com.caimei.modules.utils.message.MqInfo;
 import com.caimei.modules.utils.message.WechatTemplateMessage;
 import com.caimei.modules.utils.message.enums.MessageType;
-import com.caimei.utils.HttpRequest;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.thinkgem.jeesite.common.config.Global;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
 
 public class MessageUtil {
     protected static Logger logger = LoggerFactory.getLogger(MessageUtil.class);
@@ -23,10 +21,8 @@ public class MessageUtil {
         try {
             String coreServer = Global.getConfig("caimei.core");
             String url = coreServer + "/tools/message/send";
-            logger.info("url>>>>" + url);
             String result = RequestUtil.sendPost(url, new ObjectMapper().writeValueAsString(model),"application/json");
             JSONObject parseObject = JSONObject.parseObject(result);
-            System.out.println(parseObject);
             Integer code = parseObject.getInteger("code");
             if (code != 0) {
                 logger.info("审批消息推送失败>>>>" + model.info());
@@ -40,27 +36,61 @@ public class MessageUtil {
     }
 
     public static void main(String[] args) {
-
         //微信模板消息
-        ArrayList<String> keyWords = new ArrayList<>();
-        keyWords.add("name"+"...等"+7+"家机构客户");
-        keyWords.add("pageLabel");
-        keyWords.add("2023-09-18");
+        // ArrayList<String> keyWords = new ArrayList<>();
+        // keyWords.add("2023-06-10");
+        // keyWords.add("2023-06-10");
+        // keyWords.add("2023-06-10");
+        // keyWords.add("2023-06-10");
+        Map<String,Object> keyWords = new HashMap<>();
+        keyWords.put("character_string3","2023-06-10");
+        keyWords.put("time10","2023-06-10");
+        keyWords.put("thing9","2023-06-10");
+        keyWords.put("character_string8","2023-06-10");
         MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<WechatTemplateMessage>()
                 .code(MessageType.WECHAT_TEMPLATE_MESSAGE)
-                .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(0))
+                .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1))
                 .info(new WechatTemplateMessage()
-                        .first("")
-//                        .openId("o9nzn5yD6IOcFuhG4b3OG1droVJw")
-//                        .openId("o9nzn51aTKY5u26FDoD5zf0wU6UM")
-                        .openId("o9nzn581OysHNNsDwJJlzKpWoQ4o")
-                        .appid("wxf3cd4ae0cdd11c36")
-                        .templateId("Zd7ewJw9-bN-gIgra9flKW96W3YehikRPPkDXPfhmQ0")
-                        .keyWords(keyWords)
-                        .remark("为了更好给您服务,请及时联系采美客服!")
-                        .pagePath("pages/seller/notice/service/Institutional_visits?spId="+1340+"&accDateTime="+"2023-09-18"));
-//                        .pagePath("pages/seller/notice/service/visits_details?spId="+1340+"&clubId="+"99930"+"&accessTime="+"2023-09-18"));
+                        .type("2")
+                        .templateType("2")
+                        .first("hgfhfgh")
+                        .openId("oIsyY5njDnjzjR8nghD0axsw34t8")
+                        .appid("wx2c3b0a7f343235b1")
+                        .templateId("0Ruf-Ypu0Eahk0vY9orVN0-QqE0auk2N89LqjtGq4p8")
+                        // .keyWords(keyWords)
+                        .mapKeyWords(keyWords)
+                        .remark("个地方刚发的")
+                        .pagePath("pages/views/order/order-detail?orderId="+18691)
+                );
+        String join = StringUtils.join(wechatTemplateMessageMessageModel.getInfo().getKeyWords(), ",");
+        if(join.contains("},{")){
+            join = join.replace("},{", ",");
+        }
+        JSONObject jsonObject = JSONObject.parseObject(join);
+                System.out.println(jsonObject);
         sendMessage(wechatTemplateMessageMessageModel);
+
+//         //微信模板消息
+//         ArrayList<String> keyWords = new ArrayList<>();
+//         keyWords.add("name"+"...等"+7+"家机构客户");
+//         keyWords.add("pageLabel");
+//         keyWords.add("2023-09-18");
+//         MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<WechatTemplateMessage>()
+//                 .code(MessageType.WECHAT_TEMPLATE_MESSAGE)
+//                 .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(0))
+//                 .info(new WechatTemplateMessage()
+//                         // .type("2")
+//                         .first("")
+//                        .openId("o9nzn5yD6IOcFuhG4b3OG1droVJw")
+// //                        .openId("o9nzn51aTKY5u26FDoD5zf0wU6UM")
+// //                         .openId("o9nzn581OysHNNsDwJJlzKpWoQ4o")
+//                         .appid("wxf3cd4ae0cdd11c36")
+//                         .templateId("Zd7ewJw9-bN-gIgra9flKW96W3YehikRPPkDXPfhmQ0")
+//                         .keyWords(keyWords)
+//                         .remark("为了更好给您服务,请及时联系采美客服!")
+//                         .pagePath("pages/seller/notice/service/Institutional_visits?spId="+1340+"&accDateTime="+"2023-09-18"));
+// //                        .pagePath("pages/seller/notice/service/visits_details?spId="+1340+"&clubId="+"99930"+"&accessTime="+"2023-09-18"));
+//         sendMessage(wechatTemplateMessageMessageModel);
 //        //站内信
 //        MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
 //        insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)

+ 39 - 0
src/main/java/com/caimei/modules/utils/message/WechatTemplateMessage.java

@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
 import javax.validation.constraints.NotNull;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 @Data
 @Accessors(fluent = true)
@@ -65,6 +66,10 @@ public class WechatTemplateMessage {
      */
     @NotNull
     private JSONObject remark;
+    /**
+     * 模板消息的公众号
+     */
+    private String type;
     /**
      * 所需跳转到的小程序appid(该小程序 appid 必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏)
      */
@@ -80,6 +85,11 @@ public class WechatTemplateMessage {
      */
     @NotNull
     private String templateId;
+
+    /**
+     * 模板type:1模板消息,2类目模板消息
+     */
+    private String templateType;
     /**
      * 模板跳转链接
      */
@@ -100,6 +110,22 @@ public class WechatTemplateMessage {
     private JSONObject data;
     private JSONObject json;
 
+    public String getTemplateType() {
+        return templateType;
+    }
+
+    public void setTemplateType(String templateType) {
+        this.templateType = templateType;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
     public JSONObject getFirst() {
         return first;
     }
@@ -179,6 +205,19 @@ public class WechatTemplateMessage {
         return this;
     }
 
+    public WechatTemplateMessage mapKeyWords(Map<String,Object> words) {
+        List<JSONObject> collect = new ArrayList<>();
+        words.forEach((key, value) -> {
+            JSONObject jsonValue = new JSONObject();
+            jsonValue.put("value",value);
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put(key, jsonValue);
+            collect.add(jsonObject);
+        });
+        this.setKeyWords(collect);
+        return this;
+    }
+
     public void setKeyWords(List<JSONObject> keyWords) {
         this.keyWords = keyWords;
     }

+ 12 - 0
src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java

@@ -36,6 +36,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return DateFormatUtils.format(new Date(), pattern);
     }
 
+    /**
+     * 得到当前日期字符串 格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
+     */
+    public static String setDate(Date date, String pattern) {
+        if (date == null) {
+            return null;
+        }
+        return DateFormatUtils.format(date, pattern);
+    }
+
     /**
      * 得到日期字符串 默认格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
      */
@@ -49,6 +59,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return formatDate;
     }
 
+
     /**
      * 得到日期时间字符串,转换格式(yyyy-MM-dd HH:mm:ss)
      */
@@ -56,6 +67,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return formatDate(date, "yyyy-MM-dd HH:mm:ss");
     }
 
+
     /**
      * 得到当前时间字符串 格式(HH:mm:ss)
      */

+ 167 - 0
src/main/resources/mappings/modules/autoType/CmAutoTypeMapper.xml

@@ -0,0 +1,167 @@
+<?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.autoType.mapper.CmAutoTypeMapper">
+
+    <resultMap type="CmAutoType" id="CmAutoTypeResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="autoStatus"    column="autoStatus"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="updateTime"    column="updateTime"    />
+        <result property="createTime"    column="createTime"    />
+    </resultMap>
+
+    <sql id="selectCmAutoTypeVo">
+        select
+            cm_auto_type.id,
+            cm_auto_type.type,
+            cm_auto_type.autoStatus,
+            cm_auto_type.delFlag,
+            cm_auto_type.updateTime,
+            cm_auto_type.createTime
+    </sql>
+
+    <select id="getByCmAutoType" parameterType="CmAutoType" resultMap="CmAutoTypeResult">
+        <include refid="selectCmAutoTypeVo"/>
+        from cm_auto_type AS cm_auto_type
+        <where>  cm_auto_type.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type.type = #{type}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type.id
+        limit 0,1
+    </select>
+
+    <select id="findList" parameterType="CmAutoType" resultMap="CmAutoTypeResult">
+        <include refid="selectCmAutoTypeVo"/>
+        from cm_auto_type AS cm_auto_type
+        <where>  cm_auto_type.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''">
+                and cm_auto_type.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type.id
+        order by cm_auto_type.createTime desc
+    </select>
+
+    <select id="getCmAutoTypeList" parameterType="CmAutoType" resultMap="CmAutoTypeResult">
+        <include refid="selectCmAutoTypeVo"/>
+        from cm_auto_type AS cm_auto_type
+        <where>  cm_auto_type.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''">
+                and cm_auto_type.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type.id
+        order by cm_auto_type.createTime desc
+    </select>
+
+    <select id="getCount" parameterType="CmAutoType" resultType="int">
+        select count(1)
+        from cm_auto_type AS cm_auto_type
+        <where>  cm_auto_type.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type.type = #{type}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+    </select>
+
+    <select id="get" parameterType="String" resultMap="CmAutoTypeResult">
+        <include refid="selectCmAutoTypeVo"/>
+        from cm_auto_type AS cm_auto_type
+        where  cm_auto_type.delFlag = 0 and cm_auto_type.id = #{id}
+    </select>
+
+    <select id="getCmAutoTypeById" parameterType="String" resultMap="CmAutoTypeResult">
+        <include refid="selectCmAutoTypeVo"/>
+        from cm_auto_type AS cm_auto_type
+        where  cm_auto_type.delFlag = 0 and cm_auto_type.id = #{id}
+    </select>
+
+    <select id="getById" parameterType="CmAutoType" resultType="String">
+        select id
+        from cm_auto_type AS cm_auto_type
+        <where>  cm_auto_type.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type.type = #{type}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type.id
+        limit 0,1
+    </select>
+
+    <insert id="addCmAutoType" parameterType="CmAutoType" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_auto_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != '' and id != ''">id,</if>
+            <if test="type != null and type != ''">type,</if>
+            <if test="autoStatus != null and autoStatus != ''">autoStatus,</if>
+            <if test="delFlag != null">delFlag,</if>
+            <if test="updateTime != null">updateTime,</if>
+            <if test="createTime != null">createTime,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != '' and id != ''">#{id},</if>
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="autoStatus != null and autoStatus != ''">#{autoStatus},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmAutoType" parameterType="CmAutoType">
+        update cm_auto_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="autoStatus != null and autoStatus != ''">autoStatus = #{autoStatus},</if>
+            <if test="delFlag != null">delFlag = #{delFlag},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+            <if test="createTime != null">createTime = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="delCmAutoTypeById" parameterType="String">
+        delete
+        from cm_auto_type where id = #{id}
+    </delete>
+
+    <delete id="delCmAutoType" parameterType="CmAutoType">
+        delete
+        from cm_auto_type AS cm_auto_type
+        <where>
+            <if test="id != null and id != '' "> and cm_auto_type.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type.type = #{type}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type.autoStatus = #{autoStatus}</if>
+        </where>
+    </delete>
+
+</mapper>

+ 200 - 0
src/main/resources/mappings/modules/autoType/CmAutoTypeRecordMapper.xml

@@ -0,0 +1,200 @@
+<?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.autoType.mapper.CmAutoTypeRecordMapper">
+
+    <resultMap type="CmAutoTypeRecord" id="CmAutoTypeRecordResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="authorId"    column="authorId"    />
+        <result property="autoStatus"    column="autoStatus"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="updateTime"    column="updateTime"    />
+        <result property="createTime"    column="createTime"    />
+    </resultMap>
+
+    <sql id="selectCmAutoTypeRecordVo">
+        select
+            cm_auto_type_record.id,
+            cm_auto_type_record.type,
+            cm_auto_type_record.authorId,
+            cm_auto_type_record.autoStatus,
+            cm_auto_type_record.delFlag,
+            cm_auto_type_record.updateTime,
+            cm_auto_type_record.createTime
+    </sql>
+
+    <select id="getByCmAutoTypeRecord" parameterType="CmAutoTypeRecord" resultMap="CmAutoTypeRecordResult">
+        <include refid="selectCmAutoTypeRecordVo"/>
+        from cm_auto_type_record AS cm_auto_type_record
+        <where>  cm_auto_type_record.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type_record.type = #{type}</if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type_record.id
+        limit 0,1
+    </select>
+
+    <select id="getCmAutoTypeRecordList" parameterType="CmAutoTypeRecord" resultMap="CmAutoTypeRecordResult">
+        <include refid="selectCmAutoTypeRecordVo"/>
+        from cm_auto_type_record AS cm_auto_type_record
+        <where>  cm_auto_type_record.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''">
+                and cm_auto_type_record.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+
+        </where>
+        group by cm_auto_type_record.id
+        order by cm_auto_type_record.createTime desc
+    </select>
+
+    <select id="findList" parameterType="CmAutoTypeRecord" resultMap="CmAutoTypeRecordResult">
+        <include refid="selectCmAutoTypeRecordVo"/>
+        <if test="type != null  and type == 1">
+            ,i.guidanceImage as image ,i.title
+        </if>
+        <if test="type != null  and type == 2">
+            ,cpi.image ,cpi.title
+        </if>
+        from cm_auto_type_record AS cm_auto_type_record
+        <if test="type != null  and type == 1">
+            LEFT JOIN info i ON cm_auto_type_record.type =1 and cm_auto_type_record.authorId=i.id
+        </if>
+        <if test="type != null  and type == 2">
+            LEFT JOIN cm_page_image cpi ON cm_auto_type_record.type =2 and cm_auto_type_record.authorId=cpi.id
+        </if>
+        <where>  cm_auto_type_record.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''">
+                and cm_auto_type_record.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+            <if test="startPvCreateTime != null ">AND cm_auto_type_record.createTime >= #{startPvCreateTime} </if>
+            <if test="endPvCreateTime != null ">AND cm_auto_type_record.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>
+            <if test="type != null  and type == 1">
+                <if test="image != null and image != ''"> and i.guidanceImage = #{image}</if>
+                <if test="title != null and title != ''"> and i.title = #{title}</if>
+            </if>
+            <if test="type != null  and type == 2">
+                <if test="image != null and image != ''"> and cpi.image = #{image}</if>
+                <if test="title != null and title != ''"> and cpi.title = #{title}</if>
+            </if>
+        </where>
+        group by cm_auto_type_record.id
+        order by cm_auto_type_record.createTime desc
+    </select>
+
+    <select id="getCount" parameterType="CmAutoTypeRecord" resultType="int">
+        select count(1)
+        from cm_auto_type_record AS cm_auto_type_record
+        <where>  cm_auto_type_record.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type_record.type = #{type}</if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+        </where>
+    </select>
+
+    <select id="get" parameterType="String" resultMap="CmAutoTypeRecordResult">
+        <include refid="selectCmAutoTypeRecordVo"/>
+        from cm_auto_type_record AS cm_auto_type_record
+        where  cm_auto_type_record.delFlag = 0 and cm_auto_type_record.id = #{id}
+    </select>
+
+    <select id="getCmAutoTypeRecordById" parameterType="String" resultMap="CmAutoTypeRecordResult">
+        <include refid="selectCmAutoTypeRecordVo"/>
+        from cm_auto_type_record AS cm_auto_type_record
+        where  cm_auto_type_record.delFlag = 0 and cm_auto_type_record.id = #{id}
+    </select>
+
+
+    <select id="getById" parameterType="CmAutoTypeRecord" resultType="String">
+        select id
+        from cm_auto_type_record AS cm_auto_type_record
+        <where>  cm_auto_type_record.delFlag = 0
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type_record.type = #{type}</if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+        </where>
+        group by cm_auto_type_record.id
+        limit 0,1
+    </select>
+
+    <insert id="addCmAutoTypeRecord" parameterType="CmAutoTypeRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_auto_type_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null and type != ''">type,</if>
+            <if test="authorId != null">authorId,</if>
+            <if test="autoStatus != null and autoStatus != ''">autoStatus,</if>
+            <if test="delFlag != null">delFlag,</if>
+            <if test="updateTime != null">updateTime,</if>
+            <if test="createTime != null">createTime,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="authorId != null">#{authorId},</if>
+            <if test="autoStatus != null and autoStatus != ''">#{autoStatus},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmAutoTypeRecord" parameterType="CmAutoTypeRecord">
+        update cm_auto_type_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="authorId != null">authorId = #{authorId},</if>
+            <if test="autoStatus != null and autoStatus != ''">autoStatus = #{autoStatus},</if>
+            <if test="delFlag != null">delFlag = #{delFlag},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+            <if test="createTime != null">createTime = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="delCmAutoTypeRecordById" parameterType="String">
+        delete
+        from cm_auto_type_record where id = #{id}
+    </delete>
+
+    <delete id="delCmAutoTypeRecord" parameterType="CmAutoTypeRecord">
+        delete
+        from cm_auto_type_record AS cm_auto_type_record
+        <where>
+            <if test="id != null and id != '' "> and cm_auto_type_record.id = #{id}</if>
+            <if test="type != null  and type != ''"> and cm_auto_type_record.type = #{type}</if>
+            <if test="authorId != null "> and cm_auto_type_record.authorId = #{authorId}</if>
+            <if test="autoStatus != null  and autoStatus != ''"> and cm_auto_type_record.autoStatus = #{autoStatus}</if>
+        </where>
+    </delete>
+
+</mapper>

+ 16 - 13
src/main/resources/mappings/modules/cmpage/CmImageMapper.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.cmpage.dao.CmImageDao">
-    
+
 	<sql id="cmImageColumns">
 		a.id AS "id",
 		a.title AS "title",
@@ -26,18 +26,21 @@
 	</sql>
 
 	<select id="get" resultType="CmImage">
-		SELECT 
+		SELECT
 			<include refid="cmImageColumns"/>
 		FROM cm_page_image a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmImage">
-		SELECT 
+		SELECT
 			<include refid="cmImageColumns"/>
+			<if test="statisticsType != null  and statisticsType != ''">
+				,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+			</if>
 		FROM cm_page_image a
 		<where>
-			
+
 			<if test="id != null and id != ''">
 				AND a.id = #{id}
 			</if>
@@ -95,14 +98,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmImage">
-		SELECT 
+		SELECT
 			<include refid="cmImageColumns"/>
 		FROM cm_page_image a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -159,9 +162,9 @@
 			#{topPosition}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_page_image SET 	
+		UPDATE cm_page_image SET
 			title = #{title},
 			link = #{link},
 			appLink = #{appLink},
@@ -181,7 +184,7 @@
 			topPosition = #{topPosition}
 		WHERE id = #{id}
 	</update>
-	
+
 	<update id="delete">
 		DELETE FROM cm_page_image
 		WHERE id = #{id}
@@ -218,4 +221,4 @@
 		  b.centreId = #{id}
 		</where>
 	</select>
-</mapper>
+</mapper>

+ 1 - 0
src/main/resources/mappings/modules/hehe/CmHeheCollageProductMapper.xml

@@ -121,6 +121,7 @@
         limit 1
     </select>
 
+
     <insert id="insert" parameterType="CmHeheCollageProduct" keyProperty="id" useGeneratedKeys="true">
         INSERT INTO cm_hehe_collage_product(productId,
                                             limitedNum,

+ 26 - 2
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -336,8 +336,32 @@
         where skuId = #{skuId}
     </update>
     <select id="findLadderList" resultType="com.caimei.modules.product.entity.CmLadderPrice">
-        select id,buyPrice,buyNum
+        select id, buyPrice, buyNum
         from cm_hehe_activity_ladder
-        where skuId=#{skuId}
+        where skuId = #{skuId}
+    </select>
+    <select id="findMobileByUserYear" resultType="String">
+        select chu.mobile
+        from cm_hehe_user chu
+                 left join user u on u.userID = chu.userID
+        where chu.userIdentity='1' and  u.validFlag='1' and  u.loginTime >= DATE_SUB(NOW(), INTERVAL #{num} YEAR)
+    </select>
+
+    <select id="getMonthCount" resultType="java.lang.Integer">
+        <if test="type != null and type == 1">
+            select count(1)
+            from cm_hehe_collage_product
+            where addTime >= DATE_SUB(NOW(), INTERVAL #{num} MONTH)
+        </if>
+        <if test="type != null and type == 2">
+            select count(1)
+            from cm_hehe_activity_product
+            where addTime >= DATE_SUB(NOW(), INTERVAL #{num} MONTH)
+        </if>
+        <if test="type != null and type == 3">
+            select count(1)
+            from hehe_discount_activity_product
+            where addTime >= DATE_SUB(NOW(), INTERVAL #{num} MONTH)
+        </if>
     </select>
 </mapper>

+ 16 - 5
src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml

@@ -50,13 +50,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                a.appStatus,
                a.delFlag,
                a.updateTime,
-               a.addTime,
-               IFNULL((select c.pv from cm_praise_statistics c where a.id = c.authorId and c.type = 2), 0) as pv
-        from cm_brand_landing a
+               a.addTime
+
     </sql>
 
     <select id="selectCmBrandLandingList" parameterType="CmBrandLanding" resultMap="CmBrandLandingResult">
-        <include refid="selectCmBrandLandingVo"/>
+        <include refid="selectCmBrandLandingVo"/>,
+        <if test="statisticsType != null  and statisticsType != ''">
+            ,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+        </if>
+        from cm_brand_landing a
         <where>delFlag = 0
             <if test="id != null  and id != ''">and id = #{id}</if>
             <if test="authUserId != null ">and authUserId = #{authUserId}</if>
@@ -83,6 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="findList" parameterType="CmBrandLanding" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
+        <if test="statisticsType != null  and statisticsType != ''">
+            ,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+        </if>
+        from cm_brand_landing a
         <where>delFlag = 0
             <if test="id != null  and id != ''">and id = #{id}</if>
             <if test="authUserId != null ">and authUserId = #{authUserId}</if>
@@ -109,7 +116,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectCmBrandLandingById" parameterType="String" resultMap="CmBrandLandingResult">
-        <include refid="selectCmBrandLandingVo"/>
+        <include refid="selectCmBrandLandingVo"/>,
+        <if test="statisticsType != null  and statisticsType != ''">
+            ,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+        </if>
+        from cm_brand_landing a
         where id = #{id} and delFlag = 0
     </select>
 

+ 3 - 0
src/main/resources/mappings/modules/newhome/NewPageFirstNavigationMapper.xml

@@ -29,6 +29,9 @@
 	<select id="findList" resultType="NewPageFirstNavigation">
 		SELECT
 			<include refid="newPageFirstNavigationColumns"/>
+		<if test="statisticsType != null  and statisticsType != ''">
+			,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = #{statisticsType} and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+		</if>
 		FROM new_page_first_navigation a
 		<where>
 			a.delFlag = 0

+ 4 - 1
src/main/resources/mappings/modules/newhome/NewPageHomeimageMapper.xml

@@ -50,7 +50,10 @@
         ORDER BY a.sort desc,a.createDate desc
     </select>
     <select id="getBannerStatistics" resultType="com.caimei.modules.newhome.entity.cmStatisticsType">
-        SELECT COUNT(statisticsId) as count, ifnull(bannerId, 0) as bannerId  FROM cm_statistics_type WHERE typeId = 1 GROUP BY bannerId
+        SELECT COUNT(statisticsId) as count, ifnull(bannerId, 0) as bannerId  FROM cm_statistics_type WHERE typeId = 1
+        <if test="startPvCreateTime != null ">AND clickTime >= #{startPvCreateTime} </if>
+        <if test="endPvCreateTime != null ">AND clickTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>
+        GROUP BY bannerId
     </select>
 
     <select id="findAllList" resultType="NewPageHomeimage">

+ 88 - 0
src/main/resources/mappings/modules/order/CmPayShopMapper.xml

@@ -406,4 +406,92 @@
 		ORDER BY
 		  receiptDate DESC
 	</select>
+
+	<select id="findOtherList" resultType="com.caimei.modules.order.entity.CmPayShop">
+		SELECT
+		<include refid="cmPayShopColumns"/>,
+		u1.name AS applicantName,
+		u2.name AS reviewerName,
+		s.name AS shopName,
+		a.otherFeeFlag,
+		a.cmBankAccountName,
+		a.cmBankAccount,
+		a.cmBankName,
+		ifnull(psr.payCmAmount,0) as cmShopOtherFee,
+		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
+		FROM cm_pay_shop a
+		left join sys_user u1 on u1.id = a.applicant
+		left join sys_user u2 on u2.id = a.reviewer
+		left join shop s on s.shopID = a.shopID
+		LEFT JOIN cm_pay_shop_record psr ON psr.payShopID = a.id
+		LEFT JOIN cm_shop_order so ON so.shopOrderID = psr.shopOrderID
+		LEFT JOIN cm_receipt_order_relation cror ON cror.shopOrderId = so.shopOrderId and cror.delFlag = 0
+		LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id and cdr.delFlag = 0
+		<where>
+			s.AccountOwnership = 1
+			and so.shopStatus not in (4, 5)
+			and IFNULL(cdr.receiptType,0) not in (10,11)
+			and cdr.payWay = 2
+			and so.delFlag = '0'
+			and (so.organizeID!=4 or so.organizeID is null)
+			and a.shopID != 998
+			<if test="id != null and id != ''">
+				and a.id = #{id}
+			</if>
+			<if test="shopName != null and shopName != ''">
+				and s.name like concat('%', #{shopName}, '%')
+			</if>
+			<if test="name != null and name != ''">
+				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="startTime != null and startTime != ''">
+				AND a.applyTime <![CDATA[  >=  ]]> #{startTime}
+			</if>
+			<if test="endTime != null and endTime != ''">
+				AND a.applyTime <![CDATA[   <=  ]]> #{endTime}
+			</if>
+			<if test="startTime2 != null and startTime2 != ''">
+				AND a.payTime <![CDATA[  >=  ]]> #{startTime2}
+			</if>
+			<if test="endTime2 != null and endTime2 != ''">
+				AND a.payTime <![CDATA[   <=  ]]> #{endTime2}
+			</if>
+			<if test="status != null and status != ''">
+				AND a.status = #{status}
+			</if>
+			<if test="shopOrderNo != null and shopOrderNo != ''">
+				AND a.id in (select cpsr.payShopID from cm_pay_shop_record cpsr where cpsr.shopOrderNo like concat('%',#{shopOrderNo},'%'))
+			</if>
+			<if test="shopOrderID != null and shopOrderID != ''">
+				AND a.id in (SELECT cpsr.payShopID FROM cm_pay_shop_record cpsr WHERE cpsr.shopOrderID=#{shopOrderID})
+			</if>
+			<if test="orderID != null and orderID != ''">
+				AND a.id in (SELECT cpsr.payShopID FROM cm_pay_shop_record  cpsr LEFT JOIN cm_shop_order so ON so.shopOrderID=cpsr.shopOrderID WHERE so.orderID=#{orderID})
+			</if>
+			<if test='organizeID != null and organizeID != "" and organizeID != "9999"'>
+				AND a.id in (SELECT cpsr.payShopID FROM cm_pay_shop_record  cpsr LEFT JOIN cm_shop_order so ON so.shopOrderID=cpsr.shopOrderID WHERE so.organizeID = #{organizeID})
+			</if>
+			<if test='organizeID == "9999"'>
+				AND a.id IN (SELECT cpsr.payShopID FROM cm_pay_shop_record  cpsr LEFT JOIN cm_shop_order so ON so.shopOrderID=cpsr.shopOrderID WHERE so.orderType = 2)
+			</if>
+			<if test="orderNo != null and orderNo != ''">
+				AND a.id in (SELECT cpsr.payShopID FROM cm_pay_shop_record  cpsr LEFT JOIN cm_shop_order so ON so.shopOrderID=cpsr.shopOrderID WHERE so.orderNo LIKE CONCAT('%',#{orderNo},'%'))
+			</if>
+			<if test="paymentType != null">
+				AND a.id IN(SELECT payShopID FROM cm_pay_shop_record WHERE paymentType = #{paymentType} AND delFlag = 0)
+			</if>
+		</where>
+		GROUP BY a.id
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.id desc
+			</otherwise>
+		</choose>
+	</select>
 </mapper>

+ 87 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -2791,6 +2791,93 @@
         </if>
     </select>
 
+    <select id="findPayOtherList" resultType="com.caimei.modules.order.entity.NewShopOrder">
+        select<include refid="shopOrderColumns"/>,
+        co.payTotalFee AS payTotalFee,
+        ifnull(a.supplierFreight,0) as supplierFreight,
+        ifnull(a.rebateOrder,0) as rebateOrder,
+        bou.name AS buyer,
+        s.name AS shopName,
+        c.name AS clubName,
+        a.onlinePayWays,
+        ifnull(a.cmAccountType,0) as cmAccountType,
+        cdr.payWay AS payWay,
+        ifnull(a.cmShopOtherFee,0) as cmShopOtherFee
+        from cm_shop_order a
+        left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
+        left join bp_order_userinfo bou on bou.orderId = a.orderID
+        left join cm_order co on co.orderID = a.orderID
+        LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId and cror.delFlag = 0
+        LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id and cdr.delFlag = 0
+        left join shop s on s.shopID = a.shopID
+        LEFT JOIN club c ON c.userID = a.userID
+        <where>
+            s.AccountOwnership = 1
+            and a.shopStatus not in (4, 5)
+            and IFNULL(cdr.receiptType,0) not in (10,11)
+            and cdr.payWay = 2
+            <if test="startTime != null and startTime != ''">
+                AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND (a.orderTime &lt; #{endTime} OR a.orderTime = #{endTime})
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND a.orderID = #{orderID}
+            </if>
+            <if test="organizeID != null and organizeID != 9999">
+                AND co.organizeID = #{organizeID}
+            </if>
+            <if test="organizeID == 9999 ">
+                AND co.orderType = 2
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND a.orderNo like concat('%', #{orderNo} ,'%')
+            </if>
+            <if test="ps != null and ps.length>0 ">
+                AND a.payStatus in
+                <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="shopName != null and shopName != ''">
+                AND s.name like concat('%', #{shopName} ,'%')
+            </if>
+            <if test="buyer != null and buyer != ''">
+                AND bou.name like concat('%', #{buyer} ,'%')
+            </if>
+            <if test="clubName != null and clubName != ''">
+                AND c.name like concat('%', #{clubName} ,'%')
+            </if>
+            <if test="shopOrderID != null and shopOrderID != ''">
+                AND a.shopOrderID = #{shopOrderID}
+            </if>
+            <if test="shopOrderNo != null and shopOrderNo != ''">
+                AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
+            </if>
+            <if test="operatingMode != null and operatingMode == '1'.toString()">
+                and a.payStatus != 3 and co.status NOT IN (6,7)
+            </if>
+            <if test="operatingMode != null and operatingMode == '2'.toString()">
+                and a.payStatus != 1 and co.status != 6
+            </if>
+            <if test="operatingMode != null and operatingMode == '3'.toString()">
+                and a.payStatus = 3 and co.status NOT IN (6,7)
+            </if>
+            and a.shopStatus != 0
+            and co.delFlag = 0
+            and a.delFlag = 0
+            and (a.organizeID!=4 or a.organizeID is null)
+            and a.shopID != 998
+            and co.orderID not in (
+            SELECT orderID FROM cm_order_product WHERE productID IN
+            (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069) GROUP BY orderID
+            )
+        </where>
+        group by a.shopOrderID
+        ORDER BY a.shopOrderID DESC
+    </select>
+
     <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true"
             keyProperty="shopOrderID">
         insert into cm_shop_order

+ 1 - 1
src/main/resources/mappings/modules/serviceteam/CmServiceteamRoleMapper.xml

@@ -102,7 +102,7 @@
 			0
 		)
 	</insert>
-	<insert id="save" parameterType="CmServiceteamRole" keyProperty="id" useGeneratedKeys="true">
+	<insert id="save" parameterType="CmServiceteamRole" keyProperty="teamId" useGeneratedKeys="true">
 		INSERT INTO cm_serviceteam_role(
 			leaderId,
 			createdTime,

+ 7 - 0
src/main/resources/mappings/modules/user/CmSpMapper.xml

@@ -17,6 +17,7 @@
 		a.validFlag AS "validFlag",
 		a.status AS "status",
 		a.addTime AS "addTime",
+		a.insiderFlag as "insiderFlag",
 		a.mainServiceProviderID AS "mainServiceProviderID"
 	</sql>
 
@@ -37,6 +38,9 @@
 		LEFT JOIN c_serviceproviderstatus cs ON a.`status` = cs.c_serviceProviderStatusID
 		<where>
 			organizeID = 0
+		    <if test="insiderFlag != null">
+				AND insiderFlag = #{insiderFlag}
+			</if>
 			<if test="serviceProviderID != null and serviceProviderID != ''">
 				AND a.serviceProviderID = #{serviceProviderID}
 			</if>
@@ -103,6 +107,7 @@
 		validFlag,
 		status,
 		addTime,
+		insiderFlag,
 		mainServiceProviderID
 		) VALUES (
 		#{userID},
@@ -118,6 +123,7 @@
 		#{validFlag},
 		#{status},
 		#{addTime},
+		#{insiderFlag},
 		#{mainServiceProviderID}
 		)
 	</insert>
@@ -138,6 +144,7 @@
 		validFlag = #{validFlag},
 		status = #{status},
 		addTime = #{addTime},
+		insiderFlag = #{insiderFlag},
 		mainServiceProviderID = #{mainServiceProviderID}
 		WHERE serviceProviderID = #{serviceProviderID}
 	</update>

+ 11 - 0
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -1400,4 +1400,15 @@
         </where>
         GROUP BY c.userID ORDER BY ordr.lastOrderTime DESC
     </select>
+
+
+    <select id="getClubIds" resultType="String">
+        SELECT
+        a.clubID
+        FROM club a
+        <include refid="newCmClubJoins"/>
+        <where>
+            AND a.status =90 and u.userOrganizeID IN(0,1)  AND u.userIdentity != 8
+        </where>
+    </select>
 </mapper>

+ 52 - 43
src/main/webapp/WEB-INF/tlds/fns.tld

@@ -4,7 +4,7 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
   version="2.0">
-    
+
   <description>JSTL 1.1 functions library</description>
   <display-name>JSTL functions sys</display-name>
   <tlib-version>1.1</tlib-version>
@@ -46,79 +46,79 @@
     <function-signature>java.lang.Object getConst(java.lang.String)</function-signature>
     <example>${fns:getConst(key)}</example>
   </function>
-  
+
   <!-- UserUtils -->
   <function>
     <description>获取当前用户对象</description>
     <name>getUser</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>com.thinkgem.jeesite.modules.sys.entity.User getUser()</function-signature>
-    <example>${fns:getUser()}</example>  
+    <example>${fns:getUser()}</example>
   </function>
-  
+
   <function>
     <description>根据编码获取用户对象</description>
     <name>getUserById</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>com.thinkgem.jeesite.modules.sys.entity.User get(java.lang.String)</function-signature>
-    <example>${fns:getUserById(id)}</example>  
+    <example>${fns:getUserById(id)}</example>
   </function>
-  
+
   <function>
     <description>获取授权用户信息</description>
     <name>getPrincipal</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm.Principal getPrincipal()</function-signature>
-    <example>${fns:getPrincipal()}</example>  
+    <example>${fns:getPrincipal()}</example>
   </function>
-  
+
   <function>
     <description>获取当前用户的菜单对象列表</description>
     <name>getMenuList</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>java.util.List getMenuList()</function-signature>
-    <example>${fns:getMenuList()}</example>  
+    <example>${fns:getMenuList()}</example>
   </function>
-  
+
   <function>
     <description>获取当前用户的区域对象列表</description>
     <name>getAreaList</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>java.util.List getAreaList()</function-signature>
-    <example>${fns:getAreaList()}</example>  
+    <example>${fns:getAreaList()}</example>
   </function>
-  
+
   <function>
     <description>获取当前用户的部门对象列表</description>
     <name>getOfficeList</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>java.util.List getOfficeList()</function-signature>
-    <example>${fns:getOfficeList()}</example>  
+    <example>${fns:getOfficeList()}</example>
   </function>
-  
+
   <function>
     <description>获取当前用户缓存</description>
     <name>getCache</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.UserUtils</function-class>
     <function-signature>java.lang.Object getCache(java.lang.String, java.lang.Object)</function-signature>
-    <example>${fns:getCache(cacheName, defaultValue)}</example>  
+    <example>${fns:getCache(cacheName, defaultValue)}</example>
   </function>
-	
+
   <!-- DictUtils -->
   <function>
     <description>获取字典标签</description>
     <name>getDictLabel</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.DictUtils</function-class>
     <function-signature>java.lang.String getDictLabel(java.lang.String, java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:getDictLabel(value, type, defaultValue)}</example>  
+    <example>${fns:getDictLabel(value, type, defaultValue)}</example>
   </function>
-  
+
   <function>
     <description>获取字典标签(多个)</description>
     <name>getDictLabels</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.DictUtils</function-class>
     <function-signature>java.lang.String getDictLabels(java.lang.String, java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:getDictLabels(values, type, defaultValue)}</example>  
+    <example>${fns:getDictLabels(values, type, defaultValue)}</example>
   </function>
 
   <function>
@@ -126,23 +126,23 @@
     <name>getDictValue</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.DictUtils</function-class>
     <function-signature>java.lang.String getDictValue(java.lang.String, java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:getDictValue(label, type, defaultValue)}</example>  
+    <example>${fns:getDictValue(label, type, defaultValue)}</example>
   </function>
-  
+
   <function>
     <description>获取字典对象列表</description>
     <name>getDictList</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.DictUtils</function-class>
     <function-signature>java.util.List getDictList(java.lang.String)</function-signature>
-    <example>${fns:getDictList(type)}</example>  
+    <example>${fns:getDictList(type)}</example>
   </function>
-  
+
   <function>
     <description>获取字典对象列表</description>
     <name>getDictListJson</name>
     <function-class>com.thinkgem.jeesite.modules.sys.utils.DictUtils</function-class>
     <function-signature>java.lang.String getDictListJson(java.lang.String)</function-signature>
-    <example>${fns:getDictListJson(type)}</example>  
+    <example>${fns:getDictListJson(type)}</example>
   </function>
 
   <!-- CmmeDictUtils -->
@@ -192,112 +192,121 @@
     <name>urlEncode</name>
     <function-class>com.thinkgem.jeesite.common.utils.Encodes</function-class>
     <function-signature>java.lang.String urlEncode(java.lang.String)</function-signature>
-    <example>${fns:urlEncode(part)}</example>  
+    <example>${fns:urlEncode(part)}</example>
   </function>
   <function>
     <description>URL解码</description>
     <name>urlDecode</name>
     <function-class>com.thinkgem.jeesite.common.utils.Encodes</function-class>
     <function-signature>java.lang.String urlDecode(java.lang.String)</function-signature>
-    <example>${fns:urlDecode(part)}</example>  
+    <example>${fns:urlDecode(part)}</example>
   </function>
   <function>
     <description>HTML编码</description>
     <name>escapeHtml</name>
     <function-class>com.thinkgem.jeesite.common.utils.Encodes</function-class>
     <function-signature>java.lang.String escapeHtml(java.lang.String)</function-signature>
-    <example>${fns:escapeHtml(html)}</example>  
+    <example>${fns:escapeHtml(html)}</example>
   </function>
   <function>
     <description>HTML解码</description>
     <name>unescapeHtml</name>
     <function-class>com.thinkgem.jeesite.common.utils.Encodes</function-class>
     <function-signature>java.lang.String unescapeHtml(java.lang.String)</function-signature>
-    <example>${fns:unescapeHtml(html)}</example>  
+    <example>${fns:unescapeHtml(html)}</example>
   </function>
-  
+
   <!-- StringUtils -->
   <function>
     <description>从后边开始截取字符串</description>
     <name>substringAfterLast</name>
     <function-class>org.apache.commons.lang3.StringUtils</function-class>
     <function-signature>java.lang.String substringAfterLast(java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:substringAfterLast(str,separator)}</example>  
+    <example>${fns:substringAfterLast(str,separator)}</example>
   </function>
   <function>
     <description>判断字符串是否以某某开头</description>
     <name>startsWith</name>
     <function-class>org.apache.commons.lang3.StringUtils</function-class>
     <function-signature>boolean startsWith(java.lang.CharSequence, java.lang.CharSequence)</function-signature>
-    <example>${fns:startsWith(str,prefix)}</example> 
+    <example>${fns:startsWith(str,prefix)}</example>
   </function>
   <function>
     <description>判断字符串是否以某某结尾</description>
     <name>endsWith</name>
     <function-class>org.apache.commons.lang3.StringUtils</function-class>
     <function-signature>boolean endsWith(java.lang.CharSequence, java.lang.CharSequence)</function-signature>
-    <example>${fns:endsWith(str,suffix)}</example> 
+    <example>${fns:endsWith(str,suffix)}</example>
   </function>
   <function>
     <description>缩写字符串,超过最大宽度用“...”表示</description>
     <name>abbr</name>
     <function-class>com.thinkgem.jeesite.common.utils.StringUtils</function-class>
     <function-signature>java.lang.String abbr(java.lang.String, int)</function-signature>
-    <example>${fns:abbr(str,length)}</example>  
+    <example>${fns:abbr(str,length)}</example>
   </function>
   <function>
     <description>替换掉HTML标签</description>
     <name>replaceHtml</name>
     <function-class>com.thinkgem.jeesite.common.utils.StringUtils</function-class>
     <function-signature>java.lang.String replaceHtml(java.lang.String)</function-signature>
-    <example>${fns:replaceHtml(html)}</example>  
+    <example>${fns:replaceHtml(html)}</example>
   </function>
   <function>
     <description>转换为JS获取对象值,生成三目运算返回结果。</description>
     <name>jsGetVal</name>
     <function-class>com.thinkgem.jeesite.common.utils.StringUtils</function-class>
     <function-signature>java.lang.String jsGetVal(java.lang.String)</function-signature>
-    <example>${fns:jsGetVal('row.user.id')}  返回:!row?'':!row.user?'':!row.user.id?'':row.user.id</example>  
+    <example>${fns:jsGetVal('row.user.id')}  返回:!row?'':!row.user?'':!row.user.id?'':row.user.id</example>
   </function>
   <function>
     <description>连接两个字符串</description>
     <name>appendLast</name>
     <function-class>com.thinkgem.jeesite.common.utils.StringUtils</function-class>
     <function-signature>java.lang.String appendLast(java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:appendLast(str,suffixe)}</example>  
+    <example>${fns:appendLast(str,suffixe)}</example>
   </function>
-  
+
   <function>
     <description>连接多个字符串</description>
     <name>appendLast1</name>
     <function-class>com.thinkgem.jeesite.common.utils.StringUtils</function-class>
     <function-signature>java.lang.String appendLast(java.lang.String, java.lang.String, java.lang.String)</function-signature>
-    <example>${fns:appendLast1(str,suffixe1,suffixe2)}</example>  
+    <example>${fns:appendLast1(str,suffixe1,suffixe2)}</example>
   </function>
-  
+
   <!-- DateUtils -->
   <function>
     <description>获取当前日期</description>
     <name>getDate</name>
     <function-class>com.thinkgem.jeesite.common.utils.DateUtils</function-class>
     <function-signature>java.lang.String getDate(java.lang.String)</function-signature>
-    <example>${fns:getDate(pattern)}</example>  
+    <example>${fns:getDate(pattern)}</example>
   </function>
+  <!-- DateUtils -->
+  <function>
+    <description>转换日期</description>
+    <name>setDate</name>
+    <function-class>com.thinkgem.jeesite.common.utils.DateUtils</function-class>
+    <function-signature>java.lang.String setDate(java.util.Date,java.lang.String)</function-signature>
+    <example>${fns:setDate(date,pattern)}</example>
+  </function>
+
   <function>
     <description>获取过去的天数</description>
     <name>pastDays</name>
     <function-class>com.thinkgem.jeesite.common.utils.DateUtils</function-class>
     <function-signature>long pastDays(java.util.Date)</function-signature>
-    <example>${fns:pastDays(date)}</example>  
+    <example>${fns:pastDays(date)}</example>
   </function>
-  
+
   <!-- JsonMapper -->
   <function>
     <description>对象转换JSON字符串</description>
     <name>toJson</name>
     <function-class>com.thinkgem.jeesite.common.mapper.JsonMapper</function-class>
     <function-signature>java.lang.String toJsonString(java.lang.Object)</function-signature>
-    <example>${fns:toJson(object)}</example>  
+    <example>${fns:toJson(object)}</example>
   </function>
 
   <function>

+ 218 - 0
src/main/webapp/WEB-INF/views/modules/autoType/autoTypeList.jsp

@@ -0,0 +1,218 @@
+<%@ 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>
+        .body {
+            padding: 30px;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <c:if test="${cmAutoTypeRecord.type==2}">
+        <li><a href="${ctx}/cmpage/cmImage/?type=4&flag=4">活动专区列表</a></li>
+        <shiro:hasPermission name="cmpage:cmImage:edit">
+            <li><a href="${ctx}/cmpage/cmImage/form?flag=4&type=4">活动专区图添加</a></li>
+        </shiro:hasPermission>
+    </c:if>
+    <li class="active"><a
+            href="${ctx}/autoType/list?type=${cmAutoTypeRecord.type}">${cmAutoTypeRecord.type==1?"文章推送":"活动推送"}</a></li>
+</ul>
+<div class="body">
+    <form id="statusForm">
+        <input id="cmAutoTypeId" name="cmAutoTypeId" type="hidden" value="${cmAutoType.id}"/>
+        <div>
+            <label style="float: left">推荐方式:</label>
+            <div style="margin-left: 70px">
+                <input type="radio" name="autoStatus" value="0"  ${cmAutoType.autoStatus ne 1 ? "checked" : ""}>自动推送(设置自动推送后,则自动推送新发布的${cmAutoTypeRecord.type==1?"文章":"活动"}给所有机构)
+                <br>
+                <br>
+                <input type="radio" name="autoStatus" value="1"  ${cmAutoType.autoStatus eq 1 ? "checked" : ""}>手动推荐
+                <br>
+                <br>
+                <button id="btnSave" class="btn btn-primary" type="button"
+                        onclick="checkInfo()"  ${cmAutoType.autoStatus eq 1 ? "" : "disabled"}>
+                    选择需要推送的${cmAutoTypeRecord.type==1?"文章":"活动"}
+                </button>
+            </div>
+        </div>
+    </form>
+
+    <form:form id="searchForm" modelAttribute="cmAutoTypeRecord" action="${ctx}/autoType/list" 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="type" name="type" type="hidden" value="${cmAutoTypeRecord.type}"/>
+        <div class="ul-form">
+            <label>ID:</label>
+            <form:input path="authorId" htmlEscape="false" maxlength="11" class="input-mini"/>
+            <label>标题:</label>
+            <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
+            <label>推荐类型:</label>
+            <form:select path="autoStatus" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="自动推荐"/>
+                <form:option value="1" label="手动推荐"/>
+            </form:select>
+            <label>推送时间:</label>
+            <form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate"
+                        value="${fns:setDate(cmAutoTypeRecord.startPvCreateTime,'yyyy-MM-dd')}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            -
+            <form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate"
+                        value="${fns:setDate(cmAutoTypeRecord.endPvCreateTime,'yyyy-MM-dd')}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+            <div class="clearfix"></div>
+        </div>
+    </form:form>
+    <sys:message content="${message}"/>
+    <table id="contentTable" class="table table-striped table-bordered table-condensed">
+        <thead>
+        <tr>
+            <th>ID</th>
+            <th>${cmAutoTypeRecord.type==1?"引导图":"PC端图片"}</th>
+            <th>${cmAutoTypeRecord.type==1?"文章":"活动"}标题</th>
+            <th>推送类型</th>
+            <th>推送时间</th>
+        </tr>
+        </thead>
+        <tbody>
+        <c:forEach items="${page.list}" var="item">
+            <tr>
+                <td>${item.authorId}</td>
+                <td><img src="${item.image}" width="100px;" height="100px;"></td>
+                <td>${item.title}</td>
+                <td>${item.autoStatus==0?"自动推荐":"手动推荐"}</td>
+                <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+            </tr>
+        </c:forEach>
+        </tbody>
+    </table>
+    <div class="pagination">${page}</div>
+</div>
+<script>
+    $(document).ready(function () {
+        $("#searchForm").validate({
+            submitHandler: function (form) {
+                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);
+                }
+            }
+        });
+        $('input[name="autoStatus"]').change(function (item) {
+            var id = $('#cmAutoTypeId').val();
+            var autoStatus = $(this).val();
+            $.post("${ctx}/autoType/updateAutoStatus", {'id': id, 'autoStatus': autoStatus}, function (data) {
+                if (data.success == false) {
+                    $.jBox.tip(data.msg, 'error');
+                }
+            }, "JSON");//这里返回的类型有:json,html,xml,text
+            if (autoStatus == 0) {
+                $('#btnSave').attr("disabled", true)
+            } else {
+                $('#btnSave').attr("disabled", false)
+            }
+        })
+
+    })
+    function page(n,s){
+        $("#pageNo").val(n);
+        $("#pageSize").val(s);
+        $("#searchForm").submit();
+        return false;
+    }
+    var items = null;
+    var type = $('#type').val();
+    var title = type == 1 ? "选择文章" : "选择活动";
+
+    function checkInfo() {
+        let url = type == 1 ? "${ctx}/autoType/findAddPage" : "${ctx}/autoType/findCmImageAddPage";
+        let buttons = {"取消": '-1', "下一步": '1'}
+        iframe(url, title, buttons, submitInfo)
+    }
+
+
+    var submitInfo = function (v, h, f) {
+        //确定
+        let $jboxFrame = top.$('#jbox-iframe');
+        let $mainFrame = top.$('#mainFrame');
+        if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+            items = $jboxFrame[0].contentWindow.getCheckedItems(0);
+            if (items.length > 0) {
+                let url = "${ctx}/autoType/findClubAddPage";
+                let buttons = {"取消": '-1', "上一步": '0', "发送": '1'}
+                iframe(url, title, buttons, submitClub)
+            } else {
+                top.$.jBox.tip("请先"+title+"...");
+                return false;
+            }
+        }
+        return true;
+    }
+
+    var submitClub = function (v, h, f) {
+        if ('0' == v) {
+            checkInfo()
+        }
+        //确定
+        let $jboxFrame = top.$('#jbox-iframe');
+        let $mainFrame = top.$('#mainFrame');
+        if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+            let ids = $jboxFrame[0].contentWindow.getCheckedItems(0);
+            if (null == ids) {
+                addRecord({"type": type, "autoStatus": 1, "thisIds": items.toString()})
+            } else if (ids.length > 0) {
+                addRecord({"type": type, "autoStatus": 1, "thisIds": items.toString(), "clubIds": ids.toString()})
+            } else {
+                top.$.jBox.tip("请先勾选机构...");
+                return false;
+            }
+        }
+        return true
+    }
+
+    function addRecord(data) {
+        $.ajax({
+            url: "${ctx}/autoType/addCmAutoTypeRecord",
+            data: data,
+            type: "POST",
+            async: false,
+            success: function (res) {
+                if (res.success) {
+                    $.jBox.tip(res.msg, 'info');
+                    history.go(0)
+                } else {
+                    $.jBox.tip(res.msg, 'error');
+                }
+            }
+        });
+    }
+
+    function iframe(url, title,buttons, submit) {
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 600,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: buttons,
+            submit: submit
+        });
+    }
+
+
+</script>
+</body>
+</html>

+ 193 - 0
src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordAdd.jsp

@@ -0,0 +1,193 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>选择文章</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table td i {
+            margin: 0 2px;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //弹出框去滚动条
+            top.$('#jbox-content').css("overflow-y", "hidden");
+            show_title(30);
+
+            //			反选
+            $('body').on('click', 'input[name="info"]', function () {
+                var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
+                    allInputCheckedLength = $('input[name="info"]:checked').length,
+                    checkAllEle = $('.check-all');
+//			    判断选中长度和总长度,如果相等就是全选否则取消全选
+                if (allInputLength === allInputCheckedLength) {
+                    checkAllEle.attr('checked', true);
+                } else {
+                    checkAllEle.attr('checked', false);
+                }
+            })
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        function getCheckedItems() {
+            var items = new Array();
+            var $items = $('.check-item:checked');
+            $items.each(function () {
+                //通过拿到的商品ID组合键获取其它值
+                var productId = $(this).val();
+                items.push(productId);
+            });
+            return items;
+        }
+
+        function allCkbfun(ckb) {
+            var isChecked = ckb.checked;
+            $(".check-item").attr('checked', isChecked);
+        }
+
+        /**
+         * @param obj
+         * jquery控制input只能输入数字
+         */
+        function onlynum(obj) {
+            obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+        }
+
+        /**
+         * @param obj
+         * jquery控制input只能输入数字和两位小数(金额)
+         */
+        function num(obj) {
+            obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+            obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+            obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
+            obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+        }
+        var ontypeId = null;
+        var typeId = null;
+        function ischangeType() {
+            if (null != typeId) {
+                $("#typeListId option[value=" + typeId + "]").val(ontypeId);
+            }
+            $("#optionType").find("option").eq(0).prop("selected", true)
+            optionTypeParent()
+        }
+
+        function optionTypeParent() {
+            $("#optionType [parent]").each(function (item) {
+                if ($("#typeListId option:selected").val() == $(this).attr("parent")) {
+                    $(this).show()
+                } else {
+                    $(this).hide()
+                }
+            })
+        }
+
+        function isoptionType() {
+            if ("" != $("#optionType option:selected").val()) {
+                ontypeId =  $("#optionType option:selected").attr("parent")
+                typeId = $("#optionType option:selected").val()
+                $("#typeListId option:selected").val($("#optionType option:selected").val())
+            }else {
+                ischangeType()
+            }
+        }
+
+        $(document).ready(function () {
+            $("#typeListId option[value=" + $("#optionType option:selected").attr("parent") + "]").prop("selected", true);
+            optionTypeParent()
+            isoptionType()
+            $("input[type='radio'][name='publishSource']").change(function (obj) {
+                $("#searchForm").submit();
+            })
+        })
+
+    </script>
+</head>
+<body>
+<form:form id="searchForm" modelAttribute="info" action="${ctx}/autoType/findAddPage" 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}"/>
+    <div class="ul-form">
+        <label>ID:</label>
+        <form:hidden path="cmRelatedType"/>
+        <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
+        <label>标题:</label>
+        <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
+        <label>发布人:</label>
+        <form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
+        <label>发布时间:</label>
+        <form:input path="startPubDate" type="text" maxlength="10" class="input-medium Wdate"
+                    value="${startPubDate}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        至
+        <form:input path="endPubDate" type="text" maxlength="10" class="input-medium Wdate"
+                    value="${startPubDate}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <br> <br>
+        <label>文章分类:</label>
+        <form:select id="typeListId" path="infoType.id" class="input-small" onchange="ischangeType()">
+            <form:option value="" label=" "/>
+            <c:forEach items="${typeList}" var="type" varStatus="index">
+                <c:if test="${type.parentId eq 0}">
+                    <form:option value="${type.id}" label="${type.name}"/>
+                </c:if>
+            </c:forEach>
+        </form:select>
+        <form:select id="optionType" path="typeId" class="input-small" onchange="isoptionType()">
+            <form:option value="" label=" "/>
+            <c:forEach items="${typeList}" var="type" varStatus="index">
+                <c:if test="${type.parentId ne 0}">
+                    <form:option value="${type.id}" label="${type.name}" parent="${type.parentId}"
+                                 cssStyle="display: none"/>
+                </c:if>
+            </c:forEach>
+        </form:select>
+        &nbsp;&nbsp<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table class="table table-striped table-bordered table-condensed table-hover">
+    <tr>
+        <th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
+        <th>文章ID</th>
+        <th>文章分类</th>
+        <th>引导图</th>
+        <th>发布人</th>
+        <th>文章标题</th>
+        <th>发布时间</th>
+    </tr>
+    <tbody>
+    <c:if test="${not empty page.list}">
+        <c:forEach items="${page.list}" var="item">
+            <tr id="${item.id}" class="itemtr">
+                <th>
+                    <input class="check-item" type="checkbox" name="info" value='${item.id}'/>
+                </th>
+                <td>${item.id}</td>
+                <td>${item.infoType.name}</td>
+                <td><img src="${item.guidanceImage}" width="50px" height="50px"></td>
+                <td>${item.publisher}</td>
+                <td>${item.title}</td>
+                <td><fmt:formatDate value="${item.pubdate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+            </tr>
+        </c:forEach>
+    </c:if>
+    </tbody>
+</table>
+<c:if test="${empty  page.list}">
+    <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
+</c:if>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 135 - 0
src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordClubAdd.jsp

@@ -0,0 +1,135 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>选择文章</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table td i {
+            margin: 0 2px;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //弹出框去滚动条
+            top.$('#jbox-content').css("overflow-y", "hidden");
+            show_title(30);
+            //反选
+            $('body').on('click', 'input[name="info"]', function () {
+                var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
+                    allInputCheckedLength = $('input[name="info"]:checked').length,
+                    checkAllEle = $('.check-all');
+            //判断选中长度和总长度,如果相等就是全选否则取消全选
+                if (allInputLength === allInputCheckedLength) {
+                    checkAllEle.attr('checked', true);
+                } else {
+                    checkAllEle.attr('checked', false);
+                }
+            })
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        function getCheckedItems() {
+            var items = null;
+            if($("input[type='radio'][name='allClub']:checked").val()==1){
+                items = new Array();
+                var $items = $('.check-item:checked');
+                $items.each(function () {
+                    //通过拿到的商品ID组合键获取其它值
+                    var productId = $(this).val();
+                    items.push(productId);
+                });
+            }
+            return items;
+        }
+
+        function allCkbfun(ckb) {
+            var isChecked = ckb.checked;
+            $(".check-item").attr('checked', isChecked);
+        }
+
+        /**
+         * @param obj
+         * jquery控制input只能输入数字
+         */
+        function onlynum(obj) {
+            obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+        }
+
+
+        $(document).ready(function () {
+            let allClub =$("input[type='radio'][name='allClub']")
+            allClub.change(function (obj) {
+                if ( $(this).val()==1){
+                    $("#tableFrom").show()
+                }else {
+                    $("#tableFrom").hide()
+                }
+            })
+        })
+
+    </script>
+</head>
+<body>
+<div style="padding: 20px">
+    <p>选择需要推送的机构</p>
+    <label style="float: left">推荐方式:</label>
+    <div style="margin-left: 70px">
+        <input type="radio" name="allClub" value="0" >全部机构
+        <br>
+        <br>
+        <input type="radio" name="allClub" value="1" checked>自定义机构
+    </div>
+</div>
+<div id="tableFrom" >
+    <form:form id="searchForm" modelAttribute="newCmClub" action="${ctx}/autoType/findClubAddPage" 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}"/>
+        <div class="ul-form">
+            <label>机构ID:</label>
+            <form:input path="clubID" htmlEscape="false" maxlength="11" class="input-mini"/>
+            <label>机构名称:</label>
+            <form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
+            &nbsp;&nbsp<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+            <div class="clearfix"></div>
+        </div>
+    </form:form>
+    <sys:message content="${message}"/>
+    <table class="table table-striped table-bordered table-condensed table-hover">
+        <tr>
+            <th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
+            <th>机构ID</th>
+            <th>机构名称</th>
+            <th>联系人</th>
+            <th>手机号</th>
+        </tr>
+        <tbody>
+        <c:if test="${not empty page.list}">
+            <c:forEach items="${page.list}" var="item">
+                <tr id="${item.clubID}" class="itemtr">
+                    <th>
+                        <input class="check-item" type="checkbox" name="info" value='${item.clubID}'/>
+                    </th>
+                    <td>${item.clubID}</td>
+                    <td>${item.name}</td>
+                    <td>${item.userName}</td>
+                    <td>${item.bindMobile}</td>
+                </tr>
+            </c:forEach>
+        </c:if>
+        </tbody>
+    </table>
+    <c:if test="${empty  page.list}">
+        <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
+    </c:if>
+    <div class="pagination">${page}</div>
+</div>
+</body>
+</html>

+ 121 - 0
src/main/webapp/WEB-INF/views/modules/autoType/autoTypeRecordCmImageAdd.jsp

@@ -0,0 +1,121 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>选择文章</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table td i {
+            margin: 0 2px;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //弹出框去滚动条
+            top.$('#jbox-content').css("overflow-y", "hidden");
+            show_title(30);
+            //反选
+            $('body').on('click', 'input[name="info"]', function () {
+                var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
+                    allInputCheckedLength = $('input[name="info"]:checked').length,
+                    checkAllEle = $('.check-all');
+                //判断选中长度和总长度,如果相等就是全选否则取消全选
+                if (allInputLength === allInputCheckedLength) {
+                    checkAllEle.attr('checked', true);
+                } else {
+                    checkAllEle.attr('checked', false);
+                }
+            })
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        function getCheckedItems() {
+            var items = null;
+            items = new Array();
+            var $items = $('.check-item:checked');
+            $items.each(function () {
+                //通过拿到的商品ID组合键获取其它值
+                var productId = $(this).val();
+                items.push(productId);
+            });
+            return items;
+        }
+
+        function allCkbfun(ckb) {
+            var isChecked = ckb.checked;
+            $(".check-item").attr('checked', isChecked);
+        }
+
+        /**
+         * @param obj
+         * jquery控制input只能输入数字
+         */
+        function onlynum(obj) {
+            obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+        }
+
+
+        $(document).ready(function () {
+            let allClub = $("input[type='radio'][name='allClub']")
+            allClub.change(function (obj) {
+                if ($(this).val() == 1) {
+                    $("#tableFrom").show()
+                } else {
+                    $("#tableFrom").hide()
+                }
+            })
+        })
+
+    </script>
+</head>
+<body>
+<div id="tableFrom" >
+    <form:form id="searchForm" modelAttribute="cmImage" action="${ctx}/autoType/findCmImageAddPage" 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}"/>
+        <div class="ul-form">
+            <label>ID:</label>
+            <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
+            <label>标题:</label>
+            <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
+            &nbsp;&nbsp<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+            <div class="clearfix"></div>
+        </div>
+    </form:form>
+    <sys:message content="${message}"/>
+    <table class="table table-striped table-bordered table-condensed table-hover">
+        <tr>
+            <th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
+            <th>ID</th>
+            <th>PC端图片</th>
+            <th>标题</th>
+        </tr>
+        <tbody>
+        <c:if test="${not empty page.list}">
+            <c:forEach items="${page.list}" var="item">
+                <tr id="${item.id}" class="itemtr">
+                    <th>
+                        <input class="check-item" type="checkbox" name="info" value='${item.id}'/>
+                    </th>
+                    <td>${item.id}</td>
+                    <td><img src="${item.image}" width="50px" height="50px"></td>
+                    <td>${item.title}</td>
+                </tr>
+            </c:forEach>
+        </c:if>
+        </tbody>
+    </table>
+    <c:if test="${empty  page.list}">
+        <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
+    </c:if>
+    <div class="pagination">${page}</div>
+</div>
+</body>
+</html>

+ 21 - 11
src/main/webapp/WEB-INF/views/modules/baikePage/cmBaikeProductForm.jsp

@@ -701,13 +701,21 @@
 							touchWords = '';
 						}
 					});
+					if ($("#banner").val() == "") {
+						top.$.jBox.tip("请先选择Banner图片!");
+						return false
+					}
+					if ($("#image").val() == "") {
+						top.$.jBox.tip("请先选择头图!");
+						return false
+					}
 					if (1 == status && emptyNum > 0) {
 						var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
 						top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
 							if (v == 'ok') {
 								if (touchNum > 0) {
-									var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
-											"请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
+									var msg = 1 == status ? "当前发布内容存在敏感词,已为您标记在输入框下方," +
+											"请修改后,再进行保存发布,强行保存发布将会导致审核不通过!" :
 											"当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
 											"将会影响发布时审核不通过!";
 									top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
@@ -1180,12 +1188,12 @@
 		</div>
 		<%--banner--%>
 		<div class="control-group" style="width: 1000px">
-			<label class="control-label">banner:</label>
+			<label class="control-label"><font color="red">*</font>banner:</label>
 			<div class="main-image-list" style="display: flex;flex-wrap: wrap">
-				<div class="controls upload-content iconBox mainIgeBox" >
+				<div class="controls upload-content iconBox mainIgeBox">
 					<div class="conList">
 						<form:hidden id="banner" path="banner" htmlEscape="false" maxlength="255"
-									 class="input-xlarge "/>
+									 class="input-xlarge required"/>
 						<sys:ckfinder input="banner" type="images" uploadPath="/photo" selectMultiple="false"
 									  maxWidth="100"
 									  maxHeight="100"/>
@@ -1362,13 +1370,15 @@
 			</div>
 		</div>
 		<%--头图--%>
-		<div class="control-group"style="margin-top: 100px" >
-			<label class="control-label">头图:</label>
+		<div class="control-group" style="margin-top: 100px">
+			<label class="control-label"><font color="red">*</font>头图:</label>
 			<div class="main-image-list">
-				<div class="controls upload-content iconBox mainIgeBox" >
-					<div class="" >
-						<form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge "/>
-						<sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+				<div class="controls upload-content iconBox mainIgeBox">
+					<div class="">
+						<form:hidden id="image" path="image" htmlEscape="false" maxlength="255"
+									 class="input-xlarge required"/>
+						<sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false"
+									  maxWidth="100"
 									  maxHeight="100"/>
 					</div>
 					<br>

+ 13 - 2
src/main/webapp/WEB-INF/views/modules/cmpage/cmImageList.jsp

@@ -16,7 +16,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -158,6 +158,9 @@
 			</c:if>
 		</a></li>
 		</shiro:hasPermission>
+		<c:if test="${cmImage.flag eq 4}">
+			<li><a href="${ctx}/autoType/list?type=2">活动推送</a></li>
+		</c:if>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmImage" action="${ctx}/cmpage/cmImage/?flag=${empty cmImage.flag?null:(cmImage.flag)}" method="post" class="breadcrumb form-search">
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
@@ -197,6 +200,12 @@
 				<form:option value="1" label="是"/>
 				<form:option value="0" label="否"/>
 			</form:select>
+			<label>点击时间:</label>
+			<form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(cmImage.startPvCreateTime,'yyyy-MM-dd')}"
+						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			-
+			<form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(cmImage.endPvCreateTime,'yyyy-MM-dd')}"
+						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
             <c:if test="${cmImage.flag eq 4}">
 				<label style="float:right;">活动专区首页:<a href="${fns:getConfig('wwwServer')}cmpage/area.html" target="_blank">${fns:getConfig('wwwServer')}cmpage/area.html</a></label>
@@ -222,6 +231,7 @@
 					<th>活动状态</th>
 				</c:if>
 				<th>排序</th>
+				<th>点击量</th>
 				<th>创建时间</th>
 				<shiro:hasPermission name="cmpage:cmImage:edit"><th>操作</th></shiro:hasPermission>
 			</tr>
@@ -307,6 +317,7 @@
 					</td>
 				</c:if>
 				<td>${items.sort}</td>
+				<td>${items.pv}</td>
 				<td><fmt:formatDate value="${items.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td hidden>
 					<label id="homePageImage${index.index}">${items.homePageImage}</label>
@@ -342,4 +353,4 @@
 	</table>
 	<div class="pagination">${page}</div>
 </body>
-</html>
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp

@@ -87,7 +87,7 @@
 	<div id="infoList" style="display: none">
 		<h4 style="line-height: 50px">
 			<span style="font-weight: bold;">推荐列表</span>(当前列表记录数 <span id="infoListCount">0</span>, 最多只能添加3条数据)
-			<input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="添加商品"/>
+			<input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="添加文章"/>
 		</h4>
 		<table id="contentTable" class="table table-striped table-bordered table-condensed" style="height: 300px">
 			<thead>

+ 6 - 0
src/main/webapp/WEB-INF/views/modules/info/infoTypeLandingList.jsp

@@ -81,6 +81,12 @@
 					<form:option value="" label=" "/>
 					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 				</form:select>
+			<label>点击时间:</label>
+			<form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" htmlEscape="false" value="${fns:setDate(cmBrandLanding.startPvCreateTime,'yyyy-MM-dd')}"
+						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			-
+			<form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" htmlEscape="false" value="${fns:setDate(cmBrandLanding.endPvCreateTime,'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 id="btnSubmit" class="btn btn-primary" type="submit" value="一键排序"/>
 			&nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="添加" onclick="location.href='${ctx}/cmBrandLanding/form?type=5&levelType=${cmBrandLanding.levelType}'"/>

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

@@ -115,9 +115,19 @@
 	<li class=${newPageFirstNavigation.type==0?"active":""}><a href="${ctx}/newhome/newPageFirstNavigation?type=0">主菜单列表</a></li>
 	<li class=${newPageFirstNavigation.type==2?"active":""}><a href="${ctx}/newhome/newPageFirstNavigation?type=2">快捷运营菜单</a></li>
 </ul>
-<form:form id="searchForm" modelAttribute="newPageFirstNavigation" action="${ctx}/newhome/newPageFirstNavigation?type${newPageFirstNavigation.type}" method="get" class="breadcrumb form-search">
+<form:form id="searchForm" modelAttribute="newPageFirstNavigation" action="${ctx}/newhome/newPageFirstNavigation" method="get" 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="type" name="type" type="hidden" value="${newPageFirstNavigation.type}"/>
+	<c:if test="${newPageFirstNavigation.type==2}">
+		<label>点击时间:</label>
+		<form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageFirstNavigation.startPvCreateTime,'yyyy-MM-dd')}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+		-
+		<form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageFirstNavigation.endPvCreateTime,'yyyy-MM-dd')}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+	</c:if>
+	&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 	<input class="btn btn-primary" style="width:80px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
 	<input class="btn btn-primary" style="width:${newPageFirstNavigation.type==0?80:120}px" onclick="window.location='${ctx}/newhome/newPageFirstNavigation/form?type=${newPageFirstNavigation.type}'" value="添加${newPageFirstNavigation.type==0?"主":"快捷运营"}菜单"/>
 	<input class="btn btn-primary" style="width:100px" onclick="updateStaticHome()" value="生成静态首页"/>
@@ -133,6 +143,9 @@
 		<th><c:if test="${newPageFirstNavigation.type==0}">主</c:if>菜单名称</th>
 		<th>图标</th>
 		<th>跳转链接</th>
+		<c:if test="${newPageFirstNavigation.type==2}">
+			<th>点击量</th>
+		</c:if>
 		<th>网站状态</th>
 		<th>小程序状态</th>
 		<th>排序</th>
@@ -153,9 +166,13 @@
 			<td>
 					<img src="${newPageFirstNavigation.icon}" style="width: 50px;height: 50px;">
 			</td>
+
 			<td>
 					<a href="${newPageFirstNavigation.link}" target="_blank">${newPageFirstNavigation.link}</a>
 			</td>
+			<c:if test="${newPageFirstNavigation.type==2}">
+				<td>${newPageFirstNavigation.pv}</td>
+			</c:if>
 			<td>
 				<shiro:hasPermission name="newhome:newPageFirstNavigation:edit">
 					<c:if test="${newPageFirstNavigation.wwwEnabledStatus eq 1 }">

+ 6 - 0
src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageList.jsp

@@ -131,6 +131,12 @@
             <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
                           htmlEscape="false"/>
         </form:select>
+        <label>点击时间:</label>
+        <form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.startPvCreateTime,'yyyy-MM-dd')}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+        -
+        <form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.endPvCreateTime,'yyyy-MM-dd')}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
         &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
         <c:if test="${cmImage.flag eq 4}">
             <label style="float:right;">活动专区首页:<a href="${fns:getConfig('wwwServer')}cmpage/area.html"

+ 325 - 0
src/main/webapp/WEB-INF/views/modules/order/cmPayOtherFormList.jsp

@@ -0,0 +1,325 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>付款管理</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        #searchForm {
+            white-space: nowrap
+        }
+
+        .ul-form {
+            white-space: nowrap;
+            margin-left: -10px !important
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .time-space-symbols {
+            width: 100px;
+            display: inline-block;
+            text-align: center
+        }
+
+        #btnSubmit {
+            width: 128px;
+            margin-left: 80%
+        }
+
+        .td-a {
+            width: 100%;
+            float: left;
+            display: block;
+            text-align: center
+        }
+
+        @media screen and (max-width: 1300px) {
+            #searchForm {
+                width: 1460px !important
+            }
+
+            .nav-tabs, #contentTable {
+                width: 1490px !important
+            }
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        $(function () {
+            $('#export').click(function () {
+                var formData = $('#searchForm').serialize();
+                window.location.href = "${ctx}/order/cmPayShop/export?" + formData;
+            });
+        })
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/order/cmPayShop/payOtherList">付第三方列表</a></li>
+    <li><a href="${ctx}/shopOrder/payOtherList">申请付第三方-线下订单</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmPayShop" action="${ctx}/order/cmPayShop/" 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}"/>
+    <div class="ul-form">
+        <div>
+            <label>子订单ID:</label>
+            <form:input path="shopOrderID" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>子订单编号:</label>
+            <form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>订单ID:</label>
+            <form:input path="orderID" htmlEscape="false" maxlength="20" class="input-medium"/>
+            <label>订单编号:</label>
+            <form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+        </div>
+        <div>
+            <label>付款单ID:</label>
+            <form:input path="id" htmlEscape="false" maxlength="50" class="input-medium"/>
+            <label>供应商:</label>
+            <form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
+
+            <label>付款单名称:</label>
+            <form:input path="name" htmlEscape="false" maxlength="250" class="input-medium"/>
+            <label>付款审核状态:</label>
+            <form:select path="status" class="input-medium">
+                <form:option value="" label="所有"/>
+                <form:options items="${fns:getDictList('pay_shop_status')}" itemLabel="label" itemValue="value"
+                              htmlEscape="false"/>
+            </form:select>&nbsp;&nbsp;&nbsp;&nbsp;
+
+        </div>
+        <div>
+            <label>申请时间:</label>
+            <form:input path="startTime" type="text" maxlength="20" class="input-medium Wdate" value="${startTime}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <span class="time-space-symbols">至</span>
+            <form:input path="endTime" type="text" maxlength="20" class="input-medium Wdate" value="${endTime}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <label>付款时间:</label>
+            <form:input path="startTime2" type="text" maxlength="20" class="input-medium Wdate" value="${startTime2}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <span class="time-space-symbols">至</span>
+            <form:input path="endTime2" type="text" maxlength="20" class="input-medium Wdate" value="${endTime2}"
+                        onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+        </div>
+        <div>
+            <label>组织:</label>
+            <form:select path="organizeID" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="采美"/>
+                <form:option value="9999" label="呵呵商城"/>
+                <c:forEach items="${cmUserOrganizeList}" var="organize">
+                    <c:if test="${organize.id!=4}">
+                        <form:option value="${organize.id}" label="${organize.organizeName}"/>
+                    </c:if>
+                </c:forEach>
+            </form:select>&nbsp;&nbsp;&nbsp;&nbsp;
+            <label><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><input
+                id="export" class="btn btn-primary" value="导出筛选结果"/></label>
+        </div>
+
+
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr style="width:30%">
+        <th>付款单ID</th>
+        <th style="width:150px">付款单名称</th>
+        <th>付款类型</th>
+        <th>供应商</th>
+        <th>付款金额</th>
+        <th>子订单编号(ID)</th>
+        <th>订单编号(ID)</th>
+        <th>机构</th>
+        <th>申请人</th>
+        <th>申请日期</th>
+        <th>审核人</th>
+        <th>审核时间</th>
+        <th>付款审核状态</th>
+        <shiro:hasPermission name="order:cmPayShop:edit">
+            <th>操作</th>
+        </shiro:hasPermission>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmPayShop">
+        <tr>
+            <td>${cmPayShop.id}</td>
+            <td>${cmPayShop.name}</td>
+            <td>
+                    ${cmPayShop.paymentType eq 2 ? "供应商差价":(cmPayShop.paymentType eq 3 ? "付第三方":"子订单付款")}
+            </td>
+            <td>${cmPayShop.shopName}</td>
+            <td>
+                <c:choose>
+                    <c:when test="${cmPayShop.paymentType eq 3}">
+                        ${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}
+                        <font color="red">
+                            <c:if test="${not empty cmPayShop.cmShopOtherFee and cmPayShop.cmShopOtherFee > 0 and not empty cmPayShop.totalAmount and cmPayShop.totalAmount > 0}">
+                                (采美中介费¥${cmPayShop.cmShopOtherFee},第三方中介费¥${cmPayShop.totalAmount})
+                            </c:if>
+                            <c:if test="${(empty cmPayShop.cmShopOtherFee or cmPayShop.cmShopOtherFee eq 0) and not empty cmPayShop.totalAmount and cmPayShop.totalAmount > 0}">
+                                (第三方中介费¥${cmPayShop.totalAmount})
+                            </c:if>
+                            <c:if test="${(not empty cmPayShop.cmShopOtherFee and cmPayShop.cmShopOtherFee > 0) and (empty cmPayShop.totalAmount or cmPayShop.totalAmount eq 0)}">
+                                (采美中介费¥${cmPayShop.cmShopOtherFee})
+                            </c:if>
+                        </font>
+                    </c:when>
+                    <c:otherwise>
+                        <fmt:formatNumber value="${cmPayShop.totalAmount}" type="number" pattern="#,##0.00"/>
+                        <c:if test="${cmPayShop.wipePayment > 0}">
+                            <br><font color="red">付款抹平¥<fmt:formatNumber value="${cmPayShop.wipePayment}" type="number"
+                                                                         pattern="#,##0.00"/></font>
+                        </c:if>
+                    </c:otherwise>
+                </c:choose>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</a><br>
+                </c:forEach>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <a href="${ctx}/order/detail?id=${shopOrder.orderID}">${shopOrder.orderNo}(${shopOrder.orderID})</a><br>
+                </c:forEach>
+            </td>
+            <td>
+                <c:forEach items="${cmPayShop.shopOrders}" var="shopOrder">
+                    <c:if test="${shopOrder.organizeID eq 1}">
+                        <span class="org-note">星范</span>
+                    </c:if>
+                    ${shopOrder.clubName}
+                    <c:if test="${shopOrder.orderType eq 2}">
+                        <span><font color="red">(呵呵商城)</font></span>
+                    </c:if>
+                    <c:if test="${shopOrder.organizeID == 3}">
+
+                    </c:if><br>
+                </c:forEach>
+            </td>
+
+            <td>
+                    ${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}
+            </td>
+            <td>${cmPayShop.applyTime}</td>
+            <td>
+                    ${cmPayShop.payType eq '6'? '系统自动':cmPayShop.reviewerName}
+            </td>
+            <td>${cmPayShop.reviewTime}</td>
+            <td>
+                <c:if test="${cmPayShop.status == '0'}">
+                    <font color="red">
+                        <strong>待审核</strong>
+                    </font>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    审核通过
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    审核不通过<br><font color="red">原因: ${cmPayShop.reason}</font>
+                </c:if>
+            </td>
+            <td>
+                <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:check">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/applyCompile?id=${cmPayShop.id}">编辑</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <shiro:hasPermission name="order:cmPayShop:detail">
+                    <a class="td-a" href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">查看详情</a>
+                </shiro:hasPermission>
+                <c:if test="${cmPayShop.status == '0'}">
+                    <shiro:hasPermission name="order:cmPayShop:apply">
+                        <c:if test="${cmPayShop.paymentType ne 3 && cmPayShop.paymentType ne 2}">
+                            <a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">申请付款</a>
+                        </c:if>
+                        <c:if test="${cmPayShop.paymentType eq 3 && cmPayShop.paymentType ne 2}">
+                            <a class="td-a" href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">申请付款</a>
+                        </c:if>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:cancel">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
+                           onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:check">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/toCheck?id=${cmPayShop.id}">付款审核</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:rollBack">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}&redirectType=1"
+                           onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    <shiro:hasPermission name="order:cmPayShop:apply">
+                        <c:if test="${cmPayShop.rePayment == '1' && cmPayShop.paymentType ne 2}">
+                            <c:if test="${cmPayShop.paymentType ne 3}">
+                                <a class="td-a" href="${ctx}/order/cmPayShop/applyEdit?id=${cmPayShop.id}">重申付款</a>
+                            </c:if>
+                            <c:if test="${cmPayShop.paymentType eq 3}">
+                                <a class="td-a"
+                                   href="${ctx}/order/cmPayShop/shopOtherApplyEdit?payShopId=${cmPayShop.id}">重申付款</a>
+                            </c:if>
+                        </c:if>
+                        <c:if test="${cmPayShop.rePayment == '2'}">重申付款</c:if>
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="order:cmPayShop:cancel">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/cancel?id=${cmPayShop.id}"
+                           onclick="return confirmx('确定要取消此次付款申请吗?', this.href)">取消付款</a>
+                    </shiro:hasPermission>
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    <shiro:hasPermission name="order:cmPayShop:detail">
+                        <a class="td-a" href="${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}">打印</a>
+                    </shiro:hasPermission>
+                </c:if>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 589 - 0
src/main/webapp/WEB-INF/views/modules/order/paidShopOtherList.jsp

@@ -0,0 +1,589 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>申请付款</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .pay-wrapper {
+            padding: 0 10px
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        input[type="checkbox"]::before {
+            content: '\a0';
+            display: inline-block;
+            vertical-align: .2em;
+            width: .8em;
+            height: .8em;
+            margin-right: .2em;
+            border-radius: .2em;
+            text-indent: .15em;
+            line-height: .65
+        }
+
+        .t-btn {
+            width: 120px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all {
+            width: 70px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            background: #fff;
+            border: 1px solid #ddd;
+            margin-bottom: 10px
+        }
+
+        #select-all:active {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .pay-more-func {
+            float: right;
+            color: #2fa4e7;
+            cursor: pointer
+        }
+
+        .pay-more-func span:first-child {
+            margin-right: 6px
+        }
+
+        .pay-more-func span:hover {
+            color: #7aa9c3
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .revise-popup-content, .tips-popup-content {
+            width: 40%;
+            height: auto;
+            padding-bottom: 30px;
+            background: #fff;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%)
+        }
+
+        .revise-popup-content {
+            width: 450px;
+            height: 360px;
+            overflow-y: scroll;
+            padding: 0 15px 30px 15px
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .revise-popup-content h4, .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .revise-popup-content div {
+            margin-top: 7px;
+            text-align: center
+        }
+
+        .revise-popup-content label {
+            width: 70px;
+            text-align: right;
+            vertical-align: text-bottom
+        }
+
+        .revise-popup-content button {
+            width: 80px;
+            height: 30px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:first-child {
+            margin-left: -104px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span:last-child {
+            margin-left: 30px
+        }
+
+        .revise-popup-content > div:nth-of-type(4) > span span {
+            margin-left: 10px
+        }
+
+        .revise-popup-content > div:last-child {
+            text-align: center;
+            margin-top: 20px
+        }
+
+        .revise-popup-content input {
+            width: 100px;
+            margin-bottom: 0px
+        }
+
+        .tips-input-wrapper {
+            width: 100px
+        }
+
+        .pay-status {
+            height: 40px;
+            line-height: 40px;
+            display: block
+        }
+
+        .form-search label {
+            width: 80px;
+            text-align: left;
+            margin-top: 12px
+        }
+
+        .remark-textarea {
+            width: 95%;
+            height: 100px;
+            resize: none
+        }
+
+        .remark-title {
+            text-align: left !important
+        }
+
+        .remark-title span {
+            color: red
+        }
+
+        .ul-form {
+            white-space: nowrap;
+            margin-left: -10px !important
+        }
+
+        .ul-form label {
+            width: 90px;
+            text-align: left;
+            margin-top: 15px
+        }
+
+        .time-space-symbols {
+            width: 100px;
+            display: inline-block;
+            text-align: center
+        }
+
+        #btnSubmit {
+            width: 128px;
+            margin-left: 165px
+        }
+
+        .pay-status label {
+            margin-left: 0
+        }
+
+        .pay-status label:first-child {
+            margin-left: 10px
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
+
+    </style>
+    <script type="text/javascript">
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop/payOtherList/">付款列表</a></li>
+    <li class="active tab-li"><a href="${ctx}/shopOrder/payOtherList">申请付第三方-线下订单</a></li>
+</ul>
+<form:form id="searchForm" onsubmit="submitFunc()" modelAttribute="newShopOrder" action="${ctx}/shopOrder/payOtherList"
+           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}"/>
+    <div class="ul-form">
+        <label>子订单ID:</label>
+        <form:input path="shopOrderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>子订单编号:</label>
+        <form:input path="shopOrderNo" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>订单ID:</label>
+        <form:input path="orderID" htmlEscape="false" onkeyup="onlynum(this)" maxlength="8" class="input-medium"/>
+        <label>订单编号:</label>
+        <form:input path="orderNo" htmlEscape="false" maxlength="20" class="input-medium"/><br>
+        <label>供应商:</label>
+        <form:input path="shopName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>机构:</label>
+        <form:input path="clubName" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label class="control-label">下单时间:</label>
+        <form:input path="startTime" type="text" maxlength="10" class="input-medium Wdate" value="${startTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <span class="time-space-symbols">至</span>
+        <form:input path="endTime" type="text" maxlength="10" class="input-medium Wdate" value="${endTime}"
+                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+        <div class="pay-status">
+            <label>组织:</label>
+            <form:select path="organizeID" class="input-medium">
+                <form:option value="" label="请选择"/>
+                <form:option value="0" label="采美"/>
+                <form:option value="9999" label="呵呵商城"/>
+                <c:forEach items="${cmUserOrganizeList}" var="organize">
+                    <c:if test="${organize.id!=4}">
+                        <form:option value="${organize.id}" label="${organize.organizeName}"/>
+                    </c:if>
+                </c:forEach>
+            </form:select>
+            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<div class="pay-wrapper">
+    <button id="applyShopOtherFee" class="t-btn" style="color:white;background-color:#2F6FAB">付第三方申请</button>
+    <c:forEach items="${page.list}" var="s" varStatus="sIndex">
+        <div class="pay-list-item">
+            <table class="table table-striped table-bordered table-condensed pay-table">
+                <tr>
+                    <th style="width:20px;">
+                        <input type="checkbox" ${s.status eq 7 ?'disabled':''} data-shoporderid="${s.shopOrderID}"
+                               data-shopid="${s.shopID}" data-isPayShopOtherFee="${s.payShopOtherFee}"/>
+                    </th>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3">订单编号(ID)</th>
+                    <th colspan="2">订单金额</th>
+                    <th colspan="3">下单时间</th>
+                    <th>收款状态</th>
+                    <th>收款金额</th>
+                    <th colspan="3">促销满减</th>
+                    <th>优惠券</th>
+                    <th>成本类型</th>
+                </tr>
+                <tr>
+                    <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
+                    <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
+                    <td colspan="2"><fmt:formatNumber value="${s.payTotalFee}" type="number" pattern="#,##0.00"/></td>
+                    <td colspan="3">${s.orderTime}</td>
+                        <%--此处对应订单列表收款状态--%>
+                    <td>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&shopOrderID=${s.shopOrderID}&from=1"
+                           style="text-decoration: underline">
+                            <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
+                            <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                            <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                    </td>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                           style="text-decoration: underline">${s.receiptTotalFee}</a></td>
+                    <td colspan="3">
+                        <fmt:formatNumber value="${s.promotionFullReduction}" type="number" pattern="#,##0.00"/>
+                    </td>
+                    <td>
+                            ${s.couponAmount}
+                    </td>
+                    <td colspan="2"><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
+                            test="${s.costType == '2'}">比例成本</c:if></td>
+                </tr>
+                <tr>
+                    <th>供应商</th>
+                    <th colspan="3">机构</th>
+                    <th>机构运费</th>
+                    <th>供应商运费</th>
+                    <th colspan="3">商品费</th>
+                    <th colspan="2">付款状态</th>
+                    <th colspan="3">应付税费</th>
+                    <th>付供应商</th>
+                    <th>付第三方</th>
+                </tr>
+                <tr>
+                    <td>${s.shopName}</td>
+                    <td colspan="3">
+                        <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
+                            ${s.clubName}
+                        <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
+                        <c:if test="${s.organizeID == 3}"><em class="weishaIcon">维沙</em></c:if>
+                    </td>
+                    <td>
+                        <c:if test="${s.freight == 0}">
+                            包邮
+                        </c:if>
+                        <c:if test="${s.freight == -1}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.freight == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+                            <fmt:formatNumber value="${s.freight}" type="currency"/>
+                            <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                        </c:if>
+                        <c:if test="${s.userBeans > 0}">
+                            <br><font color="red">(采美豆抵用:${s.userBeans})</font>
+                        </c:if>
+                    </td>
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                          type="number"
+                                                          pattern="#,##0.00"/></td>
+                    <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
+                                                                          pattern="#,##0.00"/></td>
+                    <td colspan="2">
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&shopOrderID=${s.shopOrderID}&from=1"
+                           style="text-decoration: underline">
+                            <c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font color="red">待付款</font></c:if>
+                            <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
+                            <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if>
+                        </a>
+                    </td>
+                    <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
+                                                                    pattern="#,##0.00"/></td>
+                    <td class="supplier-fee">
+                        <c:if test="${s.differenceType ne 1 && s.differenceType ne 2 }">
+                            <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount-s.shopOtherFee}"
+                                                                    type="number"
+                                                                    pattern="#,##0.00"/></font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
+                            <font color="black"><fmt:formatNumber
+                                    value="${s.shouldPayShopAmount+s.differencePrice-s.shopOtherFee}"/></font><font
+                                color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
+                        </c:if>
+                        <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
+                            <font color="black"><fmt:formatNumber
+                                    value="${s.shouldPayShopAmount-s.differencePrice-s.shopOtherFee}"/></font><font
+                                color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
+                        </c:if>
+                    </td>
+                    <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
+                    <input type="hidden" class="productAmount" value="${s.productAmount}">
+                    <input type="hidden" class="costType" value="${s.costType}">
+                    <input type="hidden" class="proportional" value="${s.proportional}">
+                    <input type="hidden" class="modifyShouldPayNote" value="${s.modifyShouldPayNote}">
+                    <td class="third-party-fee">
+                        <fmt:formatNumber value="${s.shopOtherFee}" type="number"
+                                          pattern="#,##0.00"/>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee},第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee > 0 and s.cmShopOtherFee eq 0}">
+                            <font color="red">(第三方中介费¥${s.shopOtherFee})</font>
+                        </c:if>
+                        <c:if test="${s.shopOtherFee eq 0 and s.cmShopOtherFee > 0}">
+                            <font color="red">(采美中介费¥${s.cmShopOtherFee})</font>
+                        </c:if>
+                    </td>
+                </tr>
+                <tr>
+                    <th>商品名</th>
+                    <th>规格</th>
+                    <th>数量<%--(赠品)--%></th>
+                    <th>退货</th>
+                    <th colspan="2">单价</th>
+                    <th colspan="3">机构税率 / 单税费 / 总税费</th>
+                    <th colspan="2">总价</th>
+                    <th colspan="3">供应商税率 / 单税费 / 总税费</th>
+                    <th>成本(单)</th>
+                    <th>成本(总)</th>
+                </tr>
+                <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
+                    <tr class="pay-product-item">
+                        <input type="hidden" class="p-copId" value="${p.orderProductID}">
+                        <td style="width:300px;" class="p-name">
+                            <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
+                            <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
+                                ${p.name}
+                        </td>
+                        <td style="width:80px;">${p.unit}</td>
+                        <td class="p-num" data-num="${p.num + p.presentNum}">
+                                ${p.num}
+                            <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
+                        </td>
+                        <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
+                        <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
+                                                          type="number" pattern="#,##0.00"/>
+                            <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
+                                <label style="color: red">
+                                    (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                </label>
+                            </c:if>
+                        </td>
+                        <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
+                        <td>
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td colspan="2"><fmt:formatNumber
+                                value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
+                                type="number" pattern="#,##0.00"/></td>
+                        <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
+                        <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
+                        <td class="p-taxes-t">
+                            <c:choose>
+                                <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
+                                    ---
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber
+                                            value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
+                                            type="number" pattern="#,##0.00"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </td>
+                        <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
+                                                                  pattern="#,##0.00"/></td>
+                        <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
+                                              type="number" pattern="#,##0.00"/></td>
+                    </tr>
+                </c:forEach>
+            </table>
+            <div class="pay-more-func">
+                <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
+                <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>
+            </div>
+        </div>
+    </c:forEach>
+</div>
+<div class="pagination">${page}</div>
+
+<script>
+    (function () {
+        var payTableEle = $('.pay-table'),
+            payProductEle = $('.pay-product-item');
+        payTableEle.each(function (i, l) {
+            var leftLength = $(this).find('tr').length,
+                productLength = $(this).find('.pay-product-item').length;
+            // 左侧栏合并单元格
+            $(this).find('tr:first-child th:first-child').attr('rowspan', leftLength);
+        });
+
+        $('.tab-li').on('click', function () {
+            if (getCheckedArr) {
+                sessionStorage.removeItem('checkedIndexArr');
+            }
+        });
+
+        //付第三方
+        $('#applyShopOtherFee').on('click', function () {
+            var checked = $('.pay-wrapper input[type=checkbox]:checked');
+            if (checked.length < 1) {
+                alertx('请选择一个子订单');
+                return false;
+            }
+            if (checked.length > 1) {
+                alertx('每次只能选择一个子订单进行付第三方申请');
+                return false;
+            }
+            var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
+            if ("false" == isPayShopOtherFee) {
+                alertx("付第三方处于待审核状态,暂不能操作");
+                return false;
+            }
+            var shopOrderId = $(checked[0]).attr('data-shoporderid');
+            window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?otherType=1&shopOrderId=' + shopOrderId;
+        });
+
+    })();
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+
+    function submitFunc() {
+        var checkedArr = [];
+        $('.pay-checkbox').each(function (index) {
+            var thisStatus = $(this).prop('checked');
+            if (thisStatus) {
+                checkedArr.push(index);
+            }
+        })
+        if (checkedArr.length > 0) {
+            sessionStorage.setItem('checkedIndexArr', JSON.stringify(checkedArr));
+        } else {
+            sessionStorage.setItem('checkedIndexArr', []);
+        }
+    }
+
+    function inputnum(obj, val) {
+        obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+        obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+        obj.value = obj.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
+        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+    }
+</script>
+</body>
+</html>

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

@@ -234,6 +234,7 @@
            class="form-horizontal">
     <form:hidden path="shopOrderId"/>
     <input style="display: none" name="payType" value="${payType}"/>
+    <input style="display: none" name="otherType" value="${otherType}"/>
     <div class="control-group">
         <label class="control-label"><font color='red'>*</font>付款单名称:</label>
         <div class="controls">

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

@@ -56,7 +56,8 @@
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>身份:</label>
 			<div class="controls">
 				<form:select path="position" itemLabel="key" itemValue="value" htmlEscape="false">
-                    <form:options items="${positionMap}" />
+				  	    <form:option value="0" label="内部协销"/>
+				  	    <form:option value="2" label="外部协销"/>
                 </form:select>
             </div>
 		</div>

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

@@ -90,7 +90,9 @@
 			<div class="controls">
 				<%--<input name="duty" htmlEscape="false" maxlength="11" class="input-xlarge required"/>--%>
 				<select name="duty">
-				        <option value="0">协销员工</option>
+				        
+					<option value="0">内部协销</option>
+					<option value="2">外部协销</option>
 						<c:if test="${hasManager}==0">
 							<option value="1">协销经理</option>
 						</c:if>

+ 15 - 0
src/main/webapp/WEB-INF/views/modules/userNew/cmSpList.jsp

@@ -50,6 +50,12 @@
 		</form:select>
 		<label>手机号:</label>
 			<form:input path="contractMobile" htmlEscape="false" maxlength="20" class="input-medium"/>
+		<label>类型:</label>
+		<form:select path="insiderFlag" class="input-medium">
+			<form:option value="" label="请选择"/>
+			<form:option value="0" label="内部协销"/>
+			<form:option value="1" label="外部协销"/>
+		</form:select>
 		&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 		<div class="clearfix"></div>
 	</div>
@@ -63,6 +69,7 @@
 				<%--<th>联系人</th>--%>
 				<th>手机号</th>
 				<th>状态</th>
+				<th>类型</th>
 				<%--<th>身份</th>--%>
 				<th>创建时间</th>
 				<shiro:hasPermission name="user:newCmClub:edit"><th>操作</th></shiro:hasPermission>
@@ -83,6 +90,14 @@
 						已下线
 					</c:if>
 				</td>
+				<td>
+					<c:if test="${newCmSp.insiderFlag eq 0}">
+						内部协销
+					</c:if>
+					<c:if test="${newCmSp.insiderFlag eq 1}">
+						外部协销
+					</c:if>
+				</td>
 				<%--<td>${newCmSp.spIdentity}</td>--%>
 				<td>${newCmSp.addTime}</td>
 				<shiro:hasPermission name="user:newCmClub:edit">