From 256f7276b1648d96af378bc3f6a2e16366cf8aaf Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Fri, 12 May 2023 18:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B0=83=E5=BA=A6=E5=91=98?= =?UTF-8?q?=E8=80=83=E6=A0=B8=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/kpi/KpiKhxzController.java | 23 +- .../com/cm/bigdata/dao/kpi/IKpiConfigDao.java | 10 + .../com/cm/bigdata/dao/kpi/IKpiKhxzDao.java | 13 - .../cm/bigdata/dao/kpi/IKpiKhxzDdyDao.java | 21 + .../cm/bigdata/dao/kpi/IKpiKhxzWgyDao.java | 6 +- .../bigdata/pojo/dtos/kpi/KpiKhxzDdyDTO.java | 4 + .../bigdata/pojo/dtos/kpi/KpiKhxzWgy3DTO.java | 4 + .../bigdata/pojo/dtos/kpi/KpiKhxzWgyDTO.java | 782 ++++++++++++++++++ .../com/cm/bigdata/pojo/pos/kpi/CasePO.java | 9 + .../com/cm/bigdata/pojo/vos/kpi/KpiWgyVO.java | 18 + .../bigdata/service/kpi/IKpiKhxzService.java | 11 +- .../cm/bigdata/service/kpi/IKpiService.java | 2 + .../service/kpi/impl/KpiKhxzServiceImpl.java | 36 +- .../service/kpi/impl/KpiServiceImpl.java | 23 +- .../service/kpi/task/KpiKhxzDdyTask.java | 72 ++ .../service/kpi/task/KpiKhxzWgyTask.java | 1 - .../kpi/task/sub/KpiKhxzDdyCRunnable.java | 60 ++ .../kpi/task/sub/KpiKhxzDdyERunnable.java | 45 + .../com/cm/bigdata/utils/ExcelExportUtil.java | 1 + .../com/cm/bigdata/utils/KpiScoreUtil.java | 35 + .../java/com/cm/bigdata/utils/KpiUtil.java | 3 + .../mybatis/db2-mapper/kpi/user-mapper.xml | 16 + .../mybatis/mapper/kpi/kpi-config-mapper.xml | 13 + .../mapper/kpi/kpi-khxz-ddy-mapper.xml | 72 ++ .../mybatis/mapper/kpi/kpi-khxz-mapper.xml | 43 - .../mapper/kpi/kpi-khxz-wgy-mapper.xml | 145 +++- .../mybatis/mapper/kpi/kpi-mapper.xml | 21 + 27 files changed, 1417 insertions(+), 72 deletions(-) create mode 100644 src/main/java/com/cm/bigdata/dao/kpi/IKpiConfigDao.java delete mode 100644 src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDao.java create mode 100644 src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDdyDao.java create mode 100644 src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzDdyDTO.java create mode 100644 src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgy3DTO.java create mode 100644 src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgyDTO.java create mode 100644 src/main/java/com/cm/bigdata/pojo/vos/kpi/KpiWgyVO.java create mode 100644 src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzDdyTask.java create mode 100644 src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyCRunnable.java create mode 100644 src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyERunnable.java create mode 100644 src/main/resources/mybatis/mapper/kpi/kpi-config-mapper.xml create mode 100644 src/main/resources/mybatis/mapper/kpi/kpi-khxz-ddy-mapper.xml delete mode 100644 src/main/resources/mybatis/mapper/kpi/kpi-khxz-mapper.xml diff --git a/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiKhxzController.java b/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiKhxzController.java index fdd1fd7..ecde05f 100644 --- a/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiKhxzController.java +++ b/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiKhxzController.java @@ -1,6 +1,8 @@ package com.cm.bigdata.controller.apis.kpi; import com.cm.bigdata.monitor.KpiUpdateMonitor; +import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO; +import com.cm.bigdata.pojo.vos.kpi.KpiWgyVO; import com.cm.bigdata.service.kpi.IKpiKhxzService; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; @@ -11,6 +13,8 @@ import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -32,15 +36,32 @@ public class KpiKhxzController extends AbstractController { return new SuccessResult(); } + @GetMapping("update/kh-year/{khYear}/kh-month/{khMonth}") + public void resetUpdateProcess() { + KpiUpdateMonitor.getInstance().setTaskCount(0); + } + @GetMapping("get-update-percent") public SuccessResultData getUpdatePercent() { return new SuccessResultData<>(KpiUpdateMonitor.getInstance().getPercent()); } @GetMapping("list-wgy") - public List> listWgy() { + public List listWgy() { Map queryMap = requestParams(); return kpiKhxzService.listWgy(queryMap); } + @GetMapping("export-wgy") + public void exportWgy(HttpServletResponse httpServletResponse) throws IOException { + Map queryMap = requestParams(); + kpiKhxzService.exportWgy(httpServletResponse, queryMap); + } + + @PutMapping("update-wgy/{wgyLevel}") + public synchronized SuccessResult updateWgy(@PathVariable("wgyLevel") Integer wgyLevel, @RequestBody KpiWgyVO kpiWgyVO) { + kpiKhxzService.updateWgy(wgyLevel, kpiWgyVO); + return new SuccessResult(); + } + } diff --git a/src/main/java/com/cm/bigdata/dao/kpi/IKpiConfigDao.java b/src/main/java/com/cm/bigdata/dao/kpi/IKpiConfigDao.java new file mode 100644 index 0000000..6fdcae1 --- /dev/null +++ b/src/main/java/com/cm/bigdata/dao/kpi/IKpiConfigDao.java @@ -0,0 +1,10 @@ +package com.cm.bigdata.dao.kpi; + +import java.util.List; +import java.util.Map; + +public interface IKpiConfigDao { + + List> listConfig(); + +} diff --git a/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDao.java b/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDao.java deleted file mode 100644 index 2b4b9d8..0000000 --- a/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cm.bigdata.dao.kpi; - -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -@Repository -public interface IKpiKhxzDao { - - List> listWgy(Map queryMap); - -} diff --git a/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDdyDao.java b/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDdyDao.java new file mode 100644 index 0000000..595d46b --- /dev/null +++ b/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzDdyDao.java @@ -0,0 +1,21 @@ +package com.cm.bigdata.dao.kpi; + +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface IKpiKhxzDdyDao { + + void save(Map saveParams); + + void delete(Map params); + + List listUserId(Map params); + + void updateC(Map updateParams); + + void updateEF(Map updateParams); + +} diff --git a/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzWgyDao.java b/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzWgyDao.java index 862895d..42323c7 100644 --- a/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzWgyDao.java +++ b/src/main/java/com/cm/bigdata/dao/kpi/IKpiKhxzWgyDao.java @@ -1,5 +1,6 @@ package com.cm.bigdata.dao.kpi; +import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO; import org.apache.ibatis.annotations.MapKey; import org.springframework.stereotype.Repository; @@ -13,8 +14,7 @@ public interface IKpiKhxzWgyDao { void delete(Map params); - @MapKey("id") - List> listWgy(Map params); + List listWgy(Map params); List listUserId(Map params); @@ -22,4 +22,6 @@ public interface IKpiKhxzWgyDao { void updateEGIKRT(Map params); + void update(Map params); + } diff --git a/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzDdyDTO.java b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzDdyDTO.java new file mode 100644 index 0000000..96e151c --- /dev/null +++ b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzDdyDTO.java @@ -0,0 +1,4 @@ +package com.cm.bigdata.pojo.dtos.kpi; + +public class KpiKhxzDdyDTO { +} diff --git a/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgy3DTO.java b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgy3DTO.java new file mode 100644 index 0000000..8d96014 --- /dev/null +++ b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgy3DTO.java @@ -0,0 +1,4 @@ +package com.cm.bigdata.pojo.dtos.kpi; + +public class KpiKhxzWgy3DTO { +} diff --git a/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgyDTO.java b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgyDTO.java new file mode 100644 index 0000000..d1fad14 --- /dev/null +++ b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/KpiKhxzWgyDTO.java @@ -0,0 +1,782 @@ +package com.cm.bigdata.pojo.dtos.kpi; + +import javax.validation.constraints.Size; +import javax.validation.constraints.NotNull; + +import java.io.Serializable; + +import java.util.Date; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import org.hibernate.validator.constraints.Length; + +/** + * 4级网格员考核细则 + * + * @TableName kpi_khxz_wgy_3 + */ +public class KpiKhxzWgyDTO implements Serializable { + + /** + * + */ + @ExcelIgnore + private Long id; + /** + * 街道ID + */ + @ExcelIgnore + private String areaId; + /** + * 社区ID + */ + @ExcelIgnore + private String communityId; + /** + * 用户ID + */ + @ExcelIgnore + private String userId; + /** + * 考核年度 + */ + @ExcelIgnore + private Integer khYear; + /** + * 考核月份 + */ + @ExcelIgnore + private Integer khMonth; + @ExcelProperty(value = {"序号"}, index = 0) + @JsonProperty("A") + private Integer a; + /** + * 姓名 + */ + @ExcelProperty(value = {"姓名"}, index = 1) + @JsonProperty("B") + private String b; + /** + * 片区巡查 + */ + @ExcelProperty(value = {"片区巡查(40分)"}, index = 2) + @JsonProperty("C") + private Double c; + /** + * 基础分 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "基础分"}, index = 3) + @JsonProperty("D") + private Integer d; + /** + * 本月应报案件数 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月应报案件数"}, index = 4) + @JsonProperty("E") + private Integer e; + /** + * 本月单个案件分值 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月单个案件分值"}, index = 5) + @JsonProperty("F") + private Double f; + /** + * 实报案件数量 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月实报案件", "数量"}, index = 6) + @JsonProperty("G") + private Integer g; + /** + * 实报案件得分 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月实报案件", "得分"}, index = 7) + @JsonProperty("H") + private Double h; + /** + * 少报案件数量 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月少报案件", "数量"}, index = 8) + @JsonProperty("I") + private Integer i; + /** + * 少报案件得分 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月少报案件", "得分"}, index = 9) + @JsonProperty("J") + private Double j; + /** + * 多报案件数量 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月多报案件", "数量"}, index = 10) + @JsonProperty("K") + private Integer k; + /** + * 多报案件得分 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "本月多报案件", "得分"}, index = 11) + @JsonProperty("L") + private Double l; + /** + * 应上报却未上报案件 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "凡属下列情况之一经核准予以扣分", "应上报却未上报案件"}, index = 12) + @JsonProperty("M") + private Integer m; + /** + * 应上报却未上报案件意见 + */ + @ExcelIgnore + private String reasonM; + /** + * 平台立案上报不标准不及时的 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "凡属下列情况之一经核准予以扣分", "平台立案上报不标准不及时的"}, index = 13) + @JsonProperty("N") + private Integer n; + /** + * 平台立案上报不标准不及时的原因 + */ + @ExcelIgnore + private String reasonN; + /** + * 恶意退单 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "凡属下列情况之一经核准予以扣分", "恶意退单"}, index = 14) + @JsonProperty("O") + private Integer o; + /** + * 恶意退单原因 + */ + @ExcelIgnore + private String reasonO; + /** + * 扣分其它情况 + */ + @ExcelProperty(value = {"巡查上报、案件受理过程质量", "凡属下列情况之一经核准予以扣分", "其它情况"}, index = 15) + @JsonProperty("P") + private Integer p; + /** + * 扣分其它情况说明 + */ + @ExcelIgnore + private String reasonP; + /** + * 结案情况得分 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "结案情况得分"}, index = 16) + @JsonProperty("Q") + private Double q; + /** + * 督查次数 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "督察案件结案情况", "督查次数"}, index = 17) + @JsonProperty("R") + private Integer r; + /** + * 督查次数原因 + */ + @ExcelIgnore + private String reasonR; + /** + * 督查扣分 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "督察案件结案情况", "督查扣分"}, index = 18) + @JsonProperty("S") + private Double s; + /** + * 网格员24小时未核查扣分 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "案件处置过程质量", "网格员24小时未核查扣分"}, index = 19) + @JsonProperty("T") + private Double t; + /** + * 反馈虚假信息 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "案件处置过程质量", "反馈虚假信息"}, index = 20) + @JsonProperty("U") + private Double u; + /** + * 反馈虚假信息原因 + */ + @ExcelIgnore + private String reasonU; + /** + * 其他情况 + */ + @ExcelProperty(value = {"案件处置实效(指挥协调实效)", "案件处置过程质量", "其他情况"}, index = 21) + @JsonProperty("V") + private Double v; + /** + * 其他情况原因 + */ + @ExcelIgnore + private String reasonV; + /** + * 人口信息录入 + */ + @ExcelProperty(value = {"人口信息管理", "人口信息录入"}, index = 22) + @JsonProperty("W") + private Double w; + /** + * 人口信息录入原因 + */ + @ExcelIgnore + private String reasonW; + /** + * 人口信息质量管理 + */ + @ExcelProperty(value = {"人口信息管理", "人口信息质量管理"}, index = 23) + @JsonProperty("X") + private Double x; + /** + * 人口信息质量管理原因 + */ + @ExcelIgnore + private String reasonX; + /** + * 人口信息维护 + */ + @ExcelProperty(value = {"人口信息管理", "人口信息维护"}, index = 24) + @JsonProperty("Y") + private Double y; + /** + * 人口信息维护原因 + */ + @ExcelIgnore + private String reasonY; + /** + * 抽查情况 + */ + @ExcelProperty(value = {"人口信息管理", "抽查情况"}, index = 25) + @JsonProperty("Z") + private Double z; + /** + * 抽查情况原因 + */ + @ExcelIgnore + private String reasonZ; + /** + * 党建信息上报 + */ + @ExcelProperty(value = {"党组织建设", "党建信息上报"}, index = 26) + @JsonProperty("AA") + private Double aA; + /** + * 党建信息上报原因 + */ + @ExcelIgnore + private String reasonAA; + /** + * 党建信息质量管理 + */ + @ExcelProperty(value = {"党组织建设", "党建信息质量管理"}, index = 27) + @JsonProperty("AB") + private Double aB; + /** + * 党建信息质量管理原因 + */ + @ExcelIgnore + private String reasonAB; + /** + * 党建信息维护 + */ + @ExcelProperty(value = {"党组织建设", "党建信息维护"}, index = 28) + @JsonProperty("AC") + private Double aC; + /** + * 党建信息维护原因 + */ + @ExcelIgnore + private String reasonAC; + /** + * 抽查情况 + */ + @ExcelProperty(value = {"党组织建设", "抽查情况"}, index = 29) + @JsonProperty("AD") + private Double aD; + /** + * 抽查情况原因 + */ + @ExcelIgnore + private String reasonAD; + /** + * 总得分 + */ + @ExcelProperty(value = {"总得分"}, index = 30) + @JsonProperty("AE") + private Double aE; + /** + * 应发绩效工资 + */ + @ExcelProperty(value = {"应发绩效工资"}, index = 31) + @JsonProperty("AF") + private Double aF; + /** + * 实发绩效工资 + */ + @ExcelProperty(value = {"实发绩效工资"}, index = 32) + @JsonProperty("AG") + private Double aG; + /** + * 修改时间 + */ + @ExcelIgnore + private Date gmtModified; + /** + * 修改人 + */ + @ExcelIgnore + private String modifier; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAreaId() { + return areaId; + } + + public void setAreaId(String areaId) { + this.areaId = areaId; + } + + public String getCommunityId() { + return communityId; + } + + public void setCommunityId(String communityId) { + this.communityId = communityId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Integer getKhYear() { + return khYear; + } + + public void setKhYear(Integer khYear) { + this.khYear = khYear; + } + + public Integer getKhMonth() { + return khMonth; + } + + public void setKhMonth(Integer khMonth) { + this.khMonth = khMonth; + } + + public Integer getA() { + return a; + } + + public void setA(Integer a) { + this.a = a; + } + + public String getB() { + return b; + } + + public void setB(String b) { + this.b = b; + } + + public Double getC() { + return c; + } + + public void setC(Double c) { + this.c = c; + } + + public Integer getD() { + return d; + } + + public void setD(Integer d) { + this.d = d; + } + + public Integer getE() { + return e; + } + + public void setE(Integer e) { + this.e = e; + } + + public Double getF() { + return f; + } + + public void setF(Double f) { + this.f = f; + } + + public Integer getG() { + return g; + } + + public void setG(Integer g) { + this.g = g; + } + + public Double getH() { + return h; + } + + public void setH(Double h) { + this.h = h; + } + + public Integer getI() { + return i; + } + + public void setI(Integer i) { + this.i = i; + } + + public Double getJ() { + return j; + } + + public void setJ(Double j) { + this.j = j; + } + + public Integer getK() { + return k; + } + + public void setK(Integer k) { + this.k = k; + } + + public Double getL() { + return l; + } + + public void setL(Double l) { + this.l = l; + } + + public Integer getM() { + return m; + } + + public void setM(Integer m) { + this.m = m; + } + + public String getReasonM() { + return reasonM; + } + + public void setReasonM(String reasonM) { + this.reasonM = reasonM; + } + + public Integer getN() { + return n; + } + + public void setN(Integer n) { + this.n = n; + } + + public String getReasonN() { + return reasonN; + } + + public void setReasonN(String reasonN) { + this.reasonN = reasonN; + } + + public Integer getO() { + return o; + } + + public void setO(Integer o) { + this.o = o; + } + + public String getReasonO() { + return reasonO; + } + + public void setReasonO(String reasonO) { + this.reasonO = reasonO; + } + + public Integer getP() { + return p; + } + + public void setP(Integer p) { + this.p = p; + } + + public String getReasonP() { + return reasonP; + } + + public void setReasonP(String reasonP) { + this.reasonP = reasonP; + } + + public Double getQ() { + return q; + } + + public void setQ(Double q) { + this.q = q; + } + + public Integer getR() { + return r; + } + + public void setR(Integer r) { + this.r = r; + } + + public String getReasonR() { + return reasonR; + } + + public void setReasonR(String reasonR) { + this.reasonR = reasonR; + } + + public Double getS() { + return s; + } + + public void setS(Double s) { + this.s = s; + } + + public Double getT() { + return t; + } + + public void setT(Double t) { + this.t = t; + } + + public Double getU() { + return u; + } + + public void setU(Double u) { + this.u = u; + } + + public String getReasonU() { + return reasonU; + } + + public void setReasonU(String reasonU) { + this.reasonU = reasonU; + } + + public Double getV() { + return v; + } + + public void setV(Double v) { + this.v = v; + } + + public String getReasonV() { + return reasonV; + } + + public void setReasonV(String reasonV) { + this.reasonV = reasonV; + } + + public Double getW() { + return w; + } + + public void setW(Double w) { + this.w = w; + } + + public String getReasonW() { + return reasonW; + } + + public void setReasonW(String reasonW) { + this.reasonW = reasonW; + } + + public Double getX() { + return x; + } + + public void setX(Double x) { + this.x = x; + } + + public String getReasonX() { + return reasonX; + } + + public void setReasonX(String reasonX) { + this.reasonX = reasonX; + } + + public Double getY() { + return y; + } + + public void setY(Double y) { + this.y = y; + } + + public String getReasonY() { + return reasonY; + } + + public void setReasonY(String reasonY) { + this.reasonY = reasonY; + } + + public Double getZ() { + return z; + } + + public void setZ(Double z) { + this.z = z; + } + + public String getReasonZ() { + return reasonZ; + } + + public void setReasonZ(String reasonZ) { + this.reasonZ = reasonZ; + } + + public Double getaA() { + return aA; + } + + public void setaA(Double aA) { + this.aA = aA; + } + + public String getReasonAA() { + return reasonAA; + } + + public void setReasonAA(String reasonAA) { + this.reasonAA = reasonAA; + } + + public Double getaB() { + return aB; + } + + public void setaB(Double aB) { + this.aB = aB; + } + + public String getReasonAB() { + return reasonAB; + } + + public void setReasonAB(String reasonAB) { + this.reasonAB = reasonAB; + } + + public Double getaC() { + return aC; + } + + public void setaC(Double aC) { + this.aC = aC; + } + + public String getReasonAC() { + return reasonAC; + } + + public void setReasonAC(String reasonAC) { + this.reasonAC = reasonAC; + } + + public Double getaD() { + return aD; + } + + public void setaD(Double aD) { + this.aD = aD; + } + + public String getReasonAD() { + return reasonAD; + } + + public void setReasonAD(String reasonAD) { + this.reasonAD = reasonAD; + } + + public Double getaE() { + return aE; + } + + public void setaE(Double aE) { + this.aE = aE; + } + + public Double getaF() { + return aF; + } + + public void setaF(Double aF) { + this.aF = aF; + } + + public Double getaG() { + return aG; + } + + public void setaG(Double aG) { + this.aG = aG; + } + + public Date getGmtModified() { + return gmtModified; + } + + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier; + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } +} diff --git a/src/main/java/com/cm/bigdata/pojo/pos/kpi/CasePO.java b/src/main/java/com/cm/bigdata/pojo/pos/kpi/CasePO.java index 2e4db06..867f2a8 100644 --- a/src/main/java/com/cm/bigdata/pojo/pos/kpi/CasePO.java +++ b/src/main/java/com/cm/bigdata/pojo/pos/kpi/CasePO.java @@ -19,6 +19,7 @@ public class CasePO { private String gmtInspect; private Integer isSelf; private String reportUserId; + private String assignUserId; private String handleUserId; private String inspectUserId; private String inspectScore; @@ -170,6 +171,14 @@ public class CasePO { this.reportUserId = reportUserId; } + public String getAssignUserId() { + return assignUserId; + } + + public void setAssignUserId(String assignUserId) { + this.assignUserId = assignUserId; + } + public String getHandleUserId() { return handleUserId; } diff --git a/src/main/java/com/cm/bigdata/pojo/vos/kpi/KpiWgyVO.java b/src/main/java/com/cm/bigdata/pojo/vos/kpi/KpiWgyVO.java new file mode 100644 index 0000000..8945024 --- /dev/null +++ b/src/main/java/com/cm/bigdata/pojo/vos/kpi/KpiWgyVO.java @@ -0,0 +1,18 @@ +package com.cm.bigdata.pojo.vos.kpi; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class KpiWgyVO { + + private List> datas; + + public List> getDatas() { + return datas == null ? new ArrayList<>() : datas; + } + + public void setDatas(List> datas) { + this.datas = datas; + } +} diff --git a/src/main/java/com/cm/bigdata/service/kpi/IKpiKhxzService.java b/src/main/java/com/cm/bigdata/service/kpi/IKpiKhxzService.java index c483cfe..f658366 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/IKpiKhxzService.java +++ b/src/main/java/com/cm/bigdata/service/kpi/IKpiKhxzService.java @@ -1,5 +1,10 @@ package com.cm.bigdata.service.kpi; +import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO; +import com.cm.bigdata.pojo.vos.kpi.KpiWgyVO; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -8,7 +13,11 @@ public interface IKpiKhxzService { void update(Integer khYear, Integer khMonth); - List> listWgy(Map queryMap); + List listWgy(Map queryMap); + void exportWgy(HttpServletResponse httpServletResponse, Map queryMap) throws IOException; + + void updateWgy(Integer wgyLevel, KpiWgyVO kpiWgyVO); + } diff --git a/src/main/java/com/cm/bigdata/service/kpi/IKpiService.java b/src/main/java/com/cm/bigdata/service/kpi/IKpiService.java index c13f873..9355a09 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/IKpiService.java +++ b/src/main/java/com/cm/bigdata/service/kpi/IKpiService.java @@ -28,6 +28,7 @@ public interface IKpiService { */ void updateNPersonDayCount(String departmentId, String startTime, String endTime); + void updateNPersonDayCount(String roleId, Integer khYear, Integer khMonth); /** * 更新 @@ -67,4 +68,5 @@ public interface IKpiService { List listCommunityBossDayCountByUserId(String userId, Integer year, Integer month, Integer level); + } diff --git a/src/main/java/com/cm/bigdata/service/kpi/impl/KpiKhxzServiceImpl.java b/src/main/java/com/cm/bigdata/service/kpi/impl/KpiKhxzServiceImpl.java index 73cd009..6e0ca44 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/impl/KpiKhxzServiceImpl.java +++ b/src/main/java/com/cm/bigdata/service/kpi/impl/KpiKhxzServiceImpl.java @@ -1,14 +1,22 @@ package com.cm.bigdata.service.kpi.impl; -import com.cm.bigdata.dao.kpi.IKpiKhxzDao; +import com.cm.bigdata.dao.kpi.IKpiKhxzWgyDao; import com.cm.bigdata.monitor.KpiUpdateMonitor; +import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO; +import com.cm.bigdata.pojo.dtos.kpi.NPersonCaseDayCountDTO; +import com.cm.bigdata.pojo.vos.kpi.KpiWgyVO; import com.cm.bigdata.service.kpi.IKpiKhxzService; import com.cm.bigdata.service.kpi.IKpiService; import com.cm.bigdata.service.kpi.task.KpiKhxzWgyTask; +import com.cm.bigdata.utils.ExcelExportUtil; import com.cm.common.base.AbstractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; @@ -18,7 +26,7 @@ import java.util.concurrent.Executors; public class KpiKhxzServiceImpl extends AbstractService implements IKpiKhxzService { @Autowired - private IKpiKhxzDao kpiKhxzDao; + private IKpiKhxzWgyDao kpiKhxzWgyDao; @Autowired private IKpiService kpiService; @@ -35,23 +43,43 @@ public class KpiKhxzServiceImpl extends AbstractService implements IKpiKhxzServi // 更新案件,1任务 kpiService.updateCaseCount(); KpiUpdateMonitor.getInstance().complete(); + // 更新4级网格员日统计,1任务 kpiService.updateCommunityBossDayCount(khYear, khMonth, 3); KpiUpdateMonitor.getInstance().complete(); + // 更新4级网格员,4任务 kpiKhxzWgyTask.update(khYear, khMonth, 3); + // 更新5级网格员日统计,1任务 kpiService.updateCommunityBossDayCount(khYear, khMonth, 4); KpiUpdateMonitor.getInstance().complete(); + // 更新5级网格员,4个任务 kpiKhxzWgyTask.update(khYear, khMonth, 4); + + // 更新专管员、调度员日统计,1任务 + kpiService.updateNPersonDayCount("72bff485-69be-4570-9f30-ff65fdbe5251", khYear, khMonth); + KpiUpdateMonitor.getInstance().complete(); }); } @Override - public List> listWgy(Map queryMap) { - return kpiKhxzDao.listWgy(queryMap); + public List listWgy(Map queryMap) { + return kpiKhxzWgyDao.listWgy(queryMap); } + @Override + public void exportWgy(HttpServletResponse httpServletResponse, Map queryMap) throws IOException { + List wgys = listWgy(queryMap); + ExcelExportUtil.simple(httpServletResponse, "网格员考核细则", wgys, KpiKhxzWgyDTO.class); + } + @Override + public void updateWgy(Integer wgyLevel, KpiWgyVO kpiWgyVO) { + kpiWgyVO.getDatas().forEach(params -> { + params.put("wgyLevel", wgyLevel); + kpiKhxzWgyDao.update(params); + }); + } } diff --git a/src/main/java/com/cm/bigdata/service/kpi/impl/KpiServiceImpl.java b/src/main/java/com/cm/bigdata/service/kpi/impl/KpiServiceImpl.java index 7b34059..513c1fb 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/impl/KpiServiceImpl.java +++ b/src/main/java/com/cm/bigdata/service/kpi/impl/KpiServiceImpl.java @@ -114,9 +114,13 @@ public class KpiServiceImpl implements IKpiService { @Override public void updateNPersonDayCount(String departmentId, String startTime, String endTime) { + updateNPersonDayCount(departmentId, KpiUtil.ZGY_ROLE_ID, startTime, endTime); + } + + private void updateNPersonDayCount(String departmentId, String roleId, String startTime, String endTime) { Map params = new HashMap<>(); - // 专管员 - params.put("roleId", "bc405346-8714-4ded-89ac-9cc4d755f66a"); + // 专管员,调度员 + params.put("roleId", roleId); params.put("departmentId", departmentId); List userPOS = userService.listPO(params); if (userPOS.isEmpty()) { @@ -149,12 +153,26 @@ public class KpiServiceImpl implements IKpiService { queryParams.put("isSignout", isSignout); queryParams.put("isSignoutEarly", isSignoutEarly); queryParams.put("workDistance", workDistance); + if (StringUtils.equals(roleId, KpiUtil.DDY_ROLE_ID)) { + queryParams.put("dayScore", KpiScoreUtil.getDdyDayScore(isSignin, isSigninLate, isSignout, isSignoutEarly, isHoliday)); + } + if (StringUtils.equals(roleId, KpiUtil.ZGY_ROLE_ID)) { + queryParams.put("dayScore", KpiScoreUtil.getZgyDayScore(isSignin, isSigninLate, isSignout, isSignoutEarly, isHoliday)); + } queryParams.put("isHoliday", isHoliday); kpiDao.saveNPersonDayCount(queryParams); }); }); } + @Override + public void updateNPersonDayCount(String roleId, Integer year, Integer month) { + DateTime dateTime = DateTime.parse(String.format("%04d-%02d", year, month), DateTimeFormat.forPattern("yyyy-MM")); + String startTime = dateTime.dayOfMonth().withMinimumValue().toString(DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD)); + String endTime = dateTime.dayOfMonth().withMaximumValue().toString(DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD)); + updateNPersonDayCount(null, roleId, startTime, endTime); + } + private List listDate(String startTime, String endTime) { LocalDateTime startLocalDateTime = LocalDateTime.now(); LocalDateTime endLocalDateTime = LocalDateTime.now(); @@ -234,6 +252,7 @@ public class KpiServiceImpl implements IKpiService { for (ReportCaseAssignPO reportCaseAssignPO : reportCaseAssignPOS) { if (StringUtils.equals(reportCasePO.getReportCaseId(), reportCaseAssignPO.getCaseId())) { params.put("gmtAssign", reportCaseAssignPO.getGmtCreate()); + params.put("assignUserId", reportCaseAssignPO.getCreator()); params.put("handleEndTimeLong", reportCaseAssignPO.getHandleTime()); // 截至时间 LocalDateTime assignDateTime = LocalDateTime.parse(reportCaseAssignPO.getGmtCreate().substring(0, 19), DATE_TIME_FORMATTER); diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzDdyTask.java b/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzDdyTask.java new file mode 100644 index 0000000..ded752e --- /dev/null +++ b/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzDdyTask.java @@ -0,0 +1,72 @@ +package com.cm.bigdata.service.kpi.task; + +import com.cm.bigdata.dao.kpi.IKpiDao; +import com.cm.bigdata.dao.kpi.IKpiKhxzDdyDao; +import com.cm.bigdata.pojo.pos.kpi.UserPO; +import com.cm.bigdata.service.kpi.IUserService; +import com.cm.bigdata.service.kpi.task.sub.KpiKhxzDdyCRunnable; +import com.cm.bigdata.service.kpi.task.sub.KpiKhxzDdyERunnable; +import com.cm.bigdata.utils.KpiUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +@Service +public class KpiKhxzDdyTask { + + @Autowired + private IKpiDao kpiDao; + @Autowired + private IKpiKhxzDdyDao kpiKhxzDdyDao; + @Autowired + private IUserService userService; + + private ExecutorService executorService = Executors.newFixedThreadPool(10); + + public void update(int khYear, int khMonth) { + deleteBase(khYear, khMonth); + updateBase(khYear, khMonth); + List userIds = listUserId(khYear, khMonth); + if (userIds.isEmpty()) { + return; + } + executorService.execute(new KpiKhxzDdyCRunnable(kpiKhxzDdyDao, kpiDao, khYear, khMonth, userIds)); + executorService.execute(new KpiKhxzDdyERunnable(kpiKhxzDdyDao, kpiDao, khYear, khMonth, userIds)); + } + + private void deleteBase(int khYear, int khMonth) { + Map params = new HashMap<>(); + params.put("khYear", khYear); + params.put("khMonth", khMonth); + kpiKhxzDdyDao.delete(params); + } + + private void updateBase(int khYear, int khMonth) { + // 调度员 + Map params = new HashMap<>(); + params.put("roleId", KpiUtil.DDY_ROLE_ID); + List userPOS = userService.listPO(params); + userPOS.forEach(userPO -> { + Map saveParams = new HashMap<>(); + saveParams.put("khYear", khYear); + saveParams.put("khMonth", khMonth); + saveParams.put("userId", userPO.getUserId()); + saveParams.put("userUsername", userPO.getUserUsername()); + saveParams.put("B", userPO.getUserName()); + kpiKhxzDdyDao.save(saveParams); + }); + } + + private List listUserId(int khYear, int khMonth) { + Map params = new HashMap<>(); + params.put("khYear", khYear); + params.put("khMonth", khMonth); + return kpiKhxzDdyDao.listUserId(params); + } + +} diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzWgyTask.java b/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzWgyTask.java index 4e5d0ca..9b0f5a4 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzWgyTask.java +++ b/src/main/java/com/cm/bigdata/service/kpi/task/KpiKhxzWgyTask.java @@ -36,7 +36,6 @@ public class KpiKhxzWgyTask { @Autowired private ICommunityBossService communityBossService; - private ExecutorService executorService = Executors.newFixedThreadPool(10); public void update(int khYear, int khMonth, int wgyLevel) { diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyCRunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyCRunnable.java new file mode 100644 index 0000000..476ae92 --- /dev/null +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyCRunnable.java @@ -0,0 +1,60 @@ +package com.cm.bigdata.service.kpi.task.sub; + +import com.cm.bigdata.dao.kpi.IKpiDao; +import com.cm.bigdata.dao.kpi.IKpiKhxzDdyDao; +import com.cm.bigdata.monitor.KpiUpdateMonitor; +import com.cm.bigdata.pojo.pos.kpi.NPersonDayCountPO; +import com.cm.bigdata.utils.KpiUtil; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class KpiKhxzDdyCRunnable implements Runnable{ + + private IKpiKhxzDdyDao kpiKhxzDdyDao; + private IKpiDao kpiDao; + private int khYear; + private int khMonth; + private List userIds; + + public KpiKhxzDdyCRunnable(IKpiKhxzDdyDao kpiKhxzDdyDao, IKpiDao kpiDao, int khYear, int khMonth, List userIds) { + this.kpiKhxzDdyDao = kpiKhxzDdyDao; + this.kpiDao = kpiDao; + this.khYear = khYear; + this.khMonth = khMonth; + this.userIds = userIds; + } + + @Override + public void run() { + List dates = KpiUtil.listDate(khYear, khMonth); + Map params = new HashMap<>(); + userIds.forEach(userId -> { + params.put("userId", userId); + params.put("startTime", dates.get(0)); + params.put("endTime", dates.get(dates.size() - 1)); + List nPersonDayCountPOS = kpiDao.listNPersonDayCountPO(params); + int workDay = 0; + double totalDayScore = 0D; + for (NPersonDayCountPO nPersonDayCountPO : nPersonDayCountPOS) { + totalDayScore += nPersonDayCountPO.getDayScore(); + int isHoliday = nPersonDayCountPO.getIsHoliday(); + if (isHoliday == 1) { + continue; + } + workDay++; + } + double totalScore = workDay == 0 ? 0D : totalDayScore / workDay; + // 保存总分 + Map updateParams = new HashMap<>(); + updateParams.put("khYear", khYear); + updateParams.put("khMonth", khMonth); + updateParams.put("userId", userId); + updateParams.put("C", totalScore); + kpiKhxzDdyDao.updateC(updateParams); + }); + KpiUpdateMonitor.getInstance().complete(); + } + +} diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyERunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyERunnable.java new file mode 100644 index 0000000..008b073 --- /dev/null +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzDdyERunnable.java @@ -0,0 +1,45 @@ +package com.cm.bigdata.service.kpi.task.sub; + +import com.cm.bigdata.dao.kpi.IKpiDao; +import com.cm.bigdata.dao.kpi.IKpiKhxzDdyDao; +import com.cm.bigdata.monitor.KpiUpdateMonitor; +import com.cm.bigdata.pojo.pos.kpi.CasePO; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class KpiKhxzDdyERunnable implements Runnable { + + private IKpiKhxzDdyDao kpiKhxzDdyDao; + private IKpiDao kpiDao; + private int khYear; + private int khMonth; + private List userIds; + + public KpiKhxzDdyERunnable(IKpiKhxzDdyDao kpiKhxzDdyDao, IKpiDao kpiDao, int khYear, int khMonth, List userIds) { + this.kpiKhxzDdyDao = kpiKhxzDdyDao; + this.kpiDao = kpiDao; + this.khYear = khYear; + this.khMonth = khMonth; + this.userIds = userIds; + } + + @Override + public void run() { + Map params = new HashMap<>(); + userIds.forEach(userId -> { + params.put("assignUserId", userId); + List casePOS = kpiDao.listCase(params); + Map updateParams = new HashMap<>(); + updateParams.put("khYear", khYear); + updateParams.put("khMonth", khMonth); + updateParams.put("userId", userId); + updateParams.put("E", casePOS.size()); + updateParams.put("F", casePOS.size() * 10); + kpiKhxzDdyDao.updateEF(updateParams); + }); + KpiUpdateMonitor.getInstance().complete(); + } + +} diff --git a/src/main/java/com/cm/bigdata/utils/ExcelExportUtil.java b/src/main/java/com/cm/bigdata/utils/ExcelExportUtil.java index 83d7aa6..a256369 100644 --- a/src/main/java/com/cm/bigdata/utils/ExcelExportUtil.java +++ b/src/main/java/com/cm/bigdata/utils/ExcelExportUtil.java @@ -13,6 +13,7 @@ public class ExcelExportUtil { response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); String exportName = URLEncoder.encode(fileName, "utf-8"); + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.setHeader("Content-disposition", "attachment;filename=" + exportName + ".xlsx"); EasyExcel.write(response.getOutputStream(), clazz).sheet("sheet1").doWrite(dataList); } diff --git a/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java b/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java index de2f8ba..2e2e8ff 100644 --- a/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java +++ b/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java @@ -5,6 +5,11 @@ public class KpiScoreUtil { private static double WGY_SIGNIN_SCORE = 10D; private static double WGY_SIGNOUT_SCORE = 10D; private static double WGY_DISTANCE_SCORE = 20D; + private static double DDY_SIGNIN_SCORE = 15D; + private static double DDY_SIGNOUT_SCORE = 15D; + private static double ZGY_SIGNIN_SCORE = 15D; + private static double ZGY_SIGNOUT_SCORE = 15D; + public static double getWgyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, double workDistance, int isHoliday) { if (isHoliday == 1) { @@ -25,5 +30,35 @@ public class KpiScoreUtil { return signinScore + signoutScore + distanceScore; } + public static double getDdyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, int isHoliday) { + if (isHoliday == 1) { + return 0; + } + double signinScore = 0D; + double signoutScore = 0D; + if (isSignin == 1) { + signinScore += isSigninLate == 1 ? DDY_SIGNIN_SCORE / 2 : DDY_SIGNIN_SCORE; + } + if (isSignout == 1) { + signoutScore += isSignoutEarly == 1 ? DDY_SIGNOUT_SCORE / 2 : DDY_SIGNOUT_SCORE; + } + return signinScore + signoutScore; + } + + public static double getZgyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, int isHoliday) { + if (isHoliday == 1) { + return 0; + } + double signinScore = 0D; + double signoutScore = 0D; + if (isSignin == 1) { + signinScore += isSigninLate == 1 ? ZGY_SIGNIN_SCORE / 2 : ZGY_SIGNIN_SCORE; + } + if (isSignout == 1) { + signoutScore += isSignoutEarly == 1 ? ZGY_SIGNOUT_SCORE / 2 : ZGY_SIGNOUT_SCORE; + } + return signinScore + signoutScore; + } + } diff --git a/src/main/java/com/cm/bigdata/utils/KpiUtil.java b/src/main/java/com/cm/bigdata/utils/KpiUtil.java index 6b63e81..e1b514c 100644 --- a/src/main/java/com/cm/bigdata/utils/KpiUtil.java +++ b/src/main/java/com/cm/bigdata/utils/KpiUtil.java @@ -19,6 +19,9 @@ import java.util.*; public class KpiUtil { + public static String DDY_ROLE_ID = "72bff485-69be-4570-9f30-ff65fdbe5251"; + public static String ZGY_ROLE_ID = "bc405346-8714-4ded-89ac-9cc4d755f66a"; + public static boolean isdateTimeIn24Hours(String date1, DateTime date2) { date1 = date1.split("\\.")[0]; DateTime date1DateTime = DateTime.parse(date1, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD_HH_MM_SS)); diff --git a/src/main/resources/mybatis/db2-mapper/kpi/user-mapper.xml b/src/main/resources/mybatis/db2-mapper/kpi/user-mapper.xml index 2a8c7c9..eeab13d 100644 --- a/src/main/resources/mybatis/db2-mapper/kpi/user-mapper.xml +++ b/src/main/resources/mybatis/db2-mapper/kpi/user-mapper.xml @@ -57,6 +57,22 @@ sru.role_id = #{roleId} ) + + AND + EXISTS ( + SELECT + 1 + FROM + sys_role_user sru + WHERE + su.user_id = sru.user_id + AND + sru.role_id IN + + #{roleIds[${index}]} + + ) + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/kpi/kpi-config-mapper.xml b/src/main/resources/mybatis/mapper/kpi/kpi-config-mapper.xml new file mode 100644 index 0000000..63f0591 --- /dev/null +++ b/src/main/resources/mybatis/mapper/kpi/kpi-config-mapper.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/kpi/kpi-khxz-ddy-mapper.xml b/src/main/resources/mybatis/mapper/kpi/kpi-khxz-ddy-mapper.xml new file mode 100644 index 0000000..72a4fa1 --- /dev/null +++ b/src/main/resources/mybatis/mapper/kpi/kpi-khxz-ddy-mapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + INSERT INTO kpi_khxz_ddy ( + kh_year, + kh_month, + user_id, + user_username, + B + ) VALUES ( + #{khYear}, + #{khMonth}, + #{userId}, + #{userUsername}, + #{B} + ) + + + + DELETE FROM + kpi_khxz_ddy + WHERE + kh_year = #{khYear} + AND + kh_month = #{khMonth} + + + + + + UPDATE + kpi_khxz_ddy + SET + C = #{C} + WHERE + kh_year = #{khYear} + AND + kh_month = #{khMonth} + AND + user_id = #{userId} + + + + UPDATE + kpi_khxz_ddy + SET + E = #{E}, + F = #{F} + WHERE + kh_year = #{khYear} + AND + kh_month = #{khMonth} + AND + user_id = #{userId} + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/kpi/kpi-khxz-mapper.xml b/src/main/resources/mybatis/mapper/kpi/kpi-khxz-mapper.xml deleted file mode 100644 index 711ba12..0000000 --- a/src/main/resources/mybatis/mapper/kpi/kpi-khxz-mapper.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/kpi/kpi-khxz-wgy-mapper.xml b/src/main/resources/mybatis/mapper/kpi/kpi-khxz-wgy-mapper.xml index 6229d47..5f888de 100644 --- a/src/main/resources/mybatis/mapper/kpi/kpi-khxz-wgy-mapper.xml +++ b/src/main/resources/mybatis/mapper/kpi/kpi-khxz-wgy-mapper.xml @@ -2,6 +2,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO kpi_khxz_wgy_${wgyLevel}( area_id, @@ -31,15 +90,42 @@ kh_month = #{khMonth} - SELECT * FROM kpi_khxz_wgy_${wgyLevel} - WHERE - kh_year = #{khYear} - AND - kh_month = #{khMonth} + + + area_id = #{areaId} + + + AND + community_id = #{communityId} + + + AND ( + B LIKE CONCAT('%', #{keywords}, '%') + OR + user_username LIKE CONCAT('%', #{keywords}, '%') + ) + + + AND + kh_year = #{khYear} + + AND + + kh_month = #{khMonth} + + + AND + user_id IN + + #{userIds[${index}]} + + +