35 changed files with 14749 additions and 75 deletions
@ -1 +1 @@ |
|||
ALTER TABLE esd_admin.sys_menu ADD menu_code varchar(50) NULL COMMENT '菜单编码'; |
|||
ALTER TABLE esua_epdc_admin.sys_menu ADD menu_code varchar(50) NULL COMMENT '菜单编码'; |
|||
|
File diff suppressed because it is too large
@ -0,0 +1,39 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|||
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.ItemStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO; |
|||
import com.elink.esua.epdc.service.WorkItemService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 移动端接口-项目模块 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:32 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("work/event/item") |
|||
public class ApiWorkItemController { |
|||
|
|||
@Autowired |
|||
private WorkItemService workItemService; |
|||
|
|||
/** |
|||
* 项目分类统计 |
|||
* @Params: [userDetail, categoryId] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO> |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/12 13:26 |
|||
*/ |
|||
@GetMapping("statistics") |
|||
public Result<ItemStatisticsResultDTO> itemCategoryStatistics(ItemStatisticsFormDTO formDto) { |
|||
return workItemService.getItemStatistics(formDto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.*; |
|||
import com.elink.esua.epdc.dto.item.result.*; |
|||
import com.elink.esua.epdc.feign.fallback.ItemFeignClientFallback; |
|||
import com.elink.esua.epdc.feign.fallback.WorkItemFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目模块调用-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = WorkItemFeignClientFallback.class,url ="http://127.0.0.1:9066") |
|||
public interface WorkItemFeignClient { |
|||
|
|||
|
|||
|
|||
/** |
|||
* 项目统计 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemStatisticsFormDTO> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/18 13:29 |
|||
*/ |
|||
@GetMapping(value = "events/work/item/statistics", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<ItemStatisticsResultDTO> itemStatistics(ItemStatisticsFormDTO formDto); |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.*; |
|||
import com.elink.esua.epdc.dto.item.result.*; |
|||
import com.elink.esua.epdc.feign.ItemFeignClient; |
|||
import com.elink.esua.epdc.feign.WorkItemFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@Component |
|||
public class WorkItemFeignClientFallback implements WorkItemFeignClient { |
|||
|
|||
|
|||
|
|||
@Override |
|||
public Result<ItemStatisticsResultDTO> itemStatistics(ItemStatisticsFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "itemStatistics", formDto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.ItemStatisticsFormDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO; |
|||
|
|||
/** |
|||
* 项目模块-移动App端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:34 |
|||
*/ |
|||
public interface WorkItemService { |
|||
|
|||
/** |
|||
* 项目统计 |
|||
* @Params: [userDetail, deptId] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/18 13:27 |
|||
*/ |
|||
Result<ItemStatisticsResultDTO> getItemStatistics(ItemStatisticsFormDTO formDto); |
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.*; |
|||
import com.elink.esua.epdc.dto.item.result.*; |
|||
import com.elink.esua.epdc.feign.ItemFeignClient; |
|||
import com.elink.esua.epdc.feign.WorkItemFeignClient; |
|||
import com.elink.esua.epdc.service.WorkItemService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目模块-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:34 |
|||
*/ |
|||
@Service |
|||
public class WorkItemServiceImpl implements WorkItemService { |
|||
|
|||
@Autowired |
|||
private WorkItemFeignClient workItemFeignClient; |
|||
|
|||
/** |
|||
* 项目统计 |
|||
* @Params: [userDetail, selectedId] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/18 13:27 |
|||
*/ |
|||
@Override |
|||
public Result<ItemStatisticsResultDTO> getItemStatistics(ItemStatisticsFormDTO formDto) { |
|||
return workItemFeignClient.itemStatistics(formDto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,100 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
|||
import cn.afterturn.easypoi.excel.entity.ImportParams; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.codec.CharEncoding; |
|||
import org.apache.http.HttpEntity; |
|||
import org.apache.http.HttpStatus; |
|||
import org.apache.http.ParseException; |
|||
import org.apache.http.client.methods.CloseableHttpResponse; |
|||
import org.apache.http.client.methods.HttpPost; |
|||
import org.apache.http.entity.StringEntity; |
|||
import org.apache.http.impl.client.CloseableHttpClient; |
|||
import org.apache.http.impl.client.HttpClients; |
|||
import org.apache.http.util.EntityUtils; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.*; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author work@yujt.net.cn |
|||
* @date 1 1 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("inshibei") |
|||
public class ImportInShiBeiController { |
|||
|
|||
|
|||
@GetMapping("coterie/batchSave") |
|||
public Result importExcel(MultipartFile file, String userId, String token) { |
|||
ImportParams importParams = new ImportParams(); |
|||
importParams.setHeadRows(1); |
|||
try { |
|||
List<Map<String, String>> articleList = ExcelImportUtil.importExcel(file.getInputStream(), Map.class, importParams); |
|||
|
|||
for (Map<String, String> objectMap : articleList) { |
|||
postWithParam(userId, token, objectMap.get("content"), objectMap.get("type")); |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
private void postWithParam(String userId, String token, String detail, String type) throws Exception { |
|||
CloseableHttpClient httpClient = HttpClients.createDefault(); |
|||
|
|||
JSONObject json = new JSONObject(); |
|||
json.put("userId", userId); |
|||
json.put("token", token); |
|||
json.put("detail", detail); |
|||
json.put("coterieType", type); |
|||
|
|||
HttpPost httpPost = new HttpPost("http://hxb.elinkit.com.cn/InShiBei/rest/coterie/save"); |
|||
StringEntity stringEntity = new StringEntity(json.toJSONString(), CharEncoding.UTF_8); |
|||
stringEntity.setContentEncoding(CharEncoding.UTF_8); |
|||
// 发送json数据需要设置contentType
|
|||
stringEntity.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE); |
|||
httpPost.setEntity(stringEntity); |
|||
|
|||
getStringResult(httpClient.execute(httpPost)); |
|||
} |
|||
|
|||
|
|||
private static String getStringResult(CloseableHttpResponse response) { |
|||
String result = null; |
|||
try { |
|||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { |
|||
HttpEntity httpEntity = response.getEntity(); |
|||
result = EntityUtils.toString(httpEntity, CharEncoding.UTF_8); |
|||
} else { |
|||
log.error("拉取失败,错误编码为:" + response.getStatusLine().getStatusCode()); |
|||
} |
|||
} catch (ParseException e) { |
|||
log.error("getResult方法格式转换异常ParseException"); |
|||
e.printStackTrace(); |
|||
} catch (IOException e) { |
|||
log.error("getResult方法IO异常IOException"); |
|||
e.printStackTrace(); |
|||
} finally { |
|||
try { |
|||
if (null != response) { |
|||
response.close(); |
|||
} |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.item.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目统计表单DTO |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:21 |
|||
*/ |
|||
@Data |
|||
public class ItemStatisticsFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 2999035593195412516L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
/** |
|||
* 部门ID列表 |
|||
*/ |
|||
List<Long> deptIdList; |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.item.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 项目统计DTO |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:22 |
|||
*/ |
|||
@Data |
|||
public class ItemStatisticsResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 1156180616337484819L; |
|||
/** |
|||
* 待处理数量 |
|||
*/ |
|||
private String pendingHandleNum; |
|||
/** |
|||
* 已结案数量 |
|||
*/ |
|||
private String closingCaseNum; |
|||
/** |
|||
* 已关闭数量 |
|||
*/ |
|||
private String closedNum; |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.elink.esua.epdc.modules.item.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.dto.item.form.*; |
|||
import com.elink.esua.epdc.dto.item.result.*; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 移动端-项目表 |
|||
* @Author LC |
|||
* @Date 2019/9/9 16:44 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("work/item") |
|||
public class workItemController { |
|||
|
|||
@Autowired |
|||
private ItemService itemService; |
|||
|
|||
|
|||
/** |
|||
* 项目分类统计 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO> |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/12 13:31 |
|||
*/ |
|||
@GetMapping("statistics") |
|||
public Result<ItemStatisticsResultDTO> itemStatistics(@RequestBody ItemStatisticsFormDTO formDto) { |
|||
formDto.setDeptIdList(SecurityUser.getUser().getDeptIdList()); |
|||
return this.itemService.getItemStatistics(formDto); |
|||
} |
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,64 @@ |
|||
package com.elink.esua.epdc.dto.epdc.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/11/18 13:38 |
|||
* @Description: 用户列表入参 |
|||
*/ |
|||
@Data |
|||
public class EpdcWorkUserFromDTO implements Serializable { |
|||
private static final long serialVersionUID = 4478942293796375973L; |
|||
|
|||
/** |
|||
* authenticatedFlag : 是否已认证 0否 1是 |
|||
* partyFlag : 0 是否党员,0否,1是 |
|||
*/ |
|||
|
|||
@NotBlank(message = "是否已认证不能为空") |
|||
private String authenticatedFlag; |
|||
|
|||
@NotBlank(message = "是否党员不能为空") |
|||
private String partyFlag; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@NotBlank(message = "用户ID不能为空") |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户所属网格ID |
|||
*/ |
|||
@NotNull(message = "用户网格ID不能为空") |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 页码 |
|||
*/ |
|||
@NotNull(message = "页码不能为空") |
|||
private Integer pageIndex; |
|||
|
|||
/** |
|||
* 页容量 |
|||
*/ |
|||
@NotNull(message = "页容量不能为空") |
|||
private Integer pageSize; |
|||
|
|||
/** |
|||
* 第一页查询发起时的时间 |
|||
*/ |
|||
@NotBlank(message = "时间戳不能为空") |
|||
private String timestamp; |
|||
|
|||
/** |
|||
* 是否查询用户管理的所有网格的数据 0否 1是 |
|||
*/ |
|||
@NotBlank(message = "是否查询用户管理的所有网格的数据不能为空") |
|||
private String allGridFlag; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.epdc.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2019/11/18 13:34 |
|||
* @Description: 用户列表 |
|||
*/ |
|||
@Data |
|||
public class EpdcWorkUserResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 3286304561837276520L; |
|||
/** |
|||
* userId : 52531 |
|||
* faceImg : pufkbhB1UA |
|||
* nickname : 259OeUCMwu |
|||
* registerTime : 1574037785289 |
|||
*/ |
|||
|
|||
private String userId; |
|||
private String faceImg; |
|||
private String nickname; |
|||
private String registerTime; |
|||
|
|||
} |
Loading…
Reference in new issue