k94314517
2023-12-07 fc17a98e0bd076bd69d2418ec7c5d61e8a54f8bb
11111
已添加7个文件
已修改8个文件
1141 ■■■■■ 文件已修改
server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java 652 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/core/wx/WXConstant.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/FinishAnswerDTO.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/dao/web/response/ProblemsVO.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/dao/web/response/WxAuthorizeVO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/MemberService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemLogService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/ProblemsService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemLogServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/ProblemsServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_web/src/main/java/com/doumee/api/ScheduleTool.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_web/src/main/java/com/doumee/api/web/ApiController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_web/src/main/java/com/doumee/api/web/UnitController.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_web/src/main/java/com/doumee/api/web/VisitorController.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
    }
}