Browse Source

Merge remote-tracking branch 'remotes/origin/dev_shibei_match' into shibei_master

release
jianjun 4 years ago
parent
commit
b848e1082e
  1. 8
      epmet-auth-client/pom.xml
  2. 32
      epmet-auth-client/src/main/java/com/epmet/auth/feign/EpmetAuthOpenFeignClient.java
  3. 20
      epmet-auth-client/src/main/java/com/epmet/auth/feign/fallback/EpmetAuthOpenFeignClientFallback.java
  4. 20
      epmet-auth-client/src/main/java/com/epmet/auth/feign/fallback/EpmetAuthOpenFeignClientFallbackFactory.java
  5. 24
      epmet-auth/src/main/java/com/epmet/controller/GovWebController.java
  6. 8
      epmet-auth/src/main/java/com/epmet/service/GovWebService.java
  7. 43
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  8. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  9. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  10. 123
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  11. 8
      epmet-gateway/pom.xml
  12. 22
      epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java
  13. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  14. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  15. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  16. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  17. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  18. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  19. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java
  20. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  21. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  22. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  23. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  24. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java
  25. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java
  26. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  27. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java
  28. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  29. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  30. 41
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  31. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  32. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  33. 17
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  34. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  35. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  36. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

8
epmet-auth-client/pom.xml

@ -10,5 +10,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>epmet-auth-client</artifactId> <artifactId>epmet-auth-client</artifactId>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project> </project>

32
epmet-auth-client/src/main/java/com/epmet/auth/feign/EpmetAuthOpenFeignClient.java

@ -0,0 +1,32 @@
package com.epmet.auth.feign;
import com.epmet.auth.feign.fallback.EpmetAuthOpenFeignClientFallbackFactory;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:25
*/
@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallbackFactory = EpmetAuthOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallbackFactory = EpmetAuthOpenFeignClientFallbackFactory.class, url = "http://localhost:8081")
public interface EpmetAuthOpenFeignClient {
/**
* @Description 根据客户Id查询志愿者用户Id集合
* @param uuid
* @param userId
* @param customerId
* @return
* @author wangc
* @date 2020.08.13 10:22
**/
@PostMapping("/auth/govweb/generateTokenBySSOKey/{uuid}/{userId}")
Result<String> generateTokenBySSOKey(@PathVariable(value = "uuid")String uuid, @PathVariable String userId, @RequestParam String customerId);
}

20
epmet-auth-client/src/main/java/com/epmet/auth/feign/fallback/EpmetAuthOpenFeignClientFallback.java

@ -0,0 +1,20 @@
package com.epmet.auth.feign.fallback;
import com.epmet.auth.feign.EpmetAuthOpenFeignClient;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:26
*/
public class EpmetAuthOpenFeignClientFallback implements EpmetAuthOpenFeignClient {
@Override
public Result<String> generateTokenBySSOKey(String uuid, String userId, String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_AUTH_SERVER, "generateTokenBySSOKey", uuid, userId,customerId);
}
}

20
epmet-auth-client/src/main/java/com/epmet/auth/feign/fallback/EpmetAuthOpenFeignClientFallbackFactory.java

@ -0,0 +1,20 @@
package com.epmet.auth.feign.fallback;
import com.epmet.auth.feign.EpmetAuthOpenFeignClient;
import com.epmet.commons.tools.exception.ExceptionUtils;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class EpmetAuthOpenFeignClientFallbackFactory implements FallbackFactory<EpmetAuthOpenFeignClient> {
private EpmetAuthOpenFeignClientFallback fallback = new EpmetAuthOpenFeignClientFallback();
@Override
public EpmetAuthOpenFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

24
epmet-auth/src/main/java/com/epmet/controller/GovWebController.java

@ -6,18 +6,17 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.GovWebService; import com.epmet.service.GovWebService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author sun * @author sun
* @Description PC工作端-登陆服务 * @Description PC工作端-登陆服务
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("govweb") @RequestMapping("govweb")
public class GovWebController { public class GovWebController {
@ -63,5 +62,22 @@ public class GovWebController {
return new Result().ok(publicKey); return new Result().ok(publicKey);
} }
/**
* desc: 根据用户id
*
* @return com.epmet.commons.tools.utils.Result
* @author LiuJanJun
* @date 2021/3/8 5:07 下午
*/
@PostMapping("generateTokenBySSOKey/{uuid}/{userId}")
public Result<String> generateTokenBySSOKey(@PathVariable(value = "uuid")String uuid,@PathVariable String userId,@RequestParam String customerId) {
//判断是否非法登陆
/*if (!redisUtils.hasKey(RedisKeys.getIcLoginAuthKey(customerId,uuid))){
log.error("有人使用userid:{} 非法登陆",userId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
}*/
return new Result().ok(govWebService.generateTokenBySSOKey(customerId,userId));
}
} }

