From a43ce12aeca156a2b60c9c691e6bcef8a148e124 Mon Sep 17 00:00:00 2001 From: yinzuomei Date: Wed, 25 Dec 2019 15:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=20=E9=A1=B9=E7=9B=AE=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=8C=96=E5=B9=B3=E5=8F=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/DeptGridPlatformDTO.java | 91 +++++ .../DeptGridPlatformController.java | 94 +++++ .../esua/epdc/dao/DeptGridPlatformDao.java | 33 ++ .../epdc/entity/DeptGridPlatformEntity.java | 66 ++++ .../epdc/excel/DeptGridPlatformExcel.java | 68 ++++ .../epdc/redis/DeptGridPlatformRedis.java | 47 +++ .../epdc/service/DeptGridPlatformService.java | 95 +++++ .../impl/DeptGridPlatformServiceImpl.java | 104 +++++ .../resources/mapper/DeptGridPlatformDao.xml | 21 ++ .../epdc-commons/shibei-gird-sdk/pom.xml | 71 ++++ .../gird/shibei/api/ShiBeiCityGridApi.java | 56 +++ .../api/impl/ShiBeiCityGridApiImpl.java | 117 ++++++ .../gird/shibei/constant/CommonConstants.java | 47 +++ .../gird/shibei/contants/ApiConstants.java | 37 ++ .../shibei/contants/ResponseConstants.java | 15 + .../gird/shibei/dto/GetZSBInputInfoDto.java | 26 ++ .../shibei/dto/GetZSBInputInfoItemDto.java | 199 ++++++++++ .../elink/esua/gird/shibei/dto/GridDto.java | 69 ++++ .../dto/SearchCaseProcessByTaskIdDto.java | 27 ++ .../dto/SearchCaseProcessByTaskIdItemDto.java | 79 ++++ .../esua/gird/shibei/dto/form/ImageFile.java | 28 ++ .../esua/gird/shibei/dto/form/ReportFile.java | 48 +++ .../shibei/dto/form/SendInputInfoFormDto.java | 355 ++++++++++++++++++ .../form/SendWenXinEvaluateInfoFormDto.java | 40 ++ .../esua/gird/shibei/dto/form/WaveFile.java | 28 ++ .../esua/gird/shibei/util/XstreamUtil.java | 47 +++ .../spring-boot-httpclient-starter/pom.xml | 110 ++++++ .../HttpClientAutoConfigration.java | 112 ++++++ .../HttpClientManagerFactoryBen.java | 83 ++++ .../esua/httpclient/HttpClientProperty.java | 93 +++++ .../esua/httpclient/HttpClientUtils.java | 172 +++++++++ .../com/elink/esua/httpclient/ResultDto.java | 34 ++ .../main/resources/META-INF/spring.factories | 2 + .../com/elink/esua/epdc/dto/item/GirdDto.java | 69 ++++ .../dto/item/GridPlatformHandleLogDTO.java | 106 ++++++ .../epdc/dto/item/ItemGridPlatformDTO.java | 91 +++++ .../esua/epdc/dto/item/form/ImageFile.java | 28 ++ .../esua/epdc/dto/item/form/ReportFile.java | 48 +++ .../dto/item/form/SendInputInfoFormDto.java | 355 ++++++++++++++++++ .../esua/epdc/dto/item/form/WaveFile.java | 28 ++ .../epdc-events/epdc-events-server/pom.xml | 7 + .../GridPlatformHandleLogController.java | 94 +++++ .../ItemGridPlatformController.java | 94 +++++ .../item/dao/GridPlatformHandleLogDao.java | 33 ++ .../modules/item/dao/ItemGridPlatformDao.java | 33 ++ .../entity/GridPlatformHandleLogEntity.java | 76 ++++ .../item/entity/ItemGridPlatformEntity.java | 61 +++ .../excel/GridPlatformHandleLogExcel.java | 77 ++++ .../item/excel/ItemGridPlatformExcel.java | 68 ++++ .../redis/GridPlatformHandleLogRedis.java | 47 +++ .../item/redis/ItemGridPlatformRedis.java | 47 +++ .../service/GridPlatformHandleLogService.java | 95 +++++ .../item/service/ItemGridPlatformService.java | 95 +++++ .../GridPlatformHandleLogServiceImpl.java | 104 +++++ .../impl/ItemGridPlatformServiceImpl.java | 104 +++++ .../item/service/impl/ItemServiceImpl.java | 133 ++++++- .../mapper/item/GridPlatformHandleLogDao.xml | 24 ++ .../mapper/item/ItemGridPlatformDao.xml | 21 ++ 58 files changed, 4448 insertions(+), 4 deletions(-) create mode 100644 esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptGridPlatformDTO.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java create mode 100644 esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/ShiBeiCityGridApi.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/impl/ShiBeiCityGridApiImpl.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/constant/CommonConstants.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ApiConstants.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ResponseConstants.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoItemDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GridDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdItemDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ImageFile.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ReportFile.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendInputInfoFormDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendWenXinEvaluateInfoFormDto.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/WaveFile.java create mode 100644 esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/util/XstreamUtil.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientAutoConfigration.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientManagerFactoryBen.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientProperty.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientUtils.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/ResultDto.java create mode 100644 esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/resources/META-INF/spring.factories create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GirdDto.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GridPlatformHandleLogDTO.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemGridPlatformDTO.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ImageFile.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ReportFile.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SendInputInfoFormDto.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/WaveFile.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/GridPlatformHandleLogController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemGridPlatformController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/GridPlatformHandleLogDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemGridPlatformDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/GridPlatformHandleLogEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemGridPlatformEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/GridPlatformHandleLogExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemGridPlatformExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/GridPlatformHandleLogRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemGridPlatformRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/GridPlatformHandleLogService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemGridPlatformService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/GridPlatformHandleLogServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemGridPlatformServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptGridPlatformDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptGridPlatformDTO.java new file mode 100644 index 000000000..125169fbe --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptGridPlatformDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class DeptGridPlatformDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 街道编码 + */ + private String streetCode; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 启用标识 0-否,1-是 + */ + private String enableFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java new file mode 100644 index 000000000..d31708e79 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.excel.DeptGridPlatformExcel; +import com.elink.esua.epdc.service.DeptGridPlatformService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@RestController +@RequestMapping("deptgridplatform") +public class DeptGridPlatformController { + + @Autowired + private DeptGridPlatformService deptGridPlatformService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = deptGridPlatformService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DeptGridPlatformDTO data = deptGridPlatformService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptGridPlatformService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptGridPlatformService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptGridPlatformService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptGridPlatformService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptGridPlatformExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java new file mode 100644 index 000000000..c078deb9b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Mapper +public interface DeptGridPlatformDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java new file mode 100644 index 000000000..43e6bc6b5 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_grid_platform") +public class DeptGridPlatformEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 街道编码 + */ + private String streetCode; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 启用标识 0-否,1-是 + */ + private String enableFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java new file mode 100644 index 000000000..58dd8e6f8 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class DeptGridPlatformExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "部门ID") + private Long deptId; + + @Excel(name = "部门编码") + private String deptCode; + + @Excel(name = "街道编码") + private String streetCode; + + @Excel(name = "部门名称") + private String deptName; + + @Excel(name = "启用标识 0-否,1-是") + private String enableFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java new file mode 100644 index 000000000..babdde9aa --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Component +public class DeptGridPlatformRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java new file mode 100644 index 000000000..89dd97700 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +public interface DeptGridPlatformService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptGridPlatformDTO + * @author generator + * @date 2019-12-25 + */ + DeptGridPlatformDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void save(DeptGridPlatformDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void update(DeptGridPlatformDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-25 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java new file mode 100644 index 000000000..1917c0ea3 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.DeptGridPlatformDao; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; +import com.elink.esua.epdc.redis.DeptGridPlatformRedis; +import com.elink.esua.epdc.service.DeptGridPlatformService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Service +public class DeptGridPlatformServiceImpl extends BaseServiceImpl implements DeptGridPlatformService { + + @Autowired + private DeptGridPlatformRedis deptGridPlatformRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptGridPlatformDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptGridPlatformDTO.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 DeptGridPlatformDTO get(String id) { + DeptGridPlatformEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptGridPlatformDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptGridPlatformDTO dto) { + DeptGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, DeptGridPlatformEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptGridPlatformDTO dto) { + DeptGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, DeptGridPlatformEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml new file mode 100644 index 000000000..3a216b5d4 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml b/esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml new file mode 100644 index 000000000..08628a528 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml @@ -0,0 +1,71 @@ + + + + com.esua.epdc + epdc-commons + 1.0.0 + + 4.0.0 + + shibei-gird-sdk + jar + + 市北网格化服务接口封装 + + + 1.4.11.1 + + + + + org.springframework.boot + spring-boot-starter-log4j2 + provided + + + + com.thoughtworks.xstream + xstream + ${xstream.version} + + + + com.esua.epdc + spring-boot-httpclient-starter + 1.0.0 + compile + + + + org.springframework + spring-context + 5.1.9.RELEASE + compile + + + com.google.guava + guava + 26.0-jre + compile + + + cn.hutool + hutool-all + 4.1.8 + compile + + + org.apache.httpcomponents + httpcore + + + + + shibei-gird-webservice + + ${project.basedir}/src/main/java + + + diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/ShiBeiCityGridApi.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/ShiBeiCityGridApi.java new file mode 100644 index 000000000..1b50e2483 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/ShiBeiCityGridApi.java @@ -0,0 +1,56 @@ +package com.elink.esua.gird.shibei.api; + +import com.elink.esua.gird.shibei.dto.GetZSBInputInfoDto; +import com.elink.esua.gird.shibei.dto.GridDto; +import com.elink.esua.gird.shibei.dto.SearchCaseProcessByTaskIdDto; +import com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto; +import com.elink.esua.gird.shibei.dto.form.SendWenXinEvaluateInfoFormDto; + +/** + * 市北城市网格化平台API接口 + * + * @author rongchao + * @Date 18-12-3 + */ +public interface ShiBeiCityGridApi { + + /** + * 案件信息上报 + * + * @param caseReportFormDto + * @return + */ + GridDto sendInputInfo(SendInputInfoFormDto caseReportFormDto); + + /** + * 新案件信息上报 + * + * @param caseReportFormDto + * @return + */ + GridDto newSendInputInfo(SendInputInfoFormDto caseReportFormDto); + + /** + * 评价事件接口 + * + * @return + */ + GridDto sendWenXinEvaluateInfo(SendWenXinEvaluateInfoFormDto sendWenXinEvaluateInfoFormDto); + + /** + * 案件信息查询 + * + * @param beginTime YYYY-MM-DD + * @param endTime YYYY-MM-DD + * @param repoter 上报人唯一编码 + * @return + */ + GetZSBInputInfoDto getZSBInputInfo(String beginTime, String endTime, String repoter); + + /** + * 查询办理进度接口 + * + * @param taskId 要查询办理进度的任务号 + */ + SearchCaseProcessByTaskIdDto searchCaseProcessByTaskId(String taskId); +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/impl/ShiBeiCityGridApiImpl.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/impl/ShiBeiCityGridApiImpl.java new file mode 100644 index 000000000..a3d6a91a8 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/impl/ShiBeiCityGridApiImpl.java @@ -0,0 +1,117 @@ +package com.elink.esua.gird.shibei.api.impl; + +import com.elink.esua.gird.shibei.api.ShiBeiCityGridApi; +import com.elink.esua.gird.shibei.contants.ApiConstants; +import com.elink.esua.gird.shibei.dto.GetZSBInputInfoDto; +import com.elink.esua.gird.shibei.dto.GirdDto; +import com.elink.esua.gird.shibei.dto.SearchCaseProcessByTaskIdDto; +import com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto; +import com.elink.esua.gird.shibei.dto.form.SendWenXinEvaluateInfoFormDto; +import com.elink.esua.gird.shibei.util.XstreamUtil; +import com.elink.esua.httpclient.HttpClientUtils; +import com.elink.esua.httpclient.ResultDto; +import com.google.common.collect.Maps; +import org.apache.http.HttpStatus; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.Map; + +/** + * 市北城市网格化平台API接口 + * + * @author rongchao + * @Date 18-12-3 + */ +@Component +public class ShiBeiCityGridApiImpl implements ShiBeiCityGridApi { + + @Autowired + private HttpClientUtils httpClientUtils; + + private Logger LOGGER = LogManager.getLogger(HttpClientUtils.class); + + @Override + public GirdDto sendInputInfo(SendInputInfoFormDto caseReportFormDto) { + Map map = Maps.newHashMap(); + map.put("srtXml", XstreamUtil.objectToXml(caseReportFormDto)); + GirdDto girdDto = this.requestGird(ApiConstants.SendInputInfo, map, GirdDto.class); + if (girdDto == null) { + LOGGER.error("案件上报失败,案件内部编号:{}", caseReportFormDto.getHotLinesn()); + return null; + } else { + return girdDto; + } + } + + @Override + public GirdDto newSendInputInfo(SendInputInfoFormDto caseReportFormDto) { + Map map = Maps.newHashMap(); + map.put("srtXml", XstreamUtil.objectToXml(caseReportFormDto)); + GirdDto girdDto = this.requestGird(ApiConstants.newSendInputInfo, map, GirdDto.class); + if (girdDto == null) { + LOGGER.error("案件上报失败,案件内部编号:{}", caseReportFormDto.getHotLinesn()); + return null; + } else { + return girdDto; + } + } + + @Override + public GirdDto sendWenXinEvaluateInfo(SendWenXinEvaluateInfoFormDto sendWenXinEvaluateInfoFormDto) { + Map map = Maps.newHashMap(); + map.put("taskId", sendWenXinEvaluateInfoFormDto.getTaskId()); + map.put("evaluateType", sendWenXinEvaluateInfoFormDto.getEvaluateType()); + GirdDto girdDto = this.requestGird(ApiConstants.SendWenXinEvaluateInfo, map, GirdDto.class); + if (girdDto == null) { + LOGGER.error("案件评价失败,案件taskId为:{}", sendWenXinEvaluateInfoFormDto.getTaskId()); + return null; + } else { + return girdDto; + } + } + + @Override + public GetZSBInputInfoDto getZSBInputInfo(String beginTime, String endTime, String repoter) { + Map map = Maps.newHashMap(); + map.put("beginTime", beginTime); + map.put("endTime", endTime); + map.put("repoter", repoter); + GetZSBInputInfoDto getZSBInputInfoDto = this.requestGird(ApiConstants.GetZSBInputInfo, map, GetZSBInputInfoDto.class); + if (getZSBInputInfoDto == null) { + LOGGER.error("案件信息查询失败,上报人:{}", repoter); + return null; + } else { + return getZSBInputInfoDto; + } + } + + @Override + public SearchCaseProcessByTaskIdDto searchCaseProcessByTaskId(String taskId) { + Map map = Maps.newHashMap(); + map.put("taskId", taskId); + SearchCaseProcessByTaskIdDto searchCaseProcessByTaskIdDto = this.requestGird(ApiConstants.SearchCaseProcessByTaskId, map, SearchCaseProcessByTaskIdDto.class); + if (searchCaseProcessByTaskIdDto == null) { + LOGGER.error("根据taskId搜索案件进度失败,案件taskId为:{}", taskId); + return null; + } else { + return searchCaseProcessByTaskIdDto; + } + } + + private T requestGird(String requestUrl, Map parmas, Class clazz) { + try { + ResultDto result = httpClientUtils.postForm(requestUrl, parmas); + if (result.getResponseStatusCode() == HttpStatus.SC_OK) { + return XstreamUtil.xmlToObject(result.getResult(), clazz); + } + } catch (IOException e) { + LOGGER.error("调用市北网格化平台失败,请求地址:{},异常:{}", requestUrl, e.getMessage()); + } + return null; + } + +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/constant/CommonConstants.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/constant/CommonConstants.java new file mode 100644 index 000000000..fb6797bd6 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/constant/CommonConstants.java @@ -0,0 +1,47 @@ +package com.elink.esua.gird.shibei.constant; + +/** + * 定义公用常量 + * + * @author yinzuomei + * @email yinzuomei@elink-cn.com + * @date 2019-12-25 + */ +public class CommonConstants { + + public static int NUMBER_ONE = 1; + /** + * 案件来源 + */ + public static int INFO_SOURCE_ID=123; + + /** + * 渠道来源 + */ + public static int REPORT_DEPT=123; + + /** + * 案件属性 + */ + public static String INFO_TYPE_ID="1"; + + /** + * 案件大类 + */ + public static String INFO_BC="99"; + + /** + * 案件小类 + */ + public static String INFO_SC="01"; + + /** + * 案件子类 + */ + public static String INFO_ZC="01"; + + /** + * 字符:/ + */ + public static String CHAR_ASCII_47 = "/"; +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ApiConstants.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ApiConstants.java new file mode 100644 index 000000000..dc228463a --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ApiConstants.java @@ -0,0 +1,37 @@ +package com.elink.esua.gird.shibei.contants; + +/** + * webservice API接口地址常量 + * + * @author rongchao + * @Date 18-12-4 + */ +public class ApiConstants { + + /** + * 案件信息上报 + */ + public static final String SendInputInfo = "http://60.209.152.68:8083/CityGridInterfaceServiceWebService/WebService.asmx/SendInputInfo"; + + /** + * 案件信息上报 + */ + public static final String newSendInputInfo = "http://60.209.152.68:8083/CityGridInterfaceServiceWebService1.0/WebService.asmx/SendInputInfo"; + + + /** + * 评价事件接口 + */ + public static final String SendWenXinEvaluateInfo = "http://60.209.152.68:8083/SendToCityGrid/WebService.asmx/SendWenXinEvaluateInfo"; + + /** + * 案件信息查询 + */ + public static final String GetZSBInputInfo = "http://60.209.152.68:8083/SendToCityGrid/WebService.asmx/GetZSBInputInfo"; + + /** + * 查询办理进度接口 + */ + public static final String SearchCaseProcessByTaskId = "http://60.209.152.68:8083/SendToCityGrid/WebService.asmx/SearchCaseProcessByTaskId"; + +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ResponseConstants.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ResponseConstants.java new file mode 100644 index 000000000..4ec57d6cd --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ResponseConstants.java @@ -0,0 +1,15 @@ +package com.elink.esua.gird.shibei.contants; + +/** + * 响应常量 + * + * @author rongchao + * @Date 18-12-9 + */ +public class ResponseConstants { + + /** + * 成功调用标识 + */ + public static final String return_code_success = "1"; +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoDto.java new file mode 100644 index 000000000..204b8d751 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoDto.java @@ -0,0 +1,26 @@ +package com.elink.esua.gird.shibei.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +import java.util.List; + +/** + * 案件信息查询返回信息 + * + * @author rongchao + * @Date 18-12-3 + */ +@XStreamAlias("result") +public class GetZSBInputInfoDto { + + @XStreamAlias("request") + private List request; + + public List getRequest() { + return request; + } + + public void setRequest(List request) { + this.request = request; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoItemDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoItemDto.java new file mode 100644 index 000000000..c17abff72 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoItemDto.java @@ -0,0 +1,199 @@ +package com.elink.esua.gird.shibei.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 案件信息查询返回信息 + * + * @author rongchao + * @Date 18-12-3 + */ +public class GetZSBInputInfoItemDto { + + @XStreamAlias("status") + private String status; + + @XStreamAlias("taskid") + private String taskid; + + @XStreamAlias("discovertime") + private String discovertime; + + @XStreamAlias("reporter") + private String reporter; + + @XStreamAlias("hotlinesn") + private String hotlinesn; + + @XStreamAlias("infosourceid") + private String infosourceid; + + @XStreamAlias("infotypeid") + private String infotypeid; + + @XStreamAlias("infobccode") + private String infobccode; + + @XStreamAlias("infosccode") + private String infosccode; + + @XStreamAlias("infozccode") + private String infozccode; + + @XStreamAlias("streetcode") + private String streetcode; + + @XStreamAlias("address") + private String address; + + @XStreamAlias("description") + private String description; + + @XStreamAlias("accepttime") + private String accepttime; + + @XStreamAlias("acceptmark") + private String acceptmark; + + @XStreamAlias("endnote") + private String endnote; + + @XStreamAlias("endtime") + private String endtime; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getTaskid() { + return taskid; + } + + public void setTaskid(String taskid) { + this.taskid = taskid; + } + + public String getDiscovertime() { + return discovertime; + } + + public void setDiscovertime(String discovertime) { + this.discovertime = discovertime; + } + + public String getReporter() { + return reporter; + } + + public void setReporter(String reporter) { + this.reporter = reporter; + } + + public String getHotlinesn() { + return hotlinesn; + } + + public void setHotlinesn(String hotlinesn) { + this.hotlinesn = hotlinesn; + } + + public String getInfosourceid() { + return infosourceid; + } + + public void setInfosourceid(String infosourceid) { + this.infosourceid = infosourceid; + } + + public String getInfotypeid() { + return infotypeid; + } + + public void setInfotypeid(String infotypeid) { + this.infotypeid = infotypeid; + } + + public String getInfobccode() { + return infobccode; + } + + public void setInfobccode(String infobccode) { + this.infobccode = infobccode; + } + + public String getInfosccode() { + return infosccode; + } + + public void setInfosccode(String infosccode) { + this.infosccode = infosccode; + } + + public String getInfozccode() { + return infozccode; + } + + public void setInfozccode(String infozccode) { + this.infozccode = infozccode; + } + + public String getStreetcode() { + return streetcode; + } + + public void setStreetcode(String streetcode) { + this.streetcode = streetcode; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getAccepttime() { + return accepttime; + } + + public void setAccepttime(String accepttime) { + this.accepttime = accepttime; + } + + public String getAcceptmark() { + return acceptmark; + } + + public void setAcceptmark(String acceptmark) { + this.acceptmark = acceptmark; + } + + public String getEndnote() { + return endnote; + } + + public void setEndnote(String endnote) { + this.endnote = endnote; + } + + public String getEndtime() { + return endtime; + } + + public void setEndtime(String endtime) { + this.endtime = endtime; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GridDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GridDto.java new file mode 100644 index 000000000..aa7a2ff3d --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GridDto.java @@ -0,0 +1,69 @@ +package com.elink.esua.gird.shibei.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 案件上报返回信息 + * + * @author rongchao + * @Date 18-12-3 + */ +@XStreamAlias("DataReturn") +public class GridDto { + + /** + * 保存结果 1失败 0成功(非空) + */ + @XStreamAlias("ReturnCode") + private String returnCode; + + /** + * 保存日志,异常将写入异常日志 + */ + @XStreamAlias("ReturnDescription") + private String returnDescription; + + /** + * (非空) + */ + @XStreamAlias("TASKID") + private String taskId; + + /** + * 外系统编号(非空) + */ + @XStreamAlias("HotLinesn") + private String hotLinesn; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnDescription() { + return returnDescription; + } + + public void setReturnDescription(String returnDescription) { + this.returnDescription = returnDescription; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getHotLinesn() { + return hotLinesn; + } + + public void setHotLinesn(String hotLinesn) { + this.hotLinesn = hotLinesn; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdDto.java new file mode 100644 index 000000000..630aaac6a --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdDto.java @@ -0,0 +1,27 @@ +package com.elink.esua.gird.shibei.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.List; + +/** + * 查询办理进度接口返回DTO + * + * @author rongchao + * @Date 18-12-3 + */ +@XStreamAlias("result") +public class SearchCaseProcessByTaskIdDto { + + @XStreamImplicit(itemFieldName = "request") + List request; + + public List getRequest() { + return request; + } + + public void setRequest(List request) { + this.request = request; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdItemDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdItemDto.java new file mode 100644 index 000000000..fc783d6d8 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdItemDto.java @@ -0,0 +1,79 @@ +package com.elink.esua.gird.shibei.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 查询办理进度接口返回DTO + * + * @author rongchao + * @Date 18-12-3 + */ +@XStreamAlias("request") +public class SearchCaseProcessByTaskIdItemDto { + + @XStreamAlias("taskid") + private String taskid; + + @XStreamAlias("itemname") + private String itemname; + + @XStreamAlias("username") + private String username; + + @XStreamAlias("deptname") + private String deptname; + + @XStreamAlias("inserttime") + private String inserttime; + + @XStreamAlias("note") + private String note; + + public String getTaskid() { + return taskid; + } + + public void setTaskid(String taskid) { + this.taskid = taskid; + } + + public String getItemname() { + return itemname; + } + + public void setItemname(String itemname) { + this.itemname = itemname; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getDeptname() { + return deptname; + } + + public void setDeptname(String deptname) { + this.deptname = deptname; + } + + public String getInserttime() { + return inserttime; + } + + public void setInserttime(String inserttime) { + this.inserttime = inserttime; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ImageFile.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ImageFile.java new file mode 100644 index 000000000..6bdce6bdc --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ImageFile.java @@ -0,0 +1,28 @@ +package com.elink.esua.gird.shibei.dto.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.List; + +/** + * 图片 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:19 + */ +@XStreamAlias("ImageFile") +public class ImageFile { + + @XStreamImplicit(itemFieldName = "File") + private List reportFileList; + + public List getReportFileList() { + return reportFileList; + } + + public void setReportFileList(List reportFileList) { + this.reportFileList = reportFileList; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ReportFile.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ReportFile.java new file mode 100644 index 000000000..b961bec38 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ReportFile.java @@ -0,0 +1,48 @@ +package com.elink.esua.gird.shibei.dto.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; + +/** + * 上报的文件 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:50 + */ +@XStreamAlias("File") +public class ReportFile { + + @XStreamAsAttribute + private String name; + + @XStreamAsAttribute + private String url; + + @XStreamAsAttribute + private String base64string; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getBase64string() { + return base64string; + } + + public void setBase64string(String base64string) { + this.base64string = base64string; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendInputInfoFormDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendInputInfoFormDto.java new file mode 100644 index 000000000..f2923b11b --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendInputInfoFormDto.java @@ -0,0 +1,355 @@ +package com.elink.esua.gird.shibei.dto.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 案件上报表单DTO + * + * @author rongchao + * @Date 18-11-30 + */ +@XStreamAlias("Request") +public class SendInputInfoFormDto implements Serializable { + + private static final long serialVersionUID = 2907455292265057580L; + + /** + * 必填 + * 案件来源 62(网格系统分配) + */ + @XStreamAlias("InfoSourceID") + private int infoSourceID; + + /** + * 必填 + * 渠道来源 62(网格系统分配) + */ + @XStreamAlias("ReportDept") + private int reportDept; + + /** + * 必填 + * 案件类型 1(网格系统分配) + */ + @XStreamAlias("InfoTypeID") + private String infoTypeID; + + /** + * 必填 + * 案件大类 99(网格系统分配) + */ + @XStreamAlias("InfoBC") + private String infoBC; + + /** + * 必填 + * 案件小类 01(网格系统分配) + */ + @XStreamAlias("InfoSC") + private String infoSC; + + /** + * 必填 + * 案件子类 01(网格系统分配) + */ + @XStreamAlias("InfoZC") + private String infoZC; + + /** + * 必填 + * 发生地址 + */ + @XStreamAlias("StandardAddress") + private String standardAddress; + + /** + * 必填 + * 问题描述 + */ + @XStreamAlias("Description") + private String description; + + /** + * 反映人 上报人昵称 + */ + @XStreamAlias("ReportPerson") + private String reportPerson; + + /** + * 联系方式 + */ + @XStreamAlias("ContactMode") + private String contactMode; + + /** + * 必填 + * 坐标X + */ + @XStreamAlias("CoordX") + private BigDecimal coordX; + + /** + * 必填 + * 坐标Y + */ + @XStreamAlias("CoordY") + private BigDecimal coordY; + + /** + * 监督员编号 空字符串 + */ + @XStreamAlias("Keepersn") + private String keepersn; + + /** + * 必填 + * 发现时间 YYYY-MM-DD HH24:MI:SS + */ + @XStreamAlias("InsertTime") + private Date insertTime; + + /** + * 必填 + * 操作人 上报人唯一标识符 + */ + @XStreamAlias("InsertUser") + private String insertUser; + + /** + * 部件编号 空字符串 + */ + @XStreamAlias("Partsn") + private String partsn; + + /** + * 部件状态 空字符串 + */ + @XStreamAlias("PartState") + private String partState; + + /** + * 必填 + * 外系统编号 若没有编号,建议默认0 + */ + @XStreamAlias("HotLinesn") + private String hotLinesn; + + /** + * 多媒体图片 + */ + @XStreamAlias("ImageFile") + private ImageFile imageFile; + + /** + * 多媒体声音 + */ + @XStreamAlias("WaveFile") + private WaveFile waveFile; + + /** + * 必填 + * 外系统编码 130099(网格系统分配) + */ + @XStreamAlias("DeptCode") + private String deptCode; + + /** + * 街道编码 + */ + @XStreamAlias("StreetCode") + private String streetCode; + + /** + * 网格编码 + */ + @XStreamAlias("GridCode") + private String gridCode; + + public int getInfoSourceID() { + return infoSourceID; + } + + public void setInfoSourceID(int infoSourceID) { + this.infoSourceID = infoSourceID; + } + + public int getReportDept() { + return reportDept; + } + + public void setReportDept(int reportDept) { + this.reportDept = reportDept; + } + + public String getInfoTypeID() { + return infoTypeID; + } + + public void setInfoTypeID(String infoTypeID) { + this.infoTypeID = infoTypeID; + } + + public String getInfoBC() { + return infoBC; + } + + public void setInfoBC(String infoBC) { + this.infoBC = infoBC; + } + + public String getInfoSC() { + return infoSC; + } + + public void setInfoSC(String infoSC) { + this.infoSC = infoSC; + } + + public String getInfoZC() { + return infoZC; + } + + public void setInfoZC(String infoZC) { + this.infoZC = infoZC; + } + + public String getStandardAddress() { + return standardAddress; + } + + public void setStandardAddress(String standardAddress) { + this.standardAddress = standardAddress; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getReportPerson() { + return reportPerson; + } + + public void setReportPerson(String reportPerson) { + this.reportPerson = reportPerson; + } + + public String getContactMode() { + return contactMode; + } + + public void setContactMode(String contactMode) { + this.contactMode = contactMode; + } + + public BigDecimal getCoordX() { + return coordX; + } + + public void setCoordX(BigDecimal coordX) { + this.coordX = coordX; + } + + public BigDecimal getCoordY() { + return coordY; + } + + public void setCoordY(BigDecimal coordY) { + this.coordY = coordY; + } + + public String getKeepersn() { + return keepersn; + } + + public void setKeepersn(String keepersn) { + this.keepersn = keepersn; + } + + public Date getInsertTime() { + return insertTime; + } + + public void setInsertTime(Date insertTime) { + this.insertTime = insertTime; + } + + public String getInsertUser() { + return insertUser; + } + + public void setInsertUser(String insertUser) { + this.insertUser = insertUser; + } + + public String getPartsn() { + return partsn; + } + + public void setPartsn(String partsn) { + this.partsn = partsn; + } + + public String getPartState() { + return partState; + } + + public void setPartState(String partState) { + this.partState = partState; + } + + public String getHotLinesn() { + return hotLinesn; + } + + public void setHotLinesn(String hotLinesn) { + this.hotLinesn = hotLinesn; + } + + public String getDeptCode() { + return deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getGridCode() { + return gridCode; + } + + public void setGridCode(String gridCode) { + this.gridCode = gridCode; + } + + public String getStreetCode() { + return streetCode; + } + + public void setStreetCode(String streetCode) { + this.streetCode = streetCode; + } + + public ImageFile getImageFile() { + return imageFile; + } + + public void setImageFile(ImageFile imageFile) { + this.imageFile = imageFile; + } + + public WaveFile getWaveFile() { + return waveFile; + } + + public void setWaveFile(WaveFile waveFile) { + this.waveFile = waveFile; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendWenXinEvaluateInfoFormDto.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendWenXinEvaluateInfoFormDto.java new file mode 100644 index 000000000..750c0c45b --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendWenXinEvaluateInfoFormDto.java @@ -0,0 +1,40 @@ +package com.elink.esua.gird.shibei.dto.form; + +import java.io.Serializable; + +/** + * 评价事件接口表单DTO + * + * @author rongchao + * @Date 18-12-3 + */ +public class SendWenXinEvaluateInfoFormDto implements Serializable { + + private static final long serialVersionUID = -7268286268923469987L; + /** + * 开始时间 格式:1990-01-01 + */ + private String taskId; + + /** + * 满意标识: + * 3:基本满意,1:一般,2:不满意,0:满意,4:未表态 + */ + private String evaluateType; + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getEvaluateType() { + return evaluateType; + } + + public void setEvaluateType(String evaluateType) { + this.evaluateType = evaluateType; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/WaveFile.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/WaveFile.java new file mode 100644 index 000000000..7587d9a00 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/WaveFile.java @@ -0,0 +1,28 @@ +package com.elink.esua.gird.shibei.dto.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.List; + +/** + * 音频 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:28 + */ +@XStreamAlias("WaveFile") +public class WaveFile { + + @XStreamImplicit(itemFieldName = "File") + private List reportFileList; + + public List getReportFileList() { + return reportFileList; + } + + public void setReportFileList(List reportFileList) { + this.reportFileList = reportFileList; + } +} diff --git a/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/util/XstreamUtil.java b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/util/XstreamUtil.java new file mode 100644 index 000000000..ce9d9fc67 --- /dev/null +++ b/esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/util/XstreamUtil.java @@ -0,0 +1,47 @@ +package com.elink.esua.gird.shibei.util; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder; +import com.thoughtworks.xstream.io.xml.XppDriver; + +/** + * @author rongchao + * @Date 18-12-4 + */ +public class XstreamUtil { + + /** + * 将xml转换为bean + * + * @param 泛型 + * @param xml 要转换为bean的xml + * @param cls bean对应的Class + * @return xml转换为bean + */ + public static T xmlToObject(String xml, Class cls) { + XStream xStream = new XStream(new DomDriver()); + XStream.setupDefaultSecurity(xStream); + xStream.allowTypes(new Class[]{cls}); + //xstream使用注解转换 + xStream.processAnnotations(cls); + return (T) xStream.fromXML(xStream.fromXML(xml).toString()); + } + + /** + * 将bean转换为xml + * + * @param obj + * @return + */ + public static String objectToXml(Object obj) { + //解决下划线问题 + XStream xStream = new XStream(new XppDriver(new XmlFriendlyNameCoder("_-", "_"))); + XStream.setupDefaultSecurity(xStream); + xStream.allowTypes(new Class[]{obj.getClass()}); + //xstream使用注解转换 + xStream.processAnnotations(obj.getClass()); + return xStream.toXML(obj); + } + +} diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml new file mode 100644 index 000000000..34719156b --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml @@ -0,0 +1,110 @@ + + + + + com.esua.epdc + epdc-commons + 1.0.0 + + 4.0.0 + + spring-boot-httpclient-starter + jar + + spring-boot-httpclient-starter + http://www.example.com + http请求工具 + + + 4.5.6 + 26.0-jre + 1.2.17 + + + + + org.springframework.boot + spring-boot-autoconfigure + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + com.vaadin.external.google + android-json + + + + + + org.springframework.boot + spring-boot-starter-log4j2 + provided + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + com.google.guava + guava + + + + + common-spring-boot-httpclient-starter + + + maven-clean-plugin + + + + maven-resources-plugin + + + maven-compiler-plugin + + true + ${maven.compiler.source} + ${maven.compiler.target} + ${project.build.sourceEncoding} + + + + maven-surefire-plugin + + + maven-war-plugin + + + maven-install-plugin + + + maven-deploy-plugin + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + + + + + + + ${project.basedir}/src/main/java + + diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientAutoConfigration.java b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientAutoConfigration.java new file mode 100644 index 000000000..778d39539 --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientAutoConfigration.java @@ -0,0 +1,112 @@ +package com.elink.esua.httpclient; + +import org.apache.http.HttpEntityEnclosingRequest; +import org.apache.http.HttpRequest; +import org.apache.http.NoHttpResponseException; +import org.apache.http.client.HttpRequestRetryHandler; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.net.ssl.SSLException; +import java.io.InterruptedIOException; +import java.net.UnknownHostException; +import java.util.concurrent.TimeUnit; + +/** + * @author rongchao + * @Date 18-11-27 + */ +@Configuration +@EnableConfigurationProperties({HttpClientProperty.class}) +public class HttpClientAutoConfigration { + + @Autowired + private HttpClientProperty httpClientProperty; + + /** + * HttpClient的重试处理机制 + * + * @return + */ + @Bean + public HttpRequestRetryHandler httpRequestRetryHandler() { + // 请求重试 + final int retryTime = httpClientProperty.getRetryTime(); + return (exception, executionCount, context) -> { + // Do not retry if over max retry count,如果重试次数超过了retryTime,则不再重试请求 + if (executionCount >= retryTime) { + return false; + } + // 服务端断掉客户端的连接异常 + if (exception instanceof NoHttpResponseException) { + return true; + } + // time out 超时重试 + if (exception instanceof InterruptedIOException) { + return true; + } + // Unknown host + if (exception instanceof UnknownHostException) { + return false; + } + // Connection refused + if (exception instanceof ConnectTimeoutException) { + return false; + } + // SSL handshake exception + if (exception instanceof SSLException) { + return false; + } + HttpClientContext clientContext = HttpClientContext.adapt(context); + HttpRequest request = clientContext.getRequest(); + if (!(request instanceof HttpEntityEnclosingRequest)) { + return true; + } + return false; + }; + } + + /** + * 连接池管理 + * + * @return + */ + @Bean + public PoolingHttpClientConnectionManager poolingClientConnectionManager() { + PoolingHttpClientConnectionManager poolHttpcConnManager = new PoolingHttpClientConnectionManager(60, TimeUnit.SECONDS); + // 最大连接数 + poolHttpcConnManager.setMaxTotal(httpClientProperty.getConnMaxTotal()); + // 路由基数 + poolHttpcConnManager.setDefaultMaxPerRoute(httpClientProperty.getMaxPerRoute()); + return poolHttpcConnManager; + } + + /** + * @return + */ + @Bean + public RequestConfig requestConfig() { + return RequestConfig.custom() + .setConnectionRequestTimeout(httpClientProperty.getConnectRequestTimeout()) + .setConnectTimeout(httpClientProperty.getConnectTimeout()) + .setSocketTimeout(httpClientProperty.getSocketTimeout()) + .build(); + } + + @Bean + public HttpClientManagerFactoryBen httpClientManagerFactoryBen() { + return new HttpClientManagerFactoryBen(httpRequestRetryHandler(), poolingClientConnectionManager(), requestConfig()); + } + + @Bean + public HttpClientUtils httpClientUtils() { + return new HttpClientUtils(httpClientManagerFactoryBen()); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientManagerFactoryBen.java b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientManagerFactoryBen.java new file mode 100644 index 000000000..2e4b9576d --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientManagerFactoryBen.java @@ -0,0 +1,83 @@ +package com.elink.esua.httpclient; + +import org.apache.http.client.HttpRequestRetryHandler; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 描述:HttpClient客户端封装 + * + * @author rongchao + * @Date 18-11-27 + */ +public class HttpClientManagerFactoryBen implements FactoryBean, InitializingBean, DisposableBean { + + public HttpClientManagerFactoryBen(HttpRequestRetryHandler httpRequestRetryHandler, PoolingHttpClientConnectionManager poolHttpcConnManager, RequestConfig config) { + this.httpRequestRetryHandler = httpRequestRetryHandler; + this.poolHttpcConnManager = poolHttpcConnManager; + this.config = config; + } + + /** + * FactoryBean生成的目标对象 + */ + private CloseableHttpClient client; + + private HttpRequestRetryHandler httpRequestRetryHandler; + + private PoolingHttpClientConnectionManager poolHttpcConnManager; + + private RequestConfig config; + + // 销毁上下文时,销毁HttpClient实例 + @Override + public void destroy() throws Exception { + /* + * 调用httpClient.close()会先shut down connection manager,然后再释放该HttpClient所占用的所有资源, + * 关闭所有在使用或者空闲的connection包括底层socket。由于这里把它所使用的connection manager关闭了, + * 所以在下次还要进行http请求的时候,要重新new一个connection manager来build一个HttpClient, + * 也就是在需要关闭和新建Client的情况下,connection manager不能是单例的. + */ + if (null != this.client) { + this.client.close(); + } + } + + @Override// 初始化实例 + public void afterPropertiesSet() throws Exception { + /* + * 建议此处使用HttpClients.custom的方式来创建HttpClientBuilder,而不要使用HttpClientBuilder.create()方法来创建HttpClientBuilder + * 从官方文档可以得出,HttpClientBuilder是非线程安全的,但是HttpClients确实Immutable的,immutable 对象不仅能够保证对象的状态不被改变, + * 而且还可以不使用锁机制就能被其他线程共享 + */ + this.client = HttpClients.custom().setConnectionManager(poolHttpcConnManager) + .setRetryHandler(httpRequestRetryHandler) + .setDefaultRequestConfig(config) + .build(); + } + + // 返回实例的类型 + @Override + public CloseableHttpClient getObject() throws Exception { + return this.client; + } + + @Override + public Class getObjectType() { + return (this.client == null ? CloseableHttpClient.class : this.client.getClass()); + } + + // 构建的实例为单例 + @Override + public boolean isSingleton() { + return true; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientProperty.java b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientProperty.java new file mode 100644 index 000000000..8567b6f12 --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientProperty.java @@ -0,0 +1,93 @@ +package com.elink.esua.httpclient; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * @author rongchao + * @Date 18-11-27 + */ +@Configuration +@ConfigurationProperties(prefix = "httpclient.config") +public class HttpClientProperty { + + private int retryTime = 3; + + private int connMaxTotal = 300; + + private int maxPerRoute = 20; + + private int timeToLive = 60; + + private int keepAliveTime = 30; + + private int connectTimeout = 1000; + + private int connectRequestTimeout = 500; + + private int socketTimeout = 10000; + + public int getRetryTime() { + return retryTime; + } + + public void setRetryTime(int retryTime) { + this.retryTime = retryTime; + } + + public int getConnMaxTotal() { + return connMaxTotal; + } + + public void setConnMaxTotal(int connMaxTotal) { + this.connMaxTotal = connMaxTotal; + } + + public int getMaxPerRoute() { + return maxPerRoute; + } + + public void setMaxPerRoute(int maxPerRoute) { + this.maxPerRoute = maxPerRoute; + } + + public int getTimeToLive() { + return timeToLive; + } + + public void setTimeToLive(int timeToLive) { + this.timeToLive = timeToLive; + } + + public int getKeepAliveTime() { + return keepAliveTime; + } + + public void setKeepAliveTime(int keepAliveTime) { + this.keepAliveTime = keepAliveTime; + } + + public int getConnectTimeout() { + return connectTimeout; + } + + public void setConnectTimeout(int connectTimeout) { + this.connectTimeout = connectTimeout; + } + + public int getConnectRequestTimeout() { + return connectRequestTimeout; + } + + public void setConnectRequestTimeout(int connectRequestTimeout) { + this.connectRequestTimeout = connectRequestTimeout; + } + + public int getSocketTimeout() { + return socketTimeout; + } + + public void setSocketTimeout(int socketTimeout) { + this.socketTimeout = socketTimeout; + } +} diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientUtils.java b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientUtils.java new file mode 100644 index 000000000..be78b16e7 --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientUtils.java @@ -0,0 +1,172 @@ +package com.elink.esua.httpclient; + +import org.apache.commons.codec.CharEncoding; +import org.apache.http.HttpEntity; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.ParseException; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.IOException; +import java.net.URI; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @author rongchao + * @Date 18-12-3 + */ +public class HttpClientUtils { + + private static final Logger LOGGER = LogManager.getLogger(HttpClientUtils.class); + + private CloseableHttpClient client; + + public HttpClientUtils(HttpClientManagerFactoryBen httpClientBean) { + try { + this.client = httpClientBean.getObject(); + } catch (Exception e) { + LOGGER.error("CloseableHttpClient构建失败", e); + e.printStackTrace(); + } + } + + private static ResultDto getResult(CloseableHttpResponse response) { + String result = null; + HttpEntity httpEntity = null; + try { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + httpEntity = response.getEntity(); + result = EntityUtils.toString(httpEntity, CharEncoding.UTF_8); + // 释放连接 + EntityUtils.consumeQuietly(httpEntity); + } else { + LOGGER.error("拉取失败,错误编码为:{},错误信息:{}", response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()); + } + } catch (ParseException e) { + LOGGER.error("getResult方法格式转换异常ParseException"); + e.printStackTrace(); + } catch (IOException e) { + LOGGER.error("getResult方法IO异常IOException"); + e.printStackTrace(); + } finally { + EntityUtils.consumeQuietly(httpEntity); + } + ResultDto resultDto = new ResultDto(); + resultDto.setResponseStatusCode(response.getStatusLine().getStatusCode()); + resultDto.setResult(result); + return resultDto; + } + + /** + * post json 提交方式 + * + * @param url + * @param json + * @return map + * @throws KeyStoreException + * @throws NoSuchAlgorithmException + * @throws KeyManagementException + * @throws IOException + * @throws ClientProtocolException + */ + public ResultDto postJSON(String url, String json) { + CloseableHttpResponse response = null; + try { + HttpPost httpPost = new HttpPost(url); + StringEntity stringEntity = new StringEntity(json, CharEncoding.UTF_8); + stringEntity.setContentEncoding(CharEncoding.UTF_8); + // 发送json数据需要设置contentType + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = client.execute(httpPost); + return getResult(response); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * post form 提交方式 + * + * @param url + * @param map + * @return map + * @throws KeyStoreException + * @throws NoSuchAlgorithmException + * @throws KeyManagementException + * @throws IOException + * @throws ClientProtocolException + */ + public ResultDto postForm(String url, Map map) throws ClientProtocolException, IOException { + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded"); + List formParams = new ArrayList(); + for (Map.Entry kv : map.entrySet()) { + formParams.add(new BasicNameValuePair(kv.getKey(), (String) kv.getValue())); + } + HttpEntity entity = new UrlEncodedFormEntity(formParams, CharEncoding.UTF_8); + httpPost.setEntity(entity); + return getResult(client.execute(httpPost)); + } + + /** + * get 提交方式 + * + * @param url + * @param headerMap + * @param paramMap + * @return + * @throws KeyManagementException + * @throws NoSuchAlgorithmException + * @throws KeyStoreException + * @throws ClientProtocolException + * @throws IOException + */ + public ResultDto get(String url, Map headerMap, Map paramMap) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, ClientProtocolException, IOException { + HttpGet httpGet = new HttpGet(); + if (headerMap != null) { + for (String key : headerMap.keySet()) { + httpGet.setHeader(key, headerMap.get(key)); + } + } + List formparams = setHttpParams(paramMap); + String param = URLEncodedUtils.format(formparams, "UTF-8"); + httpGet.setURI(URI.create(url + "?" + param)); + return getResult(client.execute(httpGet)); + } + + /** + * 设置请求参数 + * + * @param paramMap + * @return + */ + private List setHttpParams(Map paramMap) { + List formparams = new ArrayList(); + if (paramMap != null) { + Set> set = paramMap.entrySet(); + for (Map.Entry entry : set) { + formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); + } + } + return formparams; + } +} diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/ResultDto.java b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/ResultDto.java new file mode 100644 index 000000000..fb39e6176 --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/ResultDto.java @@ -0,0 +1,34 @@ +package com.elink.esua.httpclient; + +/** + * @author rongchao + * @Date 18-12-4 + */ +public class ResultDto { + + /** + * 响应状态编码 + */ + private Integer responseStatusCode; + + /** + * 响应结果字符串 + */ + private String result; + + public Integer getResponseStatusCode() { + return responseStatusCode; + } + + public void setResponseStatusCode(Integer responseStatusCode) { + this.responseStatusCode = responseStatusCode; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } +} diff --git a/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/resources/META-INF/spring.factories b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..961954ab2 --- /dev/null +++ b/esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.elink.esua.httpclient.HttpClientAutoConfigration \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GirdDto.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GirdDto.java new file mode 100644 index 000000000..420ef53df --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GirdDto.java @@ -0,0 +1,69 @@ +package com.elink.esua.epdc.dto.item; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 案件上报返回信息 + * + * @author rongchao + * @Date 18-12-3 + */ +@XStreamAlias("DataReturn") +public class GirdDto { + + /** + * 保存结果 1失败 0成功(非空) + */ + @XStreamAlias("ReturnCode") + private String returnCode; + + /** + * 保存日志,异常将写入异常日志 + */ + @XStreamAlias("ReturnDescription") + private String returnDescription; + + /** + * (非空) + */ + @XStreamAlias("TASKID") + private String taskId; + + /** + * 外系统编号(非空) + */ + @XStreamAlias("HotLinesn") + private String hotLinesn; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnDescription() { + return returnDescription; + } + + public void setReturnDescription(String returnDescription) { + this.returnDescription = returnDescription; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getHotLinesn() { + return hotLinesn; + } + + public void setHotLinesn(String hotLinesn) { + this.hotLinesn = hotLinesn; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GridPlatformHandleLogDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GridPlatformHandleLogDTO.java new file mode 100644 index 000000000..ad3dded54 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GridPlatformHandleLogDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.item; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class GridPlatformHandleLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格化平台项目关系表ID + */ + private String itemGridPlatformId; + + /** + * 状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案 + */ + private Integer status; + + /** + * 项目处理表ID + */ + private String itemHandleProcessId; + + /** + * 处理人 + */ + private String handler; + + /** + * 处理意见 + */ + private String handlingOpinions; + + /** + * 处理部门 + */ + private String handlingDept; + + /** + * 处理时间 + */ + private Date handlingTime; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemGridPlatformDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemGridPlatformDTO.java new file mode 100644 index 000000000..3855bf9d0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemGridPlatformDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.item; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class ItemGridPlatformDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 关联表ID + */ + private String referenceId; + + /** + * 网格平台任务ID + */ + private String taskid; + + /** + * 上报人部门ID + */ + private Integer reportPersonDeptId; + + /** + * 状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案 + */ + private Integer status; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ImageFile.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ImageFile.java new file mode 100644 index 000000000..0d34a4933 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ImageFile.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.item.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.List; + +/** + * 图片 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:19 + */ +@XStreamAlias("ImageFile") +public class ImageFile { + + @XStreamImplicit(itemFieldName = "File") + private List reportFileList; + + public List getReportFileList() { + return reportFileList; + } + + public void setReportFileList(List reportFileList) { + this.reportFileList = reportFileList; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ReportFile.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ReportFile.java new file mode 100644 index 000000000..b180f18f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ReportFile.java @@ -0,0 +1,48 @@ +package com.elink.esua.epdc.dto.item.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; + +/** + * 上报的文件 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:50 + */ +@XStreamAlias("File") +public class ReportFile { + + @XStreamAsAttribute + private String name; + + @XStreamAsAttribute + private String url; + + @XStreamAsAttribute + private String base64string; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getBase64string() { + return base64string; + } + + public void setBase64string(String base64string) { + this.base64string = base64string; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SendInputInfoFormDto.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SendInputInfoFormDto.java new file mode 100644 index 000000000..9ea0db43a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SendInputInfoFormDto.java @@ -0,0 +1,355 @@ +package com.elink.esua.epdc.dto.item.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 案件上报表单DTO + * + * @author rongchao + * @Date 18-11-30 + */ +@XStreamAlias("Request") +public class SendInputInfoFormDto implements Serializable { + + private static final long serialVersionUID = 2907455292265057580L; + + /** + * 必填 + * 案件来源 62(网格系统分配) + */ + @XStreamAlias("InfoSourceID") + private int infoSourceID; + + /** + * 必填 + * 渠道来源 62(网格系统分配) + */ + @XStreamAlias("ReportDept") + private int reportDept; + + /** + * 必填 + * 案件类型 1(网格系统分配) + */ + @XStreamAlias("InfoTypeID") + private String infoTypeID; + + /** + * 必填 + * 案件大类 99(网格系统分配) + */ + @XStreamAlias("InfoBC") + private String infoBC; + + /** + * 必填 + * 案件小类 01(网格系统分配) + */ + @XStreamAlias("InfoSC") + private String infoSC; + + /** + * 必填 + * 案件子类 01(网格系统分配) + */ + @XStreamAlias("InfoZC") + private String infoZC; + + /** + * 必填 + * 发生地址 + */ + @XStreamAlias("StandardAddress") + private String standardAddress; + + /** + * 必填 + * 问题描述 + */ + @XStreamAlias("Description") + private String description; + + /** + * 反映人 上报人昵称 + */ + @XStreamAlias("ReportPerson") + private String reportPerson; + + /** + * 联系方式 + */ + @XStreamAlias("ContactMode") + private String contactMode; + + /** + * 必填 + * 坐标X + */ + @XStreamAlias("CoordX") + private BigDecimal coordX; + + /** + * 必填 + * 坐标Y + */ + @XStreamAlias("CoordY") + private BigDecimal coordY; + + /** + * 监督员编号 空字符串 + */ + @XStreamAlias("Keepersn") + private String keepersn; + + /** + * 必填 + * 发现时间 YYYY-MM-DD HH24:MI:SS + */ + @XStreamAlias("InsertTime") + private Date insertTime; + + /** + * 必填 + * 操作人 上报人唯一标识符 + */ + @XStreamAlias("InsertUser") + private String insertUser; + + /** + * 部件编号 空字符串 + */ + @XStreamAlias("Partsn") + private String partsn; + + /** + * 部件状态 空字符串 + */ + @XStreamAlias("PartState") + private String partState; + + /** + * 必填 + * 外系统编号 若没有编号,建议默认0 + */ + @XStreamAlias("HotLinesn") + private String hotLinesn; + + /** + * 多媒体图片 + */ + @XStreamAlias("ImageFile") + private ImageFile imageFile; + + /** + * 多媒体声音 + */ + @XStreamAlias("WaveFile") + private WaveFile waveFile; + + /** + * 必填 + * 外系统编码 130099(网格系统分配) + */ + @XStreamAlias("DeptCode") + private String deptCode; + + /** + * 街道编码 + */ + @XStreamAlias("StreetCode") + private String streetCode; + + /** + * 网格编码 + */ + @XStreamAlias("GridCode") + private String gridCode; + + public int getInfoSourceID() { + return infoSourceID; + } + + public void setInfoSourceID(int infoSourceID) { + this.infoSourceID = infoSourceID; + } + + public int getReportDept() { + return reportDept; + } + + public void setReportDept(int reportDept) { + this.reportDept = reportDept; + } + + public String getInfoTypeID() { + return infoTypeID; + } + + public void setInfoTypeID(String infoTypeID) { + this.infoTypeID = infoTypeID; + } + + public String getInfoBC() { + return infoBC; + } + + public void setInfoBC(String infoBC) { + this.infoBC = infoBC; + } + + public String getInfoSC() { + return infoSC; + } + + public void setInfoSC(String infoSC) { + this.infoSC = infoSC; + } + + public String getInfoZC() { + return infoZC; + } + + public void setInfoZC(String infoZC) { + this.infoZC = infoZC; + } + + public String getStandardAddress() { + return standardAddress; + } + + public void setStandardAddress(String standardAddress) { + this.standardAddress = standardAddress; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getReportPerson() { + return reportPerson; + } + + public void setReportPerson(String reportPerson) { + this.reportPerson = reportPerson; + } + + public String getContactMode() { + return contactMode; + } + + public void setContactMode(String contactMode) { + this.contactMode = contactMode; + } + + public BigDecimal getCoordX() { + return coordX; + } + + public void setCoordX(BigDecimal coordX) { + this.coordX = coordX; + } + + public BigDecimal getCoordY() { + return coordY; + } + + public void setCoordY(BigDecimal coordY) { + this.coordY = coordY; + } + + public String getKeepersn() { + return keepersn; + } + + public void setKeepersn(String keepersn) { + this.keepersn = keepersn; + } + + public Date getInsertTime() { + return insertTime; + } + + public void setInsertTime(Date insertTime) { + this.insertTime = insertTime; + } + + public String getInsertUser() { + return insertUser; + } + + public void setInsertUser(String insertUser) { + this.insertUser = insertUser; + } + + public String getPartsn() { + return partsn; + } + + public void setPartsn(String partsn) { + this.partsn = partsn; + } + + public String getPartState() { + return partState; + } + + public void setPartState(String partState) { + this.partState = partState; + } + + public String getHotLinesn() { + return hotLinesn; + } + + public void setHotLinesn(String hotLinesn) { + this.hotLinesn = hotLinesn; + } + + public String getDeptCode() { + return deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getGridCode() { + return gridCode; + } + + public void setGridCode(String gridCode) { + this.gridCode = gridCode; + } + + public String getStreetCode() { + return streetCode; + } + + public void setStreetCode(String streetCode) { + this.streetCode = streetCode; + } + + public ImageFile getImageFile() { + return imageFile; + } + + public void setImageFile(ImageFile imageFile) { + this.imageFile = imageFile; + } + + public WaveFile getWaveFile() { + return waveFile; + } + + public void setWaveFile(WaveFile waveFile) { + this.waveFile = waveFile; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/WaveFile.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/WaveFile.java new file mode 100644 index 000000000..5f4ce7cf8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/WaveFile.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.item.form; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.List; + +/** + * 音频 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2018/12/20 16:28 + */ +@XStreamAlias("WaveFile") +public class WaveFile { + + @XStreamImplicit(itemFieldName = "File") + private List reportFileList; + + public List getReportFileList() { + return reportFileList; + } + + public void setReportFileList(List reportFileList) { + this.reportFileList = reportFileList; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index bfa5b5522..4cd4fa70c 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -68,6 +68,13 @@ epdc-commons-api-version-control ${project.version} + + + com.esua.epdc + shibei-gird-sdk + 1.0.0 + compile + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/GridPlatformHandleLogController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/GridPlatformHandleLogController.java new file mode 100644 index 000000000..90e7f9b00 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/GridPlatformHandleLogController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.item.GridPlatformHandleLogDTO; +import com.elink.esua.epdc.modules.item.excel.GridPlatformHandleLogExcel; +import com.elink.esua.epdc.modules.item.service.GridPlatformHandleLogService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@RestController +@RequestMapping("gridplatformhandlelog") +public class GridPlatformHandleLogController { + + @Autowired + private GridPlatformHandleLogService gridPlatformHandleLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridPlatformHandleLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridPlatformHandleLogDTO data = gridPlatformHandleLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridPlatformHandleLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridPlatformHandleLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridPlatformHandleLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridPlatformHandleLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridPlatformHandleLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridPlatformHandleLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridPlatformHandleLogExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemGridPlatformController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemGridPlatformController.java new file mode 100644 index 000000000..3e3441ffa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemGridPlatformController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.item.ItemGridPlatformDTO; +import com.elink.esua.epdc.modules.item.excel.ItemGridPlatformExcel; +import com.elink.esua.epdc.modules.item.service.ItemGridPlatformService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@RestController +@RequestMapping("itemgridplatform") +public class ItemGridPlatformController { + + @Autowired + private ItemGridPlatformService itemGridPlatformService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = itemGridPlatformService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ItemGridPlatformDTO data = itemGridPlatformService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ItemGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + itemGridPlatformService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ItemGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + itemGridPlatformService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + itemGridPlatformService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = itemGridPlatformService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ItemGridPlatformExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/GridPlatformHandleLogDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/GridPlatformHandleLogDao.java new file mode 100644 index 000000000..9ca3d0d5c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/GridPlatformHandleLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.item.entity.GridPlatformHandleLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Mapper +public interface GridPlatformHandleLogDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemGridPlatformDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemGridPlatformDao.java new file mode 100644 index 000000000..b46a13fb0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemGridPlatformDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.item.entity.ItemGridPlatformEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Mapper +public interface ItemGridPlatformDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/GridPlatformHandleLogEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/GridPlatformHandleLogEntity.java new file mode 100644 index 000000000..fd7984763 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/GridPlatformHandleLogEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_grid_platform_handle_log") +public class GridPlatformHandleLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格化平台项目关系表ID + */ + private String itemGridPlatformId; + + /** + * 状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案 + */ + private Integer status; + + /** + * 项目处理表ID + */ + private String itemHandleProcessId; + + /** + * 处理人 + */ + private String handler; + + /** + * 处理意见 + */ + private String handlingOpinions; + + /** + * 处理部门 + */ + private String handlingDept; + + /** + * 处理时间 + */ + private Date handlingTime; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemGridPlatformEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemGridPlatformEntity.java new file mode 100644 index 000000000..409c5b269 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemGridPlatformEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_item_grid_platform") +public class ItemGridPlatformEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 关联表ID + */ + private String referenceId; + + /** + * 网格平台任务ID + */ + private String taskid; + + /** + * 上报人部门ID + */ + private Integer reportPersonDeptId; + + /** + * 状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案 + */ + private Integer status; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/GridPlatformHandleLogExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/GridPlatformHandleLogExcel.java new file mode 100644 index 000000000..016c45ab9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/GridPlatformHandleLogExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class GridPlatformHandleLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "网格化平台项目关系表ID") + private String itemGridPlatformId; + + @Excel(name = "状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案") + private Integer status; + + @Excel(name = "项目处理表ID") + private String itemHandleProcessId; + + @Excel(name = "处理人") + private String handler; + + @Excel(name = "处理意见") + private String handlingOpinions; + + @Excel(name = "处理部门") + private String handlingDept; + + @Excel(name = "处理时间") + private Date handlingTime; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemGridPlatformExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemGridPlatformExcel.java new file mode 100644 index 000000000..21ab06639 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemGridPlatformExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class ItemGridPlatformExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "关联表ID") + private String referenceId; + + @Excel(name = "网格平台任务ID") + private String taskid; + + @Excel(name = "上报人部门ID") + private Integer reportPersonDeptId; + + @Excel(name = "状态 15-网格化平台-上报,20-网格化平台-受理,25-网格化平台-立案,30-网格化平台-派遣,35-网格化平台-中间再派,40-网格化平台-接单,45-网格化平台-处理,50-网格化平台-中间督办,55-网格化平台-催办,55-网格化平台-结案") + private Integer status; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/GridPlatformHandleLogRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/GridPlatformHandleLogRedis.java new file mode 100644 index 000000000..759c70b40 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/GridPlatformHandleLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Component +public class GridPlatformHandleLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemGridPlatformRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemGridPlatformRedis.java new file mode 100644 index 000000000..0d18cb359 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemGridPlatformRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Component +public class ItemGridPlatformRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/GridPlatformHandleLogService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/GridPlatformHandleLogService.java new file mode 100644 index 000000000..aa902b9bb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/GridPlatformHandleLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.item.GridPlatformHandleLogDTO; +import com.elink.esua.epdc.modules.item.entity.GridPlatformHandleLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格化平台处理日志表 网格化平台处理日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +public interface GridPlatformHandleLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridPlatformHandleLogDTO + * @author generator + * @date 2019-12-25 + */ + GridPlatformHandleLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void save(GridPlatformHandleLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void update(GridPlatformHandleLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-25 + */ + void delete(String[] ids); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemGridPlatformService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemGridPlatformService.java new file mode 100644 index 000000000..cc5b5c311 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemGridPlatformService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.item.ItemGridPlatformDTO; +import com.elink.esua.epdc.modules.item.entity.ItemGridPlatformEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格化平台项目关系表 网格化平台项目关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +public interface ItemGridPlatformService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ItemGridPlatformDTO + * @author generator + * @date 2019-12-25 + */ + ItemGridPlatformDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void save(ItemGridPlatformDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void update(ItemGridPlatformDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-25 + */ + void delete(String[] ids); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/GridPlatformHandleLogServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/GridPlatformHandleLogServiceImpl.java new file mode 100644 index 000000000..802f8595f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/GridPlatformHandleLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.item.GridPlatformHandleLogDTO; +import com.elink.esua.epdc.modules.item.dao.GridPlatformHandleLogDao; +import com.elink.esua.epdc.modules.item.entity.GridPlatformHandleLogEntity; +import com.elink.esua.epdc.modules.item.redis.GridPlatformHandleLogRedis; +import com.elink.esua.epdc.modules.item.service.GridPlatformHandleLogService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Service +public class GridPlatformHandleLogServiceImpl extends BaseServiceImpl implements GridPlatformHandleLogService { + + @Autowired + private GridPlatformHandleLogRedis gridPlatformHandleLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridPlatformHandleLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridPlatformHandleLogDTO.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 GridPlatformHandleLogDTO get(String id) { + GridPlatformHandleLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridPlatformHandleLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridPlatformHandleLogDTO dto) { + GridPlatformHandleLogEntity entity = ConvertUtils.sourceToTarget(dto, GridPlatformHandleLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridPlatformHandleLogDTO dto) { + GridPlatformHandleLogEntity entity = ConvertUtils.sourceToTarget(dto, GridPlatformHandleLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemGridPlatformServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemGridPlatformServiceImpl.java new file mode 100644 index 000000000..ce312460c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemGridPlatformServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.item.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.item.ItemGridPlatformDTO; +import com.elink.esua.epdc.modules.item.dao.ItemGridPlatformDao; +import com.elink.esua.epdc.modules.item.entity.ItemGridPlatformEntity; +import com.elink.esua.epdc.modules.item.redis.ItemGridPlatformRedis; +import com.elink.esua.epdc.modules.item.service.ItemGridPlatformService; +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 qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Service +public class ItemGridPlatformServiceImpl extends BaseServiceImpl implements ItemGridPlatformService { + + @Autowired + private ItemGridPlatformRedis itemGridPlatformRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ItemGridPlatformDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ItemGridPlatformDTO.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 ItemGridPlatformDTO get(String id) { + ItemGridPlatformEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ItemGridPlatformDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ItemGridPlatformDTO dto) { + ItemGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, ItemGridPlatformEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ItemGridPlatformDTO dto) { + ItemGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, ItemGridPlatformEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index fc0f3989e..bf812512b 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -41,14 +41,13 @@ import com.elink.esua.epdc.dto.SysDeptDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.issue.result.IssueProgressResultDTO; -import com.elink.esua.epdc.dto.item.ItemDTO; -import com.elink.esua.epdc.dto.item.ItemDeptDTO; -import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; -import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO; +import com.elink.esua.epdc.dto.item.*; import com.elink.esua.epdc.dto.item.form.*; import com.elink.esua.epdc.dto.item.result.*; import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.events.dao.ImgDao; +import com.elink.esua.epdc.modules.events.entity.ImgEntity; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.events.service.ImgService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; @@ -58,12 +57,20 @@ import com.elink.esua.epdc.modules.item.entity.ItemEntity; import com.elink.esua.epdc.modules.item.entity.ItemHandleProcessEntity; import com.elink.esua.epdc.modules.item.entity.ItemInformationEntity; import com.elink.esua.epdc.modules.item.service.*; +import com.elink.esua.gird.shibei.api.ShiBeiCityGridApi; +import com.elink.esua.gird.shibei.constant.CommonConstants; +import com.elink.esua.gird.shibei.dto.GridDto; +import com.elink.esua.gird.shibei.dto.form.ImageFile; +import com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.util.*; /** @@ -74,6 +81,7 @@ import java.util.*; */ @Service public class ItemServiceImpl extends BaseServiceImpl implements ItemService { + private Logger logger = LogManager.getLogger(ItemServiceImpl.class); @Autowired private EpdcEventsService epdcEventsService; @@ -102,6 +110,12 @@ public class ItemServiceImpl extends BaseServiceImpl implem @Autowired private ImgService imgService; + @Autowired + private ImgDao imgDao; + + @Autowired + private ShiBeiCityGridApi shiBeiCityGridApi; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -569,6 +583,18 @@ public class ItemServiceImpl extends BaseServiceImpl implem } else if (ItemHandleCategoryEnum.HANDLE_REPORT.getValue() == dto.getHandleCategory()) { handleProcessEntity.setState(dto.getHandleCategory()); informationFormDTO.setTitle(EventsNoticeConstant.NOTICE_REPORT); + GridDto gridDto=null; + try{ + gridDto=this.reportCase(dto); + }catch(Exception e){ + return new Result().error("上报网格化平台接口失败"+e.getMessage()); + } + if (null == gridDto||!("0").equals(gridDto.getReturnCode())) { + // 接口没有返回信息,也没有异常信息 + return new Result().error("上报网格化平台接口失败"+gridDto.getReturnDescription()); + } + // 记录处理记录 + itemHandleProcessService.insert(handleProcessEntity); } else { handleProcessEntity.setState(dto.getHandleCategory()); // 更新项目状态 @@ -811,4 +837,103 @@ public class ItemServiceImpl extends BaseServiceImpl implem ItemStatisticsResultDTO resultDTO = baseDao.selectOneItemStatistics(formDto); return new Result().ok(resultDTO); } + /** + * @param dto + * @return void + * @Author yinzuomei + * @Description 案件信息上报 + * @Date 2019/12/25 13:00 + **/ + private GridDto reportCase(ItemHandleSubmitFormDTO dto) throws Exception{ + ItemEntity entity = baseDao.selectById(dto.getId()); + // 组装上报信息 + SendInputInfoFormDto sendInputInfoFormDto = packageReportEntity(entity); + // 接口请求返回实体,getReturnCode 1失败 0成功(非空) + return shiBeiCityGridApi.newSendInputInfo(sendInputInfoFormDto); + } + + /** + * @param itemEntity + * @return com.elink.esua.gird.shibei.dto.form.SendInputInfoFormDto + * @Author yinzuomei + * @Description 组装案件信息上报接口入参 + * @Date 2019/12/25 13:14 + **/ + private SendInputInfoFormDto packageReportEntity(ItemEntity itemEntity) throws Exception { + UserDetail user = SecurityUser.getUser(); + SendInputInfoFormDto formDto = new SendInputInfoFormDto(); + // 案件来源 + formDto.setInfoSourceID(CommonConstants.INFO_SOURCE_ID); + // 渠道来源 + formDto.setReportDept(CommonConstants.REPORT_DEPT); + // 案件属性 + formDto.setInfoTypeID(CommonConstants.INFO_TYPE_ID); + // 案件大类 + formDto.setInfoBC(CommonConstants.INFO_BC); + // 案件小类 + formDto.setInfoSC(CommonConstants.INFO_SC); + // 案件子类 + formDto.setInfoZC(CommonConstants.INFO_ZC); + // 发生地址 + formDto.setStandardAddress(itemEntity.getIssueAddress()); + // 问题描述 + formDto.setDescription("测试999勿删谢谢");// itemEntity.getItemContent() + // 反映人 + formDto.setReportPerson("测试人员");// itemEntity.getNickName() + // 联系方式 + formDto.setContactMode(itemEntity.getMobile()); + // 坐标X + formDto.setCoordX(new BigDecimal(itemEntity.getIssueLatitude())); + // 坐标Y + formDto.setCoordY(new BigDecimal(itemEntity.getIssueLongitude())); + // 监督员编号 + formDto.setKeepersn(""); + // 操作时间 + formDto.setInsertTime(new Date()); + // 操作人 + formDto.setInsertUser("尹作梅");// user.getRealName() + // 外系统编号 + formDto.setHotLinesn(itemEntity.getId()); + // 先查询网格对应街道id + Result completeDeptDTOResult=adminFeignClient.getCompleteDept(itemEntity.getGridId()); + if(!completeDeptDTOResult.success()){ + throw new Exception("根据网格ID获取所有上级机构信息失败"+completeDeptDTOResult.getMsg()); + } + // 根据街道id查询对应平台的deptCode、streetCode + + + + //外系统编码 必填!!!!!!! + formDto.setDeptCode("130099"); + // 街道编码!!!!!!!!!!!! + formDto.setStreetCode(null); + // 网格编码 + formDto.setGridCode(null); + + //查询图片里诶包 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(itemEntity.getEventId()), "REFERENCE_ID", itemEntity.getEventId()); + List imageList = imgDao.selectList(wrapper); + if (null != imageList && !imageList.isEmpty()) { + String url = null; + String filename = null; + com.elink.esua.gird.shibei.dto.form.ReportFile reportFile = null; + List reportFiles = new ArrayList<>(); + for (ImgEntity image : imageList) { + url = image.getImgUrl(); + if (org.apache.commons.lang.StringUtils.isNotBlank(url)) { + filename = url.substring(url.lastIndexOf(CommonConstants.CHAR_ASCII_47) + CommonConstants.NUMBER_ONE); + reportFile = new com.elink.esua.gird.shibei.dto.form.ReportFile(); + reportFile.setName(filename); + reportFile.setUrl(url); + reportFile.setBase64string(""); + reportFiles.add(reportFile); + } + } + ImageFile imageFile = new ImageFile(); + imageFile.setReportFileList(reportFiles); + formDto.setImageFile(imageFile); + } + return formDto; + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml new file mode 100644 index 000000000..c9b4e1aad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml new file mode 100644 index 000000000..04d528db1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +