jiangping
2024-07-15 055b75bc30aaceb1c73bcb823e8c5ef682891fde
提交
已添加1个文件
已修改6个文件
205 ■■■■■ 文件已修改
server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerInfoRequest.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/web/response/ZSZXCatalogResponse.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CustomerUserServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CatalogApi.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java
@@ -3,6 +3,7 @@
import com.doumee.biz.zbom.model.zhongtai.*;
import com.doumee.biz.zbom.model.zhongtai.response.*;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.web.response.ZSZXCatalogResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -33,5 +34,5 @@
    List<ZTAreaInfoResponse> getAreaList(ZTAreaListRequest param);
    ZSZXCatalogResponse getZSZXCatalogs();
}
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
@@ -77,7 +77,7 @@
            entity.setSource(CRMConstants.CRM_SOURCE.SOURCE_MP02);
            entity.setChannel(CRMConstants.CRM_SOURCE.SOURCE_MP02+"00");
        }
        entity.setOpenId(customerLog.getOpenid());
        entity.setOpenid(customerLog.getOpenid());
        entity.setDate(DateUtil.dateToString(customerLog.getCreateDate(),"yyyy/MM/dd HH:mm"));
        CrmCustomerPostRequest obj = new CrmCustomerPostRequest();
        obj.setCusInfo(new ArrayList<>());
@@ -110,7 +110,10 @@
        int status ;
        String crmInfo;
        String param = JSONObject.toJSONString(entity);
        CRMBaseResponse<List<CRMDaogouBindListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.DAOGOU_BIND_LIST_URL,CRMConstants.IntegerName.DAOGOU_BIND_LIST_NAME,param);
        CRMBaseResponse<List<CRMDaogouBindListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.DAOGOU_BIND_LIST_URL,
                CRMConstants.IntegerName.DAOGOU_BIND_LIST_NAME,
                param,
                new TypeReference<CRMBaseResponse<List<CRMDaogouBindListResponse>>>(){});
        return result;// é»˜è®¤å¤±è´¥
    }
@@ -124,7 +127,10 @@
        int status ;
        String crmInfo;
        String param = JSONObject.toJSONString(entity);
        CRMBaseResponse<List<CRMCustomerListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.CUS_BEFORE_PAGE_LIST_URL,CRMConstants.IntegerName.CUS_BEFORE_PAGE_LIST_NAME,param);
        CRMBaseResponse<List<CRMCustomerListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.CUS_BEFORE_PAGE_LIST_URL
                ,CRMConstants.IntegerName.CUS_BEFORE_PAGE_LIST_NAME
                ,param
                ,new TypeReference<CRMBaseResponse<List<CRMCustomerListResponse>>>(){});
        return result;// é»˜è®¤å¤±è´¥
    }
@@ -158,7 +164,7 @@
        }
        return  null;
    }
    public   <T> CRMBaseResponse<T> sendHttpRequest(String interfaceUrl,  String name,  String param){
    public   <T> CRMBaseResponse<T> sendHttpRequest(String interfaceUrl,  String name,  String param,TypeReference<CRMBaseResponse<T>> typeReference){
        log.info("【"+name+"】================开始===="+ JSONObject.toJSONString(param));
        String appKey = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_KEY);
        String url = redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_URL) + interfaceUrl ;
