server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -113,6 +113,15 @@ public static final String WX_PLATFORM = "WX_PLATFORM"; public static final String WX_PLATFORM_ACCESS_TOKEN = "WX_PLATFORM_ACCESS_TOKEN"; public static final String WX_PLATFORM_APPID = "WX_PLATFORM_APPID"; public static final String WX_PLATFORM_SECRET = "WX_PLATFORM_SECRET"; public interface RedisKeys { public static final String GOODSORDER_KEY = "ordercode_"; @@ -170,9 +179,652 @@ return d.longValue(); } public interface UserRelObjType{ int objTypeRoom = 0; int objTypeBook = 1; } public interface RoomRecordObjType{ int objTypeRoom = 0;//管çåå¼é¨ int objTypeBook_in = 1;//åä¼äººåå¼é¨ int objTypeBook_out = 2;//访客å¼é¨ } public interface memberType{ int visitor = 0;//æ®é访客 int lw_visitor = 1;//å³å¡è®¿å®¢ int internal = 2;//å é¨äººå } public static void main(String[] args) { String t = URLDecoder.decode("https://lsqw.gtja.com/qwcos/v-index.html#/loginforProperty?corpId=ww4b7aefafeb430e4b&corpId=ww4b7aefafeb430e4b&agentId=1000005&agentId=1000005&fromRoute=&userCode=013561&userCode=&userId=zz&userId=&encryptUserCode=&custQwId=wmIUuSDgAAR8MhtVY8w90EyKltvoK5fA&custCode=&openId=op1wZwD1dKuBQywmWWS5957zUOJI&name=%E8%B9%84%E8%B9%84&headUrl=http%3A%2F%2Fwx.qlogo.cn%2Fmmhead%2FQ3auHgzwzM4QlibSOAvYcvRMdsoyF3Ua7duLOYSJfB3dsGsYxIYonBw%2F0&dbHeadUrl=https%3A%2F%2Ftgf.gtja.com%2Ff%2F%2Fqwoms%2F2022512%2Fqwoms_1652332606613_8.jpg"); System.out.println(t); } /** * ç¨æ·ç±»å */ public enum UserType { SYSTEM(0, "ç³»ç»ç¨æ·", "管çå",Arrays.asList(0)), ORG(1, "æºæ", "æºæ",Arrays.asList(1)), CREATION(2, "åä½ä¸å¿", "åä½ä¸å¿",Arrays.asList(2)) ; // æååé private String name; private int key; private List<Integer> historyStatus; private String noteinfo;// æè¿° // æé æ¹æ³ UserType(int key, String name, String noteinfo,List<Integer> historyStatus) { this.name = name; this.key = key; this.noteinfo = noteinfo; this.historyStatus=historyStatus; } // æ®éæ¹æ³ public static String getName(int index) { for (UserType c : UserType.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (UserType c : UserType.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // æ®éæ¹æ³ public static List<Integer> getHistoryStatus(int index) { for (UserType c : UserType.values()) { if (c.getKey() == index) { return c.historyStatus; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public List<Integer> getHistoryStatus() { return historyStatus; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * æ°æ®ç¶ææä¸¾ * */ public enum Status { /** ç¨æ·å¯ç¨ç¦ç¨æä¸¾å¼*/ ENABLE(0,"æ£å¸¸"), DISABLE(1,"ç¦ç¨"); private Integer value; private String des; Status(Integer value, String des) { this.value = value; this.des = des; } public Integer getValue() { return value; } public void setValue(Integer value) { this.value = value; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } } /** * å ³è对象类å 0æ´»å¨è½®æå¾ 1æ´»å¨è¯¦æ å¾ 2é¨åºè¯ä»·3订åè¯ä»· 4å¹³å°ååè½®æ 5æ¢åºå¤å¾ 6åºéºæ°é²äºå¤å¾ 7åå®¶å¾çå¤å¾ */ public enum MultiFile{ ACTIVITY_ROTATION(0, "æ´»å¨è½®æå¾", "æ´»å¨è½®æå¾"), ACTIVITY_DETAIL(1, "æ´»å¨è¯¦æ å¾", "æ´»å¨è¯¦æ å¾"), SHOP_APPRAISE(2, "é¨åºè¯ä»·", "é¨åºè¯ä»·"), ORDER_APPRAISE(3, "订åè¯ä»·", "订åè¯ä»·"), PLATFORM_GOOD_ROTATION(4, "å¹³å°ååè½®æ", "å¹³å°ååè½®æ"), TANDIAN_PICTURE(5, "æ¢åºå¤å¾", "æ¢åºå¤å¾"), SHOP_HOT_PICTURE(6, "åºéºæ°é²äºå¤å¾", "åºéºæ°é²äºå¤å¾"), SHOP_PICTURE(7, "åå®¶å¾çå¤å¾", "åå®¶å¾çå¤å¾"), AFTERSALE_APPLY(8, "ç³è¯·å®åè¡¥å 说æéä»¶", "ç³è¯·å®åè¡¥å 说æéä»¶"), AFTERSALE_KD(9, "ç³è¯·å®åé®å¯è¯´æéä»¶", "ç³è¯·å®åé®å¯è¯´æéä»¶"), ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ MultiFile(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (MultiFile c : MultiFile.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (MultiFile c : MultiFile.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * 订å管ç * ç¶æ 0ç³è¯·ä¸ 1å·²æ¯ä» 2已忶 */ public enum ActivitySignupStatus{ APPLY_ING(0, "ç³è¯·ä¸", "ç³è¯·ä¸"), PAY_DONE(1, "å·²æ¯ä»", "å·²æ¯ä»"), CANCEL(2, "已忶", "已忶"), ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ ActivitySignupStatus(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (ActivitySignupStatus c : ActivitySignupStatus.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (ActivitySignupStatus c : ActivitySignupStatus.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * å®åç¶æ * ç¶æ 0å¾ å¤ç 1å¾ é®å¯ 2å·²å¯åº 3å家已鿬¾ 4åå®¶å·²åè´§5å®å已宿6åå®¶æç» 7已忶 */ public enum AftersaleStatus{ APPLY_ING(0, "å¾ å¤ç", "å¾ å¤ç"), WAIT_SEND(1, "å¾ é®å¯", "å¾ é®å¯"), SENDED(2, "客æ·å·²å¯åº", "客æ·å·²å¯åº"), REFUND(3, "已鿬¾", "已鿬¾"), SHOP_SENDED(4, "å¹³å°å·²åè´§", "å¹³å°å·²åè´§"), DONE(5, "å®å已宿", "å®å已宿"), SHOP_REFUSE(6, "å·²æç»", "平尿ç»"), CANCEL(7, "已忶", "客æ·åæ¶å®å"), ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ AftersaleStatus(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (AftersaleStatus c : AftersaleStatus.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (AftersaleStatus c : AftersaleStatus.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * å®åç±»å * å®åç±»å 0鿬¾ 1éè´§éæ¬¾ 2æ¢è´§ */ public enum AftersaleType{ TK(0, "鿬¾", "鿬¾"), THTK(1, "éè´§éæ¬¾", "éè´§éæ¬¾"), HH(2, "æ¢è´§", "æ¢è´§"), ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ AftersaleType(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (AftersaleType c : AftersaleType.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (AftersaleType c : AftersaleType.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * 订å管ç * ç¶æ 0å¾ æ¯ä» 1å¾ åè´§ 2å¾ æ¶è´§ 3交æå®æ 4å·²å ³é 5é¨ååè´§ */ public enum OrderStatus{ WAIT_PAY(0, "å¾ æ¯ä»", "å¾ æ¯ä»"), PAY_DONE(1, "å¾ åè´§", "å·²æ¯ä»ä»£åè´§"), WAIT_RECEIVE(2, "å¾ æ¶è´§", "å·²åè´§å¾ æ¶è´§"), DONE(3, "交æå®æ", "交æå®æ"), CLOSE(4, "å·²å ³é", "å·²å ³é"), PART_DONE(5, "é¨ååè´§", "é¨ååè´§"), ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ OrderStatus(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (OrderStatus c : OrderStatus.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (OrderStatus c : OrderStatus.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } /** * 订åç±»å * 订åç±»å 0å¹³å°åå 1åè±åå 2åå¡è®¡åç¼ç */ public enum OrderType{ ADMINPLAT(0, "å¹³å°åå ", "å¹³å°åå "), KADOUPLAT(1, "åè±åå", "åè±åå"), COFFERPLAN(2, "2åå¡è®¡åç¼ç ", "2åå¡è®¡åç¼ç ") ; // æååé private String name; private int key; private String noteinfo;// æè¿° // æé æ¹æ³ OrderType(int key, String name, String noteinfo) { this.name = name; this.key = key; this.noteinfo = noteinfo; } // æ®éæ¹æ³ public static String getName(int index) { for (OrderType c : OrderType.values()) { if (c.getKey() == index) { return c.name; } } return null; } // æ®éæ¹æ³ public static String getInfo(int index) { for (OrderType c : OrderType.values()) { if (c.getKey() == index) { return c.noteinfo; } } return null; } // get set æ¹æ³ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getKey() { return key; } public void setKey(int key) { this.key = key; } public String getNoteinfo() { return noteinfo; } } public enum ShareType{ // 0æ´»å¨1æ¢åº2å¨è¯¢3åºéº 4åå5å享éè¯·æµ·æ¥ SHARE_ACTIVITY_ACTIVITY(0,"æ´»å¨","æ´»å¨"), SHARE_ACTIVITY_VISITSHOP(1,"æ¢åº","å¨è¯¢"), SHARE_ACTIVITY_NEW(2,"å¨è¯¢","å¨è¯¢"), SHARE_SHOP(3,"åºéº","åºéº" ), SHARE_GOODS(4,"åå","åå"), SHARE_POSTER(5,"å享é请海æ¥","å享é请海æ¥") ; private Integer key; private String name; private String des; ShareType(Integer key, String name, String des) { this.key = key; this.name = name; this.des = des; } public Integer getKey() { return key; } public void setKey(Integer key) { this.key = key; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } } /** * åè±ä»»å¡ */ public enum CoffeeBeanTask{ SIGN_BOARD(1,"SIGN_BOARD","æ¯æ¥ç¾å°"), SHARE_INFO(6,"SHARE_INFO","å享èµè®¯"), SHARE_INVITE_BILL(2,"SHARE_INVITE_BILL","å享é请海æ¥"), INVITE_USER_LOGIN(3,"INVITE_USER_LOGIN","é请æ°ç¨æ·æ³¨å"), EXCHANGE_GOODS(4,"INVITE_USER_LOGIN","å æ¢åå"), EXCHANGE_COUPON(5,"INVITE_USER_LOGIN","å æ¢ä¼æ å¸"), POST_COMMENTS(7,"POST_COMMENTS","åå¸è¯è®º"), COFFEE_MAP_CONSUME(8,"COFFEE_MAP_CONSUME","åå¡å°å¾æ¶è´¹"), ; // 0平尿³¨å 1ç¾å° 2å享é请 3é请æ°ç¨æ· 4å æ¢åå 5å æ¢ä¼æ å¸ // æååé private Integer key; private String name; private String des;// æè¿° CoffeeBeanTask(Integer key, String name, String des) { this.key = key; this.name = name; this.des = des; } public Integer getKey() { return key; } public void setKey(Integer key) { this.key = key; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } } public enum NoticeType{ // 0订åéç¥ 1ç³»ç»æ¶æ¯ 2äºå¨æ¶æ¯ 3伿 叿é 4宿¹å®¢æ 5æ´»å¨æ¨è 6æçå ³æ³¨ } server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ package com.doumee.core.wx; /** * å ¬ä¼å·æ¥å£å°åç±» * * @Author : Rk * @create 2023/12/7 10:42 */ public class WXConstant { //è·åå ¬ä¼å· access_token public static final String GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET"; //è·åç¨æ·ä¿¡æ¯ public static final String GET_USER_INFO_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"; } server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ package com.doumee.dao.web.reqeust; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.math.BigDecimal; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/12/7 11:19 */ @Data public class FinishAnswerDTO { @NotBlank(message = "ç颿ç»ä¸ºç©º") @ApiModelProperty(value = "ç颿ç»ï¼jsonï¼") private String content; @NotNull(message = "使ç¨åºæ¯ä¸ºç©º") @ApiModelProperty(value = "使ç¨åºæ¯ 0å³å¡äººå 1æ®é访客") private Integer useType; @ApiModelProperty(value = "访客ç¼ç ") private String userId; @ApiModelProperty(value = "ç¨æ·openId") private String openId; } server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,43 @@ package com.doumee.dao.web.response; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.doumee.core.annotation.excel.ExcelColumn; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/12/7 11:19 */ @Data public class ProblemsVO { @ApiModelProperty(value = "主é®", example = "1") private Integer id; @ApiModelProperty(value = "夿³¨") private String remark; @ApiModelProperty(value = "é¢ç®") private String title; @ApiModelProperty(value = "é项éå") private String options; @ApiModelProperty(value = "æ£ç¡®çæ¡") private String answer; @ApiModelProperty(value = "ç±»å 0åé 1å¤é ", example = "1") private Integer type; @ApiModelProperty(value = "åå¼", example = "1") private BigDecimal score; } server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,18 @@ package com.doumee.dao.web.response; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/12/7 11:19 */ @Data public class WxAuthorizeVO { @ApiModelProperty(value = "ææOPENID") private String openid; } server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java
@@ -7,6 +7,8 @@ import com.doumee.dao.admin.request.LaborMemberDTO; import com.doumee.dao.admin.response.MemberInfoDTO; import com.doumee.dao.business.model.Member; import com.doumee.dao.web.response.WxAuthorizeVO; import java.util.List; /** @@ -132,4 +134,25 @@ * @return */ void importMemberBatch(LaborEmpowerDTO laborEmpowerDTO); /********************************************å ¬ä¼å·æ¥å£***********************************************************************/ /** * å¾®ä¿¡æææ¥å£ * @param code * @return */ WxAuthorizeVO wxAuthorize(String code); } server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java
@@ -3,6 +3,8 @@ import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.ProblemLog; import com.doumee.dao.web.reqeust.FinishAnswerDTO; import java.util.List; /** @@ -94,4 +96,11 @@ * @return long */ long count(ProblemLog problemLog); /** * ä¿åçé¢è®°å½ * @param finishAnswerDTO * @return */ Integer finishAnswer(FinishAnswerDTO finishAnswerDTO); } server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java
@@ -3,6 +3,8 @@ import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.Problems; import com.doumee.dao.web.response.ProblemsVO; import java.util.List; /** @@ -95,6 +97,14 @@ */ long count(Problems problems); /** * è·åé¢ç®ä¿¡æ¯ * @param useType * @return */ List<ProblemsVO> getProblemsVO(Integer useType); /** * è·åä¸åç¨æ·ç±»åçé¢ç® * @param useType server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -4,6 +4,10 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.PhoneUtil; import com.alibaba.fastjson.JSONObject; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.config.Jwt.JwtPayLoad; import com.doumee.config.Jwt.JwtTokenUtil; import com.doumee.core.annotation.excel.ExcelImporter; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; @@ -11,7 +15,9 @@ import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.core.utils.Constants; import com.doumee.core.utils.HttpsUtil; import com.doumee.core.utils.Utils; import com.doumee.core.wx.WXConstant; import com.doumee.dao.admin.request.LaborEmpowerDTO; import com.doumee.dao.admin.request.LaborMemberDTO; import com.doumee.dao.admin.response.MemberInfoDTO; @@ -22,6 +28,7 @@ import com.doumee.dao.business.model.Empower; import com.doumee.dao.business.model.Member; import com.doumee.dao.business.model.TrainTime; import com.doumee.dao.web.response.WxAuthorizeVO; import com.doumee.service.business.MemberService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -54,6 +61,10 @@ @Autowired private TrainTimeMapper trainTimeMapper; @Autowired private SystemDictDataBiz systemDictDataBiz; @Override public Integer create(Member member) { @@ -371,4 +382,45 @@ // } /********************************************å ¬ä¼å·æ¥å£***********************************************************************/ /** * å¾®ä¿¡æææ¥å£ * @param code * @return */ @Override public WxAuthorizeVO wxAuthorize(String code){ String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode(); String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode(); String getTokenUrl = WXConstant.GET_USER_INFO_URL.replace("CODE", code) .replace("APPID", appId).replace("SECRET", appSecret); JSONObject tokenJson = JSONObject.parseObject(HttpsUtil.get(getTokenUrl,true)); String openId = null; if(!Objects.isNull(tokenJson.get("access_token"))){ openId = tokenJson.getString("openid"); } WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO(); wxAuthorizeVO.setOpenid(openId); return wxAuthorizeVO; } } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java
@@ -1,20 +1,33 @@ package com.doumee.service.business.impl; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; 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.CompanyMapper; import com.doumee.dao.business.MemberMapper; import com.doumee.dao.business.ProblemLogMapper; import com.doumee.dao.business.model.Company; import com.doumee.dao.business.model.Member; import com.doumee.dao.business.model.ProblemLog; import com.doumee.dao.web.reqeust.FinishAnswerDTO; import com.doumee.service.business.ProblemLogService; 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.checkerframework.checker.units.qual.A; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.Date; import java.util.List; import java.util.Objects; /** * 访客çé¢è®°å½è¡¨Serviceå®ç° @@ -26,6 +39,12 @@ @Autowired private ProblemLogMapper problemLogMapper; @Autowired private MemberMapper memberMapper; @Autowired private CompanyMapper companyMapper; @Override public Integer create(ProblemLog problemLog) { @@ -157,4 +176,45 @@ QueryWrapper<ProblemLog> wrapper = new QueryWrapper<>(problemLog); return problemLogMapper.selectCount(wrapper); } /** * ä¿åçé¢è®°å½ * @param finishAnswerDTO * @return */ @Override public Integer finishAnswer(FinishAnswerDTO finishAnswerDTO){ ProblemLog problemLog = new ProblemLog(); BeanUtils.copyProperties(finishAnswerDTO,problemLog); problemLog.setCreateDate(new Date()); problemLog.setIsdeleted(Constants.ZERO); problemLog.setStatus(Constants.ZERO); if(finishAnswerDTO.getUseType().equals(Constants.ZERO)&&StringUtils.isNotBlank(finishAnswerDTO.getUserId())){ Member member = memberMapper.selectById(finishAnswerDTO.getUserId()); if(Objects.isNull(member)){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å³å¡äººå"); } if(!member.getType().equals(Constants.memberType.lw_visitor)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éå³å¡äººåç±»åï¼çé¢å¤±è´¥"); } if(!member.getStatus().equals(Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è´¦å·å·²ç»" + (member.getStatus().equals(Constants.ONE)?"ç¦ç¨":"æé»/å é¤") ); } problemLog.setName(member.getName()); problemLog.setPhone(member.getPhone()); problemLog.setCompanyId(member.getCompanyId()); Company company = companyMapper.selectById(member.getCompanyId()); if(Objects.isNull(company)){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å³å¡äººåå ¬å¸"); } problemLog.setCompanyName(company.getName()); } this.problemLogMapper.insert(problemLog); return problemLog.getId(); } } server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java
@@ -2,18 +2,22 @@ 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.ProblemsMapper; import com.doumee.dao.business.model.Problems; import com.doumee.dao.web.response.ProblemsVO; import com.doumee.service.business.ProblemsService; 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.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; /** @@ -149,4 +153,27 @@ return null; } /** * è·åé¢ç®ä¿¡æ¯ * @param useType * @return */ @Override public List<ProblemsVO> getProblemsVO(Integer useType){ List<Problems> problemsList = problemsMapper.selectList(new QueryWrapper<Problems>().lambda().eq(Problems::getUseType,useType) .eq(Problems::getIsdeleted, Constants.ZERO).orderByAsc(Problems::getSortnu)); List<ProblemsVO> problemsVOList = new ArrayList<>(); for (Problems problems:problemsList) { ProblemsVO problemsVO = new ProblemsVO(); BeanUtils.copyProperties(problems,problemsVO); problemsVOList.add(problemsVO); } return problemsVOList; } } server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,72 @@ package com.doumee.api; import com.alibaba.fastjson.JSONObject; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.utils.Constants; import com.doumee.core.utils.HttpsUtil; import com.doumee.core.wx.WXConstant; import com.doumee.dao.system.model.SystemDictData; import lombok.extern.slf4j.Slf4j; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.io.IOException; import java.net.URI; import java.util.Date; import java.util.Map; import java.util.Objects; /** * 宿¶ä»»å¡ * @author jiangping * @date 2021-10-10 14:40:35 * https://www.bejson.com/othertools/cron/ cron 表达å¼çæå°å */ @Slf4j @Component @EnableScheduling public class ScheduleTool { @Autowired private SystemDictDataBiz systemDictDataBiz; /** * æ¯å¦å¼åè */ @Value("${timing}") private Boolean timing; /** * æ´æ°å¾®ä¿¡å ¬ä¼å· ACCESS_TOKEN * @throws Exception */ @Scheduled(fixedDelay=1000 * 60 * 90) public void updAccessToken(){ String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode(); String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode(); //çæå¾®ä¿¡token String url = WXConstant.GET_ACCESS_TOKEN_URL.replace("APPID",appId).replace("APPSECRET",appSecret); String response = HttpsUtil.get(url,false); JSONObject json = JSONObject.parseObject(response); SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_ACCESS_TOKEN); if(!Objects.isNull(systemDictData)){ systemDictData.setCode(json.getString("access_token")); systemDictData.setUpdateTime(new Date()); systemDictDataBiz.updateByIdNew(systemDictData); log.info(" æ´æ°å¾®ä¿¡å ¬ä¼å· ACCESS_TOKEN =========> " + systemDictData.getCode() ); } } } server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java
@@ -1,6 +1,7 @@ package com.doumee.api.web; import com.doumee.config.Jwt.JwtTokenUtil; import com.doumee.core.model.PageData; import lombok.extern.slf4j.Slf4j; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -25,6 +26,7 @@ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); return request; } /** * è·åç¨æ·ID * server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,73 @@ package com.doumee.api.web; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.annotation.trace.Trace; import com.doumee.core.model.ApiResponse; import com.doumee.dao.system.model.SystemDictData; import com.doumee.dao.web.reqeust.FinishAnswerDTO; import com.doumee.dao.web.response.ProblemsVO; import com.doumee.service.business.ProblemLogService; import com.doumee.service.business.ProblemsService; 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.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/12/7 10:40 */ @Api(tags = "99ãå ¶ä»") @Trace(exclude = true) @RestController @RequestMapping("/web/unit") @Slf4j public class UnitController { @Autowired private SystemDictDataBiz systemDictDataBiz; @Autowired private ProblemsService problemsService; @Autowired private ProblemLogService problemLogService; @ApiOperation(value = "æ¥è¯¢åå ¸å¼æ°æ®", notes = "H5") @GetMapping("/getSystemDictData") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "String", name = "label", value = "æ°æ®åå ¸å¼", required = true), @ApiImplicitParam(paramType = "query", dataType = "String", name = "dictCode", value = "ç³»ç»åå ¸å¼", required = true) }) public ApiResponse<SystemDictData> getSystemDictData(@RequestParam String dictCode, @RequestParam String label) { return ApiResponse.success("æ¥è¯¢æå",systemDictDataBiz.queryByCode(dictCode,label)); } @ApiOperation(value = "è·åé¢ç®æ°æ®", notes = "H5") @GetMapping("/getProblemsVO") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "useType", value = "使ç¨åºæ¯ 0å³å¡äººå 1æ®é访客", required = true) }) public ApiResponse<List<ProblemsVO>> getProblemsVO(@RequestParam Integer useType) { return ApiResponse.success("æ¥è¯¢æå",problemsService.getProblemsVO(useType)); } @ApiOperation(value = "ä¿åçé¢è®°å½", notes = "H5") @PostMapping("/finishAnswer") public ApiResponse<Integer> finishAnswer(@RequestBody FinishAnswerDTO finishAnswerDTO) { return ApiResponse.success("æ¥è¯¢æå",problemLogService.finishAnswer(finishAnswerDTO)); } } server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,47 @@ package com.doumee.api.web; import com.doumee.core.annotation.trace.Trace; import com.doumee.core.model.ApiResponse; import com.doumee.core.utils.Constants; import com.doumee.dao.web.response.WxAuthorizeVO; import com.doumee.service.business.MemberService; 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.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2023/12/7 10:40 */ @Api(tags = "1ã访客ä¸å¡") @Trace(exclude = true) @RestController @RequestMapping("/web/visitor") @Slf4j public class VisitorController { @Autowired private MemberService memberService; @ApiOperation(value = "访客微信ææ", notes = "访客微信ææè·åopenId") @GetMapping("/wxAuthorize") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "ææç ", required = true) }) public ApiResponse<WxAuthorizeVO> wxAuthorize(@RequestParam String code) { WxAuthorizeVO wxAuthorizeVO = memberService.wxAuthorize(code); return ApiResponse.success("æ¥è¯¢æå",wxAuthorizeVO); } }