fuliqi
2024-04-26 224428e399b4f4d46ddf3f15b2bbf426fb922e2c
考核结果指标详情页面
14个文件已修改
4个文件已添加
603 ■■■■■ 已修改文件
ycl-common/src/main/java/enumeration/general/PublishType.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreDTO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckScoreDetailVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 157 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/system/service/impl/SysJobServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/CheckScore.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/enumeration/general/PublishType.java
New file
@@ -0,0 +1,23 @@
package enumeration.general;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
@Getter
public enum PublishType {
    UNPUBLISHED("UNPUBLISHED", "未发布"),
    PUBLISHED("PUBLISHED", "已发布");
    @EnumValue // 标明该字段存入数据库
    @JsonValue // 标明在转JSON时使用该字段,即响应时
    private final String code;
    private final String desc;
    PublishType(String code,String desc) {
        this.code = code;
        this.desc = desc;
    }
}
ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreDTO.java
New file
@@ -0,0 +1,17 @@
package com.ycl.platform.domain.dto;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class CheckScoreDTO {
    private List<Integer> id;
    private String publish;
    private Date updateTime;
    private Long updateUser;
    private Date createTime;
    private Integer examineTag;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckRule.java
@@ -1,6 +1,7 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.entity.BaseEntity;
import lombok.Data;
@@ -16,7 +17,8 @@
 * @date 2024-04-15
 */
@Data
public class CheckRule extends BaseEntity
@TableName("t_check_rule")
public class CheckRule
{
    private static final long serialVersionUID = 1L;
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java
@@ -1,19 +1,24 @@
package com.ycl.platform.domain.entity;
import annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.entity.BaseEntity;
import lombok.Data;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 考核积分明细对象 t_check_score
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-22
 */
public class CheckScore extends BaseEntity
@Data
public class CheckScore
{
    private static final long serialVersionUID = 1L;
@@ -24,128 +29,36 @@
    @Excel(name = "分值")
    private BigDecimal score;
    /** 区县 */
    /** deptid */
    @Excel(name = "区县")
    private Long deptId;
    /** 考核 */
    @Excel(name = "考核")
    private Long publishId;
    /** 考核模板id */
    @Excel(name = "考核模板id")
    private Integer templateId;
    /** 规则 */
    @Excel(name = "规则")
    private Long ruleId;
    /** 考核标签(省厅/市局) */
    @Excel(name = "考核标签(省厅/市局)")
    private Integer examineTag;
    /** 考核类型 */
    @Excel(name = "考核类型")
    private Long examineCategory;
    /** 考核类型(车辆/人脸/视频) */
    @Excel(name = "考核类型(车辆/人脸/视频)")
    private Integer examineCategory;
    /** 修改时间 */
    @Excel(name = "修改时间")
    private Date updateTime;
    /**  */
    private Long updateUser;
    /** 创建时间 */
    @Excel(name = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    /** 修改人 */
    @Excel(name = "修改人")
    private Integer updateUser;
    /** 是否发布 */
    @Excel(name = "是否发布")
    private String publish;
    /**  */
    @Excel(name = "")
    private String updateUserName;
    /**  */
    @Excel(name = "")
    private Long auditState;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setScore(BigDecimal score)
    {
        this.score = score;
    }
    public BigDecimal getScore()
    {
        return score;
    }
    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }
    public Long getDeptId()
    {
        return deptId;
    }
    public void setPublishId(Long publishId)
    {
        this.publishId = publishId;
    }
    public Long getPublishId()
    {
        return publishId;
    }
    public void setRuleId(Long ruleId)
    {
        this.ruleId = ruleId;
    }
    public Long getRuleId()
    {
        return ruleId;
    }
    public void setExamineCategory(Long examineCategory)
    {
        this.examineCategory = examineCategory;
    }
    public Long getExamineCategory()
    {
        return examineCategory;
    }
    public void setUpdateUser(Long updateUser)
    {
        this.updateUser = updateUser;
    }
    public Long getUpdateUser()
    {
        return updateUser;
    }
    public void setUpdateUserName(String updateUserName)
    {
        this.updateUserName = updateUserName;
    }
    public String getUpdateUserName()
    {
        return updateUserName;
    }
    public void setAuditState(Long auditState)
    {
        this.auditState = auditState;
    }
    public Long getAuditState()
    {
        return auditState;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("score", getScore())
            .append("deptId", getDeptId())
            .append("publishId", getPublishId())
            .append("ruleId", getRuleId())
            .append("examineCategory", getExamineCategory())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateUserName", getUpdateUserName())
            .append("auditState", getAuditState())
            .toString();
    }
    //折线图日期参数
    private String date;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplate.java
@@ -32,7 +32,7 @@
    /** 调整系数 */
    @Excel(name = "调整系数")
    private Long adjustCoefficient;
    private BigDecimal adjustCoefficient;
    /** 调整方式:乘除 */
    @Excel(name = "调整方式:乘除")
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckTemplateRule.java
@@ -45,5 +45,5 @@
    @TableField("weight")
    private BigDecimal weight;
    private String checkRuleName;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/query/CheckTemplateQuery.java
@@ -27,7 +27,7 @@
    private String templateName;
    /** 调整系数 */
    private Long adjustCoefficient;
    private String adjustCoefficient;
    /** 调整方式:乘除 */
    private String adjustWay;
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckScoreDetailVO.java
New file
@@ -0,0 +1,13 @@
package com.ycl.platform.domain.vo;
import com.ycl.platform.domain.entity.CheckTemplateRule;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class CheckScoreDetailVO {
    private List<CheckTemplateRule> checkRuleList;
    private Map<String,Object> scoreMap;
}
ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java
@@ -1,25 +1,25 @@
package com.ycl.platform.controller;
import annotation.Log;
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.entity.CheckScore;
import com.ycl.platform.service.ICheckScoreService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * 考核积分明细Controller
 * 考核积分Controller
 *
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-22
 */
@RestController
@RequestMapping("/check/score")
@@ -29,70 +29,84 @@
    private ICheckScoreService checkScoreService;
    /**
     * 查询考核积分明细列表
     * 查询考核积分卡片列表
     */
//    @PreAuthorize("@ss.hasPermi('system:score:list')")
    @PreAuthorize("@ss.hasPermi('check:score:list')")
    @GetMapping("/list")
    public TableDataInfo list(CheckScore checkScore)
    public AjaxResult list(CheckScore checkScore)
    {
        Map<Long, List<CheckScore>> deptMap = checkScoreService.selectCheckScoreList(checkScore);
        return success(deptMap);
    }
    /**
     * 区县详情列表
     */
    @PreAuthorize("@ss.hasPermi('check:score:list')")
    @GetMapping("/detail")
    public TableDataInfo detail(CheckScore checkScore)
    {
        startPage();
        List<CheckScore> list = checkScoreService.selectCheckScoreList(checkScore);
        return getDataTable(list);
        List<CheckScore> page = checkScoreService.page(checkScore);
        return getDataTable(page);
    }
    /**
     * 导出考核积分明细列表
     */
    @PreAuthorize("@ss.hasPermi('system:score:export')")
    @Log(title = "考核积分明细", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, CheckScore checkScore)
    {
        List<CheckScore> list = checkScoreService.selectCheckScoreList(checkScore);
        ExcelUtil<CheckScore> util = new ExcelUtil<CheckScore>(CheckScore.class);
        util.exportExcel(response, list, "考核积分明细数据");
    }
    /**
     * 获取考核积分明细详细信息
     * 获取考核积分详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:score:query')")
    @GetMapping(value = "/{id}")
    @PreAuthorize("@ss.hasPermi('check:score:query')")
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(checkScoreService.selectCheckScoreById(id));
    }
    /**
     * 新增考核积分明细
     * 发布考核积分
     */
    @PreAuthorize("@ss.hasPermi('system:score:add')")
    @Log(title = "考核积分明细", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CheckScore checkScore)
    @PreAuthorize("@ss.hasPermi('check:score:edit')")
    @Log(title = "考核积分", businessType = BusinessType.UPDATE)
    @PutMapping("/publish")
    public AjaxResult edit(@RequestBody CheckScoreDTO checkScoreDTO)
    {
        return toAjax(checkScoreService.insertCheckScore(checkScore));
        return toAjax(checkScoreService.publishCheckScore(checkScoreDTO));
    }
    /**
     * 修改考核积分明细
     */
    @PreAuthorize("@ss.hasPermi('system:score:edit')")
    @Log(title = "考核积分明细", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CheckScore checkScore)
    {
        return toAjax(checkScoreService.updateCheckScore(checkScore));
    }
//    /**
//     * 新增考核积分
//     */
//    @PreAuthorize("@ss.hasPermi('check:score:add')")
//    @Log(title = "考核积分", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody CheckScore checkScore)
//    {
//        return toAjax(checkScoreService.insertCheckScore(checkScore));
//    }
    /**
     * 删除考核积分明细
     */
    @PreAuthorize("@ss.hasPermi('system:score:remove')")
    @Log(title = "考核积分明细", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(checkScoreService.deleteCheckScoreByIds(ids));
    }
//    /**
//     * 删除考核积分
//     */
//    @PreAuthorize("@ss.hasPermi('check:score:remove')")
//    @Log(title = "考核积分", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(checkScoreService.deleteCheckScoreByIds(ids));
//    }
//    /**
//     * 导出考核积分列表
//     */
//    @PreAuthorize("@ss.hasPermi('check:score:export')")
//    @Log(title = "考核积分", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, CheckScore checkScore)
//    {
//        List<CheckScore> list = checkScoreService.selectCheckScoreList(checkScore);
//        ExcelUtil<CheckScore> util = new ExcelUtil<CheckScore>(CheckScore.class);
//        util.exportExcel(response, list, "考核积分明细数据");
//    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java
@@ -1,17 +1,20 @@
package com.ycl.platform.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import annotation.AutoFill;
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.entity.CheckScore;
import enumeration.OperationType;
import java.util.List;
import java.util.Map;
/**
 * 考核积分明细Mapper接口
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-22
 */
public interface CheckScoreMapper extends BaseMapper<CheckScore>
public interface CheckScoreMapper
{
    /**
     * 查询考核积分明细
@@ -60,4 +63,9 @@
     * @return 结果
     */
    public int deleteCheckScoreByIds(Long[] ids);
    @AutoFill(OperationType.UPDATE)
    int publishCheckScore(CheckScoreDTO checkScoreDTO);
    List<Map> selectScoreIndex(String tableName,Long deptId,String date);
}
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java
@@ -1,14 +1,17 @@
package com.ycl.platform.service;
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.entity.CheckScore;
import com.ycl.platform.domain.vo.CheckScoreDetailVO;
import java.util.List;
import java.util.Map;
/**
 * 考核积分明细Service接口
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-22
 */
public interface ICheckScoreService 
{
@@ -18,7 +21,7 @@
     * @param id 考核积分明细主键
     * @return 考核积分明细
     */
    public CheckScore selectCheckScoreById(Long id);
    public CheckScoreDetailVO selectCheckScoreById(Long id);
    /**
     * 查询考核积分明细列表
@@ -26,7 +29,7 @@
     * @param checkScore 考核积分明细
     * @return 考核积分明细集合
     */
    public List<CheckScore> selectCheckScoreList(CheckScore checkScore);
    public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore);
    /**
     * 新增考核积分明细
@@ -59,4 +62,8 @@
     * @return 结果
     */
    public int deleteCheckScoreById(Long id);
    int publishCheckScore(CheckScoreDTO checkScoreDTO);
    List<CheckScore> page(CheckScore checkScore);
}
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -1,66 +1,143 @@
package com.ycl.platform.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.entity.CheckRule;
import com.ycl.platform.domain.entity.CheckScore;
import com.ycl.platform.domain.entity.CheckTemplate;
import com.ycl.platform.domain.entity.CheckTemplateRule;
import com.ycl.platform.domain.vo.CheckScoreDetailVO;
import com.ycl.platform.mapper.CheckRuleMapper;
import com.ycl.platform.mapper.CheckScoreMapper;
import com.ycl.platform.mapper.CheckTemplateMapper;
import com.ycl.platform.mapper.CheckTemplateRuleMapper;
import com.ycl.platform.service.ICheckScoreService;
import com.ycl.system.entity.SysRole;
import com.ycl.utils.SecurityUtils;
import enumeration.general.PublishType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import utils.DateUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 考核积分明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-01
 * @date 2024-04-22
 */
@Service
public class CheckScoreServiceImpl extends ServiceImpl<CheckScoreMapper, CheckScore> implements ICheckScoreService
@Slf4j
public class CheckScoreServiceImpl implements ICheckScoreService
{
    @Autowired
    private CheckScoreMapper checkScoreMapper;
    private CheckScoreMapper scoreMapper;
    @Autowired
    private CheckTemplateMapper templateMapper;
    @Autowired
    private CheckTemplateRuleMapper templateRuleMapper;
    @Autowired
    private CheckRuleMapper ruleMapper;
    /**
     * 查询考核积分明细
     * 查询考核积分
     * 
     * @param id 考核积分明细主键
     * @return 考核积分明细
     * @param id 考核积分主键
     * @return 考核积分
     */
    @Override
    public CheckScore selectCheckScoreById(Long id)
    public CheckScoreDetailVO selectCheckScoreById(Long id)
    {
        return checkScoreMapper.selectCheckScoreById(id);
        CheckScoreDetailVO checkScoreDetailVO = new CheckScoreDetailVO();
        //根据id读取score
        CheckScore checkScore = scoreMapper.selectCheckScoreById(id);
        //读取规则以及权重
        List<CheckTemplateRule> templateRuleList = templateRuleMapper.selectListByTemplateId(checkScore.getTemplateId());
        //checkRules添加考核对象和考核时间
        List<CheckRule> checkRules = new ArrayList<>();
        CheckRule checkRule1 = new CheckRule();
        checkRule1.setRuleName("考核时间");
        checkRule1.setRuleIndex("create_time");
        CheckRule checkRule2 = new CheckRule();
        checkRule2.setRuleName("考核对象");
        checkRule2.setRuleIndex("deptId");
        //读取模板对应所有规则
        Map<String,Object> scoreMap = new HashMap<>();
        List<Integer> ruleIds = templateRuleList.stream().map(checkTemplateRule -> checkTemplateRule.getCheckRuleId())
                .collect(Collectors.toList());
        List<CheckRule> ruleIndex = ruleMapper.selectBatchIds(ruleIds);
//        checkRules.add(checkRule1);
//        checkRules.add(checkRule2);
        checkRules.addAll(ruleIndex);
        //根据examineCategory 读取不同index表
        Integer examineCategory = checkScore.getExamineCategory();
        String[] indexTableArr ={"t_check_index_car","t_check_index_face","t_check_index_video"};
        String tableName = indexTableArr[examineCategory];
        //TODO:获取当前月份 暂定 后期改为前端传
        LocalDate now = LocalDate.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
        String date = formatter.format(now);
        List<Map> map = scoreMapper.selectScoreIndex(tableName,checkScore.getDeptId(),date);
        scoreMap.put("tableData",checkRules);
        scoreMap.put("dataMap",map);
        checkScoreDetailVO.setCheckRuleList(templateRuleList);
        checkScoreDetailVO.setScoreMap(scoreMap);
        return checkScoreDetailVO;
    }
    /**
     * 查询考核积分明细列表
     * 查询考核积分卡片列表
     * 
     * @param checkScore 考核积分明细
     * @return 考核积分明细
     * @param checkScore 考核积分
     * @return 考核积分
     */
    @Override
    public List<CheckScore> selectCheckScoreList(CheckScore checkScore)
    public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore)
    {
        return checkScoreMapper.selectCheckScoreList(checkScore);
    }
        //TODO:数据权限
        //查询成绩
        List<CheckScore> checkScores = scoreMapper.selectCheckScoreList(checkScore);
        Map<Long, List<CheckScore>> deptMap = checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
        return deptMap;
    }
    /**
     * 新增考核积分明细
     * 区县详情
     *
     * @param checkScore 考核积分
     * @return 考核积分
     */
    @Override
    public List<CheckScore> page(CheckScore checkScore) {
        return scoreMapper.selectCheckScoreList(checkScore);
    }
    /**
     * 新增考核积分
     * 
     * @param checkScore 考核积分明细
     * @param checkScore 考核积分
     * @return 结果
     */
    @Override
    public int insertCheckScore(CheckScore checkScore)
    {
        checkScore.setCreateTime(DateUtils.getNowDate());
        return checkScoreMapper.insertCheckScore(checkScore);
        return scoreMapper.insertCheckScore(checkScore);
    }
    /**
     * 修改考核积分明细
     * 修改考核明细
     * 
     * @param checkScore 考核积分明细
     * @return 结果
@@ -68,30 +145,56 @@
    @Override
    public int updateCheckScore(CheckScore checkScore)
    {
        return checkScoreMapper.updateCheckScore(checkScore);
        return scoreMapper.updateCheckScore(checkScore);
    }
    /**
     * 批量删除考核积分明细
     * 批量删除考核积分
     * 
     * @param ids 需要删除的考核积分明细主键
     * @param ids 需要删除的考核积分主键
     * @return 结果
     */
    @Override
    public int deleteCheckScoreByIds(Long[] ids)
    {
        return checkScoreMapper.deleteCheckScoreByIds(ids);
        return scoreMapper.deleteCheckScoreByIds(ids);
    }
    /**
     * 删除考核积分明细信息
     * 删除考核积分信息
     * 
     * @param id 考核积分明细主键
     * @param id 考核积分主键
     * @return 结果
     */
    @Override
    public int deleteCheckScoreById(Long id)
    {
        return checkScoreMapper.deleteCheckScoreById(id);
        return scoreMapper.deleteCheckScoreById(id);
    }
    /**
     * 发布考核积分信息
     *
     * @param checkScoreDTO 考核积分
     * @return 结果
     */
    @Override
    public int publishCheckScore(CheckScoreDTO checkScoreDTO) {
        if(CollectionUtils.isEmpty(checkScoreDTO.getId())){
            return 0;
        }
        PublishType publishType = null;
        try {
            publishType = PublishType.valueOf(checkScoreDTO.getPublish());
        } catch (IllegalArgumentException e) {
            log.error("参数类型不匹配");
            throw new IllegalArgumentException("参数类型不匹配");
        }
        String code = publishType.getCode();
        checkScoreDTO.setPublish(code);
        return scoreMapper.publishCheckScore(checkScoreDTO);
    }
}
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
@@ -56,6 +56,7 @@
        BeanUtils.copyProperties(checkTemplate, checkTemplateQuery);
        List<Integer> deptIds = JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class);
        checkTemplateQuery.setDeptId(deptIds)
                .setAdjustCoefficient(checkTemplate.getAdjustCoefficient()+"")
                .setAlarmScore(checkTemplate.getAlarmScore()+"");
        //查询规则权重
        List<CheckTemplateRule> templateRuleList = checkTemplateRuleMapper.selectListByTemplateId(checkTemplate.getId());
@@ -88,7 +89,8 @@
            List<Integer> deptIds = JSONArray.parseArray(template.getDeptId(), Integer.class);
            CheckTemplateQuery checkTemplateQuery = new CheckTemplateQuery();
            BeanUtils.copyProperties(template, checkTemplateQuery);
            checkTemplateQuery.setDeptId(deptIds);
            checkTemplateQuery.setDeptId(deptIds)
                    .setAdjustCoefficient(template.getAdjustCoefficient()+"");
            checkTemplateList.add(checkTemplateQuery);
        }
@@ -118,6 +120,7 @@
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId))
                .setUpdateUserName(username)
                .setCreateUserName(username)
                .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+""))
                //不填报警分数---->零分---->不报警
                .setAlarmScore(new BigDecimal(checkTemplateDTO.getAlarmScore() == null? "":checkTemplateDTO.getAlarmScore()));
        int i = checkTemplateMapper.insertCheckTemplate(checkTemplate);
@@ -167,7 +170,8 @@
        checkTemplate.setUpdateUserName(SecurityUtils.getUsername());
        List<Integer> deptId = checkTemplateDTO.getDeptId();
        Collections.sort(deptId);
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId));
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId))
                .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+""));
        int i = checkTemplateMapper.updateCheckTemplate(checkTemplate);
        /** t_template_rule修改权重 */
        //先删除原数据