@@ -170,8 +176,6 @@
                url += "?timestamp=" + _t + "&sign=" + DigestUtils.md5Hex( _t + appKey);
                Map<String,String> headers = new HashMap<>();
                res = HttpsUtil.postJson(url,param);
                TypeReference typeReference =
                        new TypeReference<CRMBaseResponse<T>>(){};
                CRMBaseResponse<T>  result = JSONObject.parseObject(res, typeReference.getType());
                logResult(result,name);
                if(StringUtils.equals(result.getCode(),CRMConstants.CODE_SUCCESS)){
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
@@ -16,6 +16,7 @@
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.model.CrmInterfaceLog;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.dao.web.response.ZSZXCatalogResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,11 +53,37 @@
               ZTConstants.IntegerName.USER_GET_TOKEN_NAME,
               param.getToken(),
               param.getUserType(),
               JSONObject.toJSONString(param ));
               JSONObject.toJSONString(param ),
               new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){});
       if(result!=null){
           return result.getData();
       }
       return null;
   }
    /**
     * èŽ·å–ç”¨æˆ·ç™»é™†token
     * @return
     */
   @Override
   public ZSZXCatalogResponse getZSZXCatalogs(){
       ZSZXCatalogResponse response = new ZSZXCatalogResponse();
       ZTCatalogListRequest param = new ZTCatalogListRequest();
       param.setCatalogCode(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU);
       List<ZTCatalogInfoResponse> cataList = getCatalogList(param);
        if(cataList!=null ){
            for(ZTCatalogInfoResponse data : cataList){
                if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.JIADE_ID)){
                    response.setJdId(data);
                }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.CHUFANGSHEJI)){
                    response.setCfsj(data);
                }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.QW_SHEJI)){
                    response.setQwsj(data);
                }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.SHOUNASHEJI)){
                    response.setSnsj(data);
                }
            }
        }
       return response;
   }
    /**
     * ç”¨æˆ·ä¿¡æ¯åŒæ­¥
@@ -70,7 +97,8 @@
                ZTConstants.IntegerName.USER_UPDATE_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -88,7 +116,8 @@
                ZTConstants.IntegerName.USER_LOGOUT_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -102,12 +131,14 @@
     */
    @Override
    public  List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param){
        ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest(
       ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest(
                ZTConstants.IntegerUrl.CATALOG_LIST_URL,
                ZTConstants.IntegerName.CATALOG_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
        new TypeReference<ZTBaseResponse<List<ZTCatalogInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -125,7 +156,8 @@
                ZTConstants.IntegerName.TAG_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<List<ZTTagInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -144,7 +176,8 @@
                ZTConstants.IntegerName.CONTENT_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -162,7 +195,8 @@
                ZTConstants.IntegerName.CONTENT_INFO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTContentInfoResponse>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -180,7 +214,8 @@
                ZTConstants.IntegerName.COLLECT_DO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -198,7 +233,8 @@
                ZTConstants.IntegerName.LIKE_DO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -216,7 +252,8 @@
                ZTConstants.IntegerName.SHARE_DO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -234,7 +271,8 @@
                ZTConstants.IntegerName.VIEW_DO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -252,7 +290,8 @@
                ZTConstants.IntegerName.COLLECT_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -271,7 +310,8 @@
                ZTConstants.IntegerName.LIKE_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -293,7 +333,8 @@
                ZTConstants.IntegerName.AREA_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<List<ZTAreaInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -301,7 +342,7 @@
    }
    public   <T> ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param){
    public   <T>   ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param,TypeReference<ZTBaseResponse<T>> typeReference){
        log.info("【"+name+"】================开始===="+ JSONObject.toJSONString(param));
        String res = null;
        int success = 0;
@@ -312,8 +353,6 @@
            headers.put(ZTConstants.HEADER_USERTYPE,userType);
            String index = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_ZHONGTAI_API_URL);
            res = HttpsUtil.postJsonWithHeaders(index+url,param,headers);
            TypeReference typeReference =
                    new TypeReference<ZTBaseResponse<T>>(){};
            ZTBaseResponse<T>  result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,name);
            if(Constants.equalsInteger(result.getCode(),ZTConstants.CODE_SUCCESS)){
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerInfoRequest.java
@@ -39,6 +39,4 @@
    private String openid;
    @ApiModelProperty(value = "终端信息")
    private String terminal;
    @ApiModelProperty(value = "小程序用户opneid)")
    private String openId;
}
server/service/src/main/java/com/doumee/dao/web/response/ZSZXCatalogResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.dao.web.response;
import com.doumee.biz.zbom.model.zhongtai.response.ZTCatalogInfoResponse;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Users;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2023/3/23 9:25
 */
@Data
@ApiModel("志说装修首页四个模块对象")
public class ZSZXCatalogResponse implements Serializable {
    @ApiModelProperty(value = "家的ID")
    private ZTCatalogInfoResponse jdId;
    @ApiModelProperty(value = "收纳设计")
    private ZTCatalogInfoResponse snsj;
    @ApiModelProperty(value = "厨房设计")
    private ZTCatalogInfoResponse cfsj;
    @ApiModelProperty(value = "全屋设计")
    private ZTCatalogInfoResponse qwsj;
}
server/service/src/main/java/com/doumee/service/business/impl/CustomerUserServiceImpl.java
@@ -208,6 +208,7 @@
    private void dealSyncDataBiz(Date date,List<CRMDaogouBindListResponse> list) {
        List<CustomerUser> addList = new ArrayList<>();
        List<String> phoneList = new ArrayList<>();
        for(CRMDaogouBindListResponse data : list){
            if(StringUtils.isBlank(data.getCustomerPhone())){
                continue;
@@ -222,15 +223,8 @@
            if(member == null){
                continue;
            }
            /**
             * åˆ é™¤è€å¾—数据
             */
            customerUserMapper.update(null,new UpdateWrapper<CustomerUser>().lambda()
                    .eq(CustomerUser::getPhone,data.getDgPhone() )
                    .eq(CustomerUser::getUsername,data.getUseName() )
                    .eq(CustomerUser::getIsdeleted,Constants.ZERO)
                    .set(CustomerUser::getIsdeleted,Constants.ONE)
            );
            phoneList.add(data.getCustomerPhone());
            CustomerUser model = new CustomerUser();
            model.setCreateDate(date);
            model.setIsdeleted(Constants.ZERO);
@@ -246,6 +240,16 @@
            model.setCreationDate(data.getCreationDate());
            addList.add(model);
        }
        if(phoneList.size()>0){
            /**
             * åˆ é™¤è€å¾—数据
             */
            customerUserMapper.update(null,new UpdateWrapper<CustomerUser>().lambda()
                    .in(CustomerUser::getPhone,phoneList)
                    .eq(CustomerUser::getIsdeleted,Constants.ZERO)
                    .set(CustomerUser::getIsdeleted,Constants.ONE)
            );
        }
        if(addList .size() >0){
            int temp = 0;
            while(temp < addList.size()){
server/web/src/main/java/com/doumee/api/web/CatalogApi.java
@@ -1,10 +1,12 @@
package com.doumee.api.web;
import com.doumee.biz.zbom.ZbomZhongTaiService;
import com.doumee.config.annotation.UserLoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.SmsEmail;
import com.doumee.dao.web.response.AccountResponse;
import com.doumee.dao.web.response.ZSZXCatalogResponse;
import com.doumee.service.business.SmsEmailService;
import com.doumee.service.business.UsersService;
import io.swagger.annotations.Api;
@@ -13,10 +15,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by IntelliJ IDEA.
@@ -32,55 +31,16 @@
public class CatalogApi extends ApiController{
    @Autowired
    public UsersService usersService;
    public ZbomZhongTaiService zbomZhongTaiService;
    @Autowired
    public SmsEmailService smsEmailService;
    @ApiOperation(value = "小程序登陆", notes = "员工端小程序")
    @GetMapping("/loginByWx")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true),
    })
    public ApiResponse<AccountResponse> loginByWx(@RequestParam String code) {
        return  ApiResponse.success(usersService.wxLogin(code));
    }
    @ApiOperation(value = "发送短信验证码", notes = "员工端小程序")
    @GetMapping("/sendSms")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "phone", value = "手机号", required = true),
    })
    public ApiResponse sendSms(@RequestParam String phone) {
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setPhone(phone);
        smsEmailService.sendSms(smsEmail);
        return  ApiResponse.success("发送成功");
    }
    @ApiOperation(value = "手机号验证码登陆", notes = "员工端小程序")
    @GetMapping("/loginByPhone")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "phone", value = "手机号", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "短信验证码", required = true),
    })
    public ApiResponse<AccountResponse> loginByPhone(@RequestParam String phone,@RequestParam String code) {
        return  ApiResponse.success(usersService.phoneLogin(phone,code));
    }
    @UserLoginRequired
    @ApiOperation(value = "绑定openid", notes = "员工端小程序")
    @GetMapping("/bindingOpenid")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true),
    })
    public ApiResponse bindingOpenid(@RequestParam String code) {
        usersService.bindingOpenid(code,getMemberId());
        return  ApiResponse.success("操作成功");
    @ApiOperation(value = "C端小程序-获取首页志说装修四个模块类目数据", notes = "获取首页志说装修四个模块类目数据")
    @PostMapping("/getZSZXCatalogs")
    public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() {
        return  ApiResponse.success(zbomZhongTaiService.getZSZXCatalogs());
    }
}