feiyu02
2022-11-15 23bd719cebe5feeff4e48fde925b0b39755eea93
2022.11.15
已修改38个文件
已添加5个文件
已重命名1个文件
1255 ■■■■ 文件已修改
pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpController.kt 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/nlp/NlpWord.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/pdf/GeneratePdfUtil.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_9.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/entity/LawsRegulations.java 283 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/mapper/LedgerRecordMapper.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImpl.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LawServiceImpl.kt 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/OnLineQuestionServiceImpl.kt 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImpl.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LawService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskController.kt 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopy.kt 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerRemind.kt 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskPushFume.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/timingtask/TaskScoreRemind.kt 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LawsRegulationsMapper.xml 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LedgerRecordMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/templates/commitment-construction.ftl 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/templates/commitment-vehicle.ftl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/common/score/AutoScoreTest.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/CommitmentServiceImplTest.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImplTest.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/WxUserServiceImplTest.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/timingtask/TaskLedgerCopyTest.kt 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt
@@ -25,7 +25,7 @@
    @Bean
    fun runner() = ApplicationRunner {
        webSocketServer.start()
//        taskController.run()
        taskController.run()
        wxTokenManager.run()
    }
}
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}: è¯æ€§æ ‡æ³¨æŽ¥å£è¯·æ±‚失败,错误如下,\n$json")
        }
        return result
    }
}
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,
)
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
    }
src/main/kotlin/cn/flightfeather/supervision/common/push/PushService.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/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.*
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()
src/main/kotlin/cn/flightfeather/supervision/common/score/item/ScoreItem_12.kt
@@ -52,15 +52,18 @@
     * å­£åº¦å†…全无自评的 -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
    }
    /**
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()
    }
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.视频、VR、其他
     */
    @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、图片、语音、视频、VR、其他
     */
    @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;
    /**
     * å¯ä»¥å¤šä¸ªï¼Œâ€œã€â€åˆ†å‰²ï¼Œç”¨äºŽç³»ç»Ÿå†…快速智能检索,如固废、危废、VOCs等
     */
    @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.视频、VR、其他
     *
     * @return LR_ResourceFileType - 1.文档 Word/PDF/Excel/PPT
2.网页
3.图片
4.视频、VR、其他
     */
    public Integer getLrResourcefiletype() {
        return lrResourcefiletype;
    }
    /**
     * è®¾ç½®1.文档 Word/PDF/Excel/PPT
2.网页
3.图片
4.视频、VR、其他
     *
     * @param lrResourcefiletype 1.文档 Word/PDF/Excel/PPT
2.网页
3.图片
4.视频、VR、其他
     */
    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、图片、语音、视频、VR、其他
     *
     * @return LR_ResourceFileType - Word/PDF/Excel/PPT、图片、语音、视频、VR、其他
     */
    public Integer getLrResourcefiletype() {
        return lrResourcefiletype;
    }
    /**
     * è®¾ç½®Word/PDF/Excel/PPT、图片、语音、视频、VR、其他
     *
     * @param lrResourcefiletype Word/PDF/Excel/PPT、图片、语音、视频、VR、其他
     */
    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();
    }
    /**
     * èŽ·å–å¯ä»¥å¤šä¸ªï¼Œâ€œã€â€åˆ†å‰²ï¼Œç”¨äºŽç³»ç»Ÿå†…å¿«é€Ÿæ™ºèƒ½æ£€ç´¢ï¼Œå¦‚å›ºåºŸã€å±åºŸã€VOCs等
     *
     * @return LR_ Keywords - å¯ä»¥å¤šä¸ªï¼Œâ€œã€â€åˆ†å‰²ï¼Œç”¨äºŽç³»ç»Ÿå†…快速智能检索,如固废、危废、VOCs等
     * @return LR_Keywords - å¯ä»¥å¤šä¸ªï¼Œâ€œã€â€åˆ†å‰²ï¼Œç”¨äºŽç³»ç»Ÿå†…快速智能检索,如固废、危废、VOCs等
     */
    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();
    }
}
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>
}
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
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>
}
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
/**
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) {
                //计算应得总分,basic_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
                    }
                }
                //否则新增一条未扣分的记录
                //否则如果前端允许不用全部评分,新增一条未评分的记录
                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
        //得分解读和得分详情
        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 =
                                                //父id为空,说明此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
    }
    /**
     * æ ¹æ®ä¸Šä¼ çš„子规则扣分情况,生产子项得分记录
     * æ ¹æ®ä¸Šä¼ çš„子规则扣分情况,生成子项得分记录
     * @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) {
            //记录已存在,说明是父项的评分规则下的某个子项的一部分扣分,扣分累加
            //记录已存在,说明是父项的评分规则下的某个子项的一部分扣分,扣分累加,并且不能超过父项的上限
            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 {
                    //允许扣除的分数最小值(负数)
                    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]
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) {
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) {
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)
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
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 æ²¡æœ‰å…³é”®å­—时,按照热门获取机制获取
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字段为null")
        //时间戳
        val createTime = (json["CreateTime"] as Int?) ?: throw NullPointerException("微信服务器发送的订阅返回消息CreateTime字段为null")
        var createTime = (json["CreateTime"] as Int?)?.toLong() ?: throw NullPointerException("微信服务器发送的订阅返回消息CreateTime字段为null")
        createTime = createTime.times(1000)//此处传过来的时间戳只精确到秒,转换为毫秒
        //事件类型,此处应该都是event
        val msgType = json["MsgType"] as String?
@@ -210,7 +211,7 @@
                        val templateId = it["TemplateId"] as String?
                        val sStatus = it["SubscribeStatusString"] as String?
                        //根据时间和用户openId,判断此次操作是否重复
                        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)
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>
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>
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: å‡åˆ†æ¨¡å¼ï¼›add_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: å‡åˆ†æ¨¡å¼ï¼›add_mode:加分模式;
    var gradeMode: String? = "minus_mode"
    //single_mode: å•选模式;multi_mode:多选模式;
    var selectMode: String? = "single_mode"
    //二级规则分组
    var group: Int? = null
    //三级子规则
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 = "具体扣分条目") @RequestBody itemList: List<Pair<String, String>>,
        @ApiParam(value = "具体扣分条目(只传最小级别的评估项)") @RequestBody itemList: List<Pair<String, String>>,
    ) = evaluationService.uploadScore(userId, period, ruleId, itemList)
    @ApiOperation(value = "获取测评详情")
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)
}
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}")
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()
        //飞羽环境,获取voc数据、推送油烟数据
//        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)
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)
        }
    }
}
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)
        }
    }
}
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())
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)
        }
    }
}
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
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>
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 &gt; t1.LR_PublishDate
      <if test="param1 != null">
        and t1.LR_ResourceLevel = #{param1}
      </if>
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>
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日起施行的《中华人民共和国噪声污染防治法》,规范开展建筑施工噪声污染防治;
                            æ¶‰åŠå¤œé—´æ–½å·¥çš„,应遵守《上海市建设工程夜间施工许可和备案审查管理办法》,施工过程中应采取有效的降噪措施,避免噪声扰民。</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
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">系统联网,委托规范服务单位定期运维,及时记录相关台账,确保其正常使用,不超标排放。</span>
                        </p>
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)
    }
}
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)
    }
}
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(
                "上海市",
                "徐汇区",
                "某某企业",
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)
    }
}
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)
    }
}
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())
    }
}