ycl-server/src/main/java/com/ycl/platform/service/impl/YwThresholdServiceImpl.java
@@ -1,6 +1,5 @@
package com.ycl.platform.service.impl;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.domain.dto.CarDTO;
@@ -16,7 +15,6 @@
import enumeration.general.BusinessTypeEnum;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
ycl-server/src/main/java/com/ycl/system/service/impl/SysJobServiceImpl.java
@@ -201,7 +201,6 @@
    @Transactional(rollbackFor = Exception.class)
    public int insertJob(SysJob job) throws SchedulerException, TaskException
    {
        job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
        int rows = jobMapper.insertJob(job);
        if (rows > 0)
        {
ycl-server/src/main/java/com/ycl/task/CheckScore.java
New file
@@ -0,0 +1,12 @@
package com.ycl.task;
import org.springframework.stereotype.Component;
@Component("checkScore")
public class CheckScore {
    public void check(Integer templateId){
        System.out.println("执行模板---------->"+templateId);
    }
}
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -8,30 +8,34 @@
        <result property="id"    column="id"    />
        <result property="score"    column="score"    />
        <result property="deptId"    column="dept_id"    />
        <result property="publishId"    column="publish_id"    />
        <result property="ruleId"    column="rule_id"    />
        <result property="templateId"    column="template_id"    />
        <result property="examineTag"    column="examine_tag"    />
        <result property="examineCategory"    column="examine_category"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateUserName"    column="update_user_name"    />
        <result property="auditState"    column="audit_state"    />
        <result property="publish"    column="publish"    />
    </resultMap>
    <sql id="selectCheckScoreVo">
        select id, score, dept_id, publish_id, rule_id, examine_category, create_time, update_user, update_user_name, audit_state from t_check_score
        select id, score, dept_id, template_id, examine_tag, examine_category, create_time,update_time,update_user, publish from t_check_score
    </sql>
    <select id="selectCheckScoreList" resultMap="CheckScoreResult">
        <include refid="selectCheckScoreVo"/>
        <where>
        <where>
            <if test="score != null "> and score = #{score}</if>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
            <if test="publishId != null "> and publish_id = #{publishId}</if>
            <if test="ruleId != null "> and rule_id = #{ruleId}</if>
            <if test="templateId != null "> and template_id = #{templateId}</if>
            <if test="createTime != null "> and  DATE(create_time) = #{createTime}</if>
            <if test="date != null "> and  date_format(create_time,'%Y-%m')  = #{date}</if>
            <if test="examineTag != null "> and examine_tag = #{examineTag}</if>
            <if test="examineCategory != null "> and examine_category = #{examineCategory}</if>
            <if test="publish != null  and publish != ''"> and publish = #{publish}</if>
        </where>
    </select>
    
    <select id="selectCheckScoreById" resultMap="CheckScoreResult">
    <select id="selectCheckScoreById" parameterType="Long" resultMap="CheckScoreResult">
        <include refid="selectCheckScoreVo"/>
        where id = #{id}
    </select>
@@ -41,51 +45,62 @@
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="score != null">score,</if>
            <if test="deptId != null">dept_id,</if>
            <if test="publishId != null">publish_id,</if>
            <if test="ruleId != null">rule_id,</if>
            <if test="templateId != null">template_id,</if>
            <if test="examineTag != null">examine_tag,</if>
            <if test="examineCategory != null">examine_category,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateUserName != null">update_user_name,</if>
            <if test="auditState != null">audit_state,</if>
            <if test="publish != null">publish,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="score != null">#{score},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="publishId != null">#{publishId},</if>
            <if test="ruleId != null">#{ruleId},</if>
            <if test="templateId != null">#{templateId},</if>
            <if test="examineTag != null">#{examineTag},</if>
            <if test="examineCategory != null">#{examineCategory},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateUserName != null">#{updateUserName},</if>
            <if test="auditState != null">#{auditState},</if>
            <if test="publish != null">#{publish},</if>
         </trim>
    </insert>
    <update id="updateCheckScore">
    <update id="updateCheckScore" >
        update t_check_score
        <trim prefix="SET" suffixOverrides=",">
            <if test="score != null">score = #{score},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="publishId != null">publish_id = #{publishId},</if>
            <if test="ruleId != null">rule_id = #{ruleId},</if>
            <if test="templateId != null">template_id = #{templateId},</if>
            <if test="examineTag != null">examine_tag = #{examineTag},</if>
            <if test="examineCategory != null">examine_category = #{examineCategory},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateUserName != null">update_user_name = #{updateUserName},</if>
            <if test="auditState != null">audit_state = #{auditState},</if>
            <if test="publish != null">publish = #{publish},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteCheckScoreById" >
    <delete id="deleteCheckScoreById" parameterType="Long">
        delete from t_check_score where id = #{id}
    </delete>
    <delete id="deleteCheckScoreByIds" >
    <delete id="deleteCheckScoreByIds" parameterType="String">
        delete from t_check_score where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <update id="publishCheckScore">
        update t_check_score set publish = #{publish},update_time =#{updateTime},update_user= #{updateUser} where id in
        <foreach collection="id" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
    </update>
    <select id="selectScoreIndex" resultType="java.util.Map">
        select * from ${tableName} where dept_id =#{deptId} and date_format(create_time,'%Y-%m')  = #{date}
    </select>
</mapper>
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml
@@ -67,6 +67,9 @@
        delete from t_check_template_rule where check_template_id = #{templateId}
    </delete>
    <select id="selectListByTemplateId" resultType="com.ycl.platform.domain.entity.CheckTemplateRule">
        select * from t_check_template_rule where check_template_id = #{checkTemplateId}
        select tctr.*,tcr.rule_name as checkRuleName from t_check_template_rule tctr
        left join t_check_rule tcr on tctr.check_rule_id = tcr.id
        where check_template_id = #{checkTemplateId}
    </select>
</mapper>