diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java index 00867ccbb2..1663f19881 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java @@ -81,6 +81,11 @@ public class IcPartyMemberPointDTO implements Serializable { */ private String warnOptions; + /** + * 总分 + */ + private Integer totalScore; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java index 2334c7bd64..5055126aec 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.partymember.dto.partymember.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -9,7 +10,7 @@ import java.io.Serializable; @Data @AllArgsConstructor @NoArgsConstructor -public class PartyMemberPointListFormDTO implements Serializable { +public class PartyMemberPointListFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = 5659445492756209830L; diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java index 870672e9aa..ff27a4b5b3 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointListResultDTO.java @@ -43,21 +43,41 @@ public class PartyMemberPointListResultDTO implements Serializable { */ private Integer basePoint; + /** + * 基础选项 + */ + private String baseOptions; + /** * 民主评议积分分值 */ private Integer reviewPoint; + /** + * 民主评议选项 + */ + private String reviewOptions; + /** * 激励积分分值 */ private Integer inspirePoint; + /** + * 激励积分选项 + */ + private String inspireOptions; + /** * 警示扣分分值 */ private Integer warnPoint; + /** + * 警示扣分选项 + */ + private String warnOptions; + /** * 备注 */ @@ -68,4 +88,15 @@ public class PartyMemberPointListResultDTO implements Serializable { */ private String year; + /** + * 季度 + */ + private Integer quarter; + + + /** + * id + */ + private String partyMemberId; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java index 86a8571efe..21d1f79824 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java @@ -115,7 +115,7 @@ public class IcPartyMemberPointController { * @date 2022/5/24 14:26 */ @PostMapping("export") - public void export(@RequestBody PartyMemberExportFormDTO formDto,@LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { + public void export(@RequestBody PartyMemberPointListFormDTO formDto, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { formDto.setIsPage(false); formDto.setPageSize(NumConstant.TEN_THOUSAND); @@ -126,10 +126,10 @@ public class IcPartyMemberPointController { try { String fileName = "lhjf.xlsx"; excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyMemberPointExcel.class).build(); - PageData page = null; + PageData page = null; WriteSheet writeSheet = EasyExcel.writerSheet("量化积分").registerWriteHandler(new FreezeAndFilter()).build(); do { - page = icPartyMemberPointService.getExport(formDto,tokenDto.getCustomerId()); + page = icPartyMemberPointService.getExport(formDto, tokenDto); List list = ConvertUtils.sourceToTarget(page.getList(), IcPartyMemberPointExcel.class); list.forEach(item -> { item.setIndex(i.getAndIncrement()); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java index 4f30eb9a51..f7a36ea435 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java @@ -40,4 +40,6 @@ public interface IcPartyMemberPointDao extends BaseDao List getExport(@Param("form") PartyMemberExportFormDTO form, @Param("customerId") String customerId); + + void updateMember(@Param("partyMemberId") String partyMemberId, @Param("totalScore") Integer totalScore); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java index 56292ffef3..1f6a367d80 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyMemberEntity.java @@ -121,7 +121,7 @@ public class IcPartyMemberEntity extends BaseEpmetEntity { /** * 预留字段1 */ - private String field1; + private Integer totalScore; /** * 预留字段2 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java index e5dc272955..f042565a97 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyMemberPointExcel.java @@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; +import kotlin.ExperimentalUnsignedTypes; import lombok.Data; import javax.validation.Valid; @@ -32,46 +33,75 @@ public class IcPartyMemberPointExcel { @ExcelProperty(value = "党员ID",order = 2) private String partyMemberId; + /** + * 所属党组织 + */ @ColumnWidth(20) - @ExcelProperty(value = "年份",order = 3) - private String year; + @ExcelProperty(value = "所属党组织",order = 3) + private String partyOrg; + + /** + * 姓名 + */ + @ColumnWidth(20) + @ExcelProperty(value = "姓名",order = 4) + private String name; + /** + * 手机号 + */ @ColumnWidth(20) - @ExcelProperty(value = "季度",order = 4) + @ExcelProperty(value = "手机号",order = 5) + private String mobile; + + /** + * 身份证号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "身份证号",order = 6) + private String idCard; + + @ColumnWidth(20) + @ExcelProperty(value = "年份",order = 7) + private String year; + + @ExcelIgnore private String quarter; @ColumnWidth(20) - @ExcelProperty(value = "基础积分分值",order = 5) + @ExcelProperty(value = "基础积分分值",order = 8) private Integer basePoint; - @ColumnWidth(20) - @ExcelProperty(value = "基础积分选项 英文逗号隔开",order = 6) + @ExcelIgnore private String baseOptions; @ColumnWidth(20) - @ExcelProperty(value = "民主评议积分分值",order = 7) + @ExcelProperty(value = "民主评议积分分值",order = 9) private Integer reviewPoint; - @ColumnWidth(20) - @ExcelProperty(value = "民主评议积分选项",order = 8) + @ExcelIgnore private String reviewOptions; @ColumnWidth(20) - @ExcelProperty(value = "激励积分分值",order = 9) + @ExcelProperty(value = "激励积分分值",order = 10) private Integer inspirePoint; - @ColumnWidth(20) - @ExcelProperty(value = "激励积分选项",order = 10) + @ExcelIgnore private String inspireOptions; @ColumnWidth(20) @ExcelProperty(value = "警示扣分分值",order = 11) private Integer warnPoint; - @ColumnWidth(20) - @ExcelProperty(value = "警示扣分选项",order = 12) + @ExcelIgnore private String warnOptions; + @ColumnWidth(20) + @ExcelProperty(value = "总分" ,order = 12) + private Integer totalScore; + + + @ExcelIgnore private Integer delFlag; diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java index 29db1db7bb..e35838aa38 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java @@ -113,5 +113,5 @@ public interface IcPartyMemberPointService extends BaseService getExport(PartyMemberExportFormDTO form,String customerId); + PageData getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java index 1ea27ad263..62a91aa312 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java @@ -81,6 +81,13 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl 0) { + dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + } else { + dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + } + baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); insert(entity); } @@ -111,36 +118,9 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) { List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); - List count = baseDao.getListCount(form.getYear(), tokenDto.getCustomerId()); - // 处理统计的平均值 - for (int i = 0; i < dto.size(); i++) { - // 基础积分分值平均值 - if (dto.get(i).getBasePoint() != null && count.get(i).getBasePointCount() != NumConstant.ZERO) { - dto.get(i).setBasePoint(dto.get(i).getBasePoint() / count.get(i).getBasePointCount()); - } else { - dto.get(i).setBasePoint(NumConstant.ZERO); - } - // 民主评议积分分值 - if (dto.get(i).getInspirePoint() != null && count.get(i).getInspirePointCount() != NumConstant.ZERO) { - dto.get(i).setInspirePoint(dto.get(i).getInspirePoint() / count.get(i).getInspirePointCount()); - } else { - dto.get(i).setInspirePoint(NumConstant.ZERO); - } - // 激励积分分值 - if (dto.get(i).getReviewPoint() != null && count.get(i).getReviewPointCount() != NumConstant.ZERO) { - dto.get(i).setReviewPoint(dto.get(i).getReviewPoint() / count.get(i).getReviewPointCount()); - } else { - dto.get(i).setReviewPoint(NumConstant.ZERO); - } - // 警示扣分分值 - if (dto.get(i).getWarnPoint() != null && count.get(i).getWarnPointCount() != NumConstant.ZERO) { - dto.get(i).setWarnPoint(dto.get(i).getWarnPoint() / count.get(i).getWarnPointCount()); - } else { - dto.get(i).setWarnPoint(NumConstant.ZERO); - } - // 总分 - dto.get(i).setTotalScore(dto.get(i).getBasePoint() + dto.get(i).getInspirePoint() + dto.get(i).getReviewPoint() + dto.get(i).getWarnPoint()); - } + dto.forEach(item -> { + item.setTotalScore(item.getTotalScore() / item.getQuarter()); + }); return dto; } @@ -167,11 +147,15 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl getExport(PartyMemberExportFormDTO form,String customerId) { + public PageData getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto) { PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); - List dto = baseDao.getExport(form,customerId); - - PageInfo pageInfo = new PageInfo<>(dto); + List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), + form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); + // 算总分 + dto.forEach(item -> { + item.setTotalScore(item.getTotalScore() / item.getQuarter()); + }); + PageInfo pageInfo = new PageInfo<>(dto); return new PageData<>(dto, pageInfo.getTotal()); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml index 1339a5c68f..376495d6d7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml @@ -2,17 +2,26 @@ + + UPDATE ic_party_member + SET TOTAL_SCORE = #{totalScore} + WHERE + id = #{partyMemberId} +