diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java new file mode 100644 index 0000000000..7ffdda964f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java @@ -0,0 +1,72 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; + +import java.util.Objects; + +/** + * @author Administrator + */ + +public enum DateEnum { + /** + * 月份相关枚举 + */ + JAN("01", "1月"), + FEB("02", "2月"), + MAR("03", "3月"), + APR("04", "4月"), + MAY("05", "5月"), + JUN("06", "6月"), + JUL("07", "7月"), + AUG("08", "8月"), + SEP("09", "9月"), + OCT("10", "10月"), + NOV("11", "11月"), + DEC("12", "12月"), + /** + * 季度相关枚举 + */ + Q1("Q1", "第一季度"), + Q2("Q2", "第二季度"), + Q3("Q3", "第三季度"), + Q4("Q4", "第四季度"), + + + UN_KNOWN("0", "未知"); + + private String code; + private String name; + + + DateEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + DateEnum[] dateEnums = values(); + for (DateEnum dateEnum : dateEnums) { + if (Objects.equals(dateEnum.getCode(), code)) { + return dateEnum.getName(); + } + } + return EpmetErrorCode.SERVER_ERROR.getMsg(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java new file mode 100644 index 0000000000..1c7080f4a7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +public class IcPartyUnitCompletionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位ID + */ + @NotNull(message = "单位ID不能为空",groups = AddGroup.class) + private String unitId; + + /** + * 类型 monthly月度,quarter季度 + */ + @NotNull(message = "类型不能为空",groups = AddGroup.class) + private String type; + + /** + * 评分 百分制 + */ + @NotNull(message = "评分不能为空",groups = AddGroup.class) + private String score; + + /** + * 完成情况1已完成,0未完成 + */ + @NotNull(message = "完成情况不能为空",groups = AddGroup.class) + private String status; + + /** + * 年份 + */ + @NotNull(message = "年份不能为空",groups = AddGroup.class) + private String year; + + /** + * 月或季度 + */ + @NotNull(message = "月或季度",groups = AddGroup.class) + private String monthQuarter; + + private String monthQuarterName; + + /** + * 时间 + */ + private String recordDate; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java new file mode 100644 index 0000000000..181074d3b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/17 15:46 + */ +@Data +public class CompletionFormDTO implements Serializable { + private static final long serialVersionUID = 4925867264241549310L; + private String unitId; + private Integer pageNo = 1; + private Integer pageSize = 10; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java new file mode 100644 index 0000000000..bacdc786f6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:34 + */ +@NoArgsConstructor +@Data +public class PointRecordFormDTO implements Serializable { + private static final long serialVersionUID = -5200348821951188343L; + /** + * 服务方类型:社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit + */ + private String serviceType; + /** + * 服务方ID + */ + private String serviceId; + /** + * 开始时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private String startTime; + /** + * 结束时间 + */ + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private String endTime; + private Integer pageNo = 1; + private Integer pageSize = 10; + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java new file mode 100644 index 0000000000..b9c2c1e787 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:30 + */ +@NoArgsConstructor +@Data +public class PointRecordDTO implements Serializable { + private static final long serialVersionUID = 8562346042241117055L; + /** + * 需求类型 + */ + @JsonIgnore + private String categoryCode; + private String categoryName; + /** + * 需求人 + */ + private String demandUserName; + /** + * 需求内容 + */ + private String content; + /** + * 发放积分时间 + */ + private String pointTime; + /** + * 评价 + */ + private String score; + /** + * 积分 + */ + private String point; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java new file mode 100644 index 0000000000..52efbfa253 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.page.PageData; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/1/18 9:28 + */ +@NoArgsConstructor +@Data +public class PointRecordResultDTO implements Serializable { + private static final long serialVersionUID = -2359756064125925616L; + private Integer totalPoint; + private PageData page; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java new file mode 100644 index 0000000000..42dc75a6c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java @@ -0,0 +1,50 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.service.IcPartyUnitCompletionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@RestController +@RequestMapping("icpartyunitcompletion") +public class IcPartyUnitCompletionController { + + @Autowired + private IcPartyUnitCompletionService icPartyUnitCompletionService; + + @PostMapping("list") + public Result> page(@RequestParam CompletionFormDTO formDTO){ + PageData page = icPartyUnitCompletionService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("save") + public Result save(@RequestBody IcPartyUnitCompletionDTO dto){ + //效验数据 + if (StringUtils.isBlank(dto.getUnitId())) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + } + icPartyUnitCompletionService.save(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody IcPartyUnitCompletionDTO dto){ + icPartyUnitCompletionService.delete(dto.getId()); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index e3e9cde3b8..1d14501080 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -25,7 +25,6 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -35,9 +34,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.PointRecordResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -364,5 +365,20 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result().ok(page); } + /** + * 组织单位积分记录 + * + * @Param formDTO + * @Return {@link Result< PointRecordResultDTO>} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + @PostMapping("recordList") + public Result pointRecordList(@LoginUser TokenDto tokenDto, @RequestBody PointRecordFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + PointRecordResultDTO result = icUserDemandRecService.pointRecordList(formDTO); + return new Result().ok(result); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java new file mode 100644 index 0000000000..d99bd42168 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcPartyUnitCompletionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Mapper +public interface IcPartyUnitCompletionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 27eaa8c689..60b437ceb5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -19,13 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.result.PointRecordDTO; import com.epmet.dto.result.demand.*; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -118,4 +117,16 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("type")String type); int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult); + + /** + * 组织单位积分记录 + * + * @Param formDTO + * @Return {@link List< PointRecordDTO>} + * @Author zhaoqifeng + * @Date 2022/1/18 10:33 + */ + List getPointRecordList(PointRecordFormDTO formDTO); + + int getTotalPoint(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java new file mode 100644 index 0000000000..ea4a22feb4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java @@ -0,0 +1,71 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_unit_completion") +public class IcPartyUnitCompletionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 单位ID + */ + private String unitId; + + /** + * 类型 monthly月度,quarter季度 + */ + private String type; + + /** + * 评分 百分制 + */ + private String score; + + /** + * 完成情况1已完成,0未完成 + */ + private String status; + + /** + * 年份 + */ + private String year; + + /** + * 月或季度 + */ + private String monthQuarter; + + /** + * 时间 + */ + private String recordDate; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java new file mode 100644 index 0000000000..730da2c6ea --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java @@ -0,0 +1,46 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.entity.IcPartyUnitCompletionEntity; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +public interface IcPartyUnitCompletionService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2022-01-17 + */ + PageData page(CompletionFormDTO formDTO); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-17 + */ + void save(IcPartyUnitCompletionDTO dto); + + /** + * 删除 + * + * @param id + * @return void + * @author generator + * @date 2022-01-17 + */ + void delete(String id); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 336cd21999..6497e96139 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -20,7 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcUserDemandRecDTO; +import com.epmet.dto.form.PointRecordFormDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.PointRecordResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; @@ -224,4 +226,13 @@ public interface IcUserDemandRecService extends BaseService search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize); + + /** + * 组织单位积分记录 + * @Param formDTO + * @Return {@link PointRecordResultDTO} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java new file mode 100644 index 0000000000..ebfd7fd8c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java @@ -0,0 +1,86 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.DateEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcPartyUnitCompletionDao; +import com.epmet.dto.IcPartyUnitCompletionDTO; +import com.epmet.dto.IcPartyUnitDTO; +import com.epmet.dto.form.CompletionFormDTO; +import com.epmet.entity.IcPartyUnitCompletionEntity; +import com.epmet.service.IcPartyUnitCompletionService; +import com.epmet.service.IcPartyUnitService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +/** + * 联建单位完成情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-01-17 + */ +@Service +public class IcPartyUnitCompletionServiceImpl extends BaseServiceImpl implements IcPartyUnitCompletionService { + + @Resource + private IcPartyUnitService icPartyUnitService; + + @Override + public PageData page(CompletionFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getUnitId())) { + return new PageData<>(Collections.emptyList(), NumConstant.ZERO); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId()); + wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitCompletionDTO.class); + + if(CollectionUtils.isNotEmpty(dtoList)) { + dtoList.forEach(item -> { + item.setMonthQuarterName(DateEnum.getName(item.getMonthQuarter())); + }); + } + + return new PageData<>(dtoList, pageInfo.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyUnitCompletionDTO dto) { + IcPartyUnitCompletionEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitCompletionEntity.class); + if (StringUtils.isNotBlank(dto.getYear()) && StringUtils.isNotBlank(dto.getMonthQuarter())) { + entity.setRecordDate(dto.getYear().concat(dto.getMonthQuarter())); + } + if(StringUtils.isBlank(dto.getId())) { + IcPartyUnitDTO unity = icPartyUnitService.get(dto.getUnitId()); + entity.setCustomerId(unity.getCustomerId()); + entity.setAgencyId(unity.getAgencyId()); + entity.setPids(unity.getPids()); + insert(entity); + } else { + updateById(entity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index f7034a63ee..4bf7846cd0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1644,5 +1644,45 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, new PageInfo<>(list).getTotal()); } + + /** + * 组织单位积分记录 + * + * @param formDTO + * @Param formDTO + * @Return {@link PointRecordResultDTO} + * @Author zhaoqifeng + * @Date 2022/1/18 9:45 + */ + @Override + public PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO) { + PointRecordResultDTO result = new PointRecordResultDTO(); + + if (StringUtils.isBlank(formDTO.getServiceId())) { + result.setTotalPoint(NumConstant.ZERO); + result.setPage(new PageData<>(Collections.emptyList(), NumConstant.ZERO)); + } + + //总积分 + result.setTotalPoint(baseDao.getTotalPoint(formDTO)); + //分页查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPointRecordList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //查询分类名称 + List categoryCodes = list.stream().map(PointRecordDTO::getCategoryCode).collect(Collectors.toList()); + List dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + list.forEach(item -> { + if (dictMap.containsKey(item.getCategoryCode())) { + item.setCategoryName(dictMap.get(item.getCategoryCode())); + } + }); + } + result.setPage(new PageData<>(list, pageInfo.getTotal())); + + return result; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql new file mode 100644 index 0000000000..7493e63f53 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql @@ -0,0 +1,22 @@ +CREATE TABLE `ic_party_unit_completion` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PIDS` varchar(255) NOT NULL, + `UNIT_ID` varchar(64) NOT NULL COMMENT '单位ID', + `TYPE` varchar(10) NOT NULL COMMENT '类型 monthly月度,quarter季度', + `SCORE` varchar(5) NOT NULL COMMENT '评分 百分制', + `STATUS` varchar(1) NOT NULL COMMENT '完成情况1已完成,0未完成', + `YEAR` varchar(4) NOT NULL COMMENT '年份', + `MONTH_QUARTER` varchar(4) NOT NULL COMMENT '月或季度', + `RECORD_DATE` varchar(12) NOT NULL COMMENT '时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='联建单位完成情况'; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml new file mode 100644 index 0000000000..2dd26ab7a2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index b59fa44be5..eb1260f58b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -572,4 +572,50 @@ UPDATED_TIME=NOW() where id=#{demandRecId} + + + \ No newline at end of file