Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
已添加26个文件
已删除10个文件
已修改44个文件
已重命名1个文件
| | |
| | | > |
| | | <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/> |
| | |
| | | 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, |
| | |
| | | beanName: '', |
| | | module: '' |
| | | }, |
| | | pausing:false, |
| | | running:false, |
| | | resuming:false, |
| | | pausing: false, |
| | | running: false, |
| | | resuming: false, |
| | | room: [] |
| | | } |
| | | }, |
| | | provide() { |
| | | provide () { |
| | | return { |
| | | room: () => this.room |
| | | } |
| | |
| | | pauseById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æå该任å¡å?') |
| | | .then(() => { |
| | | this.pausing = true |
| | | this.api.paustById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æåæå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.pausing = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | .then(() => { |
| | | this.pausing = true |
| | | this.api.pauseById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æåæå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.pausing = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | resumeById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ¢å¤è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.resuming = true |
| | | this.api.resumeById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ¢å¤æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.resuming = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | .then(() => { |
| | | this.resuming = true |
| | | this.api.resumeById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ¢å¤æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.resuming = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | runById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ§è¡ä¸æ¬¡è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.running = true |
| | | this.api.runOnceById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ§è¡æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.running = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | .then(() => { |
| | | this.running = true |
| | | this.api.runOnceById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ§è¡æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.running = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation( "æ§è¡ä¸æ¬¡") |
| | | @GetMapping("RequiresPermissions") |
| | | @GetMapping("/runOnce/{id}") |
| | | @RequiresPermissions("business:quartz:update") |
| | | public ApiResponse runOnce(@PathVariable("id") Integer id) { |
| | | quartzJobService.runOnce(id) ; return ApiResponse.success(null); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | @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 ); |
| | | } |
| | |
| | | package com.doumee.biz.zbom; |
| | | |
| | | import com.doumee.biz.zbom.model.CrmCustomerSubmmitModel; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | 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; |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ZbomCRMServiceImpl implements ZbomCRMService { |
| | | |
| | | @Autowired |
| | |
| | | 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"))) { |
| | | status = 1; |
| | | crmInfo="æäº¤æå"; |
| | | success =0; |
| | | }else{ |
| | | status = 2; |
| | | crmInfo="æäº¤å¤±è´¥["+ result+"]"; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | crmInfo+= e.getMessage(); |
| | | }finally { |
| | | saveInterfaceLog(url,"å¿é¦CRM客æ·çèµä¿¡æ¯æäº¤",param,success,result); |
| | | } |
| | | 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="æäº¤æå"; |
| | | }else{ |
| | | status = 2; |
| | | crmInfo="æäº¤å¤±è´¥crmé
ç½®æè¯¯ï¼appid:["+ appid+"]"+"url:["+ urlStr+"]"; |
| | | crmInfo="æäº¤å¤±è´¥["+ result!=null?result.getMsg():"æ¥å£è¯·æ±å¤±è´¥ï¼"+"]"; |
| | | } |
| | | 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; |
| | |
| | | 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(),"è·å跳转å°å失败å¦ï¼"); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯åæ¥ |
| | |
| | | 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(); |
| | | } |
| | |
| | | ZTConstants.IntegerName.USER_LOGOUT_NAME, |
| | | param.getToken(), |
| | | param.getUserType(), |
| | | JSONObject.toJSONString(param )); |
| | | JSONObject.toJSONString(param ), |
| | | new TypeReference<ZTBaseResponse<Object>>(){}); |
| | | if(result!=null ){ |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param){ |
| | | ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest( |
| | | |
| | | ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest( |
| | | ZTConstants.IntegerUrl.CATALOG_LIST_URL, |
| | | ZTConstants.IntegerName.CATALOG_LIST_NAME, |
| | | param.getToken(), |
| | | param.getUserType(), |
| | | JSONObject.toJSONString(param )); |
| | | JSONObject.toJSONString(param ), |
| | | new TypeReference<ZTBaseResponse<List<ZTCatalogInfoResponse>>>(){}); |
| | | if(result!=null){ |
| | | return result.getData(); |
| | | } |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | @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(); |
| | | } |
| | |
| | | ZTConstants.IntegerName.COLLECT_DO_NAME, |
| | | param.getToken(), |
| | | param.getUserType(), |
| | | JSONObject.toJSONString(param )); |
| | | JSONObject.toJSONString(param ), |
| | | new TypeReference<ZTBaseResponse<Object>>(){}); |
| | | if(result!=null ){ |
| | | return true; |
| | | } |
| | |
| | | ZTConstants.IntegerName.LIKE_DO_NAME, |
| | | param.getToken(), |
| | | param.getUserType(), |
| | | JSONObject.toJSONString(param )); |
| | | JSONObject.toJSONString(param ), |
| | | new TypeReference<ZTBaseResponse<Object>>(){}); |
| | | if(result!=null ){ |
| | | return true; |
| | | } |
| | |
| | | ZTConstants.IntegerName.SHARE_DO_NAME, |
| | | param.getToken(), |
| | | param.getUserType(), |
| | | JSONObject.toJSONString(param )); |
| | | JSONObject.toJSONString(param ), |
| | | new TypeReference<ZTBaseResponse<Object>>(){}); |
| | | if(result!=null ){ |
| | | return true; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | * @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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.biz.zbom.model.crm; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * crm请æ±å
Œ
±åæ° |
| | | */ |
| | | @Data |
| | | public class CRMBaseRequst { |
| | | /** |
| | | * ç¶çº§ç¼ç |
| | | */ |
| | | private Integer timestamp; |
| | | private String sign; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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/CrmCustomerInfoModel.java ÐÞ¸Ä |
| | |
| | | package com.doumee.biz.zbom.model; |
| | | package com.doumee.biz.zbom.model.crm; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | 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 = "å§å") |
| | |
| | | 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; |
| | |
| | | private String openid; |
| | | @ApiModelProperty(value = "ç»ç«¯ä¿¡æ¯") |
| | | private String terminal; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 ;//å°å详æ
|
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | |
| | | } |
| | |
| | | package com.doumee.biz.zbom.model.zhongtai; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | |
| | | /** |
| | | * ç¶çº§ç¼ç |
| | | */ |
| | | |
| | | @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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.biz.zbom.model.zhongtai; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | |
| | | 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"; |
| | |
| | | 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 ="å
容æ¶è"; |
| | |
| | | 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 ="è·åè¡ä¸ºè½¨è¿¹"; |
| | | } |
| | | } |
| | |
| | | @Data |
| | | public class ZTContentInfoRequest extends ZTBaseRequst{ |
| | | /** |
| | | * 临æ¶ç¥¨æ® |
| | | * å
å®¹ä¸»é® |
| | | */ |
| | | private String articleId; |
| | | private String id; |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | | |
| | |
| | | */ |
| | | @Data |
| | | public class ZTUserInfoUpdateRequest extends ZTBaseRequst{ |
| | | |
| | | /** |
| | | * å°åï¼çå¸åºç宿´åç¬¦ä¸²ï¼æ¯å¦"广ä¸ç广å·å¸ç½äºåº" |
| | | */ |
| | |
| | | */ |
| | | private String appCode; |
| | | /** |
| | | * åºç¨IDï¼å°ç¨åºçAppID å¿
é |
| | | * åºç¨IDï¼å°ç¨åºçAppID |
| | | */ |
| | | private String appId; |
| | | /** |
| | |
| | | */ |
| | | private String name; |
| | | /** |
| | | * OpenIDï¼å¾®ä¿¡ç¨æ·çOpenID å¿
é |
| | | * æµç§° |
| | | */ |
| | | private String nickname; |
| | | /** |
| | | * OpenIDï¼å¾®ä¿¡ç¨æ·çOpenID |
| | | */ |
| | | private String openId; |
| | | /** |
| | |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * å¹³å°ç±»åï¼å°ç¨åºä¼ mp-weixinï¼padç«¯ä¼ web-pad å¿
é |
| | | * å¹³å°ç±»åï¼å°ç¨åºä¼ mp-weixinï¼padç«¯ä¼ web-pad |
| | | */ |
| | | private String platform; |
| | | /** |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | * çå¸åºè¯¦æ
è¿å |
| | | */ |
| | | @Data |
| | | public class ZTAreaInfoResponse { |
| | | public class ZTAreaInfoResponse implements Serializable { |
| | | /** |
| | | * id":â11000000000æ¥" |
| | | * pid":"1" |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class ZTBaseResponse<T> { |
| | | public class ZTBaseResponse<T> implements Serializable { |
| | | /** |
| | | *æ¯å¦æå,true:æå;false:失败 |
| | | */ |
| | |
| | | /** |
| | | * æ¶æ¯ç ,200:æå;å
¶ä»code:失败 |
| | | */ |
| | | private String code; |
| | | private Integer code; |
| | | /** |
| | | * æç¤ºæ¶æ¯ |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * ç¨æ·éåº |
| | | */ |
| | | @Data |
| | | public class ZTCatalogInfoResponse { |
| | | public class ZTCatalogInfoResponse implements Serializable { |
| | | /** |
| | | * ç®å½å¯ä¸ç¼ç |
| | | */ |
| | |
| | | /** |
| | | * ç®å½æåº |
| | | */ |
| | | private String sort; |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * åç®å½ |
| | | */ |
| | | private List<ZTCatalogInfoResponse> childCatalog; |
| | | private List<ZTTagInfoResponse> childTagList; |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * ç¨æ·éåº |
| | | */ |
| | | @Data |
| | | public class ZTCatalogTagTypeResponse { |
| | | public class ZTCatalogTagTypeResponse implements Serializable { |
| | | /** |
| | | * åç®å½ |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·éåº |
| | | */ |
| | | @Data |
| | | public class ZTCollectResponse { |
| | | public class ZTCollectResponse implements Serializable { |
| | | /** |
| | | * æ¶èç±»åï¼äº§åï¼æ¡ä¾ï¼å®æ¯ å¿
é |
| | | */ |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | * å
容详æ
è¿å |
| | | */ |
| | | @Data |
| | | public class ZTContentInfoResponse { |
| | | public class ZTContentInfoResponse implements Serializable { |
| | | /** |
| | | * ä½è
|
| | | */ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class ZTUserGetTokenResponse { |
| | | public class ZTUserGetTokenResponse implements Serializable { |
| | | /** |
| | | *ç¨æ·ä¸´æ¶ç¥¨æ® |
| | | */ |
| | |
| | | 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天 |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String,Object> redisTemplate; |
| | | |
| | | /** |
| | | * æ¯å¦å¼åè
|
| | | */ |
| | | @Value("${debug_model}") |
| | | private Boolean isDebug; |
| | | |
| | | /** |
| | | * æ·»å æ¦æªå¨ |
| | |
| | | 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(),"æªç»å½"); |
| | |
| | | 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) { |
| | |
| | | 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(),"æªç»å½"); |
| | |
| | | public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ; |
| | | public static final String HK_ROOTORG_NAME ="HK_ROOTORG_NAME" ; |
| | | public static final String REDIS_TOKEN_KEY = "token_"; |
| | | public static final String CUSTOMER = "CUSTOMER"; |
| | | public static final String CUSTOMER = "CUSTOMER"; |
| | | public static final String BUSINESS = "BUSINESS"; |
| | | |
| | | |
| | | //被æè®¿äººä¿¡æ¯æ ¡éªæ¹å¼ï¼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"; |
| | |
| | | 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 { |
| | |
| | | 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"; |
| | | //åéä¼è®®å¼å§ 宿¶æåå¤å°åéåé |
| | |
| | | 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"; |
| | |
| | | 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"; |
| | |
| | | * @return String |
| | | * @throws Exception |
| | | */ |
| | | public static String getNowShortDate() throws Exception { |
| | | public static String getNowShortDate() { |
| | | String nowDate = ""; |
| | | try { |
| | | java.sql.Date date = null; |
| | |
| | | nowDate = sdfShort.format(date); |
| | | return nowDate; |
| | | } catch (Exception e) { |
| | | throw e; |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * çæå享å¾ç |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | |
| | | public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage) throws IOException { |
| | | public static InputStream bufferedImageToInputStream(BufferedImage backgroundImage) { |
| | | return bufferedImageToInputStream(backgroundImage, "jpg"); |
| | | } |
| | | |
| | |
| | | * @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 |
| | |
| | | ImageIO.write(backgroundImage, format, imOut); |
| | | InputStream is = new ByteArrayInputStream(bs.toByteArray()); |
| | | return is; |
| | | }catch (Exception e){ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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); |
| | |
| | | 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; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | @ApiModelProperty(value = "æå±å
³èSç ", example = "1") |
| | | @ExcelColumn(name="æå±å
³èSç ") |
| | | private String scode; |
| | | @ApiModelProperty(value = "注åå°" ) |
| | | @ApiModelProperty(value = "注åå°(IAM)" ) |
| | | @ExcelColumn(name="注åå°") |
| | | private String regAddr; |
| | | @ApiModelProperty(value = "æ³äººèº«ä»½è¯å·" ) |
| | |
| | | @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; |
| | |
| | | @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; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="æå¡å®¢æ·æ°") |
| | | private Integer costomerNum; |
| | | |
| | | @ApiModelProperty(value = "ä»ä¸å¹´æ(yyyy-MM)") |
| | | @ExcelColumn(name="ä»ä¸å¹´æ(yyyy-MM)") |
| | | @ApiModelProperty(value = "ä»ä¸å¹´ä»½") |
| | | @ExcelColumn(name="ä»ä¸å¹´æ") |
| | | private String jobDate; |
| | | |
| | | @ApiModelProperty(value = "å®£ä¼ è¯") |
| | |
| | | @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="é®ç®±") |
| | |
| | | @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; |
| | | |
| | | } |
| | |
| | | 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.*; |
| | |
| | | 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) ; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | |
| | | 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(){ |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | void bindingOpenid(String code,Long userId); |
| | | |
| | | String importBatch(MultipartFile file); |
| | | |
| | | Users usersDetail(Long userId); |
| | | |
| | | String getUserCard(Users users); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private UsersMapper usersMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | |
| | | |
| | | @Override |
| | | public AccountResponse wxLogin(String code){ |
| | | // 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; |
| | | 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失败ï¼è¯·è系管çå"); |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().eq("OPENID", openId)); |
| | | if (member == null) { |
| | | member = new Member(); |
| | |
| | | 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 |
| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ´æ°ä¸å°tokenä¿¡æ¯ |
| | | * @param member |
| | | */ |
| | | public void updUserZTToken(Member member){ |
| | | //å¦ææ æææ/å·²è¿æ éæ°è·å |
| | | if(Objects.isNull(member.getTokenDate()) || member.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(member.getOpenid()); |
| | | ZTUserGetTokenResponse ztUserGetTokenResponse = zbomZhongTaiService.getUserToken(param); |
| | | if(Objects.nonNull(ztUserGetTokenResponse)){ |
| | | member.setToken(ztUserGetTokenResponse.getToken()); |
| | | //TODO ææ è¿ææ¥æ |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getToken,ztUserGetTokenResponse.getToken()) |
| | | .eq(Member::getId,member.getId())); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ä¸å°TOKENè·å失败ï¼è¯·è系管çå"); |
| | | |
| | | |
| | | 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(); |
| | | //æ¥è¯¢APPID |
| | | String appId = systemDictDataBiz.queryByCode(Constants.WX_MINI_CONFIG,Constants.WX_APPID_CUSTOMER).getCode(); |
| | | param.setAppId(appId); |
| | | param.setOpenId(member.getOpenid()); |
| | | ZTUserGetTokenResponse ztUserGetTokenResponse = zbomZhongTaiService.getUserToken(param); |
| | | if(Objects.nonNull(ztUserGetTokenResponse)){ |
| | | member.setToken(ztUserGetTokenResponse.getToken()); |
| | | //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(),"åæ°é误"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 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){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | import java.util.concurrent.Callable; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.Future; |
| | | |
| | | /** |
| | | * å¿é¦ç»ç»ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @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; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | @Slf4j |
| | | public class ApiController { |
| | | |
| | | @Autowired |
| | | UsersService usersService; |
| | | @Autowired |
| | | MemberService memberService; |
| | | /** |
| | | * æ¯å¦å¼åè
|
| | | */ |
| | | @Value("${debug_model}") |
| | | private Boolean isDebug; |
| | | |
| | | /** |
| | | * å¾å°request对象 |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.*; |
| | |
| | | * @Author : Rk |
| | | * @create 2024/7/10 14:03 |
| | | */ |
| | | @Api(tags = "客æ·ç«¯å°ç¨åºç¨æ·ä¸å¡") |
| | | @Api(tags = "ãC端å°ç¨åºãç¨æ·ä¸å¡") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping("/web/customer") |
| | |
| | | |
| | | @Autowired |
| | | private ZbomCRMService zbomCRMService; |
| | | |
| | | @Autowired |
| | | private ShopService shopService; |
| | | |
| | | @Autowired |
| | | private UsersService usersService; |
| | | |
| | | @ApiOperation(value = "客æ·ç«¯å°ç¨åºç»é", notes = "客æ·ç«¯å°ç¨åº") |
| | | @GetMapping("/wxLoginCustomer") |
| | |
| | | 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)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |
| | |
| | | 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. |
| | |
| | | * @Author : Rk |
| | | * @create 2024/7/10 18:06 |
| | | */ |
| | | @Api(tags = "å工端å°ç¨åºç¨æ·ä¸å¡") |
| | | @Api(tags = "ãB端å°ç¨åºãç¨æ·ä¸å¡") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping("/web/personnel") |
| | |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·å个人åç", notes = "å工端å°ç¨åº") |
| | | @PostMapping("/getUserCard") |
| | | public ApiResponse<String> getUserCard() { |
| | | return ApiResponse.success(usersService.getUserCard(this.getLoginUserInfo())); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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), |