From 497475defd5d0ebf90ae6a8e2b080a16d78043ab Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 23 九月 2022 17:49:34 +0800
Subject: [PATCH] 2022.9.23

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/WxUserService.kt                  |   16 ++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/WxUserController.kt                   |   23 ++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenWX.kt                       |   19 ++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt                      |    7 
 src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/EnElementSubType.kt               |    2 
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt            |    7 
 pom.xml                                                                                           |    7 
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenPW.kt                       |   12 +
 src/main/kotlin/cn/flightfeather/supervision/domain/entity/UserInfoWx.java                        |  160 ++++++++++++++++++++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt         |   88 +++++++++++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt |   26 +-
 src/main/resources/generator/generatorConfig.xml                                                  |    4 
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultCaseVo.kt                 |   12 
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt                |    1 
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt                     |    2 
 src/main/resources/mapper/UserInfoWxMapper.xml                                                    |   25 +++
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt       |    6 
 src/main/kotlin/cn/flightfeather/supervision/domain/mapper/UserInfoWxMapper.kt                    |    8 +
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultQAVo.kt                   |    9 +
 19 files changed, 413 insertions(+), 21 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1f4a5c5..f5bbd96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,6 +126,13 @@
         <version>1.1.6</version>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.74</version>
+        </dependency>
+
         <!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator -->
         <dependency>
             <groupId>net.coobird</groupId>
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/entity/UserInfoWx.java b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/UserInfoWx.java
new file mode 100644
index 0000000..a906aec
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/UserInfoWx.java
@@ -0,0 +1,160 @@
+package cn.flightfeather.supervision.domain.entity;
+
+import javax.persistence.*;
+
+@Table(name = "sm_t_userinfo_wx")
+public class UserInfoWx {
+    @Column(name = "UI_GUID")
+    private String uiGuid;
+
+    @Id
+    @Column(name = "UI_Open_Id")
+    private String uiOpenId;
+
+    @Column(name = "UI_Nick_Name")
+    private String uiNickName;
+
+    @Column(name = "UI_Gender")
+    private String uiGender;
+
+    @Column(name = "UI_Country")
+    private String uiCountry;
+
+    @Column(name = "UI_Province")
+    private String uiProvince;
+
+    @Column(name = "UI_City")
+    private String uiCity;
+
+    @Column(name = "UI_Avatar_Url")
+    private String uiAvatarUrl;
+
+    @Column(name = "UI_UnionId")
+    private String uiUnionid;
+
+    /**
+     * @return UI_GUID
+     */
+    public String getUiGuid() {
+        return uiGuid;
+    }
+
+    /**
+     * @param uiGuid
+     */
+    public void setUiGuid(String uiGuid) {
+        this.uiGuid = uiGuid == null ? null : uiGuid.trim();
+    }
+
+    /**
+     * @return UI_Open_Id
+     */
+    public String getUiOpenId() {
+        return uiOpenId;
+    }
+
+    /**
+     * @param uiOpenId
+     */
+    public void setUiOpenId(String uiOpenId) {
+        this.uiOpenId = uiOpenId == null ? null : uiOpenId.trim();
+    }
+
+    /**
+     * @return UI_Nick_Name
+     */
+    public String getUiNickName() {
+        return uiNickName;
+    }
+
+    /**
+     * @param uiNickName
+     */
+    public void setUiNickName(String uiNickName) {
+        this.uiNickName = uiNickName == null ? null : uiNickName.trim();
+    }
+
+    /**
+     * @return UI_Gender
+     */
+    public String getUiGender() {
+        return uiGender;
+    }
+
+    /**
+     * @param uiGender
+     */
+    public void setUiGender(String uiGender) {
+        this.uiGender = uiGender == null ? null : uiGender.trim();
+    }
+
+    /**
+     * @return UI_Country
+     */
+    public String getUiCountry() {
+        return uiCountry;
+    }
+
+    /**
+     * @param uiCountry
+     */
+    public void setUiCountry(String uiCountry) {
+        this.uiCountry = uiCountry == null ? null : uiCountry.trim();
+    }
+
+    /**
+     * @return UI_Province
+     */
+    public String getUiProvince() {
+        return uiProvince;
+    }
+
+    /**
+     * @param uiProvince
+     */
+    public void setUiProvince(String uiProvince) {
+        this.uiProvince = uiProvince == null ? null : uiProvince.trim();
+    }
+
+    /**
+     * @return UI_City
+     */
+    public String getUiCity() {
+        return uiCity;
+    }
+
+    /**
+     * @param uiCity
+     */
+    public void setUiCity(String uiCity) {
+        this.uiCity = uiCity == null ? null : uiCity.trim();
+    }
+
+    /**
+     * @return UI_Avatar_Url
+     */
+    public String getUiAvatarUrl() {
+        return uiAvatarUrl;
+    }
+
+    /**
+     * @param uiAvatarUrl
+     */
+    public void setUiAvatarUrl(String uiAvatarUrl) {
+        this.uiAvatarUrl = uiAvatarUrl == null ? null : uiAvatarUrl.trim();
+    }
+
+    /**
+     * @return UI_UnionId
+     */
+    public String getUiUnionid() {
+        return uiUnionid;
+    }
+
+    /**
+     * @param uiUnionid
+     */
+    public void setUiUnionid(String uiUnionid) {
+        this.uiUnionid = uiUnionid == null ? null : uiUnionid.trim();
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/EnElementSubType.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/EnElementSubType.kt
index f47c63a..2764c3b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/EnElementSubType.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/EnElementSubType.kt
@@ -72,7 +72,7 @@
             return if (value.toInt() == 99) {
                 subTypes[index].last()
             } else {
-                subTypes[index][value.toInt()]
+                subTypes[index][value.toInt() - 1]
             }
         }
     }
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/UserInfoWxMapper.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/UserInfoWxMapper.kt
new file mode 100644
index 0000000..a19304f
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/UserInfoWxMapper.kt
@@ -0,0 +1,8 @@
+package cn.flightfeather.supervision.domain.mapper
+
+import cn.flightfeather.supervision.domain.entity.UserInfoWx
+import cn.flightfeather.supervision.domain.util.MyMapper
+import org.apache.ibatis.annotations.Mapper
+
+@Mapper
+interface UserInfoWxMapper : MyMapper<UserInfoWx>
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt
index 6040849..0e22588 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt
@@ -99,4 +99,11 @@
                 condition.isForeign, condition.category, condition.keywords,
                 condition.isOpen, condition.isUsing, condition.count, condition.sceneTypeId)
     }
+
+    override fun getSeries(userId: String, seriesId: String): List<LawsRegulations> {
+        return lawsRegulationsMapper.selectByExample(Example(LawsRegulations::class.java).apply {
+            createCriteria().andEqualTo("lrExtension2", seriesId)
+            orderBy("lrExtension3")
+        })
+    }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt
index d9fba46..053434b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt
@@ -137,7 +137,7 @@
 
                     fileIndustry = IndustryType.getNameByValue(it.mfFileIndustry)
                     itemType = EnElementType.getNameByValue(it.mfEpItemType)
-                    itemSubType = EnElementSubType.getNameByValue(it.mfEpItemSubtype)
+                    itemSubType = EnElementSubType.getSubType(it.mfEpItemType, it.mfEpItemSubtype)
                     fileUrl = it.mfFileUrl
                     val keyList = it.mfKeywordLv1.split("銆�")
                     for (i in keyList.indices) {
@@ -247,7 +247,7 @@
 
 //                    fileIndustry = IndustryType.getNameByValue(it.mfFileIndustry)
                     itemType = EnElementType.getNameByValue(it.cqKind)
-                    itemSubType = EnElementSubType.getNameByValue(it.cqSubkind)
+                    itemSubType = EnElementSubType.getSubType(it.cqKind, it.cqSubkind)
 //                    fileUrl = it.mfFileUrl
 //                    val keyList = it.mfKeywordLv1.split("銆�")
 //                    for (i in keyList.indices) {
@@ -258,6 +258,10 @@
 //                        }
 //                    }
                     time = it.cqCreateTime
+                    punish = it.cqIsPunish
+                    illegal = it.cqIsIllegal
+                    shotSpot = it.cqIsShotspot
+                    supervise = it.cqIsSupervise
                 })
             }
             response.success = true
@@ -296,7 +300,7 @@
 
 //                    fileIndustry = IndustryType.getNameByValue(it.mfFileIndustry)
                     itemType = EnElementType.getNameByValue(it.ecEpItemType)
-                    itemSubType = EnElementSubType.getNameByValue(it.ecEpItemSubtype)
+                    itemSubType = EnElementSubType.getSubType(it.ecEpItemType, it.ecEpItemSubtype)
                     imgUrl = it.ecAppendixUrl?.split(";")?.get(0)
                     time = it.ecCreateTime
 
@@ -339,7 +343,7 @@
                 mfMgtLevel = ManageLevelType.getNameByValue(it.mfMgtLevel)
                 mfFileType = ConsultFileType.getNameByValue(it.mfFileType)
                 mfEpItemType = EnElementType.getNameByValue(it.mfEpItemType)
-                mfEpItemSubtype = EnElementSubType.getNameByValue(it.mfEpItemSubtype)
+                mfEpItemSubtype = EnElementSubType.getSubType(it.mfEpItemType, it.mfEpItemSubtype)
                 mfSaveType = FileSaveType.getNameByValue(it.mfSaveType)
             }
             result.add(vo)
@@ -356,7 +360,7 @@
                 mfMgtLevel = ManageLevelType.getNameByValue(it.mfMgtLevel)
                 mfFileType = ConsultFileType.getNameByValue(it.mfFileType)
                 mfEpItemType = EnElementType.getNameByValue(it.mfEpItemType)
-                mfEpItemSubtype = EnElementSubType.getNameByValue(it.mfEpItemSubtype)
+                mfEpItemSubtype = EnElementSubType.getSubType(it.mfEpItemType, it.mfEpItemSubtype)
                 mfSaveType = FileSaveType.getNameByValue(it.mfSaveType)
             }
         }
@@ -390,7 +394,7 @@
             BeanUtils.copyProperties(it, vo)
             vo.apply {
                 cqKind = EnElementType.getNameByValue(it.cqKind)
-                cqSubkind = EnElementSubType.getNameByValue(it.cqSubkind)
+                cqSubkind = EnElementSubType.getSubType(it.cqKind, it.cqSubkind)
             }
 
             if (answers.isNotEmpty()) {
@@ -427,7 +431,7 @@
                 typeId = ConsultResultType.TYPE4.value
                 typeName = ConsultResultType.TYPE4.des
                 itemType = EnElementType.getNameByValue(it.cqKind)
-                itemSubType = EnElementSubType.getNameByValue(it.cqSubkind)
+                itemSubType = EnElementSubType.getSubType(it.cqKind, it.cqSubkind)
                 time = it.cqCreateTime
             })
 
@@ -435,7 +439,7 @@
 //            BeanUtils.copyProperties(it, vo)
 //            vo.apply {
 //                cqKind = EnElementType.getNameByValue(it.cqKind)
-//                cqSubkind = EnElementSubType.getNameByValue(it.cqSubkind)
+//                cqSubkind = EnElementSubType.getSubType(it.ecEpItemType, it.cqSubkind)
 //            }
 //
 //            if (answers.isNotEmpty()) {
@@ -453,7 +457,7 @@
             BeanUtils.copyProperties(it, result)
             result.apply {
                 cqKind = EnElementType.getNameByValue(it.cqKind)
-                cqSubkind = EnElementSubType.getNameByValue(it.cqSubkind)
+                cqSubkind = EnElementSubType.getSubType(it.cqKind, it.cqSubkind)
             }
         }
 
@@ -481,7 +485,7 @@
             BeanUtils.copyProperties(it, vo)
             vo.apply {
                 ecEpItemType = EnElementType.getNameByValue(it.ecEpItemType)
-                ecEpItemSubtype = EnElementSubType.getNameByValue(it.ecEpItemSubtype)
+                ecEpItemSubtype = EnElementSubType.getSubType(it.ecEpItemType, it.ecEpItemSubtype)
                 ecType = EnforceCaseType.getNameByValue(it.ecType)
             }
             result.add(vo)
@@ -495,7 +499,7 @@
             BeanUtils.copyProperties(it, result)
             result.apply {
                 ecEpItemType = EnElementType.getNameByValue(it.ecEpItemType)
-                ecEpItemSubtype = EnElementSubType.getNameByValue(it.ecEpItemSubtype)
+                ecEpItemSubtype = EnElementSubType.getSubType(it.ecEpItemType, it.ecEpItemSubtype)
                 ecType = EnforceCaseType.getNameByValue(it.ecType)
             }
         }
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
index 47d73ed..1ff3939 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
@@ -1,14 +1,18 @@
 package cn.flightfeather.supervision.lightshare.service.Impl
 
+import cn.flightfeather.supervision.common.net.WXHttpService
 import cn.flightfeather.supervision.domain.entity.BaseInfo
 import cn.flightfeather.supervision.domain.entity.Company
+import cn.flightfeather.supervision.domain.entity.UserInfoWx
 import cn.flightfeather.supervision.domain.entity.Userinfo
 import cn.flightfeather.supervision.domain.enumeration.SceneType
+import cn.flightfeather.supervision.domain.enumeration.UserType
 import cn.flightfeather.supervision.domain.mapper.*
 import cn.flightfeather.supervision.infrastructure.utils.FileUtil
 import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
 import cn.flightfeather.supervision.lightshare.service.UserinfoService
 import cn.flightfeather.supervision.lightshare.vo.*
+import com.alibaba.fastjson.JSONObject
 import com.github.pagehelper.PageHelper
 import org.springframework.beans.BeanUtils
 import org.springframework.stereotype.Service
@@ -25,7 +29,7 @@
     val companyMapper: CompanyMapper,
     val restaurantBaseInfoMapper: RestaurantBaseInfoMapper,
     val vehicleBaseInfoMapper: VehicleBaseInfoMapper,
