From 23bd719cebe5feeff4e48fde925b0b39755eea93 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 15 十一月 2022 10:59:50 +0800 Subject: [PATCH] 2022.11.15 --- src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskScoreRemind.kt | 39 + src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt | 2 src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt | 6 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt | 7 src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpController.kt | 61 ++ src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt | 2 src/main/resources/templates/commitment-construction.ftl | 11 src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java | 283 ++++++++++--- src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt | 18 pom.xml | 6 src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt | 2 src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopy.kt | 94 ++++ src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt | 4 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt | 3 src/test/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopyTest.kt | 25 + src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt | 63 ++ src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt | 10 src/main/resources/generator/generatorConfig.xml | 5 src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt | 32 + src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt | 5 src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt | 11 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt | 2 src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpWord.kt | 11 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt | 5 src/main/resources/templates/commitment-vehicle.ftl | 8 src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt | 2 src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt | 19 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt | 6 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt | 41 + src/main/resources/mapper/LawsRegulationsMapper.xml | 93 ++-- src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt | 3 src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt | 5 src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt | 10 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt | 3 src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt | 6 src/main/resources/mapper/LedgerRecordMapper.xml | 22 + src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt | 236 +++++++---- src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt | 8 src/main/resources/application.yml | 4 src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt | 74 +++ 44 files changed, 965 insertions(+), 290 deletions(-) diff --git a/pom.xml b/pom.xml index 8cde2c3..f5e580b 100644 --- a/pom.xml +++ b/pom.xml @@ -301,6 +301,12 @@ <artifactId>aliyun-java-sdk-core</artifactId> <version>[4.3.2,5.0.0)</version> </dependency> + <!-- 闃块噷nlp鑷劧璇█澶勭悊--> + <dependency> + <groupId>com.aliyun</groupId> + <artifactId>aliyun-java-sdk-alinlp</artifactId> + <version>1.0.20</version> + </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> diff --git a/src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt b/src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt index 518e7c5..63fe9e1 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt @@ -25,7 +25,7 @@ @Bean fun runner() = ApplicationRunner { webSocketServer.start() -// taskController.run() + taskController.run() wxTokenManager.run() } } diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpController.kt b/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpController.kt new file mode 100644 index 0000000..4ad88cd --- /dev/null +++ b/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpController.kt @@ -0,0 +1,61 @@ +package cn.flightfeather.supervision.common.nlp + +import cn.flightfeather.supervision.infrastructure.utils.GsonUtils +import com.aliyuncs.DefaultAcsClient +import com.aliyuncs.alinlp.model.v20200629.GetPosChGeneralRequest +import com.aliyuncs.profile.DefaultProfile +import com.google.gson.JsonParser +import org.springframework.stereotype.Component + +/** + * nlp鑷劧璇█澶勭悊 + */ +@Component +class NlpController { + + private val client: DefaultAcsClient + + companion object { + const val accessKeyId = "LTAI4FvmhG97saKL33tDqUV8" + const val accessKeySecret = "3PyluVDS97GTGVmm1p3s6vbLkyqZMf" + + private const val TAG = "NlpController" + } + + init { + val defaultProfile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret) + client = DefaultAcsClient(defaultProfile) + } + + fun execute(str: String): List<String> { + val result = mutableListOf<String>() + + val request = GetPosChGeneralRequest().apply { + setSysEndpoint("alinlp.cn-hangzhou.aliyuncs.com") + serviceCode = "alinlp" + tokenizerId = "GENERAL_CHN" + text = str + } + + val start = System.currentTimeMillis() + val response = client.getAcsResponse(request) + + println(response.hashCode()) + println(response.requestId + "\n" + response.data + "\n" + "cost:" + (System.currentTimeMillis() - start)) + + val json = JsonParser.parseString(response.data).asJsonObject + if (json["success"].asBoolean) { + val r = json["result"].toString() + val list = GsonUtils.parserJsonToArrayBeans(r, NlpWord::class.java) + list.forEach { + if (it.pos in listOf("VV", "NR", "NN", "LC", "FW")) { + result.add(it.word) + } + } + } else { + throw IllegalStateException("${TAG}: 璇嶆�ф爣娉ㄦ帴鍙h姹傚け璐ワ紝閿欒濡備笅锛孿n$json") + } + + return result + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpWord.kt b/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpWord.kt new file mode 100644 index 0000000..cb2cda1 --- /dev/null +++ b/src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpWord.kt @@ -0,0 +1,11 @@ +package cn.flightfeather.supervision.common.nlp + +/** + * 闃块噷鑷劧璇█澶勭悊-涓枃璇嶆�ф爣娉ㄧ粨鏋� + */ +data class NlpWord( + //璇嶆�� + val pos: String, + //璇� + val word: String, +) \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt index c0ddec2..4970b29 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt @@ -26,13 +26,13 @@ @Throws(Exception::class) fun generateContract(param: DynamicParam): List<String> { - // 鐢熸垚html鍚堝悓 + // 鐢熸垚html generateHTML(param.templatePath, param.templateName, param.param) - // 鏍规嵁html鍚堝悓鐢熸垚pdf鍚堝悓 + // 鏍规嵁html鐢熸垚pdf generatePDF(param.outPath + param.outName) // 鏍规嵁pdf鐢熸垚鍥剧墖 val picPaths = generatePic(param.outPath + param.outName) - // 鍒犻櫎涓存椂html鏍煎紡鍚堝悓 + // 鍒犻櫎涓存椂html removeFile(TEMPORARY_CONTRACT_HTML) return picPaths } diff --git a/src/main/kotlin/cn/flightfeather/supervision/push/PushService.kt b/src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt similarity index 96% rename from src/main/kotlin/cn/flightfeather/supervision/push/PushService.kt rename to src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt index c9014b7..4db4a25 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/push/PushService.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt @@ -1,12 +1,9 @@ -package cn.flightfeather.supervision.push +package cn.flightfeather.supervision.common.push -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getRequestId -import com.aliyuncs.push.model.v20160801.PushResponse import com.aliyuncs.utils.ParameterHelper import com.aliyuncs.push.model.v20160801.PushRequest import com.aliyuncs.DefaultAcsClient import com.aliyuncs.profile.DefaultProfile -import com.aliyuncs.profile.IClientProfile import java.util.* diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt b/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt index 93e80a8..29092cd 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt @@ -95,7 +95,8 @@ fun go(_year: Int? = null, _month: Int? = null) { val fileName = "${SCENE_TYPE.des}鑷姩璇勫垎-${DateUtil.DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls" - val filePath = "E:\\宸ヤ綔\\寮�鍙慭\椋炵窘鐜app\\鑷姩璇勫垎\\${SCENE_TYPE.des}\\$fileName" +// val filePath = "E:\\宸ヤ綔\\寮�鍙慭\椋炵窘鐜app\\鑷姩璇勫垎\\${SCENE_TYPE.des}\\$fileName" + val filePath = "C:\\work\\宸ヤ綔\\绗笁鏂圭洃绠\鑷姩璇勫垎\\${SCENE_TYPE.des}\\$fileName" val out = FileOutputStream(File(filePath)) getScoreItem() diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt b/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt index 0737950..98ebaf8 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt @@ -52,15 +52,18 @@ * 瀛e害鍐呭叏鏃犺嚜璇勭殑 -10鍒� */ private fun condition2(): Boolean { -// val period = "${info.year}/$sMonth-$eMonth" -// val e = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { -// createCriteria().andEqualTo("iguid", info.userId) -// .andEqualTo("ertype", 0) -// .andEqualTo("scensename", period) -// }) -// return e.isEmpty() + val periods = mutableListOf<String>() + for (i in sMonth..eMonth) { + periods.add("${info.year}/$i-$i") + } + val e = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { + createCriteria().andEqualTo("iguid", info.userId) + .andEqualTo("ertype", 0) + .andIn("scensename", periods) + }) + return e.isEmpty() // FIXME: 2021/4/26 鑷瘎鏆傛椂涓嶆墸鍒� - return false +// return false } /** diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt b/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt index f88c426..0d84c0e 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component import tk.mybatis.mapper.entity.Example +import java.time.LocalDate import java.time.LocalDateTime import java.time.ZoneId import java.util.* @@ -46,9 +47,12 @@ * 绾夸笂鍩硅鏈鍒版垨绛炬敹鏂囦欢 -3鍒� */ private fun condition1(): Boolean { + val startTime = LocalDate.of(info.year, sMonth, 1).atStartOfDay(ZoneId.systemDefault()) + val lastTime = LocalDate.of(info.year, eMonth, 1).plusMonths(1).atStartOfDay(ZoneId.systemDefault()) val signs = signatureMapper.selectByExample(Example(Signature::class.java).apply { createCriteria().andEqualTo("msParticipantid", info.userId) .andEqualTo("msIssignin", false) + .andBetween("msCreatedate", startTime, lastTime) }) return signs.isNotEmpty() } diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java index 76d3b2a..881da07 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java +++ b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java @@ -19,6 +19,21 @@ private Integer lrResourcelevel; /** + * 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� + */ + @Column(name = "LR_ResourceTypeId") + private Integer lrResourcetypeid; + + /** + * 1.鏂囨。 Word/PDF/Excel/PPT +2.缃戦〉 +3.鍥剧墖 +4.瑙嗛銆乂R銆佸叾浠� + */ + @Column(name = "LR_ResourceFileType") + private Integer lrResourcefiletype; + + /** * 璧勮灏侀潰鍥剧墖url */ @Column(name = "LR_PicUrl") @@ -37,12 +52,6 @@ private Boolean lrIsforeign; /** - * 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� - */ - @Column(name = "LR_ResourceTypeId") - private Integer lrResourcetypeid; - - /** * 鏄惁寮�鏀�,涓哄悗缁鍊兼湇鍔¢鐣欒闂帶鍒讹紝榛樿寮�鏀�1 */ @Column(name = "LR_IsOpen") @@ -50,12 +59,6 @@ @Column(name = "LR_IsUse") private Boolean lrIsuse; - - /** - * Word/PDF/Excel/PPT銆佸浘鐗囥�佽闊炽�佽棰戙�乂R銆佸叾浠� - */ - @Column(name = "LR_ResourceFileType") - private Integer lrResourcefiletype; /** * 鏄惁绂佺敤澶栭儴閾炬帴,褰撳閮ㄨ祫婧愰潪娉曟垨娑夊強鐭ヨ瘑浜ф潈绾犵悍鏃朵笅鏋舵帶鍒� @@ -105,6 +108,30 @@ @Column(name = "LR_Version") private String lrVersion; + @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; + @Column(name = "LR_Extension1") private String lrExtension1; @@ -117,14 +144,14 @@ @Column(name = "LR_Remark") private String lrRemark; + @Column(name = "LR_ResourceDesc") + private String lrResourcedesc; + /** * 鍙互澶氫釜锛屸�溿�佲�濆垎鍓诧紝鐢ㄤ簬绯荤粺鍐呭揩閫熸櫤鑳芥绱紝濡傚浐搴熴�佸嵄搴熴�乂OCs绛� */ @Column(name = "LR_Keywords") private String lrKeywords; - - @Column(name = "LR_ResourceDesc") - private String lrResourcedesc; /** * @return LR_GUID @@ -170,6 +197,54 @@ */ public void setLrResourcelevel(Integer lrResourcelevel) { this.lrResourcelevel = lrResourcelevel; + } + + /** + * 鑾峰彇1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� + * + * @return LR_ResourceTypeId - 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� + */ + public Integer getLrResourcetypeid() { + return lrResourcetypeid; + } + + /** + * 璁剧疆1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� + * + * @param lrResourcetypeid 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� + */ + public void setLrResourcetypeid(Integer lrResourcetypeid) { + this.lrResourcetypeid = lrResourcetypeid; + } + + /** + * 鑾峰彇1.鏂囨。 Word/PDF/Excel/PPT +2.缃戦〉 +3.鍥剧墖 +4.瑙嗛銆乂R銆佸叾浠� + * + * @return LR_ResourceFileType - 1.鏂囨。 Word/PDF/Excel/PPT +2.缃戦〉 +3.鍥剧墖 +4.瑙嗛銆乂R銆佸叾浠� + */ + public Integer getLrResourcefiletype() { + return lrResourcefiletype; + } + + /** + * 璁剧疆1.鏂囨。 Word/PDF/Excel/PPT +2.缃戦〉 +3.鍥剧墖 +4.瑙嗛銆乂R銆佸叾浠� + * + * @param lrResourcefiletype 1.鏂囨。 Word/PDF/Excel/PPT +2.缃戦〉 +3.鍥剧墖 +4.瑙嗛銆乂R銆佸叾浠� + */ + public void setLrResourcefiletype(Integer lrResourcefiletype) { + this.lrResourcefiletype = lrResourcefiletype; } /** @@ -227,24 +302,6 @@ } /** - * 鑾峰彇1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� - * - * @return LR_ResourceTypeId - 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� - */ - public Integer getLrResourcetypeid() { - return lrResourcetypeid; - } - - /** - * 璁剧疆1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� - * - * @param lrResourcetypeid 1娉曞緥娉曡锛�2閫氱煡瑕佹眰锛�3鏍囧噯瑙勮寖锛�4鍩硅鏉愭枡锛�5銆佺ず鑼冩渚嬶紱6銆佸叾浠� - */ - public void setLrResourcetypeid(Integer lrResourcetypeid) { - this.lrResourcetypeid = lrResourcetypeid; - } - - /** * 鑾峰彇鏄惁寮�鏀�,涓哄悗缁鍊兼湇鍔¢鐣欒闂帶鍒讹紝榛樿寮�鏀�1 * * @return LR_IsOpen - 鏄惁寮�鏀�,涓哄悗缁鍊兼湇鍔¢鐣欒闂帶鍒讹紝榛樿寮�鏀�1 @@ -274,24 +331,6 @@ */ public void setLrIsuse(Boolean lrIsuse) { this.lrIsuse = lrIsuse; - } - - /** - * 鑾峰彇Word/PDF/Excel/PPT銆佸浘鐗囥�佽闊炽�佽棰戙�乂R銆佸叾浠� - * - * @return LR_ResourceFileType - Word/PDF/Excel/PPT銆佸浘鐗囥�佽闊炽�佽棰戙�乂R銆佸叾浠� - */ - public Integer getLrResourcefiletype() { - return lrResourcefiletype; - } - - /** - * 璁剧疆Word/PDF/Excel/PPT銆佸浘鐗囥�佽闊炽�佽棰戙�乂R銆佸叾浠� - * - * @param lrResourcefiletype Word/PDF/Excel/PPT銆佸浘鐗囥�佽闊炽�佽棰戙�乂R銆佸叾浠� - */ - public void setLrResourcefiletype(Integer lrResourcefiletype) { - this.lrResourcefiletype = lrResourcefiletype; } /** @@ -489,6 +528,118 @@ } /** + * @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(); + } + + /** * @return LR_Extension1 */ public String getLrExtension1() { @@ -545,9 +696,23 @@ } /** + * @return LR_ResourceDesc + */ + public String getLrResourcedesc() { + return lrResourcedesc; + } + + /** + * @param lrResourcedesc + */ + public void setLrResourcedesc(String lrResourcedesc) { + this.lrResourcedesc = lrResourcedesc == null ? null : lrResourcedesc.trim(); + } + + /** * 鑾峰彇鍙互澶氫釜锛屸�溿�佲�濆垎鍓诧紝鐢ㄤ簬绯荤粺鍐呭揩閫熸櫤鑳芥绱紝濡傚浐搴熴�佸嵄搴熴�乂OCs绛� * - * @return LR_ Keywords - 鍙互澶氫釜锛屸�溿�佲�濆垎鍓诧紝鐢ㄤ簬绯荤粺鍐呭揩閫熸櫤鑳芥绱紝濡傚浐搴熴�佸嵄搴熴�乂OCs绛� + * @return LR_Keywords - 鍙互澶氫釜锛屸�溿�佲�濆垎鍓诧紝鐢ㄤ簬绯荤粺鍐呭揩閫熸櫤鑳芥绱紝濡傚浐搴熴�佸嵄搴熴�乂OCs绛� */ public String getLrKeywords() { return lrKeywords; @@ -560,19 +725,5 @@ */ public void setLrKeywords(String lrKeywords) { this.lrKeywords = lrKeywords == null ? null : lrKeywords.trim(); - } - - /** - * @return LR_ResourceDesc - */ - public String getLrResourcedesc() { - return lrResourcedesc; - } - - /** - * @param lrResourcedesc - */ - public void setLrResourcedesc(String lrResourcedesc) { - this.lrResourcedesc = lrResourcedesc == null ? null : lrResourcedesc.trim(); } } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt index 6b9f354..fe8ded3 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt @@ -2,6 +2,7 @@ import cn.flightfeather.supervision.domain.entity.LedgerRecord import cn.flightfeather.supervision.domain.util.MyMapper +import org.apache.ibatis.annotations.Delete import org.apache.ibatis.annotations.Select import tk.mybatis.mapper.common.Mapper @@ -11,4 +12,14 @@ fun selectByUser(userId: String, year: Int, month: Byte, subTypeId: Int?, sceneType: String, startIndex: Int?, perPage: Int): MutableList<LedgerRecord> fun getLedgerImgs(userId: String, ledgerType: List<Int>):List<LedgerRecord> + + @Select("set @row_number:=0;") + fun setRowNumber() + + @Select("set @median_group:='';") + fun setGroup() + /** + * 鑾峰彇姣忎釜婵�娲荤姸鎬佺殑鐢ㄦ埛闇�瑕佸鍒剁殑姣忕鍙拌处鐨勬渶鏂颁竴鏉¤褰� + */ + fun getNeedCopyLedgers(): List<LedgerRecord> } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt index 32eac49..315e1d2 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt @@ -21,7 +21,7 @@ fun getTotalPoints(userId: String, evaluatorType: Int, startTime: String, endTime: String, sceneTypeId: Int? = null, erGuid: String? = null, eId: String? = null): List<Evaluation> - fun getHistoryPoint(userId: String, page: Int, per_page: Int, response: HttpServletResponse): List<AssessmentGradeVo> + fun getHistoryPoint(userId: String, page: Int, per_page: Int, platform:String?, response: HttpServletResponse): List<AssessmentGradeVo> fun getCreditInfo(userId: String): CreditInfoVo diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt index 2574606..dc9c40b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt @@ -17,6 +17,6 @@ fun findByRuleId(erguid: String): List<Evaluationsubrule> - fun getScore(userId:String, time: String):List<EvaluationVo> + fun getScore(userId:String, time: String, platform:String?):List<EvaluationVo> } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt index d79dee2..693e017 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt @@ -2,10 +2,8 @@ import cn.flightfeather.supervision.common.pdf.DynamicParam import cn.flightfeather.supervision.common.pdf.GeneratePdfUtil -import cn.flightfeather.supervision.common.pdf.PdfUtil import cn.flightfeather.supervision.domain.entity.Commitment import cn.flightfeather.supervision.domain.enumeration.SceneType -import cn.flightfeather.supervision.domain.enumeration.UserType import cn.flightfeather.supervision.domain.mapper.CommitmentMapper import cn.flightfeather.supervision.domain.mapper.UserinfoMapper import cn.flightfeather.supervision.infrastructure.utils.DateUtil @@ -18,18 +16,13 @@ import com.fasterxml.jackson.module.kotlin.readValue import com.github.pagehelper.PageHelper import com.google.gson.Gson -import net.coobird.thumbnailator.tasks.io.InputStreamImageSource import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service import org.springframework.web.multipart.MultipartFile import tk.mybatis.mapper.entity.Example -import java.awt.Image -import java.io.File import java.time.LocalDate import java.time.format.DateTimeFormatter import java.util.* -import javax.imageio.ImageReader -import javax.imageio.stream.ImageInputStream import javax.servlet.http.HttpServletResponse /** diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt index ebd565a..a37458b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt @@ -16,6 +16,7 @@ import com.github.pagehelper.PageHelper import org.springframework.stereotype.Service import tk.mybatis.mapper.entity.Example +import java.time.LocalDateTime import java.util.* import javax.servlet.http.HttpServletResponse @@ -75,16 +76,20 @@ return evaluationMapper.selectByExample(example) } - override fun getHistoryPoint(userId: String, page: Int, per_page: Int, response: HttpServletResponse): List<AssessmentGradeVo> { + override fun getHistoryPoint(userId: String, page: Int, per_page: Int, platform:String?, response: HttpServletResponse): List<AssessmentGradeVo> { val userInfo = userinfoMapper.selectByPrimaryKey(userId) ?: return emptyList() - + // FIXME: 2022/11/8 涓存椂娣诲姞杩囧害鍔熻兘锛屾彁渚涘井淇″皬绋嬪簭鍓嶇姹戒慨绫诲瀷鐨勫満鏅崟鐙殑璇勪及娓呭崟 锛屽満鏅被鍨嬩负 -7 + var sceneType = userInfo.extension2 + if (platform == "weixin" && sceneType == SceneType.VehicleRepair.value.toString()) { + sceneType = "-7" + } //璇勫垎瑙勫垯涓嬬殑鍒嗙骇銆佺瓑绾ч鑹插強绛夌骇璇勮 val pointLevel = mutableListOf<Pair<Int, Int>>() val evaluateLevel = mutableListOf<String>() val creditTexts = mutableListOf<String>() val levelColors = mutableListOf<String>() val rule = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { - createCriteria().andEqualTo("scensetypeid", userInfo.extension2) + createCriteria().andEqualTo("scensetypeid", sceneType) .andEqualTo("ruletype", "0") }) if (rule.isNotEmpty()) { @@ -124,7 +129,7 @@ resultList.add(AssessmentGradeVo().apply { this.userId = userId userRealName = userInfo.realname - sceneType = userInfo.extension2?.toIntOrNull() ?: SceneType.NoType.value + this.sceneType = userInfo.extension2?.toIntOrNull() ?: SceneType.NoType.value tPGuid = it.guid tPRuleGuid = it.stguid totalPoint = it.resultscorebef?.toInt() ?: 0 @@ -144,20 +149,22 @@ override fun getCreditInfo(userId: String): CreditInfoVo { val userinfo = userinfoMapper.selectByPrimaryKey(userId) val baseInfo = baseInfoMapper.selectByPrimaryKey(userId) + ?: return CreditInfoVo( + userId, userinfo.realname,userinfo.extension2?.toIntOrNull() ?: SceneType.NoType.value) val company = companyMapper.selectByPrimaryKey(baseInfo.ciGuid) val result = CreditInfoVo( userId, - baseInfo.biName, + baseInfo?.biName, userinfo.extension2?.toIntOrNull() ?: SceneType.NoType.value, - baseInfo.ciName, - baseInfo.biManagementCompany, - baseInfo.biContact, - baseInfo.biTelephone, - baseInfo.biAddress, - district = company.ciDistrictName, - town = company.ciTownName + baseInfo?.ciName, + baseInfo?.biManagementCompany, + baseInfo?.biContact, + baseInfo?.biTelephone, + baseInfo?.biAddress, + district = company?.ciDistrictName, + town = company?.ciTownName ) val rule = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { @@ -169,7 +176,7 @@ }).takeIf { it.isNotEmpty() }?.get(0) ?: return result val overallEvaluation = overallEvaluationMapper.selectByExample(Example(OverallEvaluation::class.java).apply { - createCriteria().andEqualTo("biGuid", baseInfo.biGuid) + createCriteria().andEqualTo("biGuid", baseInfo?.biGuid) orderBy("oePublishTime").desc() }).takeIf { it.isNotEmpty() }?.get(0) ?: return result @@ -254,10 +261,16 @@ override fun uploadScore(userId: String, period: String, ruleId: String?, itemList: List<Pair<String, String>>): Boolean { val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return false + var sceneType = userinfo.extension2 + + // FIXME: 2022/11/8 涓存椂娣诲姞杩囧害鍔熻兘锛屾彁渚涘井淇″皬绋嬪簭鍓嶇姹戒慨绫诲瀷鐨勫満鏅崟鐙殑璇勪及娓呭崟 锛屽満鏅被鍨嬩负 -7 + if (sceneType == SceneType.VehicleRepair.value.toString()) { + sceneType = "-7" + } //璇ュ満鏅被鍨嬩笅鐨勬�诲緱鍒嗚鍒� val tRule = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { - createCriteria().andEqualTo("scensetypeid", userinfo.extension2) + createCriteria().andEqualTo("scensetypeid", sceneType) .andEqualTo("ruletype", AssessmentRuleType.Total.value) .andIsNull("tasktypeid") }).takeIf { it.isNotEmpty() }?.get(0) @@ -275,7 +288,7 @@ // } val ruleList = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { - createCriteria().andEqualTo("scensetypeid", userinfo.extension2) + createCriteria().andEqualTo("scensetypeid", sceneType) .andNotEqualTo("ruletype", AssessmentRuleType.Total.value) .andIsNull("tasktypeid") }).forEach {rule-> @@ -290,6 +303,7 @@ //鎬诲緱鍒� var totalScore = 0 + //鏍规嵁涓婁紶鐨勯�夋嫨鐨勬潯鐩紝鐢熸垚瀵瑰簲鐨勮瘎鍒嗚褰� itemList.forEach { for (s in subRules) { if (s.guid == it.first) { @@ -307,8 +321,6 @@ } } } while (fatherId?.isNotBlank() == true) - - totalScore += it.second.toInt() break } } @@ -317,16 +329,21 @@ //鎬诲垎 var maxScore = 0 subRules.forEach subRules@{s -> - if (s.ertype == 2) { + //璁$畻搴斿緱鎬诲垎锛宐asic_score锛氳〃绀哄熀纭�鍒嗭紝璁$畻鍦ㄥ簲寰楁�诲垎鍐咃紱addition_score琛ㄧず鍔犲垎锛屼笉璁$畻鍦ㄥ唴 + if (s.ertype == 2 && s.extension1 != "addition_score") { maxScore += s.maxscore ?: 0 } //瑙勫垯宸茬粡鎵撳垎瀹屾瘯锛屽垯璺宠繃 itemEvaluationList.forEach {i -> if (i.esrguid == s.guid) { + //濡傛灉鏄渶澶х殑2绾ц瘎浼拌鍒欙紝璁$畻宸茶幏寰楃殑鎬诲垎 + if (s.ertype == 2) { + totalScore += i.value?.toInt() ?: 0 + } return@subRules } } - //鍚﹀垯鏂板涓�鏉℃湭鎵e垎鐨勮褰� + //鍚﹀垯濡傛灉鍓嶇鍏佽涓嶇敤鍏ㄩ儴璇勫垎锛屾柊澧炰竴鏉℃湭璇勫垎鐨勮褰� itemEvaluationList.add(Itemevaluation().apply { ieguid = UUIDGenerator.generate16ShortUUID() iguid = userId @@ -376,77 +393,89 @@ } override fun getDetail(userId: String, period: String): GradeDetailVo { + val list = period.split("-") + val endM = list[1].toInt() + val list2 = list[0].split("/") + val year = list2[0].toInt() + val startM = list2[1].toInt() + val st = LocalDateTime.of(year, startM, 1, 0, 0, 0, 0) + val et = LocalDateTime.of(year, endM, 1, 0, 0, 0, 0).plusMonths(1) + val result = GradeDetailVo() val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return result + var sceneType = userinfo.extension2 + // FIXME: 2022/11/8 涓存椂娣诲姞杩囧害鍔熻兘锛屾彁渚涘井淇″皬绋嬪簭鍓嶇姹戒慨绫诲瀷鐨勫満鏅崟鐙殑璇勪及娓呭崟 锛屽満鏅被鍨嬩负 -7 + if (sceneType == SceneType.VehicleRepair.value.toString()) { + sceneType = "-7" + } //璇ュ満鏅被鍨嬩笅鐨勬墍鏈夊緱鍒嗚鍒� - var rule0: Evaluationrule? = null - val rule1List = mutableListOf<Evaluationrule>() - evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { - createCriteria().andEqualTo("scensetypeid", userinfo.extension2) - and(createCriteria().orIsNull("tasktypeid").orNotEqualTo("tasktypeid", 1)) - }).forEach { - if (it.ruletype == AssessmentRuleType.Total.value.toString()) { - rule0 = it - } else { - rule1List.add(it) - } - } - if (rule0 == null) return result +// var rule0: Evaluationrule? = null +// val rule1List = mutableListOf<Evaluationrule>() +// evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { +// createCriteria().andEqualTo("scensetypeid", sceneType) +// and(createCriteria().orIsNull("tasktypeid").orNotEqualTo("tasktypeid", 1)) +// }).forEach { +// if (it.ruletype == AssessmentRuleType.Total.value.toString()) { +// rule0 = it +// } else { +// rule1List.add(it) +// } +// } +// if (rule0 == null) return result //寰楀垎瑙h鍜屽緱鍒嗚鎯� evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { createCriteria().andEqualTo("iguid", userId) - .andEqualTo("ertype", AssessmentRuleType.Total.value.toByte()) - .andEqualTo("scensename", period) - }).takeIf { it.isNotEmpty() }?.get(0)?.let { - rule0?.apply { - val pointLevel = mutableListOf<Pair<Int, Int>>() - val evaluateLevel = mutableListOf<String>() - val creditTexts = mutableListOf<String>() - val levelColors = mutableListOf<String>() - extension1?.split("#")?.forEach { - val pStr = it.split(",") - pointLevel.add(Pair(pStr[0].toInt(), pStr[1].toInt())) - } - extension2?.split("#")?.forEach { - evaluateLevel.add(it) - } - extension3?.split("#")?.forEach { - creditTexts.add(it) - } - remark?.split(";")?.forEach { - levelColors.add(it) - } +// .andEqualTo("ertype", AssessmentRuleType.Total.value.toByte()) + and( + createCriteria().orEqualTo("scensename", period) + .orBetween("createdate", st, et) + ) + }).forEach {e -> + val rule = evaluationruleMapper.selectByPrimaryKey(e.stguid) + //鎬诲垎瑙勫垯锛岀敓鎴愭�讳綋璇勪环 + if (rule.ruletype == AssessmentRuleType.Total.value.toString()) { + rule?.apply { + val pointLevel = mutableListOf<Pair<Int, Int>>() + val evaluateLevel = mutableListOf<String>() + val creditTexts = mutableListOf<String>() + val levelColors = mutableListOf<String>() + extension1?.split("#")?.forEach { + val pStr = it.split(",") + pointLevel.add(Pair(pStr[0].toInt(), pStr[1].toInt())) + } + extension2?.split("#")?.forEach { + evaluateLevel.add(it) + } + extension3?.split("#")?.forEach { + creditTexts.add(it) + } + remark?.split(";")?.forEach { + levelColors.add(it) + } - val l = getEvaluationLevel(it.resultscorebef?.toInt() - ?: 0, pointLevel, evaluateLevel, creditTexts, levelColors) - result.apply { - creditText = l["creditText"] - - score = it.resultscorebef?.toInt() ?: 0 - rank = it.promissednum - level = l["evaluateLevel"] - this.period = it.scensename - time = it.createdate + val l = getEvaluationLevel(e.resultscorebef?.toInt() + ?: 0, pointLevel, evaluateLevel, creditTexts, levelColors) + result.apply { + creditText = l["creditText"] + score = e.resultscorebef?.toInt() ?: 0 + rank = e.promissednum + level = l["evaluateLevel"] + this.period = period + time = e.createdate // color = l["color"] + } } } - } - - //鍒嗙被鍒殑寰楀垎(姣忎釜璇勫垎琛ㄧ殑璇勫垎澶ч」鐨勫緱鍒�)鍜屽け鍒嗘潯鐩� - val ruleMap = result.loseScore - rule1List.forEach { - val evaluation = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { - createCriteria().andEqualTo("iguid", userId) - .andEqualTo("ertype", it.ruletype) - .andEqualTo("scensename", period) - }).takeIf { it.isNotEmpty() }?.get(0)?.let {e -> + //鍏蜂綋璇勪及琛� + else { val subRules = evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply { - createCriteria().andEqualTo("erguid", it.guid) + createCriteria().andEqualTo("erguid", rule.guid) }) val itemEvaluations = itemevaluationService.getItemEvaluationList(e.guid!!) - + val ruleMap = result.loseScore + //鍒嗙被鍒殑寰楀垎(姣忎釜璇勫垎琛ㄧ殑璇勫垎澶ч」鐨勫緱鍒�)鍜屽け鍒嗘潯鐩� itemEvaluations.sortedBy { it.ertype }.forEach {item -> when (item.ertype) { //鍒嗙被鍒殑寰楀垎 @@ -483,19 +512,27 @@ for (s in subRules) { if (s.guid == item.esrguid) { val d = - Triple( - item.name ?: "", - if ((item.value?.toInt() ?: 0) < 0) { - item . value ?: "0" - } else { - (item.value?.toInt() ?: 0).minus(s.maxscore ?: 0).toString() - }, - s.remark ?: "" - ) + Triple( + item.name ?: "", +// if ((item.value?.toInt() ?: 0) < 0) { +// item.value ?: "0" +// } else { +// (item.value?.toInt() ?: 0).minus(s.maxscore ?: 0).toString() +// }, + item.value ?: "0", + s.remark ?: "" + ) val rule3Name = s.fathername for (s1 in subRules) { if (s1.itemname == rule3Name) { - val rule2Name = s1.fathername + val rule2Name = + //鐖秈d涓虹┖锛岃鏄庢4绾ц瘎浼伴」鐩存帴闄勫睘浜�2绾ц瘎浼伴」 + if (s1.fathername.isNullOrBlank()) { + ruleMap[rule3Name]?.put(rule3Name, mutableListOf()) + rule3Name + } else { + s1.fathername + } ruleMap[rule2Name]?.get(rule3Name)?.add(d) break } @@ -509,13 +546,15 @@ } } } + } + return result } /** - * 鏍规嵁涓婁紶鐨勫瓙瑙勫垯鎵e垎鎯呭喌锛岀敓浜у瓙椤瑰緱鍒嗚褰� + * 鏍规嵁涓婁紶鐨勫瓙瑙勫垯鎵e垎鎯呭喌锛岀敓鎴愬瓙椤瑰緱鍒嗚褰� * @param rule 鎬昏鍒� * @param eGuid 鎬诲垎璁板綍id * @param userId 鐢ㄦ埛id @@ -528,9 +567,27 @@ var result: Pair<String?, String?> = Pair(null, null) var exist = false for (i in itemEvaluationList) { - //璁板綍宸插瓨鍦紝璇存槑鏄埗椤圭殑璇勫垎瑙勫垯涓嬬殑鏌愪釜瀛愰」鐨勪竴閮ㄥ垎鎵e垎锛屾墸鍒嗙疮鍔� + //璁板綍宸插瓨鍦紝璇存槑鏄埗椤圭殑璇勫垎瑙勫垯涓嬬殑鏌愪釜瀛愰」鐨勪竴閮ㄥ垎鎵e垎锛屾墸鍒嗙疮鍔�,骞朵笖涓嶈兘瓒呰繃鐖堕」鐨勪笂闄� if (subRule.guid == i.esrguid) { - i.value = i.value?.toInt()?.plus(score.toInt())?.toString() + val s = i.value?.toInt()?.plus(score.toInt()) ?: 0 + //鍔犲垎妯″紡 + if (subRule.extension2 == "add_mode") { + if (s > (subRule.maxscore ?: 0)) { + i.value = subRule.maxscore?.toString() ?: "0" + } else { + i.value = s.toString() + } + } + //榛樿鎯呭喌涓哄噺鍒嗘ā寮� + else { + //鍏佽鎵i櫎鐨勫垎鏁版渶灏忓�硷紙璐熸暟锛� + val min = subRule.minscore?.minus(subRule.maxscore ?: 0) ?: 0 + if (s < min) { + i.value = min.toString() + } else { + i.value = s.toString() + } + } result = Pair(subRule.fatherid, i.value) exist = true break @@ -578,7 +635,8 @@ } } else { for (i in pointLevel.indices) { - if (score in pointLevel[i].first..pointLevel[i].second) { + if (score in pointLevel[i].first..pointLevel[i].second || + (i == pointLevel.size - 1 && score > pointLevel[i].second)) { result["color"] = levelColors[i % levelColors.size] result["creditText"] = creditTexts[i % creditTexts.size] result["evaluateLevel"] = evaluateLevel[i % evaluateLevel.size] diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt index d80effc..199bea0 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt @@ -4,6 +4,7 @@ import cn.flightfeather.supervision.domain.entity.Evaluationrule import cn.flightfeather.supervision.domain.entity.Evaluationsubrule import cn.flightfeather.supervision.domain.entity.Itemevaluation +import cn.flightfeather.supervision.domain.enumeration.SceneType import cn.flightfeather.supervision.domain.mapper.* import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService import cn.flightfeather.supervision.lightshare.vo.EvaluationVo @@ -38,9 +39,13 @@ return evaluationsubruleMapper.selectByExample(example) } - override fun getScore(userId: String, time: String): List<EvaluationVo> { + override fun getScore(userId: String, time: String, platform:String?): List<EvaluationVo> { val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return emptyList() - val sceneType = userinfo.extension2 + var sceneType = userinfo.extension2 + // FIXME: 2022/11/8 涓存椂娣诲姞杩囧害鍔熻兘锛屾彁渚涘井淇″皬绋嬪簭鍓嶇姹戒慨绫诲瀷鐨勫満鏅崟鐙殑璇勪及娓呭崟 锛屽満鏅被鍨嬩负 -7 + if (platform == "weixin" && sceneType == SceneType.VehicleRepair.value.toString()) { + sceneType = "-7" + } //璇勫垎鎬昏鍒� val rules = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { createCriteria().andEqualTo("scensetypeid", sceneType) @@ -88,7 +93,14 @@ 2 -> resultList.add(EvaluationVo().apply { id = it.guid title1 = it.itemname - score = it.minscore?.minus(it.maxscore ?: 0) ?: 0 + scoreMode = it.extension1 + gradeMode = it.extension2 + score = when (gradeMode) { + "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 + "add_mode" -> it.maxscore ?: 0 + else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 + } + selectMode = it.extension3 //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑 for (s in subRuleScores) { @@ -104,7 +116,13 @@ r.sub1.add(SubEvaluationVo().apply { id = it.guid title2 = it.itemname - score = it.minscore?.minus(it.maxscore ?: 0) ?: 0 + gradeMode = it.extension2 + selectMode = it.extension3 + score = when (gradeMode) { + "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 + "add_mode" -> it.maxscore ?: 0 + else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 + } group = _group++ //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑 @@ -121,6 +139,7 @@ } 4 -> { resultList.forEach{ r -> + //4绾х殑璇勪及椤圭洿鎺ラ檮灞炰簬2绾ц瘎浼伴」 if (r.id == it.fatherid) { if (r.sub1.isEmpty()) { r.sub1.add(SubEvaluationVo().apply { @@ -128,13 +147,19 @@ id = it.guid title2 = r.title1 score = r.score + gradeMode = r.gradeMode + selectMode = r.selectMode group = _group++ }) } r.sub1[0].sub2.add(ThirdEvaluationVo().apply { id = it.guid content = it.itemname - score = r.score.plus(it.maxscore ?: 0) + score = when (r.sub1[0].gradeMode) { + "minus_mode" -> r.score.plus(it.maxscore ?: 0) + "add_mode" -> it.maxscore ?: 0 + else -> r.score.plus(it.maxscore ?: 0) + } //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑 for (s in subRuleScores) { if (it.guid == s.esrguid) { @@ -149,7 +174,11 @@ sr.sub2.add(ThirdEvaluationVo().apply { id = it.guid content = it.itemname - score = sr.score.plus(it.maxscore ?: 0) + score = when (sr.gradeMode) { + "minus_mode" -> sr.score.plus(it.maxscore ?: 0) + "add_mode" -> it.maxscore ?: 0 + else -> sr.score.plus(it.maxscore ?: 0) + } //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑 for (s in subRuleScores) { if (it.guid == s.esrguid) { diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt index 0e22588..a024872 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt @@ -3,8 +3,10 @@ import cn.flightfeather.supervision.domain.entity.Law import cn.flightfeather.supervision.domain.entity.LawsRegulations import cn.flightfeather.supervision.domain.enumeration.SceneType +import cn.flightfeather.supervision.domain.mapper.BaseInfoMapper import cn.flightfeather.supervision.domain.mapper.LawMapper import cn.flightfeather.supervision.domain.mapper.LawsRegulationsMapper +import cn.flightfeather.supervision.domain.mapper.UserinfoMapper import cn.flightfeather.supervision.lightshare.service.LawService import cn.flightfeather.supervision.lightshare.vo.LawVo import cn.flightfeather.supervision.lightshare.vo.LawsRegulationsCondition @@ -14,7 +16,12 @@ import javax.servlet.http.HttpServletResponse @Service -class LawServiceImpl(val lawMapper: LawMapper, val lawsRegulationsMapper: LawsRegulationsMapper) : LawService { +class LawServiceImpl( + val lawMapper: LawMapper, + val lawsRegulationsMapper: LawsRegulationsMapper, + val userinfoMapper: UserinfoMapper, + val baseInfoMapper: BaseInfoMapper +) : LawService { override fun getLaws(page: Int, per_page: Int, response: HttpServletResponse): ArrayList<LawVo> { val counts = lawMapper.selectCountByExample(Example(Law::class.java)) @@ -50,8 +57,10 @@ return law.laText } - override fun getLawsRegulations( - condition: LawsRegulationsCondition, page: Int, per_page: Int, response: HttpServletResponse): List<LawsRegulations> { + override fun getLawsRegulations(userId: String, + condition: LawsRegulationsCondition, page: Int, per_page: Int, response: HttpServletResponse): List<LawsRegulations> { +// val userInfo = userinfoMapper.selectByPrimaryKey(userId) + val baseInfo = baseInfoMapper.selectByPrimaryKey(userId) val example = Example(LawsRegulations::class.java).apply { createCriteria().apply { condition.apply { @@ -71,6 +80,9 @@ andEqualTo("lrResourcefiletype", it) } } +// baseInfo?.biDistrictCode?.let { +// andEqualTo("biDistrictCode", it) +// } } condition.sceneTypeId?.let { if (it != SceneType.NoType.value) { diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt index 76a8350..c9521ac 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt @@ -353,7 +353,7 @@ return emptyList() } - private fun getLedgerRecords(userId: String, ledgerSubTypeId: Int?, sceneType: Int, time: String): List<LedgerRecord> { + override fun getLedgerRecords(userId: String, ledgerSubTypeId: Int?, sceneType: Int, time: String): List<LedgerRecord> { val ledgerSubTypes = ledgerSubTypeMapper.selectByExample(Example(LedgerSubType::class.java).apply { if (ledgerSubTypeId != null) { createCriteria().andEqualTo("lsSubtypeid", ledgerSubTypeId) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt index be4bb2b..b74776f 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt @@ -1,9 +1,6 @@ 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 @@ -11,12 +8,11 @@ import cn.flightfeather.supervision.lightshare.service.NotificationService import cn.flightfeather.supervision.lightshare.vo.NoticeReadStateVo import cn.flightfeather.supervision.lightshare.vo.NotificationVo -import cn.flightfeather.supervision.push.PushService +import cn.flightfeather.supervision.common.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 diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt index 053434b..4fea98a 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt @@ -1,5 +1,6 @@ package cn.flightfeather.supervision.lightshare.service.Impl +import cn.flightfeather.supervision.common.nlp.NlpController import cn.flightfeather.supervision.domain.entity.* import cn.flightfeather.supervision.domain.enumeration.* import cn.flightfeather.supervision.domain.mapper.* @@ -26,7 +27,8 @@ private val userinfoMapper: UserinfoMapper, private val cstQuestionMapper: CstQuestionMapper, private val settingAnswerMapper: SettingAnswerMapper, - private val enforceCaseMapper: EnforceCaseMapper + private val enforceCaseMapper: EnforceCaseMapper, + private val nlpController: NlpController ) : OnLineQuestionService { @Resource private val onLineQuestionMapper: OnLineQuestionMapper? = null @@ -100,6 +102,11 @@ } override fun searchLaw(userId: String, keyword: String, type: Byte?, page: Int, perPage: Int): BaseResponse<List<ConsultResultVo>> { + val keywordList = if (keyword.isBlank()) { + emptyList() + } else { + nlpController.execute(keyword) + } val userInfo = userinfoMapper.selectByPrimaryKey(userId) ?: return BaseResponse(false) val response = BaseResponse<List<ConsultResultVo>>(false, head = DataHead(page, perPage)) val result = mutableListOf<ConsultResultVo>() @@ -112,14 +119,21 @@ if (type == null || type == ConsultResultType.TYPE1.value) { val p = PageHelper.startPage<MgtFile>(_page, _perPage) val example = Example(MgtFile::class.java).apply { - if (keyword.isNotBlank()) { - createCriteria().orLike("mfName", "%${keyword}%") - .orLike("mfShortName", "%${keyword}%") - .orLike("mfSummary", "%${keyword}%") - .orLike("mfKeywordLv1", "%${keyword}%") - .orLike("mfKeywordLv2", "%${keyword}%") - .orLike("mfKeywordLv3", "%${keyword}%") - .orLike("mfKeywordLv4", "%${keyword}%") + if (keywordList.isNotEmpty()) { + createCriteria().apply { + keywordList.forEach { k -> + orLike("mfName", "%${k}%") + orLike("mfShortName", "%${k}%") + orLike("mfSummary", "%${k}%") + orLike("mfKeywordLv1", "%${k}%") + orLike("mfKeywordLv2", "%${k}%") + orLike("mfKeywordLv3", "%${k}%") + orLike("mfKeywordLv4", "%${k}%") + } + } + and(createCriteria().orLike("mfExtension1", "%${userInfo.extension2}%") + .orEqualTo("mfExtension1", "") + .orIsNull("mfExtension1")) } else { // TODO: 2022/9/8 娌℃湁鍏抽敭瀛楁椂锛屾寜鐓х儹闂ㄨ幏鍙栨満鍒惰幏鍙� createCriteria().orLike("mfExtension1", "%${userInfo.extension2}%") @@ -166,14 +180,19 @@ val map = mutableMapOf<String, MgtFile>() val p = PageHelper.startPage<MgtItem>(_page, _perPage) val example = Example(MgtItem::class.java).apply { - if (keyword.isNotBlank()) { - createCriteria().orLike("miChapterKeyword", "%${keyword}%") - .orLike("miKeyword", "%${keyword}%") + if (keywordList.isNotEmpty()) { + createCriteria().apply { + keywordList.forEach { k -> + orLike("miChapterKeyword", "%${k}%") + orLike("miKeyword", "%${k}%") + } + } } else { // TODO: 2022/9/8 娌℃湁鍏抽敭瀛楁椂锛屾寜鐓х儹闂ㄨ幏鍙栨満鍒惰幏鍙栨潯鐩� } } mgtItemMapper.selectByExample(example).forEach { + if (!map.containsKey(it.mfGuid)) { map[it.mfGuid] = mgtFileMapper.selectByPrimaryKey(it.mfGuid) } @@ -217,13 +236,17 @@ if (type == null || type == ConsultResultType.TYPE4.value) { val p = PageHelper.startPage<CstQuestion>(_page, _perPage) val example = Example(CstQuestion::class.java).apply { - if (keyword.isNotBlank()) { + if (keywordList.isNotEmpty()) { createCriteria().orLike("cqScenes", "%${userInfo.extension2}%") .orEqualTo("cqScenes", "") .orIsNull("cqScenes") and( - createCriteria().orLike("cqContent", "%${keyword}%") - .orLike("cqKeywords", "%${keyword}%") + createCriteria().apply { + keywordList.forEach { k -> + orLike("cqContent", "%${k}%") + orLike("cqKeywords", "%${k}%") + } + } ) } else { // TODO: 2022/9/8 娌℃湁鍏抽敭瀛楁椂锛屾寜鐓х儹闂ㄨ幏鍙栨満鍒惰幏鍙� @@ -274,13 +297,17 @@ if (type == null || type == ConsultResultType.TYPE3.value) { val p = PageHelper.startPage<EnforceCase>(_page, _perPage) val example = Example(EnforceCase::class.java).apply { - if (keyword.isNotBlank()) { + if (keywordList.isNotEmpty()) { createCriteria().orLike("ecScenes", "%${userInfo.extension2}%") .orEqualTo("ecScenes", "") .orIsNull("ecScenes") and( - createCriteria().orLike("ecTitle", "%${keyword}%") - .orLike("ecKeywords", "%${keyword}%") + createCriteria().apply { + keywordList.forEach { k -> + orLike("ecTitle", "%${k}%") + orLike("ecKeywords", "%${k}%") + } + } ) } else { // TODO: 2022/9/8 娌℃湁鍏抽敭瀛楁椂锛屾寜鐓х儹闂ㄨ幏鍙栨満鍒惰幏鍙� diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt index d3961f6..c6475a9 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt @@ -183,7 +183,8 @@ //鐢ㄦ埛openid val openId = (json["FromUserName"] as String?) ?: throw NullPointerException("寰俊鏈嶅姟鍣ㄥ彂閫佺殑璁㈤槄杩斿洖娑堟伅FromUserName瀛楁涓簄ull") //鏃堕棿鎴� - val createTime = (json["CreateTime"] as Int?) ?: throw NullPointerException("寰俊鏈嶅姟鍣ㄥ彂閫佺殑璁㈤槄杩斿洖娑堟伅CreateTime瀛楁涓簄ull") + var createTime = (json["CreateTime"] as Int?)?.toLong() ?: throw NullPointerException("寰俊鏈嶅姟鍣ㄥ彂閫佺殑璁㈤槄杩斿洖娑堟伅CreateTime瀛楁涓簄ull") + createTime = createTime.times(1000)//姝ゅ浼犺繃鏉ョ殑鏃堕棿鎴冲彧绮剧‘鍒扮锛岃浆鎹负姣 //浜嬩欢绫诲瀷锛屾澶勫簲璇ラ兘鏄痚vent val msgType = json["MsgType"] as String? @@ -210,7 +211,7 @@ val templateId = it["TemplateId"] as String? val sStatus = it["SubscribeStatusString"] as String? //鏍规嵁鏃堕棿鍜岀敤鎴穙penId锛屽垽鏂娆℃搷浣滄槸鍚﹂噸澶� - val time = Date(createTime.toLong() * 1000) + val time = Date(createTime.toLong()) val records = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply { createCriteria().andEqualTo("msOpenId", openId) .andEqualTo("msTemplateId", templateId) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt index 90993f3..6f86b6b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt @@ -12,7 +12,7 @@ fun getLawText(lawId: String): String - fun getLawsRegulations(condition: LawsRegulationsCondition, page: Int, per_page: Int, response: HttpServletResponse): List<LawsRegulations> + fun getLawsRegulations(userId: String, condition: LawsRegulationsCondition, page: Int, per_page: Int, response: HttpServletResponse): List<LawsRegulations> fun getLawsRegulationsWithEachType(condition: LawsRegulationsCondition): List<LawsRegulations> diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt index a049cf7..2625971 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt @@ -1,5 +1,6 @@ package cn.flightfeather.supervision.lightshare.service +import cn.flightfeather.supervision.domain.entity.LedgerRecord import cn.flightfeather.supervision.lightshare.vo.* import org.springframework.http.client.MultipartBodyBuilder import org.springframework.web.multipart.MultipartFile @@ -23,6 +24,8 @@ fun getLedgerImgs(userId: String, ledgerType: List<Int>): List<LedgerVo> + fun getLedgerRecords(userId: String, ledgerSubTypeId: Int?, sceneType: Int, time: String): List<LedgerRecord> + fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String> fun checkLedger(verifierId: String, remark: String?, recordList: List<LedgerCheckVo>):BaseResponse<Boolean> diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt index 6dc80d3..e3b006b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt @@ -12,6 +12,12 @@ var score: Int = 0 //鏄惁閫変腑 var select: Boolean = false + //basic_score: 鍩虹鍒嗭紝蹇呴�夛紱addition_score锛氶檮鍔犲垎锛屽彲閫夛紱null锛氶粯璁ゅ熀纭�鍒� + var scoreMode: String? = "basic_score" + //minus_mode: 鍑忓垎妯″紡锛沘dd_mode锛氬姞鍒嗘ā寮忥紱null锛氫笉鍋氳瀹氾紝璇存槑鍏跺瓙椤逛笉鏄叿浣撶殑璇勪及缁嗗垯 + var gradeMode: String? = "minus_mode" + //single_mode: 鍗曢�夋ā寮忥紱multi_mode锛氬閫夋ā寮忥紱null锛氫笉鍋氳瀹氾紝璇存槑鍏跺瓙椤逛笉鏄叿浣撶殑璇勪及缁嗗垯 + var selectMode: String? = "single_mode" //浜岀骇瀛愯鍒� var sub1: MutableList<SubEvaluationVo> = mutableListOf() } @@ -27,6 +33,10 @@ var score: Int = 0 //鏄惁閫変腑 var select: Boolean = false + //minus_mode: 鍑忓垎妯″紡锛沘dd_mode锛氬姞鍒嗘ā寮忥紱 + var gradeMode: String? = "minus_mode" + //single_mode: 鍗曢�夋ā寮忥紱multi_mode锛氬閫夋ā寮忥紱 + var selectMode: String? = "single_mode" //浜岀骇瑙勫垯鍒嗙粍 var group: Int? = null //涓夌骇瀛愯鍒� diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt index cb04c6e..2dbd910 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt @@ -53,8 +53,9 @@ @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String, @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int, @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int, + @ApiParam(value = "鍓嶇骞冲彴") @RequestParam("platform", required = false) platform:String?, response: HttpServletResponse - ) = evaluationService.getHistoryPoint(userId, page, perPage, response) + ) = evaluationService.getHistoryPoint(userId, page, perPage, platform, response) @ApiOperation(value = "鑾峰彇淇$敤璇勪及缁撴灉") @GetMapping("/creditInfo") @@ -86,7 +87,7 @@ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String, @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String, @ApiParam(value = "璇勫垎瑙勫垯id") @RequestParam(value = "ruleId", required = false) ruleId: String?, - @ApiParam(value = "鍏蜂綋鎵e垎鏉$洰") @RequestBody itemList: List<Pair<String, String>>, + @ApiParam(value = "鍏蜂綋鎵e垎鏉$洰锛堝彧浼犳渶灏忕骇鍒殑璇勪及椤癸級") @RequestBody itemList: List<Pair<String, String>>, ) = evaluationService.uploadScore(userId, period, ruleId, itemList) @ApiOperation(value = "鑾峰彇娴嬭瘎璇︽儏") diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt index c80bb9b..795ef11 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt @@ -38,5 +38,6 @@ fun getScore( @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId:String, @ApiParam(value = "璇勪及鍛ㄦ湡", example = "yyyy/M-M") @RequestParam("time") time:String, - ) = evaluationsubruleService.getScore(userId, time) + @ApiParam(value = "鍓嶇骞冲彴") @RequestParam("platform", required = false) platform:String?, + ) = evaluationsubruleService.getScore(userId, time, platform) } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt index 4804d87..eaf477a 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt @@ -35,7 +35,7 @@ @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int, @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int, response: HttpServletResponse - ) = lawService.getLawsRegulations(condition, page, perPage, response) + ) = lawService.getLawsRegulations(userId, condition, page, perPage, response) @ApiOperation(value = "鏍规嵁琛屼笟绫诲瀷鏌ユ壘鐩稿叧娉曞緥娉曡") @PostMapping("/eachType/{userId}") diff --git a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt index 0a26809..26cf551 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt @@ -14,7 +14,7 @@ */ @Component class TaskController( - fetchVOC: TaskFetchVOC, pushFume: TaskPushFume + fetchVOC: TaskFetchVOC, pushFume: TaskPushFume, ledgerCopy: TaskLedgerCopy ) { companion object { @@ -32,8 +32,12 @@ init { LOGGER.info("娣诲姞瀹氭椂浠诲姟") timeTask.clear() + //椋炵窘鐜锛岃幏鍙杤oc鏁版嵁銆佹帹閫佹补鐑熸暟鎹� // timeTask.add(fetchVOC) // timeTask.add(pushFume) + + //寰俊灏忕▼搴忥紙涓皬浼佷笟瀹堟硶鑷姪锛夛紝鍙拌处澶嶅埗銆佸畾鏃朵换鍔℃帹閫佺瓑 + timeTask.add(ledgerCopy) LOGGER.info("娣诲姞瀹氭椂浠诲姟瀹屾垚锛屼换鍔℃�昏${timeTask.size}涓�") } @@ -58,9 +62,9 @@ } val localtime = LocalDateTime.now() - LOGGER.info("瀹氭椂浠诲姟鎵ц锛屽畾鏃朵换鍔℃暟锛�${timeTask.size}") +// LOGGER.info("瀹氭椂浠诲姟鎵ц锛屽畾鏃朵换鍔℃暟锛�${timeTask.size}") timeTask.forEach { - LOGGER.info("瀹氭椂浠诲姟锛�${it.javaClass.name}") +// LOGGER.info("瀹氭椂浠诲姟锛�${it.javaClass.name}") it.execute(localtime) } // localtime = localtime.plusMinutes(1) diff --git a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopy.kt b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopy.kt new file mode 100644 index 0000000..df4391a --- /dev/null +++ b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopy.kt @@ -0,0 +1,94 @@ +package cn.flightfeather.supervision.timingtask + +import cn.flightfeather.supervision.domain.entity.LedgerMediaFile +import cn.flightfeather.supervision.domain.entity.LedgerRecord +import cn.flightfeather.supervision.domain.mapper.LedgerMediaFileMapper +import cn.flightfeather.supervision.domain.mapper.LedgerRecordMapper +import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.stereotype.Component +import tk.mybatis.mapper.entity.Example +import java.time.LocalDateTime +import java.time.ZoneId +import java.util.* + +/** + * 鍙拌处鑷姩澶嶅埗浠诲姟 + */ +@Component +class TaskLedgerCopy( + private val ledgerRecordMapper: LedgerRecordMapper, + private val ledgerMediaFileMapper: LedgerMediaFileMapper +) : BaseTimingTask() { + + private val LOGGER: Logger? = LoggerFactory.getLogger(TaskLedgerCopy::class.java) + + //鍙拌处澶嶅埗鐨勬棩鏈� + var copyDay = 11 + + override val period: Long + get() = 1440L + + override fun doTask(localtime: LocalDateTime) { + //1. 鏌ヨ姣忎釜婵�娲荤姸鎬佺殑鐢ㄦ埛闇�瑕佸鍒剁殑姣忕鍙拌处鐨勬渶鏂颁竴鏉¤褰曪紱 + ledgerRecordMapper.setRowNumber() + ledgerRecordMapper.setGroup() + val records = ledgerRecordMapper.getNeedCopyLedgers() + if (records.isEmpty()) return + + LOGGER?.info("===========寮�濮嬫墽琛屽彴璐﹀鍒朵换鍔�===============") + LOGGER?.info("=> 闇�澶嶅埗鐨勫彴璐︽�绘暟涓猴細${records.size}") + var count = 0 + val year = localtime.year + val month = localtime.monthValue + val day = localtime.dayOfMonth + records.forEach { lr -> + //鍙拌处鍘婚噸鍒ゆ柇 + val r = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply { + createCriteria().andEqualTo("lrYear", year) + .andEqualTo("lrMonth", month) + .andEqualTo("lsSubtypeid", lr.lsSubtypeid) + .andEqualTo("lrSubmitid", lr.lrSubmitid) + }) + if (r.isNotEmpty()) return@forEach + + //鑾峰彇璁板綍瀵瑰簲鐨勬枃浠朵俊鎭� + val fileList = ledgerMediaFileMapper.selectByExample(Example(LedgerMediaFile::class.java).apply { + createCriteria().andEqualTo("lrGuid", lr.lrGuid) + }) + if (fileList.size == 0) return@forEach + val file = fileList[0] ?: return@forEach + + //淇敼璁板綍淇℃伅锛屽鍒朵负鏂扮殑鍙拌处 + lr.lrGuid = UUIDGenerator.generate16ShortUUID() + lr.lrYear = year + lr.lrMonth = month.toByte() + lr.lrDay = day.toByte() + lr.lrIssubmitontime = true + lr.lrSubmitdate = Date.from(localtime.atZone(ZoneId.systemDefault()).toInstant()) + lr.lrExtension2 = "copy"//琛ㄦ槑鏄鍒剁殑鍙拌处 + ledgerRecordMapper.insert(lr) + + //淇敼瀵瑰簲鐨勬枃浠朵俊鎭� + file.apply { + mfGuid = UUIDGenerator.generate16ShortUUID() + lrGuid = lr.lrGuid + mfSavetime = Date() + } + count += ledgerMediaFileMapper.insert(file) + } + + LOGGER?.info("=> 鎴愬姛澶嶅埗鐨勫彴璐︽暟锛�${count}") + LOGGER?.info("===========鍙拌处澶嶅埗浠诲姟瀹屾垚===============") + } + + /** + * 鍙拌处鑷姩澶嶅埗浠诲姟瀹氫负姣忔湀11鍙锋棭涓�1鐐癸紝锛堟瘡鏈堢殑10鍙蜂负鍙拌处鍙婃椂鎻愪氦鐨勬渶鍚庢湡闄愶級 + */ + override fun execute(localtime: LocalDateTime) { + if (localtime.dayOfMonth == copyDay && localtime.hour == 1) { + doTask(localtime) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt index 8fc78f4..b8ac686 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt @@ -1,39 +1,103 @@ package cn.flightfeather.supervision.timingtask import cn.flightfeather.supervision.common.wx.TemplateManager +import cn.flightfeather.supervision.domain.entity.LedgerSubType import cn.flightfeather.supervision.domain.entity.MsgSubscribeWx +import cn.flightfeather.supervision.domain.enumeration.SceneType +import cn.flightfeather.supervision.domain.mapper.LedgerSubTypeMapper import cn.flightfeather.supervision.domain.mapper.MsgSubscribeWxMapper +import cn.flightfeather.supervision.domain.mapper.UserInfoWxMapper +import cn.flightfeather.supervision.domain.mapper.UserinfoMapper +import cn.flightfeather.supervision.lightshare.service.LedgerService +import org.slf4j.Logger +import org.slf4j.LoggerFactory import org.springframework.stereotype.Component import tk.mybatis.mapper.entity.Example import java.time.LocalDateTime +import java.time.format.DateTimeFormatter /** * 鍙拌处涓婁紶鍊掕鏃舵彁閱� */ @Component class TaskLedgerRemind( - private val msgSubscribeWxMapper: MsgSubscribeWxMapper + private val msgSubscribeWxMapper: MsgSubscribeWxMapper, + private val userInfoWxMapper: UserInfoWxMapper, + private val userinfoMapper: UserinfoMapper, + private val ledgerSubTypeMapper: LedgerSubTypeMapper, + private val ledgerService: LedgerService, + private val templateManager: TemplateManager ) : BaseTimingTask() { + + private val LOGGER: Logger? = LoggerFactory.getLogger(TaskLedgerRemind::class.java) + + //鍦烘櫙鍜屽搴旂殑鍙拌处绫诲瀷 + private val ledgerTypeMap = mutableMapOf<String, MutableList<LedgerSubType>>() override val period: Long get() = 1440L override fun doTask(localtime: LocalDateTime) { + LOGGER?.info("===========寮�濮嬫墽琛屽彴璐︽彁閱掓帹閫佷换鍔�===============") //1.閫夋嫨宸茶闃呬簡璇ユ潯鎻愰啋鐨勫井淇$敤鎴� val ms = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply { createCriteria().andEqualTo("msTemplateId", TemplateManager.TEMPLATE_1) .andGreaterThan("msCount", 0) + .andEqualTo("msAccept", true) }) - //2.鏌ユ壘寰俊鐢ㄦ埛缁戝畾鐨勫満鏅彴璐︿笂浼犳儏鍐� - //3.鏍规嵁缁熻缁撴灉鍐冲畾鏄惁鍙戦�佹彁閱掓帹閫� + LOGGER?.info("=> 鍙帴鏀舵帹閫佺殑寰俊鐢ㄦ埛鎬绘暟涓猴細${ms.size}") + var count = 0 + ms.forEach { + //2.鏌ユ壘寰俊鐢ㄦ埛缁戝畾鐨勫満鏅彴璐︿笂浼犳儏鍐� + val uInfoWx = userInfoWxMapper.selectByPrimaryKey(it?.msOpenId) ?: return@forEach + val userinfo = userinfoMapper.selectByPrimaryKey(uInfoWx.uiGuid) ?: return@forEach + if (userinfo.extension2 == null) { + LOGGER?.error("鐢ㄦ埛[${userinfo.acountname}]鐨勫満鏅被鍨嬪瓧娈典负绌�") + return@forEach + } + + //2.1 鑾峰彇鐢ㄦ埛瀵瑰簲鐨勫彴璐︾被鍨� + val ledgerSubTypes = if (ledgerTypeMap.containsKey(userinfo.extension2)) { + ledgerTypeMap[userinfo.extension2] + } else { + ledgerSubTypeMapper.selectByExample(Example(LedgerSubType::class.java).apply { + createCriteria().andEqualTo("lScenetype", userinfo.extension2) + orderBy("lTypeid") + }) + } + //2.2 鑾峰彇鐢ㄦ埛褰撳墠鏈堜唤鐨勬彁浜よ褰� + val records = ledgerService.getLedgerRecords(uInfoWx.uiGuid, null, userinfo.extension2!!.toInt(), localtime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + var mustTotal = 0//蹇呭~椤规�绘暟 + var mustCount = 0//蹇呭~椤逛笂浼犳暟 + ledgerSubTypes?.forEach { t -> + if (t.getlNeedupdate()) mustTotal++ + + for (r in records) { + if (t.lsSubtypeid == r.lsSubtypeid) { + mustCount++ + break + } + } + } + //3.鏍规嵁缁熻缁撴灉鍐冲畾鏄惁鍙戦�佹彁閱掓帹閫� + if (mustCount < mustTotal) { + val leftDay = 10 - localtime.dayOfMonth + templateManager.sendMsg(0, it!!.msOpenId, + listOf("鍙拌处涓婁紶", "${localtime.year}骞�${localtime.monthValue}鏈�10鏃�", leftDay.toString(), "璇烽噸鐐瑰叧娉ㄧ幇鍦鸿嚜瀵绘煡閮ㄥ垎")) + count++ + } + } + LOGGER?.info("=> 瀹為檯鎺ㄩ�佺殑寰俊鐢ㄦ埛鏁颁负锛�${count}") + LOGGER?.info("===========鍙拌处鎻愰啋鎺ㄩ�佷换鍔$粨鏉�===============") } /** - * 鍙拌处鎻愰啋浠诲姟瀹氫负姣忔湀5鍙锋棭涓�10鐐规彁閱掑綋鏈�10鍙蜂箣鍓嶆彁浜ゅ彴璐� + * 鍙拌处鎻愰啋浠诲姟瀹氫负姣忔湀5鍙锋垨9鍙锋棭涓�10鐐规彁閱掑綋鏈�10鍙蜂箣鍓嶆彁浜ゅ彴璐� */ override fun execute(localtime: LocalDateTime) { - if (localtime.dayOfMonth == 5) { + if (localtime.dayOfMonth == 5 || localtime.dayOfMonth == 9) { doTask(localtime) + } } } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt index 55d4069..26ded0e 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt @@ -45,15 +45,15 @@ get() = 1L override fun doTask(localtime: LocalDateTime) { - LOGGER.info("===========寮�濮嬫墽琛屾补鐑熸暟鎹笂浼犱换鍔�===============") - // 鍒锋柊鐩戞祴鐐圭紪鍙� - refreshDeviceCode() - //姣�10鍒嗛挓璁$畻涓�娆″钩鍧囧�煎苟涓婁紶 // FIXME: 2021/4/8 鍧囧�肩殑璁$畻閫昏緫涔嬪悗搴旇鏀惧埌鍏朵粬妯″潡 val min = localtime.minute if (min != 0 && min != 10 && min != 20 && min != 30 && min != 40 && min != 50) return + LOGGER.info("===========寮�濮嬫墽琛屾补鐑熸暟鎹笂浼犱换鍔�===============") + // 鍒锋柊鐩戞祴鐐圭紪鍙� + refreshDeviceCode() + //璁$畻鍙栧�兼椂闂� val endTime = Date.from(localtime.minusMinutes(1).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()) val startTime = Date.from(localtime.minusMinutes(10).withSecond(0).atZone(ZoneId.systemDefault()).toInstant()) diff --git a/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskScoreRemind.kt b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskScoreRemind.kt new file mode 100644 index 0000000..a68e843 --- /dev/null +++ b/src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskScoreRemind.kt @@ -0,0 +1,39 @@ +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 TaskScoreRemind( + 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) + } + } +} \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 741dcd1..ee08b70 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,12 +12,12 @@ # password: 123456 #-TestEnd- - url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false + url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false username: ledger password: ledger_fxxchackxr # 寮�鍙戣繙绋嬫湇鍔″櫒 -# url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false +# url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false # username: remoteU1 # password: eSoF8DnzfGTlhAjE diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml index 65354ff..de7b1eb 100644 --- a/src/main/resources/generator/generatorConfig.xml +++ b/src/main/resources/generator/generatorConfig.xml @@ -64,7 +64,7 @@ <!--<table tableName="tc_t_vmroom" domainObjectName="VMRoom" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> <!--<table tableName="ea_companyinfo" domainObjectName="Company" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> <!--<table tableName="tc_t_m_materials_sign_state" domainObjectName="MaterialSignState" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> - <!--<table tableName="ec_t_lawsregulations" domainObjectName="LawsRegulations" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> + <table tableName="ec_t_lawsregulations" domainObjectName="LawsRegulations" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <!--<table tableName="ea_t_baseinfo" domainObjectName="BaseInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> <!--<table tableName="ea_t_evaluation" domainObjectName="Evaluation2" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> <!--<table tableName="ea_t_fumepurifydevice" domainObjectName="FumePurifyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> @@ -102,7 +102,6 @@ <!-- <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"/> +<!-- <table tableName="sm_t_userinfo" domainObjectName="Userinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> </context> </generatorConfiguration> \ No newline at end of file diff --git a/src/main/resources/mapper/LawsRegulationsMapper.xml b/src/main/resources/mapper/LawsRegulationsMapper.xml index 8a0c8cb..507dee0 100644 --- a/src/main/resources/mapper/LawsRegulationsMapper.xml +++ b/src/main/resources/mapper/LawsRegulationsMapper.xml @@ -1,60 +1,69 @@ -<?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.LawsRegulationsMapper" > - <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LawsRegulations" > +<?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.LawsRegulationsMapper"> + <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LawsRegulations"> <!-- WARNING - @mbg.generated --> - <id column="LR_GUID" property="lrGuid" jdbcType="VARCHAR" /> - <result column="LR_ResourceTitle" property="lrResourcetitle" jdbcType="VARCHAR" /> - <result column="LR_ResourceLevel" property="lrResourcelevel" jdbcType="INTEGER" /> - <result column="LR_PicUrl" property="lrPicurl" jdbcType="VARCHAR" /> - <result column="LR_BodyUrl" property="lrBodyurl" jdbcType="VARCHAR" /> - <result column="LR_IsForeign" property="lrIsforeign" jdbcType="BIT" /> - <result column="LR_ResourceTypeId" property="lrResourcetypeid" jdbcType="INTEGER" /> - <result column="LR_IsOpen" property="lrIsopen" jdbcType="BIT" /> - <result column="LR_IsUse" property="lrIsuse" jdbcType="BIT" /> - <result column="LR_ResourceFileType" property="lrResourcefiletype" jdbcType="INTEGER" /> - <result column="LR_IsUseOutUrls" property="lrIsuseouturls" jdbcType="BIT" /> - <result column="LR_ResourceOutUrls" property="lrResourceouturls" jdbcType="VARCHAR" /> - <result column="LR_ResourceUrls" property="lrResourceurls" jdbcType="VARCHAR" /> - <result column="LR_CreatorId" property="lrCreatorid" jdbcType="VARCHAR" /> - <result column="LR_Creator" property="lrCreator" jdbcType="VARCHAR" /> - <result column="LR_CreateDate" property="lrCreatedate" jdbcType="TIMESTAMP" /> - <result column="LR_ModifierId" property="lrModifierid" jdbcType="VARCHAR" /> - <result column="LR_Modifier" property="lrModifier" jdbcType="VARCHAR" /> - <result column="LR_UpdateDate" property="lrUpdatedate" jdbcType="TIMESTAMP" /> - <result column="LR_PublishId" property="lrPublishid" jdbcType="VARCHAR" /> - <result column="LR_Publish" property="lrPublish" jdbcType="VARCHAR" /> - <result column="LR_PublishDate" property="lrPublishdate" jdbcType="TIMESTAMP" /> - <result column="LR_Version" property="lrVersion" jdbcType="VARCHAR" /> - <result column="LR_Extension1" property="lrExtension1" jdbcType="VARCHAR" /> - <result column="LR_Extension2" property="lrExtension2" jdbcType="VARCHAR" /> - <result column="LR_Extension3" property="lrExtension3" jdbcType="VARCHAR" /> - <result column="LR_Remark" property="lrRemark" jdbcType="VARCHAR" /> + <id column="LR_GUID" jdbcType="VARCHAR" property="lrGuid" /> + <result column="LR_ResourceTitle" jdbcType="VARCHAR" property="lrResourcetitle" /> + <result column="LR_ResourceLevel" jdbcType="INTEGER" property="lrResourcelevel" /> + <result column="LR_ResourceTypeId" jdbcType="INTEGER" property="lrResourcetypeid" /> + <result column="LR_ResourceFileType" jdbcType="INTEGER" property="lrResourcefiletype" /> + <result column="LR_PicUrl" jdbcType="VARCHAR" property="lrPicurl" /> + <result column="LR_BodyUrl" jdbcType="VARCHAR" property="lrBodyurl" /> + <result column="LR_IsForeign" jdbcType="BIT" property="lrIsforeign" /> + <result column="LR_IsOpen" jdbcType="BIT" property="lrIsopen" /> + <result column="LR_IsUse" jdbcType="BIT" property="lrIsuse" /> + <result column="LR_IsUseOutUrls" jdbcType="BIT" property="lrIsuseouturls" /> + <result column="LR_ResourceOutUrls" jdbcType="VARCHAR" property="lrResourceouturls" /> + <result column="LR_ResourceUrls" jdbcType="VARCHAR" property="lrResourceurls" /> + <result column="LR_CreatorId" jdbcType="VARCHAR" property="lrCreatorid" /> + <result column="LR_Creator" jdbcType="VARCHAR" property="lrCreator" /> + <result column="LR_CreateDate" jdbcType="TIMESTAMP" property="lrCreatedate" /> + <result column="LR_ModifierId" jdbcType="VARCHAR" property="lrModifierid" /> + <result column="LR_Modifier" jdbcType="VARCHAR" property="lrModifier" /> + <result column="LR_UpdateDate" jdbcType="TIMESTAMP" property="lrUpdatedate" /> + <result column="LR_PublishId" jdbcType="VARCHAR" property="lrPublishid" /> + <result column="LR_Publish" jdbcType="VARCHAR" property="lrPublish" /> + <result column="LR_PublishDate" jdbcType="TIMESTAMP" property="lrPublishdate" /> + <result column="LR_Version" jdbcType="VARCHAR" property="lrVersion" /> + <result column="BI_Province_Code" jdbcType="VARCHAR" property="biProvinceCode" /> + <result column="BI_Province_Name" jdbcType="VARCHAR" property="biProvinceName" /> + <result column="BI_City_Code" jdbcType="VARCHAR" property="biCityCode" /> + <result column="BI_City_Name" jdbcType="VARCHAR" property="biCityName" /> + <result column="BI_District_Code" jdbcType="VARCHAR" property="biDistrictCode" /> + <result column="BI_District_Name" jdbcType="VARCHAR" property="biDistrictName" /> + <result column="BI_Town_Code" jdbcType="VARCHAR" property="biTownCode" /> + <result column="BI_Town_Name" jdbcType="VARCHAR" property="biTownName" /> + <result column="LR_Extension1" jdbcType="VARCHAR" property="lrExtension1" /> + <result column="LR_Extension2" jdbcType="VARCHAR" property="lrExtension2" /> + <result column="LR_Extension3" jdbcType="VARCHAR" property="lrExtension3" /> + <result column="LR_Remark" jdbcType="VARCHAR" property="lrRemark" /> </resultMap> - <resultMap id="ResultMapWithBLOBs" type="cn.flightfeather.supervision.domain.entity.LawsRegulations" extends="BaseResultMap" > + <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.flightfeather.supervision.domain.entity.LawsRegulations"> <!-- WARNING - @mbg.generated --> - <result column="LR_Keywords" property="lrKeywords" jdbcType="LONGVARCHAR" /> - <result column="LR_ResourceDesc" property="lrResourcedesc" jdbcType="LONGVARCHAR" /> + <result column="LR_ResourceDesc" jdbcType="LONGVARCHAR" property="lrResourcedesc" /> + <result column="LR_Keywords" jdbcType="LONGVARCHAR" property="lrKeywords" /> </resultMap> - <sql id="Base_Column_List" > + <sql id="Base_Column_List"> <!-- WARNING - @mbg.generated --> - LR_GUID, LR_ResourceTitle, LR_ResourceLevel, LR_PicUrl, LR_BodyUrl, LR_IsForeign, - LR_ResourceTypeId, LR_IsOpen, LR_IsUse, LR_ResourceFileType, LR_IsUseOutUrls, LR_ResourceOutUrls, + LR_GUID, LR_ResourceTitle, LR_ResourceLevel, LR_ResourceTypeId, LR_ResourceFileType, + LR_PicUrl, LR_BodyUrl, LR_IsForeign, LR_IsOpen, LR_IsUse, LR_IsUseOutUrls, LR_ResourceOutUrls, LR_ResourceUrls, LR_CreatorId, LR_Creator, LR_CreateDate, LR_ModifierId, LR_Modifier, - LR_UpdateDate, LR_PublishId, LR_Publish, LR_PublishDate, LR_Version, LR_Extension1, - LR_Extension2, LR_Extension3, LR_Remark + LR_UpdateDate, LR_PublishId, LR_Publish, LR_PublishDate, LR_Version, BI_Province_Code, + BI_Province_Name, BI_City_Code, BI_City_Name, BI_District_Code, BI_District_Name, + BI_Town_Code, BI_Town_Name, LR_Extension1, LR_Extension2, LR_Extension3, LR_Remark </sql> - <sql id="Blob_Column_List" > + <sql id="Blob_Column_List"> <!-- WARNING - @mbg.generated --> - LR_Keywords, LR_ResourceDesc + LR_ResourceDesc, LR_Keywords </sql> <select id="getLawsRegulations" resultMap="BaseResultMap"> @@ -78,7 +87,7 @@ and (select count(*) + 1 from ec_t_lawsregulations t2 where t2.LR_ResourceTypeId = t1.LR_ResourceTypeId - AND t2.LR_PublishDate > t1.LR_PublishDate + AND t2.LR_PublishDate > t1.LR_PublishDate <if test="param1 != null"> and t1.LR_ResourceLevel = #{param1} </if> diff --git a/src/main/resources/mapper/LedgerRecordMapper.xml b/src/main/resources/mapper/LedgerRecordMapper.xml index f493a1c..a63755e 100644 --- a/src/main/resources/mapper/LedgerRecordMapper.xml +++ b/src/main/resources/mapper/LedgerRecordMapper.xml @@ -61,4 +61,26 @@ limit #{param6}, #{param7} </if> </select> + + <select id="getNeedCopyLedgers" resultMap="BaseResultMap"> + SELECT * FROM + (SELECT + @row_number:=CASE WHEN @median_group = t_ledger.g THEN @row_number+1 else 1 END AS i, + @median_group:= t_ledger.g AS median_group, + t_ledger.* + FROM + ( + SELECT + a.*, + STR_TO_DATE(concat(a.LR_Year,'-',a.LR_Month,'-',a.LR_Day),'%Y-%m-%d') as d, + CONCAT(a.LR_SubmitID, a.LS_SubTypeId) as g + FROM + ea_t_ledgerrecord AS a + ORDER BY LR_SubmitID, LS_SubTypeId, d DESC + ) as t_ledger + LEFT JOIN sm_t_userinfo AS b ON t_ledger.LR_SubmitID = b.UI_GUID + LEFT JOIN ea_t_ledgersubtype AS c ON t_ledger.LS_SubTypeId = c.LS_SubTypeId + WHERE b.UI_IsEnable = TRUE AND c.L_Auto_Copy = TRUE) as r + WHERE i = 1 + </select> </mapper> \ No newline at end of file diff --git a/src/main/resources/templates/commitment-construction.ftl b/src/main/resources/templates/commitment-construction.ftl index 8c9c409..01ca94c 100644 --- a/src/main/resources/templates/commitment-construction.ftl +++ b/src/main/resources/templates/commitment-construction.ftl @@ -77,7 +77,7 @@ style="font-family:瀹嬩綋; font-size:10pt">${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 @@ -205,7 +205,7 @@ <p style="line-height:20pt; margin:0pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"> <span style="font-family:瀹嬩綋; font-size:10pt">鍏�佹壃灏樺湪绾跨洃娴嬭澶囧畨瑁呭悗椤荤‘淇濈ǔ瀹氳繍琛岋紝骞�</span><span - style="font-family:瀹嬩綋; font-size:10pt">鍙婃椂涓庣敓鎬佺幆澧冮儴闂ㄦ补鐑熺洃鎺х郴缁熻仈缃戯紝</span><span + style="font-family:瀹嬩綋; font-size:10pt">鍙婃椂涓庣敓鎬佺幆澧冮儴闂ㄦ壃灏樼洃鎺х郴缁熻仈缃戯紝</span><span style="font-family:瀹嬩綋; font-size:10pt">渚濇嵁</span><span style="font-family:瀹嬩綋; font-size:10pt">銆�</span><span style="font-family:瀹嬩綋; font-size:10pt">涓婃捣甯傛壃灏樺湪绾跨洃娴嬫暟鎹墽娉曞簲鐢ㄨ瀹�</span><span @@ -225,7 +225,12 @@ </p> <p style="line-height:20pt; margin:0pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"> - <span style="font-family:瀹嬩綋; font-size:10pt">鍏�</span><span + <span style="font-family:瀹嬩綋; font-size:10pt">鍏�侀伒瀹�2022骞�6鏈�5鏃ヨ捣鏂借鐨勩�婁腑鍗庝汉姘戝叡鍜屽浗鍣0姹℃煋闃叉不娉曘�嬶紝瑙勮寖寮�灞曞缓绛戞柦宸ュ櫔澹版薄鏌撻槻娌伙紱 + 娑夊強澶滈棿鏂藉伐鐨勶紝搴旈伒瀹堛�婁笂娴峰競寤鸿宸ョ▼澶滈棿鏂藉伐璁稿彲鍜屽妗堝鏌ョ鐞嗗姙娉曘�嬶紝鏂藉伐杩囩▼涓簲閲囧彇鏈夋晥鐨勯檷鍣帾鏂斤紝閬垮厤鍣0鎵版皯銆�</span> + </p> + <p + style="line-height:20pt; margin:0pt; orphans:0; text-align:justify; text-indent:21pt; widows:0"> + <span style="font-family:瀹嬩綋; font-size:10pt">涔�</span><span style="font-family:瀹嬩綋; font-size:10pt">銆佸悓鎰忔湰鎵胯鍚戠ぞ浼氬叕寮�锛屽苟鑷鎺ュ彈鏀垮簻銆佽涓氱粍缁囥�佷富绠¢儴闂ㄥ鎵樼涓夋柟鐩戠鍗曚綅銆佺ぞ浼氬叕浼椼�佹柊闂昏垎璁虹殑鐩戠潱銆�</span> </p> <p diff --git a/src/main/resources/templates/commitment-vehicle.ftl b/src/main/resources/templates/commitment-vehicle.ftl index df9d38a..cb80d56 100644 --- a/src/main/resources/templates/commitment-vehicle.ftl +++ b/src/main/resources/templates/commitment-vehicle.ftl @@ -141,7 +141,7 @@ style="font-family:瀹嬩綋; font-size:12pt">VOCs</span><span style="font-family:瀹嬩綋; font-size:12pt">澶勭悊璁炬柦</span><span style="font-family:瀹嬩綋; font-size:12pt">锛�</span><span - style="font-family:瀹嬩綋; font-size:12pt">鎺掓斁鐨勫悇绫诲ぇ姘旀薄鏌撶墿搴旇揪鍒般�婂ぇ姘旀薄鏌撶墿缁煎悎鎺掓斁鏍囧噯銆嬶紙DB31/933-2015锛夎瀹氱殑鎺掓斁闄愬�艰姹傘��</span><span + style="font-family:瀹嬩綋; font-size:12pt">鎺掓斁鐨勫悇绫诲ぇ姘旀薄鏌撶墿搴旇揪鍒般�婃苯杞︾淮淇涓氬ぇ姘旀薄鏌撶墿缁煎悎鎺掓斁鏍囧噯銆嬶紙DB31/1288-2021锛夎瀹氱殑鎺掓斁闄愬�艰姹傘��</span><span style="font-family:瀹嬩綋; font-size:12pt">搴熸皵鍑�鍖栬缃畾</span><span style="font-family:瀹嬩綋; font-size:12pt; text-decoration:none">鏈熺淮鎶�</span><span style="font-family:瀹嬩綋; font-size:12pt">锛屽苟瀹氭湡鏇存崲鐩稿簲鑰楁潗锛堟椿鎬х偔銆佽繃婊ゆ绛夛級锛�</span><span @@ -165,11 +165,11 @@ style="font-family:瀹嬩綋; font-size:12pt">銆�</span><span style="font-family:瀹嬩綋; font-size:12pt">娑夊強鍠锋秱绛変骇鐢熷簾姘旀帓鏀剧殑锛�</span><span style="font-family:瀹嬩綋; font-size:12pt">鑷効</span><span - style="font-family:瀹嬩綋; font-size:12pt">瀹夎绗﹀悎銆婁笂娴峰競鍥哄畾姹℃煋婧愰潪鐢茬兎鎬荤儍鍦ㄧ嚎鐩戞祴绯荤粺楠屾敹鍙婅繍琛屾妧鏈姹傦紙璇曡锛夈�嬬殑</span><span + style="font-family:瀹嬩綋; font-size:12pt">瀹夎绗﹀悎銆婁笂娴峰競鍥哄畾姹℃煋婧愰潪鐢茬兎鎬荤儍鍦ㄧ嚎鐩戞祴绯荤粺楠屾敹鍙婅繍琛屾妧鏈姹傦紙璇曡锛夈�嬫垨鐢熸�佺幆澧冧富绠¢儴闂ㄨ姹傜殑</span><span style="font-family:瀹嬩綋; font-size:12pt">VOCs</span><span style="font-family:瀹嬩綋; font-size:12pt">鍦ㄧ嚎鐩戞祴瑁呯疆</span><span - style="font-family:瀹嬩綋; font-size:12pt">浠ュ強宸ュ喌鐩戞祴妯″潡鍜岃棰戠洃娴嬫ā鍧�</span><span - style="font-family:瀹嬩綋; font-size:12pt">锛屽苟鍙婃椂涓庣敓鎬佺幆澧冮儴闂�</span><span + style="font-family:瀹嬩綋; font-size:12pt">浠ュ強宸ュ喌鐩戞帶妯″潡</span><span + style="font-family:瀹嬩綋; font-size:12pt">锛屽苟鍙婃椂涓庣敓鎬佺幆澧冧富绠¢儴闂�</span><span style="font-family:瀹嬩綋; font-size:12pt">鐩稿叧鐩戞帶</span><span style="font-family:瀹嬩綋; font-size:12pt">绯荤粺鑱旂綉锛屽鎵樿鑼冩湇鍔″崟浣嶅畾鏈熻繍缁达紝鍙婃椂璁板綍鐩稿叧鍙拌处锛岀‘淇濆叾姝e父浣跨敤锛屼笉瓒呮爣鎺掓斁銆�</span> </p> diff --git a/src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt b/src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt index 0c5c79a..c72ed52 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt +++ b/src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt @@ -1,11 +1,15 @@ package cn.flightfeather.supervision +import cn.flightfeather.supervision.common.nlp.NlpController import cn.flightfeather.supervision.websocket.MsgType import cn.flightfeather.supervision.websocket.PersonalServerMsgVo import cn.flightfeather.supervision.websocket.WebSocketMsg import com.google.gson.Gson import org.junit.Test import org.springframework.boot.json.GsonJsonParser +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter import java.util.* import java.util.regex.Pattern @@ -71,4 +75,32 @@ d.time = 1666262747 println(d) } + + @Test + fun foo5() { + val n = NlpController() + n.execute("鍚冭嫻鏋�") + } + + @Test + fun foo6() { + var a = 1667377808L + a*=1000 + println(a) + } + + @Test + fun foo7() { + var s = "2022/10-12" + val list = s.split("-") + val endM = list[1].toInt() + val list2 = list[0].split("/") + val year = list2[0].toInt() + val startM = list2[1].toInt() +// s = s.replace("/", "-") + val st = LocalDateTime.of(year, startM, 1, 0, 0, 0, 0) + val et = LocalDateTime.of(year, endM, 1, 0, 0, 0, 0).plusMonths(1) + println(st) + println(et) + } } \ No newline at end of file diff --git a/src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt b/src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt index 9cb93d3..c4fbb32 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt +++ b/src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt @@ -20,6 +20,6 @@ @Test fun go() { - autoScore.go(2022, 1) + autoScore.go(2022, 7) } } \ No newline at end of file diff --git a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt index 97b850b..165cb06 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt +++ b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt @@ -77,7 +77,7 @@ val signImg = File("C:\\work\\vs\\ff-ai-ep\\asset\\mipmap\\boat_driving.png") val sign = MockMultipartFile("sign.png", FileInputStream(signImg)) val r = commitmentService.createLetterOfCommitment( - "WIIteekIBxXzespD", Gson().toJson(CommitmentVo( + "QNhKL9lWOefS5iWn", Gson().toJson(CommitmentVo( "涓婃捣甯�", "寰愭眹鍖�", "鏌愭煇浼佷笟", diff --git a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt index bcd3d20..5c82ec9 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt +++ b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt @@ -24,4 +24,10 @@ val r = evaluationService.getTotalPoints("xB32EtpuxU5bOzq5", 2, "2021-01-01", "2021-04-01",7,"3mbioCjN6XAAHveR",null) println(r) } + + @Test + fun getCreditInfo() { + val r = evaluationService.getCreditInfo("UwTaWXneBoTby6bH") + println(r) + } } \ No newline at end of file diff --git a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt index 5055805..52428a1 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt +++ b/src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt @@ -19,7 +19,7 @@ @Test fun subscribeResult() { - val msg = "{\"ToUserName\":\"gh_213453153\", \"List\": [{\"TemplateId\":\"sadaihdfjhsadoaiwhfefe\", \"SubscribeStatusString\":\"accept\"}]}" + val msg = "{\"ToUserName\":\"gh_c60faa57000f\",\"FromUserName\":\"otZkc5cC55BtV2AFZdXMvBw0oJo8\",\"CreateTime\":1667377808,\"MsgType\":\"event\",\"Event\":\"subscribe_msg_popup_event\",\"List\":[{\"PopupScene\":\"0\",\"SubscribeStatusString\":\"accept\",\"TemplateId\":\"6JQFOJ12yBvKfRg_duSdwKiH5_J3LpICmz3Li-L1Cr8\"},{\"PopupScene\":\"0\",\"SubscribeStatusString\":\"accept\",\"TemplateId\":\"zPNMzF5WsshniJyl83DD-lDZtNvx7JyqLbKgqDl0qvU\"},{\"PopupScene\":\"0\",\"SubscribeStatusString\":\"accept\",\"TemplateId\":\"dqREi7vAd03OOirTgBGcm5aCihZJKBjVpiA8Kbu4B8w\"}]}" wxUserService.subscribeResult(msg) } } \ No newline at end of file diff --git a/src/test/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopyTest.kt b/src/test/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopyTest.kt new file mode 100644 index 0000000..b4f1f2e --- /dev/null +++ b/src/test/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopyTest.kt @@ -0,0 +1,25 @@ +package cn.flightfeather.supervision.timingtask + +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 +import java.time.LocalDateTime + +@RunWith(SpringRunner::class) +@ExtendWith(SpringExtension::class) +@SpringBootTest +class TaskLedgerCopyTest { + + @Autowired + lateinit var taskLedgerCopy: TaskLedgerCopy + + @Test + fun doTask() { + taskLedgerCopy.doTask(LocalDateTime.now()) + } +} \ No newline at end of file -- Gitblit v1.9.3