200 changed files with 7281 additions and 300 deletions
@ -0,0 +1,5 @@ |
|||||
|
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509011061993473', 'jmreport_category', '报表应用类别', '居民信息、房屋信息', 32, 0, 0, '1', '2022-08-08 13:14:01', '1', '2022-08-08 13:14:01'); |
||||
|
|
||||
|
|
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509175185108994', 1556509011061993473, '房屋信息', 'house_info', '0', '', 2, 0, 0, '1', '2022-08-08 13:14:41', '1', '2022-08-08 13:14:41'); |
||||
|
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509102015475714', 1556509011061993473, '居民信息', 'resi_info', '0', '', 1, 0, 0, '1', '2022-08-08 13:14:23', '1', '2022-08-08 13:14:23'); |
||||
@ -0,0 +1,24 @@ |
|||||
|
<?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> |
||||
|
<artifactId>epmet-commons</artifactId> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<version>2.0.0</version> |
||||
|
<!--<relativePath>../../pom.xml</relativePath>--> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<artifactId>epmet-commons-feignclient</artifactId> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-tools</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 积木报表的返回值Page对象 |
||||
|
* @param <T> |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class JiMuPage<T> { |
||||
|
private int pageNo; |
||||
|
private int pageSize; |
||||
|
private int total; |
||||
|
private int pages; |
||||
|
private List<?> records; |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* 积木报表的返回值Result对象 |
||||
|
* @param <T> |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class JiMuResult<T> { |
||||
|
private boolean success = true; |
||||
|
private String message = ""; |
||||
|
private Integer code = 0; |
||||
|
private T result; |
||||
|
private T data; |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.form; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/8/8 15:08 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class JiMuReportFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3590609549416867701L; |
||||
|
|
||||
|
/** |
||||
|
* 报表IDs |
||||
|
*/ |
||||
|
private List<String> reportIds; |
||||
|
|
||||
|
/** |
||||
|
* 类别 |
||||
|
*/ |
||||
|
private List<String> categoryKeys; |
||||
|
|
||||
|
private String id; |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 批量导出用的requst dto |
||||
|
*/ |
||||
|
@Data |
||||
|
public class JimuReportExportRequestDTO { |
||||
|
private String excelConfigId; |
||||
|
private ExportRequestQueryParam queryParam = new ExportRequestQueryParam(); |
||||
|
|
||||
|
/** |
||||
|
* 批量导出用的请求参数 |
||||
|
*/ |
||||
|
@Data |
||||
|
public static class ExportRequestQueryParam { |
||||
|
private String id; |
||||
|
private String token; |
||||
|
private String paramKey; |
||||
|
private String pageNo; |
||||
|
private Integer pageSize; |
||||
|
private String currentPageNo; |
||||
|
private Integer currentPageSize; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.result; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class JiMuReportDetailResultDTO { |
||||
|
private String id; |
||||
|
private String code; |
||||
|
private String name; |
||||
|
private String note; |
||||
|
private String status; |
||||
|
private String type; |
||||
|
private String jsonStr; |
||||
|
private String apiUrl; |
||||
|
private String apiMethod; |
||||
|
private String apiCode; |
||||
|
private String thumb; |
||||
|
private Integer template; |
||||
|
private String createBy; |
||||
|
private Date createTime; |
||||
|
private String updateBy; |
||||
|
private Date updateTime; |
||||
|
private Map<String, Object> dataList; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/8/8 15:10 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Data |
||||
|
public class JiMuReportResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -4048477731892329569L; |
||||
|
|
||||
|
private String code; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private String id; |
||||
|
private String reportId; |
||||
|
private String reportName; |
||||
|
|
||||
|
private Boolean isList = false; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class JimuReportDbDataResultDTO { |
||||
|
|
||||
|
private ReportDB reportDb; |
||||
|
|
||||
|
@Data |
||||
|
public static class ReportDB { |
||||
|
private String apiUrl; |
||||
|
private String apiMethod; |
||||
|
private String isList; |
||||
|
private String dbChName; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.commons.feignclient.dtos.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 积木报表,报表字段列表 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class JimuReportFieldTreeResultDTO { |
||||
|
|
||||
|
private Boolean expand; |
||||
|
private String code; |
||||
|
private List<Child> children; |
||||
|
private String dbId; |
||||
|
private String type; |
||||
|
private String isList; |
||||
|
|
||||
|
@Data |
||||
|
public static class Child { |
||||
|
private Boolean expand; |
||||
|
private String title; |
||||
|
private String fieldText; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
package com.epmet.commons.feignclient.feigns; |
||||
|
|
||||
|
import com.epmet.commons.feignclient.dtos.JiMuPage; |
||||
|
import com.epmet.commons.feignclient.dtos.JiMuResult; |
||||
|
import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO; |
||||
|
import com.epmet.commons.feignclient.feigns.fallback.JiMuReportOpenFeignClientFallbackFactory; |
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import feign.Response; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.util.MultiValueMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/8/8 13:52 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class) |
||||
|
//@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class, url = "localhost:8118")
|
||||
|
public interface JiMuReportOpenFeignClient { |
||||
|
|
||||
|
@GetMapping(value = "jmreport/excelQuery") |
||||
|
JiMuResult<JiMuPage<JiMuReportDetailResultDTO>> getList(@RequestParam("pageNo") Integer pageNo, |
||||
|
@RequestParam("pageSize") Integer pageSize, |
||||
|
@RequestParam("name") String name, |
||||
|
@RequestParam("reportType") String reportType, |
||||
|
@RequestParam("token") String token, |
||||
|
@RequestHeader MultiValueMap<String, String> headers); |
||||
|
|
||||
|
@GetMapping("jmreport/show") |
||||
|
JiMuResult<Map<String,Object>> getReport(@RequestParam("id") String id,@RequestParam("apiUrl") String apiUrl,@RequestParam("params") String params,@RequestHeader MultiValueMap<String, String> headers); |
||||
|
|
||||
|
@GetMapping("/jmreport/field/tree/{report-id}") |
||||
|
JiMuResult<List<List<JimuReportFieldTreeResultDTO>>> fieldTree(@PathVariable("report-id") String reportId); |
||||
|
|
||||
|
@GetMapping("jmreport/loadDbData/{report-id}") |
||||
|
JiMuResult<JimuReportDbDataResultDTO> loadDbData(@PathVariable("report-id") String reportId); |
||||
|
|
||||
|
@PostMapping("jmreport/exportAllExcelStream") |
||||
|
Response exportAllExcelStream(JimuReportExportRequestDTO param); |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
package com.epmet.commons.feignclient.feigns.fallback; |
||||
|
|
||||
|
import com.epmet.commons.feignclient.dtos.JiMuPage; |
||||
|
import com.epmet.commons.feignclient.dtos.JiMuResult; |
||||
|
import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO; |
||||
|
import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO; |
||||
|
import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; |
||||
|
import feign.Response; |
||||
|
import org.springframework.util.MultiValueMap; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/8/8 13:53 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
public class JiMuReportOpenFeignClientFallback implements JiMuReportOpenFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public JiMuResult<JiMuPage<JiMuReportDetailResultDTO>> getList(Integer pageNo, Integer pageSize, String name, String reportType, String token, MultiValueMap<String, String> headers) { |
||||
|
JiMuResult<JiMuPage<JiMuReportDetailResultDTO>> rst = new JiMuResult<>(false, "请求失败", 200, null,null); |
||||
|
return rst; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JiMuResult<Map<String,Object>> getReport(String id,String apiUrl,String params,MultiValueMap<String, String> headers) { |
||||
|
JiMuResult<Map<String,Object>> rst = new JiMuResult<>(false, "请求失败", 200, null,null); |
||||
|
return rst; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JiMuResult<JimuReportDbDataResultDTO> loadDbData(String reportId) { |
||||
|
JiMuResult<JimuReportDbDataResultDTO> rst = new JiMuResult<>(false, "请求失败", 200, null,null); |
||||
|
return rst; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Response exportAllExcelStream(JimuReportExportRequestDTO param) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JiMuResult<List<List<JimuReportFieldTreeResultDTO>>> fieldTree(String reportId) { |
||||
|
JiMuResult rst = new JiMuResult<>(false, "请求失败", 200, null,null); |
||||
|
return rst; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.commons.feignclient.feigns.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2022/8/9 13:27 |
||||
|
* @DESC |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
public class JiMuReportOpenFeignClientFallbackFactory implements FallbackFactory<JiMuReportOpenFeignClientFallback> { |
||||
|
|
||||
|
private JiMuReportOpenFeignClientFallback fallback = new JiMuReportOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public JiMuReportOpenFeignClientFallback create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.commons.tools.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* 标记一个接口,它会被报表服务所调用 |
||||
|
*/ |
||||
|
@Target(ElementType.METHOD) |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Documented |
||||
|
public @interface ReportRequest { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
package com.epmet.commons.tools.aspect; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.bean.copier.CopyOptions; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.EpmetException; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.aspectj.lang.JoinPoint; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Before; |
||||
|
import org.aspectj.lang.reflect.MethodSignature; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.context.request.RequestAttributes; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import java.lang.reflect.Parameter; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 需要被报表服务请求的api,需要加上这个注解 |
||||
|
* 1.该注解会取url中固定的key,去redis获取参数,给入参dto复制 |
||||
|
*/ |
||||
|
@Aspect |
||||
|
@Component |
||||
|
@Order(20) |
||||
|
@Slf4j |
||||
|
public class ReportRequestAspect { |
||||
|
|
||||
|
/** |
||||
|
* 从redis中取参数用 |
||||
|
*/ |
||||
|
public static final String REPORT_REDIS_KEY = "paramKey"; |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
@Before("@annotation(com.epmet.commons.tools.annotation.ReportRequest)") |
||||
|
public void before(JoinPoint point) { |
||||
|
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
||||
|
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
||||
|
String paramKey = sra.getRequest().getParameter(REPORT_REDIS_KEY); |
||||
|
if (StringUtils.isBlank(paramKey)) { |
||||
|
// 没有携带key参数,直接跳过
|
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
Map<String, Object> cachedParams = redisUtils.hGetAll(paramKey); |
||||
|
if (cachedParams == null || cachedParams.size() == 0) { |
||||
|
log.warn("【报表服务】根据paramKey:{}未获取到有效的参数缓存。", paramKey); |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "参数失效", "参数失效"); |
||||
|
// redis中没有此参数
|
||||
|
} |
||||
|
|
||||
|
// 使用方法签名获取出参数class列表
|
||||
|
Object[] args = point.getArgs(); |
||||
|
MethodSignature signature = (MethodSignature) point.getSignature(); |
||||
|
Parameter[] parameters = signature.getMethod().getParameters(); |
||||
|
fillArgsToRequestBody(args, cachedParams, parameters); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 将redis中取出的参数,赋值到指定的入参dto上 |
||||
|
* @param args |
||||
|
* @param storedParams |
||||
|
*/ |
||||
|
private void fillArgsToRequestBody(Object[] args, Map<String, Object> storedParams, Parameter[] parameters) { |
||||
|
for (int i = 0; i < args.length; i++) { |
||||
|
Object arg = args[i]; |
||||
|
RequestBody requestBodyAnno = parameters[i].getAnnotation(RequestBody.class); |
||||
|
if (arg != null && requestBodyAnno != null) { |
||||
|
Object argBean = BeanUtil.mapToBean(storedParams, arg.getClass(), true); |
||||
|
|
||||
|
// "pageSize", "pageNo", "isPage"三个属性不从redis拷贝,而是取传递雇来的
|
||||
|
// redis里面的字段如果是null,则不会赋值给arg
|
||||
|
BeanUtil.copyProperties(argBean, arg, new CopyOptions(null, true, "pageSize", "pageNo", "isPage")); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
public enum CollectUrlEnum { |
||||
|
|
||||
|
|
||||
|
URL_PRE("subpages/points/pages/fangyi/xinxi/create/index", "小程序码跳转地址"), |
||||
|
GET_CODE_URL("https://api.weixin.qq.com/wxa/getwxacode?access_token=", "获取二维码的url"); |
||||
|
|
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
CollectUrlEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,131 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcWorkLogDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 唯一标识 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
private String allAgencyName; |
||||
|
|
||||
|
/** |
||||
|
* agency_id的所有上级 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id【场所区域】 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id【场所区域】 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 日志类型【admin库sys_dict_data表value值】 |
||||
|
*/ |
||||
|
private String logType; |
||||
|
|
||||
|
/** |
||||
|
* 日志日期 |
||||
|
*/ |
||||
|
private String logDate; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 手机 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 创建人名称 |
||||
|
*/ |
||||
|
private String createdUser; |
||||
|
|
||||
|
/** |
||||
|
* url |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 附件 |
||||
|
*/ |
||||
|
private List<IcWorkLogFileDTO> fileList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,89 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcWorkLogFileDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 唯一标识 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 日志Id |
||||
|
*/ |
||||
|
private String logId; |
||||
|
|
||||
|
/** |
||||
|
* 地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 文件名 |
||||
|
*/ |
||||
|
private String fileName; |
||||
|
|
||||
|
/** |
||||
|
* 文件名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 文件类型,0图片 |
||||
|
*/ |
||||
|
private String fileType; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author wgf |
||||
|
* @date 2022/8/3 11:18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CollectHouseFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2636608477324780974L; |
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 房屋状态 1:出租 0:自住 2:闲置 3:未售出 |
||||
|
*/ |
||||
|
private Integer rentFlag; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 居住人数 |
||||
|
*/ |
||||
|
private Integer resiNumber; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author wgf |
||||
|
* @date 2022/8/3 11:18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GetHouseInfoToCollectFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2636608477324780974L; |
||||
|
|
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class ReportHouseTestFormDTO { |
||||
|
|
||||
|
private Integer pageNo = 1; |
||||
|
private Integer pageSize = 20; |
||||
|
private String id; |
||||
|
private String test; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,124 @@ |
|||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* desc:房屋列表结果类 |
||||
|
* |
||||
|
* @author liujianjun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcHouseInfoCollectResultDTO implements Serializable { |
||||
|
|
||||
|
|
||||
|
private static final long serialVersionUID = 4963952996288796744L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 所属组织的PIDS,包括agency,grid |
||||
|
*/ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 小区id |
||||
|
*/ |
||||
|
private String neighborHoodId; |
||||
|
|
||||
|
/** |
||||
|
* 片区id,neighbor_hood_part.id,可为空。 |
||||
|
*/ |
||||
|
private String partId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 所属单元id |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
|
||||
|
/** |
||||
|
* 房屋名字后台插入时生成 |
||||
|
*/ |
||||
|
private String houseName; |
||||
|
|
||||
|
/** |
||||
|
* 全名:小区,楼栋,单元,房屋 |
||||
|
*/ |
||||
|
private String fullName; |
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋类型,这里存储字典value就可以 |
||||
|
*/ |
||||
|
private String houseType; |
||||
|
|
||||
|
/** |
||||
|
* 存储字典value |
||||
|
*/ |
||||
|
private String purpose; |
||||
|
|
||||
|
/** |
||||
|
* 1:出租 0:自住 2:闲置 3:未出售 |
||||
|
*/ |
||||
|
private Integer rentFlag; |
||||
|
|
||||
|
/** |
||||
|
* 房主姓名 |
||||
|
*/ |
||||
|
private String ownerName; |
||||
|
|
||||
|
/** |
||||
|
* 房主电话 |
||||
|
*/ |
||||
|
private String ownerPhone; |
||||
|
|
||||
|
/** |
||||
|
* 房主身份证号 |
||||
|
*/ |
||||
|
private String ownerIdCard; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private BigDecimal sort; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 房屋编码 |
||||
|
*/ |
||||
|
private String houseCode; |
||||
|
private String houseQrcodeUrl; |
||||
|
|
||||
|
/** |
||||
|
* 居住人数 |
||||
|
*/ |
||||
|
private Integer resiNumber; |
||||
|
/** |
||||
|
* 房屋可编辑编码 |
||||
|
*/ |
||||
|
private String coding; |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class ReportHouseTestResultDTO { |
||||
|
private String houseId; |
||||
|
private String doorName; |
||||
|
private String fullName; |
||||
|
} |
||||
@ -0,0 +1,88 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils; |
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcWorkLogDTO; |
||||
|
import com.epmet.excel.IcWorkLogExcel; |
||||
|
import com.epmet.service.IcWorkLogService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icWorkLog") |
||||
|
public class IcWorkLogController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcWorkLogService icWorkLogService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<IcWorkLogDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcWorkLogDTO> page = icWorkLogService.page(params); |
||||
|
return new Result<PageData<IcWorkLogDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<IcWorkLogDTO> get(@PathVariable("id") String id){ |
||||
|
IcWorkLogDTO data = icWorkLogService.get(id); |
||||
|
return new Result<IcWorkLogDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody IcWorkLogDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icWorkLogService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody IcWorkLogDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icWorkLogService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icWorkLogService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcWorkLogDTO> list = icWorkLogService.list4Export(params); |
||||
|
if(CollectionUtils.isEmpty(list)){ |
||||
|
IcWorkLogDTO dto = new IcWorkLogDTO(); |
||||
|
dto.setId(""); |
||||
|
list.add(dto); |
||||
|
} |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcWorkLogExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcWorkLogFileDTO; |
||||
|
import com.epmet.excel.IcWorkLogFileExcel; |
||||
|
import com.epmet.service.IcWorkLogFileService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icWorkLogFile") |
||||
|
public class IcWorkLogFileController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcWorkLogFileService icWorkLogFileService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<IcWorkLogFileDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcWorkLogFileDTO> page = icWorkLogFileService.page(params); |
||||
|
return new Result<PageData<IcWorkLogFileDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<IcWorkLogFileDTO> get(@PathVariable("id") String id){ |
||||
|
IcWorkLogFileDTO data = icWorkLogFileService.get(id); |
||||
|
return new Result<IcWorkLogFileDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcWorkLogFileDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icWorkLogFileService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody IcWorkLogFileDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icWorkLogFileService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icWorkLogFileService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcWorkLogFileDTO> list = icWorkLogFileService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcWorkLogFileExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.ReportRequest; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.ReportHouseTestFormDTO; |
||||
|
import com.epmet.dto.result.ReportHouseTestResultDTO; |
||||
|
import com.epmet.service.HouseService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("report") |
||||
|
public class ReportController { |
||||
|
|
||||
|
@Autowired |
||||
|
private HouseService houseService; |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
/** |
||||
|
* todo 测试用的 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("houses/test") |
||||
|
@ReportRequest |
||||
|
public Result<PageData<ReportHouseTestResultDTO>> listHouses(@RequestBody ReportHouseTestFormDTO input) { |
||||
|
System.out.println("id:"+input.getId()); |
||||
|
PageData<ReportHouseTestResultDTO> pageData = houseService.listHouses4ReportTest(input.getId(), input.getPageNo(), input.getPageSize()); |
||||
|
return new Result<PageData<ReportHouseTestResultDTO>>().ok(pageData); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("put") |
||||
|
public void put() { |
||||
|
final HashMap<String, Object> m = new HashMap<>(); |
||||
|
m.put("test", "aaa"); |
||||
|
|
||||
|
redisUtils.hMSet("ttt", m); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.IcWorkLogDTO; |
||||
|
import com.epmet.entity.IcWorkLogEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcWorkLogDao extends BaseDao<IcWorkLogEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 分页列表 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<com.epmet.dto.IcWorkLogDTO> |
||||
|
* @author zhy |
||||
|
* @date 2022/8/9 17:23 |
||||
|
*/ |
||||
|
List<IcWorkLogDTO> listPage(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 导出列表 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<com.epmet.dto.IcWorkLogDTO> |
||||
|
* @author zhy |
||||
|
* @date 2022/8/9 17:23 |
||||
|
*/ |
||||
|
List<IcWorkLogDTO> list4Export(Map<String, Object> params); |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcWorkLogFileEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcWorkLogFileDao extends BaseDao<IcWorkLogFileEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* |
||||
|
* @param logId |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void deleteByLogId(@Param("logId") String logId); |
||||
|
} |
||||
@ -0,0 +1,79 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_work_log") |
||||
|
public class IcWorkLogEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* agency_id的所有上级 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id【场所区域】 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 日志类型【admin库sys_dict_data表value值】 |
||||
|
*/ |
||||
|
private String logType; |
||||
|
|
||||
|
/** |
||||
|
* 日志日期 |
||||
|
*/ |
||||
|
private String logDate; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
private String content; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 手机 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 创建人名称 |
||||
|
*/ |
||||
|
private String createdUser; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_work_log_file") |
||||
|
public class IcWorkLogFileEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 日志Id |
||||
|
*/ |
||||
|
private String logId; |
||||
|
|
||||
|
/** |
||||
|
* 地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 文件名 |
||||
|
*/ |
||||
|
private String fileName; |
||||
|
|
||||
|
/** |
||||
|
* 文件类型,0图片 |
||||
|
*/ |
||||
|
private String fileType; |
||||
|
|
||||
|
/** |
||||
|
* 内容 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcWorkLogExcel { |
||||
|
|
||||
|
@Excel(name = "网格员", width = 15) |
||||
|
private String createdUser; |
||||
|
|
||||
|
@Excel(name = "联系电话", width = 20) |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "所属镇街", width = 25) |
||||
|
private String allAgencyName; |
||||
|
|
||||
|
@Excel(name = "所属网格", width = 25) |
||||
|
private String gridName; |
||||
|
|
||||
|
@Excel(name = "标题", width = 25) |
||||
|
private String title; |
||||
|
|
||||
|
@Excel(name = "日志时间", width = 15) |
||||
|
private String logDate; |
||||
|
|
||||
|
@Excel(name = "日志类型", width = 15) |
||||
|
private String logType; |
||||
|
|
||||
|
@Excel(name = "内容", width = 100) |
||||
|
private String content; |
||||
|
|
||||
|
@Excel(name = "备注", width = 50) |
||||
|
private String remark; |
||||
|
|
||||
|
@Excel(name = "照片", width = 50) |
||||
|
private String url; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcWorkLogFileExcel { |
||||
|
|
||||
|
@Excel(name = "唯一标识") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "客户Id") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "日志Id") |
||||
|
private String logId; |
||||
|
|
||||
|
@Excel(name = "地址") |
||||
|
private String url; |
||||
|
|
||||
|
@Excel(name = "文件名") |
||||
|
private String fileName; |
||||
|
|
||||
|
@Excel(name = "文件类型,0图片") |
||||
|
private String fileType; |
||||
|
|
||||
|
@Excel(name = "内容") |
||||
|
private Integer sort; |
||||
|
|
||||
|
@Excel(name = "删除标识:0.未删除 1.已删除") |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
@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; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcWorkLogFileRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcWorkLogRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,88 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcWorkLogFileDTO; |
||||
|
import com.epmet.entity.IcWorkLogFileEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
public interface IcWorkLogFileService extends BaseService<IcWorkLogFileEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcWorkLogFileDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
PageData<IcWorkLogFileDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcWorkLogFileDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
List<IcWorkLogFileDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcWorkLogFileDTO |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
IcWorkLogFileDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void save(IcWorkLogFileDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void update(IcWorkLogFileDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* |
||||
|
* @param logId |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void deleteByLogId(String logId); |
||||
|
} |
||||
@ -0,0 +1,88 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcWorkLogDTO; |
||||
|
import com.epmet.entity.IcWorkLogEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
public interface IcWorkLogService extends BaseService<IcWorkLogEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcWorkLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
PageData<IcWorkLogDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcWorkLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
List<IcWorkLogDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcWorkLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
List<IcWorkLogDTO> list4Export(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcWorkLogDTO |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
IcWorkLogDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void save(IcWorkLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void update(IcWorkLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-08-05 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.dao.IcWorkLogFileDao; |
||||
|
import com.epmet.dto.IcWorkLogFileDTO; |
||||
|
import com.epmet.entity.IcWorkLogFileEntity; |
||||
|
import com.epmet.redis.IcWorkLogFileRedis; |
||||
|
import com.epmet.service.IcWorkLogFileService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志附件 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcWorkLogFileServiceImpl extends BaseServiceImpl<IcWorkLogFileDao, IcWorkLogFileEntity> implements IcWorkLogFileService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcWorkLogFileRedis icWorkLogFileRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcWorkLogFileDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcWorkLogFileEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcWorkLogFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcWorkLogFileDTO> list(Map<String, Object> params) { |
||||
|
List<IcWorkLogFileEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcWorkLogFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcWorkLogFileEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
String logId = (String)params.get("logId"); |
||||
|
|
||||
|
QueryWrapper<IcWorkLogFileEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(logId), "LOG_ID", logId); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcWorkLogFileDTO get(String id) { |
||||
|
IcWorkLogFileEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcWorkLogFileDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcWorkLogFileDTO dto) { |
||||
|
IcWorkLogFileEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogFileEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcWorkLogFileDTO dto) { |
||||
|
IcWorkLogFileEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogFileEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void deleteByLogId(String id) { |
||||
|
baseDao.deleteByLogId(id); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,226 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.enums.DictTypeEnum; |
||||
|
import com.epmet.commons.tools.exception.EpmetException; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dao.CustomerAgencyDao; |
||||
|
import com.epmet.dao.CustomerGridDao; |
||||
|
import com.epmet.dao.IcWorkLogDao; |
||||
|
import com.epmet.dto.CustomerStaffDTO; |
||||
|
import com.epmet.dto.IcWorkLogDTO; |
||||
|
import com.epmet.dto.IcWorkLogFileDTO; |
||||
|
import com.epmet.dto.form.CustomerGridFormDTO; |
||||
|
import com.epmet.dto.result.GridDetailResultDTO; |
||||
|
import com.epmet.entity.CustomerAgencyEntity; |
||||
|
import com.epmet.entity.CustomerGridEntity; |
||||
|
import com.epmet.entity.IcWorkLogEntity; |
||||
|
import com.epmet.entity.IcWorkLogFileEntity; |
||||
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
||||
|
import com.epmet.feign.EpmetUserFeignClient; |
||||
|
import com.epmet.redis.IcWorkLogRedis; |
||||
|
import com.epmet.service.IcWorkLogFileService; |
||||
|
import com.epmet.service.IcWorkLogService; |
||||
|
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 javax.annotation.Resource; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格员工作日志 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-08-05 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcWorkLogServiceImpl extends BaseServiceImpl<IcWorkLogDao, IcWorkLogEntity> implements IcWorkLogService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcWorkLogRedis icWorkLogRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private LoginUserUtil loginUserUtil; |
||||
|
|
||||
|
@Autowired |
||||
|
private IcWorkLogFileService icWorkLogFileService; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetUserFeignClient epmetUserFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; |
||||
|
|
||||
|
@Resource |
||||
|
private CustomerGridDao customerGridDao; |
||||
|
|
||||
|
@Resource |
||||
|
private CustomerAgencyDao customerAgencyDao; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcWorkLogDTO> page(Map<String, Object> params) { |
||||
|
params.put("customerId", loginUserUtil.getLoginUserCustomerId()); |
||||
|
params.put("createdBy", loginUserUtil.getLoginUserId()); |
||||
|
IPage<IcWorkLogDTO> page = getPage(params); |
||||
|
List<IcWorkLogDTO> list = baseDao.listPage(params); |
||||
|
return new PageData<>(list, page.getTotal()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcWorkLogDTO> list(Map<String, Object> params) { |
||||
|
List<IcWorkLogEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcWorkLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcWorkLogDTO> list4Export(Map<String, Object> params) { |
||||
|
params.put("customerId", loginUserUtil.getLoginUserCustomerId()); |
||||
|
params.put("createdBy", loginUserUtil.getLoginUserId()); |
||||
|
List<IcWorkLogDTO> list = baseDao.list4Export(params); |
||||
|
Result<Map<String, String>> result = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.LOG_TYPE.getCode()); |
||||
|
if (!result.success() || null == result.getData()) { |
||||
|
throw new EpmetException("查询字典信息失败" + JSON.toJSONString(result)); |
||||
|
} else { |
||||
|
Map<String, String> logTypeMap = result.getData(); |
||||
|
list.forEach(item -> item.setLogType(logTypeMap.get(item.getLogType()))); |
||||
|
} |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcWorkLogEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcWorkLogEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcWorkLogDTO get(String id) { |
||||
|
IcWorkLogEntity entity = baseDao.selectById(id); |
||||
|
IcWorkLogDTO dto = ConvertUtils.sourceToTarget(entity, IcWorkLogDTO.class); |
||||
|
if (StringUtils.isNotBlank(entity.getGridId())) { |
||||
|
CustomerGridEntity grid = customerGridDao.selectById(entity.getGridId()); |
||||
|
dto.setGridName(grid.getGridName()); |
||||
|
} |
||||
|
|
||||
|
Map<String, Object> params = new HashMap<>(2); |
||||
|
params.put("logId", id); |
||||
|
List<IcWorkLogFileDTO> files = icWorkLogFileService.list(params); |
||||
|
files.forEach(item -> item.setName(item.getFileName())); |
||||
|
dto.setFileList(files); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcWorkLogDTO dto) { |
||||
|
dto.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
//查询当前申请用户的基本信息
|
||||
|
CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); |
||||
|
customerStaffParam.setUserId(loginUserUtil.getLoginUserId()); |
||||
|
Result<CustomerStaffDTO> staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); |
||||
|
if (!staffInfo.success() || null == staffInfo.getData()) { |
||||
|
throw new EpmetException("查询用户信息失败" + JSON.toJSONString(customerStaffParam)); |
||||
|
} else { |
||||
|
dto.setCreatedUser(staffInfo.getData().getRealName()); |
||||
|
dto.setMobile(staffInfo.getData().getMobile()); |
||||
|
} |
||||
|
// 组织机构处理
|
||||
|
orgHandle(dto); |
||||
|
|
||||
|
IcWorkLogEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogEntity.class); |
||||
|
insert(entity); |
||||
|
|
||||
|
// 处理附件
|
||||
|
fileHandle(dto.getFileList(), entity.getId()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcWorkLogDTO dto) { |
||||
|
// 组织机构处理
|
||||
|
orgHandle(dto); |
||||
|
|
||||
|
IcWorkLogEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogEntity.class); |
||||
|
updateById(entity); |
||||
|
|
||||
|
// 处理附件
|
||||
|
icWorkLogFileService.deleteByLogId(entity.getId()); |
||||
|
fileHandle(dto.getFileList(), entity.getId()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 附件处理 |
||||
|
* |
||||
|
* @param fileList |
||||
|
* @param logId |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/8/9 17:24 |
||||
|
*/ |
||||
|
private void fileHandle(List<IcWorkLogFileDTO> fileList, String logId) { |
||||
|
if (!fileList.isEmpty()) { |
||||
|
fileList.forEach(item -> { |
||||
|
item.setLogId(logId); |
||||
|
item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
item.setFileType(NumConstant.ZERO_STR); |
||||
|
}); |
||||
|
|
||||
|
List<IcWorkLogFileEntity> fileEntityList = ConvertUtils.sourceToTarget(fileList, IcWorkLogFileEntity.class); |
||||
|
icWorkLogFileService.insertBatch(fileEntityList); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 组织机构处理 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
* @author zhy |
||||
|
* @date 2022/8/12 17:30 |
||||
|
*/ |
||||
|
private void orgHandle(IcWorkLogDTO dto) { |
||||
|
if (StringUtils.isNotBlank(dto.getGridId())) { |
||||
|
// 查询网格信息
|
||||
|
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); |
||||
|
customerGridFormDTO.setGridId(dto.getGridId()); |
||||
|
GridDetailResultDTO gridDetailResultDTO = customerGridDao.griddetail(customerGridFormDTO); |
||||
|
if (gridDetailResultDTO != null) { |
||||
|
dto.setAgencyId(gridDetailResultDTO.getAgencyId()); |
||||
|
dto.setPids(gridDetailResultDTO.getPIds()); |
||||
|
} |
||||
|
} else { |
||||
|
CustomerAgencyEntity agency = customerAgencyDao.getAgencyByUserId(loginUserUtil.getLoginUserId(), loginUserUtil.getLoginUserCustomerId()); |
||||
|
if (agency != null) { |
||||
|
dto.setAgencyId(agency.getId()); |
||||
|
dto.setPids(agency.getPids()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
ALTER TABLE `epmet_gov_org`.`customer_grid` |
||||
|
ADD COLUMN `sort` int(11) NULL COMMENT '网格排序' AFTER `MOBILE`; |
||||
@ -0,0 +1 @@ |
|||||
|
alter table ic_neighbor_hood add COLUMN `QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '二维码地址'; |
||||
@ -0,0 +1,67 @@ |
|||||
|
/* |
||||
|
Navicat Premium Data Transfer |
||||
|
|
||||
|
Source Server : epmet_cloud_dev_gov |
||||
|
Source Server Type : MySQL |
||||
|
Source Server Version : 50726 |
||||
|
Source Host : 192.168.1.140:3306 |
||||
|
Source Schema : epmet_gov_org |
||||
|
|
||||
|
Target Server Type : MySQL |
||||
|
Target Server Version : 50726 |
||||
|
File Encoding : 65001 |
||||
|
|
||||
|
Date: 09/08/2022 10:41:08 |
||||
|
*/ |
||||
|
|
||||
|
SET NAMES utf8mb4; |
||||
|
SET FOREIGN_KEY_CHECKS = 0; |
||||
|
|
||||
|
-- ---------------------------- |
||||
|
-- Table structure for ic_work_log |
||||
|
-- ---------------------------- |
||||
|
DROP TABLE IF EXISTS `ic_work_log`; |
||||
|
CREATE TABLE `ic_work_log` ( |
||||
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一标识', |
||||
|
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户Id', |
||||
|
`AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织Id', |
||||
|
`PIDS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id的所有上级', |
||||
|
`GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格Id【场所区域】', |
||||
|
`TITLE` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', |
||||
|
`LOG_TYPE` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志类型【admin库sys_dict_data表value值】', |
||||
|
`LOG_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志日期', |
||||
|
`CONTENT` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容', |
||||
|
`REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', |
||||
|
`MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机', |
||||
|
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', |
||||
|
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
`CREATED_USER` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人名称', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格员工作日志' ROW_FORMAT = COMPACT; |
||||
|
|
||||
|
-- ---------------------------- |
||||
|
-- Table structure for ic_work_log_file |
||||
|
-- ---------------------------- |
||||
|
DROP TABLE IF EXISTS `ic_work_log_file`; |
||||
|
CREATE TABLE `ic_work_log_file` ( |
||||
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一标识', |
||||
|
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户Id', |
||||
|
`LOG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '日志Id', |
||||
|
`URL` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地址', |
||||
|
`FILE_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名', |
||||
|
`FILE_TYPE` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '文件类型,0图片', |
||||
|
`SORT` int(11) NOT NULL DEFAULT 0 COMMENT '内容', |
||||
|
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', |
||||
|
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
PRIMARY KEY (`ID`) USING BTREE |
||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格员工作日志附件' ROW_FORMAT = COMPACT; |
||||
|
|
||||
|
SET FOREIGN_KEY_CHECKS = 1; |
||||
@ -0,0 +1 @@ |
|||||
|
ALTER TABLE epmet_gov_org.ic_work_log MODIFY COLUMN GRID_ID varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '网格Id【场所区域】'; |
||||
Binary file not shown.
@ -0,0 +1,118 @@ |
|||||
|
<?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.epmet.dao.IcWorkLogDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcWorkLogEntity" id="icWorkLogMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="agencyId" column="AGENCY_ID"/> |
||||
|
<result property="pids" column="PIDS"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="title" column="TITLE"/> |
||||
|
<result property="logType" column="LOG_TYPE"/> |
||||
|
<result property="logDate" column="LOG_DATE"/> |
||||
|
<result property="content" column="CONTENT"/> |
||||
|
<result property="remark" column="REMARK"/> |
||||
|
<result property="mobile" column="MOBILE"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<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"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
<select id="listPage" resultType="com.epmet.dto.IcWorkLogDTO"> |
||||
|
SELECT |
||||
|
* |
||||
|
FROM |
||||
|
ic_work_log wl |
||||
|
WHERE |
||||
|
wl.DEL_FLAG = '0' |
||||
|
AND wl.CUSTOMER_ID = #{customerId} |
||||
|
<if test="logType != null and logType != '' "> |
||||
|
AND wl.LOG_TYPE = #{logType} |
||||
|
</if> |
||||
|
<if test="createdUser != null and createdUser != '' "> |
||||
|
AND wl.created_user = #{createdUser} |
||||
|
</if> |
||||
|
<if test="gridId != null and gridId != '' "> |
||||
|
AND wl.GRID_ID = #{gridId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND (wl.AGENCY_ID = #{agencyId} |
||||
|
OR wl.PIDS LIKE concat('%',#{agencyId}, '%' )) |
||||
|
</if> |
||||
|
<if test="mobile != null and mobile != '' "> |
||||
|
AND wl.MOBILE = #{mobile} |
||||
|
</if> |
||||
|
<if test="isSelf != null and isSelf != ''"> |
||||
|
<if test="isSelf == '1' or isSelf == 1"> |
||||
|
AND wl.CREATED_BY = #{createdBy} |
||||
|
</if> |
||||
|
</if> |
||||
|
<if test="startTime != null and startTime != '' "> |
||||
|
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) >= #{startTime} |
||||
|
</if> |
||||
|
<if test="endTime != null and endTime != '' "> |
||||
|
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) <= #{endTime} |
||||
|
</if> |
||||
|
ORDER BY wl.CREATED_TIME DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="list4Export" resultType="com.epmet.dto.IcWorkLogDTO"> |
||||
|
SELECT |
||||
|
wl.CREATED_USER, |
||||
|
wl.MOBILE, |
||||
|
IF |
||||
|
( |
||||
|
a.ALL_PARENT_NAME = '', |
||||
|
a.ORGANIZATION_NAME, |
||||
|
CONCAT( a.ALL_PARENT_NAME, '-', a.ORGANIZATION_NAME )) AS allAgencyName, |
||||
|
g.GRID_NAME, |
||||
|
wl.TITLE, |
||||
|
wl.LOG_DATE, |
||||
|
wl.LOG_TYPE, |
||||
|
wl.CONTENT, |
||||
|
wl.REMARK, |
||||
|
GROUP_CONCAT( f.URL ) AS url |
||||
|
FROM |
||||
|
ic_work_log wl |
||||
|
LEFT JOIN customer_grid g ON wl.GRID_ID = g.id |
||||
|
LEFT JOIN customer_agency a ON wl.AGENCY_ID = a.id |
||||
|
LEFT JOIN ic_work_log_file f ON f.LOG_ID = wl.id |
||||
|
WHERE |
||||
|
wl.DEL_FLAG = '0' |
||||
|
AND wl.CUSTOMER_ID = #{customerId} |
||||
|
<if test="logType != null and logType != '' "> |
||||
|
AND wl.LOG_TYPE = #{logType} |
||||
|
</if> |
||||
|
<if test="createdUser != null and createdUser != '' "> |
||||
|
AND wl.created_user = #{createdUser} |
||||
|
</if> |
||||
|
<if test="gridId != null and gridId != '' "> |
||||
|
AND wl.GRID_ID = #{gridId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND (wl.AGENCY_ID = #{agencyId} |
||||
|
OR wl.PIDS LIKE concat('%',#{agencyId}, '%' )) |
||||
|
</if> |
||||
|
<if test="mobile != null and mobile != '' "> |
||||
|
AND wl.MOBILE = #{mobile} |
||||
|
</if> |
||||
|
<if test="isSelf != null and isSelf != '' and isSelf == '1' "> |
||||
|
AND wl.CREATED_BY = #{createdBy} |
||||
|
</if> |
||||
|
<if test="startTime != null and startTime != '' "> |
||||
|
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) >= #{startTime} |
||||
|
</if> |
||||
|
<if test="endTime != null and endTime != '' "> |
||||
|
AND DATE_FORMAT( wl.CREATED_TIME, '%Y-%m-%d' ) <= #{endTime} |
||||
|
</if> |
||||
|
GROUP BY |
||||
|
wl.id, wl.CREATED_TIME |
||||
|
ORDER BY wl.CREATED_TIME DESC |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?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.epmet.dao.IcWorkLogFileDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcWorkLogFileEntity" id="icWorkLogFileMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="logId" column="LOG_ID"/> |
||||
|
<result property="url" column="URL"/> |
||||
|
<result property="fileName" column="FILE_NAME"/> |
||||
|
<result property="fileType" column="FILE_TYPE"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<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"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
<delete id="deleteByLogId"> |
||||
|
DELETE |
||||
|
FROM |
||||
|
ic_work_log_file |
||||
|
WHERE |
||||
|
LOG_ID = #{logId} |
||||
|
</delete> |
||||
|
</mapper> |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue