diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql new file mode 100644 index 0000000000..aa7b268044 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql @@ -0,0 +1,5 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509011061993473', 'jmreport_category', '报表应用类别', '居民信息、房屋信息', 32, 0, 0, '1', '2022-08-08 13:14:01', '1', '2022-08-08 13:14:01'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509175185108994', 1556509011061993473, '房屋信息', 'house_info', '0', '', 2, 0, 0, '1', '2022-08-08 13:14:41', '1', '2022-08-08 13:14:41'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509102015475714', 1556509011061993473, '居民信息', 'resi_info', '0', '', 1, 0, 0, '1', '2022-08-08 13:14:23', '1', '2022-08-08 13:14:23'); diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java new file mode 100644 index 0000000000..0c5dfb97ef --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java @@ -0,0 +1,14 @@ +package com.epmet.commons.feignclient.feigns; + +import com.epmet.commons.feignclient.feigns.fallback.JiMuReportOpenFeignClientFallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * @Author zxc + * @DateTime 2022/8/8 13:52 + * @DESC + */ +@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallback.class) +public interface JiMuReportOpenFeignClient { +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java new file mode 100644 index 0000000000..f1ca95d23d --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java @@ -0,0 +1,11 @@ +package com.epmet.commons.feignclient.feigns.fallback; + +import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; + +/** + * @Author zxc + * @DateTime 2022/8/8 13:53 + * @DESC + */ +public class JiMuReportOpenFeignClientFallback implements JiMuReportOpenFeignClient { +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 221d7d3f69..61a428a953 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -143,4 +143,9 @@ public interface ServiceConstant { * 聚合查询服务 */ String DATA_AGGREGATOR_SERVER = "data-aggregator-server"; + + /** + * + */ + String EPMET_JM_REPORT = "epmet-jmreport-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java index 1880debe42..88adefbd17 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java @@ -1,6 +1,8 @@ package com.epmet.commons.tools.dto.form; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; @@ -9,6 +11,8 @@ import javax.validation.constraints.NotBlank; * @Author sun */ @Data +@AllArgsConstructor +@NoArgsConstructor public class DictListFormDTO { /** diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PreviewReportFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PreviewReportFormDTO.java new file mode 100644 index 0000000000..c38eb53b1c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/PreviewReportFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Map; + +/** + * @Description + * @Author yzm + * @Date 2022/8/8 13:31 + */ +@Data +public class PreviewReportFormDTO { + public interface AddUserInternalGroup { + } + + @NotBlank(message = "reportId不能为空", groups = AddUserInternalGroup.class) + private String reportId; + @NotBlank(message = "categoryKey不能为空", groups = AddUserInternalGroup.class) + private String categoryKey; + private Map paramMap; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "staffId不能为空", groups = AddUserInternalGroup.class) + private String staffId; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java new file mode 100644 index 0000000000..d1e72f7d15 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/8 14:04 + * @DESC + */ +@Data +public class ReportEditFormDTO implements Serializable { + + private static final long serialVersionUID = -2157859106926125470L; + + public interface ReportEditForm{} + + /** + * 操作类型,批量操作:add;单个编辑:edit + */ + @NotBlank(message = "type不能为空", groups = ReportEditForm.class) + private String type; + + @NotBlank(message = "reportId不能为空", groups = ReportEditForm.class) + private String reportId; + + private List customerIds; + + private List categoryKeys; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/PreviewReportResDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/PreviewReportResDTO.java new file mode 100644 index 0000000000..aaff6e933b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/PreviewReportResDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/8/8 13:37 + */ +@Data +public class PreviewReportResDTO { + private String reportId; + /** + * rediskey格式:customerId:reportId:resiinfo:staffId + */ + private String paramKey; +} + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java new file mode 100644 index 0000000000..0667a0c226 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java @@ -0,0 +1,84 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/8 10:29 + * @DESC + */ +@Data +public class ReportResultDTO implements Serializable { + + private static final long serialVersionUID = -5798816843431200300L; + + /** + * 报表名字 + */ + private String reportName; + + /** + * 报表ID + */ + private String reportId; + + /** + * 客户ID + */ + @JsonIgnore + private String customerId; + + /** + * 客户名字 + */ + @JsonIgnore + private String customerName; + + /** + * 分类名字 + */ + @JsonIgnore + private String categoryName; + + /** + * 分类key + */ + @JsonIgnore + private String categoryKey; + + /** + * 客户信息集合 + */ + private List customerList; + + + @Data + public static class CustomerList implements Serializable{ + + private static final long serialVersionUID = 7146198312265513418L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名字 + */ + private String customerName; + + /** + * 分类名字 + */ + private String categoryName; + + /** + * 分类key + */ + private String categoryKey; + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java index dc347a7c53..5d41b4453c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java @@ -23,5 +23,7 @@ public interface CustomerFunctionConstant { */ String PARAMETER_EXCEPTION = "请至少勾选一条默认功能或定制功能数据"; + String REPORT_CATEGORY = "jmreport_category"; + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java index 59725b2cad..922bf28af4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java @@ -1,19 +1,21 @@ package com.epmet.controller; -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; 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.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.IcCustomerReportDTO; +import com.epmet.dto.form.PreviewReportFormDTO; +import com.epmet.dto.form.ReportEditFormDTO; +import com.epmet.dto.result.PreviewReportResDTO; +import com.epmet.dto.result.ReportResultDTO; import com.epmet.service.IcCustomerReportService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import java.util.Map; +import java.util.List; /** @@ -29,41 +31,42 @@ public class IcCustomerReportController { @Autowired private IcCustomerReportService icCustomerReportService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icCustomerReportService.page(params); - return new Result>().ok(page); - } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - IcCustomerReportDTO data = icCustomerReportService.get(id); - return new Result().ok(data); + /** + * Desc: 报表集合 + * @param + * @author zxc + * @date 2022/8/8 10:38 + */ + @PostMapping("list") + public Result> reportList(){ + return new Result>().ok(icCustomerReportService.reportList()); } - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody IcCustomerReportDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icCustomerReportService.save(dto); - return new Result(); - } - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody IcCustomerReportDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - icCustomerReportService.update(dto); - return new Result(); + /** + * 在居民信息或者房屋信息等页面点击填表,存储入参到redis,返给前端key + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("preview") + public Result previewReport(@LoginUser TokenDto tokenDto, @RequestBody PreviewReportFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, PreviewReportFormDTO.AddUserInternalGroup.class); + return new Result().ok(icCustomerReportService.previewReport(formDTO)); } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - icCustomerReportService.delete(ids); + /** + * Desc: 报表编辑 + * @param formDTO + * @author zxc + * @date 2022/8/8 14:09 + */ + @PostMapping("edit") + public Result reportEdit(@RequestBody ReportEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ReportEditFormDTO.ReportEditForm.class); + icCustomerReportService.reportEdit(formDTO); return new Result(); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java index 32068db46a..52513402d2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java @@ -1,9 +1,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 客户报表关系表 * @@ -12,5 +15,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcCustomerReportDao extends BaseDao { - + + /** + * Desc: 报表集合 + * @param + * @author zxc + * @date 2022/8/8 10:38 + */ + List reportList(); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcCustomerReportService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcCustomerReportService.java index 4f6f9af2cd..372dfa5bed 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcCustomerReportService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcCustomerReportService.java @@ -1,12 +1,15 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.PreviewReportFormDTO; +import com.epmet.dto.result.PreviewReportResDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcCustomerReportDTO; +import com.epmet.dto.form.ReportEditFormDTO; +import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; import java.util.List; -import java.util.Map; /** * 客户报表关系表 @@ -17,62 +20,25 @@ import java.util.Map; public interface IcCustomerReportService extends BaseService { /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-08-08 + * Desc: 报表集合 + * @param + * @author zxc + * @date 2022/8/8 10:38 */ - PageData page(Map params); + List reportList(); /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-08-08 + * 在居民信息或者房屋信息等页面点击填表,存储入参到redis,返给前端key + * @param formDTO + * @return */ - List list(Map params); + PreviewReportResDTO previewReport(PreviewReportFormDTO formDTO); /** - * 单条查询 - * - * @param id - * @return IcCustomerReportDTO - * @author generator - * @date 2022-08-08 + * Desc: 报表编辑 + * @param formDTO + * @author zxc + * @date 2022/8/8 14:09 */ - IcCustomerReportDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-08-08 - */ - void save(IcCustomerReportDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-08-08 - */ - void update(IcCustomerReportDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-08-08 - */ - void delete(String[] ids); + void reportEdit(ReportEditFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index 9350625c0d..02223c703d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -1,22 +1,37 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CustomerFunctionConstant; import com.epmet.dao.IcCustomerReportDao; +import com.epmet.dto.CustomerDTO; +import com.epmet.dto.form.PreviewReportFormDTO; +import com.epmet.dto.result.PreviewReportResDTO; import com.epmet.dto.IcCustomerReportDTO; +import com.epmet.dto.form.ReportEditFormDTO; +import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.IcCustomerReportService; +import org.apache.commons.collections4.CollectionUtils; 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.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 客户报表关系表 @@ -26,22 +41,14 @@ import java.util.Map; */ @Service public class IcCustomerReportServiceImpl extends BaseServiceImpl implements IcCustomerReportService { + @Autowired + private RedisUtils redisUtils; - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcCustomerReportDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; - return ConvertUtils.sourceToTarget(entityList, IcCustomerReportDTO.class); - } private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -52,31 +59,71 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportList() { + List reportList = baseDao.reportList(); + if (CollectionUtils.isEmpty(reportList)){ + return new ArrayList<>(); + } + Result> dictList = adminOpenFeignClient.dictList(new DictListFormDTO(CustomerFunctionConstant.REPORT_CATEGORY)); + if (!dictList.success()){ + throw new EpmetException("查询字典信息失败:" + CustomerFunctionConstant.REPORT_CATEGORY); + } + if (CollectionUtils.isNotEmpty(dictList.getData())){ + dictList.getData().forEach(d -> reportList.stream().filter(r -> d.getValue().equals(r.getCategoryKey())).forEach(r -> r.setCategoryName(d.getLabel()))); + } + Result> allCustomerList = operCrmOpenFeignClient.getAllCustomerList(); + if (!allCustomerList.success()){ + throw new EpmetException("获取客户信息失败..."); + } + if (CollectionUtils.isNotEmpty(allCustomerList.getData())){ + allCustomerList.getData().forEach(c -> reportList.stream().filter(r -> c.getId().equals(r.getCustomerId())).forEach(r -> r.setCustomerName(c.getCustomerName()))); + } + // todo 报表 + List result = new ArrayList<>(); + Map> groupByReport = reportList.stream().collect(Collectors.groupingBy(ReportResultDTO::getReportId)); + groupByReport.forEach((reportId,l) -> { + ReportResultDTO dto = new ReportResultDTO(); + dto.setReportId(reportId); + dto.setReportName(l.get(NumConstant.ZERO).getReportName()); + dto.setCustomerList(ConvertUtils.sourceToTarget(l, ReportResultDTO.CustomerList.class)); + result.add(dto); + }); + return result; } + /** + * 在居民信息或者房屋信息等页面点击填表,存储入参到redis,返给前端key + * + * @param formDTO + * @return + */ @Override - @Transactional(rollbackFor = Exception.class) - public void save(IcCustomerReportDTO dto) { - IcCustomerReportEntity entity = ConvertUtils.sourceToTarget(dto, IcCustomerReportEntity.class); - insert(entity); + public PreviewReportResDTO previewReport(PreviewReportFormDTO formDTO) { + // rediskey格式:customerId:reportId:resiinfo:staffId + PreviewReportResDTO reportResDTO = new PreviewReportResDTO(); + reportResDTO.setReportId(formDTO.getReportId()); + String key = formDTO.getCustomerId().concat(StrConstant.COLON).concat(formDTO.getReportId()).concat(StrConstant.COLON).concat(formDTO.getCategoryKey()).concat(StrConstant.COLON).concat(formDTO.getStaffId()); + redisUtils.hMSet(key, formDTO.getParamMap(), RedisUtils.DEFAULT_EXPIRE); + return reportResDTO; } - @Override + /** + * Desc: 报表编辑 + * @param formDTO + * @author zxc + * @date 2022/8/8 14:09 + */ @Transactional(rollbackFor = Exception.class) - public void update(IcCustomerReportDTO dto) { - IcCustomerReportEntity entity = ConvertUtils.sourceToTarget(dto, IcCustomerReportEntity.class); - updateById(entity); - } - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); + public void reportEdit(ReportEditFormDTO formDTO) { + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml index 9e4b9347a2..2336b1dc3d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml @@ -3,4 +3,15 @@ + + \ No newline at end of file