diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java index 0c43a0ae97..949522d31d 100644 --- a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/CaWghDataConstant.java @@ -13,6 +13,7 @@ public interface CaWghDataConstant { String TABLESCHEMA_UNICOM = "unicom"; String TABLESCHEMA_SHARE = "share"; + String TABLESCHEMA_WGH = "wgh"; String UNICOM_PINGFANG = "ca_pingfang"; @@ -32,7 +33,7 @@ public interface CaWghDataConstant { String SHARE_WGH_JQZ = "wgh_jqz"; String SHARE_WGH_JXCS = "wgh_jxcs"; String SHARE_WGH_JYZ = "wgh_jyz"; - String SHARE_WGH_SJXX = "wgh_sjxxb"; + String SHARE_WGH_SJXXB = "wgh_sjxxb"; String SHARE_WGH_SQXX = "wgh_sqxx"; String SHARE_WGH_SZCGWGH = "wgh_szcgwgh"; String SHARE_WGH_SZZRWG = "wgh_szzrwg"; @@ -40,9 +41,14 @@ public interface CaWghDataConstant { String SHARE_WGH_YJBMCS = "wgh_yjbmcs"; String SHARE_WGH_YQHJZ = "wgh_yqhjz"; + + String SHARE_WGH_SJXX = "wgh_sjxx"; + String DATA_URL_UNICON = "http://120.221.72.83:9090/bridge/unicom/page"; String DATA_URL_SHARE = "http://120.221.72.83:9090/bridge/share/sharePage"; + String DATA_URL_WGH = "http://120.221.72.83:9090/bridge/wgh/wghPage"; String UNICOM_CONDITION = "unicomCondition"; String SHARE_CONDITION = "shareCondition"; + String WGH_CONDITION = "wghCondition"; } diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/wgh/WghSjxxDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/wgh/WghSjxxDTO.java new file mode 100644 index 0000000000..1b0951fcc5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/wgh/WghSjxxDTO.java @@ -0,0 +1,330 @@ +package com.epmet.opendata.dto.wgh; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Data +public class WghSjxxDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 案卷标识 + */ + private Integer recid; + + /** + * 事件编号 + */ + private String sjbh; + + /** + * 事件领域 + */ + private String sjlyu; + + /** + * 事件大类 + */ + private String sjdl; + + /** + * 事件小类 + */ + private String sjxl; + + /** + * 事件细类 + */ + private String sjxil; + + /** + * 事件来源 + */ + private String sjly; + + /** + * 所属区/市 + */ + private String ssqs; + + /** + * 所属街道 + */ + private String ssjd; + + /** + * 所属社区 + */ + private String sssq; + + /** + * 事件地址 + */ + private String sjdz; + + /** + * 事件描述 + */ + private String sjms; + + /** + * 网格员标识 + */ + private String wgybs; + + /** + * 网格员名称 + */ + private String wgymc; + + /** + * 所属部门 + */ + private String ssbm; + + /** + * X坐标 + */ + private BigDecimal xzb; + + /** + * Y坐标 + */ + private BigDecimal yzb; + + /** + * 核实意见 + */ + private String hsyj; + + /** + * 创建日期 + */ + private Date createdate; + + /** + * 事件领域标签 + */ + private String sjlyubq; + + /** + * 事件大类标签 + */ + private String sjdlbq; + + /** + * 事件小类标签 + */ + private String sjxlbq; + + /** + * 事件细类标签 + */ + private String sjxilbq; + + /** + * 所属区/市标签 + */ + private String ssqsbq; + + /** + * 所属街道标签 + */ + private String ssjdbq; + + /** + * 所属社区标签 + */ + private String sssqbq; + + /** + * 事件上报 + */ + private String sjsbwj; + + /** + * 事件核实 + */ + private String sjhswj; + + /** + * 事件处置 + */ + private String sjczwj; + + /** + * 事件核查 + */ + private String sjhcwj; + + /** + * 外系统唯一标识 + */ + private String wxtwybs; + + /** + * 缩略图 + */ + private String slt; + + /** + * 处置单位 + */ + private Integer czdw; + + /** + * 处置结果 + */ + private String czjg; + + /** + * 处置单位标签 + */ + private String czdwbq; + + /** + * 是否退单 + */ + private Integer sftd; + + /** + * 是否延期 + */ + private Integer sfyq; + + /** + * 核查意见 + */ + private String hcyj; + + /** + * 是否作废 + */ + private Integer sfzf; + + /** + * 是否已核实 + */ + private Integer sfyhs; + + /** + * 是否已核查 + */ + private Integer sfyhc; + + /** + * 是否已督办 + */ + private Integer sfydb; + + /** + * 专项任务标识 + */ + private Integer zxrwbs; + + /** + * 待确责 + */ + private Integer dqz; + + /** + * 熔断状态 + */ + private Integer rdzt; + + /** + * 事件来源标签 + */ + private String sjlybq; + + /** + * 应办结时间 + */ + private Date ybjsj; + + /** + * 接收部门标识 + */ + private Integer jsbmbs; + + /** + * 核实人员标识 + */ + private Integer hsrybs; + + /** + * 核查人员标识 + */ + private Integer hcrybs; + + /** + * 处置人员标识 + */ + private Integer czrybs; + + /** + * 是否已处置 + */ + private Integer sfycz; + + /** + * 核实时间 + */ + private Date hssj; + + /** + * 核查时间 + */ + private Date hcsj; + + /** + * 处置时间 + */ + private Date czsj; + + /** + * 是否自发自处 + */ + private Integer sfzfzc; + + /** + * 核查用时 + */ + private BigDecimal hcys; + + /** + * 诉求联系人 + */ + private String sqlxr; + + /** + * 僵尸车 + */ + private Integer jsc; + + /** + * 到期时间 + */ + private Date dqsj; + + /** + * 星级评定 + */ + private Integer xjpd; + + /** + * 所属网格 + */ + private String sswg; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxController.java new file mode 100644 index 0000000000..c56867a32a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxController.java @@ -0,0 +1,96 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +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.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; + +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.wgh.WghSjxxDTO; +import com.epmet.opendata.excel.WghSjxxExcel; +import com.epmet.opendata.service.WghSjxxService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@RestController +@RequestMapping("wghSjxx") +public class WghSjxxController { + + @Autowired + private WghSjxxService wghSjxxService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = wghSjxxService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + WghSjxxDTO data = wghSjxxService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody WghSjxxDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wghSjxxService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody WghSjxxDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wghSjxxService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wghSjxxService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wghSjxxService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WghSjxxExcel.class); + } + + /** + * 调用ruoyi接口获取wgh_sjxxb数据 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/7/5 14:17 + */ + @PostMapping("/wgh/getWghSjxx") + public Result getWghSjxx(@RequestBody PreserVationFormDTO dto) { + wghSjxxService.getWghSjxx(dto); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java index a09e7b69cf..729ae19926 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java @@ -86,7 +86,7 @@ public class WghSjxxbController { } /** - * 调用ruoyi接口获取wgh_sjxx数据 + * 调用ruoyi接口获取wgh_sjxxb数据 * * @param dto * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/WghSjxxDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/WghSjxxDao.java new file mode 100644 index 0000000000..7d9c9891e7 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/WghSjxxDao.java @@ -0,0 +1,26 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.opendata.entity.WghSjxxEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Mapper +public interface WghSjxxDao extends BaseDao { + + /** + * 全量删除 + * + * @param + * @return int + * @author LZN + * @date 2022/7/5 14:18 + */ + int deleteAll(); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/WghSjxxEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/WghSjxxEntity.java new file mode 100644 index 0000000000..6b712eed8d --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/WghSjxxEntity.java @@ -0,0 +1,335 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wgh_sjxx") +public class WghSjxxEntity { + + private static final long serialVersionUID = 1L; + + /** + * 案卷标识 + */ + private Integer recid; + + /** + * 事件编号 + */ + private String sjbh; + + /** + * 事件领域 + */ + private String sjlyu; + + /** + * 事件大类 + */ + private String sjdl; + + /** + * 事件小类 + */ + private String sjxl; + + /** + * 事件细类 + */ + private String sjxil; + + /** + * 事件来源 + */ + private String sjly; + + /** + * 所属区/市 + */ + private String ssqs; + + /** + * 所属街道 + */ + private String ssjd; + + /** + * 所属社区 + */ + private String sssq; + + /** + * 事件地址 + */ + private String sjdz; + + /** + * 事件描述 + */ + private String sjms; + + /** + * 网格员标识 + */ + private String wgybs; + + /** + * 网格员名称 + */ + private String wgymc; + + /** + * 所属部门 + */ + private String ssbm; + + /** + * X坐标 + */ + private BigDecimal xzb; + + /** + * Y坐标 + */ + private BigDecimal yzb; + + /** + * 核实意见 + */ + private String hsyj; + + /** + * 创建日期 + */ + private Date createdate; + + /** + * 事件领域标签 + */ + private String sjlyubq; + + /** + * 事件大类标签 + */ + private String sjdlbq; + + /** + * 事件小类标签 + */ + private String sjxlbq; + + /** + * 事件细类标签 + */ + private String sjxilbq; + + /** + * 所属区/市标签 + */ + private String ssqsbq; + + /** + * 所属街道标签 + */ + private String ssjdbq; + + /** + * 所属社区标签 + */ + private String sssqbq; + + /** + * 事件上报 + */ + private String sjsbwj; + + /** + * 事件核实 + */ + private String sjhswj; + + /** + * 事件处置 + */ + private String sjczwj; + + /** + * 事件核查 + */ + private String sjhcwj; + + /** + * 外系统唯一标识 + */ + private String wxtwybs; + + /** + * 缩略图 + */ + private String slt; + + /** + * 处置单位 + */ + private Integer czdw; + + /** + * 处置结果 + */ + private String czjg; + + /** + * 处置单位标签 + */ + private String czdwbq; + + /** + * 是否退单 + */ + private Integer sftd; + + /** + * 是否延期 + */ + private Integer sfyq; + + /** + * 核查意见 + */ + private String hcyj; + + /** + * 是否作废 + */ + private Integer sfzf; + + /** + * 是否已核实 + */ + private Integer sfyhs; + + /** + * 是否已核查 + */ + private Integer sfyhc; + + /** + * 是否已督办 + */ + private Integer sfydb; + + /** + * 专项任务标识 + */ + private Integer zxrwbs; + + /** + * 待确责 + */ + private Integer dqz; + + /** + * 熔断状态 + */ + private Integer rdzt; + + /** + * 事件来源标签 + */ + private String sjlybq; + + /** + * 应办结时间 + */ + private Date ybjsj; + + /** + * 接收部门标识 + */ + private Integer jsbmbs; + + /** + * 核实人员标识 + */ + private Integer hsrybs; + + /** + * 核查人员标识 + */ + private Integer hcrybs; + + /** + * 处置人员标识 + */ + private Integer czrybs; + + /** + * 是否已处置 + */ + private Integer sfycz; + + /** + * 核实时间 + */ + private Date hssj; + + /** + * 核查时间 + */ + private Date hcsj; + + /** + * 处置时间 + */ + private Date czsj; + + /** + * 是否自发自处 + */ + private Integer sfzfzc; + + /** + * 核查用时 + */ + private BigDecimal hcys; + + /** + * 诉求联系人 + */ + private String sqlxr; + + /** + * 僵尸车 + */ + private Integer jsc; + + /** + * 到期时间 + */ + private Date dqsj; + + /** + * 星级评定 + */ + private Integer xjpd; + + /** + * 所属网格 + */ + private String sswg; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/WghSjxxExcel.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/WghSjxxExcel.java new file mode 100644 index 0000000000..e676083ab0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/excel/WghSjxxExcel.java @@ -0,0 +1,205 @@ +package com.epmet.opendata.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Data +public class WghSjxxExcel { + + @Excel(name = "案卷标识") + private Integer recid; + + @Excel(name = "事件编号") + private String sjbh; + + @Excel(name = "事件领域") + private String sjlyu; + + @Excel(name = "事件大类") + private String sjdl; + + @Excel(name = "事件小类") + private String sjxl; + + @Excel(name = "事件细类") + private String sjxil; + + @Excel(name = "事件来源") + private String sjly; + + @Excel(name = "所属区/市") + private String ssqs; + + @Excel(name = "所属街道") + private String ssjd; + + @Excel(name = "所属社区") + private String sssq; + + @Excel(name = "事件地址") + private String sjdz; + + @Excel(name = "事件描述") + private String sjms; + + @Excel(name = "网格员标识") + private String wgybs; + + @Excel(name = "网格员名称") + private String wgymc; + + @Excel(name = "所属部门") + private String ssbm; + + @Excel(name = "X坐标") + private BigDecimal xzb; + + @Excel(name = "Y坐标") + private BigDecimal yzb; + + @Excel(name = "核实意见") + private String hsyj; + + @Excel(name = "创建日期") + private Date createdate; + + @Excel(name = "事件领域标签") + private String sjlyubq; + + @Excel(name = "事件大类标签") + private String sjdlbq; + + @Excel(name = "事件小类标签") + private String sjxlbq; + + @Excel(name = "事件细类标签") + private String sjxilbq; + + @Excel(name = "所属区/市标签") + private String ssqsbq; + + @Excel(name = "所属街道标签") + private String ssjdbq; + + @Excel(name = "所属社区标签") + private String sssqbq; + + @Excel(name = "事件上报") + private String sjsbwj; + + @Excel(name = "事件核实") + private String sjhswj; + + @Excel(name = "事件处置") + private String sjczwj; + + @Excel(name = "事件核查") + private String sjhcwj; + + @Excel(name = "外系统唯一标识") + private String wxtwybs; + + @Excel(name = "缩略图") + private String slt; + + @Excel(name = "处置单位") + private Integer czdw; + + @Excel(name = "处置结果") + private String czjg; + + @Excel(name = "处置单位标签") + private String czdwbq; + + @Excel(name = "是否退单") + private Integer sftd; + + @Excel(name = "是否延期") + private Integer sfyq; + + @Excel(name = "核查意见") + private String hcyj; + + @Excel(name = "是否作废") + private Integer sfzf; + + @Excel(name = "是否已核实") + private Integer sfyhs; + + @Excel(name = "是否已核查") + private Integer sfyhc; + + @Excel(name = "是否已督办") + private Integer sfydb; + + @Excel(name = "专项任务标识") + private Integer zxrwbs; + + @Excel(name = "待确责") + private Integer dqz; + + @Excel(name = "熔断状态") + private Integer rdzt; + + @Excel(name = "事件来源标签") + private String sjlybq; + + @Excel(name = "应办结时间") + private Date ybjsj; + + @Excel(name = "接收部门标识") + private Integer jsbmbs; + + @Excel(name = "核实人员标识") + private Integer hsrybs; + + @Excel(name = "核查人员标识") + private Integer hcrybs; + + @Excel(name = "处置人员标识") + private Integer czrybs; + + @Excel(name = "是否已处置") + private Integer sfycz; + + @Excel(name = "核实时间") + private Date hssj; + + @Excel(name = "核查时间") + private Date hcsj; + + @Excel(name = "处置时间") + private Date czsj; + + @Excel(name = "是否自发自处") + private Integer sfzfzc; + + @Excel(name = "核查用时") + private BigDecimal hcys; + + @Excel(name = "诉求联系人") + private String sqlxr; + + @Excel(name = "僵尸车") + private Integer jsc; + + @Excel(name = "到期时间") + private Date dqsj; + + @Excel(name = "星级评定") + private Integer xjpd; + + @Excel(name = "所属网格") + private String sswg; + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/WghSjxxRedis.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/WghSjxxRedis.java new file mode 100644 index 0000000000..bda306137a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/redis/WghSjxxRedis.java @@ -0,0 +1,30 @@ +package com.epmet.opendata.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Component +public class WghSjxxRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/WghSjxxService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/WghSjxxService.java new file mode 100644 index 0000000000..38396400ed --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/WghSjxxService.java @@ -0,0 +1,90 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.wgh.WghSjxxDTO; +import com.epmet.opendata.entity.WghSjxxEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +public interface WghSjxxService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-05 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-05 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WghSjxxDTO + * @author generator + * @date 2022-07-05 + */ + WghSjxxDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-05 + */ + void save(WghSjxxDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-05 + */ + void update(WghSjxxDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-05 + */ + void delete(String[] ids); + + /** + * 调用ruoyi接口获取wgh_sjxxb数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/7/5 14:18 + */ + void getWghSjxx(PreserVationFormDTO dto); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java index 8937858883..76d82e71b7 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GuardarDatosTaskServiceImpl.java @@ -4,7 +4,6 @@ import com.epmet.opendata.dto.constant.CaWghDataConstant; import com.epmet.opendata.dto.form.PreserVationFormDTO; import com.epmet.opendata.service.*; import lombok.extern.slf4j.Slf4j; -import net.bytebuddy.asm.Advice; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -79,6 +78,9 @@ public class GuardarDatosTaskServiceImpl implements GuardarDatosTaskService { @Autowired private CaBmCategoryService caBmCategoryService; + @Autowired + private WghSjxxService wghSjxxService; + @Override public void guardarDatosTask(PreserVationFormDTO dto) { if (StringUtils.isNotBlank(dto.getTableName())) { @@ -122,7 +124,7 @@ public class GuardarDatosTaskServiceImpl implements GuardarDatosTaskService { case CaWghDataConstant.SHARE_WGH_JYZ: wghJyzService.getPreserWghJyzVation(dto); break; - case CaWghDataConstant.SHARE_WGH_SJXX: + case CaWghDataConstant.SHARE_WGH_SJXXB: wghSjxxbService.getPreserSjxxVation(dto); break; case CaWghDataConstant.SHARE_WGH_SQXX: @@ -149,6 +151,9 @@ public class GuardarDatosTaskServiceImpl implements GuardarDatosTaskService { case CaWghDataConstant.UNICOM_SYS_DICT: caSysDictService.preserSysdictVation(dto); break; + case CaWghDataConstant.SHARE_WGH_SJXX: + wghSjxxService.getWghSjxx(dto); + break; } } else{ throw new Error("没传名字"); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxServiceImpl.java new file mode 100644 index 0000000000..e3f30b415e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxServiceImpl.java @@ -0,0 +1,172 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +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.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.opendata.dao.WghSjxxDao; +import com.epmet.opendata.dto.constant.CaWghDataConstant; +import com.epmet.opendata.dto.form.PreserVationFormDTO; +import com.epmet.opendata.dto.wgh.WghSjxxDTO; +import com.epmet.opendata.entity.WghSjxxEntity; +import com.epmet.opendata.entity.WghSjxxbEntity; +import com.epmet.opendata.redis.WghSjxxRedis; +import com.epmet.opendata.service.WghSjxxService; +import com.epmet.opendata.util.AesUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-05 + */ +@Service +public class WghSjxxServiceImpl extends BaseServiceImpl implements WghSjxxService { + + @Autowired + private WghSjxxRedis wghSjxxRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WghSjxxDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WghSjxxDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public WghSjxxDTO get(String id) { + WghSjxxEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WghSjxxDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WghSjxxDTO dto) { + WghSjxxEntity entity = ConvertUtils.sourceToTarget(dto, WghSjxxEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WghSjxxDTO dto) { + WghSjxxEntity entity = ConvertUtils.sourceToTarget(dto, WghSjxxEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 调用ruoyi接口获取wgh_sjxxb数据 + * + * @param dto + * @return void + * @author LZN + * @date 2022/7/5 14:18 + */ + @Override + public void getWghSjxx(PreserVationFormDTO dto) { + int i = baseDao.deleteAll(); + + if (i >= 0) { + dto.setPageNo(NumConstant.ONE); + dto.setPageSize(CaWghDataConstant.PAGE_LIMIT); + dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_WGH); + dto.setTableName(CaWghDataConstant.SHARE_WGH_SJXX); + + dto.setWhereCase("1=1"); + dto.setOrderBy("createdate,hssj,hcsj,czsj"); + + int pageNo = 1; + + int total = 0; + + do { + try { + total = listWgh(dto); + pageNo++; + dto.setPageNo(pageNo); + } catch (Exception e) { + e.printStackTrace(); + } + } while (total > (pageNo * NumConstant.FIFTY)); + } + } + + private int listWgh(PreserVationFormDTO dto) throws Exception { + String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); + JSONObject obj = new JSONObject(); + obj.put(CaWghDataConstant.WGH_CONDITION, aes); + String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_WGH, obj.toJSONString()).getData(); + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (!result.success()) { + return dto.getPageNo() + 1; + } + + ReturnDate returnDate = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), ReturnDate.class); + this.insertBatch(returnDate.getList()); + return returnDate.getTotal(); + } + + static class ReturnDate { + + private int total; + private List list; + + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java index f544232319..c9c8fc9cca 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java @@ -16,11 +16,9 @@ import com.epmet.opendata.dto.constant.CaWghDataConstant; import com.epmet.opendata.dto.form.PreserVationFormDTO; import com.epmet.opendata.dto.form.WghSjxxFormDTO; import com.epmet.opendata.dto.form.WghSjxxbDetailFormDTO; -import com.epmet.opendata.dto.result.CaLoudongResultDTO; import com.epmet.opendata.dto.result.WghSjxxResultDTO; import com.epmet.opendata.dto.result.WghSjxxbDetailResultDTO; import com.epmet.opendata.dto.wgh.WghSjxxbDTO; -import com.epmet.opendata.entity.CaLoudongEntity; import com.epmet.opendata.entity.WghSjxxbEntity; import com.epmet.opendata.redis.WghSjxxbRedis; import com.epmet.opendata.service.WghSjxxbService; @@ -115,7 +113,7 @@ public class WghSjxxbServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from wgh_sjxx + + + +