8
epmet-auth/src/main/java/com/epmet/service/GovWebService.java

@ -16,4 +16,12 @@ public interface GovWebService {
* @Description PC工作端-工作人员登录 * @Description PC工作端-工作人员登录
**/ **/
UserTokenResultDTO login(GovWebLoginFormDTO formDTO); UserTokenResultDTO login(GovWebLoginFormDTO formDTO);
/**
* desc:根据用户Id 生成token
* @return
* @param customerId
* @param userId
*/
String generateTokenBySSOKey(String customerId, String userId);
} }

43
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -1,8 +1,11 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.common.token.constant.LoginConstant; import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.CpUserDetailRedis;
@ -94,6 +97,46 @@ public class GovWebServiceImpl implements GovWebService {
} }
@Override
public String generateTokenBySSOKey(String customerId, String userId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (staffInfo == null){
log.error("工作人员信息不存在,customerId:{},userId:{}", customerId, userId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
}
// 生成token
Map<String, Object> map = new HashMap<>();
map.put("app", "gov");
map.put("client", "web");
map.put("userId", userId);
String token = jwtTokenUtils.createToken(map);
int expire = jwtTokenProperties.getExpire();
String orgIdPath = thirdLoginService.getOrgIdPath(userId);
String[] orgIdPathParts = orgIdPath.split(":");
GovTokenDto tokenDto = new GovTokenDto();
tokenDto.setCustomerId(customerId);
tokenDto.setApp("gov");
tokenDto.setClient("web");
tokenDto.setUserId(userId);
tokenDto.setToken(token);
tokenDto.setUpdateTime(System.currentTimeMillis());
tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime());
tokenDto.setAgencyId(staffInfo.getAgencyId());
tokenDto.setRootAgencyId(staffInfo.getAgencyId());
//tokenDto.setDeptIdList(thirdLoginService.getDeptartmentIdList(userId));
//tokenDto.setGridIdList(thirdLoginService.getGridIdList(userId));
//tokenDto.setRoleList(thirdLoginService.queryGovStaffRoles(userId, orgIdPathParts[orgIdPathParts.length - 1]));
//tokenDto.setOrgIdPath(orgIdPath);
cpUserDetailRedis.set(tokenDto, expire);
logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss"));
return token;
}
/** /**
* 生成PC工作端token * 生成PC工作端token
* @author sun * @author sun

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -157,6 +157,7 @@ public enum EpmetErrorCode {
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"), COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"), MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"),
ERROR_DATE(8533, "不合理日期"),
// 该错误不会提示给前端,只是后端传输错误信息用。 // 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -636,4 +636,15 @@ public class RedisKeys {
public static String getOrgTreeCacheKey(String agencyId) { public static String getOrgTreeCacheKey(String agencyId) {
return rootPrefix.concat("org:temp:orgtree").concat(agencyId); return rootPrefix.concat("org:temp:orgtree").concat(agencyId);
} }
/**
* desc:获取第三方登陆跳转 授权key
*
* @param customerId
* @param uuid
* @return
*/
public static String getIcLoginAuthKey(String customerId, String uuid) {
return rootPrefix.concat("sys:iclogin:authkey:").concat(customerId).concat(StrConstant.COLON).concat(uuid);
}
} }

