liukangdong
2024-07-16 20b11236b4364034f52df294b9240776f539ede1
Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
已添加26个文件
已删除10个文件
已修改44个文件
已重命名1个文件
3314 ■■■■ 文件已修改
admin/src/views/timer/components/OperaTimerWindow.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/timer/timer.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin/src/main/java/com/doumee/api/business/CustomerUserController.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin/src/main/java/com/doumee/api/timer/QuartzController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin/src/main/java/com/doumee/timer/CustomerUserUpdateBiz.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/ZbomSMSService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/ZbomZhongTaiService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java 258 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomSMSServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/CrmCustomerSubmmitModel.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMBaseRequst.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerInfoRequest.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerListRequest.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerPostRequest.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmDaogouBindListRequest.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMBaseResponse.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMCustomerListResponse.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMDaogouBindListResponse.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTBaseRequst.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTBindCusFavoriteDoRequest.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTCatalogListRequest.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTContentInfoRequest.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTContentListRequest.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTUserInfoUpdateRequest.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaInfoResponse.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBasePageResponse.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBaseResponse.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBehaviorInfoResponse.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCatalogInfoResponse.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCatalogTagTypeResponse.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCollectInfoResponse.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCollectResponse.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTContentInfoResponse.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTContentListResponse.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCusFavoritesInfoResponse.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagInfoResponse.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTUserGetTokenResponse.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/config/Jwt/JwtTokenUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/config/Jwt/WebMvcConfig.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/DateUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/GeneratePicUtil.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/HttpsUtil.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/tyyun/TyyZosUtil.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/CustomerUserMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/CustomerUser.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/Shop.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/Users.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/timer/scheduler/QuartzManage.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/web/reqeust/ShopQueryByLLDTO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/web/response/ZSZXCatalogResponse.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/CustomerUserService.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/GetZhongTaiDataService.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/InitService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/ShopService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/UsersService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CustomerUserServiceImpl.java 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/GetZhongTaiDataServiceImpl.java 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/ApiController.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CatalogApi.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CustomerApi.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/PersonnelApi.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/PublicController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroAuthFilter.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroCache.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroCacheManager.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroConfig.java 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroCredentialsMatcher.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroRealm.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroSessionDAO.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/config/shiro/ShiroTokenManager.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/timer/components/OperaTimerWindow.vue
@@ -8,16 +8,16 @@
  >
    <el-form :model="form" ref="form" :rules="rules" label-width="120px" label-suffix=":">
      <el-form-item label="Bean名称" prop="beanName">
        <el-input v-model="form.beanName" placeholder="请输入Bean名称" :maxlength="10" v-trim/>
        <el-input v-model="form.beanName" placeholder="请输入Bean名称"  v-trim/>
      </el-form-item>
      <el-form-item label="模块名称" prop="module">
        <el-input v-model="form.module" placeholder="请输入模块名称" :maxlength="10" v-trim/>
        <el-input v-model="form.module" placeholder="请输入模块名称"   v-trim/>
      </el-form-item>
      <el-form-item label="Cron表达式" prop="cronExpres">
        <el-input v-model="form.cronExpres" placeholder="请输入Cron表达式" :maxlength="10" v-trim/>
        <el-input v-model="form.cronExpres" placeholder="请输入Cron表达式"   v-trim/>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="form.remark" placeholder="请输入备注" :maxlength="10" v-trim/>
        <el-input v-model="form.remark" placeholder="请输入备注" v-trim/>
      </el-form-item>
      <el-form-item label="执行参数" prop="params">
        <el-input v-model="form.params" type="textarea" placeholder="请输入执行参数" v-trim/>
admin/src/views/timer/timer.vue
@@ -70,7 +70,7 @@
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaTimerWindow from '@/views/timer/components/OperaTimerWindow'
import {runOnceById} from "@/api/timer/timer";
import {pauseById, resumeById, runOnceById} from '@/api/timer/timer'
export default {
  name: 'Devices',
  extends: BaseTable,
@@ -109,7 +109,7 @@
      this.$dialog.actionConfirm('确认暂停该任务吗?')
          .then(() => {
            this.pausing = true
            this.api.paustById(row.id)
          this.api.pauseById(row.id)
                .then(() => {
                  this.$message.info('暂停成功')
                  this.search()
@@ -161,7 +161,7 @@
          })
          .catch(() => {})
    }
  },
  }
}
</script>
server/admin/src/main/java/com/doumee/api/business/CustomerUserController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
package com.doumee.api.business;
import com.doumee.api.BaseController;
import com.doumee.core.annotation.excel.ExcelExporter;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.dao.business.model.CustomerUser;
import com.doumee.service.business.CustomerUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/15 10:21
 */
@Api(tags = "客户导购关联表")
@RestController
@RequestMapping("/business/customerUser")
public class CustomerUserController extends BaseController {
    @Autowired
    private CustomerUserService customerUserService;
    @PreventRepeat
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:customeruser:create")
    public ApiResponse create(@RequestBody CustomerUser customerUser) {
        return ApiResponse.success(customerUserService.create(customerUser));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
    @RequiresPermissions("business:customeruser:delete")
    public ApiResponse deleteById(@PathVariable Long id) {
        customerUserService.deleteById(id);
        return ApiResponse.success(null);
    }
    @ApiOperation("批量删除")
    @GetMapping("/delete/batch")
    @RequiresPermissions("business:customeruser:delete")
    public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
        String [] idArray = ids.split(",");
        List<Long> idList = new ArrayList<>();
        for (String id : idArray) {
            idList.add(Long.valueOf(id));
        }
        customerUserService.deleteByIdInBatch(idList);
        return ApiResponse.success(null);
    }
    @ApiOperation("根据ID修改")
    @PostMapping("/updateById")
    @RequiresPermissions("business:customeruser:update")
    public ApiResponse updateById(@RequestBody CustomerUser customerUser) {
        customerUserService.updateById(customerUser);
        return ApiResponse.success(null);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:customeruser:query")
    public ApiResponse<PageData<CustomerUser>> findPage (@RequestBody PageWrap<CustomerUser> pageWrap) {
        return ApiResponse.success(customerUserService.findPage(pageWrap));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:customeruser:exportExcel")
    public void exportExcel (@RequestBody PageWrap<CustomerUser> pageWrap, HttpServletResponse response) {
        ExcelExporter.build(CustomerUser.class).export(customerUserService.findPage(pageWrap).getRecords(), "客户导购关联表", response);
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:customeruser:query")
    public ApiResponse findById(@PathVariable Long id) {
        return ApiResponse.success(customerUserService.findById(id));
    }
}
server/admin/src/main/java/com/doumee/api/timer/QuartzController.java
@@ -54,7 +54,7 @@
    }
    @ApiOperation( "执行一次")
    @GetMapping("RequiresPermissions")
    @GetMapping("/runOnce/{id}")
    @RequiresPermissions("business:quartz:update")
    public ApiResponse runOnce(@PathVariable("id") Integer id) {
        quartzJobService.runOnce(id) ; return ApiResponse.success(null);
server/admin/src/main/java/com/doumee/timer/CustomerUserUpdateBiz.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.doumee.timer;
import com.doumee.core.utils.DateUtil;
import com.doumee.service.business.CustomerUserService;
import com.doumee.service.business.InitService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
 * @author å®šæ—¶èŽ·å–å¿—é‚¦å®¢æˆ·ç»‘å®šå¯¼è´­é›†åˆæ•°æ®
 * @since 2023-07-26 11:44
 */
@Component("customerBindDaogou")
public class CustomerUserUpdateBiz implements JobService {
    private static final Logger log = LoggerFactory.getLogger(CustomerUserUpdateBiz.class);
    @Autowired
    CustomerUserService customerUserService;
    @Override
    public void run(String params,String module) {
        Method method = null;
        try {
            if(StringUtils.equals(module,"syncYesterday")){
                String date = DateUtil.getYesterday();
                customerUserService.syncYesterday(date);
            }else{
                log.info("\n ======== å®šæ—¶ä»»åŠ¡å·²æ‰§è¡Œï¼šzbomRedisResut.========"+module);
            }
        } catch (Exception e) {
           e.printStackTrace();
        }
    }
}
server/service/src/main/java/com/doumee/biz/zbom/ZbomCRMService.java
@@ -1,8 +1,12 @@
package com.doumee.biz.zbom;
import com.doumee.biz.zbom.model.CrmCustomerSubmmitModel;
import com.doumee.biz.zbom.model.IamUpateShopModel;
import com.doumee.biz.zbom.model.IamUpateUserModel;
import com.doumee.biz.zbom.model.crm.CRMConstants;
import com.doumee.biz.zbom.model.crm.CrmCustomerInfoRequest;
import com.doumee.biz.zbom.model.crm.CrmCustomerListRequest;
import com.doumee.biz.zbom.model.crm.CrmDaogouBindListRequest;
import com.doumee.biz.zbom.model.crm.response.CRMBaseResponse;
import com.doumee.biz.zbom.model.crm.response.CRMCustomerListResponse;
import com.doumee.biz.zbom.model.crm.response.CRMDaogouBindListResponse;
import com.doumee.dao.business.model.CustomerLog;
import org.springframework.stereotype.Service;
@@ -16,7 +20,10 @@
@Service
public interface ZbomCRMService {
    void dealCustomerLogData(CustomerLog customerLog);
    int dealCustomerLogData(CustomerLog customerLog);
    String zbomEncode(String str);
    String getCrmGoUrl(String userName);
    int postDataToCrm(CrmCustomerSubmmitModel entity );
    CRMBaseResponse<List<CRMCustomerListResponse>> getCustomerList(CrmCustomerListRequest entity );
    CRMBaseResponse<List<CRMDaogouBindListResponse>> getDaogouBindList(CrmDaogouBindListRequest entity );
}
server/service/src/main/java/com/doumee/biz/zbom/ZbomSMSService.java
@@ -1,6 +1,5 @@
package com.doumee.biz.zbom;
import com.doumee.biz.zbom.model.CrmCustomerSubmmitModel;
import org.springframework.stereotype.Service;
/**
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;
@@ -21,16 +22,18 @@
    ZTUserGetTokenResponse userUpdateInfo(ZTUserInfoUpdateRequest param);
    boolean userLogout(ZTBaseRequst param);
    List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param);
    List<ZTTagInfoResponse> getTagList(ZTCatalogListRequest param);
    ZTBasePageResponse<ZTContentListResponse> pageContentList(ZTContentListRequest param);
   ZTContentInfoResponse getContentInfo(ZTContentInfoRequest param);
   boolean collectDo(ZTActionDoRequest param);
   boolean likeDo(ZTActionBatchDoRequest param);
   boolean shareDo(ZTActionDoRequest param);
   boolean viewDo(ZTActionDoRequest param);
    ZTBasePageResponse<ZTContentListResponse> pageCollectList(ZTContentListRequest param);
    ZTBasePageResponse<ZTCollectInfoResponse> pageCollectList(ZTContentListRequest param);
    ZTBasePageResponse<ZTContentListResponse> pageLikeList(ZTContentListRequest param);
    ZTBasePageResponse<ZTBehaviorInfoResponse> pageBehavoirList(ZTContentListRequest param);
    List<ZTAreaInfoResponse> getAreaList(ZTAreaListRequest param);
    boolean bindCustomerFavorites(ZTBindCusFavoriteDoRequest param);
    ZSZXCatalogResponse getZSZXCatalogs();
    ZTBasePageResponse<ZTCusFavoritesInfoResponse> pageCusFavoriteList(ZTContentListRequest param);
}
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
@@ -1,10 +1,15 @@
package com.doumee.biz.zbom.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.zbom.ZbomCRMService;
import com.doumee.biz.zbom.model.CrmCustomerInfoModel;
import com.doumee.biz.zbom.model.CrmCustomerSubmmitModel;
import com.doumee.biz.zbom.model.crm.*;
import com.doumee.biz.zbom.model.crm.response.CRMBaseResponse;
import com.doumee.biz.zbom.model.crm.response.CRMCustomerListResponse;
import com.doumee.biz.zbom.model.crm.response.CRMDaogouBindListResponse;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.HttpsUtil;
@@ -12,6 +17,7 @@
import com.doumee.dao.business.CustomerLogMapper;
import com.doumee.dao.business.model.CrmInterfaceLog;
import com.doumee.dao.business.model.CustomerLog;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +25,7 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.*;
/**
@@ -27,6 +34,7 @@
 * @date 2023/11/30 15:33
 */
@Service
@Slf4j
public class ZbomCRMServiceImpl implements ZbomCRMService {
    @Autowired
@@ -38,93 +46,152 @@
    private RedisTemplate<String, Object> redisTemplate;
    @Override
    @Async
    public void dealCustomerLogData(CustomerLog customerLog){
        CrmCustomerSubmmitModel entity = new CrmCustomerSubmmitModel();
        List<CrmCustomerInfoModel> cusInfo = new ArrayList();
        CrmCustomerInfoModel crmCustomerInfoModel = new CrmCustomerInfoModel();
        crmCustomerInfoModel.setId(customerLog.getId());
        crmCustomerInfoModel.setName(customerLog.getName());
        crmCustomerInfoModel.setPhone(customerLog.getPhone());
        crmCustomerInfoModel.setAreaname(customerLog.getAreaName());
        crmCustomerInfoModel.setAreacode(customerLog.getAreaCode());
        crmCustomerInfoModel.setOpenid(customerLog.getOpenid());
        crmCustomerInfoModel.setSource(Constants.CrmSources.SOURCE_ZBJX);
        crmCustomerInfoModel.setChannel(crmCustomerInfoModel.getSource()+"00");
        crmCustomerInfoModel.setDate(DateUtil.dateToString(customerLog.getCreateDate(),"yyyy/MM/dd HH:mm"));
        cusInfo.add(crmCustomerInfoModel);
        entity.setCusInfo(cusInfo);
        this.postDataToCrm(entity);
    }
    /**
     * å¿—邦客户信息提交接口
     * @param entity
     * @param customerLog
     * @return
     */
    @Override
    public int postDataToCrm(CrmCustomerSubmmitModel entity )  {
        // TODO Auto-generated method stub
        int status = 2;
        if(entity==null || entity.getCusInfo()==null || entity.getCusInfo().size() ==0){
            return status;
    @Async
    public int dealCustomerLogData(CustomerLog customerLog){
        CrmCustomerInfoRequest entity = new CrmCustomerInfoRequest();
        entity.setId(customerLog.getId());
        entity.setName(customerLog.getName());
        entity.setPhone(zbomEncode(customerLog.getPhone()));
        entity.setAreaname(customerLog.getAreaName());
        entity.setAreacode(customerLog.getAreaCode());
        entity.setOpenid(customerLog.getOpenid());
//        æäº¤ç±»åž‹ 0-测试装修风格;1-0元定制;2装修计算器
        if(Constants.equalsInteger(customerLog.getType(),Constants.ONE)){
            entity.setSource(CRMConstants.CRM_SOURCE.SOURCE_MP01);
            entity.setChannel(CRMConstants.CRM_SOURCE.SOURCE_MP01+"00");
        }else{
            entity.setSource(CRMConstants.CRM_SOURCE.SOURCE_MP02);
            entity.setChannel(CRMConstants.CRM_SOURCE.SOURCE_MP02+"00");
        }
        String type = "postCusData";
        String appid = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_KEY);
        String urlStr =  (String)redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_URL) ;
        long _t = System.currentTimeMillis();
        String crmInfo="提交失败";
        if (StringUtils.isNotBlank(appid)||StringUtils.isNotBlank(urlStr)) {
            String param = JSONObject.toJSONString(entity);
            String result = null;
            int success =1;
            String url = urlStr;
            try {
                String token = DigestUtils.md5Hex(type + _t + appid);
                  url = urlStr + "?type=" + type + "&_t=" + _t + "&token=" + token;// æäº¤CRM地址
                  result = HttpsUtil.postJson(url,param);
                if (StringUtils.isNotBlank(result)) {
                    JSONObject r = JSONObject.parseObject(result.replace("(", "").replace(")", ""));
                    if (r != null && (StringUtils.equalsIgnoreCase(r.getString("code"), "1")
                            || StringUtils.equalsIgnoreCase(r.getString("code"), "2"))) {
        entity.setOpenid(customerLog.getOpenid());
        entity.setDate(DateUtil.dateToString(customerLog.getCreateDate(),"yyyy/MM/dd HH:mm"));
        CrmCustomerPostRequest obj = new CrmCustomerPostRequest();
        obj.setCusInfo(new ArrayList<>());
        obj.getCusInfo().add(entity);
        int status ;
        String crmInfo;
        String param = JSONObject.toJSONString(obj);
        CRMBaseResponse result = sendCusHttpRequest(CRMConstants.IntegerUrl.POST_CUS_DATA_URL,CRMConstants.IntegerName.POST_CUS_DATA_NAME,param);
        if (result != null && (StringUtils.equalsIgnoreCase(result.getCode(), CRMConstants.CODE_SUCCESS))) {
                          status = 1;
                          crmInfo="提交成功";
                        success =0;
                    }else{
                        status = 2;
                        crmInfo="提交失败["+ result+"]";
            crmInfo="提交失败["+ result!=null?result.getMsg():"接口请求失败!"+"]";
                    }
                }
            }catch (Exception e){
                e.printStackTrace();
                crmInfo+= e.getMessage();
            }finally {
                saveInterfaceLog(url,"志邦CRM客户留资信息提交",param,success,result);
            }
        }else{
            status = 2;
            crmInfo="提交失败crm配置有误,appid:["+ appid+"]"+"url:["+ urlStr+"]";
        }
        List<Long> idList = new ArrayList<>();
        for(CrmCustomerInfoModel info : entity.getCusInfo()){
            idList.add(info.getId());
        }
        // å¦‚果提交成功
        CustomerLog d = new CustomerLog();
        d.setId(entity.getCusInfo().get(0).getId());
        d.setCrmStatus(Constants.ONE);
        customerLogMapper.update(null,new UpdateWrapper<CustomerLog>().lambda()
                .in(CustomerLog::getId,idList)
                .eq(CustomerLog::getId,entity.getId())
                .set(CustomerLog::getCrmStatus,Constants.ONE )
                .set(CustomerLog::getCrmInfo,crmInfo )
                .set(CustomerLog::getCrmDate,new Date() ));// æ›´æ–°çŠ¶æ€
        return status;// é»˜è®¤å¤±è´¥
    }
    /**
     * èŽ·å–å¯¼è´­ç»‘å®šåˆ—è¡¨
     * @param entity
     * @return
     */
    @Override
    public  CRMBaseResponse<List<CRMDaogouBindListResponse>> getDaogouBindList(CrmDaogouBindListRequest entity ){
        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,
                new TypeReference<CRMBaseResponse<List<CRMDaogouBindListResponse>>>(){});
        return result;// é»˜è®¤å¤±è´¥
    }
    /**
     * èŽ·å–å®¢æˆ·åˆ—è¡¨
     * @param entity
     * @return
     */
    @Override
    public CRMBaseResponse<List<CRMCustomerListResponse>> getCustomerList(CrmCustomerListRequest entity ){
        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
                ,new TypeReference<CRMBaseResponse<List<CRMCustomerListResponse>>>(){});
        return result;// é»˜è®¤å¤±è´¥
    }
    public   <T> CRMBaseResponse<T> sendCusHttpRequest(String interfaceUrl,  String name,  String param){
        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 ;
        long _t = System.currentTimeMillis();
        if (StringUtils.isNotBlank(appKey)||StringUtils.isNotBlank(url)) {
            String res = null;
            int success = 0;
            try {
                url += "?type=postCusData&_t=" + _t + "&token=" + DigestUtils.md5Hex( "postCusData" + _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)){
                    return  result;
                }else{
                    success =1;
                }
            }catch (Exception e){
                success = 1;
                log.error("【"+name+"】================失败===="+ JSONObject.toJSONString(param));
            }finally {
                saveInterfaceLog(url,name,param,success,res);
            }
        }
        return  null;
    }
    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 ;
        long _t = System.currentTimeMillis();
        if (StringUtils.isNotBlank(appKey)||StringUtils.isNotBlank(url)) {
            String res = null;
            int success = 0;
            try {
                url += "?timestamp=" + _t + "&sign=" + DigestUtils.md5Hex( _t + appKey);
                Map<String,String> headers = new HashMap<>();
                res = HttpsUtil.postJson(url,param);
                CRMBaseResponse<T>  result = JSONObject.parseObject(res, typeReference.getType());
                logResult(result,name);
                if(StringUtils.equals(result.getCode(),CRMConstants.CODE_SUCCESS)){
                    return  result;
                }else{
                    success =1;
                }
            }catch (Exception e){
                success = 1;
                log.error("【"+name+"】================失败===="+ JSONObject.toJSONString(param));
            }finally {
                saveInterfaceLog(url,name,param,success,res);
            }
        }
        return  null;
    }
    private static void logResult(CRMBaseResponse res,String name) {
        if(StringUtils.equals(res.getCode(), CRMConstants.CODE_SUCCESS)){
            log.info("【CRM接口:"+name+"】================成功====\n"+res);
        }else{
            log.error("【CRM接口:"+name+"】================失败====:\n"+ res);
        }
    }
    public  void  saveInterfaceLog(String url,String name,String  param,Integer success,String respone){
            if(crmInterfaceLogMapper ==null){
                return;
@@ -142,4 +209,55 @@
            log.setRepose(respone);
            crmInterfaceLogMapper.insert(log);
    }
    /**
     * å¿—邦字符串加密
     * @param str
     * @return
     */
    @Override
    public   String zbomEncode(String str)  {
        StringBuffer sb = new StringBuffer();
        String result = null;
        try {
            // åˆ›å»ºStringBuffer对象用来操作字符串
            String  urlStr =  (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_ENCODE_URL);
            sb = new StringBuffer(
                    urlStr + "?code=" + URLEncoder.encode(str, "UTF-8") + "&type=0&numstr=wy?");
            result = HttpsUtil.sendGet(sb.toString());
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            saveInterfaceLog(sb.toString(),"志邦字符串加密接口",str, result==null?1:0,result );
        }
        return  result;
    }
    /**
     * è·³è½¬crm功能 èŽ·å–æŽˆæƒåœ°å€
     * http://localhost:8080/core/oauth/authorize/jump?timestamp=1719998741&sign=41fbeb13965c43916876db7b5799e8ac&agent_phone_number=199077&bindKey=mp
     * @param userName
     * @return
     */
    @Override
    public    String getCrmGoUrl(String userName){
        StringBuffer sb = new StringBuffer();
        String result = null;
        try {
            // åˆ›å»ºStringBuffer对象用来操作字符串
            int _t = (int)(System.currentTimeMillis());
            String  appkey =  (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_AUTH_API_KEY);
            String  url =  (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_URL)
                    +CRMConstants.IntegerUrl.GO_CRM_AUTH_URL
                    + "?timestamp="+_t
                    +"&agent_phone_number=" + URLEncoder.encode(userName, "UTF-8")
                    + "&bindKey=mp&sign="+ DigestUtils.md5Hex( _t + appkey);;
            return url;
        }catch (Exception e){
            e.printStackTrace();
        }
       throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"获取跳转地址失败哦!");
    }
}
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomSMSServiceImpl.java
@@ -1,17 +1,10 @@
package com.doumee.biz.zbom.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.zbom.ZbomCRMService;
import com.doumee.biz.zbom.ZbomSMSService;
import com.doumee.biz.zbom.model.CrmCustomerInfoModel;
import com.doumee.biz.zbom.model.CrmCustomerSubmmitModel;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.HttpsUtil;
import com.doumee.dao.business.CrmInterfaceLogMapper;
import com.doumee.dao.business.CustomerLogMapper;
import com.doumee.dao.business.model.CrmInterfaceLog;
import com.doumee.dao.business.model.CustomerLog;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,16 +16,14 @@
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * å¿—邦CRM客户信息提交接口
 * @author æ±Ÿè¹„蹄
 * @date 2023/11/30 15:33
 */
//@Service
@Service
public class ZbomSMSServiceImpl implements ZbomSMSService  {
    @Autowired
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,33 @@
     */
    @Override
    public  List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param){
        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();
        }
        return null;
    }
    /**
     * èŽ·å–åˆ†ç±»å’Œåˆ†ç±»ä¸‹çš„æ ‡ç­¾
     * @param param
     * @return
     */
    @Override
    public      List<ZTTagInfoResponse> getTagList(ZTCatalogListRequest param){
        ZTBaseResponse<List<ZTTagInfoResponse>> result = sendHttpRequest(
                ZTConstants.IntegerUrl.TAG_LIST_URL,
                ZTConstants.IntegerName.TAG_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<List<ZTTagInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -126,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();
        }
@@ -140,11 +191,12 @@
    @Override
    public ZTContentInfoResponse getContentInfo(ZTContentInfoRequest param){
        ZTBaseResponse<ZTContentInfoResponse> result = sendHttpRequest(
                ZTConstants.IntegerUrl.CONTENT_INFO_URL+ param.getArticleId(),
                ZTConstants.IntegerUrl.CONTENT_INFO_URL+ param.getId(),
                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();
        }
@@ -162,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;
        }
@@ -180,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;
        }
@@ -198,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;
        }
@@ -216,7 +271,27 @@
                ZTConstants.IntegerName.VIEW_DO_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
        return false;
    }
    /**
     * ç”¨æˆ·ç»‘定客户喜欢清单,可绑定多个内容
     * @param param
     * @return
     */
    @Override
    public boolean bindCustomerFavorites(ZTBindCusFavoriteDoRequest param){
        ZTBaseResponse result = sendHttpRequest(
                ZTConstants.IntegerUrl.BIND_CUSTOMER_FAVORITES_URL,
                ZTConstants.IntegerName.BIND_CUSTOMER_FAVORITES_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<Object>>(){});
        if(result!=null ){
            return true;
        }
@@ -228,13 +303,52 @@
     * @return
     */
    @Override
    public ZTBasePageResponse<ZTContentListResponse> pageCollectList(ZTContentListRequest param){
        ZTBaseResponse< ZTBasePageResponse<ZTContentListResponse>> result = sendHttpRequest(
    public ZTBasePageResponse<ZTCollectInfoResponse> pageCollectList(ZTContentListRequest param){
        ZTBaseResponse< ZTBasePageResponse<ZTCollectInfoResponse>> result = sendHttpRequest(
                ZTConstants.IntegerUrl.COLLECT_LIST_URL,
                ZTConstants.IntegerName.COLLECT_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ));
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTCollectInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
        return  null;
    }
    /**
     * èŽ·å–æˆ‘çš„æ”¶è—åˆ—è¡¨åˆ†é¡µ
     * @param param
     * @return
     */
    @Override
    public  ZTBasePageResponse<ZTBehaviorInfoResponse> pageBehavoirList(ZTContentListRequest param){
        ZTBaseResponse< ZTBasePageResponse<ZTBehaviorInfoResponse>> result = sendHttpRequest(
                ZTConstants.IntegerUrl.BEHAVIOR_LIST_URL,
                ZTConstants.IntegerName.BEHAVIOR_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTBehaviorInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
        return  null;
    }
    /**
     * èŽ·å–å®¢æˆ·å–œæ¬¢
     * @param param
     * @return
     */
    @Override
    public ZTBasePageResponse<ZTCusFavoritesInfoResponse> pageCusFavoriteList(ZTContentListRequest param){
        ZTBaseResponse< ZTBasePageResponse<ZTCusFavoritesInfoResponse>> result = sendHttpRequest(
                ZTConstants.IntegerUrl.CUSTOMER_FAVORITES_LIST_URL,
                ZTConstants.IntegerName.CUSTOMER_FAVORITES_LIST_NAME,
                param.getToken(),
                param.getUserType(),
                JSONObject.toJSONString(param ),
                new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTCusFavoritesInfoResponse>>>(){});
        if(result!=null){
            return result.getData();
        }
@@ -253,7 +367,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();
        }
@@ -275,7 +390,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();
        }
@@ -283,7 +399,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;
@@ -294,11 +410,9 @@
            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(StringUtils.equals(result.getCode(),ZTConstants.CODE_SUCCESS)){
            if(Constants.equalsInteger(result.getCode(),ZTConstants.CODE_SUCCESS)){
                return  result;
            }else{
                success =1;
@@ -329,7 +443,7 @@
        interfaceLogMapper.insert(log);
    }
    private static void logResult(ZTBaseResponse res,String name) {
        if(StringUtils.equals(res.getCode(), ZTConstants.CODE_SUCCESS)){
        if(Constants.equalsInteger(res.getCode(),ZTConstants.CODE_SUCCESS)){
            log.info("【中台接口:"+name+"】================成功====\n"+res);
        }else{
            log.error("【中台接口:"+name+"】================失败====:\n"+ res);
server/service/src/main/java/com/doumee/biz/zbom/model/CrmCustomerSubmmitModel.java
ÎļþÒÑɾ³ý
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMBaseRequst.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.doumee.biz.zbom.model.crm;
import lombok.Data;
/**
 *  crm请求公共参数
 */
@Data
public class CRMBaseRequst {
    /**
     * çˆ¶çº§ç¼–码
     */
    private Integer timestamp;
    private String sign;
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CRMConstants.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
package com.doumee.biz.zbom.model.crm;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
public class CRMConstants {
    public static final CharSequence CODE_SUCCESS = "1";
    public interface IntegerUrl{
        String POST_CUS_DATA_URL ="/api/public/zbom/postCusData";
        String CUS_BEFORE_PAGE_LIST_URL ="api/public/mini/program/cusOrBeforeList";
        String DAOGOU_BIND_LIST_URL ="api/public/mini/program/list";
        String GO_CRM_AUTH_URL ="oauth/authorize/jump";
    }
    public interface IntegerName{
        String POST_CUS_DATA_NAME ="留资数据提交";
        String CUS_BEFORE_PAGE_LIST_NAME  ="查询管理客户/潜客列表";
        String DAOGOU_BIND_LIST_NAME  ="查询客户导购";
    }
    public  interface CRM_SOURCE{
       String SOURCE_DKXD = "DKXD";// ä»£å®¢ä¸‹å•(DKXD)
       String SOURCE_LYSJ = "LYSJ";// é›¶å…ƒè®¾è®¡(LYSJ)
       String SOURCE_ZBSJSQ = "ZBSJSQ";// å¿—邦设计申请(ZBSJSQ)
       String SOURCE_ZBDXFX = "ZBDXFX";// å¿—邦短信分享(ZBDXFX)
       String SOURCE_ZBLLJL = "ZBLLJL";// å¿—邦浏览记录分享(ZBLLJL)
       String SOURCE_ZBWDSC = "ZBWDSC";// å¿—邦我的收藏分享(ZBWDSC)
       String SOURCE_ZBLYSJ = "ZBLYSJ";// å¿—邦零元设计(ZBLYSJ)
       String SOURCE_ZBLDX = "ZBLDX";// å¿—邦老带新(ZBLDX)
       String SOURCE_ZBFGCS = "ZBFGCS";// å¿—邦风格测试(ZBFGCS)
       String SOURCE_ZBJX = "DSLX22";// å¿—邦家选(ZBJX)
       String SOURCE_MP01 = "MP01";// é›¶å…ƒè®¾è®¡
       String SOURCE_MP02 = "MP02";//报价计算器
    }
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerInfoRequest.java
ÎļþÃû´Ó server/service/src/main/java/com/doumee/biz/zbom/model/CrmCustomerInfoModel.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.doumee.biz.zbom.model;
package com.doumee.biz.zbom.model.crm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -7,8 +7,8 @@
import java.io.Serializable;
@Data
@ApiModel("志邦CRM客户留资提交明细参数")
public class CrmCustomerInfoModel implements Serializable {
@ApiModel("志邦CRM客户留资提交参数")
public   class CrmCustomerInfoRequest extends CRMBaseRequst implements Serializable {
    @ApiModelProperty(value = "人员编码")
    private Long id;
    @ApiModelProperty(value = "姓名")
@@ -17,9 +17,9 @@
    private String phone;
    @ApiModelProperty(value = "设计师手机号")
    private String shopper;
    @ApiModelProperty(value = "来源")
    @ApiModelProperty(value = "来源 MP01【零元设计】、MP02【报价计算器】")
    private String source;
    @ApiModelProperty(value = "渠道")
    @ApiModelProperty(value = "渠道MP0100 ï¼ŒMP0200 ")
    private String channel;
    @ApiModelProperty(value = "日期 yyyy/MM/dd HH:mm")
    private String date;
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerListRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package com.doumee.biz.zbom.model.crm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("查询管理客户/潜客列表请求参数")
public   class CrmCustomerListRequest extends CRMBaseRequst implements Serializable {
    @ApiModelProperty(value = "用户名",required = true)
    private String userName;
    @ApiModelProperty(value = "类型 ç®¡ç†å®¢æˆ·:0 æ½œå®¢åˆ—表:1" ,required = true)
    private String flag;
    @ApiModelProperty(value = "分页大小 ï¼ˆé»˜è®¤ï¼š10) 10")
    private int pageSize;
    @ApiModelProperty(value = "分页页码  ï¼ˆé»˜è®¤ï¼š1)")
    private int page;
    @ApiModelProperty(value = "客户名称,客户手机号码 ,地址")
    private String keyWords;
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmCustomerPostRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package com.doumee.biz.zbom.model.crm;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel("志邦CRM客户留资提交外层参数")
public   class CrmCustomerPostRequest extends CRMBaseRequst implements Serializable {
    @JsonProperty("cus_info")
    @SerializedName("cus_info")
    private List< CrmCustomerInfoRequest > cusInfo;
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/CrmDaogouBindListRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.doumee.biz.zbom.model.crm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("查询管理客户/潜客列表请求参数")
public   class CrmDaogouBindListRequest extends CRMBaseRequst implements Serializable {
    @ApiModelProperty(value = "用户名",required = true)
    private String userName;
    @ApiModelProperty(value = "是否定时  1:是  0否(当为1时 ï¼ŒkeyWords éžå¿…填项目) " ,required = true)
    private String timing;
    @ApiModelProperty(value = "分页大小 ï¼ˆé»˜è®¤ï¼š10) 10")
    private int pageSize;
    @ApiModelProperty(value = "分页页码  ï¼ˆé»˜è®¤ï¼š1)")
    private int page;
    @ApiModelProperty(value = "客户名称,客户手机号码 ,地址",required = true)
    private String keyWords;
    @ApiModelProperty(value = "timing æ˜¯1时候必传 ï¼Œyyyy-MM-dd,当天创建的意向",required = true)
    private String creationDate;
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMBaseResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.doumee.biz.zbom.model.crm.response;
import lombok.Data;
import java.io.Serializable;
@Data
public class CRMBaseResponse<T> implements Serializable {
    /**
     * æ¶ˆæ¯ç ,200:成功;其他code:失败
     */
    private String code;
    /**
     * æç¤ºæ¶ˆæ¯
     */
    private String msg;
    private  int total;
    /**
     *  æ•°æ®
     */
    private T data;
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMCustomerListResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package com.doumee.biz.zbom.model.crm.response;
import lombok.Data;
import java.io.Serializable;
/**
 * æŸ¥è¯¢ç®¡ç†å®¢æˆ·/潜客列表返回
 */
@Data
public class CRMCustomerListResponse implements Serializable {
    private String  dgName    ;//导购名称
    private String   dgPhone    ;//导购手机号码
    private String  orgName    ;//组织名称
    private String  userName;//    ç”¨æˆ·ç™»å½•账号
    private String  userId    ;//用户id主键
    private String  productCodeName;//    äº§å“åç§°
    private String customerPhone;//    å®¢æˆ·å§“名
    private String customerName;//    å®¢æˆ·æ‰‹æœºå·
    private String  address    ;//地址详情
}
server/service/src/main/java/com/doumee/biz/zbom/model/crm/response/CRMDaogouBindListResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.doumee.biz.zbom.model.crm.response;
import lombok.Data;
import java.io.Serializable;
/**
 * æŸ¥å®¢æˆ·å¯¼è´­ è¿”回
 */
@Data
public class CRMDaogouBindListResponse implements Serializable {
    private String  dgName    ;//导购名称
    private String   dgPhone    ;//导购手机号码
    private String  orgName    ;//组织名称
    private String  userName;//    ç”¨æˆ·ç™»å½•账号
    private String  userId    ;//用户id主键
    private String  productCodeName;//    äº§å“åç§°
    private String customerPhone;//    å®¢æˆ·å§“名
    private String customerName;//    å®¢æˆ·æ‰‹æœºå·
    private String  address    ;//地址详情
    private String  creationDate    ;//时间 yyyy-MM-dd
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTBaseRequst.java
@@ -1,5 +1,6 @@
package com.doumee.biz.zbom.model.zhongtai;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -11,8 +12,13 @@
    /**
     * çˆ¶çº§ç¼–码
     */
    @ApiModelProperty(value = "C端传“CUSTOMER”, B端传'BUSINESS")
    private String userType;
    @ApiModelProperty(value = "token" , hidden = true)
    private String token;
    private String openid;
    private String openId;
    @ApiModelProperty(value = "用户主键" , hidden = true)
    private String userId;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTBindCusFavoriteDoRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.doumee.biz.zbom.model.zhongtai;
import lombok.Data;
import java.util.List;
/**
 * ç”¨æˆ·æ”¶è—ã€æµè§ˆã€ç‚¹èµžã€åˆ†äº«+1
 */
@Data
public class ZTBindCusFavoriteDoRequest extends  ZTBaseRequst {
    /**
     * å†…容ID列表
     */
    private List<String> articleIds;
    /**
     * ç”¨æˆ·ID
     */
//    private String userId;
    /**
     * OpenID
     */
    private String openId;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTCatalogListRequest.java
@@ -1,5 +1,6 @@
package com.doumee.biz.zbom.model.zhongtai;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -10,7 +11,9 @@
public class ZTCatalogListRequest  extends  ZTBaseRequst{
    /**
     * ç›®å½•唯一编码,编码为空,则返回全部一级目录
     *
     */
    @ApiModelProperty(value = "志说装修 zb_deco äº§å“ product_intro èµ„讯product_info å…¨å±‹æ¡ˆä¾‹ whole_case",notes = "http://api.dev.zbom.7zcloud.com/content/api/catalog")
    private String catalogCode;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTConstants.java
@@ -4,15 +4,32 @@
    public static  String PLATFORM_MP_WX = "mp-weixin";//小程序平台
    public static  String PLATFORM_WEBPAD = "web-pad";//PAD端
    public static  String CODE_SUCCESS = "200";//接口成功返回码
    public static  Integer CODE_SUCCESS = 200;//接口成功返回码
    public static  String HEADER_USERTYPE = "userType";//userType在HEADER中的名字
    public static  String HEADER_TOKEN = "token";//token
    public static  String DEFAULT_PID = "1";//默认省市区pid=1表示取全中国
    /**
     * åˆ†ç±»code
     * ä¸€ç´šcode(志说装修 zb_deco äº§å“ product_intro èµ„讯product_info å…¨å±‹æ¡ˆä¾‹ whole_case)
     * è€³æœºç´šcode(志说装修: å…¨å±‹è®¾è®¡ zb_deco_qwsj åŽ¨æˆ¿è®¾è®¡ zb_deco_cfsj æ”¶çº³è®¾è®¡ zb_deco_snsj å®¶çš„iD zb_deco_jdid)
     */
    public interface CatalogCode{
        String ZHISHUO_ZHUANGXIU ="zb_deco";
        String CHANPING ="product_intro";
        String ZIXUN ="product_info";
        String QW_CASE ="whole_case";
        String QW_SHEJI ="zb_deco_qwsj";
        String CHUFANGSHEJI ="zb_deco_cfsj";
        String SHOUNASHEJI ="zb_deco_snsj";
        String JIADE_ID ="zb_deco_jdid";
    }
    public interface IntegerUrl{
        String USER_UPDATE_URL ="customer/api/sync";
        String USER_GET_TOKEN_URL ="/customer/api/login";
        String USER_LOGOUT_URL ="/customer/api/disable";
        String CATALOG_LIST_URL ="/content/api/catalog";
        String TAG_LIST_URL ="/content/api/tag";
        String CONTENT_LIST_URL ="/content/api/page";
        String CONTENT_INFO_URL ="/content/api/detail/";
        String COLLECT_DO_URL ="/content/api/collect";
@@ -22,12 +39,16 @@
        String COLLECT_LIST_URL ="/behavior/getFavorite";
        String LIKE_LIST_URL ="/behavior/getLike";
        String AREA_LIST_URL ="/base/admin/bAreaRegion/getChildren";
        String BIND_CUSTOMER_FAVORITES_URL ="/behavior/api/bindCustomerFavorites";
        String CUSTOMER_FAVORITES_LIST_URL ="/behavior/api/customerFavorites";
        String BEHAVIOR_LIST_URL ="/behavior/api/customerBehaviors";
    }
    public interface IntegerName{
        String USER_UPDATE_NAME ="用户信息同步";
        String USER_GET_TOKEN_NAME  ="用户登陆";
        String USER_LOGOUT_NAME  ="注销用户";
        String CATALOG_LIST_NAME  ="获取分类和分类下的标签";
        String CATALOG_LIST_NAME  ="根据一级code获取下级分类信息";
        String TAG_LIST_NAME  ="根据分类code获取标签信息";
        String CONTENT_LIST_NAME  ="获取内容列表分页";
        String CONTENT_INFO_NAME  ="获取内容详情";
        String COLLECT_DO_NAME  ="内容收藏";
@@ -37,5 +58,8 @@
        String COLLECT_LIST_NAME  ="获取我的收藏列表分页";
        String LIKE_LIST_NAME  ="获取我的喜欢列表分页";
        String AREA_LIST_NAME  ="获取省市区集合";
        String BIND_CUSTOMER_FAVORITES_NAME  ="绑定客户喜欢";
        String CUSTOMER_FAVORITES_LIST_NAME  ="获取客户喜欢";
        String BEHAVIOR_LIST_NAME  ="获取行为轨迹";
    }
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTContentInfoRequest.java
@@ -9,8 +9,8 @@
@Data
public class ZTContentInfoRequest  extends  ZTBaseRequst{
    /**
     * ä¸´æ—¶ç¥¨æ®
     * å†…容主键
     */
    private String articleId;
    private String id;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTContentListRequest.java
@@ -1,44 +1,38 @@
package com.doumee.biz.zbom.model.zhongtai;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTContentListRequest extends ZTBaseRequst {
    /**
     * ç›®å½•唯一编码,目录唯一编码
     */
    @ApiModelProperty(value = "分类编码")
    private String catalogCode;
    /**
     * æ˜¯å¦ç½®é¡¶ï¼Œé»˜è®¤false
     */
    @ApiModelProperty(value = " æ˜¯å¦ç½®é¡¶ï¼Œé»˜è®¤false" , hidden = true)
    private Boolean isTop;
    /**
     * å½“前页
     */
    @ApiModelProperty(value = "当前页")
    private String pageNum;
    /**
     * æ¯é¡µæ¡æ•°
     */
    @ApiModelProperty(value = "每页条数")
    private String pageSize;
    /**
     * æœç´¢å…³é”®å­—,根据标题搜索关键字
     */
    @ApiModelProperty(value = "搜索关键字")
    private String search;
    /**
     * æŽ’序方式,NORMAL - é»˜è®¤
     * HOT - æœ€çƒ­
     * LATEST - æœ€æ–°
     */
    @ApiModelProperty(value = "内容查询条件")
    private String query;
    @ApiModelProperty(value = "标签")
    private String tagCodes;
    @ApiModelProperty(value = "排序方式 NORMAL - é»˜è®¤ï¼›HOT - æœ€çƒ­ï¼›LATEST - æœ€æ–°ï¼›")
    private String sortType;
    /**
     * å¤šä¸ªæ ‡ç­¾å”¯ä¸€ç¼–码的列表,多个标签唯一编码的列表
     */
    @ApiModelProperty(value = "多个标签唯一编码的列表,多个标签唯一编码的列表",hidden = true)
    private List<String> tagCode;
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/ZTUserInfoUpdateRequest.java
@@ -7,6 +7,7 @@
 */
@Data
public class ZTUserInfoUpdateRequest  extends  ZTBaseRequst{
    /**
     * åœ°å€ï¼Œçœå¸‚区的完整字符串,比如"广东省广州市白云区"
     */
@@ -20,7 +21,7 @@
     */
    private String appCode;
    /**
     * åº”用ID,小程序的AppID å¿…需
     * åº”用ID,小程序的AppID
     */
    private String appId;
    /**
@@ -77,7 +78,11 @@
     */
    private String name;
    /**
     * OpenID,微信用户的OpenID å¿…需
     * æ˜µç§°
     */
    private String nickname;
    /**
     * OpenID,微信用户的OpenID
     */
    private String openId;
    /**
@@ -85,7 +90,7 @@
     */
    private String phone;
    /**
     * å¹³å°ç±»åž‹ï¼Œå°ç¨‹åºä¼ mp-weixin,pad端传web-pad  å¿…需
     * å¹³å°ç±»åž‹ï¼Œå°ç¨‹åºä¼ mp-weixin,pad端传web-pad
     */
    private String platform;
    /**
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTAreaInfoResponse.java
@@ -2,6 +2,7 @@
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
@@ -9,7 +10,7 @@
 * çœå¸‚区详情返回
 */
@Data
public class ZTAreaInfoResponse {
public class ZTAreaInfoResponse implements Serializable {
    /**
     * id":“11000000000日"
     * pid":"1"
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBasePageResponse.java
@@ -1,25 +1,31 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ZTBasePageResponse<T> {
    /**
     *  å½“前页
     */
    private double current;
public class ZTBasePageResponse<T> implements Serializable {
    /**
     * è®°å½•列表
     */
    @JsonAlias(value = {"data","records","userFavoriteList","userBehaviorList","customerFavoritesList"})
    private List<T> records;
    /**
     * æ¯é¡µæ˜¾ç¤ºæ¡æ•°
     * å½“前页
     */
    private double size;
    @JsonAlias(value = {"pageCount","pageNum"})
    private String pageNum;
    /**
     * æ€»è®°å½•æ•°
     * æ¯é¡µæ¡æ•°
     */
    private double total;
    @JsonAlias(value = {"pageSize",})
    private String pageSize;
    /**
     * æ€»æ•°
     */
    @JsonAlias(value = {"totalCount","total"})
    private String total;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBaseResponse.java
@@ -2,8 +2,10 @@
import lombok.Data;
import java.io.Serializable;
@Data
public class ZTBaseResponse<T> {
public class ZTBaseResponse<T> implements Serializable {
    /**
     *是否成功,true:成功;false:失败
     */
@@ -11,7 +13,7 @@
    /**
     * æ¶ˆæ¯ç ,200:成功;其他code:失败
     */
    private String code;
    private Integer code;
    /**
     * æç¤ºæ¶ˆæ¯
     */
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTBehaviorInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import lombok.Data;
import java.io.Serializable;
/**
 * å†…容分页列表返回内容
 */
@Data
public class ZTBehaviorInfoResponse implements Serializable {
    /**
     * è¡Œä¸ºç±»åž‹ï¼Œpraise-点赞,
     * praise_cancel-点赞取消,
     * collect-收藏,
     * collect_cancel-收藏取消,
     * view-查看,
     * share-分享,
     * download-下载,
     * like-喜欢,
     * like_cancel-取消喜欢
     */
    private String actionType;
    /**
     * å†…容ID
     */
    private String contentId;
    /**
     * å‘生时间,yyyy-MM-dd HH:mm:ss
     */
    private String createTime;
    /**
     * æ ‡é¢˜
     */
    private String title;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCatalogInfoResponse.java
@@ -2,6 +2,7 @@
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@@ -9,7 +10,7 @@
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTCatalogInfoResponse {
public class ZTCatalogInfoResponse implements Serializable {
    /**
     * ç›®å½•唯一编码
     */
@@ -41,11 +42,11 @@
    /**
     * ç›®å½•排序
     */
    private String sort;
    private Integer sort;
    /**
     * å­ç›®å½•
     */
    private List<ZTCatalogInfoResponse> childCatalog;
    private List<ZTTagInfoResponse> childTagList;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCatalogTagTypeResponse.java
@@ -2,6 +2,7 @@
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@@ -9,7 +10,7 @@
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTCatalogTagTypeResponse {
public class ZTCatalogTagTypeResponse implements Serializable {
    /**
     * å­ç›®å½•
     */
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCollectInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,55 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * å†…容分页列表返回内容
 */
@Data
public class ZTCollectInfoResponse implements Serializable {
    /**
     * æ”¶è—æ•°
     */
    private String collectCount;
    /**
     * å†…容ID
     */
    private String contentId;
    /**
     * å†…容标题
     */
    private String contentTitle;
    /**
     * å†…容封面
     */
    private String coverImage;
    /**
     * æ”¶è—åˆ›å»ºæ—¶é—´
     */
    private String createTime;
    /**
     * ä¸‹è½½æ•°
     */
    private String downloadCount;
    /**
     * å†…容跳转URL,无跳转则为空字符串
     */
    private String jumpUrl;
    /**
     * ç‚¹èµžæ•°
     */
    private String praiseCount;
    /**
     * åˆ†äº«æ•°
     */
    private String shareCount;
    /**
     * æŸ¥çœ‹æ•°
     */
    private String viewCount;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCollectResponse.java
@@ -2,12 +2,14 @@
import lombok.Data;
import java.io.Serializable;
/**
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTCollectResponse {
public class ZTCollectResponse implements Serializable {
    /**
     * æ”¶è—ç±»åž‹ï¼Œäº§å“ï¼Œæ¡ˆä¾‹ï¼Œå®žæ™¯ å¿…需
     */
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTContentInfoResponse.java
@@ -2,6 +2,7 @@
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
@@ -9,7 +10,7 @@
 * å†…容详情返回
 */
@Data
public class ZTContentInfoResponse {
public class ZTContentInfoResponse  implements Serializable {
    /**
     * ä½œè€…
     */
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTContentListResponse.java
@@ -1,72 +1,90 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * å†…容分页列表返回内容
 */
@Data
public class ZTContentListResponse {
public class ZTContentListResponse implements Serializable {
    /**
     * ä½œè€…
     */
    @ApiModelProperty(value = "作者")
    private String author;
    /**
     * å°é¢å›¾
     */
    @ApiModelProperty(value = "封面图")
    private String coverImage;
    /**
     * æ”¶è—é‡
     */
    @ApiModelProperty(value = "收藏量")
    private double favoriteCount;
    /**
     * æ–‡ç« ID
     */
    @ApiModelProperty(value = "文章ID")
    private String id;
    /**
     * æ˜¯å¦ç½®é¡¶
     */
    @ApiModelProperty(value = "是否置顶")
    private String isTop;
    /**
     * è¯­è¨€ç¼–码
     */
    @ApiModelProperty(value = "语言编码")
    private String langCode;
    /**
     * ç‚¹èµžé‡
     */
    @ApiModelProperty(value = "点赞量")
    private double likeCount;
    /**
     * å‘布日期
     */
    @ApiModelProperty(value = "发布日期")
    private String publishDate;
    /**
     * å‘布组织
     */
    @ApiModelProperty(value = "发布组织")
    private String publishDepartment;
    /**
     * é˜…读量
     */
    @ApiModelProperty(value = "阅读量")
    private double readCount;
    /**
     * æŽ’序
     */
    @ApiModelProperty(value = "排序")
    private String sort;
    /**
     * å­æ ‡é¢˜
     */
    @ApiModelProperty(value = "子标题")
    private String subtitle;
    /**
     * æ ‡é¢˜
     */
    @ApiModelProperty(value = "标题")
    private String title;
    /**
     * æ–‡ç« ç±»åž‹
     */
    @ApiModelProperty(value = "文章类型")
    private String type;
    /**
     * æ–‡ç« å¤–链URL,视频和其他跳转链接类型
     */
    @ApiModelProperty(value = "文章外链URL,视频和其他跳转链接类型")
    private String url;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTCusFavoritesInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTCusFavoritesInfoResponse implements Serializable {
    /**
     * å†…容ID
     */
    private String contentId;
    /**
     * å°é¢URL
     */
    private String cover;
    /**
     * å–œæ¬¢æ—¶é—´ï¼Œyyyy-MM-dd HH:mm:ss
     */
    private String favoriteTime;
    /**
     * æ ‡é¢˜
     */
    private String title;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagChildInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 *
 */
@Data
public class ZTTagChildInfoResponse implements Serializable {
    /**
     * æ ‡ç­¾å€¼CODE
     */
    private String labelValueCode;
    /**
     * æ ‡ç­¾å€¼ID
     */
    private String labelValueId;
    /**
     * æ ‡ç­¾å€¼NAME
     */
    private String labelValueName;
    /**
     * æ ‡ç­¾å€¼æŽ’序
     */
    private String labelValueSort;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTTagInfoResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.doumee.biz.zbom.model.zhongtai.response;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 * ç”¨æˆ·é€€å‡º
 */
@Data
public class ZTTagInfoResponse implements Serializable {
    /**
     * æ ‡ç­¾CODE
     */
    private String labelCode;
    /**
     * æ ‡ç­¾ID
     */
    private String labelId;
    /**
     * æ ‡ç­¾NAME
     */
    private String labelName;
    /**
     * æ ‡ç­¾æŽ’序
     */
    private String labelSort;
    /**
     * å­ç›®å½•
     */
    private List<ZTTagChildInfoResponse> valueVos;
}
server/service/src/main/java/com/doumee/biz/zbom/model/zhongtai/response/ZTUserGetTokenResponse.java
@@ -2,8 +2,10 @@
import lombok.Data;
import java.io.Serializable;
@Data
public class ZTUserGetTokenResponse {
public class ZTUserGetTokenResponse implements Serializable {
    /**
     *用户临时票据
     */
server/service/src/main/java/com/doumee/config/Jwt/JwtTokenUtil.java
@@ -49,6 +49,8 @@
    public static final String HEADER_KEY = "token";
    //取值名称
    public static final String UserId_Name = "AppUserId";
    //取值名称
    public static final String UserType = "UserType";
    //加密密钥
    private final static String jwtSecret = "MhAjU9poLf8ko54K25XBDtonaL33vtt1";
    //过期时间(s) 86400L=1天 604800L=7天
server/service/src/main/java/com/doumee/config/Jwt/WebMvcConfig.java
@@ -13,6 +13,7 @@
import io.jsonwebtoken.JwtException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
@@ -40,6 +41,12 @@
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;
    /**
     * æ˜¯å¦å¼€å‘者
     */
    @Value("${debug_model}")
    private Boolean isDebug;
    /**
     * æ·»åŠ æ‹¦æˆªå™¨
@@ -111,6 +118,7 @@
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已禁用,请联系管理员");
            }
            request.setAttribute(JwtTokenUtil.UserId_Name, memberId);
            request.setAttribute(JwtTokenUtil.UserType, Constants.CUSTOMER);
            return true;
        } catch (IllegalArgumentException | JwtException e) {
            throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
@@ -120,6 +128,9 @@
    public Boolean checkPersonnelLogin(HttpServletRequest request, HttpServletResponse response){
        String token = request.getHeader(JwtTokenUtil.HEADER_KEY);
        try {
            if(isDebug){
                return  true;
            }
            //判断Token是否超时
            boolean expiration = JwtTokenUtil.isTokenExpired(token);
            if (expiration) {
@@ -142,6 +153,7 @@
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已禁用,请联系管理员");
            }
            request.setAttribute(JwtTokenUtil.UserId_Name, userId);
            request.setAttribute(JwtTokenUtil.UserType, Constants.BUSINESS);
            return true;
        } catch (IllegalArgumentException | JwtException e) {
            throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录");
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -43,6 +43,7 @@
    //被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验)
    public static final String ZBOM_CRM_AUTH_API_KEY = "ZBOM_CRM_AUTH_API_KEY";
    public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID";
    public static final String LW_BEVISITED_USER_VALID = "LW_BEVISITED_USER_VALID";
    public static final String SELECT_DOORS_VISIT_REQUIRED = "SELECT_DOORS_VISIT_REQUIRED";
@@ -92,6 +93,9 @@
    public static final String ZBOM = "ZBOM" ;
    public static final String ZBOM_IAM_APPKEY = "ZBOM_IAM_APPKEY";
    public static final String ZBOM_IAM_APPID = "ZBOM_IAM_APPID";
    public static final String USER_CARD_HEADER_IMG ="USER_CARD_HEADER_IMG" ;
    public static final String USER_CARD_PHONE_IMG ="USER_CARD_PHONE_IMG" ;
    public static final String USER_CARD_ADDR_IMG ="USER_CARD_ADDR_IMG" ;
    public static Integer parseIntByStr(String idtOrgStatus) {
        try {
@@ -308,6 +312,8 @@
    public static final String ACCESS_KEY = "ACCESS_KEY";
    public static final String ENDPOINT = "ENDPOINT";
    public static final String RESOURCE_PATH = "RESOURCE_PATH";
    public static final String WEIXIN_DEFAULT_IMGS = "WEIXIN_DEFAULT_IMGS";
    public static final String USER_CARD_DEFAULT_IMG = "USER_CARD_DEFAULT_IMG";
    public static final String USERS_FILE = "USERS_FILE";
    public static final String NEWS_FILE = "NEWS_FILE";
    //发送会议开始  å®šæ—¶æå‰å¤šå°‘分钟发送
@@ -326,6 +332,7 @@
    public static final String WX_PLATFORM = "WX_PLATFORM";
    public static final String ZBOM_ZHONGTAI_API_URL = "ZBOM_ZHONGTAI_API_URL";
    public static final String WX_PLATFORM_ACCESS_TOKEN = "WX_PLATFORM_ACCESS_TOKEN";
    public static final String ZBOM_ENCODE_URL = "ZBOM_ENCODE_URL";
    public static final String WX_PLATFORM_APPID = "WX_PLATFORM_APPID";
    public static final String WX_PLATFORM_SECRET = "WX_PLATFORM_SECRET";
    public static final String WX_PLATFORM_AUDIT_VISIT = "WX_PLATFORM_AUDIT_VISIT";
@@ -345,28 +352,15 @@
    public static final String WX_SECRET_PERSONNEL = "WX_SECRET_PERSONNEL";
    public interface CrmSources{
       String SOURCE_DKXD = "DKXD";// ä»£å®¢ä¸‹å•(DKXD)
       String SOURCE_LYSJ = "LYSJ";// é›¶å…ƒè®¾è®¡(LYSJ)
       String SOURCE_ZBSJSQ = "ZBSJSQ";// å¿—邦设计申请(ZBSJSQ)
       String SOURCE_ZBDXFX = "ZBDXFX";// å¿—邦短信分享(ZBDXFX)
       String SOURCE_ZBLLJL = "ZBLLJL";// å¿—邦浏览记录分享(ZBLLJL)
       String SOURCE_ZBWDSC = "ZBWDSC";// å¿—邦我的收藏分享(ZBWDSC)
       String SOURCE_ZBLYSJ = "ZBLYSJ";// å¿—邦零元设计(ZBLYSJ)
       String SOURCE_ZBLDX = "ZBLDX";// å¿—邦老带新(ZBLDX)
       String SOURCE_ZBFGCS = "ZBFGCS";// å¿—邦风格测试(ZBFGCS)
       String SOURCE_ZBJX = "DSLX22";// å¿—邦家选(ZBJX)
    }
    public interface RedisKeys {
       String IMPORTING_MEMBER ="IMPORTING_MEMBER";
       String IMPORTING_SHOP ="IMPORTING_SHOP";
       String IMPORTING_USERS ="IMPORTING_USERS";
       String IAM_APPID ="IAM_APPID";
       String ZBOM_CRM_API_KEY ="ZBOM_CRM_API_KEY";
       String ZBOM_CRM_AUTH_API_KEY ="ZBOM_CRM_AUTH_API_KEY";
       String ZBOM_CRM_API_URL ="ZBOM_CRM_API_URL";
       String ZBOM_ENCODE_URL ="ZBOM_ENCODE_URL";
       String ZBOM_SMS_API_KEY ="ZBOM_SMS_API_KEY";
       String ZBOM_ZHONGTAI_API_URL ="ZBOM_ZHONGTAI_API_URL";
       String ZBOM_SMS_API_URL ="ZBOM_SMS_API_URL";
server/service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -356,7 +356,7 @@
     * @return String
     * @throws Exception
     */
    public static String getNowShortDate() throws Exception {
    public static String getNowShortDate() {
        String nowDate = "";
        try {
            java.sql.Date date = null;
@@ -364,7 +364,7 @@
            nowDate = sdfShort.format(date);
            return nowDate;
        } catch (Exception e) {
            throw e;
           return  "";
        }
    }
server/service/src/main/java/com/doumee/core/utils/GeneratePicUtil.java
@@ -4,6 +4,7 @@
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.MediaType;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
@@ -43,8 +44,8 @@
        System.out.println("结束:" + (System.currentTimeMillis() - starttime) / 1000);
    }
    private static final int width = 898;
    private static final int height = 1308;
    private static final int width = 750;
    private static final int height = 1140;
    /**
     * ç”Ÿæˆåˆ†äº«å›¾ç‰‡
@@ -133,9 +134,7 @@
        g2.drawRect(0, 0, width - 1, height - 1);
        InputStream inputStream = bufferedImageToInputStream(bi);
        return inputStream;
//        String fileName = "8701EAC36DEC405A94C530F0E6796589.jpg"; //ID.nextGUID() + ".jpg";
//        GeneratePicUtil.saveFile(inputStream, filePath+ File.separator+fileName);
//        return filePath + File.separator+ fileName;
    }
    public  static MultipartFile getMultipartFile(InputStream inputStream, String fileName) {
@@ -197,7 +196,7 @@
        }
    }
    public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage) throws IOException {
    public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage) {
        return bufferedImageToInputStream(backgroundImage, "jpg");
    }
@@ -209,7 +208,7 @@
     * @return
     * @throws IOException
     */
    public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage, String format) throws IOException {
    public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage, String format)  {
        ByteArrayOutputStream bs = new ByteArrayOutputStream();
        try (
                ImageOutputStream
@@ -217,6 +216,8 @@
            ImageIO.write(backgroundImage, format, imOut);
            InputStream is = new ByteArrayInputStream(bs.toByteArray());
            return is;
        }catch (Exception e){
            return null;
        }
    }
@@ -267,8 +268,83 @@
        }
        return resMatrix;
    }
    public static InputStream generateUserCardImg(String imgurl, String qrcode, String name,String type, String phone, String shopaddr, String shopname,String phoneIcon,String addrIcon)  {
        BufferedImage bi =  new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        //得到它的绘制环境(这张图片的笔)
        Graphics2D g2 = (Graphics2D) bi.getGraphics();
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        g2.fillRect(0, 0, width, height);
        //背景图片
        BufferedImage img1 =getImgIO(imgurl);
        if(img1!=null){
            g2.drawImage(img1, 0, 0, 750, 700, null);
        }else{
            g2.setColor(new Color(102, 102, 102, 1));
            g2.drawRect( 0, 0, 750, 700);
        }
        //商品名称
        if(name.length()>5){
            name = name.substring(0,5)+"...";
        }
        g2.setColor(Color.black);
        g2.setFont(new Font("黑体", Font.PLAIN, 40));
        g2.drawString(name, 40, 990-242);
        int w = 40+ name.length()*40;
        g2.setColor(Color.GRAY);
        g2.setFont(new Font("黑体", Font.PLAIN, 30));
        g2.drawString(type, w, 990-242);
        if(StringUtils.isNotBlank(qrcode)){
            //个人二维码
            BufferedImage img2 = getImgIO(qrcode);
            if(img2!=null){
                g2.drawImage(img2, 522, 982-242, 188, 188, null);
            }
            g2.setColor(Color.GRAY);
            g2.setFont(new Font("黑体", Font.PLAIN, 24));
            g2.drawString("扫码添加好友", 544, 1186-242);
        }
        //手机号
        BufferedImage img4 = getImgIO(phoneIcon);
        if(img4!=null){
            g2.drawImage(img4, 40, 1072-28-242, 34, 36, null);
        }
        g2.setColor(Color.GRAY);
        g2.setFont(new Font("黑体", Font.PLAIN, 30));
        g2.drawString(phone, 94, 1072-242);
        BufferedImage img3 = getImgIO(addrIcon);
        if(img3!=null){
            g2.drawImage(img3, 40, 1142-28-242, 34, 36, null);
        }
        if(shopaddr.length()>12){
            shopaddr = shopaddr.substring(0,12)+"\n"+shopaddr.substring(12);
        }
        //地址
        g2.setColor(Color.GRAY);
        g2.setFont(new Font("黑体", Font.PLAIN, 30));
        g2.drawString(shopaddr, 94, 1142-242);
        //底部
        if(shopname.length()>15){
            shopname = shopname.substring(0,15)+"...";
        }
        g2.setColor(Color.GRAY);
        g2.setFont(new Font("黑体", Font.PLAIN, 30));
        g2.drawString(shopname, 180, 1300-242);
        InputStream inputStream = bufferedImageToInputStream(bi);
        return inputStream;
    }
    private static BufferedImage getImgIO(String imgurl) {
        try {
        return     ImageIO.read(new URL(imgurl));
        }catch (Exception e){
        }return null;
    }
}
server/service/src/main/java/com/doumee/core/utils/HttpsUtil.java
@@ -22,6 +22,13 @@
    public static String post(String url, String data, String contentType, boolean ignoreSSL) {
        return connection(url, "POST", data, contentType, ignoreSSL,null);
    }
    public static String sendGet(String url) {
        if(url.startsWith("https://")){
            return connection(url, "GET", "", "text/plain; charset=utf-8", true,null);
        }else{
            return connectionHttp(url, "GET", "", "text/plain; charset=utf-8",null);
        }
    }
    public static String postJson(String url, String data) {
        if(url.startsWith("https://")){
            return connection(url, "POST", data, "application/json", true,null);
server/service/src/main/java/com/doumee/core/utils/tyyun/TyyZosUtil.java
@@ -9,14 +9,19 @@
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.*;
import com.doumee.core.oss.FileContent;
import com.doumee.core.oss.FileModel;
import com.doumee.core.utils.FileDigest;
import java.io.*;
import java.net.URL;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.doumee.core.utils.ID;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.multipart.MultipartFile;
server/service/src/main/java/com/doumee/dao/business/CustomerUserMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.doumee.dao.business;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.CustomerUser;
import com.github.yulichang.base.mapper.MPJJoinMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/15 10:21
 */
public interface CustomerUserMapper extends MPJJoinMapper<CustomerUser> {
}
server/service/src/main/java/com/doumee/dao/business/model/CustomerUser.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,115 @@
package com.doumee.dao.business.model;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
 * å®¢æˆ·å¯¼è´­å…³è”表
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/15 10:21
 */
@Data
@ApiModel("客户导购关联表")
@TableName("`customer_user`")
public class CustomerUser {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "编码", example = "1")
    @ExcelColumn(name="编码")
    private Long id;
    @ApiModelProperty(value = "是否已删除 0未删除 1已删除", example = "1")
    @ExcelColumn(name="是否已删除 0未删除 1已删除")
    private Integer isdeleted;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "编辑时间")
    @ExcelColumn(name="编辑时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "编辑人代码", example = "1")
    @ExcelColumn(name="编辑人代码")
    private Integer editor;
    @ApiModelProperty(value = "客户手机号")
    @ExcelColumn(name="客户手机号")
    private String customerPhone;
    @ApiModelProperty(value = "客户姓名")
    @ExcelColumn(name="客户姓名")
    private String customerName;
    @ApiModelProperty(value = "导购手机号")
    @ExcelColumn(name="导购手机号")
    private String phone;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String info;
    @ApiModelProperty(value = "导购编码(关联users表)", example = "1")
    @ExcelColumn(name="导购编码(关联users表)")
    private Long userId;
    @ApiModelProperty(value = "导购IAM编码")
    @ExcelColumn(name="导购IAM编码")
    private String iamUserId;
    @ApiModelProperty(value = "用户编码(关联member表)", example = "1")
    @ExcelColumn(name="用户编码(关联member表)")
    private Long memberId;
    @ApiModelProperty(value = "导购姓名")
    @ExcelColumn(name="导购姓名")
    private String name;
    @ApiModelProperty(value = "导购组织名称")
    @ExcelColumn(name="导购组织名称")
    private String orgName;
    @ApiModelProperty(value = "导购登陆账号")
    @ExcelColumn(name="导购登陆账号")
    private String username;
    @ApiModelProperty(value = "产品名称")
    @ExcelColumn(name="产品名称")
    private String productCodeName;
    @ApiModelProperty(value = "地址详情")
    @ExcelColumn(name="地址详情")
    private String addr;
    @ApiModelProperty(value = "创建日期")
    @ExcelColumn(name="创建日期")
    private String  creationDate    ;//时间 yyyy-MM-dd
    @ApiModelProperty(value = "来源 0小程序 1中台", example = "1")
    @ExcelColumn(name="来源 0小程序 1中台")
    private Integer source;
    @ApiModelProperty(value = "中台提交状态 0未提交 1已提交 2提交失败", example = "1")
    @ExcelColumn(name="中台提交状态 0未提交 1已提交 2提交失败")
    private Integer ztStatus;
    @ApiModelProperty(value = "中台提交时间")
    @ExcelColumn(name="中台提交时间")
    private Date ztDate;
    @ApiModelProperty(value = "中台提交备注")
    @ExcelColumn(name="中台提交备注")
    private String ztInfo;
}
server/service/src/main/java/com/doumee/dao/business/model/Shop.java
@@ -9,6 +9,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -120,7 +122,7 @@
    @ApiModelProperty(value = "所属关联S码", example = "1")
    @ExcelColumn(name="所属关联S码")
    private String scode;
    @ApiModelProperty(value = "注册地" )
    @ApiModelProperty(value = "注册地(IAM)" )
    @ExcelColumn(name="注册地")
    private String regAddr;
    @ApiModelProperty(value = "法人身份证号" )
@@ -188,6 +190,19 @@
    @ApiModelProperty(value = "部门级别路径", example = "1")
    @ExcelColumn(name="部门级别路径")
    private String namePath;
    @ApiModelProperty(value = "经度", example = "1")
    @ExcelColumn(name="经度")
    private BigDecimal longitude;
    @ApiModelProperty(value = "纬度", example = "1")
    @ExcelColumn(name="纬度")
    private BigDecimal latitude;
    @ApiModelProperty(value = "地址")
    @ExcelColumn(name="地址")
    private String address;
    @ApiModelProperty(value = "父级部门级别路径", example = "1")
    @TableField(exist = false)
    private String parentIdPath;
@@ -215,4 +230,13 @@
    @ApiModelProperty(value = "下级部门集合", example = "1")
    @TableField(exist = false)
    private List<Shop> childList;
    @ApiModelProperty(value = "距离 ", example = "1")
    @TableField(exist = false)
    private BigDecimal distance;
    @ApiModelProperty(value = "门店导购列表 ", example = "1")
    @TableField(exist = false)
    private List<Users> usersList;
}
server/service/src/main/java/com/doumee/dao/business/model/Users.java
@@ -134,8 +134,8 @@
    @ExcelColumn(name="服务客户数")
    private Integer costomerNum;
    @ApiModelProperty(value = "从业年月(yyyy-MM)")
    @ExcelColumn(name="从业年月(yyyy-MM)")
    @ApiModelProperty(value = "从业年份")
    @ExcelColumn(name="从业年月")
    private String jobDate;
    @ApiModelProperty(value = "宣传语")
@@ -145,6 +145,18 @@
    @ApiModelProperty(value = "个人二维码图片地址")
    @ExcelColumn(name="个人二维码图片地址")
    private String qrcodeImg;
    @ApiModelProperty(value = "企业二维码图片地址")
    @ExcelColumn(name="企业二维码图片地址")
    private String companyQrcodeImg;
    @ApiModelProperty(value = "中台临时票据过期时间")
    @ExcelColumn(name="中台临时票据过期时间")
    private Date tokenDate;
    @ApiModelProperty(value = "中台临时票据")
    @ExcelColumn(name="中台临时票据")
    private String token;
    @ApiModelProperty(value = "邮箱")
    @ExcelColumn(name="邮箱")
@@ -179,7 +191,15 @@
    @ApiModelProperty(value = "完整头像录")
    @TableField(exist = false)
    private String imgurlFull;
    @ApiModelProperty(value = "个人二维码图片地址")
    @ApiModelProperty(value = "个人二维码图片完整地址")
    @TableField(exist = false)
    private String qrcodeImgFull;
    @ApiModelProperty(value = "门店地址")
    @TableField(exist = false)
    private String shopAddress;
    @ApiModelProperty(value = "企业二维码图片完整地址")
    @TableField(exist = false)
    private String companyQrcodeImgFull;
}
server/service/src/main/java/com/doumee/dao/timer/scheduler/QuartzManage.java
@@ -1,5 +1,7 @@
package com.doumee.dao.timer.scheduler;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.dao.timer.entity.JobState;
import com.doumee.dao.timer.entity.QuartzJob;
import org.quartz.*;
@@ -142,7 +144,7 @@
                this.scheduler.pauseJob(getJobKey(quartzJob.getId()));
            }
        } catch (SchedulerException e){
            throw new RuntimeException("pauseJob Fail",e) ;
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"pauseJob Fail",e) ;
        }
    }
server/service/src/main/java/com/doumee/dao/web/reqeust/ShopQueryByLLDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.doumee.dao.web.reqeust;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2023/12/7 11:19
 */
@Data
public class ShopQueryByLLDTO {
    @ApiModelProperty(value = "经度")
    private String longitude;
    @ApiModelProperty(value = "纬度")
    private String latitude;
}
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/CustomerUserService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,99 @@
package com.doumee.service.business;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.CustomerUser;
import java.util.List;
/**
 * å®¢æˆ·å¯¼è´­å…³è”表Service定义
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/15 10:21
 */
public interface CustomerUserService {
    /**
     * åˆ›å»º
     *
     * @param customerUser å®žä½“对象
     * @return Long
     */
    Long create(CustomerUser customerUser);
    /**
     * ä¸»é”®åˆ é™¤
     *
     * @param id ä¸»é”®
     */
    void deleteById(Long id);
    /**
     * åˆ é™¤
     *
     * @param customerUser å®žä½“对象
     */
    void delete(CustomerUser customerUser);
    /**
     * æ‰¹é‡ä¸»é”®åˆ é™¤
     *
     * @param ids ä¸»é”®é›†
     */
    void deleteByIdInBatch(List<Long> ids);
    /**
     * ä¸»é”®æ›´æ–°
     *
     * @param customerUser å®žä½“对象
     */
    void updateById(CustomerUser customerUser);
    /**
     * æ‰¹é‡ä¸»é”®æ›´æ–°
     *
     * @param customerUsers å®žä½“集
     */
    void updateByIdInBatch(List<CustomerUser> customerUsers);
    /**
     * ä¸»é”®æŸ¥è¯¢
     *
     * @param id ä¸»é”®
     * @return CustomerUser
     */
    CustomerUser findById(Long id);
    /**
     * æ¡ä»¶æŸ¥è¯¢å•条记录
     *
     * @param customerUser å®žä½“对象
     * @return CustomerUser
     */
    CustomerUser findOne(CustomerUser customerUser);
    /**
     * æ¡ä»¶æŸ¥è¯¢
     *
     * @param customerUser å®žä½“对象
     * @return List<CustomerUser>
     */
    List<CustomerUser> findList(CustomerUser customerUser);
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param pageWrap åˆ†é¡µå¯¹è±¡
     * @return PageData<CustomerUser>
     */
    PageData<CustomerUser> findPage(PageWrap<CustomerUser> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
     * @param customerUser å®žä½“对象
     * @return long
     */
    long count(CustomerUser customerUser);
    void syncYesterday(String date);
}
server/service/src/main/java/com/doumee/service/business/GetZhongTaiDataService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
package com.doumee.service.business;
import com.doumee.biz.zbom.model.zhongtai.ZTCatalogListRequest;
import com.doumee.biz.zbom.model.zhongtai.ZTContentListRequest;
import com.doumee.biz.zbom.model.zhongtai.response.*;
import java.util.List;
/**
 * ç”¨æˆ·è¡Œä¸ºæ•°æ®ä¿¡æ¯è¡¨Service定义
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/04 14:40
 */
public interface GetZhongTaiDataService {
    /**
     * åˆ†ç±»æ•°æ®
     * @param param
     * @return
     */
    List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param);
    /**
     * æ ‡ç­¾æ•°æ®
     * @param param
     * @return
     */
    List<ZTTagInfoResponse> getCataLogTagList(ZTCatalogListRequest param);
    /**
     * çˆ¶å­çº§åˆ†ç±»æ•°æ®  åˆ†ç±»+标签
     * @param ztCatalogListRequest
     * @return
     */
    List<ZTCatalogInfoResponse> getZTCatalogInfoResponse(ZTCatalogListRequest ztCatalogListRequest);
    /**
     * å†…容分页
     * @param ztContentListRequest
     * @return
     */
    ZTBasePageResponse<ZTContentListResponse> pageContentList(ZTContentListRequest ztContentListRequest);
    /**
     * å†…容详情
     * @param id  ä¸šåС䏻键
     * @param userType ç”¨æˆ·ç±»åž‹
     * @param userId ç”¨æˆ·ä¸»é”®
     * @return
     */
    ZTContentInfoResponse getContentInfo(String id, String userType, Long userId);
}
server/service/src/main/java/com/doumee/service/business/InitService.java
@@ -36,10 +36,12 @@
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPKEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPKEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPID,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPID).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_AUTH_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_AUTH_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_ZHONGTAI_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_ZHONGTAI_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_ENCODE_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_ENCODE_URL).getCode());
    }
    @PostConstruct
    public void cacheShopTree(){
server/service/src/main/java/com/doumee/service/business/ShopService.java
@@ -5,6 +5,7 @@
import com.doumee.dao.admin.request.UpdateShopSortDTO;
import com.doumee.dao.business.model.Shop;
import com.doumee.dao.business.vo.ShopTreeVo;
import com.doumee.dao.web.reqeust.ShopQueryByLLDTO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -110,4 +111,18 @@
    void dealShopNamePath();
    List<Shop> listByParent(String parentId);
    /**
     * æ ¹æ®ç»çº¬åº¦ èŽ·å–é—¨åº—åˆ—è¡¨
     * @param pageWrap
     * @return
     */
    PageData<Shop> queryShopByLL(PageWrap<Shop> pageWrap);
    /**
     * é—¨åº—详情
     * @param id
     * @return
     */
    Shop shopDetail(Long id,Long memberId);
}
server/service/src/main/java/com/doumee/service/business/UsersService.java
@@ -2,6 +2,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Users;
import com.doumee.dao.web.response.AccountResponse;
import org.springframework.web.multipart.MultipartFile;
@@ -105,4 +106,8 @@
    void bindingOpenid(String code,Long userId);
    String importBatch(MultipartFile file);
    Users usersDetail(Long userId);
    String getUserCard(Users users);
}
server/service/src/main/java/com/doumee/service/business/impl/CustomerUserServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,271 @@
package com.doumee.service.business.impl;
import com.doumee.biz.zbom.ZbomCRMService;
import com.doumee.biz.zbom.model.crm.CRMConstants;
import com.doumee.biz.zbom.model.crm.CrmDaogouBindListRequest;
import com.doumee.biz.zbom.model.crm.response.CRMBaseResponse;
import com.doumee.biz.zbom.model.crm.response.CRMDaogouBindListResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CustomerUserMapper;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.UsersMapper;
import com.doumee.dao.business.model.CustomerUser;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Users;
import com.doumee.service.business.CustomerUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * å®¢æˆ·å¯¼è´­å…³è”表Service实现
 * @author æ±Ÿè¹„蹄
 * @date 2024/07/15 10:21
 */
@Service
public class CustomerUserServiceImpl implements CustomerUserService {
    @Autowired
    private CustomerUserMapper customerUserMapper;
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
    private UsersMapper usersMapper;
    @Autowired
    private ZbomCRMService zbomCRMService;
    @Override
    public Long create(CustomerUser customerUser) {
        customerUserMapper.insert(customerUser);
        return customerUser.getId();
    }
    @Override
    public void deleteById(Long id) {
        customerUserMapper.deleteById(id);
    }
    @Override
    public void delete(CustomerUser customerUser) {
        UpdateWrapper<CustomerUser> deleteWrapper = new UpdateWrapper<>(customerUser);
        customerUserMapper.delete(deleteWrapper);
    }
    @Override
    public void deleteByIdInBatch(List<Long> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        customerUserMapper.deleteBatchIds(ids);
    }
    @Override
    public void updateById(CustomerUser customerUser) {
        customerUserMapper.updateById(customerUser);
    }
    @Override
    public void updateByIdInBatch(List<CustomerUser> customerUsers) {
        if (CollectionUtils.isEmpty(customerUsers)) {
            return;
        }
        for (CustomerUser customerUser: customerUsers) {
            this.updateById(customerUser);
        }
    }
    @Override
    public CustomerUser findById(Long id) {
        return customerUserMapper.selectById(id);
    }
    @Override
    public CustomerUser findOne(CustomerUser customerUser) {
        QueryWrapper<CustomerUser> wrapper = new QueryWrapper<>(customerUser);
        return customerUserMapper.selectOne(wrapper);
    }
    @Override
    public List<CustomerUser> findList(CustomerUser customerUser) {
        QueryWrapper<CustomerUser> wrapper = new QueryWrapper<>(customerUser);
        return customerUserMapper.selectList(wrapper);
    }
    @Override
    public PageData<CustomerUser> findPage(PageWrap<CustomerUser> pageWrap) {
        IPage<CustomerUser> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<CustomerUser> queryWrapper = new QueryWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(CustomerUser::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getIsdeleted() != null) {
            queryWrapper.lambda().eq(CustomerUser::getIsdeleted, pageWrap.getModel().getIsdeleted());
        }
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.lambda().ge(CustomerUser::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.lambda().le(CustomerUser::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        if (pageWrap.getModel().getCreator() != null) {
            queryWrapper.lambda().eq(CustomerUser::getCreator, pageWrap.getModel().getCreator());
        }
        if (pageWrap.getModel().getEditDate() != null) {
            queryWrapper.lambda().ge(CustomerUser::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
            queryWrapper.lambda().le(CustomerUser::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
        }
        if (pageWrap.getModel().getEditor() != null) {
            queryWrapper.lambda().eq(CustomerUser::getEditor, pageWrap.getModel().getEditor());
        }
        if (pageWrap.getModel().getPhone() != null) {
            queryWrapper.lambda().eq(CustomerUser::getPhone, pageWrap.getModel().getPhone());
        }
        if (pageWrap.getModel().getInfo() != null) {
            queryWrapper.lambda().eq(CustomerUser::getInfo, pageWrap.getModel().getInfo());
        }
        if (pageWrap.getModel().getUserId() != null) {
            queryWrapper.lambda().eq(CustomerUser::getUserId, pageWrap.getModel().getUserId());
        }
        if (pageWrap.getModel().getIamUserId() != null) {
            queryWrapper.lambda().eq(CustomerUser::getIamUserId, pageWrap.getModel().getIamUserId());
        }
        if (pageWrap.getModel().getMemberId() != null) {
            queryWrapper.lambda().eq(CustomerUser::getMemberId, pageWrap.getModel().getMemberId());
        }
        if (pageWrap.getModel().getName() != null) {
            queryWrapper.lambda().eq(CustomerUser::getName, pageWrap.getModel().getName());
        }
        if (pageWrap.getModel().getOrgName() != null) {
            queryWrapper.lambda().eq(CustomerUser::getOrgName, pageWrap.getModel().getOrgName());
        }
        if (pageWrap.getModel().getUsername() != null) {
            queryWrapper.lambda().eq(CustomerUser::getUsername, pageWrap.getModel().getUsername());
        }
        if (pageWrap.getModel().getProductCodeName() != null) {
            queryWrapper.lambda().eq(CustomerUser::getProductCodeName, pageWrap.getModel().getProductCodeName());
        }
        if (pageWrap.getModel().getAddr() != null) {
            queryWrapper.lambda().eq(CustomerUser::getAddr, pageWrap.getModel().getAddr());
        }
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(customerUserMapper.selectPage(page, queryWrapper));
    }
    @Override
    public long count(CustomerUser customerUser) {
        QueryWrapper<CustomerUser> wrapper = new QueryWrapper<>(customerUser);
        return customerUserMapper.selectCount(wrapper);
    }
    @Override
    @Transactional
    public void syncYesterday(String date) {
        CrmDaogouBindListRequest request = new CrmDaogouBindListRequest();
        request.setPage(0);
        request.setPageSize(100);
        request.setTiming(Constants.ONE+"");
        request.setCreationDate(date);
        boolean hasMore = true;
        int currentNum = 0;
        Date cdate = new Date();
        while (hasMore){
            try {
                request.setPage(request.getPage()+1);
                currentNum += currentNum;
                CRMBaseResponse<List<CRMDaogouBindListResponse>> response = zbomCRMService.getDaogouBindList(request);
                if(response==null
                        || !StringUtils.equals(response.getCode(), CRMConstants.CODE_SUCCESS)
                        || response.getData() ==null
                        || response.getData().size() ==0){
                    hasMore = false;
                }
                if(currentNum >= response.getTotal()){
                    hasMore = false;
                }
                dealSyncDataBiz(cdate,response.getData());
            }catch (Exception e){
               hasMore = false;
            }
        }
    }
    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;
            }
            Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda()
                    .eq(Member::getPhone,data.getCustomerPhone() )
                    .eq(Member::getIsdeleted,Constants.ZERO)
                    .last("limit 1" ));
            Users user = usersMapper.selectOne(new QueryWrapper<Users>().lambda()
                    .eq(Users::getIamId,data.getUserId() )
                    .last("limit 1" ));
            if(member == null){
                continue;
            }
            phoneList.add(data.getCustomerPhone());
            CustomerUser model = new CustomerUser();
            model.setCreateDate(date);
            model.setIsdeleted(Constants.ZERO);
            model.setEditDate(date);
            model.setName(data.getDgName());
            model.setPhone(data.getDgPhone());
            model.setOrgName(data.getOrgName());
            model.setCustomerName(data.getCustomerName());
            model.setCustomerPhone(data.getCustomerPhone());
            model.setUsername(data.getUserName());
            model.setSource(Constants.ONE);
            model.setZtStatus(Constants.ONE);
            model.setZtInfo("crm同步");
            model.setIamUserId(data.getUserId());
            model.setUserId(user== null?null:user.getId());
            model.setCreationDate(data.getCreationDate());
            addList.add(model);
        }
        if(phoneList.size()>0){
            /**
             * åˆ é™¤è€å¾—数据
             */
            customerUserMapper.update(null,new UpdateWrapper<CustomerUser>().lambda()
                    .in(CustomerUser::getPhone,phoneList)
                    .eq(CustomerUser::getZtStatus,Constants.ONE)
                    .eq(CustomerUser::getIsdeleted,Constants.ZERO)
                    .set(CustomerUser::getIsdeleted,Constants.ONE)
            );
        }
        if(addList .size() >0){
            int temp = 0;
            while(temp < addList.size()){
                int index;
                if(temp + 500 <= addList.size()){
                    index = temp+500;
                }else{
                    index = addList.size();
                }
                customerUserMapper.insert(addList.subList(temp,index));
                temp = index;
            }
        }
    }
}
server/service/src/main/java/com/doumee/service/business/impl/GetZhongTaiDataServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,167 @@
package com.doumee.service.business.impl;
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.biz.zbom.ZbomZhongTaiService;
import com.doumee.biz.zbom.model.zhongtai.ZTCatalogListRequest;
import com.doumee.biz.zbom.model.zhongtai.ZTConstants;
import com.doumee.biz.zbom.model.zhongtai.ZTContentInfoRequest;
import com.doumee.biz.zbom.model.zhongtai.ZTContentListRequest;
import com.doumee.biz.zbom.model.zhongtai.response.*;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.dao.business.IamInterfaceLogMapper;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.UsersMapper;
import com.doumee.service.business.GetZhongTaiDataService;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/7/15 14:12
 */
@Service
public class GetZhongTaiDataServiceImpl implements GetZhongTaiDataService {
    @Autowired
    private ZbomZhongTaiService zbomZhongTaiService;
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
    private UsersMapper usersMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Override
    public List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest ztCatalogListRequest){
        if(Objects.isNull(ztCatalogListRequest)
        || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU)
            ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING)
            ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN)
            ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"分类信息错误");
        }
        return zbomZhongTaiService.getCatalogList(ztCatalogListRequest);
    }
    @Override
    public List<ZTTagInfoResponse> getCataLogTagList(ZTCatalogListRequest ztCatalogListRequest){
        if(Objects.isNull(ztCatalogListRequest)
                || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"分类信息错误");
        }
        return zbomZhongTaiService.getTagList(ztCatalogListRequest);
    }
    /**
     *  èŽ·å–çˆ¶å­çº§ç»“æž„æ•°æ®åˆ—è¡¨
     * å¿—说装修 zb_deco äº§å“ product_intro èµ„讯product_info å…¨å±‹æ¡ˆä¾‹ whole_case
     * èŽ·å–çˆ¶å­çº§ç»“æž„æ•°æ®
     * @return
     */
    @Override
    public List<ZTCatalogInfoResponse> getZTCatalogInfoResponse(ZTCatalogListRequest ztCatalogListRequest){
        if(Objects.isNull(ztCatalogListRequest)
                || StringUtils.isBlank(ztCatalogListRequest.getCatalogCode())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.CHANPING)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.ZIXUN)
                ||ztCatalogListRequest.getCatalogCode().equals(ZTConstants.CatalogCode.QW_CASE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"分类信息错误");
        }
        List<ZTCatalogInfoResponse>  ztCatalogInfoResponseList = zbomZhongTaiService.getCatalogList(ztCatalogListRequest);
        if(CollectionUtils.isNotEmpty(ztCatalogInfoResponseList)){
            for (ZTCatalogInfoResponse ztCatalogInfoResponse:ztCatalogInfoResponseList) {
                ZTCatalogListRequest ztCatalogTagListRequest = new ZTCatalogListRequest();
                ztCatalogTagListRequest.setCatalogCode(ztCatalogInfoResponse.getCode());
                List<ZTTagInfoResponse> ztTagInfoResponseList = zbomZhongTaiService.getTagList(ztCatalogTagListRequest);
                if(CollectionUtils.isNotEmpty(ztCatalogInfoResponseList)){
                    ztCatalogInfoResponse.setChildTagList(ztTagInfoResponseList);
                }
            }
        }
        return ztCatalogInfoResponseList;
    }
    /**
     * å†…容 åˆ†é¡µæ•°æ®
     * @param ztContentListRequest
     * @return
     */
    @Override
    public ZTBasePageResponse<ZTContentListResponse> pageContentList(ZTContentListRequest ztContentListRequest){
        if(Objects.isNull(ztContentListRequest)
            || Objects.isNull(ztContentListRequest.getPageNum())
            || Objects.isNull(ztContentListRequest.getPageSize())
            || StringUtils.isBlank(ztContentListRequest.getCatalogCode())
            || StringUtils.isBlank(ztContentListRequest.getTagCodes())
            || StringUtils.isBlank(ztContentListRequest.getQuery())
            || StringUtils.isBlank(ztContentListRequest.getSortType())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        //查询 ä¸­å°
        String token = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,ztContentListRequest.getUserId(),ztContentListRequest.getUserType());
        ztContentListRequest.setToken(token);
        String catalogCode = ztContentListRequest.getCatalogCode();
        if(catalogCode.equals(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU)
                ||catalogCode.equals(ZTConstants.CatalogCode.CHANPING)
                ||catalogCode.equals(ZTConstants.CatalogCode.ZIXUN)
                ||catalogCode.equals(ZTConstants.CatalogCode.QW_CASE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"分类信息错误");
        }
        ZTBasePageResponse<ZTContentListResponse> response = zbomZhongTaiService.pageContentList(ztContentListRequest);
        return response;
    }
    @Override
    public ZTContentInfoResponse getContentInfo(String id,String userType,Long userId){
        //查询 ä¸­å° TOKEN
        String token = MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,userId.toString(),userType);
        ZTContentInfoRequest ztContentListRequest = new ZTContentInfoRequest();
        ztContentListRequest.setToken(token);
        ztContentListRequest.setUserType(userType);
        ztContentListRequest.setId(id);
        ZTContentInfoResponse response = zbomZhongTaiService.getContentInfo(ztContentListRequest);
        return response;
    }
}
server/service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -18,11 +18,14 @@
import com.doumee.core.oss.FileModel;
import com.doumee.core.utils.CodeVerifyUtils;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.core.wx.WxMiniConfig;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.UsersMapper;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Users;
import com.doumee.dao.web.reqeust.EditMemberRequest;
import com.doumee.dao.web.reqeust.WxPhoneRequest;
import com.doumee.dao.web.response.AccountResponse;
@@ -35,6 +38,7 @@
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.catalina.User;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -56,6 +60,9 @@
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
    private UsersMapper usersMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
@@ -259,14 +266,13 @@
    @Override
    public AccountResponse wxLogin(String code){
//        try {
        try {
            //获取微信敏感数据
//            WxMaJscode2SessionResult session = WxMiniConfig.wxCustomerService.getUserService().getSessionInfo(code);
//            String openId = session.getOpenid();
//            if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isBlank(openId)) {
//                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"获取openid失败!请联系管理员");
//            }
            String openId = code;
            WxMaJscode2SessionResult session = WxMiniConfig.wxCustomerService.getUserService().getSessionInfo(code);
            String openId = session.getOpenid();
            if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isBlank(openId)) {
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"获取openid失败!请联系管理员");
            }
            Member member = memberMapper.selectOne(new QueryWrapper<Member>().eq("OPENID", openId));
            if (member == null) {
                member = new Member();
@@ -281,13 +287,13 @@
            String token = JwtTokenUtil.generateToken(payLoad);
            AccountResponse accountResponse = new AccountResponse();
            accountResponse.setToken(token);
//            accountResponse.setSessionKey(session.getSessionKey());
            accountResponse.setSessionKey(session.getSessionKey());
            accountResponse.setMember(member);
            return accountResponse;
//        } catch (WxErrorException e) {
//            e.printStackTrace();
//        }
//        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"微信登录异常!请联系管理员");
        } catch (WxErrorException e) {
            e.printStackTrace();
        }
        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"微信登录异常!请联系管理员");
    }
    @Override
@@ -311,7 +317,7 @@
    public void updMemberDetail(EditMemberRequest editMemberRequest){
        Member member = memberMapper.selectById(editMemberRequest.getMemberId());
        ZTUserInfoUpdateRequest ztUserInfoUpdateRequest = new  ZTUserInfoUpdateRequest();
        ztUserInfoUpdateRequest.setOpenid(member.getOpenid());
        ztUserInfoUpdateRequest.setOpenId(member.getOpenid());
        String appId = systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_CUSTOMER).getCode();
        ztUserInfoUpdateRequest.setAppId(appId);
        ztUserInfoUpdateRequest.setPlatform(Constants.PLATFORM);
@@ -365,11 +371,14 @@
    }
    /**
     * æ›´æ–°ä¸­å°token信息
     * @param member
     */
    public void updUserZTToken(Member member){
    public static String getZTToken(ZbomZhongTaiService zbomZhongTaiService, MemberMapper memberMapper, UsersMapper usersMapper, SystemDictDataBiz systemDictDataBiz, String id, String userType){
        if(userType.equals(Constants.CUSTOMER)){
            Member member = memberMapper.selectById(id);
            if(Objects.isNull(member)){
                throw new BusinessException(ResponseStatus.BAD_REQUEST);
            }
        //如果无有效期/已过期 é‡æ–°èŽ·å–
        if(Objects.isNull(member.getTokenDate()) || member.getTokenDate().getTime()<=System.currentTimeMillis() ){
            ZTUserGetTokenRequest param = new ZTUserGetTokenRequest();
@@ -383,11 +392,40 @@
                //TODO æš‚无过期日期
                memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getToken,ztUserGetTokenResponse.getToken())
                        .eq(Member::getId,member.getId()));
                    return ztUserGetTokenResponse.getToken();
            }else{
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"中台TOKEN获取失败,请联系管理员");
            }
        };
    }
            return member.getToken();
        }else if(userType.equals(Constants.BUSINESS)){
            Users users = usersMapper.selectById(id);
            if(Objects.isNull(users)){
                throw new BusinessException(ResponseStatus.BAD_REQUEST);
            }
            if(Objects.isNull(users.getTokenDate()) || users.getTokenDate().getTime()<=System.currentTimeMillis() ){
                ZTUserGetTokenRequest param = new ZTUserGetTokenRequest();
                //查询APPID
                String appId = systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_CUSTOMER).getCode();
                param.setAppId(appId);
                param.setOpenId(users.getOpenid());
                ZTUserGetTokenResponse ztUserGetTokenResponse = zbomZhongTaiService.getUserToken(param);
                if(Objects.nonNull(ztUserGetTokenResponse)){
                    users.setToken(ztUserGetTokenResponse.getToken());
                    //TODO æš‚无过期日期
                    usersMapper.update(new UpdateWrapper<Users>().lambda().set(Users::getToken,ztUserGetTokenResponse.getToken())
                            .eq(Users::getId,users.getId()));
                    return ztUserGetTokenResponse.getToken();
                }else{
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"中台TOKEN获取失败,请联系管理员");
                }
            }
            return users.getToken();
        }else{
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误");
        }
    }
@@ -401,11 +439,11 @@
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已注销");
        }
        //校验用户token信息
        this.updUserZTToken(member);
        MemberServiceImpl.getZTToken(zbomZhongTaiService,memberMapper,usersMapper,systemDictDataBiz,member.getId().toString(),Constants.CUSTOMER);
        //调起中台注销接口
        ZTBaseRequst ztBaseRequst = new ZTBaseRequst();
        ztBaseRequst.setUserType(Constants.CUSTOMER);
        ztBaseRequst.setOpenid(member.getOpenid());
        ztBaseRequst.setOpenId(member.getOpenid());
        ztBaseRequst.setToken(member.getToken());
        Boolean logoutFlag = zbomZhongTaiService.userLogout(ztBaseRequst);
        if(logoutFlag){
@@ -420,4 +458,6 @@
    }
}
server/service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
@@ -1,5 +1,6 @@
package com.doumee.service.business.impl;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.annotation.excel.ExcelImporter;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
@@ -12,15 +13,15 @@
import com.doumee.dao.admin.request.FcodeImport;
import com.doumee.dao.admin.request.ShopImport;
import com.doumee.dao.admin.request.UpdateShopSortDTO;
import com.doumee.dao.business.CategoryMapper;
import com.doumee.dao.business.CategorySegMapper;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.SegmentsMapper;
import com.doumee.dao.business.ShopMapper;
import com.doumee.dao.business.UsersMapper;
import com.doumee.dao.business.join.ShopJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ShopTree;
import com.doumee.dao.business.vo.ShopTreeVo;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.dao.web.reqeust.ShopQueryByLLDTO;
import com.doumee.service.business.ShopService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -41,7 +42,6 @@
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
 * å¿—邦组织信息表Service实现
@@ -55,10 +55,17 @@
    private RedisTemplate<String, Object> redisTemplate;
    @Autowired
    private ShopJoinMapper shopMapper;
    @Autowired
    private SegmentsMapper segmentsMapper;
    @Autowired
    private CategorySegMapper categorySegMapper;
    @Autowired
    private UsersMapper usersMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private MemberMapper memberMapper;
    @Override
    public Long create(Shop shop) {
@@ -858,4 +865,79 @@
            }
        }
    }
    @Override
    public PageData<Shop> queryShopByLL(PageWrap<Shop> pageWrap) {
        if(Objects.isNull(pageWrap.getModel())
                || Objects.isNull(pageWrap.getModel().getLatitude())
                || Objects.isNull(pageWrap.getModel().getLongitude())){
            return null;
        }
        IPage<Shop> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        MPJLambdaWrapper<Shop> queryWrapper = new MPJLambdaWrapper<>();
        queryWrapper.select("ID,NAME,ADDRESS,PROVINCE_NAME,CITY_NAME,AREA_NAME,TOWN,AREA_NAME,LEGAL_PHONE," +
                        " CONVERT (ST_Distance_Sphere (point ("+pageWrap.getModel().getLongitude()+", "+pageWrap.getModel().getLatitude()+" ), point ( LONGITUDE, LATITUDE )) /1000,decimal(15,2)) as distance ")
                .eq("isdeleted",Constants.ZERO)
                .isNotNull("LATITUDE")
                .isNotNull("LONGITUDE")
                .eq("ATTRIBUTE",Constants.ONE)
                .orderByAsc(" distance ");
        Utils.MP.blankToNull(pageWrap.getModel());
        PageData<Shop> pageData = PageData.from(shopMapper.selectPage(page, queryWrapper));
        String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) +
        StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode());
        for (Shop shop:pageData.getRecords()) {
            //查询门店下导购数据
            List<Users> usersList =usersMapper.selectList(new QueryWrapper<Users>().lambda().eq(Users::getDepartmentId,shop.getId())
                    .eq(Users::getIsdeleted,Constants.ZERO)
                    .eq(Users::getStatus,Constants.ONE)
                    .eq(Users::getType,Constants.ZERO)
            );
            for (Users users:usersList) {
                if(StringUtils.isNotBlank(users.getImgurl())){
                    users.setImgurlFull(prefix + users.getImgurl());
                }
            }
            shop.setUsersList(usersList);
        }
        return pageData;
    }
    @Override
    public Shop shopDetail(Long id,Long memberId) {
        Member member = memberMapper.selectById(memberId);
        if(Objects.isNull(member)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到用户信息");
        }
        QueryWrapper<Shop> queryWrapper = new QueryWrapper<Shop>();
        //如果人员没有经纬度信息,则不查询距离
        if(Objects.nonNull(member.getLatitude())&&Objects.nonNull(member.getLongitude())){
            queryWrapper.select("ID,NAME,ADDRESS,PROVINCE_NAME,CITY_NAME,AREA_NAME,TOWN,AREA_NAME,LEGAL_PHONE," +
                    " CONVERT (ST_Distance_Sphere (point ("+member.getLongitude()+", "+member.getLatitude()+" ), point ( LONGITUDE, LATITUDE )) /1000,decimal(15,2)) as distance ");
        }
        queryWrapper.eq("id",id);
        Shop shop = shopMapper.selectOne(queryWrapper);
        if(Objects.isNull(shop)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) +
                StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode());
        List<Users> usersList =usersMapper.selectList(new QueryWrapper<Users>().lambda().eq(Users::getDepartmentId,shop.getId())
                .eq(Users::getIsdeleted,Constants.ZERO)
                .eq(Users::getStatus,Constants.ONE)
                .eq(Users::getType,Constants.ZERO)
        );
        for (Users users:usersList) {
            if(StringUtils.isNotBlank(users.getImgurl())){
                users.setImgurlFull(prefix + users.getImgurl());
            }
        }
        shop.setUsersList(usersList);
        return shop;
    }
}
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
@@ -1,6 +1,7 @@
package com.doumee.service.business.impl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.hutool.core.date.DateUnit;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.biz.zbom.model.IamUserRoleModel;
import com.doumee.biz.zbom.model.IamUserTypeModel;
@@ -13,7 +14,10 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.GeneratePicUtil;
import com.doumee.core.utils.Utils;
import com.doumee.core.utils.tyyun.TyyZosUtil;
import com.doumee.dao.admin.request.ShopImport;
import com.doumee.dao.admin.request.UserImport;
import com.doumee.dao.business.ShopMapper;
@@ -41,10 +45,8 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -600,5 +602,69 @@
        return null;
    }
    @Override
    public     String getUserCard(Users users){
        String path = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.RESOURCE_PATH).getCode();
        String folder = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.USERS_FILE).getCode();
        String defualtHeader = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.USER_CARD_HEADER_IMG).getCode();
        String defualtPhone = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.USER_CARD_PHONE_IMG).getCode();
        String defualtAddr = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.USER_CARD_ADDR_IMG).getCode();
        String imgurl =StringUtils.isNotBlank(users.getImgurl())?path+users.getImgurl():defualtHeader;
        String qrcode =StringUtils.isNotBlank(users.getQrcodeImg())?path+users.getQrcodeImg():null;
        InputStream inputStream = GeneratePicUtil.generateUserCardImg(
                imgurl
                ,qrcode
                ,StringUtils.defaultString(users.getName(),"-")
                ,"导购"
                ,StringUtils.defaultString(users.getPhone(),"-")
                ,StringUtils.defaultString(users.getShopAddress(),"-")
                ,"ZBOM志邦家居|"+ StringUtils.defaultString(users.getShopName(),"-")
                ,defualtPhone
                ,defualtAddr);
        TyyZosUtil obs = new TyyZosUtil( systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ENDPOINT).getCode(),
                systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ACCESS_ID).getCode(),
                systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.ACCESS_KEY).getCode());
        String fileName =folder+ DateUtil.getNowShortDate()+"/"+UUID.randomUUID().toString() + ".jpg";
        if (obs.uploadInputstreamObject(inputStream,systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.BUCKETNAME).getCode(), fileName)) {
            return  path+fileName;
        }
        return null;
    }
    @Override
    public Users usersDetail(Long userId){
        Users users = usersMapper.selectById(userId);
        if(Objects.isNull(users)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        String prefix = StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode()) +
                StringUtils.trimToNull(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.USERS_FILE).getCode());
        if(StringUtils.isNotBlank(users.getImgurl())){
            users.setImgurlFull(prefix + users.getImgurl());
        }
        if(StringUtils.isNotBlank(users.getQrcodeImg())){
            users.setQrcodeImgFull(prefix + users.getQrcodeImg());
        }
        if(StringUtils.isNotBlank(users.getCompanyQrcodeImg())){
            users.setCompanyQrcodeImgFull(prefix + users.getCompanyQrcodeImg());
        }
        if(Objects.nonNull(users.getDepartmentId())){
            Shop shop = shopMapper.selectById(users.getDepartmentId());
            if(Objects.nonNull(shop)){
                users.setShopName(shop.getName());
                if(StringUtils.isNotBlank(shop.getAddress())){
                    users.setShopAddress(shop.getAddress());
                }else{
                    users.setShopAddress(shop.getProvinceName()+shop.getCityName()+shop.getAreaName()+shop.getTown()+shop.getRegAddr());
                }
            }
        }
        return users;
    }
}
server/web/src/main/java/com/doumee/api/web/ApiController.java
@@ -2,8 +2,13 @@
import com.doumee.config.Jwt.JwtTokenUtil;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Users;
import com.doumee.service.business.MemberService;
import com.doumee.service.business.UsersService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.ptg.MemAreaPtg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -17,6 +22,15 @@
@Slf4j
public class ApiController {
    @Autowired
    UsersService usersService;
    @Autowired
    MemberService memberService;
    /**
     * æ˜¯å¦å¼€å‘者
     */
    @Value("${debug_model}")
    private Boolean isDebug;
    /**
     * å¾—到request对象
@@ -38,5 +52,34 @@
        Object obj = this.getRequest().getAttribute(JwtTokenUtil.UserId_Name);
        return obj != null ? (Long) obj : null;
    }
    protected Long getUserId() {
        if(isDebug){
            return 2L;
        }
        Object obj = this.getRequest().getAttribute(JwtTokenUtil.UserId_Name);
        return obj != null ? (Long) obj : null;
    }
    protected Users getLoginUserInfo() {
      Long userId = getUserId();
      if(userId== null){
          return null;
      }
        Users user = usersService.findById(userId);
      return user;
    }
    protected Member getLoginMemberInfo() {
      Long userId = getMemberId();
      if(userId== null){
          return null;
      }
        Member user = memberService.findById(userId);
      return user;
    }
    protected Long getUserType() {
        Object obj = this.getRequest().getAttribute(JwtTokenUtil.UserType);
        return obj != null ? (Long) obj : null;
    }
}
server/web/src/main/java/com/doumee/api/web/CatalogApi.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
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;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/7/10 18:06
 */
@Api(tags = "分类和标签相关接口")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/catalog")
@Slf4j
public class CatalogApi extends ApiController{
    @Autowired
    public ZbomZhongTaiService zbomZhongTaiService;
    @Autowired
    public SmsEmailService smsEmailService;
    @ApiOperation(value = "C端小程序-获取首页志说装修四个模块类目数据", notes = "获取首页志说装修四个模块类目数据")
    @PostMapping("/getZSZXCatalogs")
    public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() {
        return  ApiResponse.success(zbomZhongTaiService.getZSZXCatalogs());
    }
}
server/web/src/main/java/com/doumee/api/web/CustomerApi.java
@@ -4,19 +4,22 @@
import com.doumee.config.annotation.LoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.CustomerLog;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.Shop;
import com.doumee.dao.business.model.Users;
import com.doumee.dao.web.reqeust.*;
import com.doumee.dao.web.response.AccountResponse;
import com.doumee.dao.web.response.BjParamConfigResponse;
import com.doumee.service.business.BjParamService;
import com.doumee.service.business.CustomerService;
import com.doumee.service.business.MemberService;
import com.doumee.service.business.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -29,7 +32,7 @@
 * @Author : Rk
 * @create 2024/7/10 14:03
 */
@Api(tags = "客户端小程序用户业务")
@Api(tags = "【C端小程序】用户业务")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/customer")
@@ -48,6 +51,12 @@
    @Autowired
    private ZbomCRMService zbomCRMService;
    @Autowired
    private ShopService shopService;
    @Autowired
    private UsersService usersService;
    @ApiOperation(value = "客户端小程序登陆", notes = "客户端小程序")
    @GetMapping("/wxLoginCustomer")
@@ -146,5 +155,40 @@
        return  ApiResponse.success("操作成功");
    }
    @LoginRequired
    @ApiOperation(value = "门店列表", notes = "客户端小程序")
    @PostMapping("/shopPage")   @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<PageData<Shop>> shopPage (@RequestBody PageWrap<Shop> pageWrap) {
        return ApiResponse.success(shopService.queryShopByLL(pageWrap));
    }
    @LoginRequired
    @ApiOperation(value = "门店详情", notes = "客户端小程序")
    @GetMapping("/shopDetail")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "Long", name = "shopId", value = "门店主键", required = true)
    })
    public ApiResponse<Shop> shopDetail (@RequestParam Long shopId) {
        Long memberId = this.getMemberId();
        return ApiResponse.success(shopService.shopDetail(shopId,memberId));
    }
    @LoginRequired
    @ApiOperation(value = "导购详情", notes = "客户端小程序")
    @GetMapping("/usersDetail")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "Long", name = "userId", value = "导购主键", required = true)
    })
    public ApiResponse<Users> usersDetail (@RequestParam Long userId) {
        return ApiResponse.success(usersService.usersDetail(userId));
    }
}
server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package com.doumee.api.web;
import com.doumee.biz.zbom.ZbomZhongTaiService;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.web.response.ZSZXCatalogResponse;
import com.doumee.service.business.SmsEmailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/7/10 18:06
 */
@Api(tags = "【B端小程序】客户管理接口")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/customer")
@Slf4j
public class CustomerManageApi extends ApiController{
    @Autowired
    public ZbomZhongTaiService zbomZhongTaiService;
    @Autowired
    public SmsEmailService smsEmailService;
    @ApiOperation(value = "C端小程序-获取首页志说装修四个模块类目数据", notes = "获取首页志说装修四个模块类目数据")
    @PostMapping("/getZSZXCatalogs")
    public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() {
        return  ApiResponse.success(zbomZhongTaiService.getZSZXCatalogs());
    }
}
server/web/src/main/java/com/doumee/api/web/PersonnelApi.java
@@ -15,10 +15,7 @@
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
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.
@@ -26,7 +23,7 @@
 * @Author : Rk
 * @create 2024/7/10 18:06
 */
@Api(tags = "员工端小程序用户业务")
@Api(tags = "【B端小程序】用户业务")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/personnel")
@@ -86,4 +83,11 @@
        return  ApiResponse.success("操作成功");
    }
    @ApiOperation(value = "获取个人名片", notes = "员工端小程序")
    @PostMapping("/getUserCard")
    public ApiResponse<String> getUserCard() {
        return  ApiResponse.success(usersService.getUserCard(this.getLoginUserInfo()));
    }
}
server/web/src/main/java/com/doumee/api/web/PublicController.java
@@ -3,12 +3,16 @@
import com.alibaba.fastjson.JSONObject;
import com.doumee.api.BaseController;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.annotation.LoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.FtpUtil;
import com.doumee.core.utils.aliyun.ALiYunUtil;
import com.doumee.core.utils.tyyun.TyyZosUtil;
import com.doumee.dao.business.model.Users;
import com.doumee.dao.system.model.SystemDictData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -46,6 +50,20 @@
    private SystemDictDataBiz systemDictDataBiz;
    @LoginRequired
    @ApiOperation(value = "字典值查询")
    @GetMapping("/getDictData")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "大类编码", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "String", name = "label", value = "子类编码", required = true)
    })
    public ApiResponse<SystemDictData> getDictData (@RequestParam String code,@RequestParam String label) {
        SystemDictData systemDictData = systemDictDataBiz.queryByCode(code,label);
        return ApiResponse.success(systemDictData);
    }
    @ApiOperation(value = "上传", notes = "上传", httpMethod = "POST", position = 6)
    @ApiImplicitParams({
        @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class),
server/web/src/main/java/com/doumee/config/shiro/ShiroAuthFilter.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroCache.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroCacheManager.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroConfig.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroCredentialsMatcher.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroRealm.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroSessionDAO.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java
ÎļþÒÑɾ³ý
server/web/src/main/java/com/doumee/config/shiro/ShiroTokenManager.java
ÎļþÒÑɾ³ý