-    val userMapMapper: UserMapMapper
+    val userMapMapper: UserMapMapper,
 ) : UserinfoService {
 
     //鏍规嵁userinfo鏉′欢鏌ヨ
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt
new file mode 100644
index 0000000..0cde9e7
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt
@@ -0,0 +1,88 @@
+package cn.flightfeather.supervision.lightshare.service.Impl
+
+import cn.flightfeather.supervision.common.net.WXHttpService
+import cn.flightfeather.supervision.domain.entity.UserInfoWx
+import cn.flightfeather.supervision.domain.entity.Userinfo
+import cn.flightfeather.supervision.domain.entity.Version
+import cn.flightfeather.supervision.domain.enumeration.UserType
+import cn.flightfeather.supervision.domain.mapper.UserInfoWxMapper
+import cn.flightfeather.supervision.domain.mapper.UserinfoMapper
+import cn.flightfeather.supervision.domain.mapper.VersionMapper
+import cn.flightfeather.supervision.infrastructure.utils.FileUtil
+import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
+import cn.flightfeather.supervision.lightshare.service.VersionService
+import cn.flightfeather.supervision.lightshare.service.WxUserService
+import cn.flightfeather.supervision.lightshare.vo.AccessTokenPW
+import cn.flightfeather.supervision.lightshare.vo.AccessTokenWX
+import cn.flightfeather.supervision.lightshare.vo.BaseResponse
+import cn.flightfeather.supervision.lightshare.vo.VersionVo
+import com.alibaba.fastjson.JSONObject
+import org.springframework.stereotype.Service
+import org.springframework.web.multipart.MultipartFile
+import tk.mybatis.mapper.entity.Example
+
+@Service
+class WxUserServiceImpl(val userinfoMapper: UserinfoMapper, val userInfoWxMapper: UserInfoWxMapper): WxUserService {
+
+    override fun loginWx(accessTokenWX: AccessTokenWX): BaseResponse<Userinfo> {
+        accessTokenWX.code ?: return BaseResponse(false, "鐧诲綍鍑瘉涓嶈兘涓虹┖")
+
+        val res = WXHttpService.code2Session(accessTokenWX.code!!)
+
+//        return BaseResponse(false)
+        if (res.success) {
+            val json = JSONObject.parseObject(res.m.responseBodyAsString)
+            if (json["errcode"] == 0 || json["errcode"] == null) {
+                val openid = json["openid"] as String
+                val unionid = json["unionid"] as String
+                val user = userInfoWxMapper.selectByPrimaryKey(openid)
+                return if (user.uiOpenId == null) {
+                    val newUserWx = UserInfoWx().apply {
+//                        uiGuid = UUIDGenerator.generate16ShortUUID()
+                        uiOpenId = openid
+                        uiNickName = accessTokenWX.nickName
+                        uiGender
+                        uiCountry
+                        uiProvince
+                        uiCity
+                        uiAvatarUrl = accessTokenWX.avatarUrl
+                        uiUnionid = unionid
+                    }
+//                    val newUser = Userinfo().apply {
+//                        guid = newUserWx.uiGuid
+//                        headIconUrl = newUserWx.uiAvatarUrl
+//                        acountname
+//                        realname = newUserWx.uiNickName
+//                        password
+//                        usertypeid = UserType.Enterprise.value.toByte()
+//                        usertype = UserType.Enterprise.des
+//                        isenable = true
+//                        wechatid = newUserWx.uiOpenId
+//                    }
+                    var r = userInfoWxMapper.insert(newUserWx)
+//                    r += userinfoMapper.insert(newUser)
+                    return if (r == 1) {
+                        BaseResponse(true, "寰俊鐢ㄦ埛娉ㄥ唽鎴愬姛")
+                    } else {
+                        BaseResponse(false, "寰俊鐢ㄦ埛娉ㄥ唽澶辫触")
+                    }
+                } else {
+                    if (user.uiGuid != null) {
+                        val userinfo = userinfoMapper.selectByPrimaryKey(user.uiGuid)
+                        BaseResponse(true, "寰俊鐢ㄦ埛鐧诲綍鎴愬姛", data = userinfo)
+                    } else {
+                        BaseResponse(true, "寰俊鐢ㄦ埛鏈粦瀹氫紒涓�")
+                    }
+                }
+            } else {
+                return BaseResponse(false, "璇锋眰澶辫触锛歟rrcode=${json["errcode"]}")
+            }
+        } else {
+            return BaseResponse(false, "璇锋眰澶辫触, 鏃犳硶璁块棶寰俊鎺ュ彛")
+        }
+    }
+
+    override fun loginPw(accessTokenPW: AccessTokenPW): BaseResponse<Userinfo> {
+        TODO("Not yet implemented")
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt
index 266a236..90993f3 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt
@@ -15,4 +15,6 @@
     fun getLawsRegulations(condition: LawsRegulationsCondition, page: Int, per_page: Int, response: HttpServletResponse): List<LawsRegulations>
 
     fun getLawsRegulationsWithEachType(condition: LawsRegulationsCondition): List<LawsRegulations>
+
+    fun getSeries(userId: String, seriesId: String): List<LawsRegulations>
 }
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt
index 0aee3a4..0d7b9c4 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserinfoService.kt
@@ -20,6 +20,7 @@
 
     fun login(loginRequestVo: LoginRequestVo): AccessToken
 
+
     fun register(loginRequestVo: LoginRequestVo): AccessToken
 
     fun register2(loginRequestVo: LoginRequestVo): AccessToken
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/WxUserService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/WxUserService.kt
new file mode 100644
index 0000000..de6779f
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/WxUserService.kt
@@ -0,0 +1,16 @@
+package cn.flightfeather.supervision.lightshare.service
+
+import cn.flightfeather.supervision.domain.entity.Userinfo
+import cn.flightfeather.supervision.lightshare.vo.AccessTokenPW
+import cn.flightfeather.supervision.lightshare.vo.AccessTokenWX
+import cn.flightfeather.supervision.lightshare.vo.BaseResponse
+
+interface WxUserService {
+
+    /**
+     * 寰俊鐢ㄦ埛娉ㄥ唽鍜岀櫥褰�
+     */
+    fun loginWx(accessTokenWX: AccessTokenWX): BaseResponse<Userinfo>
+
+    fun loginPw(accessTokenPW: AccessTokenPW): BaseResponse<Userinfo>
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenPW.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenPW.kt
new file mode 100644
index 0000000..c042ff1
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenPW.kt
@@ -0,0 +1,12 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import com.fasterxml.jackson.annotation.JsonInclude
+
+/**
+ * 寰俊鐢ㄦ埛瀵嗙爜鐧诲綍淇℃伅
+ */
+class AccessTokenPW : AccessTokenWX() {
+    var userName: String? = null
+
+    var password: String? = null
+}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenWX.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenWX.kt
new file mode 100644
index 0000000..1b5987a
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AccessTokenWX.kt
@@ -0,0 +1,19 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import com.fasterxml.jackson.annotation.JsonInclude
+
+/**
+ * 寰俊鐢ㄦ埛涓�閿櫥褰曠櫥褰曚俊鎭�
+ */
+open class AccessTokenWX {
+    //鐢ㄦ埛鐧诲綍鍑瘉
+    var code: String? = null
+    //涓嶅寘鍚晱鎰熶俊鎭殑鍘熷鏁版嵁瀛楃涓诧紝鐢ㄤ簬璁$畻绛惧悕
+    var rawData: String? = null
+    var signature: String? = null
+    var encryptedData: String? = null
+    var iv: String? = null
+
+    var nickName: String? = null
+    var avatarUrl: String? = null
+}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultCaseVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultCaseVo.kt
index d9bc138..6461a4d 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultCaseVo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultCaseVo.kt
@@ -11,16 +11,16 @@
     var provinceName: String? = null
     var cityName: String? = null
     var occurDate: String? = null
-    //鏄惁璁捐琛屾斂澶勭綒
+    //鏄惁娑夊強琛屾斂澶勭綒
     var punish: Boolean = false
-    //鏄惁璁捐琛屾斂鎷樼暀
+    //鏄惁娑夊強琛屾斂鎷樼暀
     var detained: Boolean = false
-    //鏄惁璁捐鍒戜簨璐d换
+    //鏄惁娑夊強鍒戜簨璐d换
     var illegal: Boolean = false
-    //鏄惁璁捐鐜繚鐑偣
+    //鏄惁娑夊強鐜繚鐑偣
     var shotSpot: Boolean = false
-    //鏄惁璁捐鐫e療瑕佺偣
+    //鏄惁娑夊強鐫e療瑕佺偣
     var supervise: Boolean = false
-    //鏄惁璁捐琛屾斂澶勭綒杞诲井杩濇硶
+    //鏄惁娑夊強琛屾斂澶勭綒杞诲井杩濇硶
     var minor: Boolean = false
 }
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultQAVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultQAVo.kt
index c0dfc82..1cd8c56 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultQAVo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ConsultResultQAVo.kt
@@ -9,5 +9,12 @@
  */
 class ConsultResultQAVo : ConsultResultVo() {
 
-//    val answer: String? = null
+    //鏄惁娑夊強琛屾斂澶勭綒
+    var punish: Boolean = false
+    //鏄惁娑夊強鍒戜簨璐d换
+    var illegal: Boolean = false
+    //鏄惁娑夊強鐜繚鐑偣
+    var shotSpot: Boolean = false
+    //鏄惁娑夊強鐫e療瑕佺偣
+    var supervise: Boolean = false
 }
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt
index 0b9ecf7..4804d87 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt
@@ -43,4 +43,11 @@
         @ApiParam(value = "鐢ㄦ埛id") @PathVariable userId: String,
         @ApiParam(value = "鏌ユ壘鏉′欢") @RequestBody condition: LawsRegulationsCondition
     ) = lawService.getLawsRegulationsWithEachType(condition)
+
+    @ApiOperation(value = "鏌ヨ璧勬簮鎵�鍦ㄧ郴鍒�")
+    @PostMapping("/series")
+    fun getSeries(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "鏌ユ壘鏉′欢") @RequestParam(value = "seriesId") seriesId: String,
+    ) = lawService.getSeries(userId, seriesId)
 }
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/WxUserController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/WxUserController.kt
new file mode 100644
index 0000000..9dc1b94
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/WxUserController.kt
@@ -0,0 +1,23 @@
+package cn.flightfeather.supervision.lightshare.web
+
+import cn.flightfeather.supervision.lightshare.service.WxUserService
+import cn.flightfeather.supervision.lightshare.vo.AccessTokenWX
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+@Api(tags = ["寰俊鐢ㄦ埛淇℃伅API鎺ュ彛"])
+@RestController
+@RequestMapping("/wxuser")
+class WxUserController(val wxUserService: WxUserService) {
+
+    @ApiOperation(value = "鐧诲綍")
+    @PostMapping("/loginWx")
+    fun loginWx(
+        @ApiParam("鐧诲綍淇℃伅") @RequestBody accessTokenWX: AccessTokenWX
+    ) = wxUserService.loginWx(accessTokenWX)
+}
\ No newline at end of file
diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml
index 87c0f17..a1ffdec 100644
--- a/src/main/resources/generator/generatorConfig.xml
+++ b/src/main/resources/generator/generatorConfig.xml
@@ -90,7 +90,9 @@
 <!--               selectByExampleQueryId="false"/>-->
 <!--        <table tableName="epk_t_settinganswer" domainObjectName="SettingAnswer" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
 <!--               selectByExampleQueryId="false"/>-->
-        <table tableName="epk_t_enforcecase" domainObjectName="EnforceCase" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
+<!--        <table tableName="epk_t_enforcecase" domainObjectName="EnforceCase" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
+<!--               selectByExampleQueryId="false"/>-->
+        <table tableName="sm_t_userinfo_wx" domainObjectName="UserInfoWx" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
                selectByExampleQueryId="false"/>
     </context>
 </generatorConfiguration>
\ No newline at end of file
diff --git a/src/main/resources/mapper/UserInfoWxMapper.xml b/src/main/resources/mapper/UserInfoWxMapper.xml
new file mode 100644
index 0000000..e51ef0b
--- /dev/null
+++ b/src/main/resources/mapper/UserInfoWxMapper.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="cn.flightfeather.supervision.domain.mapper.UserInfoWxMapper" >
+  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.UserInfoWx" >
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="UI_Open_Id" property="uiOpenId" jdbcType="VARCHAR" />
+    <result column="UI_GUID" property="uiGuid" jdbcType="VARCHAR" />
+    <result column="UI_Nick_Name" property="uiNickName" jdbcType="VARCHAR" />
+    <result column="UI_Gender" property="uiGender" jdbcType="VARCHAR" />
+    <result column="UI_Country" property="uiCountry" jdbcType="VARCHAR" />
+    <result column="UI_Province" property="uiProvince" jdbcType="VARCHAR" />
+    <result column="UI_City" property="uiCity" jdbcType="VARCHAR" />
+    <result column="UI_Avatar_Url" property="uiAvatarUrl" jdbcType="VARCHAR" />
+    <result column="UI_UnionId" property="uiUnionid" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    <!--
+      WARNING - @mbg.generated
+    -->
+    UI_GUID, UI_Open_Id, UI_Nick_Name, UI_Gender, UI_Country, UI_Province, UI_City, UI_Avatar_Url, 
+    UI_UnionId
+  </sql>
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3