瀏覽代碼

新增引流友站id参数&bugfix

zhijiezhao 1 年之前
父節點
當前提交
585abef794

+ 17 - 9
src/main/java/com/caimei365/user/controller/ClubApi.java

@@ -90,6 +90,7 @@ public class ClubApi {
 
 
     /**
     /**
      * 更新机构资料--组织
      * 更新机构资料--组织
+     *
      * @param club
      * @param club
      * @return
      * @return
      */
      */
@@ -101,6 +102,7 @@ public class ClubApi {
 
 
     /**
     /**
      * 重新提交机构资料--组织
      * 重新提交机构资料--组织
+     *
      * @param club
      * @param club
      * @return
      * @return
      */
      */
@@ -109,6 +111,7 @@ public class ClubApi {
     public ResponseJson<ClubUpdateDto> organizeClubinfo(ClubUpdateDto club) {
     public ResponseJson<ClubUpdateDto> organizeClubinfo(ClubUpdateDto club) {
         return clubService.organizeClubinfo(club);
         return clubService.organizeClubinfo(club);
     }
     }
+
     /**
     /**
      * 机构个人中心
      * 机构个人中心
      * <p>
      * <p>
@@ -232,7 +235,7 @@ public class ClubApi {
 
 
     @ApiOperation("优先展示标签 -- 咨询记录 -> 标签记录")
     @ApiOperation("优先展示标签 -- 咨询记录 -> 标签记录")
     @GetMapping("/remarks/getPriorKeyword")
     @GetMapping("/remarks/getPriorKeyword")
-    public ResponseJson<List<Map<String, String>>> getPriorKeyword(){
+    public ResponseJson<List<Map<String, String>>> getPriorKeyword() {
 
 
         return clubService.getPriorKeyword();
         return clubService.getPriorKeyword();
     }
     }
@@ -595,12 +598,12 @@ public class ClubApi {
 
 
     /**
     /**
      * 机构访问记录列表
      * 机构访问记录列表
+     *
      * @param clubId
      * @param clubId
      * @return
      * @return
      */
      */
     @GetMapping("/record/list")
     @GetMapping("/record/list")
     public ResponseJson accessRecords(Integer clubId) {
     public ResponseJson accessRecords(Integer clubId) {
-
         if (null == clubId) {
         if (null == clubId) {
             return ResponseJson.error("机构id不能为空");
             return ResponseJson.error("机构id不能为空");
         }
         }
@@ -609,13 +612,14 @@ public class ClubApi {
 
 
     /**
     /**
      * 机构访问记录详情
      * 机构访问记录详情
+     *
      * @param clubId
      * @param clubId
      * @param accessDate
      * @param accessDate
      * @param ip
      * @param ip
      * @return
      * @return
      */
      */
     @GetMapping("/record/detail")
     @GetMapping("/record/detail")
-    public ResponseJson recordDetail(Integer clubId, String accessDate,String ip, Integer pageNum, Integer pageSize) {
+    public ResponseJson recordDetail(Integer clubId, String accessDate, String ip, Integer pageNum, Integer pageSize) {
         if (null == clubId) {
         if (null == clubId) {
             return ResponseJson.error("机构id不能为空", null);
             return ResponseJson.error("机构id不能为空", null);
         }
         }
@@ -627,19 +631,21 @@ public class ClubApi {
 
 
     /**
     /**
      * 机构初始数据
      * 机构初始数据
+     *
      * @param clubId
      * @param clubId
      * @return
      * @return
      */
      */
     @GetMapping("/clubInitial")
     @GetMapping("/clubInitial")
     public ResponseJson selTotal(Integer clubId) {
     public ResponseJson selTotal(Integer clubId) {
         if (null == clubId) {
         if (null == clubId) {
-            return ResponseJson.error("机构id不能为空",null);
+            return ResponseJson.error("机构id不能为空", null);
         }
         }
         return clubService.selTotal(clubId);
         return clubService.selTotal(clubId);
     }
     }
 
 
     /**
     /**
      * 用户需求
      * 用户需求
+     *
      * @param clubId
      * @param clubId
      * @param dateType
      * @param dateType
      * @param startTime
      * @param startTime
@@ -650,8 +656,10 @@ public class ClubApi {
     public ResponseJson<Map<String, Object>> getCustomDemand(Integer clubId, Integer dateType, String startTime, String endTime) {
     public ResponseJson<Map<String, Object>> getCustomDemand(Integer clubId, Integer dateType, String startTime, String endTime) {
         return clubService.getCustomDemand(clubId, dateType, startTime, endTime);
         return clubService.getCustomDemand(clubId, dateType, startTime, endTime);
     }
     }
+
     /**
     /**
      * 机构画像
      * 机构画像
+     *
      * @param cmPortrait
      * @param cmPortrait
      * @return
      * @return
      */
      */
@@ -659,17 +667,17 @@ public class ClubApi {
     @ResponseBody
     @ResponseBody
     public ResponseJson clubPortrait(CmPortraitDto cmPortrait) {
     public ResponseJson clubPortrait(CmPortraitDto cmPortrait) {
         if (null == cmPortrait.getClubId()) {
         if (null == cmPortrait.getClubId()) {
-            return ResponseJson.error("机构id不能为空",null);
+            return ResponseJson.error("机构id不能为空", null);
         }
         }
         if (null == cmPortrait.getDateType()) {
         if (null == cmPortrait.getDateType()) {
-            return ResponseJson.error("时间类型不能为空",null);
+            return ResponseJson.error("时间类型不能为空", null);
         }
         }
         if (null == cmPortrait.getType()) {
         if (null == cmPortrait.getType()) {
-            return ResponseJson.error("数据类型不能为空",null);
+            return ResponseJson.error("数据类型不能为空", null);
         }
         }
         if (StringUtils.isNotBlank(cmPortrait.getStartTime()) && StringUtils.isNotBlank(cmPortrait.getEndTime())) {
         if (StringUtils.isNotBlank(cmPortrait.getStartTime()) && StringUtils.isNotBlank(cmPortrait.getEndTime())) {
-            if (cmPortrait.getStartTime().compareTo(cmPortrait.getEndTime()) > 0 ) {
-                return ResponseJson.error("开始时间不能大于结束时间",null);
+            if (cmPortrait.getStartTime().compareTo(cmPortrait.getEndTime()) > 0) {
+                return ResponseJson.error("开始时间不能大于结束时间", null);
             }
             }
         }
         }
         return clubService.dataList(cmPortrait);
         return clubService.dataList(cmPortrait);

+ 5 - 2
src/main/java/com/caimei365/user/controller/CmBehaviorRecordApi.java

@@ -36,7 +36,10 @@ public class CmBehaviorRecordApi {
      */
      */
     @IpSave(saveName = "用户行为记录", saveParams = true)
     @IpSave(saveName = "用户行为记录", saveParams = true)
     @GetMapping("/Statistics")
     @GetMapping("/Statistics")
-    public ResponseJson<String> behaviorRecordApp(HttpServletRequest request, Integer userId, String pagePath, String pageType, String pageLabel, String behaviorType, Integer productId, String accessDuration, Integer accessClient, Integer shopId, String headUserId, String productArchiveId, String openId) {
+    public ResponseJson<String> behaviorRecordApp(HttpServletRequest request, Integer userId, String pagePath,
+                                                  String pageType, String pageLabel, String behaviorType, Integer productId,
+                                                  String accessDuration, Integer accessClient, Integer shopId, String headUserId,
+                                                  String productArchiveId, String openId, Integer partnerId) {
         HttpSession session = request.getSession();
         HttpSession session = request.getSession();
         Cookie[] cookies = request.getCookies();
         Cookie[] cookies = request.getCookies();
         if (null != cookies) {
         if (null != cookies) {
@@ -47,7 +50,7 @@ public class CmBehaviorRecordApi {
             }
             }
         }
         }
         String touristId = (String) session.getAttribute("touristId");
         String touristId = (String) session.getAttribute("touristId");
-        log.info("用户行为记录=======userId==》" + userId + "==pagePath==" + pagePath + "==pageType==" + pageType + "==pageLabel==" + pageLabel + "==behaviorType==" + behaviorType + "==productId==" + productId + "==accessDuration==" + accessDuration + "==accessClient==" + accessClient + "==shopId==" + shopId + "==headUserId=="+headUserId+ "==productArchiveId=="+productArchiveId+ "==openId=="+openId);
+        log.info("用户行为记录=======userId==》" + userId + "==pagePath==" + pagePath + "==pageType==" + pageType + "==pageLabel==" + pageLabel + "==behaviorType==" + behaviorType + "==productId==" + productId + "==accessDuration==" + accessDuration + "==accessClient==" + accessClient + "==shopId==" + shopId + "==headUserId==" + headUserId + "==productArchiveId==" + productArchiveId + "==openId==" + openId);
         return ResponseJson.success("用户行为记录完成");
         return ResponseJson.success("用户行为记录完成");
     }
     }
 
 

+ 0 - 3
src/main/java/com/caimei365/user/idempotent/IpSaveAspect.java

@@ -1,7 +1,6 @@
 package com.caimei365.user.idempotent;
 package com.caimei365.user.idempotent;
 
 
 
 
-import com.alibaba.fastjson.JSON;
 import com.caimei365.user.feign.ToolsFeign;
 import com.caimei365.user.feign.ToolsFeign;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
@@ -21,9 +20,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
-import java.util.Enumeration;
 
 
 
 
 /**
 /**

+ 4 - 0
src/main/java/com/caimei365/user/model/dto/ClubRegisterDto.java

@@ -16,6 +16,10 @@ import java.io.Serializable;
 @ApiModel("机构注册")
 @ApiModel("机构注册")
 @Data
 @Data
 public class ClubRegisterDto implements Serializable {
 public class ClubRegisterDto implements Serializable {
+    /**
+     * 友站id,1 dep
+     */
+    private Integer partnerId;
     /**
     /**
      *  内外部协销标记 0内部协销,1外部协销
      *  内外部协销标记 0内部协销,1外部协销
      */
      */

+ 4 - 0
src/main/java/com/caimei365/user/model/dto/RoosInformationDto.java

@@ -11,6 +11,10 @@ import lombok.Data;
 @Data
 @Data
 public class RoosInformationDto {
 public class RoosInformationDto {
 
 
+    /**
+     * 友站id,1 dep
+     */
+    private Integer partnerId;
     /**
     /**
      * 访问人ip
      * 访问人ip
      */
      */

+ 4 - 0
src/main/java/com/caimei365/user/model/po/UserPo.java

@@ -12,6 +12,10 @@ import java.io.Serializable;
  */
  */
 @Data
 @Data
 public class UserPo implements Serializable {
 public class UserPo implements Serializable {
+    /**
+     * 友站id,1 dep
+     */
+    private Integer partnerId;
     /**
     /**
      * 组织ID
      * 组织ID
      */
      */

+ 4 - 0
src/main/java/com/caimei365/user/model/vo/CmRecordVo.java

@@ -1,6 +1,8 @@
 package com.caimei365.user.model.vo;
 package com.caimei365.user.model.vo;
 
 
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.Map;
@@ -11,6 +13,8 @@ import java.util.Map;
  * @author : Charles
  * @author : Charles
  * @date : 2023/3/24
  * @date : 2023/3/24
  */
  */
+@AllArgsConstructor
+@NoArgsConstructor
 @Data
 @Data
 public class CmRecordVo {
 public class CmRecordVo {
     /**
     /**

+ 4 - 1
src/main/java/com/caimei365/user/model/vo/UserLoginVo.java

@@ -14,7 +14,10 @@ import java.util.Date;
  */
  */
 @Data
 @Data
 public class UserLoginVo implements Serializable {
 public class UserLoginVo implements Serializable {
-
+    /**
+     * 友站id,1 dep
+     */
+    private Integer partnerId;
     /**
     /**
      * 内外部协销标记 0内部协销,1外部协销
      * 内外部协销标记 0内部协销,1外部协销
      */
      */

+ 4 - 0
src/main/java/com/caimei365/user/service/impl/AsyncService.java

@@ -111,4 +111,8 @@ public class AsyncService {
             weChatService.sendChoseServiceMessage(title, keyWord1, keyWord2, keyWord3, keyWord4, remark, path, openId, templateId);
             weChatService.sendChoseServiceMessage(title, keyWord1, keyWord2, keyWord3, keyWord4, remark, path, openId, templateId);
         }
         }
     }
     }
+    @Async("taskExecutor")
+    public void updateTourist(Integer userId, String touristId) {
+        loginMapper.updateTourist(userId, touristId);
+    }
 }
 }

+ 69 - 84
src/main/java/com/caimei365/user/service/impl/ClubServiceImpl.java

@@ -125,7 +125,7 @@ public class ClubServiceImpl implements ClubService {
             try {
             try {
                 club.setFirstTime(remarksInfo.getFirstTime() != null ? dateFormat.format(dateFormat.parse(remarksInfo.getFirstTime())) : null);
                 club.setFirstTime(remarksInfo.getFirstTime() != null ? dateFormat.format(dateFormat.parse(remarksInfo.getFirstTime())) : null);
                 club.setRecentlyTime(remarksInfo.getRecentlyTime() != null ? dateFormat.format(dateFormat.parse(remarksInfo.getRecentlyTime())) : null);
                 club.setRecentlyTime(remarksInfo.getRecentlyTime() != null ? dateFormat.format(dateFormat.parse(remarksInfo.getRecentlyTime())) : null);
-            }catch (ParseException e) {
+            } catch (ParseException e) {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
         }
         }
@@ -234,11 +234,11 @@ public class ClubServiceImpl implements ClubService {
             long timeOld = calendar.getTime().getTime();
             long timeOld = calendar.getTime().getTime();
             calendar.setTime(new Date());
             calendar.setTime(new Date());
             long timeNew = calendar.getTime().getTime();
             long timeNew = calendar.getTime().getTime();
-            int day = (int)(timeNew - timeOld) / 1000 / 60 / 60 / 24;
+            int day = (int) (timeNew - timeOld) / 1000 / 60 / 60 / 24;
             if (day > 3) {
             if (day > 3) {
-                map.put("lostType",1);
+                map.put("lostType", 1);
             } else {
             } else {
-                map.put("lostType",0);
+                map.put("lostType", 0);
             }
             }
         }
         }
         return ResponseJson.success(map);
         return ResponseJson.success(map);
@@ -357,19 +357,19 @@ public class ClubServiceImpl implements ClubService {
     public ResponseJson<ClubUpdateDto> updateOrganizeClubinfo(ClubUpdateDto club) {
     public ResponseJson<ClubUpdateDto> updateOrganizeClubinfo(ClubUpdateDto club) {
         // 参数校验
         // 参数校验
         if (club.getUserId() == null) {
         if (club.getUserId() == null) {
-            return ResponseJson.error(-1,"参数异常:用户Id不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:用户Id不能为空!", null);
         }
         }
         if (club.getClubId() == null) {
         if (club.getClubId() == null) {
-            return ResponseJson.error(-1,"参数异常:机构Id不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:机构Id不能为空!", null);
         }
         }
         if (club.getLinkMan() == null) {
         if (club.getLinkMan() == null) {
-            return ResponseJson.error(-1,"参数异常:联系人不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:联系人不能为空!", null);
         }
         }
         if (StringUtils.isBlank(club.getMedicalPracticeLicense()) || StringUtils.isEmpty(club.getMedicalPracticeLicense())) {
         if (StringUtils.isBlank(club.getMedicalPracticeLicense()) || StringUtils.isEmpty(club.getMedicalPracticeLicense())) {
-            return ResponseJson.error(-1,"请上传营业执照",null);
+            return ResponseJson.error(-1, "请上传营业执照", null);
         }
         }
         if (StringUtils.isBlank(club.getBusinessLicense()) || StringUtils.isEmpty(club.getBusinessLicense())) {
         if (StringUtils.isBlank(club.getBusinessLicense()) || StringUtils.isEmpty(club.getBusinessLicense())) {
-            return ResponseJson.error(-1,"请上传医疗职业许可证",null);
+            return ResponseJson.error(-1, "请上传医疗职业许可证", null);
         }
         }
         UserPo user = new UserPo();
         UserPo user = new UserPo();
         // 用户Id
         // 用户Id
@@ -402,19 +402,19 @@ public class ClubServiceImpl implements ClubService {
     public ResponseJson<ClubUpdateDto> organizeClubinfo(ClubUpdateDto club) {
     public ResponseJson<ClubUpdateDto> organizeClubinfo(ClubUpdateDto club) {
         // 参数校验
         // 参数校验
         if (club.getUserId() == null) {
         if (club.getUserId() == null) {
-            return ResponseJson.error(-1,"参数异常:用户Id不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:用户Id不能为空!", null);
         }
         }
         if (club.getClubId() == null) {
         if (club.getClubId() == null) {
-            return ResponseJson.error(-1,"参数异常:机构Id不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:机构Id不能为空!", null);
         }
         }
         if (club.getLinkMan() == null) {
         if (club.getLinkMan() == null) {
-            return ResponseJson.error(-1,"参数异常:联系人不能为空!", null);
+            return ResponseJson.error(-1, "参数异常:联系人不能为空!", null);
         }
         }
         if (StringUtils.isBlank(club.getMedicalPracticeLicense()) || StringUtils.isEmpty(club.getMedicalPracticeLicense())) {
         if (StringUtils.isBlank(club.getMedicalPracticeLicense()) || StringUtils.isEmpty(club.getMedicalPracticeLicense())) {
-            return ResponseJson.error(-1,"请上传营业执照",null);
+            return ResponseJson.error(-1, "请上传营业执照", null);
         }
         }
         if (StringUtils.isBlank(club.getBusinessLicense()) || StringUtils.isEmpty(club.getBusinessLicense())) {
         if (StringUtils.isBlank(club.getBusinessLicense()) || StringUtils.isEmpty(club.getBusinessLicense())) {
-            return ResponseJson.error(-1,"请上传医疗职业许可证",null);
+            return ResponseJson.error(-1, "请上传医疗职业许可证", null);
         }
         }
         UserPo user = new UserPo();
         UserPo user = new UserPo();
         // 用户Id
         // 用户Id
@@ -482,7 +482,7 @@ public class ClubServiceImpl implements ClubService {
                 }
                 }
 
 
                 if (clubVo.getLinkManIdentity() != null) {
                 if (clubVo.getLinkManIdentity() != null) {
-                    if (club.getLinkManIdentity() != null ) {
+                    if (club.getLinkManIdentity() != null) {
                         if (club.getLinkManIdentity().equals(clubVo.getLinkManIdentity())) {
                         if (club.getLinkManIdentity().equals(clubVo.getLinkManIdentity())) {
                             list.add("修改了联系人身份");
                             list.add("修改了联系人身份");
                             type = 1;
                             type = 1;
@@ -492,7 +492,7 @@ public class ClubServiceImpl implements ClubService {
                         type = 1;
                         type = 1;
                     }
                     }
                 } else {
                 } else {
-                    if (club.getLinkManIdentity() != null ) {
+                    if (club.getLinkManIdentity() != null) {
                         list.add("新增了联系人身份");
                         list.add("新增了联系人身份");
                         type = 1;
                         type = 1;
                     }
                     }
@@ -790,7 +790,7 @@ public class ClubServiceImpl implements ClubService {
             }
             }
         }
         }
         operationalLogsPo.setOperationType("编辑");
         operationalLogsPo.setOperationType("编辑");
-        operationalLogsPo.setActionContent(StringUtils.strip(list.toString(),"[]"));
+        operationalLogsPo.setActionContent(StringUtils.strip(list.toString(), "[]"));
 
 
         // 机构修改 机构联系人 为操作人
         // 机构修改 机构联系人 为操作人
         if (StringUtils.isNotBlank(club.getLinkMan())) {
         if (StringUtils.isNotBlank(club.getLinkMan())) {
@@ -807,7 +807,7 @@ public class ClubServiceImpl implements ClubService {
         }
         }
         operationalLogsPo.setOperationTime(new Date());
         operationalLogsPo.setOperationTime(new Date());
 
 
-        log.info("operationalLogsPo====="+operationalLogsPo);
+        log.info("operationalLogsPo=====" + operationalLogsPo);
         clubMapper.insertOpLogs(operationalLogsPo);
         clubMapper.insertOpLogs(operationalLogsPo);
         return type;
         return type;
     }
     }
@@ -1095,15 +1095,15 @@ public class ClubServiceImpl implements ClubService {
                     for (String keyword : split) {
                     for (String keyword : split) {
                         trendsKeywordList.add(keyword);
                         trendsKeywordList.add(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
-                        if(null == keywordExist) {
+                        if (null == keywordExist) {
                             clubMapper.insertLabel(keyword, serviceProviderId, 1, 0);
                             clubMapper.insertLabel(keyword, serviceProviderId, 1, 0);
                         }
                         }
                     }
                     }
                 } else {
                 } else {
                     trendsKeywordList.add(trendsKeyword);
                     trendsKeywordList.add(trendsKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(trendsKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(trendsKeyword);
-                    if(null == keywordExist) {
-                        clubMapper.insertLabel(trendsKeyword, serviceProviderId, 1,0);
+                    if (null == keywordExist) {
+                        clubMapper.insertLabel(trendsKeyword, serviceProviderId, 1, 0);
                     }
                     }
                 }
                 }
             }
             }
@@ -1116,14 +1116,14 @@ public class ClubServiceImpl implements ClubService {
                     for (String keyword : split) {
                     for (String keyword : split) {
                         stateKeywordList.add(keyword);
                         stateKeywordList.add(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
-                        if(null == keywordExist) {
+                        if (null == keywordExist) {
                             clubMapper.insertLabel(keyword, serviceProviderId, 0, 1);
                             clubMapper.insertLabel(keyword, serviceProviderId, 0, 1);
                         }
                         }
                     }
                     }
                 } else {
                 } else {
                     stateKeywordList.add(stateKeyword);
                     stateKeywordList.add(stateKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(stateKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(stateKeyword);
-                    if(null == keywordExist) {
+                    if (null == keywordExist) {
                         clubMapper.insertLabel(stateKeyword, serviceProviderId, 0, 1);
                         clubMapper.insertLabel(stateKeyword, serviceProviderId, 0, 1);
                     }
                     }
                 }
                 }
@@ -1302,7 +1302,7 @@ public class ClubServiceImpl implements ClubService {
             clubMapper.updateRemarksSp(clubId, oldSpId, spId, 1);
             clubMapper.updateRemarksSp(clubId, oldSpId, spId, 1);
         }
         }
         if (!spId.equals(choseServiceId)) {
         if (!spId.equals(choseServiceId)) {
-            log.info("更新协销微信模板提醒"+choseServiceId);
+            log.info("更新协销微信模板提醒" + choseServiceId);
             asyncService.sendChoseServiceMessage(1, clubId, spId, choseServiceId);
             asyncService.sendChoseServiceMessage(1, clubId, spId, choseServiceId);
         }
         }
         // 添加协销更换记录
         // 添加协销更换记录
@@ -2061,15 +2061,15 @@ public class ClubServiceImpl implements ClubService {
                     for (String keyword : split) {
                     for (String keyword : split) {
                         trendsKeywordList.add(keyword);
                         trendsKeywordList.add(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
-                        if(null == keywordExist) {
+                        if (null == keywordExist) {
                             clubMapper.insertLabel(keyword, serviceProviderId, 1, 0);
                             clubMapper.insertLabel(keyword, serviceProviderId, 1, 0);
                         }
                         }
                     }
                     }
                 } else {
                 } else {
                     trendsKeywordList.add(trendsKeyword);
                     trendsKeywordList.add(trendsKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(trendsKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(trendsKeyword);
-                    if(null == keywordExist) {
-                        clubMapper.insertLabel(trendsKeyword, serviceProviderId, 1,0);
+                    if (null == keywordExist) {
+                        clubMapper.insertLabel(trendsKeyword, serviceProviderId, 1, 0);
                     }
                     }
                 }
                 }
             }
             }
@@ -2082,14 +2082,14 @@ public class ClubServiceImpl implements ClubService {
                     for (String keyword : split) {
                     for (String keyword : split) {
                         stateKeywordList.add(keyword);
                         stateKeywordList.add(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
                         Integer keywordExist = clubMapper.findKeywordExist(keyword);
-                        if(null == keywordExist) {
+                        if (null == keywordExist) {
                             clubMapper.insertLabel(keyword, serviceProviderId, 0, 1);
                             clubMapper.insertLabel(keyword, serviceProviderId, 0, 1);
                         }
                         }
                     }
                     }
                 } else {
                 } else {
                     stateKeywordList.add(stateKeyword);
                     stateKeywordList.add(stateKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(stateKeyword);
                     Integer keywordExist = clubMapper.findKeywordExist(stateKeyword);
-                    if(null == keywordExist) {
+                    if (null == keywordExist) {
                         clubMapper.insertLabel(stateKeyword, serviceProviderId, 0, 1);
                         clubMapper.insertLabel(stateKeyword, serviceProviderId, 0, 1);
                     }
                     }
                 }
                 }
@@ -2218,7 +2218,7 @@ public class ClubServiceImpl implements ClubService {
                 state.add(map);
                 state.add(map);
             }
             }
             // 数据为空时 返回null
             // 数据为空时 返回null
-            if ( StringUtils.isBlank(visitRemarksVo.getStateKeyword()) || StringUtils.isEmpty(visitRemarksVo.getStateKeyword())) {
+            if (StringUtils.isBlank(visitRemarksVo.getStateKeyword()) || StringUtils.isEmpty(visitRemarksVo.getStateKeyword())) {
                 state = null;
                 state = null;
             }
             }
 
 
@@ -2364,7 +2364,7 @@ public class ClubServiceImpl implements ClubService {
                 }
                 }
             }
             }
             // 数据为空时 返回null
             // 数据为空时 返回null
-            if ( (StringUtils.isBlank(rk) || StringUtils.isEmpty(rk)) &&
+            if ((StringUtils.isBlank(rk) || StringUtils.isEmpty(rk)) &&
                     (StringUtils.isBlank(r.getTrendsKeyword()) || StringUtils.isEmpty(r.getTrendsKeyword())) &&
                     (StringUtils.isBlank(r.getTrendsKeyword()) || StringUtils.isEmpty(r.getTrendsKeyword())) &&
                     (StringUtils.isBlank(r.getStateKeyword()) || StringUtils.isEmpty(r.getStateKeyword()))) {
                     (StringUtils.isBlank(r.getStateKeyword()) || StringUtils.isEmpty(r.getStateKeyword()))) {
                 strings = null;
                 strings = null;
@@ -2525,29 +2525,12 @@ public class ClubServiceImpl implements ClubService {
     @Override
     @Override
     public ResponseJson accessRecords(Integer clubId) {
     public ResponseJson accessRecords(Integer clubId) {
         List<CmRecordVo> data = new ArrayList<>();
         List<CmRecordVo> data = new ArrayList<>();
-        ArrayList list = new ArrayList<>();
-        ArrayList<String> listYear = new ArrayList<>();
-        CmRecordVo cmRecordVo = new CmRecordVo();
         List<RecordVo> records = clubMapper.accessRecords(clubId);
         List<RecordVo> records = clubMapper.accessRecords(clubId);
-        String substring = "";
         if (records.size() > 0) {
         if (records.size() > 0) {
-            for (RecordVo recordVo : records) {
-                substring = recordVo.getAccessDate().substring(0, 4);
-                if (!listYear.contains(substring)) {
-                    listYear.add(substring);
-                }
-            }
-            for (int i = 0; i < listYear.size() ; i++) {
-                for (RecordVo recordVo : records) {
-                    if (listYear.get(i).equals(recordVo.getAccessDate().substring(0, 4))) {
-                        recordVo.setMonthAndDay(recordVo.getAccessDate().substring(5));
-                        list.add(recordVo);
-                    }
-                }
-                cmRecordVo.setYear(listYear.get(i));
-                cmRecordVo.setData(list);
-                data.add(cmRecordVo);
-            }
+            Map<String, ArrayList<RecordVo>> collectMap = records.stream().collect(Collectors.groupingBy(r -> r.getAccessDate().substring(0, 4), Collectors.toCollection(ArrayList::new)));
+            collectMap.forEach((year, r) -> {
+                data.add(new CmRecordVo(year, r));
+            });
         }
         }
         return ResponseJson.success(data);
         return ResponseJson.success(data);
     }
     }
@@ -2562,7 +2545,7 @@ public class ClubServiceImpl implements ClubService {
         // 访问来源数据
         // 访问来源数据
         List<BehaviorRecodeVo> region = clubMapper.selRegion(ip, accessDate, 0, null);
         List<BehaviorRecodeVo> region = clubMapper.selRegion(ip, accessDate, 0, null);
         String format = "";
         String format = "";
-        for(BehaviorRecodeVo record: recordDetail) {
+        for (BehaviorRecodeVo record : recordDetail) {
             // 图片处理
             // 图片处理
             if (StringUtils.isNotBlank(record.getProductImage())) {
             if (StringUtils.isNotBlank(record.getProductImage())) {
                 record.setProductImage(ImageUtils.getImageURL("product", record.getProductImage(), 0, wwwDomain));
                 record.setProductImage(ImageUtils.getImageURL("product", record.getProductImage(), 0, wwwDomain));
@@ -2597,6 +2580,7 @@ public class ClubServiceImpl implements ClubService {
 
 
     /**
     /**
      * 用户需求
      * 用户需求
+     *
      * @param clubId
      * @param clubId
      * @param dateType
      * @param dateType
      * @param startTime
      * @param startTime
@@ -2699,7 +2683,7 @@ public class ClubServiceImpl implements ClubService {
             String startTime = "";
             String startTime = "";
             cmPortrait.setEndTime(endTime);
             cmPortrait.setEndTime(endTime);
             // 日期参数为    日
             // 日期参数为    日
-            if (0 ==  cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) {
+            if (0 == cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) {
 //                cmPortrait.setAccessDate(endTime);
 //                cmPortrait.setAccessDate(endTime);
                 cmPortrait.setStartTime(endTime);
                 cmPortrait.setStartTime(endTime);
 //                cmPortrait.setEndTime(endTime);
 //                cmPortrait.setEndTime(endTime);
@@ -2734,13 +2718,13 @@ public class ClubServiceImpl implements ClubService {
         }
         }
         // 机构订单
         // 机构订单
         if (0 == cmPortrait.getType() || 4 == cmPortrait.getType()) {
         if (0 == cmPortrait.getType() || 4 == cmPortrait.getType()) {
-            if ((0 ==  cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && expty) {
+            if ((0 == cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && expty) {
                 cmPortrait.setEndTime(dateFormat.format(date));
                 cmPortrait.setEndTime(dateFormat.format(date));
             }
             }
             if (cmPortrait.getEndTime().equals(endTime)) {
             if (cmPortrait.getEndTime().equals(endTime)) {
                 cmPortrait.setEndTime(dateFormat.format(date));
                 cmPortrait.setEndTime(dateFormat.format(date));
             }
             }
-            int ordinary = 0, secondHand = 0, rebate = 0, partialRefund = 0,total = 0; //, fullRefund = 0, closed = 0
+            int ordinary = 0, secondHand = 0, rebate = 0, partialRefund = 0, total = 0; //, fullRefund = 0, closed = 0
             double orderScopeTotalFee = 0.0;
             double orderScopeTotalFee = 0.0;
             ArrayList<PortraitMap> orderPortraits = new ArrayList<>();
             ArrayList<PortraitMap> orderPortraits = new ArrayList<>();
             PortraitMap orderPortrait = new PortraitMap();
             PortraitMap orderPortrait = new PortraitMap();
@@ -2791,7 +2775,7 @@ public class ClubServiceImpl implements ClubService {
                 orderPortrait.setValue(ordinary);
                 orderPortrait.setValue(ordinary);
                 if (ordinary != 0) {
                 if (ordinary != 0) {
                     orderPortrait.setName("普通");
                     orderPortrait.setName("普通");
-                    orderPortrait.setPer(instance.format((float)ordinary / (float) length * 100));
+                    orderPortrait.setPer(instance.format((float) ordinary / (float) length * 100));
                 } else {
                 } else {
                     orderPortrait.setName("普通");
                     orderPortrait.setName("普通");
                     orderPortrait.setPer("0");
                     orderPortrait.setPer("0");
@@ -2801,7 +2785,7 @@ public class ClubServiceImpl implements ClubService {
                 orderPortrait.setValue(secondHand);
                 orderPortrait.setValue(secondHand);
                 if (secondHand != 0) {
                 if (secondHand != 0) {
                     orderPortrait.setName("二手");
                     orderPortrait.setName("二手");
-                    orderPortrait.setPer(instance.format((float)secondHand / (float) length * 100));
+                    orderPortrait.setPer(instance.format((float) secondHand / (float) length * 100));
                 } else {
                 } else {
                     orderPortrait.setName("二手");
                     orderPortrait.setName("二手");
                     orderPortrait.setPer("0");
                     orderPortrait.setPer("0");
@@ -2888,7 +2872,7 @@ public class ClubServiceImpl implements ClubService {
         }
         }
         // 咨询记录
         // 咨询记录
         if (2 == cmPortrait.getType() || 4 == cmPortrait.getType()) {
         if (2 == cmPortrait.getType() || 4 == cmPortrait.getType()) {
-            if ((0 ==  cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && expty) {
+            if ((0 == cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && expty) {
                 cmPortrait.setEndTime(dateFormat.format(date));
                 cmPortrait.setEndTime(dateFormat.format(date));
             }
             }
             if (cmPortrait.getEndTime().equals(endTime)) {
             if (cmPortrait.getEndTime().equals(endTime)) {
@@ -2902,7 +2886,7 @@ public class ClubServiceImpl implements ClubService {
             ArrayList<String> remarkAll = new ArrayList<>();
             ArrayList<String> remarkAll = new ArrayList<>();
             int number = 0;
             int number = 0;
             if (remarksList.size() != 0) {
             if (remarksList.size() != 0) {
-                for (CmClubRemarksVo remarks: remarksList) {
+                for (CmClubRemarksVo remarks : remarksList) {
                     String[] split = remarks.getRemarks().split(",");
                     String[] split = remarks.getRemarks().split(",");
                     for (String str : split) {
                     for (String str : split) {
                         if (!strRemark.contains(str)) {
                         if (!strRemark.contains(str)) {
@@ -2912,7 +2896,7 @@ public class ClubServiceImpl implements ClubService {
                     }
                     }
                 }
                 }
                 for (String str : strRemark) {
                 for (String str : strRemark) {
-                    for (int i = 0;i < remarkAll.size(); i++) {
+                    for (int i = 0; i < remarkAll.size(); i++) {
                         if (str.equals(remarkAll.get(i))) {
                         if (str.equals(remarkAll.get(i))) {
                             number++;
                             number++;
                         }
                         }
@@ -2931,14 +2915,14 @@ public class ClubServiceImpl implements ClubService {
                 String strTemp = "";
                 String strTemp = "";
                 for (int i = 0; i < integers.size() - 1; i++) {
                 for (int i = 0; i < integers.size() - 1; i++) {
                     for (int k = 0; k < integers.size() - 1 - i; k++) {
                     for (int k = 0; k < integers.size() - 1 - i; k++) {
-                        if (integers.get(k) > integers.get(k+1)) {
+                        if (integers.get(k) > integers.get(k + 1)) {
                             temp = integers.get(k);
                             temp = integers.get(k);
-                            integers.set(k,integers.get(k+1));
-                            integers.set(k+1,temp);
+                            integers.set(k, integers.get(k + 1));
+                            integers.set(k + 1, temp);
 
 
                             strTemp = strings.get(k);
                             strTemp = strings.get(k);
-                            strings.set(k,strings.get(k+1));
-                            strings.set(k+1,strTemp);
+                            strings.set(k, strings.get(k + 1));
+                            strings.set(k + 1, strTemp);
                         }
                         }
                     }
                     }
                 }
                 }
@@ -2963,7 +2947,7 @@ public class ClubServiceImpl implements ClubService {
             ArrayList<Integer> integers = new ArrayList<>();
             ArrayList<Integer> integers = new ArrayList<>();
             ArrayList<String> strings = new ArrayList<>();
             ArrayList<String> strings = new ArrayList<>();
             if (pageTypeList.size() != 0) {
             if (pageTypeList.size() != 0) {
-                for(BehaviorRecodeVo record : pageTypeList) {
+                for (BehaviorRecodeVo record : pageTypeList) {
                     integers.add(record.getNumbers());
                     integers.add(record.getNumbers());
                     strings.add(record.getPageLabel());
                     strings.add(record.getPageLabel());
                 }
                 }
@@ -2973,7 +2957,7 @@ public class ClubServiceImpl implements ClubService {
         }
         }
         if (!expty) {
         if (!expty) {
             cmPortrait.setStartTime(time1);
             cmPortrait.setStartTime(time1);
-            if ((0 ==  cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && ObjectUtils.isEmpty(cmPortrait.getStartTime())) {
+            if ((0 == cmPortrait.getDateType() || 1 == cmPortrait.getDateType()) && ObjectUtils.isEmpty(cmPortrait.getStartTime())) {
                 cmPortrait.setStartTime(time2);
                 cmPortrait.setStartTime(time2);
             }
             }
             cmPortrait.setEndTime(time2);
             cmPortrait.setEndTime(time2);
@@ -2995,54 +2979,55 @@ public class ClubServiceImpl implements ClubService {
             order.setStartTime(cmPortrait.getStartTime());
             order.setStartTime(cmPortrait.getStartTime());
             order.setEndTime(cmPortrait.getEndTime());
             order.setEndTime(cmPortrait.getEndTime());
             if (order.getOrderTotalNum() == 0) {
             if (order.getOrderTotalNum() == 0) {
-                map.put("order",null);
+                map.put("order", null);
             } else {
             } else {
-                map.put("order",order);
+                map.put("order", order);
             }
             }
             behavior.setName(cmPortrait.getBehaviorType());
             behavior.setName(cmPortrait.getBehaviorType());
             behavior.setValue(cmPortrait.getBehaviorValue());
             behavior.setValue(cmPortrait.getBehaviorValue());
             behavior.setStartTime(cmPortrait.getStartTime());
             behavior.setStartTime(cmPortrait.getStartTime());
             behavior.setEndTime(cmPortrait.getEndTime());
             behavior.setEndTime(cmPortrait.getEndTime());
             if (ObjectUtils.isEmpty(behavior.getValue())) {
             if (ObjectUtils.isEmpty(behavior.getValue())) {
-                map.put("behavior",null);
+                map.put("behavior", null);
             } else {
             } else {
-                map.put("behavior",behavior);
+                map.put("behavior", behavior);
             }
             }
             remarks.setName(cmPortrait.getRemarksType());
             remarks.setName(cmPortrait.getRemarksType());
             remarks.setValue(cmPortrait.getRemarksValue());
             remarks.setValue(cmPortrait.getRemarksValue());
             remarks.setStartTime(cmPortrait.getStartTime());
             remarks.setStartTime(cmPortrait.getStartTime());
             remarks.setEndTime(cmPortrait.getEndTime());
             remarks.setEndTime(cmPortrait.getEndTime());
             if (ObjectUtils.isEmpty(remarks.getValue())) {
             if (ObjectUtils.isEmpty(remarks.getValue())) {
-                map.put("remarks",null);
+                map.put("remarks", null);
             } else {
             } else {
-                map.put("remarks",remarks);
+                map.put("remarks", remarks);
             }
             }
             pageType.setName(cmPortrait.getPageType());
             pageType.setName(cmPortrait.getPageType());
             pageType.setValue(cmPortrait.getPageTypeValue());
             pageType.setValue(cmPortrait.getPageTypeValue());
             pageType.setStartTime(cmPortrait.getStartTime());
             pageType.setStartTime(cmPortrait.getStartTime());
             pageType.setEndTime(cmPortrait.getEndTime());
             pageType.setEndTime(cmPortrait.getEndTime());
             if (ObjectUtils.isEmpty(pageType.getValue())) {
             if (ObjectUtils.isEmpty(pageType.getValue())) {
-                map.put("pageType",null);
+                map.put("pageType", null);
             } else {
             } else {
-                map.put("pageType",pageType);
+                map.put("pageType", pageType);
             }
             }
-            map.put("portrait",cmPortrait);
-            map.put("code",0);
+            map.put("portrait", cmPortrait);
+            map.put("code", 0);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            map.put("code",-1);
+            map.put("code", -1);
         }
         }
         return ResponseJson.success(map);
         return ResponseJson.success(map);
     }
     }
 
 
     /**
     /**
      * 时间计算
      * 时间计算
+     *
      * @param recordTime
      * @param recordTime
      * @return
      * @return
      */
      */
-    public String calculationTime(String recordTime){
+    public String calculationTime(String recordTime) {
         double doc = Double.parseDouble(recordTime);
         double doc = Double.parseDouble(recordTime);
-        int num = (int)doc;
+        int num = (int) doc;
         //小时
         //小时
         int HH = 0;
         int HH = 0;
         // 分钟
         // 分钟
@@ -3050,17 +3035,17 @@ public class ClubServiceImpl implements ClubService {
         //秒
         //秒
         int ss = 0;
         int ss = 0;
         int item = num / 1000;
         int item = num / 1000;
-        if ((item / 60) >0) {
+        if ((item / 60) > 0) {
             mm = item / 60;
             mm = item / 60;
             ss = item % 60;
             ss = item % 60;
         } else {
         } else {
             ss = item;
             ss = item;
         }
         }
-        if ((mm / 60) >0) {
+        if ((mm / 60) > 0) {
             HH = mm / 60;
             HH = mm / 60;
             mm = mm % 60;
             mm = mm % 60;
         }
         }
-        String  str= HH+":"+mm+":"+ss;
+        String str = HH + ":" + mm + ":" + ss;
         SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
         SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
         Date parse = null;
         Date parse = null;
         try {
         try {

+ 3 - 3
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -126,7 +126,7 @@ public class LoginServiceImpl implements LoginService {
             if (md5Password.equals(dbPassword)) {
             if (md5Password.equals(dbPassword)) {
                 // 游客id与用户关联
                 // 游客id与用户关联
                 if (StringUtils.isNotBlank(loginPasswordDto.getTouristId()) && StringUtils.isNotEmpty(loginPasswordDto.getTouristId())) {
                 if (StringUtils.isNotBlank(loginPasswordDto.getTouristId()) && StringUtils.isNotEmpty(loginPasswordDto.getTouristId())) {
-                    loginMapper.updateTourist(baseUser.getUserId(), loginPasswordDto.getTouristId());
+                    asyncService.updateTourist(baseUser.getUserId(), loginPasswordDto.getTouristId());
                 }
                 }
                 if (baseUser.getUserIdentity() == 1) {
                 if (baseUser.getUserIdentity() == 1) {
                     // 协销登录
                     // 协销登录
@@ -296,7 +296,7 @@ public class LoginServiceImpl implements LoginService {
                     UserLoginVo baseUser = loginMapper.getLoginUserByMobileOrEmail(mobile);
                     UserLoginVo baseUser = loginMapper.getLoginUserByMobileOrEmail(mobile);
                     // 游客id与用户关联
                     // 游客id与用户关联
                     if (StringUtils.isNotBlank(loginCodeDto.getTouristId()) && StringUtils.isNotEmpty(loginCodeDto.getTouristId())) {
                     if (StringUtils.isNotBlank(loginCodeDto.getTouristId()) && StringUtils.isNotEmpty(loginCodeDto.getTouristId())) {
-                        loginMapper.updateTourist(baseUser.getUserId(), loginCodeDto.getTouristId());
+                        asyncService.updateTourist(baseUser.getUserId(), loginCodeDto.getTouristId());
                     }
                     }
                     // 如果前端传入unionId,则存入返回前端
                     // 如果前端传入unionId,则存入返回前端
                     baseUser.setUnionId(unionId);
                     baseUser.setUnionId(unionId);
@@ -929,7 +929,7 @@ public class LoginServiceImpl implements LoginService {
                 loginUser.setSpUserId(loginMapper.getClubSpUserId(loginUser.getClubId()));
                 loginUser.setSpUserId(loginMapper.getClubSpUserId(loginUser.getClubId()));
             }
             }
             Integer shopID = messageCenterMapper.shopID(loginUser.getUserId());
             Integer shopID = messageCenterMapper.shopID(loginUser.getUserId());
-            Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
+//            Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
             // 上架费次数
             // 上架费次数
             Integer listingFeeCount = messageCenterMapper.listingFee(shopID);
             Integer listingFeeCount = messageCenterMapper.listingFee(shopID);
             // 上架费有效期内个数
             // 上架费有效期内个数

+ 2 - 1
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -162,7 +162,6 @@ public class RegisterServiceImpl implements RegisterService {
         }
         }
         // 协销Id,默认采美官方
         // 协销Id,默认采美官方
         Integer spId = 1342;
         Integer spId = 1342;
-        int ss = null != clubRegisterDto.getInsideFLag() ? clubRegisterDto.getInsideFLag() : 0;
         // 外部协销
         // 外部协销
         if (null != clubRegisterDto.getInsideFLag() && 1 == clubRegisterDto.getInsideFLag()) {
         if (null != clubRegisterDto.getInsideFLag() && 1 == clubRegisterDto.getInsideFLag()) {
             spId = clubRegisterDto.getSpId();
             spId = clubRegisterDto.getSpId();
@@ -231,6 +230,8 @@ public class RegisterServiceImpl implements RegisterService {
         user.setServiceProviderStatus(90);
         user.setServiceProviderStatus(90);
         //采美豆
         //采美豆
         user.setUserBeans(1000);
         user.setUserBeans(1000);
+        // 友站Id
+        user.setPartnerId(clubRegisterDto.getPartnerId());
         /*
         /*
             保存数据库 user
             保存数据库 user
          */
          */

+ 11 - 28
src/main/java/com/caimei365/user/service/impl/RoosInformationServiceImpl.java

@@ -32,7 +32,8 @@ import java.util.List;
 @Service
 @Service
 public class RoosInformationServiceImpl implements RoosInformationService {
 public class RoosInformationServiceImpl implements RoosInformationService {
 
 
-    @Autowired private RoosInformationMapper roosInformationMapper;
+    @Autowired
+    private RoosInformationMapper roosInformationMapper;
 
 
     /**
     /**
      * 查看用户是否有过弹框,游客当天是否有过弹框
      * 查看用户是否有过弹框,游客当天是否有过弹框
@@ -45,37 +46,19 @@ public class RoosInformationServiceImpl implements RoosInformationService {
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         String format = simpleDateFormat.format(new Date());
         String format = simpleDateFormat.format(new Date());
         List<Integer> list = roosInformationMapper.selIsClick(IP, format, shopId, productId, infoId, keyword);
         List<Integer> list = roosInformationMapper.selIsClick(IP, format, shopId, productId, infoId, keyword);
-        log.info("list==="+list);
-        boolean isClick = false;
+        boolean isClick = true;
         // 判断是否点击过取消、或者填写过信息
         // 判断是否点击过取消、或者填写过信息
         if (null != list && list.size() > 0) {
         if (null != list && list.size() > 0) {
-            if (list.stream().allMatch(i -> i == 0)) {
-                isClick = true;
+            if (list.stream().allMatch(i -> i == 1)) {
+                isClick = false;
             }
             }
-        } else {
-            isClick = true;
         }
         }
-        log.info("shopId==="+shopId+"===productId==="+productId+"===infoId==="+infoId+"===keyword==="+keyword);
         // 供应商不存在或者处于不统计状态 不显示弹框
         // 供应商不存在或者处于不统计状态 不显示弹框
         Integer shopStatus = roosInformationMapper.getShopStatus(shopId, productId, infoId, keyword);
         Integer shopStatus = roosInformationMapper.getShopStatus(shopId, productId, infoId, keyword);
-        List<Integer> shopProductIds = roosInformationMapper.getShopProductIds(shopId);
-        log.info("shopStatus===="+shopStatus);
         // 网站底部的每个商品的弹窗,只在浏览了该商品相关的文章详情,商品详情和搜索列表后才显示,而不是该供应商的任意一个商品都显示
         // 网站底部的每个商品的弹窗,只在浏览了该商品相关的文章详情,商品详情和搜索列表后才显示,而不是该供应商的任意一个商品都显示
-        if (null != shopStatus && 0 != shopStatus) {
+        if (null == shopStatus || 0 != shopStatus) {
             isClick = false;
             isClick = false;
         }
         }
-        if (null == shopStatus) {
-            isClick = false;
-        }
-        // 若一个供应商只添加了一个商品,则游客在浏览该供应商主页时,就显示该商品的底部弹窗
-        if (null != shopId) {
-            if (null != list && list.size() > 0 && list.stream().allMatch(i -> i == 0)
-                    && null != shopStatus && 0 == shopStatus && null != shopProductIds && shopProductIds.size() == 1) {
-                isClick = true;
-            } else {
-                isClick = false;
-            }
-        }
         return isClick;
         return isClick;
     }
     }
 
 
@@ -90,7 +73,6 @@ public class RoosInformationServiceImpl implements RoosInformationService {
      */
      */
     @Override
     @Override
     public ResponseJson<CmShopPopUpVo> getPopUpInfo(Integer shopId, Integer productId, Integer infoId, String keyword) {
     public ResponseJson<CmShopPopUpVo> getPopUpInfo(Integer shopId, Integer productId, Integer infoId, String keyword) {
-        log.info("shopId==="+shopId+"===productId==="+productId+"===infoId==="+infoId+"===keyword==="+keyword);
         CmShopPopUpVo shopPop = new CmShopPopUpVo();
         CmShopPopUpVo shopPop = new CmShopPopUpVo();
         if (null != shopId) {
         if (null != shopId) {
             List<Integer> shopProductIds = roosInformationMapper.getShopProductIds(shopId);
             List<Integer> shopProductIds = roosInformationMapper.getShopProductIds(shopId);
@@ -103,7 +85,7 @@ public class RoosInformationServiceImpl implements RoosInformationService {
         if (null == shopPop) {
         if (null == shopPop) {
             return ResponseJson.error(-1, "信息异常", null);
             return ResponseJson.error(-1, "信息异常", null);
         }
         }
-        log.info("shopPop====="+shopPop);
+        log.info("shopPop=====" + shopPop);
         return ResponseJson.success(shopPop);
         return ResponseJson.success(shopPop);
     }
     }
 
 
@@ -130,7 +112,7 @@ public class RoosInformationServiceImpl implements RoosInformationService {
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public ResponseJson<List<cmShopAdvertisingImage>> selectVisitRoos(Integer userId , String IP) {
+    public ResponseJson<List<cmShopAdvertisingImage>> selectVisitRoos(Integer userId, String IP) {
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         String format = simpleDateFormat.format(new Date());
         String format = simpleDateFormat.format(new Date());
         // 供应商集合
         // 供应商集合
@@ -161,7 +143,7 @@ public class RoosInformationServiceImpl implements RoosInformationService {
             }
             }
             // 是否搜索过供应商相关搜索词
             // 是否搜索过供应商相关搜索词
             List<String> shopKeyword = roosInformationMapper.getShopKeyword(shopId);
             List<String> shopKeyword = roosInformationMapper.getShopKeyword(shopId);
-            for (String keyword: shopKeyword) {
+            for (String keyword : shopKeyword) {
                 behavior = roosInformationMapper.getBehavior(userId.toString(), IP, format, 8, keyword);
                 behavior = roosInformationMapper.getBehavior(userId.toString(), IP, format, 8, keyword);
                 if (behavior != null && behavior.size() > 0) {
                 if (behavior != null && behavior.size() > 0) {
                     if (!shopIds.contains(shopId)) {
                     if (!shopIds.contains(shopId)) {
@@ -182,6 +164,7 @@ public class RoosInformationServiceImpl implements RoosInformationService {
 
 
     /**
     /**
      * 获取用户访问IP
      * 获取用户访问IP
+     *
      * @return
      * @return
      */
      */
     @Override
     @Override
@@ -207,7 +190,7 @@ public class RoosInformationServiceImpl implements RoosInformationService {
         if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
         if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
             ip = request.getRemoteAddr();
             ip = request.getRemoteAddr();
         }
         }
-        log.info("获取访问人ip==========="+ip);
+        log.info("获取访问人ip===========" + ip);
         return ip;
         return ip;
     }
     }
 }
 }

+ 1 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -1131,7 +1131,7 @@
                (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
                (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
     </select>
     </select>
     <select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
     <select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
-        SELECT accessDate, COUNT(cbr.recordID) AS number, IP AS ip
+        SELECT accessDate, COUNT(cbr.recordID) AS number, IP AS ip,SUBSTRING(accessDate, 6, 5) as monthAndDay
         FROM cm_behavior_record cbr
         FROM cm_behavior_record cbr
                  LEFT JOIN club c ON cbr.userID = c.userID
                  LEFT JOIN club c ON cbr.userID = c.userID
         WHERE cbr.delFlag = 0
         WHERE cbr.delFlag = 0

+ 2 - 0
src/main/resources/mapper/LoginMapper.xml

@@ -36,6 +36,7 @@
                u.guideFlag          as guideFlag,
                u.guideFlag          as guideFlag,
                (select status from club where userId = u.userId limit 1)  as clubStatus,
                (select status from club where userId = u.userId limit 1)  as clubStatus,
                u.manufacturerStatus as shopStatus,
                u.manufacturerStatus as shopStatus,
+               u.partnerId          as partnerId,
                cu.id                as operationId,
                cu.id                as operationId,
                cu.status            as operationStatus,
                cu.status            as operationStatus,
                cu.mobile            as operationMobile
                cu.mobile            as operationMobile
@@ -59,6 +60,7 @@
                u.userIdentity       AS userIdentity,
                u.userIdentity       AS userIdentity,
                u.password           AS PASSWORD,
                u.password           AS PASSWORD,
                u.guideFlag          AS guideFlag,
                u.guideFlag          AS guideFlag,
+               u.partnerId          as partnerId,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
                (select status from club where userId = u.userId limit 1) AS clubStatus,
                u.manufacturerStatus AS shopStatus,
                u.manufacturerStatus AS shopStatus,
                cu.id                AS operationId,
                cu.id                AS operationId,

+ 229 - 193
src/main/resources/mapper/RegisterMapper.xml

@@ -1,257 +1,293 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.RegisterMapper">
 <mapper namespace="com.caimei365.user.mapper.RegisterMapper">
-    <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
-        insert into user(`userOrganizeID`,`registerTime`,`registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`,`guideFlag`, `password`, `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans)
-                  values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{guideFlag},#{password},#{agreeFlag},#{validFlag},#{serviceProviderId},#{serviceProviderStatus}, #{userBeans})
+    <insert id="insertClubUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId"
+            useGeneratedKeys="true">
+        insert into user(`userOrganizeID`, `registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`,
+                         `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `guideFlag`, `password`,
+                         `agreeFlag`, `validFlag`, `serviceProviderID`, `serviceProviderStatus`, userBeans, partnerId)
+        values (#{organizeId}, #{registerTime}, #{registerIp}, #{ipAddress}, #{source}, #{registerUserTypeId}, #{name},
+                #{userName}, #{bindMobile}, #{email}, #{userIdentity}, #{guideFlag}, #{password}, #{agreeFlag},
+                #{validFlag}, #{serviceProviderId}, #{serviceProviderStatus}, #{userBeans}, #{partnerId})
     </insert>
     </insert>
     <select id="selUser" resultType="com.caimei365.user.model.po.UserPo">
     <select id="selUser" resultType="com.caimei365.user.model.po.UserPo">
-        select * from user where registerTime = #{registerTime}
+        select *
+        from user
+        where registerTime = #{registerTime}
     </select>
     </select>
 
 
     <insert id="insertOrgan">
     <insert id="insertOrgan">
         insert into cm_organ_value_system
         insert into cm_organ_value_system
             (userID, customerValue, customerStatus, stage, addTime, delType)
             (userID, customerValue, customerStatus, stage, addTime, delType)
-            values(#{userID}, '低价值客户', 3, 0, date_format(now(), '%Y-%m-%d'), 1)
+        values (#{userID}, '低价值客户', 3, 0, date_format(now(), '%Y-%m-%d'), 1)
     </insert>
     </insert>
 
 
     <insert id="insertActiveOrgan">
     <insert id="insertActiveOrgan">
         insert into cm_organ_active_system
         insert into cm_organ_active_system
-        (userId, activeState, activeStatus, stage, addTime, delType)
-        values(#{userId}, '活跃用户', 0, 0, date_format(now(), '%Y-%m-%d'), 1)
+            (userId, activeState, activeStatus, stage, addTime, delType)
+        values (#{userId}, '活跃用户', 0, 0, date_format(now(), '%Y-%m-%d'), 1)
     </insert>
     </insert>
 
 
-    <insert id="insertClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
-        insert into club(`name`, `sname`, `contractMobile`, `linkMan`, `userID`, `addTime`, `status`, `spID`, `scanFlag`, provinceID, cityID, townID, address, headpic, businessLicenseImage, medicalPracticeLicenseImg, socialCreditCode,newDeal)
-                  values(#{name},#{shortName},#{contractMobile},#{linkMan},#{userId},#{addTime},#{status}, #{serviceProviderId}, #{scanFlag}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{shopPhoto}, #{businessLicense},#{medicalPracticeLicense}, #{socialCreditCode},1)
+    <insert id="insertClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId"
+            useGeneratedKeys="true">
+        insert into club(`name`, `sname`, `contractMobile`, `linkMan`, `userID`, `addTime`, `status`, `spID`,
+                         `scanFlag`, provinceID, cityID, townID, address, headpic, businessLicenseImage,
+                         medicalPracticeLicenseImg, socialCreditCode, newDeal)
+        values (#{name}, #{shortName}, #{contractMobile}, #{linkMan}, #{userId}, #{addTime}, #{status},
+                #{serviceProviderId}, #{scanFlag}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{shopPhoto},
+                #{businessLicense}, #{medicalPracticeLicense}, #{socialCreditCode}, 1)
     </insert>
     </insert>
-    <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId" useGeneratedKeys="true">
-        insert into club(`name`, `sname`,     `contractMobile`, `userID`, `addTime`, `status`, `spID`,              `scanFlag`,`contractEmail`,`linkMan`, `provinceID`, `cityID`,`townID`, `address`, `headpic`, `businessLicenseImage`,`socialCreditCode`,`firstClubType`,`secondClubType`,`department`,`medicalPracticeLicenseImg`,`mainpro`,newDeal)
-                  values(#{name},#{shortName},#{contractMobile},#{userId},#{addTime},#{status},#{serviceProviderId},#{scanFlag},#{contractEmail},#{linkMan},#{provinceId},#{cityId},#{townId},#{address},#{shopPhoto},#{businessLicense},#{socialCreditCode},#{firstClubType},#{secondClubType},#{department},#{medicalPracticeLicense},#{mainProduct},1)
+    <insert id="insertUpgradeClub" parameterType="com.caimei365.user.model.po.ClubPo" keyProperty="clubId"
+            useGeneratedKeys="true">
+        insert into club(`name`, `sname`, `contractMobile`, `userID`, `addTime`, `status`, `spID`, `scanFlag`,
+                         `contractEmail`, `linkMan`, `provinceID`, `cityID`, `townID`, `address`, `headpic`,
+                         `businessLicenseImage`, `socialCreditCode`, `firstClubType`, `secondClubType`, `department`,
+                         `medicalPracticeLicenseImg`, `mainpro`, newDeal)
+        values (#{name}, #{shortName}, #{contractMobile}, #{userId}, #{addTime}, #{status}, #{serviceProviderId},
+                #{scanFlag}, #{contractEmail}, #{linkMan}, #{provinceId}, #{cityId}, #{townId}, #{address},
+                #{shopPhoto}, #{businessLicense}, #{socialCreditCode}, #{firstClubType}, #{secondClubType},
+                #{department}, #{medicalPracticeLicense}, #{mainProduct}, 1)
     </insert>
     </insert>
-    <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id" useGeneratedKeys="true">
-        insert into cm_mall_operation_user(`userID`, `clubID`, `shopID`, `userOrganizeID`,`linkName`,`nickName`,`headimgurl`,`userType`,`mobile`,`status`, `unionId`, `openid`,`pcOpenid`, `addTime`, `updateTime`, `bindTime`, `delFlag`)
-                                    values(#{userId},#{clubId},#{shopId},#{organizeId},#{linkName},#{nickName},#{avatarUrl},#{userType},#{mobile} ,#{status},#{unionId},#{openId},#{pcOpenId},#{addTime},#{updateTime},#{bindTime},#{delFlag})
+    <insert id="insertOperation" parameterType="com.caimei365.user.model.po.OperationPo" keyProperty="id"
+            useGeneratedKeys="true">
+        insert into cm_mall_operation_user(`userID`, `clubID`, `shopID`, `userOrganizeID`, `linkName`, `nickName`,
+                                           `headimgurl`, `userType`, `mobile`, `status`, `unionId`, `openid`,
+                                           `pcOpenid`, `addTime`, `updateTime`, `bindTime`, `delFlag`)
+        values (#{userId}, #{clubId}, #{shopId}, #{organizeId}, #{linkName}, #{nickName}, #{avatarUrl}, #{userType},
+                #{mobile}, #{status}, #{unionId}, #{openId}, #{pcOpenId}, #{addTime}, #{updateTime}, #{bindTime},
+                #{delFlag})
     </insert>
     </insert>
-    <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId" useGeneratedKeys="true">
-        insert into user(`userOrganizeID`,`registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`, `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `manufacturerStatus` , `password`, `agreeFlag`, `validFlag`)
-        values(#{organizeId},#{registerTime},#{registerIp},#{ipAddress},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
+    <insert id="insertShopUser" parameterType="com.caimei365.user.model.po.UserPo" keyProperty="userId"
+            useGeneratedKeys="true">
+        insert into user(`userOrganizeID`, `registerTime`, `registerIP`, `ipAddress`, `source`, `registerUserTypeID`,
+                         `name`, `userName`, `bindMobile`, `email`, `userIdentity`, `manufacturerStatus`, `password`,
+                         `agreeFlag`, `validFlag`)
+        values (#{organizeId}, #{registerTime}, #{registerIp}, #{ipAddress}, #{source}, #{registerUserTypeId}, #{name},
+                #{userName}, #{bindMobile}, #{email}, #{userIdentity}, #{manufacturerStatus}, #{password}, #{agreeFlag},
+                #{validFlag})
     </insert>
     </insert>
-    <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
-        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
-        values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{mainProductDesc},#{shopDesc},#{website},#{wxOfficialAccount},#{wxApplets},#{addTime},#{validFlag},#{status},#{medicalPracticeLicenseImg1})
+    <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId"
+            useGeneratedKeys="true">
+        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail`, `provinceID`,
+                         `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`,
+                         `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`,
+                         `wxApplets`, `addTime`, `validFlag`, `status`, medicalPracticeLicenseImg1)
+        values (#{userId}, #{name}, #{shortName}, #{linkMan}, #{contractMobile}, #{contractEmail}, #{provinceId},
+                #{cityId}, #{townId}, #{address}, #{socialCreditCode}, #{businessLicense}, #{firstShopType},
+                #{secondShopType}, #{mainProduct}, #{mainProductDesc}, #{shopDesc}, #{website}, #{wxOfficialAccount},
+                #{wxApplets}, #{addTime}, #{validFlag}, #{status}, #{medicalPracticeLicenseImg1})
     </insert>
     </insert>
     <update id="updateUserClubId">
     <update id="updateUserClubId">
-        update user set clubID = #{clubId} where userID = #{userId}
+        update user
+        set clubID = #{clubId}
+        where userID = #{userId}
     </update>
     </update>
     <update id="updateUserShopId">
     <update id="updateUserShopId">
-        update user set shopID = #{shopId} where userID = #{userId}
+        update user
+        set shopID = #{shopId}
+        where userID = #{userId}
     </update>
     </update>
     <update id="updateClubUserByUpgrade">
     <update id="updateClubUserByUpgrade">
-        update user set registerIP = #{registerIp},
-                        email = #{email},
-                        name = #{name}
+        update user
+        set registerIP = #{registerIp},
+            email      = #{email},
+            name       = #{name}
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <update id="updateShopUserByApply">
     <update id="updateShopUserByApply">
         update user set userName = #{userName}, name = #{name}, manufacturerStatus = #{manufacturerStatus}
         update user set userName = #{userName}, name = #{name}, manufacturerStatus = #{manufacturerStatus}
-            <if test="email != null and email != ''">
-                , email = #{email}
-            </if>
+        <if test="email != null and email != ''">
+            , email = #{email}
+        </if>
         where userID = #{userId}
         where userID = #{userId}
     </update>
     </update>
     <update id="updateClubByUpgrade">
     <update id="updateClubByUpgrade">
         update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail = #{contractEmail},
         update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail = #{contractEmail},
-            <if test="contractPhone != null and contractPhone != ''">
-                contractPhone = #{contractPhone},
-            </if>
-            <if test="linkMan != null and linkMan != ''">
-                linkMan = #{linkMan},
-            </if>
-            <if test="linkManIdentity != null and linkManIdentity != ''">
-                linkManIdentity = #{linkManIdentity},
-            </if>
-            provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
-            <if test="shopPhoto != null  and shopPhoto != 'null'  and shopPhoto != ''">
-                headpic = #{shopPhoto},
-            </if>
-            businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
-            <if test="firstClubType == 1">
-                secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
-            </if>
-            <if test="mainProduct != null and mainProduct != ''">
-                mainpro = #{mainProduct},
-            </if>
-            <if test="fax != null and fax != ''">
-                fax = #{fax},
-            </if>
-            <if test="profile != null and profile != ''">
-                info = #{profile},
-            </if>
-            status = #{status}
+        <if test="contractPhone != null and contractPhone != ''">
+            contractPhone = #{contractPhone},
+        </if>
+        <if test="linkMan != null and linkMan != ''">
+            linkMan = #{linkMan},
+        </if>
+        <if test="linkManIdentity != null and linkManIdentity != ''">
+            linkManIdentity = #{linkManIdentity},
+        </if>
+        provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
+        <if test="shopPhoto != null  and shopPhoto != 'null'  and shopPhoto != ''">
+            headpic = #{shopPhoto},
+        </if>
+        businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType =
+        #{firstClubType},
+        <if test="firstClubType == 1">
+            secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg =
+            #{medicalPracticeLicense},
+        </if>
+        <if test="mainProduct != null and mainProduct != ''">
+            mainpro = #{mainProduct},
+        </if>
+        <if test="fax != null and fax != ''">
+            fax = #{fax},
+        </if>
+        <if test="profile != null and profile != ''">
+            info = #{profile},
+        </if>
+        status = #{status}
         where clubID = #{clubId}
         where clubID = #{clubId}
     </update>
     </update>
     <update id="updateShopInfoByApply">
     <update id="updateShopInfoByApply">
         update shop set userID = #{userId}, name = #{name},
         update shop set userID = #{userId}, name = #{name},
-            <if test="shortName != null and shortName != ''">
-                sname = #{shortName},
-            </if>
-            <if test="email != null and email != ''">
-                contractEmail = #{email},
-            </if>
-            <if test="linkMan != null and linkMan != ''">
-                linkMan = #{linkMan},
-            </if>
-            <if test="townId != null and townId != ''">
-                provinceID = #{provinceId},cityID = #{cityId},townID = #{townId},address = #{address},
-            </if>
-            <if test="socialCreditCode != null and socialCreditCode != ''">
-                socialCreditCode = #{socialCreditCode},
-            </if>
-            <if test="businessLicense != null and businessLicense != ''">
-                businessLicenseImage = #{businessLicense},
-            </if>
-            <if test="firstShopType != null and firstShopType != ''">
-                firstShopType = #{firstShopType},
-            </if>
-            <if test="secondShopType != null and secondShopType != ''">
-                secondShopType = #{secondShopType},
-            </if>
-            <if test="mainProduct != null and mainProduct != ''">
-                mainpro = #{mainProduct},
-            </if>
-            productDesc = #{mainProductDesc},
-            info = #{shopDesc},
-            website = #{website},
-            wxOfficialAccount = #{wxOfficialAccount},
-            wxApplets = #{wxApplets},
-            status = #{status}
+        <if test="shortName != null and shortName != ''">
+            sname = #{shortName},
+        </if>
+        <if test="email != null and email != ''">
+            contractEmail = #{email},
+        </if>
+        <if test="linkMan != null and linkMan != ''">
+            linkMan = #{linkMan},
+        </if>
+        <if test="townId != null and townId != ''">
+            provinceID = #{provinceId},cityID = #{cityId},townID = #{townId},address = #{address},
+        </if>
+        <if test="socialCreditCode != null and socialCreditCode != ''">
+            socialCreditCode = #{socialCreditCode},
+        </if>
+        <if test="businessLicense != null and businessLicense != ''">
+            businessLicenseImage = #{businessLicense},
+        </if>
+        <if test="firstShopType != null and firstShopType != ''">
+            firstShopType = #{firstShopType},
+        </if>
+        <if test="secondShopType != null and secondShopType != ''">
+            secondShopType = #{secondShopType},
+        </if>
+        <if test="mainProduct != null and mainProduct != ''">
+            mainpro = #{mainProduct},
+        </if>
+        productDesc = #{mainProductDesc},
+        info = #{shopDesc},
+        website = #{website},
+        wxOfficialAccount = #{wxOfficialAccount},
+        wxApplets = #{wxApplets},
+        status = #{status}
         where shopID = #{shopId}
         where shopID = #{shopId}
     </update>
     </update>
 
 
     <update id="updateGuideFlagByUserId">
     <update id="updateGuideFlagByUserId">
-        update user set guideFlag=1 where userID=#{userId}
+        update user
+        set guideFlag=1
+        where userID = #{userId}
     </update>
     </update>
 
 
-    <insert id="insertClubTemporary" useGeneratedKeys="true" keyProperty="userId" keyColumn="id" parameterType="com.caimei365.user.model.dto.ClubOnlineDto">
-        INSERT INTO `club_temporary` (
-          `userId`, `name`, `shortName`, `bindMobile`,
-          `contractEmail`, `linkMan`, `linkManIdentity`, `provinceId`,
-          `cityId`, `townId`, `address`, `shopPhoto`,
-          `businessLicense`, `socialCreditCode`,
-          `firstClubType`, `secondClubType`,
-          `department`, `medicalPracticeLicense`,
-          `mainProduct`, `isAgreed`,addTime
-        )
-        VALUES
-          (
-            #{userId}, #{name}, #{shortName}, #{bindMobile},
-            #{contractEmail}, #{linkMan}, #{linkManIdentity}, #{provinceId},
-            #{cityId}, #{townId}, #{address}, #{shopPhoto},
-            #{businessLicense}, #{socialCreditCode},
-            #{firstClubType}, #{secondClubType},
-            #{department}, #{medicalPracticeLicense},
-            #{mainProduct}, #{isAgreed},now()
-          )
+    <insert id="insertClubTemporary" useGeneratedKeys="true" keyProperty="userId" keyColumn="id"
+            parameterType="com.caimei365.user.model.dto.ClubOnlineDto">
+        INSERT INTO `club_temporary` (`userId`, `name`, `shortName`, `bindMobile`,
+                                      `contractEmail`, `linkMan`, `linkManIdentity`, `provinceId`,
+                                      `cityId`, `townId`, `address`, `shopPhoto`,
+                                      `businessLicense`, `socialCreditCode`,
+                                      `firstClubType`, `secondClubType`,
+                                      `department`, `medicalPracticeLicense`,
+                                      `mainProduct`, `isAgreed`, addTime)
+        VALUES (#{userId}, #{name}, #{shortName}, #{bindMobile},
+                #{contractEmail}, #{linkMan}, #{linkManIdentity}, #{provinceId},
+                #{cityId}, #{townId}, #{address}, #{shopPhoto},
+                #{businessLicense}, #{socialCreditCode},
+                #{firstClubType}, #{secondClubType},
+                #{department}, #{medicalPracticeLicense},
+                #{mainProduct}, #{isAgreed}, now())
     </insert>
     </insert>
 
 
     <select id="getTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
     <select id="getTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
-        SELECT
-          `userId`,
-          confirmUserId,
-          `name`,
-          `shortName`,
-          `bindMobile`,
-          `contractEmail`,
-          `linkMan`,
-          `provinceId`,
-          `cityId`,
-          `townId`,
-          `address`,
-          `shopPhoto`,
-          `businessLicense`,
-          `socialCreditCode`,
-          `firstClubType`,
-          `secondClubType`,
-          `department`,
-          `medicalPracticeLicense`,
-          `mainProduct`,
-          `isAgreed`
-        FROM
-          `club_temporary`
-        WHERE
-          id = #{id}
+        SELECT `userId`,
+               confirmUserId,
+               `name`,
+               `shortName`,
+               `bindMobile`,
+               `contractEmail`,
+               `linkMan`,
+               `provinceId`,
+               `cityId`,
+               `townId`,
+               `address`,
+               `shopPhoto`,
+               `businessLicense`,
+               `socialCreditCode`,
+               `firstClubType`,
+               `secondClubType`,
+               `department`,
+               `medicalPracticeLicense`,
+               `mainProduct`,
+               `isAgreed`
+        FROM `club_temporary`
+        WHERE id = #{id}
     </select>
     </select>
 
 
     <insert id="insertBeansHistory">
     <insert id="insertBeansHistory">
-        INSERT INTO `user_beans_history` (
-          `userId`, `type`, `beansType`, `orderId`, `archiveId`,
-          `num`, `pushStatus`, `addTime`, delFlag
-        )
-        VALUES
-          (
-            #{userId}, #{type}, #{beansType}, #{orderId}, #{archiveId},
-            #{num}, #{pushStatus}, #{addTime}, 0
-          )
+        INSERT INTO `user_beans_history` (`userId`, `type`, `beansType`, `orderId`, `archiveId`,
+                                          `num`, `pushStatus`, `addTime`, delFlag)
+        VALUES (#{userId}, #{type}, #{beansType}, #{orderId}, #{archiveId},
+                #{num}, #{pushStatus}, #{addTime}, 0)
     </insert>
     </insert>
 
 
     <update id="updateClubUser">
     <update id="updateClubUser">
         UPDATE
         UPDATE
-          user
-        SET
-          bindMobile = #{bindMobile},
-          userIdentity = #{userIdentity},
-          email = #{email},
-          userName = #{userName},
-          source = #{source},
-          password = #{password},
-          registerUserTypeID = #{registerUserTypeId},
-          name = #{name},
-          registerTime = #{registerTime},
-          registerIP = #{registerIp},
-          ipAddress = #{ipAddress},
-          clubStatus = #{clubStatus},
-          serviceProviderStatus = #{serviceProviderStatus},
-          serviceProviderID = #{serviceProviderId},
-          guideFlag = #{guideFlag}
-        WHERE
-          userID = #{userId}
+            user
+        SET bindMobile            = #{bindMobile},
+            userIdentity          = #{userIdentity},
+            email                 = #{email},
+            userName              = #{userName},
+            source                = #{source},
+            password              = #{password},
+            registerUserTypeID    = #{registerUserTypeId},
+            name                  = #{name},
+            registerTime          = #{registerTime},
+            registerIP            = #{registerIp},
+            ipAddress             = #{ipAddress},
+            clubStatus            = #{clubStatus},
+            serviceProviderStatus = #{serviceProviderStatus},
+            serviceProviderID     = #{serviceProviderId},
+            guideFlag             = #{guideFlag}
+        WHERE userID = #{userId}
     </update>
     </update>
 
 
     <update id="updateClub">
     <update id="updateClub">
         UPDATE
         UPDATE
-          club
-        SET
-          name = #{name},
-          sname = #{shortName},
-          provinceID = #{provinceId},
-          cityID = #{cityId},
-          townID = #{townId},
-          spID = #{serviceProviderId},
-          address = #{address},
-          linkMan = #{linkMan},
-          contractPhone = #{contractPhone},
-          contractMobile = #{contractMobile},
-          fax = #{fax},
-          contractEmail = #{contractEmail},
-          info = #{profile},
-          addTime = #{addTime},
-          status = #{status},
-          businessLicenseImage = #{businessLicense},
-          defaultServiceProviderID = #{serviceProviderId},
-          mainpro = #{mainProduct},
-          headpic = #{shopPhoto},
-          lastModify = NOW(),
-          socialCreditCode = #{socialCreditCode},
-          department = #{department},
-          medicalPracticeLicenseImg = #{medicalPracticeLicense}
-        WHERE
-          userID = #{userId}
+            club
+        SET name                      = #{name},
+            sname                     = #{shortName},
+            provinceID                = #{provinceId},
+            cityID                    = #{cityId},
+            townID                    = #{townId},
+            spID                      = #{serviceProviderId},
+            address                   = #{address},
+            linkMan                   = #{linkMan},
+            contractPhone             = #{contractPhone},
+            contractMobile            = #{contractMobile},
+            fax                       = #{fax},
+            contractEmail             = #{contractEmail},
+            info                      = #{profile},
+            addTime                   = #{addTime},
+            status                    = #{status},
+            businessLicenseImage      = #{businessLicense},
+            defaultServiceProviderID  = #{serviceProviderId},
+            mainpro                   = #{mainProduct},
+            headpic                   = #{shopPhoto},
+            lastModify                = NOW(),
+            socialCreditCode          = #{socialCreditCode},
+            department                = #{department},
+            medicalPracticeLicenseImg = #{medicalPracticeLicense}
+        WHERE userID = #{userId}
     </update>
     </update>
     <select id="selProvince" resultType="java.lang.Integer">
     <select id="selProvince" resultType="java.lang.Integer">
-        SELECT provinceID as provinceId FROM province WHERE NAME LIKE concat('%', #{regionPro} ,'%') limit 1
+        SELECT provinceID as provinceId
+        FROM province
+        WHERE NAME LIKE concat('%', #{regionPro}, '%')
+        limit 1
     </select>
     </select>
     <select id="selCity" resultType="java.lang.Integer">
     <select id="selCity" resultType="java.lang.Integer">
-        SELECT cityID as cityId FROM city WHERE NAME LIKE concat('%', #{regionCity} ,'%') AND validFlag = 1 limit 1
+        SELECT cityID as cityId
+        FROM city
+        WHERE NAME LIKE concat('%', #{regionCity}, '%')
+          AND validFlag = 1
+        limit 1
     </select>
     </select>
 </mapper>
 </mapper>

+ 70 - 65
src/main/resources/mapper/RoosInformationMapper.xml

@@ -3,8 +3,8 @@
 <mapper namespace="com.caimei365.user.mapper.RoosInformationMapper">
 <mapper namespace="com.caimei365.user.mapper.RoosInformationMapper">
     <select id="selIsClick" resultType="integer">
     <select id="selIsClick" resultType="integer">
         SELECT isClick FROM cm_roos_information cri
         SELECT isClick FROM cm_roos_information cri
-            left join cm_shop_product csp on csp.id = cri.shopProductId
-            left join cm_shop_statistics css on css.id = csp.statisticsId
+        left join cm_shop_product csp on csp.id = cri.shopProductId
+        left join cm_shop_statistics css on css.id = csp.statisticsId
         <if test="infoId != null">
         <if test="infoId != null">
             LEFT JOIN cm_shop_info csi ON csi.shopProductId = csp.id
             LEFT JOIN cm_shop_info csi ON csi.shopProductId = csp.id
         </if>
         </if>
@@ -26,7 +26,8 @@
                 and csi.infoId = #{infoId}
                 and csi.infoId = #{infoId}
             </if>
             </if>
             <if test="keyword != null and keyword != ''">
             <if test="keyword != null and keyword != ''">
-                and ((csk.status = 0 and cusf.keyword like concat('%',#{keyword},'%') ) or s.name like concat('%',#{keyword},'%'))
+                and ((csk.status = 0 and cusf.keyword like concat('%',#{keyword},'%') ) or s.name like
+                concat('%',#{keyword},'%'))
             </if>
             </if>
         </where>
         </where>
     </select>
     </select>
@@ -56,18 +57,19 @@
                 and csi.infoId = #{infoId}
                 and csi.infoId = #{infoId}
             </if>
             </if>
             <if test="keyword != null and keyword != ''">
             <if test="keyword != null and keyword != ''">
-                and (csk.status = 0 and cusf.keyword like concat('%',#{keyword},'%') ) or s.name like concat('%',#{keyword},'%')
+                and (csk.status = 0 and cusf.keyword like concat('%',#{keyword},'%') ) or s.name like
+                concat('%',#{keyword},'%')
             </if>
             </if>
         </where>
         </where>
         limit 1
         limit 1
     </select>
     </select>
 
 
     <select id="getShopProductIds" resultType="java.lang.Integer">
     <select id="getShopProductIds" resultType="java.lang.Integer">
-        SELECT
-            csp.id
+        SELECT csp.id
         FROM cm_shop_product csp
         FROM cm_shop_product csp
                  LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
                  LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
-        WHERE css.shopId = #{shopId} AND csp.delFlag = 0
+        WHERE css.shopId = #{shopId}
+          AND csp.delFlag = 0
     </select>
     </select>
 
 
     <select id="getShopAdvert" resultType="com.caimei365.user.model.vo.cmShopAdvertisingImage">
     <select id="getShopAdvert" resultType="com.caimei365.user.model.vo.cmShopAdvertisingImage">
@@ -77,7 +79,7 @@
         <if test="shopIds.size()>0">
         <if test="shopIds.size()>0">
             and csa.shopId in
             and csa.shopId in
             <foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
             <foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
-                  #{shopId}
+                #{shopId}
             </foreach>
             </foreach>
         </if>
         </if>
         order by csa.sort asc, csa.addTime desc
         order by csa.sort asc, csa.addTime desc
@@ -85,22 +87,23 @@
 
 
     <select id="getShopPop" resultType="com.caimei365.user.model.vo.CmShopPopUpVo">
     <select id="getShopPop" resultType="com.caimei365.user.model.vo.CmShopPopUpVo">
         SELECT
         SELECT
-          csp.id,
-          css.shopId,
-          cspd.id as shopProductId,
-          csp.image,
-          csp.guidingOne,
-          csp.guidingTwo,
-          csp.addTime
+        csp.id,
+        css.shopId,
+        cspd.id as shopProductId,
+        csp.image,
+        csp.guidingOne,
+        csp.guidingTwo,
+        csp.addTime
         FROM cm_shop_popUp csp
         FROM cm_shop_popUp csp
         left join cm_shop_product cspd on cspd.id = csp.shopProductId
         left join cm_shop_product cspd on cspd.id = csp.shopProductId
         left join cm_shop_statistics css on cspd.statisticsId = css.id
         left join cm_shop_statistics css on cspd.statisticsId = css.id
-         <if test="infoId != null">
+        <if test="infoId != null">
             LEFT JOIN cm_shop_info csi ON csi.shopProductId = cspd.id
             LEFT JOIN cm_shop_info csi ON csi.shopProductId = cspd.id
-         </if>
+        </if>
         <if test="keyword != null and keyword != ''">
         <if test="keyword != null and keyword != ''">
             LEFT JOIN cm_shop_keyword csk ON csk.shopProductId = cspd.id
             LEFT JOIN cm_shop_keyword csk ON csk.shopProductId = cspd.id
             left join cm_user_search_frequency cusf on cusf.id = csk.searchId
             left join cm_user_search_frequency cusf on cusf.id = csk.searchId
+            left join shop s on css.shopId = s.shopID
         </if>
         </if>
         <where>
         <where>
             css.status = 0 and cspd.status = 0 and cspd.delFlag = 0
             css.status = 0 and cspd.status = 0 and cspd.delFlag = 0
@@ -113,24 +116,23 @@
             </if>
             </if>
             <if test="keyword != null and keyword != ''">
             <if test="keyword != null and keyword != ''">
                 and csk.status = 0
                 and csk.status = 0
-                and cusf.keyword like concat('%',#{keyword},'%')
+                and cusf.keyword like concat('%',#{keyword},'%') or s.name like concat('%',#{keyword},'%')
             </if>
             </if>
         </where>
         </where>
         limit 1
         limit 1
     </select>
     </select>
 
 
     <select id="getProductPop" resultType="com.caimei365.user.model.vo.CmShopPopUpVo">
     <select id="getProductPop" resultType="com.caimei365.user.model.vo.CmShopPopUpVo">
-        SELECT
-            csp.id,
-            css.shopId,
-            cspd.id as shopProductId,
-            csp.image,
-            csp.guidingOne,
-            csp.guidingTwo,
-            csp.addTime
+        SELECT csp.id,
+               css.shopId,
+               cspd.id as shopProductId,
+               csp.image,
+               csp.guidingOne,
+               csp.guidingTwo,
+               csp.addTime
         FROM cm_shop_popUp csp
         FROM cm_shop_popUp csp
-        left join cm_shop_product cspd on cspd.id = csp.shopProductId
-        left join cm_shop_statistics css on css.id = cspd.statisticsId
+                 left join cm_shop_product cspd on cspd.id = csp.shopProductId
+                 left join cm_shop_statistics css on css.id = cspd.statisticsId
         where css.shopId = #{shopId}
         where css.shopId = #{shopId}
           AND cspd.delFlag = 0
           AND cspd.delFlag = 0
         limit 1
         limit 1
@@ -138,50 +140,50 @@
 
 
     <insert id="insRoosInformation">
     <insert id="insRoosInformation">
         INSERT INTO cm_roos_information
         INSERT INTO cm_roos_information
-            (
-             IP,
-             shopProductId,
-             <if test="consultName != null and consultName != ''">
-                 consultName,
-             </if>
-             <if test="consultMobile != null and consultMobile != ''">
-                consultMobile,
-             </if>
-             isClick,
-             createTime
-             )
-        VALUES(
-               #{ip},
-               #{shopProductId},
-               <if test="consultName != null and consultName != ''">
-                #{consultName},
-               </if>
-               <if test="consultMobile != null and consultMobile != ''">
-                #{consultMobile},
-               </if>
-               #{isClick},
-               #{createTime}
-               )
+        (IP,shopProductId,
+        <if test="consultName != null and consultName != ''">
+            consultName,
+        </if>
+        <if test="consultMobile != null and consultMobile != ''">
+            consultMobile,
+        </if>
+        isClick,createTime)
+        VALUES(#{ip}, #{shopProductId},
+        <if test="consultName != null and consultName != ''">
+            #{consultName},
+        </if>
+        <if test="consultMobile != null and consultMobile != ''">
+            #{consultMobile},
+        </if>
+        #{isClick},
+        #{createTime})
     </insert>
     </insert>
 
 
     <select id="getShopId" resultType="java.lang.Integer">
     <select id="getShopId" resultType="java.lang.Integer">
-        select shopId from cm_shop_statistics where status = 0 and delFlag = 0
+        select shopId
+        from cm_shop_statistics
+        where status = 0
+          and delFlag = 0
     </select>
     </select>
 
 
     <select id="getShopProductId" resultType="java.lang.Integer">
     <select id="getShopProductId" resultType="java.lang.Integer">
-        select productId from product where shopId = #{shopId}
+        select productId
+        from product
+        where shopId = #{shopId}
     </select>
     </select>
 
 
     <select id="getShopInfoId" resultType="java.lang.Integer">
     <select id="getShopInfoId" resultType="java.lang.Integer">
-        select
-            csi.infoId
+        select csi.infoId
         FROM cm_shop_info csi
         FROM cm_shop_info csi
-        LEFT JOIN cm_shop_product csp ON csp.id = csi.shopProductId
-            LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
+                 LEFT JOIN cm_shop_product csp ON csp.id = csi.shopProductId
+                 LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
         WHERE css.shopId = #{shopId}
         WHERE css.shopId = #{shopId}
-          AND csi.status = 0 AND csi.delFlag = 0
-          AND csp.status = 0 AND csp.delFlag = 0
-          AND css.status = 0 AND css.delFlag = 0
+          AND csi.status = 0
+          AND csi.delFlag = 0
+          AND csp.status = 0
+          AND csp.delFlag = 0
+          AND css.status = 0
+          AND css.delFlag = 0
     </select>
     </select>
 
 
     <select id="getShopKeyword" resultType="java.lang.String">
     <select id="getShopKeyword" resultType="java.lang.String">
@@ -191,9 +193,12 @@
                  LEFT JOIN cm_shop_product csp ON csp.id = csk.shopProductId
                  LEFT JOIN cm_shop_product csp ON csp.id = csk.shopProductId
                  LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
                  LEFT JOIN cm_shop_statistics css ON css.id = csp.statisticsId
         WHERE css.shopId = #{shopId}
         WHERE css.shopId = #{shopId}
-          AND csk.status = 0 AND csk.delFlag = 0
-          AND csp.status = 0 AND csp.delFlag = 0
-          AND css.status = 0 AND css.delFlag = 0
+          AND csk.status = 0
+          AND csk.delFlag = 0
+          AND csp.status = 0
+          AND csp.delFlag = 0
+          AND css.status = 0
+          AND css.delFlag = 0
     </select>
     </select>
 
 
     <select id="getBehavior" resultType="java.lang.Integer">
     <select id="getBehavior" resultType="java.lang.Integer">
@@ -210,7 +215,7 @@
                 </if>
                 </if>
             </if>
             </if>
             <if test="pageType == 8">
             <if test="pageType == 8">
-                and pageLabel  = #{pagePath}
+                and pageLabel = #{pagePath}
             </if>
             </if>
             <if test="userId != 0">
             <if test="userId != 0">
                 AND userID = #{userId}
                 AND userID = #{userId}