Browse Source

项目上报网格化平台功能v1

dev
yinzuomei 6 years ago
parent
commit
a43ce12aec
  1. 91
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptGridPlatformDTO.java
  2. 94
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java
  3. 33
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java
  4. 66
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java
  5. 68
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java
  6. 47
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java
  7. 95
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java
  8. 104
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java
  9. 21
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml
  10. 71
      esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml
  11. 56
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/ShiBeiCityGridApi.java
  12. 117
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/api/impl/ShiBeiCityGridApiImpl.java
  13. 47
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/constant/CommonConstants.java
  14. 37
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ApiConstants.java
  15. 15
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/contants/ResponseConstants.java
  16. 26
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoDto.java
  17. 199
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GetZSBInputInfoItemDto.java
  18. 69
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/GridDto.java
  19. 27
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdDto.java
  20. 79
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/SearchCaseProcessByTaskIdItemDto.java
  21. 28
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ImageFile.java
  22. 48
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/ReportFile.java
  23. 355
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendInputInfoFormDto.java
  24. 40
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/SendWenXinEvaluateInfoFormDto.java
  25. 28
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/dto/form/WaveFile.java
  26. 47
      esua-epdc/epdc-commons/shibei-gird-sdk/src/main/java/com/elink/esua/gird/shibei/util/XstreamUtil.java
  27. 110
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml
  28. 112
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientAutoConfigration.java
  29. 83
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientManagerFactoryBen.java
  30. 93
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientProperty.java
  31. 172
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/HttpClientUtils.java
  32. 34
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/java/com/elink/esua/httpclient/ResultDto.java
  33. 2
      esua-epdc/epdc-commons/spring-boot-httpclient-starter/src/main/resources/META-INF/spring.factories
  34. 69
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GirdDto.java
  35. 106
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/GridPlatformHandleLogDTO.java
  36. 91
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemGridPlatformDTO.java
  37. 28
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ImageFile.java
  38. 48
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ReportFile.java
  39. 355
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SendInputInfoFormDto.java
  40. 28
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/WaveFile.java
  41. 7
      esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml
  42. 94
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/GridPlatformHandleLogController.java
  43. 94
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemGridPlatformController.java
  44. 33
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/GridPlatformHandleLogDao.java
  45. 33
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemGridPlatformDao.java
  46. 76
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/GridPlatformHandleLogEntity.java
  47. 61
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemGridPlatformEntity.java
  48. 77
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/GridPlatformHandleLogExcel.java
  49. 68
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemGridPlatformExcel.java
  50. 47
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/GridPlatformHandleLogRedis.java
  51. 47
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemGridPlatformRedis.java
  52. 95
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/GridPlatformHandleLogService.java
  53. 95
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemGridPlatformService.java
  54. 104
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/GridPlatformHandleLogServiceImpl.java
  55. 104
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemGridPlatformServiceImpl.java
  56. 133
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  57. 24
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml
  58. 21
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml

91
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<DeptGridPlatformDTO>> page(@RequestParam Map<String, Object> params){
PageData<DeptGridPlatformDTO> page = deptGridPlatformService.page(params);
return new Result<PageData<DeptGridPlatformDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<DeptGridPlatformDTO> get(@PathVariable("id") String id){
DeptGridPlatformDTO data = deptGridPlatformService.get(id);
return new Result<DeptGridPlatformDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<DeptGridPlatformDTO> list = deptGridPlatformService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, DeptGridPlatformExcel.class);
}
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<DeptGridPlatformEntity> {
}

66
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<DeptGridPlatformEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<DeptGridPlatformDTO>
* @author generator
* @date 2019-12-25
*/
PageData<DeptGridPlatformDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<DeptGridPlatformDTO>
* @author generator
* @date 2019-12-25
*/
List<DeptGridPlatformDTO> list(Map<String, Object> 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);
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<DeptGridPlatformDao, DeptGridPlatformEntity> implements DeptGridPlatformService {
@Autowired
private DeptGridPlatformRedis deptGridPlatformRedis;
@Override
public PageData<DeptGridPlatformDTO> page(Map<String, Object> params) {
IPage<DeptGridPlatformEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, DeptGridPlatformDTO.class);
}
@Override
public List<DeptGridPlatformDTO> list(Map<String, Object> params) {
List<DeptGridPlatformEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, DeptGridPlatformDTO.class);
}
private QueryWrapper<DeptGridPlatformEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<DeptGridPlatformEntity> 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));
}
}

21
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/DeptGridPlatformDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.DeptGridPlatformDao">
<resultMap type="com.elink.esua.epdc.entity.DeptGridPlatformEntity" id="deptGridPlatformMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptCode" column="DEPT_CODE"/>
<result property="streetCode" column="STREET_CODE"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="enableFlag" column="ENABLE_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
</mapper>

71
esua-epdc/epdc-commons/shibei-gird-sdk/pom.xml

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>shibei-gird-sdk</artifactId>
<packaging>jar</packaging>
<description>市北网格化服务接口封装</description>
<properties>
<xstream.version>1.4.11.1</xstream.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${xstream.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>spring-boot-httpclient-starter</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.9.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.1.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</dependency>
</dependencies>
<build>
<finalName>shibei-gird-webservice</finalName>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
</build>
</project>

56
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);
}

117
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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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> T requestGird(String requestUrl, Map<String, Object> parmas, Class<T> 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;
}
}

47
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 = "/";
}

37
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";
}

15
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";
}

26
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<GetZSBInputInfoItemDto> request;
public List<GetZSBInputInfoItemDto> getRequest() {
return request;
}
public void setRequest(List<GetZSBInputInfoItemDto> request) {
this.request = request;
}
}

199
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;
}
}

69
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;
}
}

27
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<SearchCaseProcessByTaskIdItemDto> request;
public List<SearchCaseProcessByTaskIdItemDto> getRequest() {
return request;
}
public void setRequest(List<SearchCaseProcessByTaskIdItemDto> request) {
this.request = request;
}
}

79
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;
}
}

28
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<ReportFile> reportFileList;
public List<ReportFile> getReportFileList() {
return reportFileList;
}
public void setReportFileList(List<ReportFile> reportFileList) {
this.reportFileList = reportFileList;
}
}

48
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;
}
}

355
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;
}
}

40
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;
}
}

28
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<ReportFile> reportFileList;
public List<ReportFile> getReportFileList() {
return reportFileList;
}
public void setReportFileList(List<ReportFile> reportFileList) {
this.reportFileList = reportFileList;
}
}

47
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 <T> 泛型
* @param xml 要转换为bean的xml
* @param cls bean对应的Class
* @return xml转换为bean
*/
public static <T> T xmlToObject(String xml, Class<T> 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);
}
}

110
esua-epdc/epdc-commons/spring-boot-httpclient-starter/pom.xml

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-httpclient-starter</artifactId>
<packaging>jar</packaging>
<name>spring-boot-httpclient-starter</name>
<url>http://www.example.com</url>
<description>http请求工具</description>
<properties>
<httpclient.version>4.5.6</httpclient.version>
<guava.version>26.0-jre</guava.version>
<log4j.version>1.2.17</log4j.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
</dependencies>
<build>
<finalName>common-spring-boot-httpclient-starter</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>true</parameters>
<source>${maven.compiler.source}</source> <!-- 源代码使用的开发版本 -->
<target>${maven.compiler.target}</target> <!-- 需要生成的目标class文件的编译版本 -->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<!-- jar插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
</build>
</project>

112
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());
}
}

83
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<CloseableHttpClient>, 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;
}
}

93
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;
}
}

172
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<String, Object> map) throws ClientProtocolException, IOException {
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
List<NameValuePair> formParams = new ArrayList<NameValuePair>();
for (Map.Entry<String, Object> 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<String, String> headerMap, Map<String, String> 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<NameValuePair> 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<NameValuePair> setHttpParams(Map<String, String> paramMap) {
List<NameValuePair> formparams = new ArrayList<NameValuePair>();
if (paramMap != null) {
Set<Map.Entry<String, String>> set = paramMap.entrySet();
for (Map.Entry<String, String> entry : set) {
formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
}
return formparams;
}
}

34
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;
}
}

2
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

69
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;
}
}

106
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

91
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

28
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<ReportFile> reportFileList;
public List<ReportFile> getReportFileList() {
return reportFileList;
}
public void setReportFileList(List<ReportFile> reportFileList) {
this.reportFileList = reportFileList;
}
}

48
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;
}
}

355
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;
}
}

28
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<ReportFile> reportFileList;
public List<ReportFile> getReportFileList() {
return reportFileList;
}
public void setReportFileList(List<ReportFile> reportFileList) {
this.reportFileList = reportFileList;
}
}

7
esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml

@ -68,6 +68,13 @@
<artifactId>epdc-commons-api-version-control</artifactId>
<version>${project.version}</version>
</dependency>
<!-- 上报网格平台 -->
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>shibei-gird-sdk</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<GridPlatformHandleLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<GridPlatformHandleLogDTO> page = gridPlatformHandleLogService.page(params);
return new Result<PageData<GridPlatformHandleLogDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<GridPlatformHandleLogDTO> get(@PathVariable("id") String id){
GridPlatformHandleLogDTO data = gridPlatformHandleLogService.get(id);
return new Result<GridPlatformHandleLogDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<GridPlatformHandleLogDTO> list = gridPlatformHandleLogService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, GridPlatformHandleLogExcel.class);
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<ItemGridPlatformDTO>> page(@RequestParam Map<String, Object> params){
PageData<ItemGridPlatformDTO> page = itemGridPlatformService.page(params);
return new Result<PageData<ItemGridPlatformDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ItemGridPlatformDTO> get(@PathVariable("id") String id){
ItemGridPlatformDTO data = itemGridPlatformService.get(id);
return new Result<ItemGridPlatformDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<ItemGridPlatformDTO> list = itemGridPlatformService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ItemGridPlatformExcel.class);
}
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<GridPlatformHandleLogEntity> {
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ItemGridPlatformEntity> {
}

76
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

61
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

77
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<GridPlatformHandleLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GridPlatformHandleLogDTO>
* @author generator
* @date 2019-12-25
*/
PageData<GridPlatformHandleLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GridPlatformHandleLogDTO>
* @author generator
* @date 2019-12-25
*/
List<GridPlatformHandleLogDTO> list(Map<String, Object> 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);
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ItemGridPlatformEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ItemGridPlatformDTO>
* @author generator
* @date 2019-12-25
*/
PageData<ItemGridPlatformDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ItemGridPlatformDTO>
* @author generator
* @date 2019-12-25
*/
List<ItemGridPlatformDTO> list(Map<String, Object> 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);
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<GridPlatformHandleLogDao, GridPlatformHandleLogEntity> implements GridPlatformHandleLogService {
@Autowired
private GridPlatformHandleLogRedis gridPlatformHandleLogRedis;
@Override
public PageData<GridPlatformHandleLogDTO> page(Map<String, Object> params) {
IPage<GridPlatformHandleLogEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GridPlatformHandleLogDTO.class);
}
@Override
public List<GridPlatformHandleLogDTO> list(Map<String, Object> params) {
List<GridPlatformHandleLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GridPlatformHandleLogDTO.class);
}
private QueryWrapper<GridPlatformHandleLogEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GridPlatformHandleLogEntity> 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));
}
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ItemGridPlatformDao, ItemGridPlatformEntity> implements ItemGridPlatformService {
@Autowired
private ItemGridPlatformRedis itemGridPlatformRedis;
@Override
public PageData<ItemGridPlatformDTO> page(Map<String, Object> params) {
IPage<ItemGridPlatformEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ItemGridPlatformDTO.class);
}
@Override
public List<ItemGridPlatformDTO> list(Map<String, Object> params) {
List<ItemGridPlatformEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ItemGridPlatformDTO.class);
}
private QueryWrapper<ItemGridPlatformEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ItemGridPlatformEntity> 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));
}
}

133
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<ItemDao, ItemEntity> implements ItemService {
private Logger logger = LogManager.getLogger(ItemServiceImpl.class);
@Autowired
private EpdcEventsService epdcEventsService;
@ -102,6 +110,12 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
@Autowired
private ImgService imgService;
@Autowired
private ImgDao imgDao;
@Autowired
private ShiBeiCityGridApi shiBeiCityGridApi;
@Override
public PageData<ItemDTO> page(Map<String, Object> params) {
IPage<ItemEntity> page = baseDao.selectPage(
@ -569,6 +583,18 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> 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<ItemDao, ItemEntity> implem
ItemStatisticsResultDTO resultDTO = baseDao.selectOneItemStatistics(formDto);
return new Result<ItemStatisticsResultDTO>().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<CompleteDeptDTO> 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<ImgEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(itemEntity.getEventId()), "REFERENCE_ID", itemEntity.getEventId());
List<ImgEntity> 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<com.elink.esua.gird.shibei.dto.form.ReportFile> 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;
}
}

24
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/GridPlatformHandleLogDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.item.dao.GridPlatformHandleLogDao">
<resultMap type="com.elink.esua.epdc.modules.item.entity.GridPlatformHandleLogEntity" id="gridPlatformHandleLogMap">
<result property="id" column="ID"/>
<result property="itemGridPlatformId" column="ITEM_GRID_PLATFORM_ID"/>
<result property="status" column="STATUS"/>
<result property="itemHandleProcessId" column="ITEM_HANDLE_PROCESS_ID"/>
<result property="handler" column="HANDLER"/>
<result property="handlingOpinions" column="HANDLING_OPINIONS"/>
<result property="handlingDept" column="HANDLING_DEPT"/>
<result property="handlingTime" column="HANDLING_TIME"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
</mapper>

21
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemGridPlatformDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.item.dao.ItemGridPlatformDao">
<resultMap type="com.elink.esua.epdc.modules.item.entity.ItemGridPlatformEntity" id="itemGridPlatformMap">
<result property="id" column="ID"/>
<result property="referenceId" column="REFERENCE_ID"/>
<result property="taskid" column="TASKID"/>
<result property="reportPersonDeptId" column="REPORT_PERSON_DEPT_ID"/>
<result property="status" column="STATUS"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
</mapper>
Loading…
Cancel
Save