2022.10.21
1.环境守法小程序后台功能首发版本完成
已修改30个文件
已添加30个文件
已重命名2个文件
| | |
| | | <artifactId>freemarker</artifactId> |
| | | <version>2.3.31</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/com.belerweb/pinyin4j --> |
| | | <dependency> |
| | | <groupId>com.belerweb</groupId> |
| | | <artifactId>pinyin4j</artifactId> |
| | | <version>2.5.1</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | package cn.flightfeather.supervision |
| | | |
| | | import cn.flightfeather.supervision.common.wx.WxTokenManager |
| | | import cn.flightfeather.supervision.timingtask.TaskController |
| | | import cn.flightfeather.supervision.websocket.VMRoomWebSocketServer |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | |
| | | @Autowired |
| | | lateinit var taskController: TaskController |
| | | |
| | | @Autowired |
| | | lateinit var wxTokenManager: WxTokenManager |
| | | |
| | | @Bean |
| | | fun runner() = ApplicationRunner { |
| | | webSocketServer.start() |
| | | // taskController.run() |
| | | wxTokenManager.run() |
| | | } |
| | | } |
| | | |
| | |
| | | package cn.flightfeather.supervision.common.net |
| | | |
| | | import cn.flightfeather.supervision.common.wx.MessageWxVo |
| | | import cn.flightfeather.supervision.common.wx.WxConfig |
| | | import com.alibaba.fastjson.JSON |
| | | import com.alibaba.fastjson.JSONObject |
| | | import com.google.gson.Gson |
| | | import com.google.gson.JsonObject |
| | | import com.google.gson.JsonParser |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/10/15 |
| | |
| | | */ |
| | | object WXHttpService { |
| | | |
| | | private const val APP_ID="" |
| | | private const val SECRET = "" |
| | | private val httpMethod = HttpMethod("api.weixin.qq.com", 443, true) |
| | | |
| | | /** |
| | | * 微信ç»å½åè¯æ ¡éª |
| | | */ |
| | | fun code2Session(code: String): HttpMethod.MyResponse = |
| | | httpMethod.get( |
| | | fun code2Session(code: String): Pair<String, String>? { |
| | | val res =httpMethod.get( |
| | | "/sns/jscode2session", listOf( |
| | | Pair("appid", APP_ID), Pair("secret", SECRET), Pair("js_code", code), Pair("grant_type", "authorization_code") |
| | | Pair("appid", WxConfig.APP_ID), Pair("secret", WxConfig.SECRET), Pair("js_code", code), Pair("grant_type", "authorization_code") |
| | | ) |
| | | ) |
| | | return if (res.success) { |
| | | val json = JSONObject.parseObject(res.m.responseBodyAsString) |
| | | val errCode = json["errcode"] |
| | | if (errCode == 0 || errCode == null) { |
| | | val openid = json["openid"] as String |
| | | val unionid = json["session_key"] as String |
| | | Pair(openid, unionid) |
| | | } else { |
| | | null |
| | | } |
| | | } else { |
| | | null |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 微信åé订é
æ¶æ¯ |
| | | */ |
| | | fun sendMsg(accessToken:String, msgWxV0: MessageWxVo): Boolean { |
| | | val data = Gson().toJson(msgWxV0) |
| | | val response = httpMethod.post("/cgi-bin/message/subscribe/send?access_token=${accessToken}", data) |
| | | if (response.success) { |
| | | val json = JsonParser.parseString(response.m.responseBodyAsString) |
| | | if (json.isJsonObject) { |
| | | val jo = json.asJsonObject |
| | | val eMsg = jo["errmsg"]?.asString |
| | | when (jo["errcode"]?.asInt) { |
| | | 40003 -> { |
| | | throw IllegalStateException("微信订é
æ¶æ¯ï¼touseråæ®µopenid为空æè
䏿£ç¡®ï¼é误信æ¯ï¼${eMsg}") |
| | | } |
| | | 40037 -> { |
| | | throw IllegalStateException("微信订é
æ¶æ¯ï¼è®¢é
模æ¿idä¸ºç©ºä¸æ£ç¡®ï¼é误信æ¯ï¼${eMsg}") |
| | | } |
| | | 43101 -> { |
| | | throw IllegalStateException("微信订é
æ¶æ¯ï¼ç¨æ·æç»æ¥æ¶æ¶æ¯ï¼é误信æ¯ï¼${eMsg}") |
| | | } |
| | | 47003 -> { |
| | | throw IllegalStateException("微信订é
æ¶æ¯ï¼æ¨¡æ¿åæ°ä¸åç¡®ï¼å
·ä½é误ï¼${eMsg}") |
| | | } |
| | | 41030 -> { |
| | | throw IllegalStateException("微信订é
æ¶æ¯ï¼pageè·¯å¾ä¸æ£ç¡®ï¼é误信æ¯ï¼${eMsg}") |
| | | } |
| | | } |
| | | } |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå°ç¨åºå
¨å±åå°æ¥å£è°ç¨åæ® |
| | | */ |
| | | fun getAccessToken(): JsonObject? { |
| | | val res = httpMethod.get( |
| | | "/cgi-bin/token", listOf( |
| | | Pair("grant_type", "client_credential"), |
| | | Pair("appid", WxConfig.APP_ID), |
| | | Pair("secret", WxConfig.SECRET) |
| | | ) |
| | | ) |
| | | return if (res.success) { |
| | | val json = JsonParser.parseString(res.m.responseBodyAsString) |
| | | if (json.isJsonObject) { |
| | | json.asJsonObject |
| | | } else { |
| | | null |
| | | } |
| | | } else { |
| | | null |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | @SuppressWarnings("serial") |
| | | public class AesException extends Exception { |
| | | |
| | | public final static int OK = 0; |
| | | public final static int ValidateSignatureError = -40001; |
| | | public final static int ParseXmlError = -40002; |
| | | public final static int ComputeSignatureError = -40003; |
| | | public final static int IllegalAesKey = -40004; |
| | | public final static int ValidateAppidError = -40005; |
| | | public final static int EncryptAESError = -40006; |
| | | public final static int DecryptAESError = -40007; |
| | | public final static int IllegalBuffer = -40008; |
| | | //public final static int EncodeBase64Error = -40009; |
| | | //public final static int DecodeBase64Error = -40010; |
| | | //public final static int GenReturnXmlError = -40011; |
| | | |
| | | private int code; |
| | | |
| | | private static String getMessage(int code) { |
| | | switch (code) { |
| | | case ValidateSignatureError: |
| | | return "ç¾åéªè¯é误"; |
| | | case ParseXmlError: |
| | | return "xmlè§£æå¤±è´¥"; |
| | | case ComputeSignatureError: |
| | | return "shaå å¯çæç¾å失败"; |
| | | case IllegalAesKey: |
| | | return "SymmetricKeyéæ³"; |
| | | case ValidateAppidError: |
| | | return "appidæ ¡éªå¤±è´¥"; |
| | | case EncryptAESError: |
| | | return "aeså å¯å¤±è´¥"; |
| | | case DecryptAESError: |
| | | return "aesè§£å¯å¤±è´¥"; |
| | | case IllegalBuffer: |
| | | return "è§£å¯åå¾å°çbufferéæ³"; |
| | | // case EncodeBase64Error: |
| | | // return "base64å å¯é误"; |
| | | // case DecodeBase64Error: |
| | | // return "base64è§£å¯é误"; |
| | | // case GenReturnXmlError: |
| | | // return "xmlçæå¤±è´¥"; |
| | | default: |
| | | return null; // cannot be |
| | | } |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | AesException(int code) { |
| | | super(getMessage(code)); |
| | | this.code = code; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | class ByteGroup { |
| | | ArrayList<Byte> byteContainer = new ArrayList<Byte>(); |
| | | |
| | | public byte[] toBytes() { |
| | | byte[] bytes = new byte[byteContainer.size()]; |
| | | for (int i = 0; i < byteContainer.size(); i++) { |
| | | bytes[i] = byteContainer.get(i); |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | | public ByteGroup addBytes(byte[] bytes) { |
| | | for (byte b : bytes) { |
| | | byteContainer.add(b); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | public int size() { |
| | | return byteContainer.size(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx |
| | | |
| | | import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType |
| | | |
| | | data class MessageWxVo( |
| | | //æ¥æ¶è
ï¼ç¨æ·ï¼çopenid |
| | | val touser: String, |
| | | val template_id: String, |
| | | val page: String, |
| | | val miniprogram_state: String, |
| | | val lang: String, |
| | | var data: Any? = null |
| | | ) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * 对å
¬ä¼å¹³å°åéç»å
¬ä¼è´¦å·çæ¶æ¯å è§£å¯ç¤ºä¾ä»£ç . |
| | | * |
| | | * @copyright Copyright (c) 1998-2014 Tencent Inc. |
| | | */ |
| | | |
| | | // ------------------------------------------------------------------------ |
| | | |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * æä¾åºäºPKCS7ç®æ³çå è§£å¯æ¥å£. |
| | | */ |
| | | class PKCS7Encoder { |
| | | static Charset CHARSET = Charset.forName("utf-8"); |
| | | static int BLOCK_SIZE = 32; |
| | | |
| | | /** |
| | | * è·å¾å¯¹ææè¿è¡è¡¥ä½å¡«å
çåè. |
| | | * |
| | | * @param count éè¦è¿è¡å¡«å
è¡¥ä½æä½çææåèä¸ªæ° |
| | | * @return è¡¥é½ç¨çåèæ°ç» |
| | | */ |
| | | static byte[] encode(int count) { |
| | | // 计ç®éè¦å¡«å
ç使° |
| | | int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); |
| | | if (amountToPad == 0) { |
| | | amountToPad = BLOCK_SIZE; |
| | | } |
| | | // è·å¾è¡¥ä½æç¨çå符 |
| | | char padChr = chr(amountToPad); |
| | | String tmp = new String(); |
| | | for (int index = 0; index < amountToPad; index++) { |
| | | tmp += padChr; |
| | | } |
| | | return tmp.getBytes(CHARSET); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§£å¯åææçè¡¥ä½å符 |
| | | * |
| | | * @param decrypted è§£å¯åçææ |
| | | * @return å é¤è¡¥ä½å符åçææ |
| | | */ |
| | | static byte[] decode(byte[] decrypted) { |
| | | int pad = (int) decrypted[decrypted.length - 1]; |
| | | if (pad < 1 || pad > 32) { |
| | | pad = 0; |
| | | } |
| | | return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); |
| | | } |
| | | |
| | | /** |
| | | * å°æ°å转åæASCIIç 对åºçå符ï¼ç¨äºå¯¹ææè¿è¡è¡¥ç |
| | | * |
| | | * @param a éè¦è½¬åçæ°å |
| | | * @return 转åå¾å°çå符 |
| | | */ |
| | | static char chr(int a) { |
| | | byte target = (byte) (a & 0xFF); |
| | | return (char) target; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * 对å
¬ä¼å¹³å°åéç»å
¬ä¼è´¦å·çæ¶æ¯å è§£å¯ç¤ºä¾ä»£ç . |
| | | * |
| | | * @copyright Copyright (c) 1998-2014 Tencent Inc. |
| | | */ |
| | | |
| | | // ------------------------------------------------------------------------ |
| | | |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * SHA1 class |
| | | * |
| | | * 计ç®å
¬ä¼å¹³å°çæ¶æ¯ç¾åæ¥å£. |
| | | */ |
| | | public class SHA1 { |
| | | |
| | | /** |
| | | * ç¨SHA1ç®æ³çæå®å
¨ç¾å |
| | | * @param token ç¥¨æ® |
| | | * @param timestamp æ¶é´æ³ |
| | | * @param nonce éæºå符串 |
| | | * @param encrypt 坿 |
| | | * @return å®å
¨ç¾å |
| | | * @throws AesException |
| | | */ |
| | | public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException |
| | | { |
| | | try { |
| | | String[] array = new String[] { token, timestamp, nonce, encrypt }; |
| | | StringBuffer sb = new StringBuffer(); |
| | | // å符串æåº |
| | | Arrays.sort(array); |
| | | for (int i = 0; i < 4; i++) { |
| | | sb.append(array[i]); |
| | | } |
| | | String str = sb.toString(); |
| | | // SHA1ç¾åçæ |
| | | MessageDigest md = MessageDigest.getInstance("SHA-1"); |
| | | md.update(str.getBytes()); |
| | | byte[] digest = md.digest(); |
| | | |
| | | StringBuffer hexstr = new StringBuffer(); |
| | | String shaHex = ""; |
| | | for (int i = 0; i < digest.length; i++) { |
| | | shaHex = Integer.toHexString(digest[i] & 0xFF); |
| | | if (shaHex.length() < 2) { |
| | | hexstr.append(0); |
| | | } |
| | | hexstr.append(shaHex); |
| | | } |
| | | return hexstr.toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new AesException(AesException.ComputeSignatureError); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx |
| | | |
| | | import cn.flightfeather.supervision.common.net.WXHttpService |
| | | import cn.flightfeather.supervision.domain.entity.LogMsgSubscribeWx |
| | | import cn.flightfeather.supervision.domain.mapper.LogMsgSubscribeWxMapper |
| | | import com.alibaba.fastjson.JSON |
| | | import com.google.gson.Gson |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import java.util.* |
| | | import javax.annotation.PostConstruct |
| | | |
| | | /** |
| | | * 微信订é
æ¶æ¯æ¨¡æ¿ç®¡ç |
| | | */ |
| | | @Component |
| | | class TemplateManager { |
| | | |
| | | companion object { |
| | | private lateinit var instance: TemplateManager |
| | | |
| | | //æ¨éå°ç¨åºçæ¬ |
| | | private const val PROGRAM_STATE_1 = "developer"//å¼åç |
| | | private const val PROGRAM_STATE_2 = "trial"//ä½éªç |
| | | private const val PROGRAM_STATE_3 = "formal"//æ£å¼ç |
| | | |
| | | const val TEMPLATE_1 = "6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8"//å计æ¶å°ææéï¼å°è´¦ |
| | | const val TEMPLATE_2 = "zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU"//代åäºé¡¹æéï¼èªæµæºè¯ |
| | | const val TEMPLATE_3 = "zPNMzF5WsshniJyl83DD-u7MyVoUozOc2kjK8dGZcSA"//代åäºé¡¹æéï¼éè¦éç¥ï¼å¦ä¼è®®ãæ¿åºå
¬åï¼æå®ï¼ |
| | | const val TEMPLATE_4 = "dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w"//å¤å¿äºé¡¹æéï¼æªè®¤è¯æéæå
¶ä» |
| | | |
| | | //模æ¿idå对åºç跳转路å¾(å·²æé¡ºåºå°½éä¸è¦ä¿®æ¹ï¼æ°æ¨¡æ¿å¾å顺延) |
| | | val templateList = listOf( |
| | | Pair(TEMPLATE_1,"pages/m_user/userlogin/userlogin"), |
| | | Pair(TEMPLATE_2,"pages/m_user/userlogin/userlogin"), |
| | | Pair(TEMPLATE_3,"pages/m_user/userlogin/userlogin"), |
| | | Pair(TEMPLATE_4,"pages/m_user/userlogin/userlogin"), |
| | | ) |
| | | } |
| | | |
| | | @Autowired |
| | | lateinit var wxTokenManager: WxTokenManager |
| | | |
| | | @Autowired |
| | | lateinit var logMsgSubscribeWxMapper: LogMsgSubscribeWxMapper |
| | | |
| | | @PostConstruct |
| | | fun init() { |
| | | instance = this |
| | | } |
| | | |
| | | fun sendMsg(templateId: Int, openId: String, dataList: List<String>): Boolean { |
| | | val token = wxTokenManager.getAccessToken() |
| | | val msg = newTemplate(templateId, openId, dataList) |
| | | val res = WXHttpService.sendMsg(token, msg) |
| | | return if (res) { |
| | | //åéæåï¼åè®°å½ç¸åºçæ¥å¿ |
| | | val log = LogMsgSubscribeWx().apply { |
| | | lmsOpenId = msg.touser |
| | | lmsTemplateId = msg.template_id |
| | | lmsData = Gson().toJson(msg.data) |
| | | lmsTime = Date() |
| | | lmsResult = false |
| | | } |
| | | logMsgSubscribeWxMapper.insert(log) |
| | | true |
| | | } else { |
| | | false |
| | | } |
| | | } |
| | | |
| | | fun newTemplate(templateId: Int, openId: String, dataList: List<String>): MessageWxVo { |
| | | val t = templateList[templateId] |
| | | val msg = MessageWxVo(openId, t.first, t.second, PROGRAM_STATE_3, "zh_CN") |
| | | when (templateId) { |
| | | 0 -> { |
| | | val temp = Template1() |
| | | if (dataList.size == 4) { |
| | | temp.thing1.value = dataList[0] |
| | | temp.time2.value = dataList[1] |
| | | temp.number3.value = dataList[2] |
| | | temp.thing4.value = dataList[3] |
| | | } |
| | | msg.data = temp |
| | | } |
| | | 1 -> { |
| | | val temp = Template2() |
| | | if (dataList.size == 5) { |
| | | temp.thing15.value = dataList[0] |
| | | temp.thing1.value = dataList[1] |
| | | temp.thing4.value = dataList[2] |
| | | temp.time10.value = dataList[3] |
| | | temp.thing12.value = dataList[4] |
| | | } |
| | | msg.data = temp |
| | | } |
| | | 2 -> { |
| | | val temp = Template3() |
| | | if (dataList.size == 4) { |
| | | temp.thing1.value = dataList[0] |
| | | temp.thing4.value = dataList[1] |
| | | temp.time10.value = dataList[2] |
| | | temp.thing12.value = dataList[3] |
| | | } |
| | | msg.data = temp |
| | | } |
| | | } |
| | | return msg |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å°è´¦åè®¡æ¶æé |
| | | */ |
| | | inner class Template1 { |
| | | //å计æ¶åç§° |
| | | val thing1: TValue = TValue("") |
| | | |
| | | //ç®æ æ¶é´ |
| | | val time2: TValue = TValue("") |
| | | |
| | | //å©ä½å¤©æ° |
| | | val number3: TValue = TValue("") |
| | | |
| | | //夿³¨ |
| | | val thing4: TValue = TValue("") |
| | | } |
| | | |
| | | /** |
| | | * èªæµæºè¯æé |
| | | */ |
| | | inner class Template2 { |
| | | //äºé¡¹ç±»å |
| | | val thing15: TValue = TValue("") |
| | | |
| | | //äºé¡¹ä¸»é¢ |
| | | val thing1: TValue = TValue("") |
| | | |
| | | //äºé¡¹æè¿° |
| | | val thing4: TValue = TValue("") |
| | | |
| | | //æªæ¢æ¶é´ |
| | | val time10: TValue = TValue("") |
| | | |
| | | //夿³¨æ¶æ¯ |
| | | val thing12: TValue = TValue("") |
| | | } |
| | | |
| | | /** |
| | | * éè¦éç¥ï¼å¦ä¼è®®ãæ¿åºå
¬åï¼æå®ï¼ |
| | | */ |
| | | inner class Template3 { |
| | | //äºé¡¹ä¸»é¢ |
| | | val thing1: TValue = TValue("") |
| | | |
| | | //äºé¡¹æè¿° |
| | | val thing4: TValue = TValue("") |
| | | |
| | | //æªæ¢æ¶é´ |
| | | val time10: TValue = TValue("") |
| | | |
| | | //夿³¨æ¶æ¯ |
| | | val thing12: TValue = TValue("") |
| | | } |
| | | |
| | | /** |
| | | * æªè®¤è¯æéæå
¶ä» |
| | | */ |
| | | inner class Template4 { |
| | | //æ´»å¨äºä»¶ |
| | | val thing1: TValue = TValue("") |
| | | |
| | | //å¤å¿äºé¡¹ |
| | | val thing3: TValue = TValue("") |
| | | |
| | | //å¼å§æ¶é´ |
| | | val time2: TValue = TValue("") |
| | | |
| | | //温馨æç¤º |
| | | val thing5: TValue = TValue("") |
| | | |
| | | //宿è¿åº¦ |
| | | val thing4: TValue = TValue("") |
| | | } |
| | | |
| | | data class TValue(var value: String) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * 对å
¬ä¼å¹³å°åéç»å
¬ä¼è´¦å·çæ¶æ¯å è§£å¯ç¤ºä¾ä»£ç . |
| | | * |
| | | * @copyright Copyright (c) 1998-2014 Tencent Inc. |
| | | */ |
| | | |
| | | // ------------------------------------------------------------------------ |
| | | |
| | | /** |
| | | * é对org.apache.commons.codec.binary.Base64ï¼ |
| | | * éè¦å¯¼å
¥æ¶å
commons-codec-1.9ï¼æcommons-codec-1.8çå
¶ä»çæ¬ï¼ |
| | | * 宿¹ä¸è½½å°åï¼http://commons.apache.org/proper/commons-codec/download_codec.cgi |
| | | */ |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.util.Arrays; |
| | | import java.util.Random; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.spec.IvParameterSpec; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | /** |
| | | * æä¾æ¥æ¶åæ¨éç»å
¬ä¼å¹³å°æ¶æ¯çå è§£å¯æ¥å£(UTF8ç¼ç çå符串). |
| | | * <ol> |
| | | * <li>ç¬¬ä¸æ¹åå¤å 坿¶æ¯ç»å
¬ä¼å¹³å°</li> |
| | | * <li>ç¬¬ä¸æ¹æ¶å°å
¬ä¼å¹³å°åéçæ¶æ¯ï¼éªè¯æ¶æ¯çå®å
¨æ§ï¼å¹¶å¯¹æ¶æ¯è¿è¡è§£å¯ã</li> |
| | | * </ol> |
| | | * 说æï¼å¼å¸¸java.security.InvalidKeyException:illegal Key Sizeçè§£å³æ¹æ¡ |
| | | * <ol> |
| | | * <li>å¨å®æ¹ç½ç«ä¸è½½JCEæ éå¶æéçç¥æä»¶ï¼JDK7çä¸è½½å°åï¼ |
| | | * http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html</li> |
| | | * <li>ä¸è½½åè§£åï¼å¯ä»¥çå°local_policy.jaråUS_export_policy.jar以åreadme.txt</li> |
| | | * <li>妿å®è£
äºJREï¼å°ä¸¤ä¸ªjaræä»¶æ¾å°%JRE_HOME%\lib\securityç®å½ä¸è¦ç忥çæä»¶</li> |
| | | * <li>妿å®è£
äºJDKï¼å°ä¸¤ä¸ªjaræä»¶æ¾å°%JDK_HOME%\jre\lib\securityç®å½ä¸è¦ç忥æä»¶</li> |
| | | * </ol> |
| | | */ |
| | | public class WXBizMsgCrypt { |
| | | static Charset CHARSET = Charset.forName("utf-8"); |
| | | Base64 base64 = new Base64(); |
| | | byte[] aesKey; |
| | | String token; |
| | | String appId; |
| | | |
| | | /** |
| | | * æé 彿° |
| | | * @param token å
¬ä¼å¹³å°ä¸ï¼å¼åè
设置çtoken |
| | | * @param encodingAesKey å
¬ä¼å¹³å°ä¸ï¼å¼åè
设置çEncodingAESKey |
| | | * @param appId å
¬ä¼å¹³å°appid |
| | | * |
| | | * @throws AesException æ§è¡å¤±è´¥ï¼è¯·æ¥ç该å¼å¸¸çé误ç åå
·ä½çéè¯¯ä¿¡æ¯ |
| | | */ |
| | | public WXBizMsgCrypt(String token, String encodingAesKey, String appId) throws AesException { |
| | | if (encodingAesKey.length() != 43) { |
| | | throw new AesException(AesException.IllegalAesKey); |
| | | } |
| | | |
| | | this.token = token; |
| | | this.appId = appId; |
| | | aesKey = Base64.decodeBase64(encodingAesKey + "="); |
| | | } |
| | | |
| | | // çæ4个åèçç½ç»åèåº |
| | | byte[] getNetworkBytesOrder(int sourceNumber) { |
| | | byte[] orderBytes = new byte[4]; |
| | | orderBytes[3] = (byte) (sourceNumber & 0xFF); |
| | | orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF); |
| | | orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF); |
| | | orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF); |
| | | return orderBytes; |
| | | } |
| | | |
| | | // è¿å4个åèçç½ç»åèåº |
| | | int recoverNetworkBytesOrder(byte[] orderBytes) { |
| | | int sourceNumber = 0; |
| | | for (int i = 0; i < 4; i++) { |
| | | sourceNumber <<= 8; |
| | | sourceNumber |= orderBytes[i] & 0xff; |
| | | } |
| | | return sourceNumber; |
| | | } |
| | | |
| | | // éæºçæ16ä½å符串 |
| | | String getRandomStr() { |
| | | String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (int i = 0; i < 16; i++) { |
| | | int number = random.nextInt(base.length()); |
| | | sb.append(base.charAt(number)); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 对ææè¿è¡å å¯. |
| | | * |
| | | * @param text éè¦å å¯çææ |
| | | * @return å å¯åbase64ç¼ç çå符串 |
| | | * @throws AesException aeså å¯å¤±è´¥ |
| | | */ |
| | | String encrypt(String randomStr, String text) throws AesException { |
| | | ByteGroup byteCollector = new ByteGroup(); |
| | | byte[] randomStrBytes = randomStr.getBytes(CHARSET); |
| | | byte[] textBytes = text.getBytes(CHARSET); |
| | | byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length); |
| | | byte[] appidBytes = appId.getBytes(CHARSET); |
| | | |
| | | // randomStr + networkBytesOrder + text + appid |
| | | byteCollector.addBytes(randomStrBytes); |
| | | byteCollector.addBytes(networkBytesOrder); |
| | | byteCollector.addBytes(textBytes); |
| | | byteCollector.addBytes(appidBytes); |
| | | |
| | | // ... + pad: 使ç¨èªå®ä¹çå¡«å
æ¹å¼å¯¹ææè¿è¡è¡¥ä½å¡«å
|
| | | byte[] padBytes = PKCS7Encoder.encode(byteCollector.size()); |
| | | byteCollector.addBytes(padBytes); |
| | | |
| | | // è·å¾æç»çåèæµ, æªå å¯ |
| | | byte[] unencrypted = byteCollector.toBytes(); |
| | | |
| | | try { |
| | | // 设置å 坿¨¡å¼ä¸ºAESçCBCæ¨¡å¼ |
| | | Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); |
| | | SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES"); |
| | | IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16); |
| | | cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv); |
| | | |
| | | // å å¯ |
| | | byte[] encrypted = cipher.doFinal(unencrypted); |
| | | |
| | | // 使ç¨BASE64对å å¯åçå符串è¿è¡ç¼ç |
| | | String base64Encrypted = base64.encodeToString(encrypted); |
| | | |
| | | return base64Encrypted; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new AesException(AesException.EncryptAESError); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 坹坿è¿è¡è§£å¯. |
| | | * |
| | | * @param text éè¦è§£å¯ç坿 |
| | | * @return è§£å¯å¾å°çææ |
| | | * @throws AesException aesè§£å¯å¤±è´¥ |
| | | */ |
| | | String decrypt(String text) throws AesException { |
| | | byte[] original; |
| | | try { |
| | | // è®¾ç½®è§£å¯æ¨¡å¼ä¸ºAESçCBCæ¨¡å¼ |
| | | Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); |
| | | SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES"); |
| | | IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16)); |
| | | cipher.init(Cipher.DECRYPT_MODE, key_spec, iv); |
| | | |
| | | // 使ç¨BASE64坹坿è¿è¡è§£ç |
| | | byte[] encrypted = Base64.decodeBase64(text); |
| | | |
| | | // è§£å¯ |
| | | original = cipher.doFinal(encrypted); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new AesException(AesException.DecryptAESError); |
| | | } |
| | | |
| | | String xmlContent, from_appid; |
| | | try { |
| | | // å»é¤è¡¥ä½å符 |
| | | byte[] bytes = PKCS7Encoder.decode(original); |
| | | |
| | | // å离16ä½éæºå符串,ç½ç»åèåºåAppId |
| | | byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20); |
| | | |
| | | int xmlLength = recoverNetworkBytesOrder(networkOrder); |
| | | |
| | | xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET); |
| | | from_appid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length), |
| | | CHARSET); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new AesException(AesException.IllegalBuffer); |
| | | } |
| | | |
| | | // appidä¸ç¸åçæ
åµ |
| | | if (!from_appid.equals(appId)) { |
| | | throw new AesException(AesException.ValidateAppidError); |
| | | } |
| | | return xmlContent; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å°å
¬ä¼å¹³å°åå¤ç¨æ·çæ¶æ¯å 坿å
. |
| | | * <ol> |
| | | * <li>对è¦åéçæ¶æ¯è¿è¡AES-CBCå å¯</li> |
| | | * <li>çæå®å
¨ç¾å</li> |
| | | * <li>å°æ¶æ¯å¯æåå®å
¨ç¾åæå
æxmlæ ¼å¼</li> |
| | | * </ol> |
| | | * |
| | | * @param replyMsg å
¬ä¼å¹³å°å¾
åå¤ç¨æ·çæ¶æ¯ï¼xmlæ ¼å¼çå符串 |
| | | * @param timeStamp æ¶é´æ³ï¼å¯ä»¥èªå·±çæï¼ä¹å¯ä»¥ç¨URLåæ°çtimestamp |
| | | * @param nonce éæºä¸²ï¼å¯ä»¥èªå·±çæï¼ä¹å¯ä»¥ç¨URLåæ°çnonce |
| | | * |
| | | * @return å å¯åçå¯ä»¥ç´æ¥åå¤ç¨æ·ç坿ï¼å
æ¬msg_signature, timestamp, nonce, encryptçxmlæ ¼å¼çå符串 |
| | | * @throws AesException æ§è¡å¤±è´¥ï¼è¯·æ¥ç该å¼å¸¸çé误ç åå
·ä½çéè¯¯ä¿¡æ¯ |
| | | */ |
| | | public String encryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException { |
| | | // å å¯ |
| | | String encrypt = encrypt(getRandomStr(), replyMsg); |
| | | |
| | | // çæå®å
¨ç¾å |
| | | if (timeStamp == "") { |
| | | timeStamp = Long.toString(System.currentTimeMillis()); |
| | | } |
| | | |
| | | String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt); |
| | | |
| | | // System.out.println("åéç»å¹³å°çç¾åæ¯: " + signature[1].toString()); |
| | | // çæåéçxml |
| | | String result = XMLParse.generate(encrypt, signature, timeStamp, nonce); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ£éªæ¶æ¯çç宿§ï¼å¹¶ä¸è·åè§£å¯åçææ. |
| | | * <ol> |
| | | * <li>å©ç¨æ¶å°ç坿çæå®å
¨ç¾åï¼è¿è¡ç¾åéªè¯</li> |
| | | * <li>è¥éªè¯éè¿ï¼åæåxmlä¸çå 坿¶æ¯</li> |
| | | * <li>å¯¹æ¶æ¯è¿è¡è§£å¯</li> |
| | | * </ol> |
| | | * |
| | | * @param msgSignature ç¾å串ï¼å¯¹åºURLåæ°çmsg_signature |
| | | * @param timeStamp æ¶é´æ³ï¼å¯¹åºURLåæ°çtimestamp |
| | | * @param nonce éæºä¸²ï¼å¯¹åºURLåæ°çnonce |
| | | * @param postData 坿ï¼å¯¹åºPOST请æ±çæ°æ® |
| | | * |
| | | * @return è§£å¯åçåæ |
| | | * @throws AesException æ§è¡å¤±è´¥ï¼è¯·æ¥ç该å¼å¸¸çé误ç åå
·ä½çéè¯¯ä¿¡æ¯ |
| | | */ |
| | | public String decryptMsg(String msgSignature, String timeStamp, String nonce, String postData) |
| | | throws AesException { |
| | | |
| | | // å¯é¥ï¼å
¬ä¼è´¦å·çapp secret |
| | | // æå坿 |
| | | Object[] encrypt = XMLParse.extract(postData); |
| | | |
| | | // éªè¯å®å
¨ç¾å |
| | | String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt[1].toString()); |
| | | |
| | | // åURLä¸çç¾åæ¯è¾æ¯å¦ç¸ç |
| | | // System.out.println("ç¬¬ä¸æ¹æ¶å°URLä¸çç¾åï¼" + msg_sign); |
| | | // System.out.println("ç¬¬ä¸æ¹æ ¡éªç¾åï¼" + signature); |
| | | if (!signature.equals(msgSignature)) { |
| | | throw new AesException(AesException.ValidateSignatureError); |
| | | } |
| | | |
| | | // è§£å¯ |
| | | String result = decrypt(encrypt[1].toString()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * éªè¯URL |
| | | * @param msgSignature ç¾å串ï¼å¯¹åºURLåæ°çmsg_signature |
| | | * @param timeStamp æ¶é´æ³ï¼å¯¹åºURLåæ°çtimestamp |
| | | * @param nonce éæºä¸²ï¼å¯¹åºURLåæ°çnonce |
| | | * @param echoStr éæºä¸²ï¼å¯¹åºURLåæ°çechostr |
| | | * |
| | | * @return è§£å¯ä¹åçechostr |
| | | * @throws AesException æ§è¡å¤±è´¥ï¼è¯·æ¥ç该å¼å¸¸çé误ç åå
·ä½çéè¯¯ä¿¡æ¯ |
| | | */ |
| | | public String verifyUrl(String msgSignature, String timeStamp, String nonce, String echoStr) |
| | | throws AesException { |
| | | String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr); |
| | | |
| | | if (!signature.equals(msgSignature)) { |
| | | throw new AesException(AesException.ValidateSignatureError); |
| | | } |
| | | |
| | | String result = decrypt(echoStr); |
| | | return result; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx |
| | | |
| | | object WxConfig { |
| | | /**å°ç¨åºç³è¯·äºä¸¤ä¸ªå
¬ä¼å·ï¼éæ©å
¶ä¸ä¸ç§*************************************************************/ |
| | | //å°ç½å¨è¯¢ |
| | | // const val APP_ID="wxffd1438dd373fcf6" |
| | | // const val SECRET = "83c5ecfb9b2ae882b577a5c04ff7c3bd" |
| | | |
| | | //ä¸å°å¾®ä¼ä¸çæç¯å¢å®æ³æºè½æå¡ |
| | | const val APP_ID="wx5758efcebb0774de" |
| | | const val SECRET = "444a906c37ae3f2eab609060d944f624" |
| | | const val USER_NAME = "gh_c60faa57000f" |
| | | /*********************************************************************************************/ |
| | | |
| | | //å°ç¨åºæ¨éæ¶æ¯éªè¯token |
| | | const val TOKEN = "ledger" |
| | | |
| | | const val AES_KEY = "ou43VsUPRFNmEIoVXsy038z0NPLbPAiIAysGrg1YFlZ" |
| | | |
| | | //ç¨æ·æ¥æ¶æææ¶æ¶æ¯æ¨éçå
³é®è¯ |
| | | const val S_ACCEPT = "accept" |
| | | const val S_REJECT = "reject" |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx |
| | | |
| | | import cn.flightfeather.supervision.common.net.WXHttpService |
| | | import org.springframework.stereotype.Component |
| | | import java.util.concurrent.Executors |
| | | import java.util.concurrent.ScheduledExecutorService |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | /** |
| | | * å°ç¨åºå
¨å±åå°æ¥å£è°ç¨åæ®ç®¡ç |
| | | */ |
| | | @Component |
| | | class WxTokenManager { |
| | | |
| | | companion object { |
| | | private const val TAG = "WxTokenManager" |
| | | } |
| | | private var schedule = Executors.newScheduledThreadPool(2) |
| | | |
| | | private var token = "" |
| | | |
| | | fun run(){ |
| | | if (token.isBlank()) { |
| | | refreshToken(0) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å·æ°æ¥å£è°ç¨åè¯ |
| | | * @param delay å»¶è¿æ§è¡æ¶é´ï¼åä½ï¼ç§ |
| | | * @param force æ¯å¦å¼ºå¶ä¸æå½å线ç¨ï¼éæ°æ§è¡ |
| | | */ |
| | | fun refreshToken(delay:Long, force:Boolean = false) { |
| | | if (force) { |
| | | schedule = closeThread(schedule) |
| | | } |
| | | schedule.schedule({ |
| | | getTokenTask() |
| | | }, delay, TimeUnit.SECONDS) |
| | | } |
| | | |
| | | fun getAccessToken(): String { |
| | | if (token.isBlank()) { |
| | | throw IllegalStateException("[${TAG}]è·åå°ç¨åºæ¥å£è°ç¨åæ®ï¼å½åtokenè¿æªè·åå°") |
| | | } |
| | | return token |
| | | } |
| | | |
| | | private fun getTokenTask() { |
| | | val res = WXHttpService.getAccessToken() |
| | | if (res == null) { |
| | | //请æ±å¤±è´¥ï¼10såéè¯ |
| | | refreshToken(10) |
| | | } else { |
| | | var nextDelay = 6900L//ä¸ä¸æ¬¡è·ååè¯æ¶é´é´éï¼ç§ï¼ |
| | | when (res["errcode"]?.asInt) { |
| | | //è¯·æ±æå |
| | | null, 0 -> { |
| | | val t = res["access_token"]?.asString |
| | | if (t == null) { |
| | | refreshToken(60) |
| | | } else { |
| | | token = t |
| | | res["expires_in"]?.asLong?.let { nextDelay = it - 300 } |
| | | refreshToken(nextDelay) |
| | | } |
| | | } |
| | | //微信æå¡å¨ç³»ç»ç¹å¿ï¼ç¨åéè¯ |
| | | -1 -> { |
| | | refreshToken(60) |
| | | } |
| | | //AppSecreté误 |
| | | 40001 -> { |
| | | throw IllegalStateException("[${TAG}]è·åå°ç¨åºæ¥å£è°ç¨åæ®ï¼AppSecret[${WxConfig.SECRET}]é误") |
| | | } |
| | | 40002 -> { |
| | | throw IllegalStateException("[${TAG}]è·åå°ç¨åºæ¥å£è°ç¨åæ®ï¼è¯·ç¡®ä¿grant_typeåæ®µå¼ä¸ºclient_credential") |
| | | } |
| | | 40003 -> { |
| | | throw IllegalStateException("[${TAG}]è·åå°ç¨åºæ¥å£è°ç¨åæ®ï¼AppID[${WxConfig.APP_ID}]é误") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun closeThread(s: ScheduledExecutorService): ScheduledExecutorService { |
| | | try { |
| | | s.shutdown() |
| | | if (s.awaitTermination(10, TimeUnit.SECONDS)) { |
| | | s.shutdownNow() |
| | | } |
| | | } catch (e: InterruptedException) { |
| | | e.printStackTrace() |
| | | s.shutdownNow() |
| | | } |
| | | return Executors.newScheduledThreadPool(2) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * 对å
¬ä¼å¹³å°åéç»å
¬ä¼è´¦å·çæ¶æ¯å è§£å¯ç¤ºä¾ä»£ç . |
| | | * |
| | | * @copyright Copyright (c) 1998-2014 Tencent Inc. |
| | | */ |
| | | |
| | | // ------------------------------------------------------------------------ |
| | | |
| | | package cn.flightfeather.supervision.common.wx; |
| | | |
| | | import java.io.StringReader; |
| | | |
| | | import javax.xml.parsers.DocumentBuilder; |
| | | import javax.xml.parsers.DocumentBuilderFactory; |
| | | |
| | | import org.w3c.dom.Document; |
| | | import org.w3c.dom.Element; |
| | | import org.w3c.dom.NodeList; |
| | | import org.xml.sax.InputSource; |
| | | |
| | | /** |
| | | * XMLParse class |
| | | * |
| | | * æä¾æåæ¶æ¯æ ¼å¼ä¸ç坿åçæå夿¶æ¯æ ¼å¼çæ¥å£. |
| | | */ |
| | | class XMLParse { |
| | | |
| | | /** |
| | | * æååºxmlæ°æ®å
ä¸çå 坿¶æ¯ |
| | | * @param xmltext å¾
æåçxmlå符串 |
| | | * @return æååºçå 坿¶æ¯å符串 |
| | | * @throws AesException |
| | | */ |
| | | public static Object[] extract(String xmltext) throws AesException { |
| | | Object[] result = new Object[3]; |
| | | try { |
| | | DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); |
| | | dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); |
| | | dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); |
| | | dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); |
| | | dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); |
| | | dbf.setXIncludeAware(false); |
| | | dbf.setExpandEntityReferences(false); |
| | | DocumentBuilder db = dbf.newDocumentBuilder(); |
| | | StringReader sr = new StringReader(xmltext); |
| | | InputSource is = new InputSource(sr); |
| | | Document document = db.parse(is); |
| | | |
| | | Element root = document.getDocumentElement(); |
| | | NodeList nodelist1 = root.getElementsByTagName("Encrypt"); |
| | | NodeList nodelist2 = root.getElementsByTagName("ToUserName"); |
| | | result[0] = 0; |
| | | result[1] = nodelist1.item(0).getTextContent(); |
| | | result[2] = nodelist2.item(0).getTextContent(); |
| | | return result; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new AesException(AesException.ParseXmlError); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çæxmlæ¶æ¯ |
| | | * @param encrypt å å¯åçæ¶æ¯å¯æ |
| | | * @param signature å®å
¨ç¾å |
| | | * @param timestamp æ¶é´æ³ |
| | | * @param nonce éæºå符串 |
| | | * @return çæçxmlå符串 |
| | | */ |
| | | public static String generate(String encrypt, String signature, String timestamp, String nonce) { |
| | | |
| | | String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n" |
| | | + "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n" |
| | | + "<TimeStamp>%3$s</TimeStamp>\n" + "<Nonce><![CDATA[%4$s]]></Nonce>\n" + "</xml>"; |
| | | return String.format(format, encrypt, signature, timestamp, nonce); |
| | | |
| | | } |
| | | } |
| | |
| | | private String biName; |
| | | |
| | | /** |
| | | * ç¨æ·ç®ç§° |
| | | */ |
| | | @Column(name = "BI_Nick_Name") |
| | | private String biNickName; |
| | | |
| | | /** |
| | | * æå±å
¬å¸id |
| | | */ |
| | | @Column(name = "CI_GUID") |
| | |
| | | */ |
| | | @Column(name = "CI_Name") |
| | | private String ciName; |
| | | |
| | | @Column(name = "BI_Province_Code") |
| | | private String biProvinceCode; |
| | | |
| | | @Column(name = "BI_Province_Name") |
| | | private String biProvinceName; |
| | | |
| | | @Column(name = "BI_City_Code") |
| | | private String biCityCode; |
| | | |
| | | @Column(name = "BI_City_Name") |
| | | private String biCityName; |
| | | |
| | | @Column(name = "BI_District_Code") |
| | | private String biDistrictCode; |
| | | |
| | | @Column(name = "BI_District_Name") |
| | | private String biDistrictName; |
| | | |
| | | @Column(name = "BI_Town_Code") |
| | | private String biTownCode; |
| | | |
| | | @Column(name = "BI_Town_Name") |
| | | private String biTownName; |
| | | |
| | | /** |
| | | * æå±ç©ä¸å
¬å¸åç§°id |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ç®ç§° |
| | | * |
| | | * @return BI_Nick_Name - ç¨æ·ç®ç§° |
| | | */ |
| | | public String getBiNickName() { |
| | | return biNickName; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ç¨æ·ç®ç§° |
| | | * |
| | | * @param biNickName ç¨æ·ç®ç§° |
| | | */ |
| | | public void setBiNickName(String biNickName) { |
| | | this.biNickName = biNickName == null ? null : biNickName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±å
¬å¸id |
| | | * |
| | | * @return CI_GUID - æå±å
¬å¸id |
| | |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Province_Code |
| | | */ |
| | | public String getBiProvinceCode() { |
| | | return biProvinceCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biProvinceCode |
| | | */ |
| | | public void setBiProvinceCode(String biProvinceCode) { |
| | | this.biProvinceCode = biProvinceCode == null ? null : biProvinceCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Province_Name |
| | | */ |
| | | public String getBiProvinceName() { |
| | | return biProvinceName; |
| | | } |
| | | |
| | | /** |
| | | * @param biProvinceName |
| | | */ |
| | | public void setBiProvinceName(String biProvinceName) { |
| | | this.biProvinceName = biProvinceName == null ? null : biProvinceName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_City_Code |
| | | */ |
| | | public String getBiCityCode() { |
| | | return biCityCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biCityCode |
| | | */ |
| | | public void setBiCityCode(String biCityCode) { |
| | | this.biCityCode = biCityCode == null ? null : biCityCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_City_Name |
| | | */ |
| | | public String getBiCityName() { |
| | | return biCityName; |
| | | } |
| | | |
| | | /** |
| | | * @param biCityName |
| | | */ |
| | | public void setBiCityName(String biCityName) { |
| | | this.biCityName = biCityName == null ? null : biCityName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_District_Code |
| | | */ |
| | | public String getBiDistrictCode() { |
| | | return biDistrictCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biDistrictCode |
| | | */ |
| | | public void setBiDistrictCode(String biDistrictCode) { |
| | | this.biDistrictCode = biDistrictCode == null ? null : biDistrictCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_District_Name |
| | | */ |
| | | public String getBiDistrictName() { |
| | | return biDistrictName; |
| | | } |
| | | |
| | | /** |
| | | * @param biDistrictName |
| | | */ |
| | | public void setBiDistrictName(String biDistrictName) { |
| | | this.biDistrictName = biDistrictName == null ? null : biDistrictName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Town_Code |
| | | */ |
| | | public String getBiTownCode() { |
| | | return biTownCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biTownCode |
| | | */ |
| | | public void setBiTownCode(String biTownCode) { |
| | | this.biTownCode = biTownCode == null ? null : biTownCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Town_Name |
| | | */ |
| | | public String getBiTownName() { |
| | | return biTownName; |
| | | } |
| | | |
| | | /** |
| | | * @param biTownName |
| | | */ |
| | | public void setBiTownName(String biTownName) { |
| | | this.biTownName = biTownName == null ? null : biTownName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±ç©ä¸å
¬å¸åç§°id |
| | | * |
| | | * @return BI_Management_Company_Id - æå±ç©ä¸å
¬å¸åç§°id |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.entity; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "sys_log_msg_subscribe_wx") |
| | | public class LogMsgSubscribeWx { |
| | | @Id |
| | | @Column(name = "LMS_ID") |
| | | private Integer lmsId; |
| | | |
| | | @Column(name = "LMS_Open_Id") |
| | | private String lmsOpenId; |
| | | |
| | | @Column(name = "LMS_Template_Id") |
| | | private String lmsTemplateId; |
| | | |
| | | @Column(name = "LMS_Data") |
| | | private String lmsData; |
| | | |
| | | @Column(name = "LMS_Time") |
| | | private Date lmsTime; |
| | | |
| | | @Column(name = "LMS_Msg_Id") |
| | | private String lmsMsgId; |
| | | |
| | | @Column(name = "LMS_Result") |
| | | private Boolean lmsResult; |
| | | |
| | | @Column(name = "LMS_Extension1") |
| | | private String lmsExtension1; |
| | | |
| | | @Column(name = "LMS_Extension2") |
| | | private String lmsExtension2; |
| | | |
| | | @Column(name = "LMS_Extension3") |
| | | private String lmsExtension3; |
| | | |
| | | @Column(name = "LMS_Remark") |
| | | private String lmsRemark; |
| | | |
| | | /** |
| | | * @return LMS_ID |
| | | */ |
| | | public Integer getLmsId() { |
| | | return lmsId; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsId |
| | | */ |
| | | public void setLmsId(Integer lmsId) { |
| | | this.lmsId = lmsId; |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Open_Id |
| | | */ |
| | | public String getLmsOpenId() { |
| | | return lmsOpenId; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsOpenId |
| | | */ |
| | | public void setLmsOpenId(String lmsOpenId) { |
| | | this.lmsOpenId = lmsOpenId == null ? null : lmsOpenId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Template_Id |
| | | */ |
| | | public String getLmsTemplateId() { |
| | | return lmsTemplateId; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsTemplateId |
| | | */ |
| | | public void setLmsTemplateId(String lmsTemplateId) { |
| | | this.lmsTemplateId = lmsTemplateId == null ? null : lmsTemplateId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Data |
| | | */ |
| | | public String getLmsData() { |
| | | return lmsData; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsData |
| | | */ |
| | | public void setLmsData(String lmsData) { |
| | | this.lmsData = lmsData == null ? null : lmsData.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Time |
| | | */ |
| | | public Date getLmsTime() { |
| | | return lmsTime; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsTime |
| | | */ |
| | | public void setLmsTime(Date lmsTime) { |
| | | this.lmsTime = lmsTime; |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Msg_Id |
| | | */ |
| | | public String getLmsMsgId() { |
| | | return lmsMsgId; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsMsgId |
| | | */ |
| | | public void setLmsMsgId(String lmsMsgId) { |
| | | this.lmsMsgId = lmsMsgId == null ? null : lmsMsgId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Result |
| | | */ |
| | | public Boolean getLmsResult() { |
| | | return lmsResult; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsResult |
| | | */ |
| | | public void setLmsResult(Boolean lmsResult) { |
| | | this.lmsResult = lmsResult; |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Extension1 |
| | | */ |
| | | public String getLmsExtension1() { |
| | | return lmsExtension1; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsExtension1 |
| | | */ |
| | | public void setLmsExtension1(String lmsExtension1) { |
| | | this.lmsExtension1 = lmsExtension1 == null ? null : lmsExtension1.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Extension2 |
| | | */ |
| | | public String getLmsExtension2() { |
| | | return lmsExtension2; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsExtension2 |
| | | */ |
| | | public void setLmsExtension2(String lmsExtension2) { |
| | | this.lmsExtension2 = lmsExtension2 == null ? null : lmsExtension2.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Extension3 |
| | | */ |
| | | public String getLmsExtension3() { |
| | | return lmsExtension3; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsExtension3 |
| | | */ |
| | | public void setLmsExtension3(String lmsExtension3) { |
| | | this.lmsExtension3 = lmsExtension3 == null ? null : lmsExtension3.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return LMS_Remark |
| | | */ |
| | | public String getLmsRemark() { |
| | | return lmsRemark; |
| | | } |
| | | |
| | | /** |
| | | * @param lmsRemark |
| | | */ |
| | | public void setLmsRemark(String lmsRemark) { |
| | | this.lmsRemark = lmsRemark == null ? null : lmsRemark.trim(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.entity; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "ea_t_msg_subscribe_wx") |
| | | public class MsgSubscribeWx { |
| | | @Id |
| | | @Column(name = "MS_ID") |
| | | private Integer msId; |
| | | |
| | | /** |
| | | * 订é
çæ¨¡æ¿id |
| | | */ |
| | | @Column(name = "MS_Template_Id") |
| | | private String msTemplateId; |
| | | |
| | | @Column(name = "MS_Open_Id") |
| | | private String msOpenId; |
| | | |
| | | /** |
| | | * å©ä½è®¢é
æ¬¡æ° |
| | | */ |
| | | @Column(name = "MS_Count") |
| | | private Integer msCount; |
| | | |
| | | /** |
| | | * æ¯å¦æ¥æ¶æ¨é |
| | | */ |
| | | @Column(name = "MS_Accept") |
| | | private Boolean msAccept; |
| | | |
| | | /** |
| | | * ææ°æä½æ¶é´ |
| | | */ |
| | | @Column(name = "MS_Update_Time") |
| | | private Date msUpdateTime; |
| | | |
| | | @Column(name = "MS_Extension1") |
| | | private String msExtension1; |
| | | |
| | | @Column(name = "MS_Extension2") |
| | | private String msExtension2; |
| | | |
| | | @Column(name = "MS_Extension3") |
| | | private String msExtension3; |
| | | |
| | | @Column(name = "MS_Remark") |
| | | private String msRemark; |
| | | |
| | | /** |
| | | * @return MS_ID |
| | | */ |
| | | public Integer getMsId() { |
| | | return msId; |
| | | } |
| | | |
| | | /** |
| | | * @param msId |
| | | */ |
| | | public void setMsId(Integer msId) { |
| | | this.msId = msId; |
| | | } |
| | | |
| | | /** |
| | | * è·å订é
çæ¨¡æ¿id |
| | | * |
| | | * @return MS_Template_Id - 订é
çæ¨¡æ¿id |
| | | */ |
| | | public String getMsTemplateId() { |
| | | return msTemplateId; |
| | | } |
| | | |
| | | /** |
| | | * 设置订é
çæ¨¡æ¿id |
| | | * |
| | | * @param msTemplateId 订é
çæ¨¡æ¿id |
| | | */ |
| | | public void setMsTemplateId(String msTemplateId) { |
| | | this.msTemplateId = msTemplateId == null ? null : msTemplateId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return MS_Open_Id |
| | | */ |
| | | public String getMsOpenId() { |
| | | return msOpenId; |
| | | } |
| | | |
| | | /** |
| | | * @param msOpenId |
| | | */ |
| | | public void setMsOpenId(String msOpenId) { |
| | | this.msOpenId = msOpenId == null ? null : msOpenId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå©ä½è®¢é
æ¬¡æ° |
| | | * |
| | | * @return MS_Count - å©ä½è®¢é
æ¬¡æ° |
| | | */ |
| | | public Integer getMsCount() { |
| | | return msCount; |
| | | } |
| | | |
| | | /** |
| | | * 设置å©ä½è®¢é
æ¬¡æ° |
| | | * |
| | | * @param msCount å©ä½è®¢é
æ¬¡æ° |
| | | */ |
| | | public void setMsCount(Integer msCount) { |
| | | this.msCount = msCount; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¯å¦æ¥æ¶æ¨é |
| | | * |
| | | * @return MS_Accept - æ¯å¦æ¥æ¶æ¨é |
| | | */ |
| | | public Boolean getMsAccept() { |
| | | return msAccept; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¯å¦æ¥æ¶æ¨é |
| | | * |
| | | * @param msAccept æ¯å¦æ¥æ¶æ¨é |
| | | */ |
| | | public void setMsAccept(Boolean msAccept) { |
| | | this.msAccept = msAccept; |
| | | } |
| | | |
| | | /** |
| | | * è·åææ°æä½æ¶é´ |
| | | * |
| | | * @return MS_Update_Time - ææ°æä½æ¶é´ |
| | | */ |
| | | public Date getMsUpdateTime() { |
| | | return msUpdateTime; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ææ°æä½æ¶é´ |
| | | * |
| | | * @param msUpdateTime ææ°æä½æ¶é´ |
| | | */ |
| | | public void setMsUpdateTime(Date msUpdateTime) { |
| | | this.msUpdateTime = msUpdateTime; |
| | | } |
| | | |
| | | /** |
| | | * @return MS_Extension1 |
| | | */ |
| | | public String getMsExtension1() { |
| | | return msExtension1; |
| | | } |
| | | |
| | | /** |
| | | * @param msExtension1 |
| | | */ |
| | | public void setMsExtension1(String msExtension1) { |
| | | this.msExtension1 = msExtension1 == null ? null : msExtension1.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return MS_Extension2 |
| | | */ |
| | | public String getMsExtension2() { |
| | | return msExtension2; |
| | | } |
| | | |
| | | /** |
| | | * @param msExtension2 |
| | | */ |
| | | public void setMsExtension2(String msExtension2) { |
| | | this.msExtension2 = msExtension2 == null ? null : msExtension2.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return MS_Extension3 |
| | | */ |
| | | public String getMsExtension3() { |
| | | return msExtension3; |
| | | } |
| | | |
| | | /** |
| | | * @param msExtension3 |
| | | */ |
| | | public void setMsExtension3(String msExtension3) { |
| | | this.msExtension3 = msExtension3 == null ? null : msExtension3.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return MS_Remark |
| | | */ |
| | | public String getMsRemark() { |
| | | return msRemark; |
| | | } |
| | | |
| | | /** |
| | | * @param msRemark |
| | | */ |
| | | public void setMsRemark(String msRemark) { |
| | | this.msRemark = msRemark == null ? null : msRemark.trim(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.entity; |
| | | |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "ea_t_personal_info") |
| | | public class PersonalInfo { |
| | | /** |
| | | * 个人信æ¯id |
| | | */ |
| | | @Id |
| | | @Column(name = "PI_GUID") |
| | | private String piGuid; |
| | | |
| | | /** |
| | | * å§å |
| | | */ |
| | | @Column(name = "PI_Name") |
| | | private String piName; |
| | | |
| | | /** |
| | | * 个人è¯ä»¶ç±»åid |
| | | */ |
| | | @Column(name = "PI_ID_Type_Num") |
| | | private Byte piIdTypeNum; |
| | | |
| | | /** |
| | | * 个人è¯ä»¶ç±»å |
| | | */ |
| | | @Column(name = "PI_ID_Type") |
| | | private String piIdType; |
| | | |
| | | /** |
| | | * è¯ä»¶ç¼å· |
| | | */ |
| | | @Column(name = "PI_ID") |
| | | private String piId; |
| | | |
| | | /** |
| | | * èä½ç¼å· |
| | | */ |
| | | @Column(name = "PI_Position_Num") |
| | | private Byte piPositionNum; |
| | | |
| | | /** |
| | | * èä½ |
| | | */ |
| | | @Column(name = "PI_Position") |
| | | private String piPosition; |
| | | |
| | | @Column(name = "PI_Extension1") |
| | | private String piExtension1; |
| | | |
| | | @Column(name = "PI_Extension2") |
| | | private String piExtension2; |
| | | |
| | | @Column(name = "PI_Extension3") |
| | | private String piExtension3; |
| | | |
| | | @Column(name = "PI_Remark") |
| | | private String piRemark; |
| | | |
| | | /** |
| | | * è·å个人信æ¯id |
| | | * |
| | | * @return PI_GUID - 个人信æ¯id |
| | | */ |
| | | public String getPiGuid() { |
| | | return piGuid; |
| | | } |
| | | |
| | | /** |
| | | * 设置个人信æ¯id |
| | | * |
| | | * @param piGuid 个人信æ¯id |
| | | */ |
| | | public void setPiGuid(String piGuid) { |
| | | this.piGuid = piGuid == null ? null : piGuid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå§å |
| | | * |
| | | * @return PI_Name - å§å |
| | | */ |
| | | public String getPiName() { |
| | | return piName; |
| | | } |
| | | |
| | | /** |
| | | * 设置å§å |
| | | * |
| | | * @param piName å§å |
| | | */ |
| | | public void setPiName(String piName) { |
| | | this.piName = piName == null ? null : piName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å个人è¯ä»¶ç±»åid |
| | | * |
| | | * @return PI_ID_Type_Num - 个人è¯ä»¶ç±»åid |
| | | */ |
| | | public Byte getPiIdTypeNum() { |
| | | return piIdTypeNum; |
| | | } |
| | | |
| | | /** |
| | | * 设置个人è¯ä»¶ç±»åid |
| | | * |
| | | * @param piIdTypeNum 个人è¯ä»¶ç±»åid |
| | | */ |
| | | public void setPiIdTypeNum(Byte piIdTypeNum) { |
| | | this.piIdTypeNum = piIdTypeNum; |
| | | } |
| | | |
| | | /** |
| | | * è·å个人è¯ä»¶ç±»å |
| | | * |
| | | * @return PI_ID_Type - 个人è¯ä»¶ç±»å |
| | | */ |
| | | public String getPiIdType() { |
| | | return piIdType; |
| | | } |
| | | |
| | | /** |
| | | * 设置个人è¯ä»¶ç±»å |
| | | * |
| | | * @param piIdType 个人è¯ä»¶ç±»å |
| | | */ |
| | | public void setPiIdType(String piIdType) { |
| | | this.piIdType = piIdType == null ? null : piIdType.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè¯ä»¶ç¼å· |
| | | * |
| | | * @return PI_ID - è¯ä»¶ç¼å· |
| | | */ |
| | | public String getPiId() { |
| | | return piId; |
| | | } |
| | | |
| | | /** |
| | | * 设置è¯ä»¶ç¼å· |
| | | * |
| | | * @param piId è¯ä»¶ç¼å· |
| | | */ |
| | | public void setPiId(String piId) { |
| | | this.piId = piId == null ? null : piId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åèä½ç¼å· |
| | | * |
| | | * @return PI_Position_Num - èä½ç¼å· |
| | | */ |
| | | public Byte getPiPositionNum() { |
| | | return piPositionNum; |
| | | } |
| | | |
| | | /** |
| | | * 设置èä½ç¼å· |
| | | * |
| | | * @param piPositionNum èä½ç¼å· |
| | | */ |
| | | public void setPiPositionNum(Byte piPositionNum) { |
| | | this.piPositionNum = piPositionNum; |
| | | } |
| | | |
| | | /** |
| | | * è·åèä½ |
| | | * |
| | | * @return PI_Position - èä½ |
| | | */ |
| | | public String getPiPosition() { |
| | | return piPosition; |
| | | } |
| | | |
| | | /** |
| | | * 设置èä½ |
| | | * |
| | | * @param piPosition èä½ |
| | | */ |
| | | public void setPiPosition(String piPosition) { |
| | | this.piPosition = piPosition == null ? null : piPosition.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return PI_Extension1 |
| | | */ |
| | | public String getPiExtension1() { |
| | | return piExtension1; |
| | | } |
| | | |
| | | /** |
| | | * @param piExtension1 |
| | | */ |
| | | public void setPiExtension1(String piExtension1) { |
| | | this.piExtension1 = piExtension1 == null ? null : piExtension1.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return PI_Extension2 |
| | | */ |
| | | public String getPiExtension2() { |
| | | return piExtension2; |
| | | } |
| | | |
| | | /** |
| | | * @param piExtension2 |
| | | */ |
| | | public void setPiExtension2(String piExtension2) { |
| | | this.piExtension2 = piExtension2 == null ? null : piExtension2.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return PI_Extension3 |
| | | */ |
| | | public String getPiExtension3() { |
| | | return piExtension3; |
| | | } |
| | | |
| | | /** |
| | | * @param piExtension3 |
| | | */ |
| | | public void setPiExtension3(String piExtension3) { |
| | | this.piExtension3 = piExtension3 == null ? null : piExtension3.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return PI_Remark |
| | | */ |
| | | public String getPiRemark() { |
| | | return piRemark; |
| | | } |
| | | |
| | | /** |
| | | * @param piRemark |
| | | */ |
| | | public void setPiRemark(String piRemark) { |
| | | this.piRemark = piRemark == null ? null : piRemark.trim(); |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "ea_t_restaurant_base_info") |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | public class RestaurantBaseInfo implements BaseSpecialInfo { |
| | | public class RestaurantBaseInfo implements BaseSpecialInfo{ |
| | | @Id |
| | | @Column(name = "RB_GUID") |
| | | private String rbGuid; |
| | |
| | | */ |
| | | @Column(name = "RB_Concentration_Area") |
| | | private String rbConcentrationArea; |
| | | |
| | | /** |
| | | * æå£æ°é |
| | | */ |
| | | @Column(name = "RB_Outfall_Count") |
| | | private Integer rbOutfallCount; |
| | | |
| | | /** |
| | | * æå£ä½ç½® |
| | | */ |
| | | @Column(name = "RB_Outfall_Location") |
| | | private String rbOutfallLocation; |
| | | |
| | | /** |
| | | * æå£ç¼å· |
| | | */ |
| | | @Column(name = "RB_Outfall_Num") |
| | | private String rbOutfallNum; |
| | | |
| | | @Column(name = "RB_Extension1") |
| | | private String rbExtension1; |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæå£æ°é |
| | | * |
| | | * @return RB_Outfall_Count - æå£æ°é |
| | | */ |
| | | public Integer getRbOutfallCount() { |
| | | return rbOutfallCount; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå£æ°é |
| | | * |
| | | * @param rbOutfallCount æå£æ°é |
| | | */ |
| | | public void setRbOutfallCount(Integer rbOutfallCount) { |
| | | this.rbOutfallCount = rbOutfallCount; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå£ä½ç½® |
| | | * |
| | | * @return RB_Outfall_Location - æå£ä½ç½® |
| | | */ |
| | | public String getRbOutfallLocation() { |
| | | return rbOutfallLocation; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå£ä½ç½® |
| | | * |
| | | * @param rbOutfallLocation æå£ä½ç½® |
| | | */ |
| | | public void setRbOutfallLocation(String rbOutfallLocation) { |
| | | this.rbOutfallLocation = rbOutfallLocation == null ? null : rbOutfallLocation.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå£ç¼å· |
| | | * |
| | | * @return RB_Outfall_Num - æå£ç¼å· |
| | | */ |
| | | public String getRbOutfallNum() { |
| | | return rbOutfallNum; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå£ç¼å· |
| | | * |
| | | * @param rbOutfallNum æå£ç¼å· |
| | | */ |
| | | public void setRbOutfallNum(String rbOutfallNum) { |
| | | this.rbOutfallNum = rbOutfallNum == null ? null : rbOutfallNum.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return RB_Extension1 |
| | | */ |
| | | public String getRbExtension1() { |
| | |
| | | |
| | | @Table(name = "sm_t_userinfo_wx") |
| | | public class UserInfoWx { |
| | | @Column(name = "UI_GUID") |
| | | private String uiGuid; |
| | | |
| | | /** |
| | | * 微信id |
| | | */ |
| | | @Id |
| | | @Column(name = "UI_Open_Id") |
| | | private String uiOpenId; |
| | | |
| | | /** |
| | | * åºæ¯id |
| | | */ |
| | | @Column(name = "UI_GUID") |
| | | private String uiGuid; |
| | | |
| | | /** |
| | | * ä¼ä¸id |
| | | */ |
| | | @Column(name = "CI_GUID") |
| | | private String ciGuid; |
| | | |
| | | /** |
| | | * 微信æµç§° |
| | | */ |
| | | @Column(name = "UI_Nick_Name") |
| | | private String uiNickName; |
| | | |
| | |
| | | @Column(name = "UI_City") |
| | | private String uiCity; |
| | | |
| | | /** |
| | | * 微信头å |
| | | */ |
| | | @Column(name = "UI_Avatar_Url") |
| | | private String uiAvatarUrl; |
| | | |
| | | /** |
| | | * 微信ä¼è¯sessionId |
| | | */ |
| | | @Column(name = "UI_UnionId") |
| | | private String uiUnionid; |
| | | |
| | | /** |
| | | * @return UI_GUID |
| | | * 个人信æ¯id |
| | | */ |
| | | public String getUiGuid() { |
| | | return uiGuid; |
| | | } |
| | | @Column(name = "PI_GUID") |
| | | private String piGuid; |
| | | |
| | | /** |
| | | * @param uiGuid |
| | | */ |
| | | public void setUiGuid(String uiGuid) { |
| | | this.uiGuid = uiGuid == null ? null : uiGuid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return UI_Open_Id |
| | | * è·å微信id |
| | | * |
| | | * @return UI_Open_Id - 微信id |
| | | */ |
| | | public String getUiOpenId() { |
| | | return uiOpenId; |
| | | } |
| | | |
| | | /** |
| | | * @param uiOpenId |
| | | * 设置微信id |
| | | * |
| | | * @param uiOpenId 微信id |
| | | */ |
| | | public void setUiOpenId(String uiOpenId) { |
| | | this.uiOpenId = uiOpenId == null ? null : uiOpenId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return UI_Nick_Name |
| | | * è·ååºæ¯id |
| | | * |
| | | * @return UI_GUID - åºæ¯id |
| | | */ |
| | | public String getUiGuid() { |
| | | return uiGuid; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®åºæ¯id |
| | | * |
| | | * @param uiGuid åºæ¯id |
| | | */ |
| | | public void setUiGuid(String uiGuid) { |
| | | this.uiGuid = uiGuid == null ? null : uiGuid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¼ä¸id |
| | | * |
| | | * @return CI_GUID - ä¼ä¸id |
| | | */ |
| | | public String getCiGuid() { |
| | | return ciGuid; |
| | | } |
| | | |
| | | /** |
| | | * 设置ä¼ä¸id |
| | | * |
| | | * @param ciGuid ä¼ä¸id |
| | | */ |
| | | public void setCiGuid(String ciGuid) { |
| | | this.ciGuid = ciGuid == null ? null : ciGuid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å微信æµç§° |
| | | * |
| | | * @return UI_Nick_Name - 微信æµç§° |
| | | */ |
| | | public String getUiNickName() { |
| | | return uiNickName; |
| | | } |
| | | |
| | | /** |
| | | * @param uiNickName |
| | | * 设置微信æµç§° |
| | | * |
| | | * @param uiNickName 微信æµç§° |
| | | */ |
| | | public void setUiNickName(String uiNickName) { |
| | | this.uiNickName = uiNickName == null ? null : uiNickName.trim(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @return UI_Avatar_Url |
| | | * è·å微信头å |
| | | * |
| | | * @return UI_Avatar_Url - 微信头å |
| | | */ |
| | | public String getUiAvatarUrl() { |
| | | return uiAvatarUrl; |
| | | } |
| | | |
| | | /** |
| | | * @param uiAvatarUrl |
| | | * 设置微信头å |
| | | * |
| | | * @param uiAvatarUrl 微信头å |
| | | */ |
| | | public void setUiAvatarUrl(String uiAvatarUrl) { |
| | | this.uiAvatarUrl = uiAvatarUrl == null ? null : uiAvatarUrl.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return UI_UnionId |
| | | * è·å微信ä¼è¯sessionId |
| | | * |
| | | * @return UI_UnionId - 微信ä¼è¯sessionId |
| | | */ |
| | | public String getUiUnionid() { |
| | | return uiUnionid; |
| | | } |
| | | |
| | | /** |
| | | * @param uiUnionid |
| | | * 设置微信ä¼è¯sessionId |
| | | * |
| | | * @param uiUnionid 微信ä¼è¯sessionId |
| | | */ |
| | | public void setUiUnionid(String uiUnionid) { |
| | | this.uiUnionid = uiUnionid == null ? null : uiUnionid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å个人信æ¯id |
| | | * |
| | | * @return PI_GUID - 个人信æ¯id |
| | | */ |
| | | public String getPiGuid() { |
| | | return piGuid; |
| | | } |
| | | |
| | | /** |
| | | * 设置个人信æ¯id |
| | | * |
| | | * @param piGuid 个人信æ¯id |
| | | */ |
| | | public void setPiGuid(String piGuid) { |
| | | this.piGuid = piGuid == null ? null : piGuid.trim(); |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.entity |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | import java.util.* |
| | | import javax.persistence.Column |
| | | import javax.persistence.Id |
| | | import javax.persistence.Table |
| | | |
| | | @Table(name = "sm_t_userinfo") |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | open class Userinfo { |
| | | open class Userinfo { |
| | | @Id |
| | | @Column(name = "UI_GUID") |
| | | var guid: String? = null |
| | |
| | | var password: String? = null |
| | | |
| | | /** |
| | | * |
| | | * å¼å表ä¸è·åï¼1ï¼æå¸ç¨æ·ï¼2ï¼è¢«ç管对象åä½ç¨æ·ï¼3ï¼ä¸»ç®¡é¨é¨ç¨æ·ï¼ |
| | | */ |
| | | @Column(name = "UI_UserTypeID") |
| | | var usertypeid: Byte? = null |
| | |
| | | @Column(name = "UI_WechatID") |
| | | var wechatid: String? = null |
| | | |
| | | @Column(name = "UI_Create_Time") |
| | | var uiCreateTime: Date? = null |
| | | |
| | | @Column(name = "UI_Login_Time") |
| | | var uiLoginTime: Date? = null |
| | | |
| | | @Column(name = "UI_Extension1") |
| | | var extension1: String? = null |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.enumeration |
| | | |
| | | /** |
| | | * ç¨æ·è®¤è¯ç¶æ |
| | | */ |
| | | enum class AuthenticationStatus(val value: Byte, val des: String) { |
| | | YES(1, "authenticated"), |
| | | NO(0, "unauthorized") |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.LogMsgSubscribeWx |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface LogMsgSubscribeWxMapper : MyMapper<LogMsgSubscribeWx?> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.MsgSubscribeWx |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface MsgSubscribeWxMapper : MyMapper<MsgSubscribeWx?> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.PersonalInfo |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface PersonalInfoMapper : MyMapper<PersonalInfo?> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.infrastructure.utils |
| | | |
| | | import net.sourceforge.pinyin4j.PinyinHelper |
| | | |
| | | class PinYin { |
| | | |
| | | companion object{ |
| | | fun getPinYinHeader(str: String): String { |
| | | |
| | | val temp = str.trim() |
| | | val result = StringBuilder() |
| | | for (i in temp.indices) { |
| | | if (i >= 6) { |
| | | break |
| | | } |
| | | val it = temp[i] |
| | | if (it in 'a'..'z' || it in 'A'..'Z' || it in '0'..'9') { |
| | | result.append(it.toString()) //妿å符串æ¯è±æä¸æ¹å |
| | | } else { |
| | | PinyinHelper.toHanyuPinyinStringArray(it)?.let { pinyin -> |
| | | result.append(pinyin[0].elementAt(0) + "") |
| | | } |
| | | } |
| | | } |
| | | |
| | | return result.toString() |
| | | } |
| | | |
| | | /** |
| | | * 第ä¸ä¸ªæåè·å宿´æ¼é³ï¼ä¹åçåªåé¦åæ¯ |
| | | */ |
| | | fun getPinYinHeader2(str: String): Array<String>? { |
| | | val temp = str.trim() |
| | | val result = mutableListOf<String>() |
| | | var i = 0 |
| | | temp.forEach { |
| | | // if (i >= 6) { |
| | | // return@forEach |
| | | // } |
| | | if (it in 'a'..'z' || it in 'A'..'Z' || it in '0'..'9') { |
| | | result.add(it.toString()) //妿å符串æ¯è±æä¸æ¹å |
| | | } else { |
| | | PinyinHelper.toHanyuPinyinStringArray(it)?.let { pinyin -> |
| | | if (i == 0) { |
| | | result.add(pinyin[0].dropLast(1)) |
| | | } else { |
| | | result.add(pinyin[0].elementAt(0) + "") |
| | | } |
| | | } |
| | | } |
| | | i++ |
| | | } |
| | | |
| | | return result.toTypedArray() |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.Company |
| | | import cn.flightfeather.supervision.domain.entity.PersonalInfo |
| | | import cn.flightfeather.supervision.domain.enumeration.SceneType |
| | | import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | |
| | | interface AuthService { |
| | | |
| | | fun authCompany(wxUserId: String, company: Company): BaseResponse<String> |
| | | |
| | | /** |
| | | * ç¨æ·åºæ¯è®¤è¯ |
| | | * @param wxUserId å¾®ä¿¡ç¨æ·openId |
| | | * @param sceneType åºæ¯ç±»åï¼[SceneType.value] |
| | | * @param sceneInfo åºæ¯ä¿¡æ¯ï¼[AuthSceneVo] |
| | | * @see SceneType |
| | | * @see AuthSceneVo |
| | | * @return è®¤è¯æåä¸å¦ |
| | | */ |
| | | fun authScene(wxUserId: String, sceneType: Int, sceneInfo: String): BaseResponse<String> |
| | | |
| | | fun authPersonal(wxUserId: String, personalInfo: PersonalInfo): BaseResponse<String> |
| | | |
| | | /** |
| | | * è·åç¨æ·è®¤è¯ç¶æ |
| | | * @param wxUserId å¾®ä¿¡ç¨æ·openId |
| | | * @param userId åºæ¯ç¨æ·id |
| | | * @return 认è¯ç¶æï¼ [ä¼ä¸è®¤è¯ç¶æ, åºæ¯è®¤è¯ç¶æ, 个人认è¯ç¶æ] |
| | | */ |
| | | fun authStatus(wxUserId: String?, userId: String?): BaseResponse<List<Boolean>> |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.Impl |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.* |
| | | import cn.flightfeather.supervision.domain.enumeration.AuthenticationStatus |
| | | import cn.flightfeather.supervision.domain.enumeration.SceneType |
| | | import cn.flightfeather.supervision.domain.mapper.* |
| | | import cn.flightfeather.supervision.infrastructure.utils.PinYin |
| | | import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.lightshare.service.AuthService |
| | | import cn.flightfeather.supervision.lightshare.vo.AuthSceneRestVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import com.google.gson.Gson |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.transaction.annotation.Transactional |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | @Service |
| | | class AuthServiceImpl( |
| | | private val userinfoMapper: UserinfoMapper, |
| | | private val userInfoWxMapper: UserInfoWxMapper, |
| | | private val companyMapper: CompanyMapper, |
| | | private val personalInfoMapper: PersonalInfoMapper, |
| | | private val baseInfoMapper: BaseInfoMapper, |
| | | private val fumePurifyDeviceMapper: FumePurifyDeviceMapper, |
| | | private val monitorDeviceMapper: MonitorDeviceMapper, |
| | | private val restaurantBaseInfoMapper: RestaurantBaseInfoMapper, |
| | | private val vehicleBaseInfoMapper: VehicleBaseInfoMapper |
| | | ): AuthService { |
| | | |
| | | @Transactional |
| | | override fun authCompany(wxUserId: String, company: Company): BaseResponse<String> { |
| | | val wxUser = userInfoWxMapper.selectByPrimaryKey(wxUserId) ?: return BaseResponse(false, "ç¨æ·å¾®ä¿¡idä¸åå¨") |
| | | company.ciExtension3 = AuthenticationStatus.YES.des |
| | | if (company.ciGuid == null) { |
| | | company.ciGuid = UUIDGenerator.generate16ShortUUID() |
| | | companyMapper.insert(company) |
| | | } else { |
| | | companyMapper.updateByPrimaryKeySelective(company) |
| | | } |
| | | val bInfo = if (wxUser.uiGuid == null) null else baseInfoMapper.selectByPrimaryKey(wxUser.uiGuid) |
| | | if (bInfo != null && bInfo.ciGuid != company.ciGuid) { |
| | | bInfo.ciGuid = company.ciGuid |
| | | bInfo.ciName = company.ciName |
| | | baseInfoMapper.updateByPrimaryKeySelective(bInfo) |
| | | } |
| | | if (wxUser.ciGuid != company.ciGuid) { |
| | | wxUser.ciGuid = company.ciGuid |
| | | userInfoWxMapper.updateByPrimaryKeySelective(wxUser) |
| | | } |
| | | return BaseResponse(true) |
| | | } |
| | | |
| | | @Transactional |
| | | override fun authScene(wxUserId: String, sceneType: Int, sceneInfo: String): BaseResponse<String> { |
| | | // val user = userinfoMapper.selectByPrimaryKey(userId) ?: return BaseResponse(false, "ç¨æ·åºæ¯idä¸åå¨") |
| | | val wxUser = userInfoWxMapper.selectByPrimaryKey(wxUserId) ?: return BaseResponse(false, "ç¨æ·å¾®ä¿¡idä¸åå¨") |
| | | val gson = Gson() |
| | | // ææåºæ¯ç»ä¸çåºç¡ä¿¡æ¯ |
| | | val asVo = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | var bInfo = if (wxUser.uiGuid == null) null else baseInfoMapper.selectByPrimaryKey(wxUser.uiGuid) |
| | | if (bInfo == null) { |
| | | val cInfo = if (wxUser.ciGuid == null) null else companyMapper.selectByPrimaryKey(wxUser.ciGuid) |
| | | val name = getUName(asVo.biName ?: "") |
| | | //æ°å»ºåºæ¯è´¦å·ååºæ¯ä¿¡æ¯ |
| | | val newUser = Userinfo().apply { |
| | | guid = UUIDGenerator.generate16ShortUUID() |
| | | acountname = name |
| | | realname = asVo.biName |
| | | password = "123456" |
| | | usertypeid = 3 |
| | | usertype = "ä¼ä¸" |
| | | isenable = true |
| | | if (asVo.biLocation.isNotEmpty()) extension1 = asVo.biLocation[2] |
| | | extension2 = sceneType.toString() |
| | | } |
| | | bInfo = asVo.toNewBaseInfo(newUser, cInfo) |
| | | userinfoMapper.insert(newUser) |
| | | baseInfoMapper.insert(bInfo) |
| | | } else { |
| | | val userInfo = userinfoMapper.selectByPrimaryKey(bInfo.biGuid) |
| | | userInfo.apply { |
| | | realname = asVo.biName |
| | | if (asVo.biLocation.isNotEmpty()) extension1 = asVo.biLocation[2] |
| | | } |
| | | asVo.updateBaseInfo(bInfo) |
| | | userinfoMapper.updateByPrimaryKeySelective(userInfo) |
| | | baseInfoMapper.updateByPrimaryKeySelective(bInfo) |
| | | } |
| | | val userId = bInfo.biGuid |
| | | when (sceneType) { |
| | | SceneType.Restaurant.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneRestVo::class.java) |
| | | //é¤é¥®åºåºæ¬ä¿¡æ¯å½å
¥ |
| | | var rbInfo = restaurantBaseInfoMapper.selectByPrimaryKey(userId) |
| | | if (rbInfo == null) { |
| | | rbInfo = info.toNewRestInfo(userId) |
| | | restaurantBaseInfoMapper.insert(rbInfo) |
| | | } else { |
| | | info.updateRestInfo(rbInfo) |
| | | restaurantBaseInfoMapper.updateByPrimaryKeySelective(rbInfo) |
| | | } |
| | | //é¤é¥®åºæ²¹çååè£
置信æ¯å½å
¥ |
| | | var fpdInfo = fumePurifyDeviceMapper.selectByExample(Example(FumePurifyDevice::class.java).apply { |
| | | createCriteria().andEqualTo("fpUserId", userId) |
| | | })?.takeIf { it.isNotEmpty() }?.get(0) |
| | | if (fpdInfo == null) { |
| | | fpdInfo = info.toNewFpdInfo(bInfo) |
| | | fumePurifyDeviceMapper.insert(fpdInfo) |
| | | } else { |
| | | info.updateFpdInfo(fpdInfo) |
| | | fumePurifyDeviceMapper.updateByPrimaryKeySelective(fpdInfo) |
| | | } |
| | | //é¤é¥®åºæ²¹ççæµè®¾å¤ä¿¡æ¯å½å
¥ |
| | | var mdInfo = monitorDeviceMapper.selectByExample(Example(MonitorDevice::class.java).apply { |
| | | createCriteria().andEqualTo("mdUserId", userId) |
| | | })?.takeIf { it.isNotEmpty() }?.get(0) |
| | | if (mdInfo == null) { |
| | | mdInfo = info.toNewMdInfo(bInfo) |
| | | monitorDeviceMapper.insert(mdInfo) |
| | | } else { |
| | | info.updateMdInfo(mdInfo) |
| | | monitorDeviceMapper.updateByPrimaryKeySelective(mdInfo) |
| | | } |
| | | } |
| | | SceneType.Construction.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | SceneType.Wharf.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | SceneType.StorageYard.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | SceneType.MixingPlant.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | SceneType.Industrial.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | SceneType.VehicleRepair.value -> { |
| | | val info = gson.fromJson(sceneInfo, AuthSceneVo::class.java) |
| | | } |
| | | else-> return BaseResponse(false, "ç¨æ·åºæ¯ç±»åé误") |
| | | } |
| | | |
| | | return BaseResponse(true, "åºæ¯è®¤è¯å®æ") |
| | | } |
| | | |
| | | override fun authPersonal(wxUserId: String, personalInfo: PersonalInfo): BaseResponse<String> { |
| | | val wxUser = userInfoWxMapper.selectByPrimaryKey(wxUserId) ?: return BaseResponse(false, "ç¨æ·å¾®ä¿¡idä¸åå¨") |
| | | personalInfo.piExtension3 = AuthenticationStatus.YES.des |
| | | if (personalInfo.piGuid == null) { |
| | | personalInfo.piGuid = UUIDGenerator.generate16ShortUUID() |
| | | personalInfoMapper.insert(personalInfo) |
| | | } else { |
| | | personalInfoMapper.updateByPrimaryKeySelective(personalInfo) |
| | | } |
| | | if (wxUser.piGuid != personalInfo.piGuid) { |
| | | wxUser.piGuid = personalInfo.piGuid |
| | | userInfoWxMapper.updateByPrimaryKeySelective(wxUser) |
| | | } |
| | | return BaseResponse(true) |
| | | } |
| | | |
| | | override fun authStatus(wxUserId: String?, userId: String?): BaseResponse<List<Boolean>> { |
| | | val status = mutableListOf(false, false, false) |
| | | if (wxUserId != null) { |
| | | val wxUser = userInfoWxMapper.selectByPrimaryKey(wxUserId) ?: return BaseResponse(false, "该微信账æ·ä¸åå¨") |
| | | //夿ä¼ä¸ä¿¡æ¯æ¯å¦è®¤è¯ |
| | | if (wxUser.ciGuid != null) { |
| | | companyMapper.selectByPrimaryKey(wxUser.ciGuid)?.let { c -> |
| | | if (c.ciExtension3 == AuthenticationStatus.YES.des) status[0] = true |
| | | } |
| | | } |
| | | //å¤æåºæ¯ä¿¡æ¯æ¯å¦è®¤è¯ |
| | | if (wxUser.uiGuid != null) { |
| | | baseInfoMapper.selectByPrimaryKey(wxUser.uiGuid)?.let {b -> |
| | | if (b.biExtension3 == AuthenticationStatus.YES.des) status[1] = true |
| | | } |
| | | } |
| | | //å¤æä¸ªäººä¿¡æ¯æ¯å¦è®¤è¯ |
| | | if (wxUser.piGuid != null) { |
| | | personalInfoMapper.selectByPrimaryKey(wxUser.piGuid)?.let { p -> |
| | | if (p.piExtension3 == AuthenticationStatus.YES.des) status[2] = true |
| | | } |
| | | } |
| | | }else if (userId != null) { |
| | | val user = userinfoMapper.selectByPrimaryKey(userId) ?: return BaseResponse(false, "è¯¥åºæ¯è´¦æ·ä¸åå¨") |
| | | val baseInfo = baseInfoMapper.selectByPrimaryKey(userId) |
| | | //夿ä¼ä¸ä¿¡æ¯æ¯å¦è®¤è¯ |
| | | if (baseInfo?.ciGuid != null) { |
| | | companyMapper.selectByPrimaryKey(baseInfo.ciGuid)?.let { c -> |
| | | if (c.ciExtension3 == AuthenticationStatus.YES.des) status[0] = true |
| | | } |
| | | } |
| | | //å¤æåºæ¯ä¿¡æ¯æ¯å¦è®¤è¯ |
| | | if (baseInfo?.biExtension3 == AuthenticationStatus.YES.des) status[1] = true |
| | | //å¤æä¸ªäººä¿¡æ¯æ¯å¦è®¤è¯ |
| | | // TODO: 2022/10/11 æ¤åæ¯ä¸ææ¶æ ä¸ªäººè®¤è¯ |
| | | } |
| | | |
| | | return BaseResponse(true, data = status) |
| | | } |
| | | |
| | | private fun getUName(sceneName: String): String { |
| | | var uName = if (sceneName.isNotBlank()) PinYin.getPinYinHeader(sceneName) else UUIDGenerator.generateShortUUID() |
| | | var repeated = false |
| | | var i = 1 |
| | | do { |
| | | userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | | createCriteria().andEqualTo("acountname", uName) |
| | | }).let { |
| | | repeated = it.isNotEmpty() |
| | | if (repeated) { |
| | | uName += i |
| | | } |
| | | } |
| | | i++ |
| | | } while (repeated && i < 20) |
| | | if (repeated) uName = UUIDGenerator.generateShortUUID() |
| | | return uName |
| | | } |
| | | } |
| | |
| | | if (sceneType != SceneType.NoType.value) { |
| | | createCriteria().andEqualTo("lScenetype", sceneType) |
| | | } |
| | | orderBy("lTypeid") |
| | | }) |
| | | val records = getLedgerRecords(userId, null, sceneType, time) |
| | | val resultList = mutableListOf<LedgerSubTypeVo>() |
| | |
| | | |
| | | } |
| | | |
| | | override fun getLedgerDetail2(userId: String, ledgerSubTypeId: Int?, sceneType: Int, time: String): List<LedgerVo> { |
| | | val records = getLedgerRecords(userId, ledgerSubTypeId, sceneType, time) |
| | | override fun getLedgerDetail2(userId: String, ledgerSubTypeId: Int?, sceneType: Int, time: String?): List<LedgerVo> { |
| | | val records = if (time != null) { |
| | | getLedgerRecords(userId, ledgerSubTypeId, sceneType, time) |
| | | } else { |
| | | // FIXME: 2022/10/13 ææ¶åªæ¯æledgerSubTypeIdä¸ä¸ºnullçæ
åµ |
| | | if (ledgerSubTypeId == null) return emptyList() |
| | | PageHelper.startPage<LedgerRecord>(1, 1) |
| | | ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply { |
| | | createCriteria().andEqualTo("lrSubmitid", userId) |
| | | .andEqualTo("lsSubtypeid", ledgerSubTypeId) |
| | | orderBy("lrSubmitdate").desc() |
| | | }) |
| | | } |
| | | val result = ArrayList<LedgerVo>() |
| | | records.forEach { |
| | | val media = ledgerMediaFileMapper.selectByExample( |
| | |
| | | override fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String> { |
| | | val year = time.split("-")[0] |
| | | val month = time.split("-")[1] |
| | | val date = DateUtil.StringToDate(time, DateUtil.DateStyle.YYYY_MM) |
| | | copyLedgerList.forEach { |
| | | //å»é夿 |
| | | val r = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply { |
| | |
| | | lr.lrYear = year.toInt() |
| | | lr.lrMonth = month.toByte() |
| | | lr.lrIssubmitontime = true |
| | | lr.lrSubmitdate = Date() |
| | | lr.lrSubmitdate = date |
| | | lr.lrExtension2 = "copy"//è¡¨ææ¯å¤å¶çå°è´¦ |
| | | ledgerRecordMapper.insert(lr) |
| | | |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.Impl |
| | | |
| | | import cn.flightfeather.supervision.common.net.WXHttpService |
| | | import cn.flightfeather.supervision.common.wx.MessageWxVo |
| | | import cn.flightfeather.supervision.common.wx.TemplateManager |
| | | import cn.flightfeather.supervision.common.wx.WxTokenManager |
| | | import cn.flightfeather.supervision.domain.entity.* |
| | | import cn.flightfeather.supervision.domain.enumeration.DistrictType |
| | | import cn.flightfeather.supervision.domain.enumeration.UserType |
| | | import cn.flightfeather.supervision.domain.mapper.NoticeMapper |
| | | import cn.flightfeather.supervision.domain.mapper.NoticeReadStateMapper |
| | | import cn.flightfeather.supervision.domain.mapper.NotificationMapper |
| | | import cn.flightfeather.supervision.domain.mapper.UserinfoMapper |
| | | import cn.flightfeather.supervision.lightshare.repository.MeetingParticipantRepository |
| | | import cn.flightfeather.supervision.lightshare.service.NotificationService |
| | | import cn.flightfeather.supervision.lightshare.vo.NoticeReadStateVo |
| | |
| | | import cn.flightfeather.supervision.push.PushService |
| | | import cn.flightfeather.supervision.domain.enumeration.ParticipantType |
| | | import cn.flightfeather.supervision.domain.enumeration.SceneType |
| | | import cn.flightfeather.supervision.domain.mapper.* |
| | | import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator |
| | | import com.alibaba.fastjson.JSON |
| | | import com.flightfeather.taizhang.model.enumeration.NotificationType |
| | | import com.flightfeather.taizhang.model.enumeration.WorkSubType |
| | | import com.github.pagehelper.PageHelper |
| | |
| | | val noticeMapper: NoticeMapper, |
| | | val noticeReadStateMapper: NoticeReadStateMapper, |
| | | val userinfoMapper: UserinfoMapper, |
| | | val meetingParticipantRepository: MeetingParticipantRepository |
| | | val meetingParticipantRepository: MeetingParticipantRepository, |
| | | val templateManager: TemplateManager |
| | | ) : NotificationService { |
| | | |
| | | override fun getNotificationUnRead(userId: String, page: Int, per_page: Int, response: HttpServletResponse): List<NotificationVo> { |
| | |
| | | } |
| | | return noticeMapper.insert(notice) == 1 |
| | | } |
| | | |
| | | override fun pushMsgWx(templateId: Int): String { |
| | | val res = templateManager.sendMsg(templateId, "otZkc5VRlwauEMPqMluQYdVa4zuE", listOf("å°è´¦ä¸ä¼ ", "2022å¹´10æ10æ¥", "3", "请éç¹å
³æ³¨ç°åºèªå¯»æ¥é¨å")) |
| | | return if (res) "success" else "fail" |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | val restaurantBaseInfoMapper: RestaurantBaseInfoMapper, |
| | | val vehicleBaseInfoMapper: VehicleBaseInfoMapper, |
| | | val userMapMapper: UserMapMapper, |
| | | val personalInfoMapper: PersonalInfoMapper, |
| | | val userInfoWxMapper: UserInfoWxMapper |
| | | ) : UserinfoService { |
| | | |
| | | //æ ¹æ®userinfoæ¡ä»¶æ¥è¯¢ |
| | |
| | | } |
| | | } |
| | | |
| | | override fun findOne(id: String): Userinfo{ |
| | | override fun findOne(id: String): Userinfo { |
| | | val userInfo = userinfoMapper.selectByPrimaryKey(id) |
| | | userMapMapper.selectByPrimaryKey(id)?.let { |
| | | userInfo?.extension3 = it.svUserId |
| | |
| | | } |
| | | } |
| | | |
| | | override fun changePassword(userId: String, oldPassword: String, newPassword: String): Int { |
| | | override fun changePassword(userId: String, oldPassword: String, newPassword: String): BaseResponse<String> { |
| | | if (newPassword.trim() == "") return BaseResponse(false, "æ°å¯ç ä¸è½ä¸ºç©º") |
| | | if (oldPassword == newPassword) return BaseResponse(false, "æ°å¯ç ä¸è½ååå¯ç ç¸å") |
| | | |
| | | val userInfo = findOne(userId) |
| | | return if (oldPassword != userInfo.password) { |
| | | 0 |
| | | BaseResponse(false, "åå¯ç é误") |
| | | } else { |
| | | val newUserInfo = Userinfo().apply { |
| | | guid = userInfo.guid |
| | | password = newPassword |
| | | remark = "pwChanged" |
| | | } |
| | | update(newUserInfo) |
| | | BaseResponse(true, "å¯ç ä¿®æ¹æå") |
| | | } |
| | | } |
| | | |
| | |
| | | return result |
| | | } |
| | | |
| | | override fun getBaseInfo(userId: String): UserBaseInfo { |
| | | override fun getBaseInfo(userId: String, wxUserId: String?): UserBaseInfo { |
| | | val userInfo = userinfoMapper.selectByPrimaryKey(userId) ?: return UserBaseInfo(userId) |
| | | val baseInfo = baseInfoMapper.selectByPrimaryKey(userId) ?: return UserBaseInfo(userId) |
| | | val baseInfo = baseInfoMapper.selectByPrimaryKey(userId) |
| | | val wxUser = if (wxUserId != null) userInfoWxMapper.selectByPrimaryKey(wxUserId) else null |
| | | |
| | | val mapper = when (userInfo.extension2) { |
| | | SceneType.Restaurant.value.toString() -> restaurantBaseInfoMapper |
| | | SceneType.VehicleRepair.value.toString() -> vehicleBaseInfoMapper |
| | | else -> restaurantBaseInfoMapper |
| | | else -> null |
| | | } |
| | | |
| | | val specialInfo = mapper.selectByPrimaryKey(baseInfo.biGuid) |
| | | val companyInfo = companyMapper.selectByPrimaryKey(baseInfo.ciGuid) |
| | | val specialInfo = mapper?.selectByPrimaryKey(baseInfo?.biGuid) |
| | | val companyInfo = companyMapper.selectByPrimaryKey(if (baseInfo?.ciGuid != null) baseInfo.ciGuid else wxUser?.ciGuid) |
| | | val personalInfo = personalInfoMapper.selectByPrimaryKey(wxUser?.piGuid) |
| | | |
| | | return UserBaseInfo(userId, userInfo.realname, baseInfo, companyInfo, specialInfo) |
| | | return UserBaseInfo(userId, userInfo.realname, baseInfo, companyInfo, specialInfo, personalInfo) |
| | | } |
| | | |
| | | override fun search(district: String?, sceneType: Int?, userType: Int?, page: Int, perPage: Int): BaseResponse<List<Userinfo>> { |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.Impl |
| | | |
| | | import cn.flightfeather.supervision.common.net.WXHttpService |
| | | import cn.flightfeather.supervision.common.wx.SHA1 |
| | | import cn.flightfeather.supervision.common.wx.WxConfig |
| | | import cn.flightfeather.supervision.domain.entity.LogMsgSubscribeWx |
| | | import cn.flightfeather.supervision.domain.entity.MsgSubscribeWx |
| | | 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.domain.mapper.* |
| | | import cn.flightfeather.supervision.lightshare.service.WxUserService |
| | | import cn.flightfeather.supervision.lightshare.vo.AccessToken |
| | | 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.JSON |
| | | import com.alibaba.fastjson.JSONArray |
| | | import com.alibaba.fastjson.JSONObject |
| | | import org.slf4j.LoggerFactory |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | @Service |
| | | class WxUserServiceImpl(val userinfoMapper: UserinfoMapper, val userInfoWxMapper: UserInfoWxMapper): WxUserService { |
| | | class WxUserServiceImpl( |
| | | val userinfoMapper: UserinfoMapper, |
| | | val userInfoWxMapper: UserInfoWxMapper, |
| | | val userMapMapper: UserMapMapper, |
| | | val baseInfoMapper: BaseInfoMapper, |
| | | private val msgSubscribeWxMapper: MsgSubscribeWxMapper, |
| | | private val logMsgSubscribeWxMapper: LogMsgSubscribeWxMapper |
| | | ): WxUserService { |
| | | |
| | | private val LOGGER = LoggerFactory.getLogger(WxUserServiceImpl::class.java) |
| | | |
| | | 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 { |
| | | WXHttpService.code2Session(accessTokenWX.code!!)?.let { |
| | | val openid = it.first |
| | | val unionid = it.second |
| | | val user = userInfoWxMapper.selectByPrimaryKey(openid) |
| | | return if (user == null || user.uiOpenId == null) { |
| | | val newUserWx = UserInfoWx().apply { |
| | | // uiGuid = UUIDGenerator.generate16ShortUUID() |
| | | uiOpenId = openid |
| | | uiNickName = accessTokenWX.nickName |
| | | uiGender |
| | | uiCountry |
| | | uiProvince |
| | | uiCity |
| | | uiAvatarUrl = accessTokenWX.avatarUrl |
| | | uiUnionid = unionid |
| | | } |
| | | uiOpenId = openid |
| | | uiNickName = accessTokenWX.nickName |
| | | uiGender |
| | | uiCountry |
| | | uiProvince |
| | | uiCity |
| | | uiAvatarUrl = accessTokenWX.avatarUrl |
| | | uiUnionid = unionid |
| | | } |
| | | // val newUser = Userinfo().apply { |
| | | // guid = newUserWx.uiGuid |
| | | // headIconUrl = newUserWx.uiAvatarUrl |
| | |
| | | // isenable = true |
| | | // wechatid = newUserWx.uiOpenId |
| | | // } |
| | | var r = userInfoWxMapper.insert(newUserWx) |
| | | var r = userInfoWxMapper.insert(newUserWx) |
| | | // r += userinfoMapper.insert(newUser) |
| | | return if (r == 1) { |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·æ³¨åæå") |
| | | } else { |
| | | BaseResponse(false, "å¾®ä¿¡ç¨æ·æ³¨å失败") |
| | | } |
| | | return if (r == 1) { |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·æ³¨åæå") |
| | | } else { |
| | | if (user.uiGuid != null) { |
| | | val userinfo = userinfoMapper.selectByPrimaryKey(user.uiGuid) |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·ç»å½æå", data = userinfo) |
| | | } else { |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·æªç»å®ä¼ä¸") |
| | | } |
| | | BaseResponse(false, "å¾®ä¿¡ç¨æ·æ³¨å失败") |
| | | } |
| | | } else { |
| | | return BaseResponse(false, "请æ±å¤±è´¥ï¼errcode=${json["errcode"]}") |
| | | if (user.uiGuid != null) { |
| | | val userinfo = userinfoMapper.selectByPrimaryKey(user.uiGuid) |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·ç»å½æå", data = userinfo) |
| | | } else { |
| | | BaseResponse(true, "å¾®ä¿¡ç¨æ·æªç»å®ä¼ä¸") |
| | | } |
| | | } |
| | | } |
| | | |
| | | return BaseResponse(false, "请æ±å¤±è´¥, æ æ³è®¿é®å¾®ä¿¡æ¥å£") |
| | | } |
| | | |
| | | override fun loginPw(accessTokenPW: AccessTokenPW): AccessToken { |
| | | //1. è´¦å·å¯ç ç»å½æ¶ï¼å°é带ç微信idä¸è´¦å·ç»å® |
| | | if (!accessTokenPW.userName.isNullOrBlank() && !accessTokenPW.password.isNullOrBlank()) { |
| | | val user = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | | createCriteria().andEqualTo("acountname", accessTokenPW.userName) |
| | | .andEqualTo("password",accessTokenPW.password) |
| | | }) |
| | | if (user.isEmpty()) return AccessToken() |
| | | |
| | | val result = AccessToken() |
| | | //1.1 微信id为空ï¼ç´æ¥ç»å½; 微信idä¸ä¸ºç©ºï¼ç»å®è³è´¦å· |
| | | if (!accessTokenPW.code.isNullOrBlank()) { |
| | | val baseInfo = baseInfoMapper.selectByPrimaryKey(user[0].guid) |
| | | WXHttpService.code2Session(accessTokenPW.code!!)?.let { |
| | | val openid = it.first |
| | | val unionid = it.second |
| | | val userWx = userInfoWxMapper.selectByPrimaryKey(openid) |
| | | result.openId = openid |
| | | return@let if (userWx == null || userWx.uiOpenId == null) { |
| | | val newUserWx = UserInfoWx().apply { |
| | | uiGuid = user[0].guid |
| | | ciGuid = baseInfo?.ciGuid |
| | | uiOpenId = openid |
| | | uiNickName = accessTokenPW.nickName |
| | | uiGender |
| | | uiCountry |
| | | uiProvince |
| | | uiCity |
| | | uiAvatarUrl = accessTokenPW.avatarUrl |
| | | uiUnionid = unionid |
| | | } |
| | | userInfoWxMapper.insert(newUserWx) |
| | | } else if (userWx.uiGuid != user[0].guid) { |
| | | userWx.uiGuid = user[0].guid |
| | | userWx.ciGuid = baseInfo?.ciGuid |
| | | userInfoWxMapper.updateByPrimaryKey(userWx) |
| | | } else { |
| | | return@let |
| | | } |
| | | } |
| | | } |
| | | return result.apply { |
| | | userId = user[0].guid |
| | | val sUser = userMapMapper.selectByPrimaryKey(userId) |
| | | sUserId = sUser?.svUserId |
| | | success = true |
| | | } |
| | | } |
| | | //2. å½å¾®ä¿¡ä¸é®ç»å½æ¶ï¼å¤æè´¦å·ç»å®æ
åµ |
| | | else if (!accessTokenPW.code.isNullOrBlank()) { |
| | | WXHttpService.code2Session(accessTokenPW.code!!)?.let { |
| | | val openid = it.first |
| | | val unionid = it.second |
| | | val userWx = userInfoWxMapper.selectByPrimaryKey(openid) |
| | | return if (userWx == null || userWx.uiOpenId == null) { |
| | | AccessToken() |
| | | } else { |
| | | val user = userinfoMapper.selectByPrimaryKey(userWx.uiGuid) |
| | | AccessToken().apply { |
| | | if (user?.guid == null) { |
| | | success = false |
| | | } else { |
| | | userId = user.guid |
| | | val sUser = userMapMapper.selectByPrimaryKey(userId) |
| | | sUserId = sUser?.svUserId |
| | | openId = openid |
| | | success = true |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return AccessToken() |
| | | } else { |
| | | return BaseResponse(false, "请æ±å¤±è´¥, æ æ³è®¿é®å¾®ä¿¡æ¥å£") |
| | | return AccessToken() |
| | | } |
| | | } |
| | | |
| | | override fun loginPw(accessTokenPW: AccessTokenPW): BaseResponse<Userinfo> { |
| | | TODO("Not yet implemented") |
| | | override fun subscribeCheck(signature: String, timestamp: String, nonce: String, echostr: String): String { |
| | | val s = SHA1.getSHA1(WxConfig.TOKEN, timestamp, nonce, "") |
| | | LOGGER.info("微信æå¡å¨éªè¯ï¼sha1ï¼${s}") |
| | | return if (signature == s) { |
| | | LOGGER.info("success") |
| | | echostr |
| | | } else { |
| | | LOGGER.info("fail") |
| | | "fail" |
| | | } |
| | | } |
| | | |
| | | override fun subscribeResult(msg: String): String{ |
| | | println(msg) |
| | | |
| | | val json = JSON.parseObject(msg) |
| | | //å°ç¨åºåå§idï¼ä¸æ¯APP_ID |
| | | val appName = (json["ToUserName"] as String?) ?: throw NullPointerException("微信æå¡å¨åéç订é
è¿åæ¶æ¯ToUserNameåæ®µä¸ºnull") |
| | | if (appName != WxConfig.USER_NAME) throw IllegalStateException("å°ç¨åºåå§IDä¸å¹é
ï¼å¾®ä¿¡[${appName}]ï¼æå¡å¨è®°å½[${WxConfig.USER_NAME}]") |
| | | //ç¨æ·openid |
| | | val openId = (json["FromUserName"] as String?) ?: throw NullPointerException("微信æå¡å¨åéç订é
è¿åæ¶æ¯FromUserNameåæ®µä¸ºnull") |
| | | //æ¶é´æ³ |
| | | val createTime = (json["CreateTime"] as Int?) ?: throw NullPointerException("微信æå¡å¨åéç订é
è¿åæ¶æ¯CreateTimeåæ®µä¸ºnull") |
| | | //äºä»¶ç±»åï¼æ¤å¤åºè¯¥é½æ¯event |
| | | val msgType = json["MsgType"] as String? |
| | | |
| | | //åæ¶æ¯æ¨¡æ¿è¿åç»æ |
| | | val results = mutableListOf<JSONObject>() |
| | | val list = json["List"] |
| | | if (list is JSONArray) { |
| | | list.forEach { |
| | | if (it is JSONObject) { |
| | | results.add(it) |
| | | } |
| | | } |
| | | } else if (list is JSONObject) { |
| | | results.add(list) |
| | | } |
| | | val event = json["Event"] |
| | | if (event is String) { |
| | | when (event) { |
| | | //ç¨æ·è§¦å订é
æ¶æ¯å¼¹æ¡åçè¡ä¸ºæ¶é´ç»æ |
| | | //ç¨æ·å¨ææºç«¯æå¡éç¥æ¶æ¯å¡çå³ä¸è§ç®¡çæ¶æ¯æ¶çæä½ç»æ |
| | | "subscribe_msg_popup_event" , |
| | | "subscribe_msg_change_event" -> { |
| | | results.forEach { |
| | | val templateId = it["TemplateId"] as String? |
| | | val sStatus = it["SubscribeStatusString"] as String? |
| | | //æ ¹æ®æ¶é´åç¨æ·openIdï¼å¤ææ¤æ¬¡æä½æ¯å¦éå¤ |
| | | val time = Date(createTime.toLong() * 1000) |
| | | val records = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply { |
| | | createCriteria().andEqualTo("msOpenId", openId) |
| | | .andEqualTo("msTemplateId", templateId) |
| | | }) |
| | | //ç¨æ·æ 订é
è®°å½ |
| | | if (records.isEmpty()) { |
| | | val m = MsgSubscribeWx().apply { |
| | | msTemplateId = templateId |
| | | msOpenId = openId |
| | | msUpdateTime = time |
| | | if (sStatus == WxConfig.S_ACCEPT) { |
| | | msCount = 1 |
| | | msAccept = true |
| | | }else if (sStatus == WxConfig.S_REJECT) { |
| | | msCount = 0 |
| | | msAccept = false |
| | | } |
| | | } |
| | | msgSubscribeWxMapper.insert(m) |
| | | } |
| | | //ç¨æ·æè®¢é
è®°å½ |
| | | else if (records.size == 1) { |
| | | //å
æé |
| | | val r = records[0] |
| | | if (r != null && createTime > (r.msUpdateTime?.time ?: 0)) { |
| | | r.msUpdateTime = time |
| | | if (sStatus == WxConfig.S_ACCEPT) { |
| | | r.msCount += 1 |
| | | r.msAccept = true |
| | | } else if (sStatus == WxConfig.S_REJECT) { |
| | | r.msAccept = false |
| | | } |
| | | msgSubscribeWxMapper.updateByPrimaryKey(r) |
| | | } |
| | | } |
| | | //ç¨æ·åä¸ªæ¨¡æ¿æå¤æ¡è®°å½ï¼é误 |
| | | else { |
| | | throw IllegalStateException("ç¨æ·[${openId}]微信订é
åæ¡æ¶æ¯è®°å½å¤§äº1") |
| | | } |
| | | } |
| | | } |
| | | //åéç»ç¨æ·è®¢é
æ¶æ¯çè¿åç»æ |
| | | "subscribe_msg_sent_event" -> { |
| | | results.forEach { |
| | | val templateId = it["TemplateId"] as String? |
| | | val msgId = it["MsgID"] as String? |
| | | val eCode = it["ErrorCode"] as String? |
| | | val eStatus = it["ErrorStatus"] as String? |
| | | //æ¨éæååï¼è¯¥ç¨æ·è¯¥æ¡æ¨¡æ¿å¯ç¨æ¬¡æ°åä¸ï¼å¹¶ä¸è®°å½æ¨éæ¥å¿ |
| | | if (eCode == "0") { |
| | | val records = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply { |
| | | createCriteria().andEqualTo("msOpenId", openId) |
| | | .andEqualTo("msTemplateId", templateId) |
| | | }) |
| | | if (records.size != 1) throw IllegalStateException("å¾®ä¿¡ç¨æ·[${openId}]模æ¿[${templateId}]订é
次æ°è®°å½ç¼ºå¤±") |
| | | records[0]?.let { ms -> |
| | | ms.msCount-- |
| | | msgSubscribeWxMapper.updateByPrimaryKey(ms) |
| | | } |
| | | |
| | | //æ¥æ¾è¿åæ¶æ¯24å°æ¶ä¹å
çè®°å½ |
| | | // ä¸è¬æ
åµä¸ï¼ä¸»å¨æ¨éæ¶æ¯åï¼å¾®ä¿¡æå¡å¨ä¼ç«å³è¿å对åºçæ¨éç»æï¼æä»¥åºè¯¥åªæ¥è¯¢å°ä¸æ¡æ²¡ælmsMsgIdçè®°å½ï¼ |
| | | // æè
å¨å¾®ä¿¡æå¡å¨éå¤åéçæ
åµä¸ï¼åªæ¥è¯¢å°ä¸æ¡æå¯¹åºlmsMsgIdçè®°å½ï¼ |
| | | val logs = logMsgSubscribeWxMapper.selectByExample(Example(LogMsgSubscribeWx::class.java).apply { |
| | | createCriteria().andEqualTo("lmsOpenId", openId) |
| | | .andEqualTo("lmsTemplateId", templateId) |
| | | and( |
| | | createCriteria().orIsNull("lmsMsgId").orEqualTo("lmsMsgId", msgId) |
| | | ) |
| | | }).let { list-> |
| | | var result = list |
| | | for (l in list) { |
| | | if (l?.lmsMsgId == msgId) { |
| | | result = emptyList() |
| | | break |
| | | } |
| | | } |
| | | result |
| | | } |
| | | if (logs.isNotEmpty()) { |
| | | val l = logs[0] |
| | | l?.lmsTime = Date() |
| | | l?.lmsMsgId = msgId |
| | | l?.lmsResult = true |
| | | logMsgSubscribeWxMapper.updateByPrimaryKey(l) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "success" |
| | | } else { |
| | | return "fail" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | fun getLedgerDetail(userId: String, ledgerSubTypeId: Int? = null, sceneType: Int, startTime: String, endTime: String, page: Int? = null, perPage: Int, response: HttpServletResponse): ArrayList<LedgerVo> |
| | | |
| | | fun getLedgerDetail2(userId: String, ledgerSubTypeId: Int? = null, sceneType: Int, time: String): List<LedgerVo> |
| | | fun getLedgerDetail2(userId: String, ledgerSubTypeId: Int? = null, sceneType: Int, time: String?): List<LedgerVo> |
| | | |
| | | fun uploadLedger(userId: String, ledgerVoList: String, files: Array<MultipartFile>): Boolean |
| | | |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.common.wx.MessageWxVo |
| | | import cn.flightfeather.supervision.domain.entity.MeetingInfo |
| | | import cn.flightfeather.supervision.domain.entity.VMRoom |
| | | import cn.flightfeather.supervision.lightshare.vo.LedgerSubTypeVo |
| | |
| | | fun pushMeetingReleaseNotification(meetingVo: MeetingInfo, roomVo: VMRoom?, userId: String, title: String, body: String) |
| | | |
| | | fun releaseNotice(userId: String, noticeVo: NotificationVo): Boolean |
| | | |
| | | fun pushMsgWx(templateId: Int): String |
| | | } |
| | |
| | | |
| | | fun upLoadAccountPic(userId: String, files: Array<MultipartFile>): String |
| | | |
| | | fun changePassword(userId: String, oldPassword: String, newPassword: String): Int |
| | | fun changePassword(userId: String, oldPassword: String, newPassword: String): BaseResponse<String> |
| | | |
| | | fun searchUser(userId: String,condition: UserSearchCondition, page: Int, perPage: Int, response: HttpServletResponse): List<Userinfo> |
| | | |
| | | fun getBaseInfo(userId: String): UserBaseInfo |
| | | fun getBaseInfo(userId: String, wxUserId: String?): UserBaseInfo |
| | | |
| | | fun search(district: String?, sceneType: Int?, userType: Int?, page: Int, perPage: Int): BaseResponse<List<Userinfo>> |
| | | |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.Userinfo |
| | | import cn.flightfeather.supervision.lightshare.vo.AccessToken |
| | | import cn.flightfeather.supervision.lightshare.vo.AccessTokenPW |
| | | import cn.flightfeather.supervision.lightshare.vo.AccessTokenWX |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | |
| | | */ |
| | | fun loginWx(accessTokenWX: AccessTokenWX): BaseResponse<Userinfo> |
| | | |
| | | fun loginPw(accessTokenPW: AccessTokenPW): BaseResponse<Userinfo> |
| | | /** |
| | | * ç¨æ·åå¯ç ç»å½ï¼åæ¶ç»å®å¾®ä¿¡ç¨æ· |
| | | */ |
| | | // FIXME: 2022/9/25 æå® |
| | | fun loginPw(accessTokenPW: AccessTokenPW): AccessToken |
| | | |
| | | |
| | | fun subscribeCheck(signature: String, timestamp: String, nonce: String, echostr: String): String |
| | | |
| | | fun subscribeResult(msg: String): String |
| | | } |
| | |
| | | var userId: String? = null |
| | | // 对åºé£ç¾½ç管ä¸çç¨æ·id |
| | | var sUserId: String? = null |
| | | // å¾®ä¿¡ç¨æ·id |
| | | var openId: String? = null |
| | | var success: Boolean = false |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.BaseInfo |
| | | import cn.flightfeather.supervision.domain.entity.FumePurifyDevice |
| | | import cn.flightfeather.supervision.domain.entity.MonitorDevice |
| | | import cn.flightfeather.supervision.domain.entity.RestaurantBaseInfo |
| | | import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator |
| | | import org.springframework.beans.BeanUtils |
| | | import java.util.* |
| | | |
| | | /** |
| | | * é¤é¥®åºè®¤è¯ä¿¡æ¯ |
| | | */ |
| | | class AuthSceneRestVo : AuthSceneVo() { |
| | | //ç»è¥èç³» |
| | | var rbCuisine: String? = null |
| | | //å°±é¤ä½æ»æ° |
| | | var rbTotalSeating: Int? = null |
| | | //ç¶å¤´æ° |
| | | var rbCookingRangeNum: Int? = null |
| | | //å¹´åç¨æ²¹éï¼æ°æ®åºè®°å½ä¸ºæåº¦ç¨æ²¹éï¼ |
| | | var rbCookingOilCapacity: Int? = null |
| | | //ç¨æ²¹ç±»å |
| | | var rbCookingOilType: String? = null |
| | | //æå±éä¸åº |
| | | var rbConcentrationArea: String? = null |
| | | //æå£æ°é |
| | | var rbOutfallCount: Int? = null |
| | | //æå£ä½ç½® |
| | | var rbOutfallLocation: String? = null |
| | | //æå£ç¼å· |
| | | var rbOutfallNum: String? = null |
| | | |
| | | //ååè®¾å¤æ°é |
| | | var fpNum: String? = null |
| | | //çæµè®¾å¤æ°é |
| | | var mdNum: String? = null |
| | | |
| | | /** |
| | | * çææ°çé¤é¥®ä¿¡æ¯å¯¹è±¡ |
| | | */ |
| | | fun toNewRestInfo(userId: String) = RestaurantBaseInfo().apply { |
| | | rbGuid = userId |
| | | updateRestInfo(this) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è³é¤é¥®ä¿¡æ¯ |
| | | */ |
| | | fun updateRestInfo(restInfo: RestaurantBaseInfo) { |
| | | restInfo.apply { |
| | | // rbCuisine = rbCuisine |
| | | // rbTotalSeating = rbTotalSeating |
| | | // rbCookingRangeNum = rbCookingRangeNum |
| | | // rbCookingOilType = rbCookingOilType |
| | | // rbConcentrationArea = rbConcentrationArea |
| | | // rbOutfallCount = rbOutfallCount |
| | | // rbOutfallLocation = rbOutfallLocation |
| | | // rbOutfallNum = rbOutfallNum |
| | | BeanUtils.copyProperties(this@AuthSceneRestVo, this) |
| | | rbCookingOilCapacity = this@AuthSceneRestVo.rbCookingOilCapacity?.div(12).toString() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çææ°çé¤é¥®æ²¹çååè£
置信æ¯å¯¹è±¡ |
| | | */ |
| | | fun toNewFpdInfo(baseInfo: BaseInfo) = FumePurifyDevice().apply { |
| | | fpGuid = UUIDGenerator.generate16ShortUUID() |
| | | fpUserId = baseInfo.biGuid |
| | | fpUserName = baseInfo.biName |
| | | fpUpdatingTime = Date() |
| | | updateFpdInfo(this) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è³é¤é¥®æ²¹çååè£
ç½®ä¿¡æ¯ |
| | | */ |
| | | fun updateFpdInfo(fpdInfo: FumePurifyDevice) { |
| | | fpdInfo.apply { |
| | | fpNum = this@AuthSceneRestVo.fpNum |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çææ°çé¤é¥®æ²¹ççæµè®¾å¤ä¿¡æ¯å¯¹è±¡ |
| | | */ |
| | | fun toNewMdInfo(baseInfo: BaseInfo) = MonitorDevice().apply { |
| | | mdGuid = UUIDGenerator.generate16ShortUUID() |
| | | mdUserId = baseInfo.biGuid |
| | | mdUserName = baseInfo.biName |
| | | mdUpdatingTime = Date() |
| | | updateMdInfo(this) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è³é¤é¥®æ²¹ççæµè®¾å¤ä¿¡æ¯ |
| | | */ |
| | | fun updateMdInfo(mdInfo: MonitorDevice) { |
| | | mdInfo.apply { |
| | | mdNum = this@AuthSceneRestVo.mdNum |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.BaseInfo |
| | | import cn.flightfeather.supervision.domain.entity.Company |
| | | import cn.flightfeather.supervision.domain.entity.Userinfo |
| | | import cn.flightfeather.supervision.domain.enumeration.AuthenticationStatus |
| | | import org.springframework.beans.BeanUtils |
| | | import java.util.* |
| | | |
| | | /** |
| | | * åºæ¯è®¤è¯ä¿¡æ¯ |
| | | */ |
| | | open class AuthSceneVo { |
| | | //åºæ¯åç§° |
| | | var biName: String? = null |
| | | //åºæ¯ç®ç§° |
| | | var biNickName: String? = null |
| | | //åºæ¯è系人 |
| | | var biContact: String? = null |
| | | //åºæ¯èç³»çµè¯ |
| | | var biTelephone: String? = null |
| | | //åºæ¯å°å |
| | | var biAddress: String? = null |
| | | //åºæ¯æå±è¡æ¿åºå |
| | | var biLocation: Array<String> = emptyArray() |
| | | |
| | | /** |
| | | * çææ°çåºæ¯åºç¡ä¿¡æ¯å¯¹è±¡ |
| | | */ |
| | | fun toNewBaseInfo(newUser: Userinfo, cInfo:Company?) = BaseInfo().apply { |
| | | biGuid = newUser.guid |
| | | ciGuid = cInfo?.ciGuid |
| | | ciName = cInfo?.ciName |
| | | biCreateTime = Date() |
| | | biExtension1 = newUser.acountname |
| | | updateBaseInfo(this) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è³åºæ¯åºç¡ä¿¡æ¯ |
| | | */ |
| | | fun updateBaseInfo(baseInfo: BaseInfo) { |
| | | baseInfo.apply { |
| | | // biName = biName |
| | | // biNickName = biNickName |
| | | // biContact = biContact |
| | | // biTelephone = biTelephone |
| | | // biAddress = biAddress |
| | | if (biLocation.isNotEmpty()) { |
| | | biProvinceName = biLocation[0] |
| | | biCityName = biLocation[1] |
| | | biDistrictName = biLocation[2] |
| | | biTownName = biLocation[3] |
| | | biProvinceCode = biLocation[4] |
| | | biCityCode = biLocation[5] |
| | | biDistrictCode = biLocation[6] |
| | | biTownCode = biLocation[7] |
| | | } |
| | | biUpdateTime = Date() |
| | | biExtension3 = AuthenticationStatus.YES.des |
| | | BeanUtils.copyProperties(this@AuthSceneVo, this) |
| | | } |
| | | } |
| | | } |
| | |
| | | import cn.flightfeather.supervision.domain.entity.BaseInfo |
| | | import cn.flightfeather.supervision.domain.entity.BaseSpecialInfo |
| | | import cn.flightfeather.supervision.domain.entity.Company |
| | | import cn.flightfeather.supervision.domain.entity.PersonalInfo |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | |
| | | /** |
| | |
| | | val name: String? = null, |
| | | val baseInfo: BaseInfo? = null, |
| | | val company: Company? = null, |
| | | val specialInfo: BaseSpecialInfo? = null |
| | | val specialInfo: BaseSpecialInfo? = null, |
| | | val personalInfo: PersonalInfo? = null |
| | | ) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.Company |
| | | import cn.flightfeather.supervision.domain.entity.PersonalInfo |
| | | import cn.flightfeather.supervision.lightshare.service.AuthService |
| | | import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["ç¨æ·è®¤è¯ç¸å
³APIæ¥å£"]) |
| | | @RestController |
| | | @RequestMapping("/auth") |
| | | class AuthController(val authService: AuthService) { |
| | | |
| | | @ApiOperation(value = "ä¼ä¸ä¿¡æ¯è®¤è¯") |
| | | @PostMapping("/company") |
| | | fun authCompany( |
| | | @ApiParam("ç¨æ·å¾®ä¿¡id") @RequestParam("wxUserId") wxUserId: String, |
| | | @ApiParam("ä¼ä¸ä¿¡æ¯") @RequestBody company: Company, |
| | | ) = authService.authCompany(wxUserId, company) |
| | | |
| | | @ApiOperation(value = "åºæ¯ä¿¡æ¯è®¤è¯") |
| | | @PostMapping("/scene") |
| | | fun authScene( |
| | | @ApiParam("ç¨æ·å¾®ä¿¡id") @RequestParam("wxUserId") wxUserId: String, |
| | | @ApiParam("ç¨æ·åºæ¯ç±»åç¼å·") @RequestParam("sceneType") sceneType: Int, |
| | | @ApiParam("åºæ¯ä¿¡æ¯") @RequestBody sceneInfo: String, |
| | | ) = authService.authScene(wxUserId, sceneType, sceneInfo) |
| | | |
| | | @ApiOperation(value = "个人信æ¯è®¤è¯") |
| | | @PostMapping("/personal") |
| | | fun authPersonal( |
| | | @ApiParam("ç¨æ·å¾®ä¿¡id") @RequestParam("wxUserId") wxUserId: String, |
| | | @ApiParam("个人信æ¯") @RequestBody personalInfo: PersonalInfo |
| | | ) = authService.authPersonal(wxUserId, personalInfo) |
| | | |
| | | @ApiOperation(value = "è·åç¨æ·è®¤è¯ç¶æ") |
| | | @GetMapping("/status") |
| | | fun authStatus( |
| | | @ApiParam("ç¨æ·å¾®ä¿¡id") @RequestParam(value = "wxUserId", required = false) wxUserId: String?, |
| | | @ApiParam("ç¨æ·åºæ¯id") @RequestParam(value = "userId", required = false) userId: String?, |
| | | ) = authService.authStatus(wxUserId, userId) |
| | | } |
| | |
| | | @ApiParam("ç¨æ·id") @PathVariable userId: String, |
| | | @ApiParam(value = "å°è´¦åç±»åidï¼ å¦æä¸ä¼ ï¼åé»è®¤æ ¹æ®åºæ¯ç±»åè·åææå°è´¦", required = false) @RequestParam(value = "ledgerSubTypeId", required = false) ledgerSubTypeId: Int?, |
| | | @ApiParam("åºæ¯ç±»åid") @RequestParam(value = "sceneType") sceneType: Int, |
| | | @ApiParam(value = "æ¶é´", example = "yyyy-MM-dd") @RequestParam(value = "time") time: String |
| | | @ApiParam(value = "æ¶é´", example = "yyyy-MM-dd") @RequestParam(value = "time", required = false) time: String? |
| | | ) = ledgerService.getLedgerDetail2(userId, ledgerSubTypeId, sceneType, time) |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ å°è´¦ä¿¡æ¯") |
| | |
| | | ) = notificationService.getUnReadNoticeNum(userId) |
| | | |
| | | @ApiOperation(value = "åå¸éç¥") |
| | | @PostMapping("{userId}/release") |
| | | @PostMapping("/{userId}/release") |
| | | fun releaseNotice( |
| | | @ApiParam("ç¨æ·id") @PathVariable("userId") userId: String, |
| | | @ApiParam("éç¥") @RequestBody notice: NotificationVo |
| | | ) = notificationService.releaseNotice(userId, notice) |
| | | |
| | | @ApiOperation(value = "æ¨é䏿¡å¾®ä¿¡è®¢é
æ¶æ¯") |
| | | @GetMapping("/wx/message/subscribe/send") |
| | | fun pushMsgWx( |
| | | @ApiParam("模æ¿id") @RequestParam("templateId") templateId: Int |
| | | ) = notificationService.pushMsgWx(templateId) |
| | | } |
| | |
| | | ) = userinfoService.upLoadAccountPic(userId, files) |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹å¯ç ") |
| | | @PostMapping("/password/change/{userId}") |
| | | @PostMapping("/password/change") |
| | | fun changePassword( |
| | | @ApiParam("ç¨æ·id") @RequestParam("userId") userId: String, |
| | | @ApiParam("æ§å¯ç ") @RequestParam("oldPassword") oldPassword: String, |
| | |
| | | @ApiOperation(value = "è·åç¨æ·åºæ¬ä¿¡æ¯") |
| | | @GetMapping("/baseInfo") |
| | | fun getBaseInfo( |
| | | @ApiParam("ç¨æ·id") @RequestParam("userId") userId: String |
| | | ) = userinfoService.getBaseInfo(userId) |
| | | @ApiParam("ç¨æ·id") @RequestParam("userId") userId: String, |
| | | @ApiParam("å¾®ä¿¡ç¨æ·id") @RequestParam(value = "wxUserId", required = false) wxUserId: String? |
| | | ) = userinfoService.getBaseInfo(userId, wxUserId) |
| | | |
| | | @ApiOperation(value = "æ ¹æ®ç»å®æ¡ä»¶ï¼æç´¢ç¨æ·") |
| | | @GetMapping("/search") |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.lightshare.service.WxUserService |
| | | import cn.flightfeather.supervision.lightshare.vo.AccessTokenPW |
| | | 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 |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["å¾®ä¿¡ç¨æ·ä¿¡æ¯APIæ¥å£"]) |
| | | @RestController |
| | |
| | | fun loginWx( |
| | | @ApiParam("ç»å½ä¿¡æ¯") @RequestBody accessTokenWX: AccessTokenWX |
| | | ) = wxUserService.loginWx(accessTokenWX) |
| | | |
| | | |
| | | @ApiOperation(value = "ç»å½") |
| | | @PostMapping("/loginPW") |
| | | fun loginPW( |
| | | @ApiParam("ç»å½ä¿¡æ¯") @RequestBody accessTokenPW: AccessTokenPW |
| | | ) = wxUserService.loginPw(accessTokenPW) |
| | | |
| | | @ApiOperation(value = "微信æ¥å
¥éªè¯") |
| | | @GetMapping("/message/subscribe/result") |
| | | fun subscribeCheck( |
| | | @ApiParam("微信å å¯ç¾å") @RequestParam signature: String, |
| | | @ApiParam("æ¶é´æ³") @RequestParam timestamp: String, |
| | | @ApiParam("éæºæ°") @RequestParam nonce: String, |
| | | @ApiParam("éæºå符串") @RequestParam echostr: String, |
| | | ) = wxUserService.subscribeCheck(signature, timestamp, nonce, echostr) |
| | | |
| | | @ApiOperation(value = "å¾®ä¿¡ç¨æ·è®¢é
æ¶æ¯ç»ææ¨é", notes = "微信ä¼å°ç¨æ·è®¢é
æ¶æ¯ãæ¶æ¯æ¨éæ
åµçä¿¡æ¯éè¿æ¤æ¥å£åéè¿æ¥") |
| | | @PostMapping("/message/subscribe/result") |
| | | fun subscribeResult( |
| | | @ApiParam("æ¶æ¯") @RequestBody msg: String |
| | | ) = wxUserService.subscribeResult(msg) |
| | | } |
| | |
| | | // 任塿§è¡å¨æï¼åä½ï¼åé |
| | | abstract val period: Long |
| | | |
| | | fun execute(localtime:LocalDateTime) { |
| | | open fun execute(localtime:LocalDateTime) { |
| | | val now = LocalDateTime.now() |
| | | if (now.minusSeconds(period * 60 - 5) >= lastTime) { |
| | | lastTime = now |
| | |
| | | */ |
| | | @Component |
| | | class TaskController( |
| | | fetchVOC: FetchVOC, pushFume: PushFume |
| | | fetchVOC: TaskFetchVOC, pushFume: TaskPushFume |
| | | ) { |
| | | |
| | | companion object { |
| | |
| | | init { |
| | | LOGGER.info("æ·»å 宿¶ä»»å¡") |
| | | timeTask.clear() |
| | | timeTask.add(fetchVOC) |
| | | timeTask.add(pushFume) |
| | | // timeTask.add(fetchVOC) |
| | | // timeTask.add(pushFume) |
| | | LOGGER.info("æ·»å 宿¶ä»»å¡å®æï¼ä»»å¡æ»è®¡${timeTask.size}个") |
| | | } |
| | | |
| ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/timingtask/FetchVOC.kt ÐÞ¸Ä |
| | |
| | | * è·åvocçæµæ°æ® |
| | | */ |
| | | @Component |
| | | class FetchVOC : BaseTimingTask() { |
| | | class TaskFetchVOC : BaseTimingTask() { |
| | | companion object { |
| | | private lateinit var instance: FetchVOC |
| | | private lateinit var instance: TaskFetchVOC |
| | | } |
| | | |
| | | @Autowired |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.timingtask |
| | | |
| | | import cn.flightfeather.supervision.common.wx.TemplateManager |
| | | import cn.flightfeather.supervision.domain.entity.MsgSubscribeWx |
| | | import cn.flightfeather.supervision.domain.mapper.MsgSubscribeWxMapper |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.LocalDateTime |
| | | |
| | | /** |
| | | * å°è´¦ä¸ä¼ åè®¡æ¶æé |
| | | */ |
| | | @Component |
| | | class TaskLedgerRemind( |
| | | private val msgSubscribeWxMapper: MsgSubscribeWxMapper |
| | | ) : BaseTimingTask() { |
| | | |
| | | override val period: Long |
| | | get() = 1440L |
| | | |
| | | override fun doTask(localtime: LocalDateTime) { |
| | | //1.éæ©å·²è®¢é
äºè¯¥æ¡æéçå¾®ä¿¡ç¨æ· |
| | | val ms = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply { |
| | | createCriteria().andEqualTo("msTemplateId", TemplateManager.TEMPLATE_1) |
| | | .andGreaterThan("msCount", 0) |
| | | }) |
| | | //2.æ¥æ¾å¾®ä¿¡ç¨æ·ç»å®çåºæ¯å°è´¦ä¸ä¼ æ
åµ |
| | | //3.æ ¹æ®ç»è®¡ç»æå³å®æ¯å¦åéæéæ¨é |
| | | } |
| | | |
| | | /** |
| | | * å°è´¦æéä»»å¡å®ä¸ºæ¯æ5å·æ©ä¸10ç¹æé彿10å·ä¹åæäº¤å°è´¦ |
| | | */ |
| | | override fun execute(localtime: LocalDateTime) { |
| | | if (localtime.dayOfMonth == 5) { |
| | | doTask(localtime) |
| | | } |
| | | } |
| | | } |
| ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/timingtask/PushFume.kt ÐÞ¸Ä |
| | |
| | | import cn.flightfeather.supervision.domain.mapper.DeviceInfoMapper |
| | | import cn.flightfeather.supervision.domain.mapper.FumeMinuteValueMapper |
| | | import cn.flightfeather.supervision.infrastructure.utils.DateUtil |
| | | import com.github.pagehelper.PageHelper |
| | | import org.slf4j.LoggerFactory |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.LocalDateTime |
| | | import java.time.LocalTime |
| | | import java.time.ZoneId |
| | | import java.time.ZoneOffset |
| | | import java.time.format.DateTimeFormatter |
| | | import java.util.* |
| | | import javax.annotation.PostConstruct |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * ä¸ä¼ æ²¹ççæµæ°æ® |
| | | */ |
| | | @Component |
| | | class PushFume : BaseTimingTask() { |
| | | class TaskPushFume : BaseTimingTask() { |
| | | |
| | | companion object { |
| | | // private lateinit var instance: PushFume |
| | | val LOGGER = LoggerFactory.getLogger(PushFume::class.java) |
| | | val LOGGER = LoggerFactory.getLogger(TaskPushFume::class.java) |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | <!-- selectByExampleQueryId="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"/> |
| | | <!-- <table tableName="sm_t_userinfo_wx" domainObjectName="UserInfoWx" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!-- selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="ea_t_personal_info" domainObjectName="PersonalInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"--> |
| | | <!-- selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="ea_t_msg_subscribe_wx" domainObjectName="MsgSubscribeWx" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false"--> |
| | | <!-- selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="sys_log_msg_subscribe_wx" domainObjectName="LogMsgSubscribeWx" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false"--> |
| | | <!-- selectByExampleQueryId="false"/>--> |
| | | <table tableName="sm_t_userinfo" domainObjectName="Userinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" |
| | | selectByExampleQueryId="false"/> |
| | | </context> |
| | | </generatorConfiguration> |
| | |
| | | --> |
| | | <id column="BI_GUID" property="biGuid" jdbcType="VARCHAR" /> |
| | | <result column="BI_Name" property="biName" jdbcType="VARCHAR" /> |
| | | <result column="BI_Nick_Name" property="biNickName" jdbcType="VARCHAR" /> |
| | | <result column="CI_GUID" property="ciGuid" jdbcType="VARCHAR" /> |
| | | <result column="CI_Name" property="ciName" jdbcType="VARCHAR" /> |
| | | <result column="BI_Province_Code" property="biProvinceCode" jdbcType="VARCHAR" /> |
| | | <result column="BI_Province_Name" property="biProvinceName" jdbcType="VARCHAR" /> |
| | | <result column="BI_City_Code" property="biCityCode" jdbcType="VARCHAR" /> |
| | | <result column="BI_City_Name" property="biCityName" jdbcType="VARCHAR" /> |
| | | <result column="BI_District_Code" property="biDistrictCode" jdbcType="VARCHAR" /> |
| | | <result column="BI_District_Name" property="biDistrictName" jdbcType="VARCHAR" /> |
| | | <result column="BI_Town_Code" property="biTownCode" jdbcType="VARCHAR" /> |
| | | <result column="BI_Town_Name" property="biTownName" jdbcType="VARCHAR" /> |
| | | <result column="BI_Management_Company_Id" property="biManagementCompanyId" jdbcType="VARCHAR" /> |
| | | <result column="BI_Management_Company" property="biManagementCompany" jdbcType="VARCHAR" /> |
| | | <result column="BI_Contact" property="biContact" jdbcType="VARCHAR" /> |
| | |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | BI_GUID, BI_Name, CI_GUID, CI_Name, BI_Management_Company_Id, BI_Management_Company, |
| | | BI_Contact, BI_Telephone, BI_Address, BI_Create_Time, BI_Update_Time, BI_Extension1, |
| | | BI_Extension2, BI_Extension3, BI_Remark |
| | | BI_GUID, BI_Name, BI_Nick_Name, CI_GUID, CI_Name, BI_Province_Code, BI_Province_Name, |
| | | BI_City_Code, BI_City_Name, BI_District_Code, BI_District_Name, BI_Town_Code, BI_Town_Name, |
| | | BI_Management_Company_Id, BI_Management_Company, BI_Contact, BI_Telephone, BI_Address, |
| | | BI_Create_Time, BI_Update_Time, BI_Extension1, BI_Extension2, BI_Extension3, BI_Remark |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.LogMsgSubscribeWxMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LogMsgSubscribeWx" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="LMS_ID" property="lmsId" jdbcType="INTEGER" /> |
| | | <result column="LMS_Open_Id" property="lmsOpenId" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Template_Id" property="lmsTemplateId" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Data" property="lmsData" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Time" property="lmsTime" jdbcType="TIMESTAMP" /> |
| | | <result column="LMS_Msg_Id" property="lmsMsgId" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Result" property="lmsResult" jdbcType="BIT" /> |
| | | <result column="LMS_Extension1" property="lmsExtension1" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Extension2" property="lmsExtension2" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Extension3" property="lmsExtension3" jdbcType="VARCHAR" /> |
| | | <result column="LMS_Remark" property="lmsRemark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | LMS_ID, LMS_Open_Id, LMS_Template_Id, LMS_Data, LMS_Time, LMS_Msg_Id, LMS_Result, |
| | | LMS_Extension1, LMS_Extension2, LMS_Extension3, LMS_Remark |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.MsgSubscribeWxMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.MsgSubscribeWx" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="MS_ID" property="msId" jdbcType="INTEGER" /> |
| | | <result column="MS_Template_Id" property="msTemplateId" jdbcType="VARCHAR" /> |
| | | <result column="MS_Open_Id" property="msOpenId" jdbcType="VARCHAR" /> |
| | | <result column="MS_Count" property="msCount" jdbcType="INTEGER" /> |
| | | <result column="MS_Accept" property="msAccept" jdbcType="BIT" /> |
| | | <result column="MS_Update_Time" property="msUpdateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="MS_Extension1" property="msExtension1" jdbcType="VARCHAR" /> |
| | | <result column="MS_Extension2" property="msExtension2" jdbcType="VARCHAR" /> |
| | | <result column="MS_Extension3" property="msExtension3" jdbcType="VARCHAR" /> |
| | | <result column="MS_Remark" property="msRemark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | MS_ID, MS_Template_Id, MS_Open_Id, MS_Count, MS_Accept, MS_Update_Time, MS_Extension1, |
| | | MS_Extension2, MS_Extension3, MS_Remark |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.PersonalInfoMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.PersonalInfo" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="PI_GUID" property="piGuid" jdbcType="VARCHAR" /> |
| | | <result column="PI_Name" property="piName" jdbcType="VARCHAR" /> |
| | | <result column="PI_ID_Type_Num" property="piIdTypeNum" jdbcType="TINYINT" /> |
| | | <result column="PI_ID_Type" property="piIdType" jdbcType="VARCHAR" /> |
| | | <result column="PI_ID" property="piId" jdbcType="VARCHAR" /> |
| | | <result column="PI_Position_Num" property="piPositionNum" jdbcType="TINYINT" /> |
| | | <result column="PI_Position" property="piPosition" jdbcType="VARCHAR" /> |
| | | <result column="PI_Extension1" property="piExtension1" jdbcType="VARCHAR" /> |
| | | <result column="PI_Extension2" property="piExtension2" jdbcType="VARCHAR" /> |
| | | <result column="PI_Extension3" property="piExtension3" jdbcType="VARCHAR" /> |
| | | <result column="PI_Remark" property="piRemark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | PI_GUID, PI_Name, PI_ID_Type_Num, PI_ID_Type, PI_ID, PI_Position_Num, PI_Position, |
| | | PI_Extension1, PI_Extension2, PI_Extension3, PI_Remark |
| | | </sql> |
| | | </mapper> |
| | |
| | | <result column="RB_Cooking_Oil_Type" property="rbCookingOilType" jdbcType="VARCHAR" /> |
| | | <result column="RB_Cooking_Oil_Capacity" property="rbCookingOilCapacity" jdbcType="VARCHAR" /> |
| | | <result column="RB_Concentration_Area" property="rbConcentrationArea" jdbcType="VARCHAR" /> |
| | | <result column="RB_Outfall_Count" property="rbOutfallCount" jdbcType="INTEGER" /> |
| | | <result column="RB_Outfall_Location" property="rbOutfallLocation" jdbcType="VARCHAR" /> |
| | | <result column="RB_Outfall_Num" property="rbOutfallNum" jdbcType="VARCHAR" /> |
| | | <result column="RB_Extension1" property="rbExtension1" jdbcType="VARCHAR" /> |
| | | <result column="RB_Extension2" property="rbExtension2" jdbcType="VARCHAR" /> |
| | | <result column="RB_Extension3" property="rbExtension3" jdbcType="VARCHAR" /> |
| | |
| | | RB_GUID, RB_Cuisine, RB_Cooking_Fumes_Type, RB_Peak_Period, RB_Indoor_Seating, RB_Outdoor_Seating, |
| | | RB_Total_Seating, RB_Outdoor_Barbecue, RB_Open_Kitchen, RB_Environment, RB_Cooking_Range_Num, |
| | | RB_Electric_Oven_Num, RB_Other_Cooker_Num, RB_Fresh_Air, RB_Air_Conditioner, RB_Exhaust_Fan, |
| | | RB_Cooking_Oil_Type, RB_Cooking_Oil_Capacity, RB_Concentration_Area, RB_Extension1, |
| | | RB_Extension2, RB_Extension3, RB_Remark |
| | | RB_Cooking_Oil_Type, RB_Cooking_Oil_Capacity, RB_Concentration_Area, RB_Outfall_Count, |
| | | RB_Outfall_Location, RB_Outfall_Num, RB_Extension1, RB_Extension2, RB_Extension3, |
| | | RB_Remark |
| | | </sql> |
| | | </mapper> |
| | |
| | | --> |
| | | <id column="UI_Open_Id" property="uiOpenId" jdbcType="VARCHAR" /> |
| | | <result column="UI_GUID" property="uiGuid" jdbcType="VARCHAR" /> |
| | | <result column="CI_GUID" property="ciGuid" 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_City" property="uiCity" jdbcType="VARCHAR" /> |
| | | <result column="UI_Avatar_Url" property="uiAvatarUrl" jdbcType="VARCHAR" /> |
| | | <result column="UI_UnionId" property="uiUnionid" jdbcType="VARCHAR" /> |
| | | <result column="PI_GUID" property="piGuid" 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 |
| | | UI_Open_Id, UI_GUID, CI_GUID, UI_Nick_Name, UI_Gender, UI_Country, UI_Province, UI_City, |
| | | UI_Avatar_Url, UI_UnionId, PI_GUID |
| | | </sql> |
| | | </mapper> |
| | |
| | | <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span |
| | | style=" font-size:12pt">ç»ä¸ç¤¾ä¼ä¿¡ç¨ä»£ç </span></p> |
| | | </td> |
| | | <td |
| | | <td colspan="3" |
| | | style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.4pt; padding-right:5.03pt; vertical-align:middle; width:133.55pt"> |
| | | <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span |
| | | style=" font-size:12pt">${SocialCode}</span></p> |
| | | </td> |
| | | <td |
| | | style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.4pt; padding-right:5.03pt; vertical-align:middle; width:97.8pt"> |
| | | style="display:none;border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.4pt; padding-right:5.03pt; vertical-align:middle; width:97.8pt"> |
| | | <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span |
| | | style=" font-size:12pt">ç¯è¯å®¡æ¹æå·</span></p> |
| | | </td> |
| | | <td |
| | | style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.4pt; padding-right:5.03pt; vertical-align:middle; width:119.55pt"> |
| | | style="display:none;border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.4pt; padding-right:5.03pt; vertical-align:middle; width:119.55pt"> |
| | | <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span |
| | | style=" font-size:12pt">${Number}</span></p> |
| | | </td> |
| | |
| | | style=" font-size:12pt">${IdNo}</span></p> |
| | | </td> |
| | | </tr> |
| | | <tr style="height:42.7pt"> |
| | | <tr style="height:42.7pt;display:none;"> |
| | | <td colspan="2" |
| | | style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:106.85pt"> |
| | | <p style="line-height:20pt; margin:0pt; orphans:0; text-align:center; widows:0"><span |
| | |
| | | </p> |
| | | <p |
| | | style="line-height:20pt; margin:0pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"> |
| | | <span style=" font-size:12pt">ä¸ãå®è£
æ²¹çåååå¼å³å¤ç设æ½ï¼æ²¹çææ¾æµåº¦ç¬¦å<䏿µ·å¸é¤é¥®ä¸æ²¹çææ¾æ åã(DB |
| | | 31/844 -2014)ï¼å¹¶å§æç¬¦åãæ¸
æ´è¡ä¸ç»è¥æå¡è§èãçæå¡åä½å®æè¿è¡ç»´æ¤æ¸
æ´ï¼åæ¶è®°å½ç¸å
³å°è´¦ï¼ç¡®ä¿å
¶æ£å¸¸ä½¿ç¨ï¼é²æ¢å¯¹å¨è¾¹å±
æ°é æçæ´»ç¯å¢æ±¡æã </span> |
| | | <span style=" font-size:12pt">ä¸ãå®è£
æ²¹çåååå¼å³å¤ç设æ½ï¼æ²¹çææ¾æµåº¦ç¬¦åã䏿µ·å¸é¤é¥®ä¸æ²¹çææ¾æ åã(DB |
| | | 31/844 -2014)ï¼å¹¶å§æè§èæå¡åä½åç
§ãææ²¹çè®¾æ½æ¸
æ´ææ¯è§èã(T/SHXFXH 002-2021)宿è¿è¡ç»´æ¤æ¸
æ´ï¼åæ¶è®°å½ç¸å
³å°è´¦ï¼ç¡®ä¿å
¶æ£å¸¸ä½¿ç¨ï¼é²æ¢å¯¹å¨è¾¹å±
æ°é æçæ´»ç¯å¢æ±¡æã </span> |
| | | </p> |
| | | <p |
| | | style="line-height:20pt; margin:0pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"> |
| | | <span |
| | | style=" font-size:12pt">åãå®è£
符åãCCAEPI-RG-Y-020-2011ãçæ²¹çå¨çº¿çæµè£
ç½®ï¼å¹¶åæ¶ä¸çæç¯ç«é¨é¨]æ²¹ççæ§ç³»ç»èç½ï¼å§æè§èæå¡åä½å®æè¿ç»´ï¼åæ¶è®°å½ç¸å
³å°è´¦ï¼ç¡®ä¿å
¶æ£å¸¸ä½¿ç¨ï¼ä¸è¶
æ ææ¾ã |
| | | style=" font-size:12pt">åãå®è£
符åãCCAEPI-RG-Y-020-2011ãçæ²¹çå¨çº¿çæµè£
ç½®ï¼æ ¹æ®ãé¤é¥®æ²¹çå¨çº¿çæµï¼å
æ£å°æ³ï¼ä¸çæ§ææ¯è§èã(T/SHAEPI 003-2022)ï¼åæ¶ä¸çæç¯å¢é¨é¨æ²¹ççæ§æ°æ®å¹³å°èç½ï¼ |
| | | å§æè§èæå¡åä½å®æè¿ç»´ï¼åæ¶è®°å½ç¸å
³å°è´¦ï¼ç¡®ä¿å
¶æ£å¸¸ä½¿ç¨ï¼ä¸è¶
æ ææ¾ã |
| | | </span> |
| | | </p> |
| | | <p |
| | |
| | | import com.google.gson.Gson |
| | | import org.junit.Test |
| | | import org.springframework.boot.json.GsonJsonParser |
| | | import java.util.* |
| | | import java.util.regex.Pattern |
| | | |
| | | /** |
| | |
| | | |
| | | @Test |
| | | fun foo4() { |
| | | |
| | | val d = Date() |
| | | println(d.time) |
| | | d.time = 1666262747 |
| | | println(d) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.wx |
| | | |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.Assertions.* |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit.jupiter.SpringExtension |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class TemplateManagerTest{ |
| | | |
| | | @Autowired |
| | | lateinit var templateManager: TemplateManager |
| | | |
| | | @Test |
| | | fun newTemplate() { |
| | | val msg = templateManager.newTemplate(0, "otZkc5cC55BtV2AFZdXMvBw0oJo8", listOf("value1", "value2", "value3", "value4")) |
| | | println(msg) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.Impl |
| | | |
| | | import cn.flightfeather.supervision.lightshare.service.NotificationService |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit.jupiter.SpringExtension |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import java.io.BufferedReader |
| | | import java.io.InputStreamReader |
| | | import java.util.concurrent.Executors |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class NotificationServiceImplTest{ |
| | | |
| | | @Autowired |
| | | lateinit var notificationService: NotificationService |
| | | |
| | | @Test |
| | | fun pushMsgWx() { |
| | | Thread.sleep(10000) |
| | | notificationService.pushMsgWx(0) |
| | | val input = BufferedReader(InputStreamReader(System.`in`)) |
| | | val reader = input.readLine() |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.Impl |
| | | |
| | | import cn.flightfeather.supervision.lightshare.service.WxUserService |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit.jupiter.SpringExtension |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class WxUserServiceImplTest { |
| | | |
| | | @Autowired |
| | | lateinit var wxUserService: WxUserService |
| | | |
| | | @Test |
| | | fun subscribeResult() { |
| | | val msg = "{\"ToUserName\":\"gh_213453153\", \"List\": [{\"TemplateId\":\"sadaihdfjhsadoaiwhfefe\", \"SubscribeStatusString\":\"accept\"}]}" |
| | | wxUserService.subscribeResult(msg) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.timingtask |
| | | |
| | | import cn.flightfeather.supervision.SupervisionApplication |
| | | import cn.flightfeather.supervision.common.net.FumeHttpService |
| | | import cn.flightfeather.supervision.domain.entity.AvgFumeMinuteValue |
| | | import cn.flightfeather.supervision.domain.entity.FumeMinuteValue |
| | | import cn.flightfeather.supervision.domain.mapper.AvgFumeMinuteValueMapper |
| | |
| | | import java.util.* |
| | | import java.util.concurrent.Executors |
| | | import java.util.concurrent.TimeUnit |
| | | import kotlin.math.round |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner::class) |
| | | @SpringBootTest(classes = [SupervisionApplication::class]) |
| | | class PushFumeTest { |
| | | |
| | | @Autowired |
| | | lateinit var pushFume: PushFume |
| | | lateinit var pushFume: TaskPushFume |
| | | |
| | | @Autowired |
| | | lateinit var fumeMinuteValueMapper: FumeMinuteValueMapper |