123
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -945,4 +945,127 @@ public class DateUtils {
return result; return result;
} }
/**
* @Description 获取工作日时间没有排除节假日
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:51 上午
*/
public static Date getWorkDay(Date startDate, int num) {
Date tomorrow = null;
int delay = 1;
while (delay <= num) {
tomorrow = getTomorrow(startDate);
if (!isWeekend(tomorrow)) {
delay++;
}
startDate = tomorrow;
}
return startDate;
}
/**
* @Description 根据开始时间计算出 当前日期后n个工作日没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWorkDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回工作日
if (!isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n个周末没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWeekendDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回周末
if (isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n天没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getEveryDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
startDate = tomorrow;
}
return result;
}
/**
* @Description 判断日期字符串是否为周末
* @param date eg:yyyy-MM-dd
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static boolean isWeekend(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY;
}
/**
* @Description 获取tomorrow的日期
* @param startDate
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static Date getTomorrow(Date startDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(startDate);
cal.add(Calendar.DAY_OF_MONTH, +1);
return cal.getTime();
}
} }

8
epmet-gateway/pom.xml

@ -77,6 +77,12 @@
<artifactId>epmet-admin-client</artifactId> <artifactId>epmet-admin-client</artifactId>
<version>2.0.0</version> <version>2.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-auth-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -129,7 +135,7 @@
<!-- gateway routes --> <!-- gateway routes -->
<!-- 1、认证服务 --> <!-- 1、认证服务 -->
<!-- <gateway.routes.epmet-auth-server.uri>http://localhost:8081</gateway.routes.epmet-auth-server.uri>--> <!--<gateway.routes.epmet-auth-server.uri>http://localhost:8081</gateway.routes.epmet-auth-server.uri>-->
<gateway.routes.epmet-auth-server.uri>lb://epmet-auth-server</gateway.routes.epmet-auth-server.uri> <gateway.routes.epmet-auth-server.uri>lb://epmet-auth-server</gateway.routes.epmet-auth-server.uri>
<!-- 2、Admin服务 --> <!-- 2、Admin服务 -->
<gateway.routes.epmet-admin-server.uri>lb://epmet-admin-server</gateway.routes.epmet-admin-server.uri> <gateway.routes.epmet-admin-server.uri>lb://epmet-admin-server</gateway.routes.epmet-admin-server.uri>

22
epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java

@ -1,11 +1,15 @@
package com.epmet.auth; package com.epmet.auth;
import com.alibaba.fastjson.JSON;
import com.epmet.auth.feign.EpmetAuthOpenFeignClient;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.BaseTokenDto; import com.epmet.commons.tools.security.dto.BaseTokenDto;
import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.filter.CpProperty; import com.epmet.filter.CpProperty;
import com.epmet.jwt.JwtTokenUtils; import com.epmet.jwt.JwtTokenUtils;
import io.jsonwebtoken.Claims; import io.jsonwebtoken.Claims;
@ -40,6 +44,8 @@ public class InternalAuthProcessor extends AuthProcessor {
@Autowired @Autowired
private CpProperty cpProperty; private CpProperty cpProperty;
@Autowired
private EpmetAuthOpenFeignClient epmetAuthOpenFeignClient;
@Override @Override
public ServerWebExchange auth(ServerWebExchange exchange, GatewayFilterChain chain) { public ServerWebExchange auth(ServerWebExchange exchange, GatewayFilterChain chain) {
@ -70,6 +76,22 @@ public class InternalAuthProcessor extends AuthProcessor {
userId = (String) claims.get(AppClientConstant.USER_ID); userId = (String) claims.get(AppClientConstant.USER_ID);
expiration = claims.getExpiration(); expiration = claims.getExpiration();
baseTokenDto = cpUserDetailRedis.get(app, client, userId, BaseTokenDto.class); baseTokenDto = cpUserDetailRedis.get(app, client, userId, BaseTokenDto.class);
//市北数字社区 如果redis里不存在 则自动登陆 生成token放入redis
if (baseTokenDto == null){
Result<String> stringResult = epmetAuthOpenFeignClient.generateTokenBySSOKey("123", userId, CustomerIdConstant.SHI_BEI_CUSTOMER_ID);
if (stringResult != null && stringResult.success() && StringUtils.isNotBlank(stringResult.getData())){
baseTokenDto = new BaseTokenDto();
baseTokenDto.setApp(app);
baseTokenDto.setClient(client);
baseTokenDto.setUserId(userId);
String tokenNew = stringResult.getData();
//把传过来的token用新的token 替换
token = tokenNew;
baseTokenDto.setToken(tokenNew);
baseTokenDto.setCustomerId(CustomerIdConstant.SHI_BEI_CUSTOMER_ID);
}
logger.info("stringResult"+ JSON.toJSONString(stringResult));
}
} }
} }

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
@ -15,7 +16,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean; import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean;
@ -30,7 +30,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -41,7 +40,6 @@ import java.net.URLEncoder;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -302,11 +300,11 @@ public class GovOrgController {
PageData<GridMemberDataAnalysisResultDTO> page; PageData<GridMemberDataAnalysisResultDTO> page;
int pageNo = 0; int pageNo = NumConstant.ONE;
int pageSize = 1000; int pageSize = NumConstant.ONE_THOUSAND;
do { do {
page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo, pageSize, startTime, endTime, false); page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo++, pageSize, startTime, endTime, false);
List<GridMemberDataAnalysisResultDTO> pageList = page.getList(); List<GridMemberDataAnalysisResultDTO> pageList = page.getList();
List<GridMemberDataAnalysisExcelExportBean> exportBeans = ConvertUtils.sourceToTarget(pageList, GridMemberDataAnalysisExcelExportBean.class); List<GridMemberDataAnalysisExcelExportBean> exportBeans = ConvertUtils.sourceToTarget(pageList, GridMemberDataAnalysisExcelExportBean.class);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2172,6 +2172,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "【pcwork查询网格员数据统计列表】传入时间条件有误"); // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "【pcwork查询网格员数据统计列表】传入时间条件有误");
//} //}
PageHelper.startPage(pageNo, pageSize, needCount);
return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID); return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID);
} }
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -342,7 +342,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
re.setTotalTime(totalTime == "" ? "0分钟" : totalTime); re.setTotalTime(totalTime == "" ? "0分钟" : totalTime);
//re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h"); //re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h");
//re.setTotalTime(re.getTimeNum() / 60 + "分钟"); //re.setTotalTime(re.getTimeNum() / 60 + "分钟");
list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName())); //list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()));
}); });
return resultList; return resultList;

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java

@ -126,7 +126,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
if (null != gridInfo) { if (null != gridInfo) {
user.setGridName(gridInfo.getGridName()); user.setGridName(gridInfo.getGridName());
user.setOrgId(gridInfo.getAgencyId()); user.setOrgId(gridInfo.getAgencyId());
user.setOrgName(gridInfo.getOrgName()); if(StringUtils.isNotBlank(gridInfo.getOrgName())){
user.setOrgName(gridInfo.getOrgName());
}else{
GridInfoDTO gridInfoDTO = customerGridService.queryGridInfoDTO(user.getGridId());
user.setOrgName(gridInfoDTO.getOrgName());
}
//原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开 //原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开
user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA)); user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA));
}else{ }else{

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -110,8 +110,7 @@
LEFT JOIN customer_agency ca LEFT JOIN customer_agency ca
ON (cg.PID = CA.ID) ON (cg.PID = CA.ID)
WHERE WHERE
CG.CUSTOMER_ID =#{customerId} cg.id = #{gridId}
and cg.id = #{gridId}
</select> </select>
<select id="getCustomerStaffGridList" resultType="com.epmet.dto.org.CustomerStaffGridDTO"> <select id="getCustomerStaffGridList" resultType="com.epmet.dto.org.CustomerStaffGridDTO">

4
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -25,6 +25,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -616,7 +618,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
//地区编码 同一级不允许重名 //地区编码 同一级不允许重名
List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim()); List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim());
if (CollUtil.isNotEmpty(list)) { if (CollUtil.isNotEmpty(list)) {
throw new RenException("name已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "name已存在", "组织名称已存在");
} }
AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO(); AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO();
areaCodeChildDTO.setName(formDTO.getName().trim()); areaCodeChildDTO.setName(formDTO.getName().trim());

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java

@ -54,5 +54,7 @@ public class GetListSocietyOrgFormDTO implements Serializable {
private String staffId; private String staffId;
//token中userId所属组织的pid //token中userId所属组织的pid
private String pids; private String pids;
//token中userId所属组织Id
private String agencyId;
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -117,7 +117,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) { public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) {
GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO(); GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds()); //2022.1.7 应产品要求 当前组织只能看到自己组织添加的社会组织数据,不允许看其他下级的
//formDTO.setPids(staffInfoCache.getAgencyPIds());
formDTO.setAgencyId(staffInfoCache.getAgencyId());
//1.根据查询条件分页查询社会组织数据 //1.根据查询条件分页查询社会组织数据
PageInfo<SocietyOrgListResultDTO> result = PageInfo<SocietyOrgListResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1069,7 +1069,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价");
} }
//用户输入的完成情况,走内容审核 //用户输入的完成情况,走内容审核
textScan(formDTO.getFinishDesc()); if(StringUtils.isNotBlank(formDTO.getFinishDesc())){
textScan(formDTO.getFinishDesc());
}
//当前操作用户是工作端用户还是居民端用户 //当前操作用户是工作端用户还是居民端用户
String userType = ""; String userType = "";
if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) { if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) {

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -24,8 +24,11 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId} AND customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''"> <!-- <if test="pids != null and pids.trim() != ''">
AND pids LIKE CONCAT('%', #{pids}, '%') AND pids LIKE CONCAT('%', #{pids}, '%')
</if>-->
<if test="agencyId != null and agencyId.trim() != ''">
AND agency_id = #{agencyId}
</if> </if>
<if test="societyName != null and societyName.trim() != ''"> <if test="societyName != null and societyName.trim() != ''">
AND society_name LIKE CONCAT('%', #{societyName}, '%') AND society_name LIKE CONCAT('%', #{societyName}, '%')

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -47,6 +47,11 @@ public class AllMattersResultDTO implements Serializable {
@JsonIgnore @JsonIgnore
private String endTime; private String endTime;
/**
* 预约类型每天everyDay工作日workDay周末weekend
*/
private String appointmentType;
public AllMattersResultDTO() { public AllMattersResultDTO() {
this.matterName = ""; this.matterName = "";
this.allowTime = ""; this.allowTime = "";
@ -55,5 +60,6 @@ public class AllMattersResultDTO implements Serializable {
this.address = ""; this.address = "";
this.workPhone = ""; this.workPhone = "";
this.centerName = ""; this.centerName = "";
this.appointmentType="";
} }
} }

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java

@ -27,8 +27,11 @@ public class AppointmentTimeResultDTO implements Serializable {
*/ */
private List<TimeDTO> timeDetail; private List<TimeDTO> timeDetail;
private List<String> dateList;
public AppointmentTimeResultDTO() { public AppointmentTimeResultDTO() {
this.appointmentType = ""; this.appointmentType = "";
this.timeDetail = new ArrayList<>(); this.timeDetail = new ArrayList<>();
this.dateList = new ArrayList<>();
} }
} }

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java

@ -13,4 +13,8 @@ public interface PartyServiceCenterConstant {
String APPOINTMENT_STATUS_APPOINTING = "appointing"; String APPOINTMENT_STATUS_APPOINTING = "appointing";
String APPOINTMENT_STATUS_CANCEL = "cancel"; String APPOINTMENT_STATUS_CANCEL = "cancel";
String APPOINTMENT_TYPE_EVERY_DAY = "everyDay";
String APPOINTMENT_TYPE_WORK_DAY = "workDay";
String APPOINTMENT_TYPE_WEEKEND = "weekend";
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -306,5 +306,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId); OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
int updateSubAgencyAreaCode(@Param("customerId") String customerId, @Param("originalParentAreaCode")String originalParentAreaCode,@Param("operateUserId") String operateUserId); int updateSubAgencyAreaCode(@Param("customerId") String customerId, @Param("originalParentAreaCode")String originalParentAreaCode,@Param("operateUserId") String operateUserId);
int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId);
} }

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java

@ -101,4 +101,12 @@ public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity>
* @Date 2020/12/15 10:05 * @Date 2020/12/15 10:05
**/ **/
int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId); int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId);
int updateSubDeptAreaCode(@Param("customerId") String customerId,
@Param("areaCode")String areaCode,
@Param("operateUserId") String operateUserId);
int updateDeptAreaCode(@Param("agencyId")String agencyId,
@Param("areaCode")String areaCode,
@Param("operateUserId") String operateUserId);
} }

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -351,4 +351,10 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Description 网格组织信息 * @Description 网格组织信息
**/ **/
CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId); CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId);
int updateSubGridAreaCode(@Param("customerId") String customerId,
@Param("agencyId")String agencyId,
@Param("operateUserId") String operateUserId);
int updateGridAreaCode(@Param("agencyId")String agencyId, @Param("areaCode")String areaCode,@Param("operateUserId") String operateUserId);
} }

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
@ -33,6 +34,7 @@ import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.RoleKeyConstants;
import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
@ -93,7 +95,8 @@ public class AgencyServiceImpl implements AgencyService {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired @Autowired
private IcBuildingDao icBuildingDao; private IcBuildingDao icBuildingDao;
@Autowired
private CustomerDepartmentDao customerDepartmentDao;
/** /**
* @param formDTO * @param formDTO
@ -152,9 +155,24 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setCode(formDTO.getCode()); originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts()); originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile()); originalEntity.setMobile(formDTO.getMobile());
if (StringUtils.isNotBlank(originalEntity.getAreaCode())
&& originalEntity.getAreaCode().contains("UD")
&& StringUtils.isNotBlank(formDTO.getAreaCode())
&& "other".equals(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改");
}
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalEntity.getAreaCode())) { if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalEntity.getAreaCode())) {
CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid());
//如果修改了areaCode。 //如果修改了areaCode。
customerAgencyDao.updateSubAgencyAreaCode(originalEntity.getCustomerId(), originalEntity.getAreaCode(), formDTO.getUserId()); if(StringUtils.isNotBlank(originalEntity.getAreaCode())){
//如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。
// customerAgencyDao.updateSubAgencyAreaCode(originalEntity.getCustomerId(), originalEntity.getAreaCode(), formDTO.getUserId());
customerAgencyDao.updateSubAgencyAreaCodeById(originalEntity.getCustomerId(), originalEntity.getId(), formDTO.getUserId());
//网格的
customerGridDao.updateSubGridAreaCode(originalEntity.getCustomerId(), originalEntity.getId(), formDTO.getUserId());
//部门的
customerDepartmentDao.updateSubDeptAreaCode(originalEntity.getCustomerId(), originalEntity.getAreaCode(), formDTO.getUserId());
}
//判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码 //判断areaCodeSwitch:open: 选择地区编码必填;closed: 无需选择地区编码
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) {
@ -166,19 +184,28 @@ public class AgencyServiceImpl implements AgencyService {
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg());
} }
originalEntity.setAreaCode(formDTO.getAreaCode()); originalEntity.setAreaCode(formDTO.getAreaCode());
originalEntity.setParentAreaCode(parent.getAreaCode());
}else{ }else{
//如果选择的是other,需要自定义一个编码 //如果选择的是other,需要自定义一个编码
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO();
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel()); addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel());
addAreaCodeFormDTO.setParentAreaCode(formDTO.getAreaCode()); addAreaCodeFormDTO.setParentAreaCode(parent.getAreaCode());
addAreaCodeFormDTO.setName(formDTO.getAgencyName()); addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO); Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) { if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); if (addAreaCodeResult.getCode() > 8000) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义area_code异常" + addAreaCodeResult.getMsg());
} else {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
} }
originalEntity.setAreaCode(addAreaCodeResult.getData()); originalEntity.setAreaCode(addAreaCodeResult.getData());
originalEntity.setParentAreaCode(parent.getAreaCode());
} }
} }
//更新直属部门和直属网格的areaCode
customerGridDao.updateGridAreaCode(originalEntity.getId(),formDTO.getAreaCode(),formDTO.getUserId());
customerDepartmentDao.updateDeptAreaCode(originalEntity.getId(),formDTO.getAreaCode(),formDTO.getUserId());
} }
//1:更新当前组织信息 //1:更新当前组织信息

41
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -275,6 +275,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -322,6 +336,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) { public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -423,6 +451,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
throw new RenException("事项不存在..."); throw new RenException("事项不存在...");
} }
result.setAppointmentType(matter.getAppointmentType()); result.setAppointmentType(matter.getAppointmentType());
result.setDateList(getDateList(result.getAppointmentType()));
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate()) .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate())
@ -487,6 +516,18 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result; return result;
} }
public List<String> getDateList(String type) {
List<String> result = new ArrayList<>();
if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_EVERY_DAY)){
result = DateUtils.getEveryDayList(new Date(),NumConstant.SEVEN);
}else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_WORK_DAY)){
result = DateUtils.getWorkDayList(new Date(),NumConstant.SEVEN);
}else {
result = DateUtils.getWeekendDayList(new Date(),NumConstant.SEVEN);
}
return result;
}
/** /**
* @Description 党群服务中心预约记录 * @Description 党群服务中心预约记录
* @param formDTO * @param formDTO

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -742,4 +742,16 @@
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
AND PARENT_AREA_CODE LIKE concat( #{originalParentAreaCode}, '%' ) AND PARENT_AREA_CODE LIKE concat( #{originalParentAreaCode}, '%' )
</update> </update>
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency
SET AREA_CODE = '',
PARENT_AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
</mapper> </mapper>

18
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -87,4 +87,22 @@
UPDATED_TIME=NOW() UPDATED_TIME=NOW()
where id=#{deptId} where id=#{deptId}
</update> </update>
<update id="updateSubDeptAreaCode" parameterType="map">
update customer_department
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND AREA_CODE LIKE concat(#{areaCode}, '%' )
</update>
<update id="updateDeptAreaCode" parameterType="map">
update customer_department
SET AREA_CODE = #{areaCode},
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where del_flag='0'
and agency_id=#{agencyId}
</update>
</mapper> </mapper>

17
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -755,4 +755,21 @@
AND cg.id = #{gridId} AND cg.id = #{gridId}
</select> </select>
<update id="updateSubGridAreaCode" parameterType="map">
update customer_grid
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<update id="updateGridAreaCode" parameterType="map">
update customer_grid
SET AREA_CODE = #{areaCode},
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where del_flag='0'
and pid=#{agencyId}
</update>
</mapper> </mapper>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -64,7 +64,8 @@
IFNULL(cm.MATTER_IMG,'') AS matterImg, IFNULL(cm.MATTER_IMG,'') AS matterImg,
c.ADDRESS, c.ADDRESS,
c.WORK_PHONE, c.WORK_PHONE,
c.CENTER_NAME c.CENTER_NAME,
cm.APPOINTMENT_TYPE as appointmentType
FROM ic_party_service_center c FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0) INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0 AND c.DEL_FLAG = 0

28
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -218,12 +218,14 @@ public class CustomerStaffController {
Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO); Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (result.success()) {
mq.setCustomerId(fromDTO.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(result.getData().getUserId()); mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgType("staff"); mq.setOrgId(result.getData().getUserId());
mq.setType("staff_create"); mq.setOrgType("staff");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return result; return result;
@ -240,12 +242,14 @@ public class CustomerStaffController {
Result result = customerStaffService.editStaff(fromDTO); Result result = customerStaffService.editStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (result.success()) {
mq.setCustomerId(fromDTO.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(fromDTO.getStaffId()); mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgType("staff"); mq.setOrgId(fromDTO.getStaffId());
mq.setType("staff_change"); mq.setOrgType("staff");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("staff_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return result; return result;

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -491,6 +491,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
//2.查询网格信息并赋值 //2.查询网格信息并赋值
Map<String, CustomerGridDTO> map = new HashMap<>(); Map<String, CustomerGridDTO> map = new HashMap<>();
for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) { for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) {
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
if (map.containsKey(r.getGridId())) { if (map.containsKey(r.getGridId())) {
r.setGridName(map.get(r.getGridId()).getGridName()); r.setGridName(map.get(r.getGridId()).getGridName());
continue; continue;
@ -512,12 +517,6 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
r.setGridName(resultGrid.getData().getGridName()); r.setGridName(resultGrid.getData().getGridName());
map.put(r.getGridId(), resultGrid.getData()); map.put(r.getGridId(), resultGrid.getData());
} }
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
} }
//3.封装数据并返回 //3.封装数据并返回
resultDTO.setTotal((int)result.getTotal()); resultDTO.setTotal((int)result.getTotal());

Loading…
Cancel
Save