40 changed files with 2828 additions and 0 deletions
@ -0,0 +1,29 @@ |
|||||
|
package com.elink.esua.epdc.dto.epdc.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/4 19:37 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserSysDeptInfoFormDTO implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* 主键集合 |
||||
|
*/ |
||||
|
// @NotEmpty(message = "deptIdList不能为空")
|
||||
|
// @Valid
|
||||
|
private List<Long> deptIdList; |
||||
|
|
||||
|
/** |
||||
|
* 部门类型键值 |
||||
|
*/ |
||||
|
// @NotEmpty(message = "部门类型不能为空")
|
||||
|
// @Valid
|
||||
|
private List<String> typeKeyList; |
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
package com.elink.esua.epdc.dto.epdc.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/4 19:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserSysDeptInfoResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -4240447826256510696L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 上级ID |
||||
|
*/ |
||||
|
private Long pid; |
||||
|
|
||||
|
/** |
||||
|
* 上级名称 |
||||
|
*/ |
||||
|
private String parentName; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级ID,用逗号分开 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级名称,用-连接 |
||||
|
*/ |
||||
|
private String parentNames; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
} |
||||
@ -0,0 +1,132 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
import com.alibaba.fastjson.annotation.JSONField; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
@NotBlank(message = "规则id不能为空") |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
@NotBlank(message = "考核部门id不能为空") |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
@NotBlank(message = "得分不能为空") |
||||
|
@Min(0) |
||||
|
private Integer score; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期起始月 |
||||
|
*/ |
||||
|
@NotBlank(message = "考核周期起始月不能为空") |
||||
|
@JSONField(format = "yyyy-MM") |
||||
|
private Date scoreStartMonth; |
||||
|
} |
||||
@ -0,0 +1,156 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreTempDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
private Integer score; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 导出用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 规则名称 |
||||
|
*/ |
||||
|
private String ruleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期 |
||||
|
*/ |
||||
|
private String kpiCycleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private String scoreStartTime; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private Date scoreEndTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/5 17:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ImportExcelErrorResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -6085396247858232510L; |
||||
|
|
||||
|
/** |
||||
|
* 错误数据行数 |
||||
|
*/ |
||||
|
private String errorLine; |
||||
|
/** |
||||
|
* 错误数据信息 |
||||
|
*/ |
||||
|
private String errorInfo; |
||||
|
} |
||||
@ -0,0 +1,109 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import com.alibaba.fastjson.annotation.JSONField; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/4 16:44 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreResultDTO implements Serializable { |
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
private Integer score; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
@JSONField(format = "yyyy-MM-dd") |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
@JSONField(format = "yyyy-MM-dd") |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 考核规则名称 |
||||
|
*/ |
||||
|
private String ruleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期(字典值) |
||||
|
*/ |
||||
|
private String kpiCycle; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description 录入模板 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/4 17:44 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreTemplateResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3228442740296126765L; |
||||
|
/** |
||||
|
* 规则名称 |
||||
|
*/ |
||||
|
private String ruleName; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期 |
||||
|
*/ |
||||
|
private String kpiCycleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private String scoreStartTime; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private String scoreEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
private Integer score; |
||||
|
|
||||
|
/*********************************************************************************************************/ |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 导出用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.elink.esua.epdc.enums; |
||||
|
|
||||
|
/** |
||||
|
* @Auther: yinzuomei |
||||
|
* @Date: 2019/12/5 12:41 |
||||
|
* @Description: 考核周期枚举 |
||||
|
*/ |
||||
|
public enum KpiCycleEnum { |
||||
|
/** |
||||
|
* 月month quarter year |
||||
|
*/ |
||||
|
KPI_CYCLE_MONTH("month","月"), |
||||
|
/** |
||||
|
* 季 |
||||
|
*/ |
||||
|
KPI_CYCLE_QUARTER("quarter","季"), |
||||
|
/** |
||||
|
* 年 |
||||
|
*/ |
||||
|
KPI_CYCLE_YEAR("year","年"); |
||||
|
private String value; |
||||
|
private String name; |
||||
|
|
||||
|
KpiCycleEnum(String value, String name) { |
||||
|
this.value = value; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public void setValue(String value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
package com.elink.esua.epdc.utils; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.io.*; |
||||
|
|
||||
|
/** |
||||
|
* 接收文件转化File |
||||
|
* Created by liuhongwei on 2019/6/21. |
||||
|
*/ |
||||
|
public class StreamUtils { |
||||
|
|
||||
|
|
||||
|
|
||||
|
public static File conversionFile(MultipartFile file){ |
||||
|
|
||||
|
File toFile =null; |
||||
|
InputStream ins = null; |
||||
|
try { |
||||
|
// 转化字节流
|
||||
|
ins = file.getInputStream(); |
||||
|
// 获取文件名字
|
||||
|
toFile = new File(file.getOriginalFilename()); |
||||
|
// 字节转化文件
|
||||
|
inputStreamToFile(ins, toFile); |
||||
|
ins.close(); |
||||
|
} catch (IOException e) { |
||||
|
new RenException(500,"文件转化失败"); |
||||
|
} |
||||
|
return toFile; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 流转化 |
||||
|
* @param ins file |
||||
|
* @return |
||||
|
* @author liuhongwei |
||||
|
* @date 2019/6/14 14:07 |
||||
|
*/ |
||||
|
public static void inputStreamToFile(InputStream ins, File file) { |
||||
|
try { |
||||
|
OutputStream os = new FileOutputStream(file); |
||||
|
int bytesRead = 0; |
||||
|
byte[] buffer = new byte[8192]; |
||||
|
while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { |
||||
|
os.write(buffer, 0, bytesRead); |
||||
|
} |
||||
|
os.close(); |
||||
|
ins.close(); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,124 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO; |
||||
|
import com.elink.esua.epdc.excel.KpiManualScoreExcel; |
||||
|
import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; |
||||
|
import com.elink.esua.epdc.service.KpiManualScoreService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("kpimanualscore") |
||||
|
public class KpiManualScoreController { |
||||
|
|
||||
|
@Autowired |
||||
|
private KpiManualScoreService kpiManualScoreService; |
||||
|
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<KpiManualScoreResultDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
// PageData<KpiManualScoreDTO> page = kpiManualScoreService.page(params);
|
||||
|
PageData<KpiManualScoreResultDTO> page = kpiManualScoreService.listKpiManualScoreResultDTO(params); |
||||
|
return new Result<PageData<KpiManualScoreResultDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<KpiManualScoreDTO> get(@PathVariable("id") String id){ |
||||
|
KpiManualScoreDTO data = kpiManualScoreService.get(id); |
||||
|
return new Result<KpiManualScoreDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody KpiManualScoreDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return kpiManualScoreService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody KpiManualScoreDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
return kpiManualScoreService.update(dto); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
kpiManualScoreService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<KpiManualScoreDTO> list = kpiManualScoreService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, KpiManualScoreExcel.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param params |
||||
|
* @return void |
||||
|
* @Author yinzuomei |
||||
|
* @Description 导出录入模板 |
||||
|
* @Date 2019/12/4 17:46 |
||||
|
**/ |
||||
|
@GetMapping("exportTemplate") |
||||
|
public void exportTemplate(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<KpiManualScoreTemplateResultDTO> list = kpiManualScoreService.listKpiManualScoreTemplateResultDTO(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, simpleDateFormat.format(new Date()), list, KpiManualScoreTemplateExcel.class); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param file |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 导入手动打分记录 |
||||
|
* @Date 2019/12/5 15:45 |
||||
|
**/ |
||||
|
@PostMapping("importManualScoreExcel") |
||||
|
public Result importManualScoreExcel(@RequestParam("file") MultipartFile file) { |
||||
|
return kpiManualScoreService.importManualScoreExcel(file); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; |
||||
|
import com.elink.esua.epdc.excel.KpiManualScoreTempExcel; |
||||
|
import com.elink.esua.epdc.service.KpiManualScoreTempService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("kpimanualscoretemp") |
||||
|
public class KpiManualScoreTempController { |
||||
|
|
||||
|
@Autowired |
||||
|
private KpiManualScoreTempService kpiManualScoreTempService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<KpiManualScoreTempDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<KpiManualScoreTempDTO> page = kpiManualScoreTempService.page(params); |
||||
|
return new Result<PageData<KpiManualScoreTempDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<KpiManualScoreTempDTO> get(@PathVariable("id") String id){ |
||||
|
KpiManualScoreTempDTO data = kpiManualScoreTempService.get(id); |
||||
|
return new Result<KpiManualScoreTempDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody KpiManualScoreTempDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
kpiManualScoreTempService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody KpiManualScoreTempDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
kpiManualScoreTempService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
kpiManualScoreTempService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<KpiManualScoreTempDTO> list = kpiManualScoreTempService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, KpiManualScoreTempExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface KpiManualScoreDao extends BaseDao<KpiManualScoreEntity> { |
||||
|
|
||||
|
List<KpiManualScoreResultDTO> selectListKpiManualScoreResultDTO(Map<String, Object> params); |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; |
||||
|
import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface KpiManualScoreTempDao extends BaseDao<KpiManualScoreTempEntity> { |
||||
|
|
||||
|
int deleteManualScoreTemp(@Param("userId") String toString, |
||||
|
@Param("ruleId")String id, |
||||
|
@Param("scoreStartTime")String scoreStartTime); |
||||
|
|
||||
|
List<KpiManualScoreTempEntity> selectListKpiManualScoreTemp(@Param("userId") String userId, |
||||
|
@Param("recordList")List<KpiManualScoreTemplateExcel> recordList); |
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_kpi_manual_score") |
||||
|
public class KpiManualScoreEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
private Integer score; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,126 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_kpi_manual_score_temp") |
||||
|
public class KpiManualScoreTempEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
private Integer score; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期yyyy-MM-dd |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 导出用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 规则名称 |
||||
|
*/ |
||||
|
private String ruleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期 |
||||
|
*/ |
||||
|
private String kpiCycleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private String scoreStartTime; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private String scoreEndTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "epdc_kpi_rule表主键") |
||||
|
private String ruleId; |
||||
|
|
||||
|
@Excel(name = "被打分的部门id") |
||||
|
private String deptId; |
||||
|
|
||||
|
@Excel(name = "得分") |
||||
|
private Integer score; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
@Excel(name = "删除标记") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "所有父级部门id") |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
@Excel(name = "所有父级部门名称") |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
@Excel(name = "完整部门id") |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
@Excel(name = "完整部门名称") |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreTempExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "epdc_kpi_rule表主键") |
||||
|
private String ruleId; |
||||
|
|
||||
|
@Excel(name = "被打分的部门id") |
||||
|
private String deptId; |
||||
|
|
||||
|
@Excel(name = "得分") |
||||
|
private Integer score; |
||||
|
|
||||
|
@Excel(name = "考核起止日期yyyy-MM-dd") |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
@Excel(name = "考核终止日期yyyy-MM-dd") |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
@Excel(name = "所有父级部门id") |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
@Excel(name = "所有父级部门名称") |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
@Excel(name = "完整部门名称") |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
@Excel(name = "完整部门id") |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
@Excel(name = "导出用户id") |
||||
|
private String userId; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
@Excel(name = "删除标记") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "街道") |
||||
|
private String street; |
||||
|
|
||||
|
@Excel(name = "社区") |
||||
|
private String community; |
||||
|
|
||||
|
@Excel(name = "网格") |
||||
|
private String grid; |
||||
|
|
||||
|
@Excel(name = "规则名称") |
||||
|
private String ruleName; |
||||
|
|
||||
|
@Excel(name = "考核周期") |
||||
|
private String kpiCycleName; |
||||
|
|
||||
|
@Excel(name = "考核起止日期") |
||||
|
private String scoreStartTime; |
||||
|
|
||||
|
@Excel(name = "考核终止日期") |
||||
|
private Date scoreEndTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,117 @@ |
|||||
|
package com.elink.esua.epdc.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description 录入模板 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/4 17:46 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class KpiManualScoreTemplateExcel { |
||||
|
|
||||
|
/** |
||||
|
* 街道 |
||||
|
*/ |
||||
|
@Excel(name = "街道") |
||||
|
private String street; |
||||
|
|
||||
|
/** |
||||
|
* 社区 |
||||
|
*/ |
||||
|
@Excel(name = "社区") |
||||
|
private String community; |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
@Excel(name = "网格") |
||||
|
private String grid; |
||||
|
|
||||
|
/** |
||||
|
* 规则名称 |
||||
|
*/ |
||||
|
@Excel(name = "规则名称") |
||||
|
private String ruleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核周期 |
||||
|
*/ |
||||
|
@Excel(name = "考核周期") |
||||
|
private String kpiCycleName; |
||||
|
|
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
@Excel(name = "考核起止日期") |
||||
|
private String scoreStartTime; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
@Excel(name = "考核终止日期") |
||||
|
private String scoreEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 得分 |
||||
|
*/ |
||||
|
@Excel(name = "得分") |
||||
|
private Integer score; |
||||
|
|
||||
|
/************************************************ 我 是 一 条 分 割 线 ************************************************************************/ |
||||
|
/************************************************ 我 是 一 条 分 割 线 ************************************************************************/ |
||||
|
/************************************************ 我 是 一 条 分 割 线 ************************************************************************/ |
||||
|
/** |
||||
|
* 部门名称 |
||||
|
* |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/************************************************ 组装数据 ************************************************************************/ |
||||
|
/** |
||||
|
* epdc_kpi_rule表主键 |
||||
|
*/ |
||||
|
private String ruleId; |
||||
|
|
||||
|
/** |
||||
|
* 被打分的部门id |
||||
|
*/ |
||||
|
private String deptId; |
||||
|
/** |
||||
|
* 考核起止日期 |
||||
|
*/ |
||||
|
private Date scoreStartDate; |
||||
|
|
||||
|
/** |
||||
|
* 考核终止日期 |
||||
|
*/ |
||||
|
private Date scoreEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门id |
||||
|
*/ |
||||
|
private String parentDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 所有父级部门名称 |
||||
|
*/ |
||||
|
private String parentDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
/** |
||||
|
* 完整部门名称 |
||||
|
*/ |
||||
|
private String allDeptNames; |
||||
|
|
||||
|
/** |
||||
|
* 导出用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.elink.esua.epdc.feign; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; |
||||
|
import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 管理端接口 |
||||
|
* |
||||
|
* @author yujintao |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/7 9:27 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = AdminFeignClientFallback.class) |
||||
|
public interface AdminFeignClient { |
||||
|
@PostMapping(value = "sys/dept/queryUserSysDeptInfo", consumes = MediaType.APPLICATION_JSON_VALUE) |
||||
|
Result<List<UserSysDeptInfoResultDTO>> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO); |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.elink.esua.epdc.feign.fallback; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; |
||||
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2019/12/5 10:26 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class AdminFeignClientFallback implements AdminFeignClient { |
||||
|
@Override |
||||
|
public Result<List<UserSysDeptInfoResultDTO>> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "queryUserSysDeptInfo", userSysDeptInfoFormDTO); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class KpiManualScoreRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class KpiManualScoreTempRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,126 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreEntity; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
public interface KpiManualScoreService extends BaseService<KpiManualScoreEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<KpiManualScoreDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
PageData<KpiManualScoreDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<KpiManualScoreDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
List<KpiManualScoreDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return KpiManualScoreDTO |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
KpiManualScoreDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
Result save(KpiManualScoreDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
Result update(KpiManualScoreDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-04 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* @param params |
||||
|
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 列表查询 |
||||
|
* @Date 2019/12/4 17:37 |
||||
|
**/ |
||||
|
PageData<KpiManualScoreResultDTO> listKpiManualScoreResultDTO(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* @param params |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 构造录入模板excel内容 |
||||
|
* @Date 2019/12/4 19:47 |
||||
|
**/ |
||||
|
List<KpiManualScoreTemplateResultDTO> listKpiManualScoreTemplateResultDTO(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* @param file |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 导入手动打分记录 |
||||
|
* @Date 2019/12/5 15:46 |
||||
|
**/ |
||||
|
Result importManualScoreExcel(MultipartFile file); |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
public interface KpiManualScoreTempService extends BaseService<KpiManualScoreTempEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<KpiManualScoreTempDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
PageData<KpiManualScoreTempDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<KpiManualScoreTempDTO> |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
List<KpiManualScoreTempDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return KpiManualScoreTempDTO |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
KpiManualScoreTempDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
void save(KpiManualScoreTempDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
void update(KpiManualScoreTempDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2019-12-06 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,484 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
||||
|
import cn.hutool.core.collection.CollUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.exception.ErrorCode; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dao.KpiManualScoreDao; |
||||
|
import com.elink.esua.epdc.dao.KpiManualScoreRuleDao; |
||||
|
import com.elink.esua.epdc.dao.KpiManualScoreTempDao; |
||||
|
import com.elink.esua.epdc.dao.KpiRuleDao; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.ImportExcelErrorResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreEntity; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreRuleEntity; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; |
||||
|
import com.elink.esua.epdc.entity.KpiRuleEntity; |
||||
|
import com.elink.esua.epdc.enums.KpiCycleEnum; |
||||
|
import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; |
||||
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
||||
|
import com.elink.esua.epdc.redis.KpiManualScoreRedis; |
||||
|
import com.elink.esua.epdc.service.KpiManualScoreService; |
||||
|
import com.elink.esua.epdc.service.KpiManualScoreTempService; |
||||
|
import com.elink.esua.epdc.utils.StreamUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.text.ParseException; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-04 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class KpiManualScoreServiceImpl extends BaseServiceImpl<KpiManualScoreDao, KpiManualScoreEntity> implements KpiManualScoreService { |
||||
|
|
||||
|
private Logger logger = LoggerFactory.getLogger(getClass()); |
||||
|
@Autowired |
||||
|
private KpiManualScoreRedis kpiManualScoreRedis; |
||||
|
@Autowired |
||||
|
private KpiManualScoreRuleDao kpiManualScoreRuleDao; |
||||
|
@Autowired |
||||
|
private KpiRuleDao kpiRuleDao; |
||||
|
@Autowired |
||||
|
private UserDetailRedis userDetailRedis; |
||||
|
@Autowired |
||||
|
private AdminFeignClient adminFeignClient; |
||||
|
@Autowired |
||||
|
private KpiManualScoreTempDao kpiManualScoreTempDao; |
||||
|
@Autowired |
||||
|
private KpiManualScoreTempService kpiManualScoreTempService; |
||||
|
//设置日期格式
|
||||
|
private SimpleDateFormat monthFormat = new SimpleDateFormat("yyyy-MM"); |
||||
|
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
|
||||
|
@Override |
||||
|
public PageData<KpiManualScoreDTO> page(Map<String, Object> params) { |
||||
|
String ruleId = params.containsKey("ruleId") ? params.get("ruleId").toString() : null; |
||||
|
String createdTime = params.containsKey("createdTime") ? params.get("createdTime").toString() : null; |
||||
|
QueryWrapper<KpiManualScoreEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(ruleId), "RULE_ID", ruleId); |
||||
|
wrapper.between(StringUtils.isNotBlank(createdTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m' )", createdTime, createdTime); |
||||
|
IPage<KpiManualScoreEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
wrapper |
||||
|
); |
||||
|
PageData<KpiManualScoreDTO> list = getPageData(page, KpiManualScoreDTO.class); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param params |
||||
|
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 列表查询 |
||||
|
* @Date 2019/12/4 17:37 |
||||
|
**/ |
||||
|
@Override |
||||
|
public PageData<KpiManualScoreResultDTO> listKpiManualScoreResultDTO(Map<String, Object> params) { |
||||
|
IPage<KpiManualScoreResultDTO> page = getPage(params); |
||||
|
List<KpiManualScoreResultDTO> list = baseDao.selectListKpiManualScoreResultDTO(params); |
||||
|
return new PageData<>(list, page.getTotal()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<KpiManualScoreDTO> list(Map<String, Object> params) { |
||||
|
List<KpiManualScoreEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, KpiManualScoreDTO.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.KpiManualScoreTemplateResultDTO> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 导出录入模板 |
||||
|
* @Date 2019/12/4 18:00 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<KpiManualScoreTemplateResultDTO> listKpiManualScoreTemplateResultDTO(Map<String, Object> params) { |
||||
|
List<KpiManualScoreTemplateResultDTO> list = new ArrayList<>(); |
||||
|
//用户所选规则
|
||||
|
String ruleId = params.get("ruleId").toString(); |
||||
|
String scoreStartTime = params.get("scoreStartTime").toString(); |
||||
|
Date scoreStartDateMonth = new Date(); |
||||
|
try { |
||||
|
scoreStartDateMonth = monthFormat.parse(scoreStartTime); |
||||
|
} catch (ParseException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
Date scoreEndDateMonth = new Date(); |
||||
|
|
||||
|
KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(ruleId); |
||||
|
|
||||
|
//考核周期赋值
|
||||
|
String kpiCycleName = ""; |
||||
|
if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { |
||||
|
kpiCycleName = KpiCycleEnum.KPI_CYCLE_MONTH.getName(); |
||||
|
scoreEndDateMonth = scoreStartDateMonth; |
||||
|
} else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { |
||||
|
kpiCycleName = KpiCycleEnum.KPI_CYCLE_QUARTER.getName(); |
||||
|
scoreEndDateMonth = stepMonth(scoreStartDateMonth, 2); |
||||
|
} else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { |
||||
|
kpiCycleName = KpiCycleEnum.KPI_CYCLE_YEAR.getName(); |
||||
|
scoreEndDateMonth = stepMonth(scoreStartDateMonth, 11); |
||||
|
} |
||||
|
|
||||
|
// 用户拥有的所有部门权限
|
||||
|
List<Long> dataScopeDeptList = getDataScopeDeptList(); |
||||
|
|
||||
|
//调用admin模块查询部门信息详情
|
||||
|
UserSysDeptInfoFormDTO userSysDeptInfoFormDTO = new UserSysDeptInfoFormDTO(); |
||||
|
userSysDeptInfoFormDTO.setDeptIdList(dataScopeDeptList); |
||||
|
List<String> typeKeyList = new ArrayList<>(); |
||||
|
typeKeyList.add(kpiRuleEntity.getDeptTypeKey()); |
||||
|
userSysDeptInfoFormDTO.setTypeKeyList(typeKeyList); |
||||
|
Result<List<UserSysDeptInfoResultDTO>> result = this.queryUserSysDeptInfo(userSysDeptInfoFormDTO); |
||||
|
|
||||
|
if (result.getCode() == 0 && result.getData().size() > 0) { |
||||
|
List<UserSysDeptInfoResultDTO> userSysDeptInfoResultDTOList = result.getData(); |
||||
|
for (UserSysDeptInfoResultDTO userSysDeptInfoResultDTO : userSysDeptInfoResultDTOList) { |
||||
|
|
||||
|
KpiManualScoreTemplateResultDTO kpiManualScoreTemplateResultDTO = new KpiManualScoreTemplateResultDTO(); |
||||
|
|
||||
|
kpiManualScoreTemplateResultDTO.setRuleName(kpiRuleEntity.getRuleName()); |
||||
|
kpiManualScoreTemplateResultDTO.setStreet(userSysDeptInfoResultDTO.getStreet()); |
||||
|
kpiManualScoreTemplateResultDTO.setCommunity(userSysDeptInfoResultDTO.getCommunity()); |
||||
|
kpiManualScoreTemplateResultDTO.setGrid(userSysDeptInfoResultDTO.getGrid()); |
||||
|
kpiManualScoreTemplateResultDTO.setDeptName(userSysDeptInfoResultDTO.getName()); |
||||
|
kpiManualScoreTemplateResultDTO.setKpiCycleName(kpiCycleName); |
||||
|
kpiManualScoreTemplateResultDTO.setScoreStartTime(dateFormat.format(getFirstDayDateOfMonth(scoreStartDateMonth))); |
||||
|
kpiManualScoreTemplateResultDTO.setScoreEndTime(dateFormat.format(getLastDayOfMonth(scoreEndDateMonth))); |
||||
|
kpiManualScoreTemplateResultDTO.setScore(null); |
||||
|
|
||||
|
kpiManualScoreTemplateResultDTO.setRuleId(kpiRuleEntity.getId()); |
||||
|
kpiManualScoreTemplateResultDTO.setDeptId(userSysDeptInfoResultDTO.getId().toString()); |
||||
|
kpiManualScoreTemplateResultDTO.setScoreStartDate(getFirstDayDateOfMonth(scoreStartDateMonth)); |
||||
|
kpiManualScoreTemplateResultDTO.setScoreEndDate(getLastDayOfMonth(scoreEndDateMonth)); |
||||
|
kpiManualScoreTemplateResultDTO.setParentDeptIds(userSysDeptInfoResultDTO.getPids()); |
||||
|
kpiManualScoreTemplateResultDTO.setParentDeptNames(userSysDeptInfoResultDTO.getParentNames()); |
||||
|
kpiManualScoreTemplateResultDTO.setAllDeptIds(userSysDeptInfoResultDTO.getPids() + "," + userSysDeptInfoResultDTO.getId()); |
||||
|
kpiManualScoreTemplateResultDTO.setAllDeptNames(userSysDeptInfoResultDTO.getParentNames() + "-" + userSysDeptInfoResultDTO.getName()); |
||||
|
kpiManualScoreTemplateResultDTO.setUserId(SecurityUser.getUserId().toString()); |
||||
|
list.add(kpiManualScoreTemplateResultDTO); |
||||
|
} |
||||
|
//删除临时表数据
|
||||
|
kpiManualScoreTempDao.deleteManualScoreTemp(SecurityUser.getUserId().toString(), |
||||
|
kpiRuleEntity.getId(), |
||||
|
dateFormat.format(getFirstDayDateOfMonth(scoreStartDateMonth))); |
||||
|
//插入临时表
|
||||
|
List<KpiManualScoreTempEntity> tempEntityList = ConvertUtils.sourceToTarget(list, KpiManualScoreTempEntity.class); |
||||
|
kpiManualScoreTempService.insertBatch(tempEntityList, 200); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param file |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 导入手动打分记录 |
||||
|
* @Date 2019/12/5 15:46 |
||||
|
**/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result importManualScoreExcel(MultipartFile file) { |
||||
|
File f = StreamUtils.conversionFile(file); |
||||
|
try { |
||||
|
//判断上传文件类型
|
||||
|
String originalFilename = file.getOriginalFilename(); |
||||
|
if (!originalFilename.contains(".xlsx") && !originalFilename.contains(".xls")) { |
||||
|
return new Result().error("请选择.xls或者.xlsx格式文件"); |
||||
|
} |
||||
|
ImportParams importParams = new ImportParams(); |
||||
|
List<KpiManualScoreTemplateExcel> recordList = ExcelImportUtil.importExcel(f, KpiManualScoreTemplateExcel.class, importParams); |
||||
|
if (CollUtil.isEmpty(recordList)) { |
||||
|
return new Result().error("导入内容不能为空"); |
||||
|
} |
||||
|
//校验记录数是否一致
|
||||
|
List<ImportExcelErrorResultDTO> errorRecordList = new ArrayList<>(); |
||||
|
List<KpiManualScoreTempEntity> tempEntityList = kpiManualScoreTempDao.selectListKpiManualScoreTemp(SecurityUser.getUserId().toString(), recordList); |
||||
|
if (CollUtil.isEmpty(tempEntityList) || tempEntityList.size() != recordList.size()) { |
||||
|
ImportExcelErrorResultDTO excelErrorResultDTO = new ImportExcelErrorResultDTO(); |
||||
|
excelErrorResultDTO.setErrorLine("0"); |
||||
|
excelErrorResultDTO.setErrorInfo("导入记录条数与导出模板不一致,请核对"); |
||||
|
errorRecordList.add(excelErrorResultDTO); |
||||
|
} |
||||
|
if (CollUtil.isNotEmpty(errorRecordList)) { |
||||
|
Result errorResult = new Result(); |
||||
|
errorResult.setCode(ErrorCode.INTERNAL_SERVER_ERROR); |
||||
|
return errorResult.ok(errorRecordList); |
||||
|
} |
||||
|
List<KpiManualScoreEntity> kpiManualScoreEntityList = ConvertUtils.sourceToTarget(tempEntityList, KpiManualScoreEntity.class); |
||||
|
//循环插入:如果存在则删除原纪录
|
||||
|
for (KpiManualScoreEntity kpiManualScoreEntity : kpiManualScoreEntityList) { |
||||
|
baseDao.delete(getUniqueWrapper(kpiManualScoreEntity)); |
||||
|
baseDao.insert(kpiManualScoreEntity); |
||||
|
} |
||||
|
//删除临时表数据
|
||||
|
kpiManualScoreTempDao.deleteManualScoreTemp(SecurityUser.getUserId().toString(), |
||||
|
tempEntityList.get(0).getRuleId(), |
||||
|
tempEntityList.get(0).getScoreStartTime()); |
||||
|
} finally { |
||||
|
// logger.info("记得删除文件哦");
|
||||
|
this.deleteAllFilesOfDir(f); |
||||
|
} |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除文件夹(强制删除) |
||||
|
* |
||||
|
* @param path |
||||
|
*/ |
||||
|
public void deleteAllFilesOfDir(File path) { |
||||
|
if (null != path) { |
||||
|
if (!path.exists()) |
||||
|
return; |
||||
|
if (path.isFile()) { |
||||
|
boolean result = path.delete(); |
||||
|
int tryCount = 0; |
||||
|
while (!result && tryCount++ < 10) { |
||||
|
System.gc(); // 回收资源
|
||||
|
result = path.delete(); |
||||
|
} |
||||
|
} |
||||
|
File[] files = path.listFiles(); |
||||
|
if (null != files) { |
||||
|
for (int i = 0; i < files.length; i++) { |
||||
|
deleteAllFilesOfDir(files[i]); |
||||
|
} |
||||
|
} |
||||
|
path.delete(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public KpiManualScoreDTO get(String id) { |
||||
|
KpiManualScoreEntity entity = baseDao.selectById(id); |
||||
|
KpiManualScoreDTO kpiManualScoreDTO = ConvertUtils.sourceToTarget(entity, KpiManualScoreDTO.class); |
||||
|
try { |
||||
|
kpiManualScoreDTO.setScoreStartMonth(monthFormat.parse(monthFormat.format(kpiManualScoreDTO.getScoreStartDate()))); |
||||
|
} catch (ParseException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return kpiManualScoreDTO; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result save(KpiManualScoreDTO dto) { |
||||
|
KpiRuleEntity kpiRuleEntity = kpiRuleDao.selectById(dto.getRuleId()); |
||||
|
//得分不能大于满分
|
||||
|
KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(kpiRuleEntity.getId()); |
||||
|
if (null == kpiManualScoreRuleEntity) { |
||||
|
return new Result().error("没有找到关联的手动打分项"); |
||||
|
} else if (null != kpiManualScoreRuleEntity && dto.getScore() > kpiManualScoreRuleEntity.getFullMarks()) { |
||||
|
return new Result().error("得分不能高于满分"); |
||||
|
} |
||||
|
Date scoreEndDateMonth = new Date(); |
||||
|
if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_MONTH.getValue())) { |
||||
|
scoreEndDateMonth = dto.getScoreStartMonth(); |
||||
|
} else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_QUARTER.getValue())) { |
||||
|
scoreEndDateMonth = stepMonth(dto.getScoreStartMonth(), 2); |
||||
|
} else if (kpiRuleEntity.getKpiCycle().equals(KpiCycleEnum.KPI_CYCLE_YEAR.getValue())) { |
||||
|
scoreEndDateMonth = stepMonth(dto.getScoreStartMonth(), 11); |
||||
|
} |
||||
|
dto.setScoreStartDate(getFirstDayDateOfMonth(dto.getScoreStartMonth())); |
||||
|
dto.setScoreEndDate(getLastDayOfMonth(scoreEndDateMonth)); |
||||
|
//调用admin模块查询部门信息详情
|
||||
|
UserSysDeptInfoFormDTO userSysDeptInfoFormDTO = new UserSysDeptInfoFormDTO(); |
||||
|
List<Long> deptIdList = new ArrayList<>(); |
||||
|
deptIdList.add(Long.valueOf(dto.getDeptId())); |
||||
|
userSysDeptInfoFormDTO.setDeptIdList(deptIdList); |
||||
|
List<String> typeKeyList = new ArrayList<>(); |
||||
|
typeKeyList.add(kpiRuleEntity.getDeptTypeKey()); |
||||
|
userSysDeptInfoFormDTO.setTypeKeyList(typeKeyList); |
||||
|
Result<List<UserSysDeptInfoResultDTO>> result = this.queryUserSysDeptInfo(userSysDeptInfoFormDTO); |
||||
|
if (result.getCode() == 0 && result.getData().size() > 0) { |
||||
|
List<UserSysDeptInfoResultDTO> userSysDeptInfoResultDTOList = result.getData(); |
||||
|
UserSysDeptInfoResultDTO userSysDeptInfoResultDTO = userSysDeptInfoResultDTOList.get(0); |
||||
|
dto.setParentDeptIds(userSysDeptInfoResultDTO.getPids()); |
||||
|
dto.setParentDeptNames(userSysDeptInfoResultDTO.getParentNames()); |
||||
|
dto.setAllDeptIds(userSysDeptInfoResultDTO.getPids() + "," + userSysDeptInfoResultDTO.getId()); |
||||
|
dto.setAllDeptNames(userSysDeptInfoResultDTO.getParentNames() + "-" + userSysDeptInfoResultDTO.getName()); |
||||
|
} else { |
||||
|
return new Result().error("获取部门相关信息失败"); |
||||
|
} |
||||
|
KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); |
||||
|
baseDao.delete(getUniqueWrapper(entity)); |
||||
|
insert(entity); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Result update(KpiManualScoreDTO dto) { |
||||
|
KpiManualScoreEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreEntity.class); |
||||
|
//得分不能大于满分
|
||||
|
KpiManualScoreRuleEntity kpiManualScoreRuleEntity = kpiManualScoreRuleDao.selectOneKpiManualScoreRuleByRuleId(dto.getRuleId()); |
||||
|
if (null == kpiManualScoreRuleEntity) { |
||||
|
return new Result().error("没有找到关联的手动打分项"); |
||||
|
} else if (null != kpiManualScoreRuleEntity && dto.getScore() > kpiManualScoreRuleEntity.getFullMarks()) { |
||||
|
return new Result().error("得分不能高于满分"); |
||||
|
} |
||||
|
updateById(entity); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param entity |
||||
|
* @return com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<com.elink.esua.epdc.entity.KpiManualScoreEntity> |
||||
|
* @Author yinzuomei |
||||
|
* @Description |
||||
|
* @Date 2019/12/6 13:58 |
||||
|
**/ |
||||
|
public QueryWrapper<KpiManualScoreEntity> getUniqueWrapper(KpiManualScoreEntity entity) { |
||||
|
QueryWrapper<KpiManualScoreEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(entity.getRuleId()), "RULE_ID", entity.getRuleId()) |
||||
|
.eq(StringUtils.isNotBlank(entity.getDeptId()), "DEPT_ID", entity.getDeptId()) |
||||
|
.eq("score_end_date", entity.getScoreEndDate()) |
||||
|
.eq("score_start_date", entity.getScoreStartDate()); |
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param userSysDeptInfoFormDTO |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO>> |
||||
|
* @Author yinzuomei |
||||
|
* @Description |
||||
|
* @Date 2019/12/6 13:58 |
||||
|
**/ |
||||
|
public Result<List<UserSysDeptInfoResultDTO>> queryUserSysDeptInfo(UserSysDeptInfoFormDTO userSysDeptInfoFormDTO) { |
||||
|
return adminFeignClient.queryUserSysDeptInfo(userSysDeptInfoFormDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return java.util.List<java.lang.Long> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 用户拥有的所有部门权限 |
||||
|
* @Date 2019/12/5 16:29 |
||||
|
**/ |
||||
|
public List<Long> getDataScopeDeptList() { |
||||
|
Long userId = SecurityUser.getUserId(); |
||||
|
// 查询当前用户所具有的的数据权限
|
||||
|
UserDetail userDetail = userDetailRedis.get(userId); |
||||
|
// 用户拥有的所有部门权限
|
||||
|
return userDetail.getDeptIdList(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param sourceDate |
||||
|
* @param month |
||||
|
* @return java.util.Date |
||||
|
* @Author yinzuomei |
||||
|
* @Description |
||||
|
* @Date 2019/12/5 13:46 |
||||
|
**/ |
||||
|
public Date stepMonth(Date sourceDate, int month) { |
||||
|
Calendar c = Calendar.getInstance(); |
||||
|
c.setTime(sourceDate); |
||||
|
c.add(Calendar.MONTH, month); |
||||
|
return c.getTime(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param date |
||||
|
* @return java.util.Date |
||||
|
* @Author yinzuomei |
||||
|
* @Description 获取传入日期所在月的第一天 |
||||
|
* @Date 2019/12/5 13:46 |
||||
|
**/ |
||||
|
public Date getFirstDayDateOfMonth(Date date) { |
||||
|
|
||||
|
final Calendar cal = Calendar.getInstance(); |
||||
|
|
||||
|
cal.setTime(date); |
||||
|
|
||||
|
final int last = cal.getActualMinimum(Calendar.DAY_OF_MONTH); |
||||
|
|
||||
|
cal.set(Calendar.DAY_OF_MONTH, last); |
||||
|
|
||||
|
return cal.getTime(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param date |
||||
|
* @return java.util.Date |
||||
|
* @Author yinzuomei |
||||
|
* @Description 获取传入日期所在月的最后一天 |
||||
|
* @Date 2019/12/5 13:47 |
||||
|
**/ |
||||
|
public Date getLastDayOfMonth(Date date) { |
||||
|
|
||||
|
final Calendar cal = Calendar.getInstance(); |
||||
|
|
||||
|
cal.setTime(date); |
||||
|
|
||||
|
final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); |
||||
|
|
||||
|
cal.set(Calendar.DAY_OF_MONTH, last); |
||||
|
|
||||
|
return cal.getTime(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<KpiManualScoreEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<KpiManualScoreEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.dao.KpiManualScoreTempDao; |
||||
|
import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; |
||||
|
import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; |
||||
|
import com.elink.esua.epdc.redis.KpiManualScoreTempRedis; |
||||
|
import com.elink.esua.epdc.service.KpiManualScoreTempService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 绩效考核手动打分记录 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2019-12-06 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class KpiManualScoreTempServiceImpl extends BaseServiceImpl<KpiManualScoreTempDao, KpiManualScoreTempEntity> implements KpiManualScoreTempService { |
||||
|
|
||||
|
@Autowired |
||||
|
private KpiManualScoreTempRedis kpiManualScoreTempRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<KpiManualScoreTempDTO> page(Map<String, Object> params) { |
||||
|
IPage<KpiManualScoreTempEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, KpiManualScoreTempDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<KpiManualScoreTempDTO> list(Map<String, Object> params) { |
||||
|
List<KpiManualScoreTempEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, KpiManualScoreTempDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<KpiManualScoreTempEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<KpiManualScoreTempEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public KpiManualScoreTempDTO get(String id) { |
||||
|
KpiManualScoreTempEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, KpiManualScoreTempDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(KpiManualScoreTempDTO dto) { |
||||
|
KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(KpiManualScoreTempDTO dto) { |
||||
|
KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
<?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="com.elink.esua.epdc.dao.KpiManualScoreDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.KpiManualScoreEntity" id="kpiManualScoreMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="ruleId" column="RULE_ID"/> |
||||
|
<result property="deptId" column="DEPT_ID"/> |
||||
|
<result property="score" column="SCORE"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
||||
|
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
||||
|
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
||||
|
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
||||
|
<result property="scoreStartDate" column="score_start_date"/> |
||||
|
<result property="scoreEndDate" column="score_end_date"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.dto.result.KpiManualScoreResultDTO" id="KpiManualScoreResultDTOMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="ruleId" column="RULE_ID"/> |
||||
|
<result property="deptId" column="DEPT_ID"/> |
||||
|
<result property="score" column="SCORE"/> |
||||
|
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
||||
|
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
||||
|
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
||||
|
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="ruleName" column="rule_name"/> |
||||
|
<result property="kpiCycle" column="kpi_cycle"/> |
||||
|
<result property="scoreStartDate" column="score_start_date"/> |
||||
|
<result property="scoreEndDate" column="score_end_date"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="selectListKpiManualScoreResultDTO" parameterType="map" resultMap="KpiManualScoreResultDTOMap"> |
||||
|
SELECT |
||||
|
kmc.id, |
||||
|
kmc.rule_id, |
||||
|
kmc.dept_id, |
||||
|
kmc.score, |
||||
|
kmc.parent_dept_ids, |
||||
|
kmc.parent_dept_names, |
||||
|
kmc.all_dept_ids, |
||||
|
kmc.all_dept_names, |
||||
|
kmc.revision, |
||||
|
kmc.created_by, |
||||
|
kmc.created_time, |
||||
|
kmc.updated_by, |
||||
|
kmc.updated_time, |
||||
|
kmc.del_flag, |
||||
|
kr.rule_name, |
||||
|
kr.kpi_cycle, |
||||
|
kmc.score_start_date, |
||||
|
kmc.score_end_date |
||||
|
FROM |
||||
|
epdc_kpi_manual_score kmc |
||||
|
left join epdc_kpi_rule kr |
||||
|
on(kmc.RULE_ID=kr.id) |
||||
|
WHERE |
||||
|
kmc.del_flag = '0' |
||||
|
<if test="ruleId!=null and ruleId!=''"> |
||||
|
AND kmc.rule_id =#{ruleId} |
||||
|
</if> |
||||
|
<if test="scoreStartDate != null and scoreStartDate != ''"> |
||||
|
AND DATE_FORMAT( kmc.score_start_date, '%Y-%m' ) BETWEEN #{scoreStartDate} AND #{scoreStartDate} |
||||
|
</if> |
||||
|
ORDER BY kmc.CREATED_TIME DESC |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,86 @@ |
|||||
|
<?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="com.elink.esua.epdc.dao.KpiManualScoreTempDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.KpiManualScoreTempEntity" id="kpiManualScoreTempMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="ruleId" column="RULE_ID"/> |
||||
|
<result property="deptId" column="DEPT_ID"/> |
||||
|
<result property="score" column="SCORE"/> |
||||
|
<result property="scoreStartDate" column="score_start_date"/> |
||||
|
<result property="scoreEndDate" column="score_end_date"/> |
||||
|
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
||||
|
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
||||
|
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
||||
|
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
||||
|
<result property="userId" column="USER_ID"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="street" column="street"/> |
||||
|
<result property="community" column="community"/> |
||||
|
<result property="grid" column="grid"/> |
||||
|
<result property="ruleName" column="rule_name"/> |
||||
|
<result property="kpiCycleName" column="kpi_cycle_name"/> |
||||
|
<result property="scoreStartTime" column="score_start_time"/> |
||||
|
<result property="scoreEndTime" column="score_end_time"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<delete id="deleteManualScoreTemp" parameterType="map"> |
||||
|
DELETE |
||||
|
FROM |
||||
|
epdc_kpi_manual_score_temp |
||||
|
WHERE |
||||
|
RULE_ID =#{ruleId} |
||||
|
AND user_id = #{userId} |
||||
|
AND score_start_time =#{scoreStartTime} |
||||
|
</delete> |
||||
|
|
||||
|
<select id="selectListKpiManualScoreTemp" parameterType="map" resultMap="kpiManualScoreTempMap"> |
||||
|
<foreach collection="recordList" item="record" index="index" open="" close="" separator="union"> |
||||
|
select temp.ID, |
||||
|
temp.RULE_ID, |
||||
|
temp.DEPT_ID, |
||||
|
#{record.score} as SCORE, |
||||
|
temp.score_start_date, |
||||
|
temp.score_end_date, |
||||
|
temp.PARENT_DEPT_IDS, |
||||
|
temp.PARENT_DEPT_NAMES, |
||||
|
temp.ALL_DEPT_NAMES, |
||||
|
temp.ALL_DEPT_IDS, |
||||
|
temp.REVISION, |
||||
|
temp.CREATED_BY, |
||||
|
temp.CREATED_TIME, |
||||
|
temp.UPDATED_BY, |
||||
|
temp.UPDATED_TIME, |
||||
|
temp.DEL_FLAG, |
||||
|
temp.street, |
||||
|
temp.community, |
||||
|
temp.grid, |
||||
|
temp.rule_name, |
||||
|
temp.kpi_cycle_name, |
||||
|
temp.score_start_time, |
||||
|
temp.score_end_time |
||||
|
from epdc_kpi_manual_score_temp temp,epdc_kpi_rule kr,epdc_kpi_manual_score_rule sr |
||||
|
where temp.DEL_FLAG='0' |
||||
|
and kr.DEL_FLAG='0' |
||||
|
and temp.RULE_ID=kr.id |
||||
|
and temp.USER_ID=#{userId} |
||||
|
and kr.reference_id=sr.id |
||||
|
and temp.rule_name=#{record.ruleName} |
||||
|
and temp.street=#{record.street} |
||||
|
and temp.community=#{record.community} |
||||
|
and temp.grid=#{record.grid} |
||||
|
and temp.kpi_cycle_name=#{record.kpiCycleName} |
||||
|
and temp.score_start_time=#{record.scoreStartTime} |
||||
|
and temp.score_end_time=#{record.scoreEndTime} |
||||
|
and #{record.score} >=0 |
||||
|
and #{record.score} <=sr.full_marks |
||||
|
and #{record.score} is not null |
||||
|
</foreach> |
||||
|
</select> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue