diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 44ca89df30..3f23ee88c8 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -9,10 +9,7 @@ import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.ThirdLoginService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -219,4 +216,16 @@ public class ThirdLoginController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(thirdLoginService.govLoginInternalDing(formDTO)); } + + /** + * 根据免登授权码, 获取登录用户身份 + * + * @param authCode 烟台认证中心 授权码 + * @return + */ + @PostMapping("sso-govlogin-yantai/{authCode}") + public Result yantaiSSOLogin(@PathVariable(value = "authCode") String authCode) { + return new Result().ok(thirdLoginService.yanTaiSSOLogin(authCode)); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java index 7a0517574a..6658ab5770 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java @@ -38,5 +38,7 @@ public class ResiDingAppLoginResDTO { * false:未注册 */ private Boolean regFlag; + + private String realName; } diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index dff5e129e5..f939656023 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -117,4 +117,11 @@ public interface ThirdLoginService { * @return */ UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO); + + /** + * desc:烟台sso根据authCode 获取本系统token + * @param authCode + * @return + */ + UserTokenResultDTO yanTaiSSOLogin(String authCode); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 92e1de27a5..91828cb561 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -95,6 +95,7 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { //5.生成token存到redis并返回 UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setCustomerId(formDTO.getCustomerId()); userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); return userTokenResultDTO; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 25524fa9e0..3e1e580fce 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -6,8 +6,10 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.alibaba.fastjson.JSON; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; @@ -366,6 +368,10 @@ public class LoginServiceImpl implements LoginService { } else { logger.error(String.format("运营人员%s退出成功,清空菜单和权限redis异常", tokenDto.getUserId())); } + //如果是工作端退出,删除当前工作人员缓存 + if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ + CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(),tokenDto.getUserId()); + } return new Result(); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 9850feb4b3..3d2c2ebee0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -27,6 +27,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.api.yt.YantaiApi; +import com.epmet.commons.tools.utils.api.yt.YantaiSSOUser; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; import com.epmet.constant.SmsTemplateConstant; @@ -35,10 +37,7 @@ import com.epmet.dto.dingres.DingUserDetailDTO; import com.epmet.dto.dingres.V2UserGetuserinfoResDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.*; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; @@ -98,6 +97,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol private EpmetUserFeignClient epmetUserFeignClient; @Autowired private GovWebService govWebService; + @Autowired + private ThirdOpenFeignClient thirdOpenFeignClient; /** * @param formDTO @@ -1030,14 +1031,13 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol public ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO) { // 获取用户手机号 log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO)); - ResiDingAppLoginResDTO resDTO = null; - resDTO = new ResiDingAppLoginResDTO(); + ResiDingAppLoginResDTO resDTO = new ResiDingAppLoginResDTO(); resDTO.setCustomerId(getCurrentCustomerId()); // 1、获取用户手机号 DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode()); dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); - + resDTO.setRealName(dingLoginResiFormDTO.getNick()); // 2、调用userfeign接口获取userId、注册网格相关信息 Result loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { @@ -1079,6 +1079,20 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol return govWebService.loginByThirdPlatform(loginGovParam); } + @Override + public UserTokenResultDTO yanTaiSSOLogin(String authCode) { + YantaiSSOUser ssoUserInfo = YantaiApi.getLoginToken(authCode); + if (ssoUserInfo== null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"登录失败-sso获取用户失败","登录失败-sso获取用户失败"); + } + + GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO(); + loginGovParam.setCustomerId("1535072605621841922"); + loginGovParam.setPhone(ssoUserInfo.getMobile()); + + return govWebService.loginByThirdPlatform(loginGovParam); + } + /** * 最原始的企业内部应用开发,不授权给产品服务商 * @param miniAppId diff --git a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm index 1e489dca52..c26eeb8447 100644 --- a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm @@ -2,7 +2,6 @@ package ${package}.controller; import ${main}.commons.tools.aop.NoRepeatSubmit; import ${main}.commons.tools.page.PageData; -import ${main}.commons.tools.utils.ExcelUtils; import ${main}.commons.tools.utils.Result; import ${main}.commons.tools.validator.AssertUtils; import ${main}.commons.tools.validator.ValidatorUtils; @@ -10,7 +9,6 @@ import ${main}.commons.tools.validator.group.AddGroup; import ${main}.commons.tools.validator.group.UpdateGroup; import ${main}.commons.tools.validator.group.DefaultGroup; import ${package}.dto.${className}DTO; -import ${package}.excel.${className}Excel; import ${package}.service.${className}Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -71,12 +69,4 @@ public class ${className}Controller { return new Result(); } - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List<${className}DTO> list = ${classname}Service.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class); - } - - - } diff --git a/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm b/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm index f0bcfe2a7e..de6efd193d 100644 --- a/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm @@ -9,7 +9,6 @@ import ${package}.commons.tools.constant.FieldConstant; import ${package}.dao.${className}Dao; import ${package}.dto.${className}DTO; import ${package}.entity.${className}Entity; -import ${package}.redis.${className}Redis; import ${package}.service.${className}Service; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -29,9 +28,6 @@ import java.util.Map; @Service public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service { - @Autowired - private ${className}Redis ${classname}Redis; - @Override public PageData<${className}DTO> page(Map params) { IPage<${className}Entity> page = baseDao.selectPage( diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java new file mode 100644 index 0000000000..529bc6c34a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java @@ -0,0 +1,38 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:08 + */ +@Data +public class IcEventComDTO implements Serializable { + private static final long serialVersionUID = -5166489408303997740L; + /** + * 事件Id + */ + private String icEventId; + /** + * 事件内容 + */ + private String eventContent; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 0:已回复 1:已转项目 2:已转需求3:转议题 + */ + private String operationType; + + /** + * 项目、需求ID、议题id + */ + private String operationId; +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java new file mode 100644 index 0000000000..65c001b97f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java @@ -0,0 +1,65 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:06 + */ +@Data +public class TopicInfoComDTO implements Serializable { + private static final long serialVersionUID = 4242861917113716511L; + /** + * 话题id + */ + private String topicId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 图片列表 + */ + private List topicImgs; + + /** + * 话题语音-2022.10.10 + */ + private List topicVoices; + + /** + * 话题发表人(山东路168-尹女士) + */ + private String publishedUser; + + /** + * 话题发表时间 (时间戳 毫秒级) + */ + private Long publishedTime; + + + private String releaseTime; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题所属小组名称 + */ + private String groupName; + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java index 4dcf8869a1..001c7fe0ae 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java @@ -6,7 +6,7 @@ import java.util.List; /** - * @Description + * @Description 核酸结果查询 * @Author yzm * @Date 2022/9/26 17:04 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ec9ee8c209..0bf690a8ea 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -267,6 +267,7 @@ public enum EpmetErrorCode { NAT_RESULT_IS_NULL_ERROR(8932,"检测结果不能为空"), SAMPLE_TIME_IS_NULL_ERROR(8933,"采样时间不能为空"), SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR(8934,"检测时间或结果不能为空"), + ID_CARD_ERROR(8935,"请输入正确的身份证号或护照号"), MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 9164f6d142..bec26ea89d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -49,6 +49,10 @@ public class LogMsgSendFilter extends LevelFilter { //如果日志级别等于设置的日志级别 则发送消息 if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { try { + //排除其他包路径的东西 + if (!event.getLoggerName().startsWith(baseProjectPackage)){ + return super.decide(event); + } getServerInfo(); if (EnvEnum.LOCAL.getName().equals(activeEnv)){ //交给其他filter继续向下处理 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 49ab921e0f..63f27f195b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -537,6 +537,14 @@ public class RedisKeys { return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId); } + public static String getCustomerAllStaffInfoKey(String customerId) { + return rootPrefix.concat("gov:allCustomerStaff:").concat(customerId).concat(StrConstant.COLON).concat("*"); + } + + public static String getCustomerStaffInfoKeyByMobile(String customerId,String mobile) { + return rootPrefix.concat("gov:allCustomerStaff:").concat(customerId).concat(StrConstant.COLON).concat(mobile); + } + /** * @description 网格信息 * diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 7cb132b0f5..23a7f1dd3c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -57,7 +57,6 @@ public class CustomerOrgRedis { public static GridInfoCache getGridInfo(String gridId){ String key = RedisKeys.getGridInfoKey(gridId); Map grid = customerOrgRedis.redisUtils.hGetAll(key); - log.info("grid is {}", JSON.toJSONString(grid)); if (!CollectionUtils.isEmpty(grid)) { return ConvertUtils.mapToEntity(grid, GridInfoCache.class); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index 37904be02b..66abe790f3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; +import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoDTOCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -138,4 +139,32 @@ public class CustomerStaffRedis { return customerStaffRedis.redisUtils.delete(key); } + /** + * Desc: 拉取烟台用户时使用。 + * 根据客户ID 手机号获取工作人员信息,没有返回null + * @param customerId + * @param mobile + * @author zxc + * @date 2022/10/19 14:18 + */ + public static CustomerStaffInfoDTOCache getStaffInfoByMobile(String customerId, String mobile){ + String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, mobile); + Map roleMap = customerStaffRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(roleMap)) { + return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoDTOCache.class); + } + return null; + } + + /** + * Desc: 【烟台用】删除所有工作人员信息 + * @param customerId + * @author zxc + * @date 2022/10/19 14:28 + */ + public static void delAllCustomerStaff(String customerId){ + String key = RedisKeys.getCustomerAllStaffInfoKey(customerId); + customerStaffRedis.redisUtils.deleteByPattern(key); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java new file mode 100644 index 0000000000..70d5da942a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java @@ -0,0 +1,133 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2022/10/19 14:26 + * @DESC + */ +@Data +public class CustomerStaffInfoDTOCache implements Serializable { + + private static final long serialVersionUID = 6967736754443092229L; + + + /** + * ID + */ + private String id; + + /** + * 关联User表的主键Id + */ + private String userId; + + /** + * 账户 + */ + private String userAccount; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * fulltime专职parttime兼职 + */ + private String workType; + + /** + * 头像 + */ + private String headPhoto; + + /** + * inactive未激活,active已激活 + */ + private String activeFlag; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 未禁用enable,已禁用diabled + */ + private String enableFlag; + + /** + * 客户id + */ + private String customerId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 登录密码 + */ + private String password; + + /** + * 身份证号 + */ + private String idCard; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java index bb663ac327..044b1d393c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java @@ -1,6 +1,8 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.google.common.collect.Lists; import org.apache.commons.codec.binary.Base64; @@ -12,9 +14,13 @@ import org.springframework.stereotype.Component; import javax.annotation.PreDestroy; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import javax.validation.constraints.NotNull; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; import java.util.concurrent.ArrayBlockingQueue; /** @@ -115,36 +121,71 @@ public class DingdingMsgSender { running = false; } - /** - * 发送POST 请求 - * - * @param param 请求参数,JSON格式 - * @return - */ - private Result sendMsg(DingTalkTextMsg param) { - if (StringUtils.isBlank(param.getWebHook())) { - param.setWebHook(webHook); - } - if (StringUtils.isBlank(param.getSecret())) { - param.setSecret(secret); - } - Result result = new Result().error(); - Long timestamp = System.currentTimeMillis(); - try { - String stringToSign = timestamp + "\n" + param.getSecret(); - Mac mac = Mac.getInstance("HmacSHA256"); - mac.init(new SecretKeySpec(param.getSecret().getBytes(StandardCharsets.UTF_8), "HmacSHA256")); - byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8)); - String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); - String url = param.getWebHook(); - url = url.concat("×tamp=" + timestamp + "&sign=" + sign); - String jsonStrParam = param.getMsgContent(); - result = HttpClientManager.getInstance().sendPostByJSON(url, jsonStrParam); - } catch (Exception e) { - logger.warn("sendPostByJSON error", e); - } - return result; - } + /** + * 发送POST 请求 + * + * @param param 请求参数,JSON格式 + * @return + */ + @Deprecated + private Result sendMsg(DingTalkTextMsg param) { + if (StringUtils.isBlank(param.getWebHook())) { + param.setWebHook(webHook); + } + if (StringUtils.isBlank(param.getSecret())) { + param.setSecret(secret); + } + Result result = new Result().error(); + try { + String url = getUrlString(param, System.currentTimeMillis()); + String jsonStrParam = param.getMsgContent(); + result = HttpClientManager.getInstance().sendPostByJSON(url, jsonStrParam); + } catch (Exception e) { + logger.warn("sendPostByJSON error", e); + } + return result; + } + + @NotNull + private String getUrlString(DingTalkTextMsg param, Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException { + String stringToSign = timestamp + "\n" + param.getSecret(); + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(param.getSecret().getBytes(StandardCharsets.UTF_8), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8)); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); + String url = param.getWebHook(); + url = url.concat("×tamp=" + timestamp + "&sign=" + sign); + return url; + } + + /** + * 发送POST 请求 + * + * @param param 请求参数,JSON格式 + * @return + */ + public Result sendMsgSdk(DingTalkTextMsg param) { + if (StringUtils.isBlank(param.getWebHook())) { + param.setWebHook(webHook); + } + if (StringUtils.isBlank(param.getSecret())) { + param.setSecret(secret); + } + Result result = new Result().error(); + try { + String url = getUrlString(param, System.currentTimeMillis()); + DefaultDingTalkClient client = new DefaultDingTalkClient(url); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("text"); + OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); + text.setContent(param.getContent()); + request.setText(text); + client.execute(request); + } catch (Exception e) { + logger.warn("sendPostByJSON error", e); + } + return result; + } public static void main(String[] args) { for (int i = 0; i < 50; i++) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index 6427301a18..e04227d5dc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.*; @@ -16,6 +17,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 扫描内容工具类 @@ -31,6 +33,15 @@ public class ScanContentUtils { * @return */ public static Result imgSyncScan(String url, ImgScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); @@ -57,6 +68,15 @@ public class ScanContentUtils { * @return */ public static Result textSyncScan(String url, TextScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("textSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java new file mode 100644 index 0000000000..b5b7e96e09 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java @@ -0,0 +1,92 @@ + +package com.epmet.commons.tools.utils.api.yt; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:组织机构数据 实体类 + * @author liujianjun + */ +@Data +public class OrgData implements Serializable { + + /** + * 联系人姓名 + */ + private String contact; + /** + * 联系电话号码 + */ + private String contactTelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstNameOfOrganization; + + /** + * 组织机构全称 + */ + private String nameOfOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + /** + * 注册类型 + */ + private String registrationType; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditId; + + /** + * 上级ID + */ + private String pid; + + /** + * orgId全路径 + */ + private String pids; + + /** + * 上级组织名 + */ + private String parentOrgName; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java new file mode 100644 index 0000000000..6c2ca8c60a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java @@ -0,0 +1,199 @@ +package com.epmet.commons.tools.utils.api.yt; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.codec.binary.Base64; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.Security; + +/** + * 烟台的认证中心-国密sm4加解密 + */ +public class SM4UtilsForYanTai { + private static String SM4_KEY = "yaweisoftware@xy"; + //编码格式 + private static final Charset encryptCharset = StandardCharsets.UTF_8; + + public enum Algorithm { + SM4("SM4","SM4","国密四,key长16byte"); + private String keyAlgorithm; + private String transformation; + private String description;//描述 + Algorithm(String keyAlgorithm, String transformation, String description) { + this.keyAlgorithm = keyAlgorithm; + this.transformation = transformation; + this.description = description; + } + public String getKeyAlgorithm() { + return this.keyAlgorithm; + } + public String getTransformation() { + return this.transformation; + } + public String getDescription() { + return this.description; + } + } + + private static final String PROVIDER_NAME = "BC"; + static { + Security.addProvider(new BouncyCastleProvider()); + } + + /** + * 自定字符串产生密钥 + * @param algorithm 加解密算法 + * @param keyStr 密钥字符串 + * @param charset 编码字符集 + * @return 密钥 + */ + public static SecretKey genKeyByStr(Algorithm algorithm, String keyStr, Charset charset) { + return readKeyFromBytes(algorithm, keyStr.getBytes(charset)); + } + + /** + * 根据指定字节数组产生密钥 + * @param algorithm 加解密算法 + * @param keyBytes 密钥字节数组 + * @return 密钥 + */ + public static SecretKey readKeyFromBytes(Algorithm algorithm, byte[] keyBytes) { + return new SecretKeySpec(keyBytes, algorithm.getKeyAlgorithm()); + } + + /****************************加密*********************************/ + /** + * 加密字符串,并进行base64编码 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @param charset 编码字符集 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static String encryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) throws InvalidKeyException { + return Base64.encodeBase64String(encrypt(algorithm, key, data.getBytes(charset))); + } + + /** + * 加密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static byte[] encrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException { + try { + return cipherDoFinal(algorithm, Cipher.ENCRYPT_MODE, key, data); + } catch (BadPaddingException e) { + throw new RuntimeException(e);//明文没有具体格式要求,不会出错。所以这个异常不需要外部捕获。 + } + } + + /** + * 加解密字节数组 + * @param algorithm 加解密算法 + * @param opmode 操作:1加密,2解密 + * @param key 密钥 + * @param data 数据 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 解密密文错误(加密模式没有) + */ + private static byte[] cipherDoFinal(Algorithm algorithm, int opmode, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + Cipher cipher; + try { + cipher = Cipher.getInstance(algorithm.getTransformation(), PROVIDER_NAME); + } catch (Exception e) { + //NoSuchAlgorithmException:加密算法名是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchProviderException:Provider是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchPaddingException:没有特定的填充机制,与环境有关,业务没有办法处理。所以这个异常不需要外部捕获。 + throw new RuntimeException(e); + } + cipher.init(opmode, key); + try { + return cipher.doFinal(data); + } catch (IllegalBlockSizeException e) { + throw new RuntimeException(e);//业务不需要将数据分块(好像由底层处理了),如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + } + } + + /****************************解密*********************************/ + /** + * 对字符串先进行base64解码,再解密 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @param charset 编码字符集 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static String decryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) + throws InvalidKeyException, BadPaddingException { + return new String(decrypt(algorithm, key, Base64.decodeBase64(data)), charset); + } + + /** + * 解密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static byte[] decrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + return cipherDoFinal(algorithm, Cipher.DECRYPT_MODE, key, data); + } + + public static String Encrypt(String data) throws InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return encryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + public static String Decrypt(String data) throws BadPaddingException, InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return decryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + //加密 + public static String dealEncryptData(Object data) throws JsonProcessingException, InvalidKeyException { + ObjectMapper objectMapper = new ObjectMapper(); + String dataString = ""; + try { + if(data instanceof String){ + dataString = (String) data; + }else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataEncrypt = Encrypt(dataString); + return dataEncrypt; + }catch (Exception e){ + return dataString; + } + } + //解密 + public static String dealDecryptData(Object data) throws JsonProcessingException, BadPaddingException, InvalidKeyException { + String dataString = ""; + try { + ObjectMapper objectMapper = new ObjectMapper(); + if (data instanceof String) { + dataString = (String) data; + } else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataDecrypt = Decrypt(dataString); + return dataDecrypt; + }catch (Exception e){ + return dataString; + } + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java new file mode 100644 index 0000000000..1a9853705d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java @@ -0,0 +1,184 @@ +package com.epmet.commons.tools.utils.api.yt; + + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.pqc.math.linearalgebra.ByteUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; +import java.util.Arrays; + +/** + * sm4加密算法工具类 + * + * @explain sm4加密、解密与加密结果验证 可逆算法 + * @Autor:jingyao + */ +public class TestMs4 { + static { + Security.addProvider(new BouncyCastleProvider()); + } + + private static final String ENCODING = "UTF-8"; + public static final String ALGORITHM_NAME = "SM4"; + // 加密算法/分组加密模式/分组填充方式 + // PKCS5Padding-以8个字节为一组进行分组加密 + // 定义分组加密模式使用:PKCS5Padding + public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding"; + // 128-32位16进制;256-64位16进制 + public static final int DEFAULT_KEY_SIZE = 128; + + /** + * 生成ECB暗号 + * + * @param algorithmName 算法名称 + * @param mode 模式 + * @param key + * @return + * @throws Exception + * @explain ECB模式(电子密码本模式:Electronic codebook) + */ + private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception { + Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); + Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME); + cipher.init(mode, sm4Key); + return cipher; + } + + /** + * 自动生成密钥 + * + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @explain + */ + public static byte[] generateKey() throws Exception { + return generateKey(DEFAULT_KEY_SIZE); + } + + + //加密****************************************** + + /** + * @param keySize + * @return + * @throws Exception + * @explain 系统产生秘钥 + */ + public static byte[] generateKey(int keySize) throws Exception { + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME); + kg.init(keySize, new SecureRandom()); + return kg.generateKey().getEncoded(); + } + + /** + * sm4加密 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param paramStr 待加密字符串 + * @return 返回16进制的加密字符串 + * @throws Exception + * @explain 加密模式:ECB 密文长度不固定,会随着被加密字符串长度的变化而变化 + */ + public static String encryptEcb(String hexKey, String paramStr) throws Exception { + String cipherText = ""; + // 16进制字符串-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // String-->byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 加密后的数组 + byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData); + // byte[]-->hexString + cipherText = ByteUtils.toHexString(cipherArray); + return cipherText; + } + + /** + * 加密模式之Ecb + * + * @param key + * @param data + * @return + * @throws Exception + */ + public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key);//声称Ecb暗号,通过第二个参数判断加密还是解密 + return cipher.doFinal(data); + } + + //解密**************************************** + + /** + * sm4解密 + * + * @param hexKey 16进制密钥 + * @param cipherText 16进制的加密字符串(忽略大小写) + * @return 解密后的字符串 + * @throws Exception + * @explain 解密模式:采用ECB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + // 用于接收解密后的字符串 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 解密 + * + * @param key + * @param cipherText + * @return + * @throws Exception + * @explain + */ + public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key);//生成Ecb暗号,通过第二个参数判断加密还是解密 + return cipher.doFinal(cipherText); + } + + /** + * 校验加密前后的字符串是否为同一数据 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param cipherText 16进制加密后的字符串 + * @param paramStr 加密前的字符串 + * @return 是否为同一数据 + * @throws Exception + * @explain + */ + public static boolean verifyEcb(String hexKey, String cipherText, String paramStr) throws Exception { + // 用于接收校验结果 + boolean flag = false; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // 将16进制字符串转换成数组 + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] decryptData = decrypt_Ecb_Padding(keyData, cipherData); + // 将原字符串转换成byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 判断2个数组是否一致 + flag = Arrays.equals(decryptData, srcData); + return flag; + } + + public static void main(String[] args) throws Exception { + String text = "5d22ea44c7599a48f0d4446b1b7fbb4bb8353922df437d39c3a38549c0f2549cbd021ada00a8be83027ae06203c3daea2eedc5bd0875c7e509c7049045c5349577f2c21bcec328a5ea0bf341191e5bdba978566dddd16f1cf1928ff5cbd826dd33289fb45a8a04585f1f24ab04f59426371a5a0a0f2ee3e7b00d2bdfba7810524ce4c33130eda077546fa4c4191d0117f7a44e1cadac6c69a7d437653be1f958a459e0f025d471e09ab4636c38013032948ffb0827040ed6f3436be090f545186928a7b0b2bfc65782452606607ce8555ba130caacad73998da704428a07276a2699889c9872eebba5de8b72cdbe88705483293b00ab3ecb3aa57d283a4ecab40b71bc0a10e9ec626f07b2293255349fb2270d37e81c5c3d0de0b0f0706ed1872f60f039ce2e51effc39aef9747d67457e072cf3170a9c19589c1bab1a7d9d80"; + String s = TestMs4.decryptEcb("dbcff4c9f4774e6cb56080f279149d59", text); + System.out.println(s); + } + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java new file mode 100644 index 0000000000..b7d3abca4e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java @@ -0,0 +1,50 @@ + +package com.epmet.commons.tools.utils.api.yt; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:认证中心-用户信息 + * @author liujianjun + */ +@Data +public class UserData implements Serializable { + + /** + * 性别:todo 不知道是什么值 + */ + private String gender; + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + private String orderNumber; + /** + * 职务 + */ + private String position; + /** + * 职级 + */ + private String positionLevel; + /** + * 电话号码 + */ + private String telephoneNumber; + /** + * 用户编码/id + */ + private String userGuid; + /** + * 用户姓名 + */ + private String userName; + /** + * 人员路径 + */ + private String userPath; + + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java new file mode 100644 index 0000000000..8cf49c6410 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -0,0 +1,327 @@ +package com.epmet.commons.tools.utils.api.yt; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.fasterxml.jackson.core.JsonProcessingException; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; + +import javax.crypto.BadPaddingException; +import java.security.InvalidKeyException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2022/10/17 3:57 下午 + * @version: 1.0 + */ +@Slf4j +public class YantaiApi { + private static final String SSO_SERVER = "http://172.20.46.155:8080/sso/"; + /** + * 相当于 appKey + */ + private static final String CLIENT_ID = "1000009"; + /** + * 相当于 appSecret 用于解密 他们重定向回来的code 解密他们的token 获取用户嘻嘻 + */ + private static final String CLIENT_SECRET = "a1f9879119bc4080ab5575f832b7d98b"; + /** + * 调用sso后台api接口的 秘钥 + */ + private static final String SSO_API_TOKEN = "iJCDUgCBV/Zk5FkkaxLypA=="; + /** + * 政务网地址 + */ + private static final String SSO_BACKGROUND_SERVER_URL = "http://172.20.46.155:8082/"; + /** + * 互联网地址 + */ + //private static final String SSO_BACKGROUND_SERVER_URL = "http://120.220.248.247:8081/"; + + /** + * desc:根据组织id获取本级组织信息 + * + * @param organizationId + * @return + */ + public static OrgData getOuInfoByOuGuid(String organizationId) { + try { + if (StringUtils.isBlank(organizationId)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + String url = SSO_BACKGROUND_SERVER_URL + "person/ouinfo/getOuInfoByOuGuid"; + + Map paramMap = new HashMap<>(); + paramMap.put("organizationId",organizationIdEn); + + log.info("getOuInfoByOuGuid request param:{} url:{}",paramMap, url); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, getApiHeaderMap()); + log.info("getOuInfoByOuGuid request result:{}", result); + if (!result.success()){ + return new OrgData(); + } + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + log.warn("getOuInfoByOuGuid 接口错误"); + return new OrgData(); + } + //解密 + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + OrgData orgData = JSON.parseObject(data, OrgData.class); + log.info("getChildOuInfoByGuid request real result:{}", JSON.toJSONString(orgData)); + return orgData; + } catch (Exception e) { + log.error("getChildOuInfoByGuid exception", e); + } + return new OrgData(); + } + + /** + * desc:根据组织id获取下级组织 + * + * @param organizationId + * @return + */ + public static List getChildOuInfoByGuid(String organizationId) { + try { + if (StringUtils.isBlank(organizationId)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + String url = SSO_BACKGROUND_SERVER_URL + "person/ouinfo/getChildOuInfoByGuid"; + + Map paramMap = new HashMap<>(); + paramMap.put("organizationId",organizationIdEn); + + log.info("getChildOuInfoByGuid request param:{} url:{}",paramMap, url); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, getApiHeaderMap()); + log.info("getChildOuInfoByGuid request result:{}", result); + if (!result.success()){ + return new ArrayList<>(); + } + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + log.warn("getChildOuInfoByGuid 接口错误"); + return new ArrayList<>(); + } + //解密 + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + List orgData = JSON.parseArray(data, OrgData.class); + log.info("getChildOuInfoByGuid request real result:{}", JSON.toJSONString(orgData)); + return orgData; + } catch (Exception e) { + log.error("getChildOuInfoByGuid exception", e); + } + return new ArrayList<>(); + } + + /** + * desc:根据组织id获取下级组织 + * + * @param organizationId + * @return + */ + public static List getUserByOuGuid(String organizationId) { + try { + if (StringUtils.isBlank(organizationId)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + String url = SSO_BACKGROUND_SERVER_URL + "person/userInfo/getUserByOuGuid"; + + + Map paramMap = new HashMap<>(); + paramMap.put("organizationId",organizationIdEn); + log.info("getUserByOuGuid request param: url:{},param:{}", url, paramMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, getApiHeaderMap()); + log.info("getUserByOuGuid request result:{}", result); + if (!result.success()){ + return new ArrayList<>(); + } + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + log.warn("getUserByOuGuid 接口错误"); + return new ArrayList<>(); + } + //解密 + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + List userData = JSON.parseArray(data, UserData.class); + log.info("getUserByOuGuid request real result:{}", JSON.toJSONString(userData)); + return userData; + } catch (Exception e) { + log.error("getUserByOuGuid exception", e); + } + return new ArrayList<>(); + } + + /** + * desc:根据组织id获取下级组织 + * + * @param code + * @return + */ + public static YantaiSSOUser getLoginToken(String code) { + try { + if (StringUtils.isBlank(code)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(code); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + log.info("getLoginToken加密组织Id = " + organizationIdEn); + String url = SSO_SERVER + "logintoken?client_id=" + CLIENT_ID + "&client_code=" + code; + + Map headerMap = new HashMap<>(); + Map paramMap = new HashMap<>(); + log.info("getUserByOuGuid request param: url:{},header:{}", url, headerMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + if (!result.success() || StringUtils.isBlank(result.getData())) { + log.info("getUserByOuGuid fail result:{}", JSON.toJSONString(result)); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取token为空", "获取token为空"); + } + log.info("getUserByOuGuid request result:{}", result); + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + //解密 + String errcode = jsonObject.getString("errcode"); + if (!NumConstant.ZERO_STR.equals(errcode)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取token失败", "获取token失败"); + } + String sencondData = jsonObject.getString("data"); + log.info("getLoginToken jiami data:{}", sencondData); + //String data = SM4UtilsForYanTai.dealDecryptData(sencondData); + + + String data = TestMs4.decryptEcb(CLIENT_SECRET, sencondData); + log.info("getLoginToken jiemi data:{}", sencondData); + YantaiSSOUser userData = JSON.parseObject(data, YantaiSSOUser.class); + log.info("getUserByOuGuid request real result:{}", JSON.toJSONString(userData)); + String userInfoMobile = getUserInfoMobile(userData.getUserGuid()); + userData.setMobile(userInfoMobile); + return userData; + } catch (Exception e) { + log.error("getUserByOuGuid exception", e); + } + return null; + } + + public static String getUserInfoMobile(String userId) { + try { + + String userIdEn = SM4UtilsForYanTai.dealEncryptData(userId); + + String serverUrl = SSO_BACKGROUND_SERVER_URL + "person/userInfo/getUserByUserGuid"; + //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; + Map param = new HashMap<>(); + param.put("userGuid", userIdEn); + + Result result = HttpClientManager.getInstance().sendGet(serverUrl, param, getApiHeaderMap()); + System.out.println(JSON.toJSONString(result)); + if (!result.success() || StringUtils.isBlank(result.getData())) { + log.info("getUserInfoMobile fail result:{}", JSON.toJSONString(result)); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); + } + String data = result.getData(); + log.info("getUserInfoMobile jiami data:{}", JSON.parseObject(data)); + JSONObject jsonObject = JSON.parseObject(data); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取人员信息接口返回失败" + secondMessage, "获取人员信息接口返回失败" + secondMessage); + } + String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + String telephoneNumber = JSON.parseObject(data1).getString("mobileTelephoneNumber"); + log.info("getUserInfoMobile jiemi data:{}", telephoneNumber); + return telephoneNumber; + } catch (Exception e) { + log.error("getUserInfoMobile exception", e); + } + return null; + } + + @NotNull + private static Map getApiHeaderMap() { + Map headerMap = new HashMap<>(); + try { + JSONObject token = new JSONObject(); + token.put("token", SSO_API_TOKEN); + // token.put("token","iJCDUgCBV/Zk5FkkaxLypA=="); + token.put("expiration", System.currentTimeMillis()); + + String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); + headerMap.put("Authorization", "Bearer " + tokanStr); + } catch (Exception e) { + log.error("getApiHeaderMap exception", e); + } + return headerMap; + } + + public static void main(String[] args) throws BadPaddingException, InvalidKeyException, JsonProcessingException { + + //testGetUserByUserId(); + + //code只能用一次 + //getLoginToken("0d554bccfbac4be3846d643252daf92b"); + + String organizationId = "44e05de9-34fa-48f6-b89f-02838d792cf9"; + OrgData ouInfoByOuGuid = getOuInfoByOuGuid(organizationId); + System.out.println("ouInfoByOuGuid:"+JSON.toJSONString(ouInfoByOuGuid)); + List childOuInfoByGuid = getChildOuInfoByGuid(organizationId); + System.out.println("childOuInfoByGuid:"+JSON.toJSONString(childOuInfoByGuid)); + //先用他说的有人的组织id联调 + //String orgId = "2b271845-ed51-48aa-9935-00b9e7e06311"; + //orgId = "2b271845-ed51-48aa-9935-00b9e7e05778"; + List userByOuGuid = getUserByOuGuid(organizationId); + System.out.println("getUserByOuGuid:"+JSON.toJSONString(userByOuGuid)); + + Map apiHeaderMap = getApiHeaderMap(); + System.out.println(apiHeaderMap); + //testGetUserByUserId(); + } + + private static void testGetUserByUserId() throws JsonProcessingException, InvalidKeyException, BadPaddingException { + String testUserId = "0ffd76e2-27b5-4b33-be9a-186f9f878bf1"; + + String serverUrl = SSO_BACKGROUND_SERVER_URL +"person/userInfo/getUserByUserGuid"; + //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; + Map param = new HashMap<>(); + param.put("userGuid", SM4UtilsForYanTai.dealEncryptData(testUserId)); + Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param, getApiHeaderMap()); + System.out.println(JSON.toJSONString(stringResult)); + + String data = stringResult.getData(); + JSONObject jsonObject = JSON.parseObject(data); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + System.out.println(secondCode); + System.out.println(secondMessage); + String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + System.out.println("======" + data1); + String s = SM4UtilsForYanTai.dealDecryptData("EsOeQX+A8+GG26lzLnuKeuylkBDRFcTbF+gE/jURIzddlVI8RToQQhzK4EHy0WfpS/L4dSAJC93UyVLJhj+r/pup2RFq/GjpH7Md+1Mjg3dM+eyDuGql71bUrldQwJXYnHrQm3Mn7tk5m2eLhEVNkFvdELjuy3Kg8YihZXf2Sox+kxtmK4DSIn/gxhVCoUneWeL0cA6JGHI6jNuq97rzgcNK3Mwen8MxOoWP3n3r+kIpwZCwIlL70MrBjIZ6FHIhcxpqL82gpLSe1K0TFgeWw+9PMo1yv4cGZn7rU86TDlQFoDP86dVa1jrBoyUmW/vvLXrMKwfBaiv9/EUzcCLZWYxEwH93n0X/NYCYem3pfv4uXk5A7/D+Npgj9OKCEIz0ROn0UW5NiXI5Vibz0dywaq4sfsR/LiwjV81QOGY9tsHzN2+MnyTVpQg1l7looNnq1j+wwLneS0aDmbTqBLEn/baph/Hnr2L/9HYpWfXkhz93XRNAdsbxhXdG5ZIiJSwNasHinPR3e2Hmn/02GOsBPFUifbyNUtslt4RS/gwboonBoXz8wrmXi+PfzUXwN8f2CKdBNEHl72USp70NtBSJUPAkHdXZEQPgGRped63Z9GA="); + System.out.println("sssssss:" + s); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java new file mode 100644 index 0000000000..d2285ce0f3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java @@ -0,0 +1,35 @@ + +package com.epmet.commons.tools.utils.api.yt; + +import lombok.Data; + +import java.io.Serializable; + +/** + * sso:认证中心 用户信息 + * @author liujianjun + */ +@Data +public class YantaiSSOUser implements Serializable { + + private static final long serialVersionUID = -2794280342919451106L; + + /** + * 他说这个是手机号 + */ + private String clientId; + private String departmentCode; + private String expirationTime; + private String ip; + private String issueTime; + private String registerGuid; + private String registerName; + private String userGuid; + private String userName; + + /** + * 二次请求结果 + */ + private String mobile; + +} diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 483f545f43..3fa85a8919 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -418,7 +418,11 @@ management: web: exposure: include: "*" +# enabled-by-default: false + endpoint: + gateway: + enabled: false health: show-details: ALWAYS @@ -518,6 +522,9 @@ epmet: - /gov/org/ichouse/houseoption - /epmetuser/icresicollect/save - /gov/org/customergrid/gridoption + # 员工登记、受众群体登记 + - /gov/org/icEmployeeRegister/add + - /gov/org/icGroupPeopleRegister/add # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: - /data/report/** diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java index 4565baf59c..a6a7f8f18c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java @@ -73,6 +73,8 @@ public class IssueApplicationDTO implements Serializable { * 网格ID 居民端议题对应一个网格Id */ private String gridId; + private String orgId; + private String orgIdPath; /** * 审核通过后对应的 议题id diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java index f1561c2a1b..32186f5212 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java @@ -108,7 +108,10 @@ public class IssueListResultDTO implements Serializable { @JsonIgnore private String applyStatus; - + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; public IssueListResultDTO() { this.issueId = ""; this.issueTitle = ""; @@ -129,5 +132,6 @@ public class IssueListResultDTO implements Serializable { this.projectId = ""; this.issueClosedTime = 0L; this.issueApplicationId = ""; + this.sourceType=""; } } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index 4a63e5c8ee..ea1763af18 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -42,5 +42,10 @@ public class StaffDetailV2FormDTO implements Serializable { private String orgType = ""; //职责名称列表 private List roles; + /** + * 数字社区里的角色名称 + */ + private List szsqRoles; + private String customerId; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index 7c3bbfd838..3e80bbf9ba 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -26,6 +26,7 @@ import org.apache.ibatis.annotations.Param; import java.util.LinkedList; import java.util.List; +import java.util.Map; /** * 机关单位信息表 @@ -110,4 +111,12 @@ public interface CustomerAgencyDao extends BaseDao { List getSubAgencyList(@Param("agencyId") String agencyId); List getSubAgencyListByAgency(@Param("customerId") String customerId, @Param("agencyId") String agencyId); + + /** + * @Description 查询员工的证件号和手机号 + * @param registerId + * @Author zxc + * @Date 2022/10/27 14:03 + */ + Map getEmployeeRegisterMobileAndIdCard(@Param("registerId") String registerId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java index 1e6671bfa7..ff45b8a88c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java @@ -70,6 +70,9 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String gridId; + private String orgId; + private String orgIdPath; + /** * 审核通过后对应的 议题id */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 79f949b525..f6de7bd634 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -10,6 +10,8 @@ import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; @@ -20,6 +22,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.BadgeConstant; import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; @@ -55,8 +58,11 @@ import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.DetailByTypeResultDTO; +import com.epmet.dto.form.GetStaffExistRoleFormDTO; +import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.GovAccessFeignClient; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -117,6 +123,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private IcPointNucleicMonitoringDao pointNucleicMonitoringDao; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private GovAccessFeignClient govAccessFeignClient; /** * @Description 根据UserIds查询 @@ -733,7 +741,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { //基本信息 CustomerStaffDTO dto = customerStaffDao.selectByStaffId(staffId); if (null == dto) { - return result; + // return result; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"customer_staff is null staffId:"+staffId,"未查询到工作人员基础信息"); } //角色信息 List list = staffRoleDao.selectByStaffId(staffId); @@ -743,7 +752,16 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setName(dto.getRealName()); result.setGender(dto.getGender().toString()); result.setRoles(list); - + // 获取数字社区里的新角色 + GetStaffExistRoleFormDTO getStaffExistRoleFormDTO = new GetStaffExistRoleFormDTO(); + getStaffExistRoleFormDTO.setStaffId(staffId); + getStaffExistRoleFormDTO.setCustomerId(dto.getCustomerId()); + Result> staffExistRole = govAccessFeignClient.getStaffExistRole(getStaffExistRoleFormDTO); + if (staffExistRole.success()&&CollectionUtils.isNotEmpty(staffExistRole.getData())){ + // 过滤selected=true的 + List szsqRoles=staffExistRole.getData().stream().filter(t->t.getSelected()).map(m -> m.getRoleName()).distinct().collect(Collectors.toList()); + result.setSzsqRoles(szsqRoles); + } return result; } @@ -1077,6 +1095,14 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); result.setMobile(info.get(NeighborhoodConstant.MOBILE)); msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(核酸检测信息)"); + }else if (formDTO.getType().equals(NeighborhoodConstant.EMPLOYEE_EPIDEMIC_MANAGE_DETAIL)){ + Map info = govOrgService.getEmployeeRegisterMobileAndIdCard(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到员工登记信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(员工登记信息)"); } // 发送mq消息 HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 8c92a4004e..7464db5e2b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -17,6 +17,7 @@ import com.epmet.dto.IcNeighborHoodDTO; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Map; /** * @Author zxc @@ -292,4 +293,12 @@ public interface GovOrgService { ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid); + /** + * @Description 查询员工的证件号和手机号 + * @param registerId + * @Author zxc + * @Date 2022/10/27 14:03 + */ + Map getEmployeeRegisterMobileAndIdCard(String registerId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index d2ee934888..196126509c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -504,8 +504,9 @@ public class GovOrgServiceImpl implements GovOrgService { public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) { //1.查询工作人员基本信息、角色信息 StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId()); - if (null == result) { - return new StaffDetailV2FormDTO(); + if (null == result||StringUtils.isBlank(result.getStaffId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"customer_staff is null staffId:"+formDTO.getStaffId(),"未查询到工作人员基本信息"); + // return new StaffDetailV2FormDTO(); } //2.查询工作人员注册组织关系信息 @@ -513,7 +514,7 @@ public class GovOrgServiceImpl implements GovOrgService { staffIdList.add(formDTO.getStaffId()); List list = customerAgencyDao.selelctStaffOrg(staffIdList); if (null == list || list.size() < NumConstant.ONE) { - throw new RenException("未查询到工作人员注册组织信息"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"未查询到工作人员注册组织信息","未查询到工作人员所属组织信息"); } //3.封装数据并返回 @@ -1522,4 +1523,15 @@ public class GovOrgServiceImpl implements GovOrgService { return resultDTO; } + /** + * @Description 查询员工的证件号和手机号 + * @param registerId + * @Author zxc + * @Date 2022/10/27 14:03 + */ + @Override + public Map getEmployeeRegisterMobileAndIdCard(String registerId) { + return customerAgencyDao.getEmployeeRegisterMobileAndIdCard(registerId); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml index 08db0e9088..fdd1ff4c5f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml @@ -12,7 +12,12 @@ ia.TOPIC_ID, iah.REASON AS rejectedReason, ia.grid_id, - ia.apply_status + ia.apply_status, + ( + case when ia.TOPIC_ID is not null then 'resi_topic' + else '' + end + ) as sourceType FROM issue_application_history iah LEFT JOIN issue_application ia ON iah.ISSUE_APPLICATION_ID = ia.ID AND ia.APPLY_STATUS = 'rejected' WHERE ia.DEL_FLAG = 0 @@ -31,7 +36,12 @@ ISSUE_TITLE, UNIX_TIMESTAMP(CREATED_TIME) AS auditingTime, TOPIC_ID, - grid_id + grid_id, + ( + case when TOPIC_ID is not null then 'resi_topic' + else '' + end + ) as sourceType FROM issue_application WHERE DEL_FLAG = 0 AND ( diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml index 495473205c..82c3c09f32 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -12,7 +12,8 @@ ISSUE_TITLE AS issueTitle , UNIX_TIMESTAMP(CREATED_TIME) AS createTime, SUGGESTION, - grid_id + grid_id, + SOURCE_TYPE as sourceType FROM issue WHERE DEL_FLAG = '0' AND ISSUE_STATUS = #{issueStatus} @@ -30,7 +31,8 @@ SUGGESTION , UNIX_TIMESTAMP(SHIFTED_TIME) AS shiftProjectTime, grid_id, - issue_title + issue_title, + SOURCE_TYPE as sourceType FROM issue WHERE DEL_FLAG = '0' AND ISSUE_STATUS = 'shift_project' diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index 9af0849b72..90f40009c2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -326,4 +326,9 @@ AND pid = #{agencyId} + + + diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index b0f519a3ac..418b3dc251 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -833,7 +833,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl> page(@RequestBody PartyActivityFormDTO formDTO){ + public Result> page(@LoginUser TokenDto tokenDto,@RequestBody PartyActivityFormDTO formDTO){ + formDTO.setCustomerId(formDTO.getCustomerId()); PageData page = icPartyActivityService.search(formDTO); return new Result>().ok(page); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 95093177cb..8a0ba036ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -16,10 +17,6 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.PartyUnitFormDTO; -import com.epmet.dto.form.PartyUnitListFormDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.*; @@ -37,12 +34,10 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -70,9 +65,20 @@ public class IcPartyUnitController { private Path IC_PARTY_UNIT_UPLOAD_DIR; + /** + * 联建单位-列表查询 + * 本组织及下级数据 + * @param tokenDto + * @param formDTO + * @return + */ @PostMapping("list") public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); + //工作端调用的话,赋值当前登录用户id + if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ + formDTO.setCurrentStaffId(tokenDto.getUserId()); + } PageData page = icPartyUnitService.search(formDTO); return new Result>().ok(page); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index 3267ef36bb..89159c015b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -142,6 +142,7 @@ public class IcSocietyOrgController implements ResultDataResolver { public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); return new Result().ok(societyOrgService.getList(formDTO)); } @@ -171,7 +172,7 @@ public class IcSocietyOrgController implements ResultDataResolver { // formDTO.setIsPage(false); // GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); // ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExportExcel.class); - + formDTO.setApp(tokenDto.getApp()); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); formDTO.setIsPage(false); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 99894e3165..6c294e4608 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -398,6 +398,7 @@ public class IcUserDemandRecController implements ResultDataResolver { /** * desc:根据来源id 删除需求 只删主表 + * 2022.10.12:删除服务需求:ic_user_demand_rec、ic_user_demand_service、ic_user_demand_satisfaction、ic_user_demand_operate_log * @param originId * @param origin * @return diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index 0c02e737b7..e0cb649327 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; @@ -116,4 +117,11 @@ public interface IcPartyUnitDao extends BaseDao { @Param("customerId") String customerId); List selectByIds(@Param("partyUnitIds") List partyUnitIds); + + /** + * 联建单位-分页列表查询 + * @param formDTO + * @return + */ + List pageList(PartyUnitFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index ce4b03c9b7..68d30ddc19 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -268,6 +268,7 @@ public interface IcUserDemandRecService extends BaseService liveRecList(TokenDto tokenDto,Map map) { if (!map.containsKey("actId") || StringUtils.isEmpty(map.get("actId"))) { logger.warn("传参中没有actId,或者actId为空,userId:" + tokenDto.getUserId() + "客户id:" + tokenDto.getCustomerId()); - throw new RenException("actId不能为空"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"actId不能为空","活动id不能为空"); } // 数据汇总 ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index c645ffbc55..e7b3fbc4e5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -128,7 +128,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyUnitFormDTO formDTO) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + /*LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); @@ -127,7 +126,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); + List list = baseDao.selectList(wrapper);*/ + //本组织及下级 + if(StringUtils.isNotBlank(formDTO.getCurrentStaffId())&&StringUtils.isBlank(formDTO.getAgencyId())){ + CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + List list = baseDao.pageList(formDTO); PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); @@ -150,6 +155,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 063064f9cd..013ea62d1c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.impl; import com.alibaba.excel.EasyExcel; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -148,10 +149,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); - wrapper.eq(IcUserDemandRecEntity::getOriginId, originId) - .eq(IcUserDemandRecEntity::getOrigin,origin) - .set(IcUserDemandRecEntity::getUpdatedTime,new Date()) - .set(IcUserDemandRecEntity::getCreatedBy,loginUserUtil.getLoginUserId()) - .set(IcUserDemandRecEntity::getDelFlag,NumConstant.ONE_STR); - return baseDao.update(null, wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(IcUserDemandRecEntity::getOrigin,origin).eq(IcUserDemandRecEntity::getOriginId,originId); + IcUserDemandRecEntity recEntity = baseDao.selectOne(queryWrapper); + if (null == recEntity) { + return 0; + } + //删除服务需求 + deleteUserDemand(Arrays.asList(recEntity.getId())); + return 1; + } + + /** + * 删除服务需求 + * ic_user_demand_rec、ic_user_demand_service、ic_user_demand_satisfaction、ic_user_demand_operate_log + * @param ids + */ + @Transactional(rollbackFor = Exception.class) + public void deleteUserDemand(List ids) { + Date nowTime = new Date(); + String currentUserId = loginUserUtil.getLoginUserId(); + for (String id : ids) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IcUserDemandRecEntity::getId, id) + .set(IcUserDemandRecEntity::getUpdatedTime, nowTime) + .set(IcUserDemandRecEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandRecEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + + LambdaUpdateWrapper serviceWrapper = new LambdaUpdateWrapper(); + serviceWrapper.eq(IcUserDemandServiceEntity::getDemandRecId, id) + .set(IcUserDemandServiceEntity::getUpdatedTime, nowTime) + .set(IcUserDemandServiceEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandServiceEntity::getDelFlag, NumConstant.ONE_STR); + demandServiceDao.update(null, serviceWrapper); + + LambdaUpdateWrapper statWrapper = new LambdaUpdateWrapper(); + statWrapper.eq(IcUserDemandSatisfactionEntity::getDemandRecId, id) + .set(IcUserDemandSatisfactionEntity::getUpdatedTime, nowTime) + .set(IcUserDemandSatisfactionEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandSatisfactionEntity::getDelFlag, NumConstant.ONE_STR); + demandSatisfactionDao.update(null, statWrapper); + + LambdaUpdateWrapper logWrapper = new LambdaUpdateWrapper(); + logWrapper.eq(IcUserDemandOperateLogEntity::getDemandRecId, id) + .set(IcUserDemandOperateLogEntity::getUpdatedTime, nowTime) + .set(IcUserDemandOperateLogEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandOperateLogEntity::getDelFlag, NumConstant.ONE_STR); + operateLogDao.update(null, logWrapper); + } } /** @@ -563,6 +612,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl + AND (ur.AGENCY_ID = #{agencyId} or ur.PIDS like concat('%',#{agencyId},'%')) + - AND UNIT_ID = #{unitId} + AND ur.UNIT_ID = #{unitId} GROUP BY - ACTIVITY_ID + ur.ACTIVITY_ID ) b ON a.ID = b.ACTIVITY_ID INNER JOIN ( SELECT - ACTIVITY_ID, - GROUP_CONCAT( SERVICE_MATTER ) AS serviceMatter + sr.ACTIVITY_ID, + GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter FROM - ic_activity_service_relation + ic_activity_service_relation sr WHERE - DEL_FLAG = '0' - AND AGENCY_ID = #{agencyId} + sr.DEL_FLAG = '0' + + AND (sr.AGENCY_ID = #{agencyId} or sr.PIDS like concat('%',#{agencyId},'%')) + - AND SERVICE_MATTER = #{serviceMatter} + AND sr.SERVICE_MATTER = #{serviceMatter} GROUP BY - ACTIVITY_ID + sr.ACTIVITY_ID ) c ON a.ID = c.ACTIVITY_ID WHERE a.DEL_FLAG = '0' - AND a.AGENCY_ID = #{agencyId} + + AND (a.AGENCY_ID = #{agencyId} or a.PIDS like concat('%',#{agencyId},'%')) + AND a.GRID_ID = #{gridId} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index c1800190cb..e57c6d2419 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -193,4 +193,35 @@ ) + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java new file mode 100644 index 0000000000..e47d52bcd3 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java @@ -0,0 +1,36 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.ThirdOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author zxc + * @dscription 拉取yt用户信息和组织信息 + */ +@Slf4j +@Component("YTUserAndOrgPullTask") +public class YTUserAndOrgPullTask implements ITask { + + @Autowired + private ThirdOpenFeignClient thirdOpenFeignClient; + + @Override + public void run(String params) { + Result yanTaiOrgInfo = thirdOpenFeignClient.getYanTaiOrgInfo("44e05de9-34fa-48f6-b89f-02838d792cf9"); + if (yanTaiOrgInfo.success()) { + log.info("yt拉取组织信息定时任务执行成功"); + } else { + log.error("yt拉取组织信息定时任务执行失败:" + yanTaiOrgInfo.getMsg()); + } + + Result yanTaiUserInfo = thirdOpenFeignClient.getYanTaiUserInfo("44e05de9-34fa-48f6-b89f-02838d792cf9"); + if (yanTaiUserInfo.success()) { + log.info("yt拉取用户信息定时任务执行成功"); + } else { + log.error("yt拉取用户信息定时任务执行失败:" + yanTaiUserInfo.getMsg()); + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java new file mode 100644 index 0000000000..fd5f9121c7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java @@ -0,0 +1,139 @@ +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-10-18 + */ +@Data +public class DataSyncOrgDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 联系人姓名 + */ + private String contact; + + /** + * 联系电话号码 + */ + private String contacttelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstnameofOrganization; + + /** + * 组织机构全称 + */ + private String nameofOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + + /** + * 注册类型 + */ + private String registrationType; + + /** + * 统一社会信用代码 + */ + private String unifiedsocialcreditId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户id;烟台id + */ + private String customerId; + + /** + * 上级组织机构id:ORGANIZATION_ID; 根级组织赋值0 + */ + private String pid; + + /** + * 上级组织机构名称:ORGANIZATIO_NABBREVIATION + */ + private String parentOrgName; + + /** + * 所有上级组织。不包含本身! + */ + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java new file mode 100644 index 0000000000..291d40d7de --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java @@ -0,0 +1,124 @@ +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-10-18 + */ +@Data +public class DataSyncUserDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 职务 + */ + private String position; + + /** + * 职级 + */ + private String positionLevel; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 统一用户编码 + */ + private String userGuid; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 人员路径 + */ + private String userPath; + + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户id + */ + private String customerId; + + /** + * 0未创建、1已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java new file mode 100644 index 0000000000..522f2926ee --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.yantai; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * @Author yzm + * @Date 2022/10/18 13:54 + */ +@Data +public class YtSyncStaffIdFormDTO { + /** + * 客户ID + */ + @NotBlank(message = "customerId不能为空",groups = AddGroup.class) + private String customerId; + /** + * 人员ID + */ + @NotBlank(message = "staffId不能为空",groups = AddGroup.class) + private String staffId; + + @NotBlank(message = "name不能为空",groups = AddGroup.class) + private String name; + + @NotBlank(message = "mobile不能为空",groups = AddGroup.class) + private String mobile; + + @NotBlank(message = "当前操作人id不能为空",groups = AddGroup.class) + private String operUserId; + +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java new file mode 100644 index 0000000000..6a3ddda553 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.yantai; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description 运营端,统一认证 列表查询入参 + * @Author yzm + * @Date 2022/10/18 11:12 + */ +@Data +public class YtUserPageFormDTO extends PageFormDTO { + /** + * 0本机 + * 1本级及下级 + */ + private String type; + /** + * 组织id + * data_sync_org_data.ORGANIZATION_ID + */ + private String orgId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 0未创建、已创建 + */ + private String status; +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java new file mode 100644 index 0000000000..1a3b19a855 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.yantai; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/10/18 14:21 + */ +@Data +public class DataSyncOrgDataDTO implements Serializable { + private static final long serialVersionUID = -3011177998045994250L; + private String orgId; + private String orgName; + private String pid; + /** + * true代表有下级 + */ + private Boolean haveChild; +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java new file mode 100644 index 0000000000..38da48f7a9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.yantai; + +import lombok.Data; + +/** + * @Description 运营端,统一认证 列表返参 + * @Author yzm + * @Date 2022/10/18 11:53 + */ +@Data +public class YtUserPageResDTO { + /** + * 统一用户编码 + */ + private String userGuid; + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + /** + * XXX-XXX + */ + private String orgName; + /** + * 用户姓名 + */ + private String userName; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 0未创建、已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; + + private String customerId; +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java index f0fef19e58..0638d340be 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.BlockChainCreateProjectFormDTO; import com.epmet.dto.form.BlockChainProcessProjectFormDTO; import com.epmet.dto.form.ProjectApplyAssistFormDTO; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.ProjectAssistResult; import com.epmet.dto.result.UploadFileResultDTO; import com.epmet.feign.fallback.EpmetThirdOpenFeignClientFallbackFactory; @@ -75,6 +76,9 @@ public interface EpmetThirdOpenFeignClient { @PostMapping("/third/blockchain/project/process") Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input); + @PostMapping("/third/dataSync/update-staff") + Result dataSyncUpdateStaff(@RequestBody YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO); + class MultipartSupportConfig { @Autowired diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java index 7b19e3efde..1f0f16c314 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java @@ -8,6 +8,7 @@ import com.epmet.feign.fallback.ThirdOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -69,4 +70,23 @@ public interface ThirdOpenFeignClient { */ @PostMapping("/third/blockchain/project/process") Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input); + + /** + * Desc: 从统一认证中心 拉取组织信息 + * @param orgId + * @author zxc + * @date 2022/10/18 16:50 + */ + @PostMapping("/third/dataSync/yanTai/sync/org") + Result getYanTaiOrgInfo(@RequestParam("orgId") String orgId); + + /** + * Desc: 从统一认证中心 拉取用户信息 + * @param orgId + * @author zxc + * @date 2022/10/18 16:50 + */ + @PostMapping("/third/dataSync/yanTai/sync/user") + Result getYanTaiUserInfo(@RequestParam("orgId") String orgId); + } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java index ebf63b3e49..ec7901a7a1 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.BlockChainCreateProjectFormDTO; import com.epmet.dto.form.BlockChainProcessProjectFormDTO; import com.epmet.dto.form.ProjectApplyAssistFormDTO; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.ProjectAssistResult; import com.epmet.dto.result.UploadFileResultDTO; import com.epmet.feign.EpmetThirdOpenFeignClient; @@ -57,4 +58,8 @@ public class EpmetThirdOpenFeignClientFallback implements EpmetThirdOpenFeignCli return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "processProject", input); } + @Override + public Result dataSyncUpdateStaff(YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "updateStaff", ytSyncStaffIdFormDTO); + } } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java index 973342dc57..006122b075 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java @@ -40,4 +40,14 @@ public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient { public Result blockChainProcessProject(BlockChainProcessProjectFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "blockChainProcessProject", input); } + + @Override + public Result getYanTaiOrgInfo(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getYanTaiOrgInfo", orgId); + } + + @Override + public Result getYanTaiUserInfo(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getYanTaiUserInfo", orgId); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java new file mode 100644 index 0000000000..74e1d13560 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java @@ -0,0 +1,12 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2022/10/18 16:43 + * @DESC + */ +public interface YanTaiConstant { + + String YT_CUSTOMER_ID = "1535072605621841922"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java new file mode 100644 index 0000000000..80f3a2f056 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -0,0 +1,84 @@ +package com.epmet.controller.yantai; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * desc: 从各个平台-同步用户和组织数据到本地 用于生成本系统账号 + * + * @author LiuJanJun + * @date 2022/10/17 3:41 下午 + */ +@RestController +@RequestMapping("dataSync") +public class DataSyncUserAndOrgController { + + @Autowired + private DataSyncUserAndOrgService dataSyncUserAndOrgService; + + /** + * desc:从统一认证中心 拉取用户信息 + * @return + */ + @PostMapping("yanTai/sync/user") + public Result getYanTaiUserInfo(@RequestParam("orgId")String orgId) { + Boolean flag = dataSyncUserAndOrgService.yanTaiSyncUser(orgId); + return new Result().ok(flag); + } + + /** + * desc:从统一认证中心 拉取组织信息 + * @return + */ + @PostMapping("yanTai/sync/org") + public Result getYanTaiOrgInfo(@RequestParam("orgId")String orgId) { + Boolean extJson = dataSyncUserAndOrgService.yanTaiSyncOrg(orgId); + return new Result().ok(extJson); + } + + + /** + * 运营端,统一认证 列表查询 + * + * @param formDTO + * @return + */ + @PostMapping("page-user") + public Result> pageUser(@RequestBody YtUserPageFormDTO formDTO) { + return new Result>().ok(dataSyncUserAndOrgService.pageUser(formDTO)); + } + + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * + * @param formDTO + * @return + */ + @PostMapping("update-staff") + public Result updateStaff(@RequestBody YtSyncStaffIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + dataSyncUserAndOrgService.updateStaff(formDTO.getCustomerId(),formDTO.getOperUserId(),formDTO.getStaffId(),formDTO.getName(),formDTO.getMobile()); + return new Result(); + } + + /** + * 运营端,统一认证 列表查询条件 那颗树 调用此接口 + * @param formDTO + * @return + */ + @PostMapping("ytorglist") + public Result> ytOrgList(@RequestBody YtUserPageFormDTO formDTO){ + List list=dataSyncUserAndOrgService.ytOrgList(formDTO.getOrgId()); + return new Result>().ok(list); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java new file mode 100644 index 0000000000..eedd580077 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java @@ -0,0 +1,41 @@ +package com.epmet.controller.yantai; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; + +import java.util.List; + +/** + * @author liujianjun + */ +public interface DataSyncUserAndOrgService { + Boolean yanTaiSyncUser(String organizationId); + + Boolean yanTaiSyncOrg(String organizationId); + + /** + * 运营端-统一认证 + * 用户列表 + * @param formDTO + * @return + */ + PageData pageUser(YtUserPageFormDTO formDTO); + + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * @param customerId + * @param staffId + * @param name + * @param mobile + */ + int updateStaff(String customerId,String operUserId, String staffId, String name, String mobile); + + /** + * 根据组织id查询下级组织 + * @param pid + * @return + */ + List ytOrgList(String pid); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java new file mode 100644 index 0000000000..287ff51e80 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -0,0 +1,199 @@ +package com.epmet.controller.yantai; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoDTOCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.api.yt.OrgData; +import com.epmet.commons.tools.utils.api.yt.UserData; +import com.epmet.commons.tools.utils.api.yt.YantaiApi; +import com.epmet.dao.yantai.DataSyncOrgDataDao; +import com.epmet.dao.yantai.DataSyncUserDataDao; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import com.epmet.entity.yantai.DataSyncUserDataEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.DataSyncOrgDataService; +import com.epmet.service.DataSyncUserDataService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import static com.epmet.constant.YanTaiConstant.YT_CUSTOMER_ID; + +/** + * desc:烟台 从认证中心同步组织和用户信息 到本地 + * + * @author: LiuJanJun + * @date: 2022/10/17 3:42 下午 + * @version: 1.0 + */ +@Service +@Slf4j +public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService { + @Autowired + private DataSyncUserDataDao dataSyncUserDataDao; + @Autowired + private DataSyncOrgDataDao dataSyncOrgDataDao; + @Autowired + private DataSyncOrgDataService dataSyncOrgDataService; + @Autowired + private DataSyncUserDataService dataSyncUserDataService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * Desc: 从org表查询组织,在根据组织去查询用户 + * @param organizationId + * @author zxc + * @date 2022/10/19 13:27 + */ + @Override + public Boolean yanTaiSyncUser(String organizationId) { + String customerId = YT_CUSTOMER_ID; + // 先删除 旧数据 + Integer delSize = null; + do { + delSize = dataSyncUserDataService.deleteByCustomerId(customerId); + }while (null != delSize && delSize == NumConstant.ONE_THOUSAND); + // 缓存初始化staffs + epmetUserOpenFeignClient.allCustomerStaffInCache(customerId); + Integer no = NumConstant.ONE; + Integer size; + do { + // 分批获取org + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> dataSyncOrgDataDao.getAllList(customerId)); + size = pageInfo.getList().size(); + if (CollectionUtils.isNotEmpty(pageInfo.getList())){ + List needInsert = new ArrayList<>(); + pageInfo.getList().forEach(org -> { + // 根据org查用户 + List data = YantaiApi.getUserByOuGuid(org.getOrganizationId()); + if (CollectionUtils.isNotEmpty(data)){ + for (UserData u : data) { + CustomerStaffInfoDTOCache staffInfo = CustomerStaffRedis.getStaffInfoByMobile(customerId, u.getMobileTelephoneNumber()); + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(u, DataSyncUserDataEntity.class); + entity.setOrganizationId(org.getOrganizationId()); + entity.setCustomerId(customerId); + entity.setRemark(""); + if (null == staffInfo){ + entity.setStatus(NumConstant.ZERO_STR); + entity.setStaffId(""); + }else { + entity.setStatus(NumConstant.ONE_STR); + entity.setStaffId(staffInfo.getUserId()); + } + needInsert.add(entity); + } + } + }); + dataSyncUserDataService.insertBatch(needInsert,NumConstant.FIVE_HUNDRED); + } + no++; + }while (size == NumConstant.ONE_HUNDRED); + // 删除staffs缓存 + CustomerStaffRedis.delAllCustomerStaff(customerId); + return false; + } + + @Override + public Boolean yanTaiSyncOrg(String organizationId) { + // 先删除 旧数据 + Integer delSize = null; + do { + delSize = dataSyncOrgDataService.deleteByCustomerId(YT_CUSTOMER_ID); + }while (null != delSize && delSize == NumConstant.ONE_THOUSAND); + List needInsert = new ArrayList<>(); + // 根组织 + OrgData rootOrg = YantaiApi.getOuInfoByOuGuid(organizationId); + if (null == rootOrg){ + log.error("未查询到根组织:"+organizationId); + return true; + } + rootOrg.setPid(""); + rootOrg.setPids(""); + rootOrg.setNameOfOrganization(""); + needInsert.add(rootOrg); + List data = YantaiApi.getChildOuInfoByGuid(organizationId); + if (CollectionUtils.isNotEmpty(data)){ + data.forEach(d -> { + d.setPid(organizationId); + d.setPids(organizationId.concat(":").concat(d.getOrganizationId())); + d.setNameOfOrganization(rootOrg.getNameOfOrganization()); + needInsert.add(d); + disposeYanTaiSyncOrg(d,needInsert); + }); + List entities = needInsert.stream().map(m -> { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(m, DataSyncOrgDataEntity.class); + entity.setCustomerId(YT_CUSTOMER_ID); + return entity; + }).collect(Collectors.toList()); + dataSyncOrgDataService.insertBatch(entities, NumConstant.ONE_HUNDRED); + } + return false; + } + + public void disposeYanTaiSyncOrg(OrgData orgData, List needInsert){ + List data = YantaiApi.getChildOuInfoByGuid(orgData.getOrganizationId()); + if (CollectionUtils.isNotEmpty(data)){ + data.forEach(d -> { + d.setPid(orgData.getOrganizationId()); + d.setPids(orgData.getPids().concat(":").concat(d.getOrganizationId())); + d.setNameOfOrganization(orgData.getNameOfOrganization()); + needInsert.add(d); + disposeYanTaiSyncOrg(d,needInsert); + }); + } + } + + + /** + * 运营端-统一认证 + * 用户列表 + * + * @param formDTO + * @return + */ + @Override + public PageData pageUser(YtUserPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = dataSyncUserDataDao.pageUser(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * + * @param customerId + * @param staffId + * @param name + * @param mobile + */ + @Override + public int updateStaff(String customerId, String operUserId,String staffId, String name, String mobile) { + return dataSyncUserDataDao.updateStaff(customerId,operUserId,staffId,name,mobile); + } + + /** + * 根据组织id查询下级组织 + * + * @param pid + * @return + */ + @Override + public List ytOrgList(String pid) { + List list=dataSyncOrgDataDao.queryList(pid); + return list; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java new file mode 100644 index 0000000000..35d90d20ca --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java @@ -0,0 +1,199 @@ +package com.epmet.controller.yantai; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.codec.binary.Base64; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.Security; + +/** + * 烟台的认证中心-国密sm4加解密 + */ +public class SM4UtilsForYanTai { + private static String SM4_KEY = "yaweisoftware@xy"; + //编码格式 + private static final Charset encryptCharset = StandardCharsets.UTF_8; + + public enum Algorithm { + SM4("SM4","SM4","国密四,key长16byte"); + private String keyAlgorithm; + private String transformation; + private String description;//描述 + Algorithm(String keyAlgorithm, String transformation, String description) { + this.keyAlgorithm = keyAlgorithm; + this.transformation = transformation; + this.description = description; + } + public String getKeyAlgorithm() { + return this.keyAlgorithm; + } + public String getTransformation() { + return this.transformation; + } + public String getDescription() { + return this.description; + } + } + + private static final String PROVIDER_NAME = "BC"; + static { + Security.addProvider(new BouncyCastleProvider()); + } + + /** + * 自定字符串产生密钥 + * @param algorithm 加解密算法 + * @param keyStr 密钥字符串 + * @param charset 编码字符集 + * @return 密钥 + */ + public static SecretKey genKeyByStr(Algorithm algorithm, String keyStr, Charset charset) { + return readKeyFromBytes(algorithm, keyStr.getBytes(charset)); + } + + /** + * 根据指定字节数组产生密钥 + * @param algorithm 加解密算法 + * @param keyBytes 密钥字节数组 + * @return 密钥 + */ + public static SecretKey readKeyFromBytes(Algorithm algorithm, byte[] keyBytes) { + return new SecretKeySpec(keyBytes, algorithm.getKeyAlgorithm()); + } + + /****************************加密*********************************/ + /** + * 加密字符串,并进行base64编码 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @param charset 编码字符集 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static String encryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) throws InvalidKeyException { + return Base64.encodeBase64String(encrypt(algorithm, key, data.getBytes(charset))); + } + + /** + * 加密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static byte[] encrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException { + try { + return cipherDoFinal(algorithm, Cipher.ENCRYPT_MODE, key, data); + } catch (BadPaddingException e) { + throw new RuntimeException(e);//明文没有具体格式要求,不会出错。所以这个异常不需要外部捕获。 + } + } + + /** + * 加解密字节数组 + * @param algorithm 加解密算法 + * @param opmode 操作:1加密,2解密 + * @param key 密钥 + * @param data 数据 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 解密密文错误(加密模式没有) + */ + private static byte[] cipherDoFinal(Algorithm algorithm, int opmode, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + Cipher cipher; + try { + cipher = Cipher.getInstance(algorithm.getTransformation(), PROVIDER_NAME); + } catch (Exception e) { + //NoSuchAlgorithmException:加密算法名是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchProviderException:Provider是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchPaddingException:没有特定的填充机制,与环境有关,业务没有办法处理。所以这个异常不需要外部捕获。 + throw new RuntimeException(e); + } + cipher.init(opmode, key); + try { + return cipher.doFinal(data); + } catch (IllegalBlockSizeException e) { + throw new RuntimeException(e);//业务不需要将数据分块(好像由底层处理了),如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + } + } + + /****************************解密*********************************/ + /** + * 对字符串先进行base64解码,再解密 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @param charset 编码字符集 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static String decryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) + throws InvalidKeyException, BadPaddingException { + return new String(decrypt(algorithm, key, Base64.decodeBase64(data)), charset); + } + + /** + * 解密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static byte[] decrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + return cipherDoFinal(algorithm, Cipher.DECRYPT_MODE, key, data); + } + + public static String Encrypt(String data) throws InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return encryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + public static String Decrypt(String data) throws BadPaddingException, InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return decryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + //加密 + public static String dealEncryptData(Object data) throws JsonProcessingException, InvalidKeyException { + ObjectMapper objectMapper = new ObjectMapper(); + String dataString = ""; + try { + if(data instanceof String){ + dataString = (String) data; + }else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataEncrypt = Encrypt(dataString); + return dataEncrypt; + }catch (Exception e){ + return dataString; + } + } + //解密 + public static String dealDecryptData(Object data) throws JsonProcessingException, BadPaddingException, InvalidKeyException { + String dataString = ""; + try { + ObjectMapper objectMapper = new ObjectMapper(); + if (data instanceof String) { + dataString = (String) data; + } else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataDecrypt = Decrypt(dataString); + return dataDecrypt; + }catch (Exception e){ + return dataString; + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java new file mode 100644 index 0000000000..b9f2a0eca4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao.yantai; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Mapper +public interface DataSyncOrgDataDao extends BaseDao { + /** + * 根据pid查询下一级组织列表 + * @param pid + * @return + */ + List queryList(@Param("pid") String pid); + + List getAllList(@Param("customerId") String customerId); + + Integer deleteByCustomerId(@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java new file mode 100644 index 0000000000..b36d45240b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java @@ -0,0 +1,44 @@ +package com.epmet.dao.yantai; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Mapper +public interface DataSyncUserDataDao extends BaseDao { + /** + * 运营端,统一认证 列表查询 + * @param formDTO + * @return + */ + List pageUser(YtUserPageFormDTO formDTO); + + /** + * 更新data_sync_user_data 为已创建、记录staffId + * @param customerId + * @param operUserId + * @param staffId + * @param name + * @param mobile + * @return + */ + int updateStaff(@Param("customerId") String customerId, + @Param("operUserId")String operUserId, + @Param("staffId")String staffId, + @Param("name")String name, + @Param("mobile")String mobile); + + Integer deleteByCustomerId(@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java new file mode 100644 index 0000000000..5c46e0b939 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java @@ -0,0 +1,106 @@ +package com.epmet.entity.yantai; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("data_sync_org_data") +public class DataSyncOrgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 联系人姓名 + */ + private String contact; + + /** + * 联系电话号码 + */ + private String contacttelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstnameofOrganization; + + /** + * 组织机构全称 + */ + private String nameofOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + + /** + * 注册类型 + */ + private String registrationType; + + /** + * 统一社会信用代码 + */ + private String unifiedsocialcreditId; + + /** + * 客户id;烟台id + */ + private String customerId; + + /** + * 上级组织机构id:ORGANIZATION_ID; 根级组织赋值0 + */ + private String pid; + + /** + * 上级组织机构名称:ORGANIZATIO_NABBREVIATION + */ + private String parentOrgName; + + /** + * 所有上级组织。不包含本身! + */ + private String pids; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java new file mode 100644 index 0000000000..e0fa956f32 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java @@ -0,0 +1,91 @@ +package com.epmet.entity.yantai; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("data_sync_user_data") +public class DataSyncUserDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 职务 + */ + private String position; + + /** + * 职级 + */ + private String positionLevel; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 统一用户编码 + */ + private String userGuid; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 人员路径 + */ + private String userPath; + + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + + /** + * 客户id + */ + private String customerId; + + /** + * 0未创建、已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java new file mode 100644 index 0000000000..72b77a4888 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java @@ -0,0 +1,80 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DataSyncOrgDataDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +public interface DataSyncOrgDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DataSyncOrgDataDTO + * @author generator + * @date 2022-10-18 + */ + DataSyncOrgDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void save(DataSyncOrgDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void update(DataSyncOrgDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-10-18 + */ + void delete(String[] ids); + + Integer deleteByCustomerId(String customerId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java new file mode 100644 index 0000000000..b9f9fe8acf --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java @@ -0,0 +1,80 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DataSyncUserDataDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +public interface DataSyncUserDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DataSyncUserDataDTO + * @author generator + * @date 2022-10-18 + */ + DataSyncUserDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void save(DataSyncUserDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void update(DataSyncUserDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-10-18 + */ + void delete(String[] ids); + + Integer deleteByCustomerId(String customerId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java new file mode 100644 index 0000000000..057d51885b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java @@ -0,0 +1,89 @@ +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.yantai.DataSyncOrgDataDao; +import com.epmet.dto.DataSyncOrgDataDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import com.epmet.service.DataSyncOrgDataService; +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-10-18 + */ +@Service +public class DataSyncOrgDataServiceImpl extends BaseServiceImpl implements DataSyncOrgDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DataSyncOrgDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DataSyncOrgDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DataSyncOrgDataDTO get(String id) { + DataSyncOrgDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DataSyncOrgDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DataSyncOrgDataDTO dto) { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncOrgDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DataSyncOrgDataDTO dto) { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncOrgDataEntity.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 Integer deleteByCustomerId(String customerId) { + return baseDao.deleteByCustomerId(customerId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java new file mode 100644 index 0000000000..7149e74507 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java @@ -0,0 +1,87 @@ +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.yantai.DataSyncUserDataDao; +import com.epmet.dto.DataSyncUserDataDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; +import com.epmet.service.DataSyncUserDataService; +import org.apache.commons.lang3.StringUtils; +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-10-18 + */ +@Service +public class DataSyncUserDataServiceImpl extends BaseServiceImpl implements DataSyncUserDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DataSyncUserDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DataSyncUserDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DataSyncUserDataDTO get(String id) { + DataSyncUserDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DataSyncUserDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DataSyncUserDataDTO dto) { + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncUserDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DataSyncUserDataDTO dto) { + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncUserDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Integer deleteByCustomerId(String customerId) { + return baseDao.deleteByCustomerId(customerId); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.17__yt_sync_organduser.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.17__yt_sync_organduser.sql new file mode 100644 index 0000000000..5249bca97b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.17__yt_sync_organduser.sql @@ -0,0 +1,52 @@ +CREATE TABLE `data_sync_org_data` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CONTACT` varchar(64) DEFAULT NULL COMMENT '联系人姓名', + `CONTACTTELEPHONE_NUMBER` varchar(64) DEFAULT NULL COMMENT '联系电话号码', + `DETAIL_ADDRESS` varchar(64) DEFAULT NULL COMMENT '详细地址', + `FIRSTNAMEOF_ORGANIZATION` varchar(64) DEFAULT NULL COMMENT '组织机构第一名称', + `NAMEOF_ORGANIZATION` varchar(64) DEFAULT NULL COMMENT '组织机构全称', + `ORDER_NUMBER` varchar(64) DEFAULT NULL COMMENT '排序号码', + `ORGANIZATIO_NABBREVIATION` varchar(64) NOT NULL COMMENT '组织机构简称', + `ORGANIZATION_ID` varchar(64) NOT NULL COMMENT '组织机构ID', + `ORGANIZATION_LEVEL` varchar(64) DEFAULT NULL COMMENT '组织机构级别', + `ORGANIZATION_PATH` varchar(256) NOT NULL COMMENT '组织机构路径', + `ORGANIZATION_TYPE` varchar(64) DEFAULT NULL COMMENT '组织机构类型', + `REGISTRATION_TYPE` varchar(64) DEFAULT NULL COMMENT '注册类型', + `UNIFIEDSOCIALCREDIT_ID` varchar(64) DEFAULT NULL COMMENT '统一社会信用代码', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id;烟台id', + `PID` varchar(64) NOT NULL COMMENT '上级组织机构id:ORGANIZATION_ID; 根级组织赋值0', + `PARENT_ORG_NAME` varchar(64) DEFAULT NULL COMMENT '上一级组织机构名称:ORGANIZATIO_NABBREVIATION', + `PIDS` varchar(255) DEFAULT NULL COMMENT '所有上级组织。不包含本身!如果是根组织,此列为空串', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `data_sync_user_data` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `GENDER` varchar(64) DEFAULT NULL COMMENT '性别:0未知1男2女', + `MOBILE_TELEPHONE_NUMBER` varchar(64) NOT NULL COMMENT '手机号码', + `ORDER_NUMBER` varchar(64) DEFAULT NULL COMMENT '排序号码', + `POSITION` varchar(64) DEFAULT NULL COMMENT '职务', + `POSITION_LEVEL` varchar(64) DEFAULT NULL COMMENT '职级', + `TELEPHONE_NUMBER` varchar(64) DEFAULT NULL COMMENT '电话号码', + `USER_GUID` varchar(64) DEFAULT NULL COMMENT '统一用户编码', + `USER_NAME` varchar(64) NOT NULL COMMENT '用户姓名', + `USER_PATH` varchar(128) DEFAULT NULL COMMENT '人员路径', + `ORGANIZATION_ID` varchar(64) NOT NULL COMMENT 'data_sync_org_data.组织机构ID;', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `STATUS` varchar(1) DEFAULT '0' COMMENT '0未创建、1已创建', + `STAFF_ID` varchar(64) DEFAULT NULL COMMENT 'customer_staff.userId,已创建的此列不能为空', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注;目前为空', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.18__yt_alter_sync.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.18__yt_alter_sync.sql new file mode 100644 index 0000000000..930f3df2e4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.18__yt_alter_sync.sql @@ -0,0 +1,4 @@ +alter table data_sync_org_data modify column PIDS varchar(1024) comment '所有上级组织。不包含本身!如果是根组织,此列为空串'; + +CREATE INDEX idx_data_sync_orgid on data_sync_org_data(ORGANIZATION_ID); +CREATE INDEX idx_data_sync_userorgid on data_sync_user_data(ORGANIZATION_ID); \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml index c95ac8b0f3..f8e2164fb7 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml @@ -140,10 +140,9 @@ - + - @@ -158,7 +157,7 @@ - + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml new file mode 100644 index 0000000000..b92833402c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from data_sync_org_data + where customer_id = #{customerId} + and del_flag = 0 + limit 1000 + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml new file mode 100644 index 0000000000..f063d4e31c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from data_sync_user_data + where customer_id = #{customerId} + and del_flag = 0 + limit 1000 + + + + + + + UPDATE data_sync_user_data + SET UPDATED_BY = #{operUserId}, + UPDATED_TIME = NOW(), + `STATUS` = '1', + STAFF_ID = #{staffId}, + CUSTOMER_ID = #{customerId} + WHERE + MOBILE_TELEPHONE_NUMBER = #{mobile} + AND USER_NAME = #{name} + AND del_flag = '0' + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java index fd0cdff40e..1138c33c7b 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java @@ -73,6 +73,8 @@ public class IssueApplicationDTO implements Serializable { * 网格ID 居民端议题对应一个网格Id */ private String gridId; + private String orgId; + private String orgIdPath; /** * 审核通过后对应的 议题id @@ -130,4 +132,16 @@ public class IssueApplicationDTO implements Serializable { */ private Long latestTime; + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java new file mode 100644 index 0000000000..d9d7f2b723 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Data +public class IssueAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务id + */ + private String businessId; + + /** + * 议题:issue + */ + private String attachTo; + + /** + * 附件名 + */ + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String type; + + /** + * 附件地址 + */ + private String url; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 5e7a6c8fdb..487ca68aee 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -19,8 +19,10 @@ package com.epmet.dto; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -34,6 +36,8 @@ public class IssueDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface IssueForm{} + /** * 议题ID */ @@ -45,7 +49,7 @@ public class IssueDTO implements Serializable { private String issueStatus; /** - * 来源类型 eg:resi_topic + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String sourceType; @@ -67,12 +71,14 @@ public class IssueDTO implements Serializable { /** * 议题名称 最多20字 */ - private String issueTitle; + @NotBlank(message = "issueTitle不能为空",groups = IssueForm.class) + private String issueTitle; /** * 建议 最多1000字 */ - private String suggestion; + @NotBlank(message = "suggestion不能为空",groups = IssueForm.class) + private String suggestion; /** * 客户ID @@ -82,7 +88,8 @@ public class IssueDTO implements Serializable { /** * 网格ID 居民端议题对应一个网格Id */ - private String gridId; + @NotBlank(message = "gridId不能为空",groups = IssueForm.class) + private String gridId; /** * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 @@ -160,4 +167,23 @@ public class IssueDTO implements Serializable { private String projectId; private String issueId; + + /** + * 地址 + */ + @NotBlank(message = "address不能为空",groups = IssueForm.class) + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + private String userId; + + private List attachmentList; } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java new file mode 100644 index 0000000000..619ae8baad --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 16:52 + * @DESC + */ +@Data +public class AllIssueListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -9150357859854770833L; + + private String startTime; + private String endTime; + private String issueStatus; + private String issueTitle; + private String orgId; + private String orgType; + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java new file mode 100644 index 0000000000..0fefeb06d2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 17:07 + * @DESC + */ +@Data +public class AuditListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 5924913199706972596L; + + private String startTime; + private String endTime; + private String issueTitle; + private String orgId; + private String orgType; + + /** + * under_auditing:待审核;rejected:驳回; + */ + private String applyStatus; + + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java index d633a49564..eee04a2b61 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java @@ -17,11 +17,17 @@ public class CloseIssueFormDTO implements Serializable { @NotBlank(message = "议题Id不能为空") private String issueId; + /** + * resolved已解决 + * unresolved未解决 + */ @NotBlank(message = "解决状态不能为空") private String resolveType; @NotBlank(message = "关闭理由不能为空") @Length(max=1000,message = "手机号不能超过1000位") private String closeReason; + + private String currentUserId; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java new file mode 100644 index 0000000000..5bfd830570 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/12 11:00 + */ +@Data +public class DelIssueFormDTO { + @NotBlank(message = "customerId不能为空") + private String customerId; + @NotBlank(message = "userId不能为空") + private String userId; + @Valid + @NotEmpty(message = "issueIds不能为空") + private List issueIds; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java index d9339a0e97..3c2caa5909 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java @@ -15,7 +15,8 @@ public class IssueCategoryTagListFormDTO implements Serializable { private static final long serialVersionUID = 2599592072265715951L; @NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) private String issueId; - + @NotBlank(message = "customerId不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) + private String customerId; public interface CategoryTag{} } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java new file mode 100644 index 0000000000..a965c22ed4 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java @@ -0,0 +1,123 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description + * @Author yzm + * @Date 2022/10/10 9:32 + */ +@Data +public class PublishIssueFormDTO implements Serializable { + private static final long serialVersionUID = 1713711343683095564L; + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + @NotBlank(message = "议题状态不能为空", groups = AddUserShowGroup.class) + private String issueStatus; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + @NotBlank(message = "议题来源不能为空", groups = AddUserShowGroup.class) + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 议题名称 最多20字 + */ + @NotBlank(message = "issueTitle不能为空", groups = AddUserShowGroup.class) + private String issueTitle; + + /** + * 建议 最多1000字 + */ + @NotBlank(message = "suggestion不能为空", groups = AddUserShowGroup.class) + private String suggestion; + + /** + * 客户ID + */ + @NotBlank(message = "customerId不能为空", groups = AddUserShowGroup.class) + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + @NotBlank(message = "gridId不能为空", groups = AddUserShowGroup.class) + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + @NotBlank(message = "orgIdPath不能为空", groups = AddUserShowGroup.class) + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + @NotBlank(message = "orgId不能为空", groups = AddUserShowGroup.class) + private String orgId; + + /** + * 表决发起日期(转议题日期) + */ + @NotNull(message = "表决发起日期(转议题日期)不能为空", groups = AddUserShowGroup.class) + private Date decidedTime; + + /** + * 地址 + */ + @NotBlank(message = "address不能为空", groups = AddUserShowGroup.class) + private String address; + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = AddUserShowGroup.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空", groups = AddUserShowGroup.class) + private String latitude; + + /** + * 创建人 + */ + @NotBlank(message = "议题发起人(createdBy)不能为空", groups = AddUserShowGroup.class) + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String eventReportUserName; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java index fb51463348..d0f2ad3c41 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java @@ -17,4 +17,9 @@ public class SelectIssueVotingDetailFormDTO implements Serializable { private String issueId; private String gridId; + + /** + * 来源类型 不为空的时候根据类型处理 + */ + private String sourceType; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java index 44655fbb8b..b3816f3a24 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java @@ -28,5 +28,11 @@ public class VoteFormDTO implements Serializable { */ private String createdBy; + /** + * 当 sourceType = issue 时,是直接创建议题,无需加入小组即可表决 + * 默认为resi_topic + */ + private String sourceType = "resi_topic"; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java new file mode 100644 index 0000000000..0efcb2566a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2022/10/9 16:49 + * @DESC + */ +@Data +public class AllIssueListResultDTO implements Serializable { + + private static final long serialVersionUID = -3447913619727610107L; + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + private String orgId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 议题建议 + */ + private String suggestion; + + /** + * 议题创建时间 + */ + private String createdTime; + + /** + * 支持数 + */ + private Integer supportCount; + + /** + * 反对数 + */ + private Integer oppositionCount; + + /** + * 议题状态 + */ + private String issueStatus; + private String issueStatusName; + private String issueId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; + + private Date decidedTime; + private Date votingDeadline; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java new file mode 100644 index 0000000000..5878ca9864 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 17:04 + * @DESC + */ +@Data +public class AuditListResultDTO implements Serializable { + + private static final long serialVersionUID = -9143726703244316997L; + + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + private String orgId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 议题建议 + */ + private String suggestion; + + private String applyStatus; + private String applyStatusName; + + private String applyTime; + + private String issueApplicationId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index 08bfdca9e6..68b2b4367e 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description @@ -38,4 +39,15 @@ public class ClosedIssueListResultDTO implements Serializable { * 话题id */ private String sourceId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java index 5d87d13144..c82a6a79ce 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -53,6 +54,7 @@ public class GovIssueDetailResultDTO implements Serializable { * 议题来源 例如 resi_topic * */ private String sourceType; + private String sourceId; /** * 当议题没有转成详情时此项为"" @@ -64,4 +66,16 @@ public class GovIssueDetailResultDTO implements Serializable { * */ private Long votingDeadline; + public GovIssueDetailResultDTO() { + this.issueTitle = ""; + this.issueStatus = ""; + this.topicInfo = new GovTopicOfIssueInfoResultDTO(); + this.issuePublisherMobile = ""; + this.issueSuggestion = ""; + this.belongsGridName = ""; + this.issueInitiator = ""; + this.sourceType = ""; + this.projectId = ""; + this.votingDeadline = NumConstant.ZERO_L; + } } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java index 1ddcdd85da..40fe5ceafa 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -53,4 +55,15 @@ public class GovTopicOfIssueInfoResultDTO implements Serializable { * 话题所属小组名称 */ private String groupName; + + public GovTopicOfIssueInfoResultDTO() { + this.topicId = ""; + this.topicContent = ""; + this.photoList = new ArrayList<>(); + this.topicPublisher = ""; + this.topicPublishTime = NumConstant.ZERO_L; + this.topicPublisherMobile = ""; + this.groupId = ""; + this.groupName = ""; + } } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java new file mode 100644 index 0000000000..9fa5741fe3 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * @Description 议题的处理进展(包含转项目后的进展)内部服务之间调用 + * @Author yzm + * @Date 2022/10/11 9:43 + */ +@Data +public class IssueAdvanceResDTO { + private String issueId; + /** + * 议题状态(voting 已转项目:shift_project 已关闭:closed) + */ + private String issueStatus; + private List processList; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java new file mode 100644 index 0000000000..ce7311130c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/8 12:58 + */ +@Data +public class IssueProfileDTO { + private String issueId; + private String sourceId; + private String longitude; + private String latitude; + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index f63ea2d492..c87d9e5f51 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Author zxc @@ -15,7 +16,7 @@ import java.util.Date; public class IssueResultDTO implements Serializable { private static final long serialVersionUID = -1L; - + private String issueId; /** * 议题标题 */ @@ -53,4 +54,16 @@ public class IssueResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftIssueTime; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + private String sourceId; + + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java index 4af11fb3f2..e666b9b9cb 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java @@ -50,4 +50,6 @@ public class MyPubIssuesAuditingResultDTO implements Serializable { @JsonIgnore private String topicId; + private String sourceType; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java index 05b17f9d57..731a1e5b57 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java @@ -5,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * @Author zxc + * @Author zxc 就是他issue * 议题处理进展 */ @Data @@ -37,5 +37,6 @@ public class ProcessListResultDTO implements Serializable { * 进展id(操作记录表id) */ private String processId; + private String type; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java new file mode 100644 index 0000000000..d3e8b4ed84 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 11:13 + */ +@Data +public class ProcessListResultDTOBak { + + /** + * 处理进展名称(表决中、转项目、流转中已结案、已关闭) + */ + private String processName; + + /** + * 已转项目进展记录时间 + */ + private Long processTime; + + /** + * 处理部门(处理人所属的机关单位名称) + */ + private String departmentName; + + /** + * 进展说明 + */ + private String progressDesc; + + /** + * 进展id(操作记录表id) + */ + private String processId; + private String type; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index 2ac18595ea..038d40a90d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description 政府端/居民段查看表决中议题列表返参 @@ -18,7 +19,10 @@ public class VotingIssueListResultDTO implements Serializable { * 议题发布时间 * */ private Long issuePublishTime; - + /** + * 议题发布时间 + */ + private String issuePublishTimeStr; /** * 议题Id * */ @@ -38,4 +42,14 @@ public class VotingIssueListResultDTO implements Serializable { * 来源话题的id */ private String sourceId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 2392e4d2fa..097dbeba8c 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -34,7 +34,7 @@ import java.util.Map; * @date 2020/6/4 13:37 */ @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class) -//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class,url = "localhost:8101") +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** @@ -336,7 +336,11 @@ public interface GovIssueOpenFeignClient { @PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectcategory") Result> getProjectCategory(@RequestBody List list); - + /** + * 调用此方法建议分页!!!! + * @param formDTO + * @return + */ @PostMapping("/gov/issue/issue/unresolvedlist") Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO); @@ -395,4 +399,37 @@ public interface GovIssueOpenFeignClient { @PostMapping(value = "/gov/issue/issueprojectcategorydict/first/{customerId}") Result> queryFirstCategory(@PathVariable("customerId") String customerId); + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + @PostMapping("/gov/issue/issue/getIssueProfile") + Result> getIssueProfile(@RequestBody List issueIds); + + /** + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("/gov/issue/issue/publishIssue") + Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO); + + /** + * 议题处理进展:(只包含发起议题、关闭议题) + * @param formDTO + * @return + */ + @PostMapping("/gov/issue/issueprocess/issueprocess") + Result queryIssueProcess(@RequestBody IssueIdFormDTO formDTO); + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + @PostMapping("/gov/issue/issue/deleteIssueInternal") + Result> deleteIssueInternal(@RequestBody DelIssueFormDTO delIssueFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index be2f187945..b76d3ce734 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -332,5 +332,48 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryFirstCategory", customerId); } + /** + * 根据议题ids查询议题简要信息 + * + * @param issueIds + * @return + */ + @Override + public Result> getIssueProfile(List issueIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getIssueProfile", issueIds); + } + + /** + * 事件转议题 + * + * @param issueFormDTO + * @return + */ + @Override + public Result publishIssue(PublishIssueFormDTO issueFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "publishIssue", issueFormDTO); + } + /** + * 议题处理进展,(只包含发起议题、关闭议题) + * + * @param formDTO + * @return + */ + @Override + public Result queryIssueProcess(IssueIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryIssueProcess", formDTO); + } + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回项目id,上层再单独去删除项目 + */ + @Override + public Result> deleteIssueInternal(DelIssueFormDTO delIssueFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "deleteIssueInternal", delIssueFormDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 7741561d9f..db38938089 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -179,7 +179,9 @@ callerRunsPolicy false - https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://epmet-open.elinkservice.cn/api/epmetscan/api https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java index 2a0cf7b35f..8cb2d2d0da 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java @@ -36,4 +36,9 @@ public interface UserMessageConstant { */ String PROJECT_RESOLVED_MSG = "您收到一条【%s】的新信息,请您尽快处理。"; + /** + * 议题转项目消息模板 + */ + String PUB_ISSUE_SHIFT_PROJECT_MSG = "您发表的议题\"%s\"的问题,已由%s部门处理,请查看。"; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java index 8317eb8ab0..25f4af86f9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java @@ -2,16 +2,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IssueConstant; import com.epmet.dto.form.*; -import com.epmet.dto.result.ApplicationDetailWorkResultDTO; -import com.epmet.dto.result.ApplicationHistoryResDTO; -import com.epmet.dto.result.ApplicationHistoryWorkResultDTO; -import com.epmet.dto.result.IssueApplicationResDTO; +import com.epmet.dto.result.*; import com.epmet.service.IssueApplicationHistoryService; import com.epmet.service.IssueApplicationService; import com.epmet.service.IssueService; @@ -21,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; /** @@ -130,4 +131,38 @@ public class IssueAuditController { public Result audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){ return new Result().ok(issueService.audit(token,param)); } + + /** + * Desc: 审核列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/10/9 17:11 + */ + @PostMapping("auditList") + public Result> auditList(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(issueApplicationService.auditList(formDTO)); + } + + @PostMapping("auditListExport") + public void auditListExport(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueApplicationService.auditListExport(formDTO,response); + } + + /** + * Desc: 补全议题审核表历史数据 + * @param + * @author zxc + * @date 2022/10/10 10:55 + */ + @PostMapping("initIssueApplicationHistoryData") + public Result initIssueApplicationHistoryData(){ + issueApplicationService.initIssueApplicationHistoryData(); + return new Result(); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java index 6f459a71ad..6df8e177c3 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java @@ -106,7 +106,8 @@ public class IssueCategoryController { * @Author sun **/ @PostMapping("categorytaglist") - public Result categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) { + public Result categoryTagList(@LoginUser TokenDto tokenDto,@RequestBody IssueCategoryTagListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class); return new Result().ok(issueCategoryService.categoryTagList(formDTO)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index ec49c3bb81..efb1ede9f1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -1,6 +1,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -13,9 +15,12 @@ import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.epmet.service.IssueService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; /** @@ -280,7 +285,11 @@ public class IssueController { return new Result>().ok(issueService.canEvaluateProjectCountBatch(issueIds)); } - + /** + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 + * @param formDTO + * @return + */ @PostMapping("unresolvedlist") public Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO){ return new Result>().ok(issueService.getUnResolvedList(formDTO)); @@ -333,5 +342,78 @@ public class IssueController { return new Result().ok(issueService.issueAuditReset(gridId)); } + /** + * Desc: 创建议题【直接创建】 + * @param formDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + @PostMapping("createIssue") + public Result createIssue(@LoginUser TokenDto tokenDto,@RequestBody IssueDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,IssueDTO.IssueForm.class); + issueService.createIssue(formDTO); + return new Result(); + } + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + @PostMapping("getIssueProfile") + public Result> getIssueProfile(@RequestBody List issueIds) { + if (CollectionUtils.isEmpty(issueIds)) { + return new Result<>(); + } + return new Result>().ok(issueService.getIssueProfile(issueIds)); + } + + /** + * Desc: 查询所有议题 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/10/9 16:59 + */ + @PostMapping("allIssueList") + public Result> allIssueList(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(issueService.allIssueList(formDTO)); + } + + @PostMapping("allIssueListExport") + public void allIssueListExport(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueService.allIssueListExport(formDTO,response); + } + + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("publishIssue") + public Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO) { + ValidatorUtils.validateEntity(issueFormDTO, PublishIssueFormDTO.AddUserShowGroup.class); + return new Result().ok(issueService.publishIssue(issueFormDTO)); + } + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回项目id,上层再单独去删除项目 + */ + @PostMapping("deleteIssueInternal") + public Result> deleteIssueInternal(@RequestBody DelIssueFormDTO delIssueFormDTO){ + ValidatorUtils.validateEntity(delIssueFormDTO); + return new Result>().ok(issueService.deleteIssueInternal(delIssueFormDTO)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java index a77e531b26..ec413629df 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java @@ -43,8 +43,9 @@ public class IssueManageController { * @Description 议题管理-关闭议题 **/ @PostMapping("closeissue") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSE) + // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSE) public Result closeIssue(@LoginUser TokenDto tokenDTO, @RequestBody CloseIssueFormDTO formDTO) { + formDTO.setCurrentUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO); issueService.closeIssue(formDTO); return new Result(); @@ -88,6 +89,11 @@ public class IssueManageController { return new Result().ok(issueVoteStatisticalService.votingTrend(issueId)); } + @PostMapping("votingTrendV2") + public Result votingTrendV2(@RequestBody IssueIdFormDTO issueId){ + return new Result().ok(issueVoteStatisticalService.votingTrendV2(issueId)); + } + /** * @Description 满意度评价列表——已关闭 * @param formDTO @@ -196,6 +202,7 @@ public class IssueManageController { @PostMapping("progress") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result> processList(@RequestBody IssueIdFormDTO issueId){ + ValidatorUtils.validateEntity(issueId); return new Result>().ok(issueProcessService.processList(issueId)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java index 737b187ad1..5250066ed8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.excel.IssueProcessExcel; import com.epmet.service.IssueProcessService; @@ -103,4 +104,13 @@ public class IssueProcessController { return new Result>().ok(issueProcessService.processList(issueId)); } + /** + * 议题的处理进展,(只包含发起议题、关闭议题) + * @param issueId + * @return + */ + @PostMapping("issueprocess") + public Result queryIssueProcess(@RequestBody IssueIdFormDTO issueId){ + return new Result().ok(issueProcessService.queryIssueProcess(issueId)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java index 33296076b6..4f2ede6325 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; @@ -74,4 +76,28 @@ public interface IssueApplicationDao extends BaseDao { */ List selectTopicIdList(@Param("topicIdList") List topicIdList); + /** + * Desc: 待审核,驳回列表 + * @param formDTO + * @author zxc + * @date 2022/10/10 13:42 + */ + List auditList(AuditListFormDTO formDTO); + + /** + * Desc: 补全数据 + * @param + * @author zxc + * @date 2022/10/10 13:42 + */ + List initIssueApplicationHistoryData(); + + /** + * Desc: 批量更新议题审核组织信息 + * @param list + * @author zxc + * @date 2022/10/10 13:42 + */ + void updateIssueApplication(List list); + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java new file mode 100644 index 0000000000..828bea698e --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IssueAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Mapper +public interface IssueAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java index 650e4ac227..42fb7ca9bf 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java @@ -42,7 +42,7 @@ public interface IssueCategoryDao extends BaseDao { * @Description 查询议题绑定的分类名称,按排序升序 * @Author sun **/ - List selectIssueCategoryList(@Param("issueId") String issueId); + List selectIssueCategoryList(@Param("customerId")String customerId,@Param("issueId") String issueId); /** * @param formDTO diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index 1c5ae213ee..ce3dc28a1c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -308,4 +308,12 @@ public interface IssueDao extends BaseDao { */ Integer selectAuditIssue(@Param("gridId")String gridId); + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List selectIssueProfile(@Param("issueIds") List issueIds); + + List allIssueList(AllIssueListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java index 8ec3f59be1..f61f5e6917 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java @@ -70,6 +70,9 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String gridId; + private String orgId; + private String orgIdPath; + /** * 审核通过后对应的 议题id */ @@ -85,4 +88,16 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String approveStaffId; + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java new file mode 100644 index 0000000000..b7016bd587 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java @@ -0,0 +1,82 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_attachment") +public class IssueAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务id + */ + private String businessId; + + /** + * 议题:issue + */ + private String attachTo; + + /** + * 附件名 + */ + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String type; + + /** + * 附件地址 + */ + private String url; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java index fa33418bc6..7f47f3cfa1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java @@ -43,7 +43,7 @@ public class IssueEntity extends BaseEpmetEntity { private String issueStatus; /** - * 来源类型 eg:resi_topic + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String sourceType; @@ -112,4 +112,19 @@ public class IssueEntity extends BaseEpmetEntity { */ private Date closedTime; + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java new file mode 100644 index 0000000000..5a4a508506 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java @@ -0,0 +1,42 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/10/11 16:30 + * @DESC + */ +@Data +public class AllIssueListExportExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "议题标题") + @ColumnWidth(20) + private String issueTitle; + + @ExcelProperty(value = "议题建议") + @ColumnWidth(20) + private String suggestion; + + @ExcelProperty(value = "议题创建时间") + @ColumnWidth(20) + private String createdTime; + + @ExcelProperty(value = "支持数") + @ColumnWidth(20) + private Integer supportCount; + + @ExcelProperty(value = "反对数") + @ColumnWidth(20) + private Integer oppositionCount; + + @ExcelProperty(value = "议题状态") + @ColumnWidth(20) + private String issueStatusName; +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java new file mode 100644 index 0000000000..f6aac9792c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java @@ -0,0 +1,34 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/10/11 16:45 + * @DESC + */ +@Data +public class AuditListExportExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "议题标题") + @ColumnWidth(20) + private String issueTitle; + + @ExcelProperty(value = "议题建议") + @ColumnWidth(20) + private String suggestion; + + @ExcelProperty(value = "状态") + @ColumnWidth(20) + private String applyStatusName; + + @ExcelProperty(value = "提交审核时间") + @ColumnWidth(20) + private String applyTime; +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java index 38331b5780..d0e29cf063 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java @@ -2,11 +2,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ProcessProjectIdFormDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; -import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.feign.fallback.GovProjectFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -43,9 +41,9 @@ public interface GovProjectFeignClient { /** * @Description 议题处理进展——已转项目 - * @param formDTO + * @param formDTO 该方法已经放到了GovProjectOpenFeignClient * @author zxc - */ + *//* @PostMapping("/gov/project/projectprocess/projectprocesslist") - Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO); + Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO);*/ } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java index c8185fa47e..a120f582ac 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java @@ -3,11 +3,9 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ProcessProjectIdFormDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; -import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.feign.GovProjectFeignClient; import org.springframework.stereotype.Component; @@ -26,10 +24,11 @@ public class GovProjectFeignClientFallBack implements GovProjectFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProjectByIssue", fromDTO); } - @Override + //该方法已经放到了GovProjectOpenFeignClient + /*@Override public Result> projectProcessList(ProcessProjectIdFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "projectProcessList", formDTO); - } + }*/ @Override public Result issueShiftProject(ShiftProjectFormDTO formDTO) { diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index aecc10b0b5..5b00541fb0 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java @@ -20,8 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; @@ -32,6 +34,8 @@ import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -150,4 +154,9 @@ public interface IssueApplicationService extends BaseService notIssueToTopicIds(List topicIdList); + + PageData auditList(AuditListFormDTO formDTO); + void auditListExport(AuditListFormDTO formDTO, HttpServletResponse response) throws IOException; + + void initIssueApplicationHistoryData(); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java new file mode 100644 index 0000000000..1ca53e2103 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueAttachmentDTO; +import com.epmet.entity.IssueAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +public interface IssueAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-09-30 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-09-30 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueAttachmentDTO + * @author generator + * @date 2022-09-30 + */ + IssueAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-30 + */ + void save(IssueAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-30 + */ + void update(IssueAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-09-30 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java index 5717b27db0..489470c850 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java @@ -27,6 +27,7 @@ import com.epmet.dto.result.IssueCategoryTagListResultDTO; import com.epmet.dto.result.ProjectCategoryTagResultDTO; import com.epmet.entity.IssueCategoryEntity; +import java.util.Date; import java.util.List; import java.util.Map; @@ -132,4 +133,5 @@ public interface IssueCategoryService extends BaseService { **/ void saveCategory(IssueSaveCategoryFormDTO formDTO); + void delByIssueId(String issueId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java index b3b8a300ab..025d10baca 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.entity.IssueProcessEntity; @@ -109,4 +110,11 @@ public interface IssueProcessService extends BaseService { * @date 2020.05.13 16:42 **/ int insertOne(IssueProcessDTO issueProcessDTO); + + /** + * 议题的处理进展,(只包含发起议题、关闭议题) + * @param issueId + * @return + */ + IssueAdvanceResDTO queryIssueProcess(IssueIdFormDTO issueId); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 1296374261..4ccd839e72 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -14,6 +14,8 @@ import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; @@ -343,6 +345,7 @@ public interface IssueService extends BaseService { /** * 无需解决解决列表 + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 * @author zhaoqifeng * @date 2021/7/27 16:58 * @param fromDTO @@ -384,4 +387,43 @@ public interface IssueService extends BaseService { */ Boolean issueAuditReset(String gridId); + /** + * Desc: 创建议题【直接创建】 + * @param issueDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + void createIssue(IssueDTO issueDTO); + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List getIssueProfile(List issueIds); + + /** + * Desc: 查询所有议题 + * @param formDTO + * @author zxc + * @date 2022/10/9 16:58 + */ + PageData allIssueList(AllIssueListFormDTO formDTO); + void allIssueListExport(AllIssueListFormDTO formDTO, HttpServletResponse response) throws IOException; + + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO); + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + List deleteIssueInternal(DelIssueFormDTO delIssueFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java index b7970e8793..a99f1a96c7 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.IssueTagsSaveFormDTO; import com.epmet.dto.result.AddTagResultDTO; import com.epmet.entity.IssueTagsEntity; +import java.util.Date; import java.util.List; import java.util.Map; @@ -122,4 +123,6 @@ public interface IssueTagsService extends BaseService { * @date 2020/12/10 上午9:37 */ void issueTagSave(IssueTagsSaveFormDTO form, TokenDto tokenDto); + + void delByIssueId(String issueId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java index a1aec7c5f1..d9f8c8c7dc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java @@ -28,6 +28,7 @@ import com.epmet.dto.result.EvaluationListResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; +import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import java.util.List; @@ -115,6 +116,7 @@ public interface IssueVoteStatisticalService extends BaseService page(Map params) { @@ -136,6 +140,8 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl result = resiGroupOpenFeignClient.applicationDetail(formDTO); if (!result.success()){ throw new RenException("工作端查询待审核||已驳回 申请详情失败......"); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java index 074b7bcd39..7332720abd 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java @@ -17,19 +17,39 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +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.poi.excel.handler.FreezeAndFilter; import com.epmet.dao.IssueApplicationDao; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AllIssueListResultDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; +import com.epmet.excel.AllIssueListExportExcel; +import com.epmet.excel.AuditListExportExcel; import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; @@ -39,13 +59,17 @@ import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import com.epmet.service.IssueApplicationService; import com.epmet.utils.ModuleConstants; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; /** * 话题转议题申请表 @@ -54,6 +78,7 @@ import java.util.Map; * @since v1.0.0 2020-11-17 */ @Service +@Slf4j public class IssueApplicationServiceImpl extends BaseServiceImpl implements IssueApplicationService { @Override @@ -186,4 +211,98 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl auditList(AuditListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + } + PageData result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.auditList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List auditListResultDTOS = baseDao.auditList(formDTO); + result.setList(auditListResultDTOS); + result.setTotal(auditListResultDTOS.size()); + } + if (CollectionUtils.isNotEmpty(result.getList())){ + result.getList().forEach(l -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+l.getGridId()); + } + l.setGridName(gridInfo.getGridNamePath()); + }); + } + return result; + } + + @Override + public void auditListExport(AuditListFormDTO formDTO, HttpServletResponse response) throws IOException { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "议题审核列表" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), AuditListExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + List list = null; + do { + PageData data = auditList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), AuditListExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + @Override + public void initIssueApplicationHistoryData() { + Integer no = NumConstant.ONE; + Integer size; + do { + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.initIssueApplicationHistoryData()); + List list = pageInfo.getList(); + size = list.size(); + if (CollectionUtils.isNotEmpty(list)){ + for (IssueApplicationDTO l : list) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if (null == gridInfo){ + log.warn("查询网格信息失败:"+l.getGridId()); + continue; + } + l.setOrgId(gridInfo.getPid()); + l.setOrgIdPath(gridInfo.getPids()); + } + updateIssueApplication(list); + } + no++; + }while (size.compareTo(NumConstant.ONE_HUNDRED) == NumConstant.ZERO); + } + + @Transactional(rollbackFor = Exception.class) + public void updateIssueApplication(List list){ + baseDao.updateIssueApplication(list); + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java new file mode 100644 index 0000000000..e9d0c69b54 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java @@ -0,0 +1,82 @@ +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IssueAttachmentDao; +import com.epmet.dto.IssueAttachmentDTO; +import com.epmet.entity.IssueAttachmentEntity; +import com.epmet.service.IssueAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Service +public class IssueAttachmentServiceImpl extends BaseServiceImpl implements IssueAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueAttachmentDTO get(String id) { + IssueAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueAttachmentDTO dto) { + IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueAttachmentDTO dto) { + IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java index c86e5d926d..2fda58fd28 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -44,10 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -130,7 +128,7 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl categoryList = baseDao.selectIssueCategoryList(formDTO.getIssueId()); + List categoryList = baseDao.selectIssueCategoryList(formDTO.getCustomerId(),formDTO.getIssueId()); if (categoryList.size() > NumConstant.ZERO) { resultDTO.setCategoryList(categoryList); } @@ -224,4 +222,13 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueCategoryEntity::getIssueId, issueId) + .set(IssueCategoryEntity::getUpdatedTime, delTime) + .set(IssueCategoryEntity::getUpdatedBy, userId) + .set(IssueCategoryEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java index 5e47cc5a4a..b53f885c0f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java @@ -21,6 +21,8 @@ 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -32,9 +34,12 @@ import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; import com.epmet.dto.form.ProcessProjectIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; +import com.epmet.dto.result.ProcessListResultDTOBak; +import com.epmet.dto.result.ProjectProcessListResultDTO; import com.epmet.entity.IssueProcessEntity; -import com.epmet.feign.GovProjectFeignClient; +import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.service.IssueProcessService; import com.epmet.service.IssueService; import org.apache.commons.lang3.StringUtils; @@ -60,11 +65,11 @@ public class IssueProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -140,33 +145,61 @@ public class IssueProcessServiceImpl extends BaseServiceImpl processList(IssueIdFormDTO issueId) { List listResult = new ArrayList(); IssueDTO issueDTO = issueService.get(issueId.getIssueId()); + if(null==issueDTO){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"议题不存在","议题不存在"); + } String issueStatus = issueDTO.getIssueStatus(); if (issueStatus.equals(IssueConstant.ISSUE_CLOSED)){ //已关闭——处理进展 listResult = baseDao.issueProcess(issueId); + return listResult; }else if (issueStatus.equals(IssueConstant.ISSUE_SHIFT_PROJECT)){ //已转项目——处理进展 String projectId = issueProjectRelationDao.selectProjectIdByIssueId(issueId.getIssueId()); if (!StringUtils.isBlank(projectId)) { ProcessProjectIdFormDTO formDTO = new ProcessProjectIdFormDTO(); formDTO.setProjectId(projectId); - Result> resultDTO = govProjectFeignClient.projectProcessList(formDTO); + Result> resultDTO = govProjectOpenFeignClient.projectProcessList(formDTO); if (!resultDTO.success()){ throw new RenException(IssueConstant.PROJECT_PROCESS_LIST_FAILURE); } if (!CollectionUtils.isEmpty(resultDTO.getData())){ - listResult = resultDTO.getData(); - } - //转议题信息 - ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); - if (null != issueProcessResultDTO) { - listResult.add(issueProcessResultDTO); + listResult.addAll(ConvertUtils.sourceToTarget(resultDTO.getData(),ProcessListResultDTO.class)); } } - }else { - return new ArrayList<>(); + } + //转议题信息 + ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); + if (null != issueProcessResultDTO) { + listResult.add(issueProcessResultDTO); } return listResult; } + /** + * 议题处理进展(只包含发起议题、关闭议题) + * + * @param issueId + * @return + */ + @Override + public IssueAdvanceResDTO queryIssueProcess(IssueIdFormDTO issueId) { + IssueDTO issueDTO = issueService.get(issueId.getIssueId()); + List processList=new ArrayList<>(); + if (issueDTO.getIssueStatus().equals(IssueConstant.ISSUE_CLOSED)){ + //已关闭——处理进展 + processList = baseDao.issueProcess(issueId); + }else{ + //转议题信息 + ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); + if (null != issueProcessResultDTO) { + processList.add(issueProcessResultDTO); + } + } + IssueAdvanceResDTO issueAdvanceResDTO=new IssueAdvanceResDTO(); + issueAdvanceResDTO.setIssueId(issueDTO.getId()); + issueAdvanceResDTO.setIssueStatus(issueDTO.getIssueStatus()); + issueAdvanceResDTO.setProcessList(ConvertUtils.sourceToTarget(processList, ProcessListResultDTOBak.class)); + return issueAdvanceResDTO; + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java index 99cc85eecf..2ae8d5e288 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java @@ -178,10 +178,9 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl imp private IssueVoteDetailService issueVoteDetailService; @Autowired private DistributedLock distributedLock; + @Autowired + private IssueAttachmentService issueAttachmentService; @Value("${openapi.scan.server.url}") private String scanApiUrl; @Value("${openapi.scan.method.textSyncScan}") private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; @Override public PageData page(Map params) { @@ -209,13 +228,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp //议题信息 IssueResultDTO issueResult = issueDao.issueDetail(issueDetail); if (null != issueResult && StringUtils.isNotBlank(issueResult.getGridId())) { - BelongGridNameFormDTO formDTO = new BelongGridNameFormDTO(); - formDTO.setGridId(issueResult.getGridId()); - Result result = govOrgOpenFeignClient.getGridNameByGridId(formDTO); - logger.info("根据网格id查询网格名称接口返参:" + JSON.toJSONString(result)); - if (result.success() && null != result.getData()) { - issueResult.setGridName(result.getData().getBelongsGridName()); - } + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(issueResult.getGridId()); + issueResult.setGridName(null != gridInfoCache ? gridInfoCache.getGridNamePath() : StrConstant.EPMETY_STR); } return issueResult; } @@ -376,8 +390,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp result.setAuditSwitch(ifOpen ? ModuleConstants.AUDIT_SWITCH_OPEN : ModuleConstants.AUDIT_SWITCH_CLOSE); //2.居民端组长提交议题审核 - - //默认打开 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(param.getGridId()); + if (null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+param.getGridId()); + } + //默认打开 //2.1查询是否存在application记录 Map applicationParam = new HashMap<>(); applicationParam.put(ModuleConstants.FIELD_JAVA_TOPIC_ID, param.getTopicId()); @@ -390,6 +407,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp if(ifOpen) { //首次提交 新增application IssueApplicationDTO newApplication = ConvertUtils.sourceToTarget(param, IssueApplicationDTO.class); + newApplication.setOrgId(gridInfo.getPid()); + newApplication.setOrgIdPath(gridInfo.getPids()); newApplication.setApplyStatus(defaultStatusUnderAuditing); newApplication.setId(UUID.randomUUID().toString().replace("-", "")); applicationService.save(newApplication); @@ -558,8 +577,6 @@ public class IssueServiceImpl extends BaseServiceImpl imp app2update.setIssueId(issueResult.getIssueId()); } - }else { - throw new RenException(topicInfo.getInternalMsg()); } @@ -591,7 +608,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient) .sendGroupAchievementMqMsg(new GroupAchievementMQMsg(application.getCustomerId(), application.getGroupId(), AchievementTypeEnum.TOISSUE.getCode())); if (!flag) { - logger.error("发送(小组成就)系统消息到message服务失败"); + logger.warn("发送(小组成就)系统消息到message服务失败"); } return app2update.getIssueId(); } @@ -606,7 +623,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List votingList(CommonIssueListFormDTO issueListForm) { PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); - return baseDao.selectVotingList(issueListForm); + List resultList=baseDao.selectVotingList(issueListForm); + return resultList; } /** @@ -619,7 +637,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List closedList(CommonIssueListFormDTO issueListForm) { PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); - return baseDao.selectClosedList(issueListForm); + List resultDTOList=baseDao.selectClosedList(issueListForm); + return resultDTOList; } /** @@ -633,7 +652,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp public GovIssueDetailResultDTO issueDetailGov(IssueDetailFormDTO issueParam) { //1.得到议题信息 IssueEntity issueDetail = selectById(issueParam.getIssueId()); - + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(issueDetail.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败"+issueDetail.getGridId()); + } + GovIssueDetailResultDTO issueInfo = new GovIssueDetailResultDTO(); //2.1如果此条议题来源自话题 if(StringUtils.equals(ModuleConstants.ISSUE_FROM_TOPIC,issueDetail.getSourceType())){ GovTopicIssueInfoFormDTO topicParam = new GovTopicIssueInfoFormDTO(); @@ -645,10 +668,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp resiGroupFeignClient.topicInfoForIssueDetailGov(topicParam); if(topicResult.success() && null != topicResult.getData()){ GovTopicOfIssueInfoResultDTO topicInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovTopicOfIssueInfoResultDTO.class); - GovIssueDetailResultDTO issueInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovIssueDetailResultDTO.class); + issueInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovIssueDetailResultDTO.class); issueInfo.setIssueStatus(issueDetail.getIssueStatus()); issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); issueInfo.setIssueTitle(issueDetail.getIssueTitle()); + issueInfo.setSourceId(issueDetail.getSourceId()); issueInfo.setVotingDeadline(null == issueDetail.getVotingDeadline() ? NumConstant.ZERO_L : issueDetail.getVotingDeadline().getTime()/NumConstant.ONE_THOUSAND); issueInfo.setTopicInfo(topicInfo); @@ -660,6 +684,29 @@ public class IssueServiceImpl extends BaseServiceImpl imp return issueInfo; } //查询话题失败异常 + }else if (ModuleConstants.ISSUE.equals(issueDetail.getSourceType())){ + issueInfo = ConvertUtils.sourceToTarget(issueDetail,GovIssueDetailResultDTO.class); + issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(issueDetail.getCreatedBy())); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询居民信息失败"); + } + UserBaseInfoResultDTO user = userResult.getData().get(NumConstant.ZERO); + issueInfo.setIssueInitiator(user.getShowName()); + issueInfo.setIssuePublisherMobile(user.getMobile()); + issueInfo.setBelongsGridName(gridInfo.getGridNamePath()); + return issueInfo; + }else { + issueInfo = ConvertUtils.sourceToTarget(issueDetail,GovIssueDetailResultDTO.class); + issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(issueDetail.getCustomerId(), issueDetail.getCreatedBy()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+issueDetail.getCreatedBy()); + } + issueInfo.setIssueInitiator(staffInfo.getRealName()); + issueInfo.setIssuePublisherMobile(staffInfo.getMobile()); + issueInfo.setBelongsGridName(gridInfo.getGridNamePath()); + return issueInfo; } return null; @@ -675,50 +722,37 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Transactional(rollbackFor = Exception.class) public void closeIssue(CloseIssueFormDTO formDTO) { //公开回复内容审核 - if (StringUtils.isNotBlank(formDTO.getCloseReason())) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - taskDTO.setContent(formDTO.getCloseReason()); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } + checkCloseReason(formDTO.getCloseReason()); - Date date = new Date(); + Date nowTime = new Date(); //1:更新议题详情表数据 IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); if (null == entity) { - throw new RenException(IssueConstant.SELECT_EXCEPTION); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_EXCEPTION,"议题不存在"); } if (IssueConstant.ISSUE_CLOSED.equals(entity.getIssueStatus())) { - throw new RenException(IssueConstant.OPERATION_EXCEPTION); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.OPERATION_EXCEPTION,"议题不存在"); } entity.setIssueStatus(IssueConstant.ISSUE_CLOSED); entity.setCloseReason(formDTO.getCloseReason()); entity.setResolveType(formDTO.getResolveType()); - entity.setVotingDeadline(date); - entity.setClosedTime(date); + entity.setVotingDeadline(nowTime); + entity.setClosedTime(nowTime); if (baseDao.updateById(entity) < NumConstant.ONE) { throw new RenException(IssueConstant.UPPDATE_EXCEPTION); } //2:调用gov-org服务,查询组织网格名称 - AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); + /*AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); agencyGridResultDTO.setAgencyId(entity.getOrgId()); agencyGridResultDTO.setGridId(entity.getGridId()); Result resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO); if (!resultDTO.success() || null == resultDTO.getData()) { throw new RenException(IssueConstant.SELECT_GOV_ORG_EXCEPTION); } - agencyGridResultDTO = resultDTO.getData(); - + agencyGridResultDTO = resultDTO.getData();*/ + //上面代码注释,改用缓存 + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(entity.getGridId()); //3:议题进展记录表新增数据 IssueProcessEntity processEntity = new IssueProcessEntity(); processEntity.setIssueId(formDTO.getIssueId()); @@ -726,30 +760,28 @@ public class IssueServiceImpl extends BaseServiceImpl imp processEntity.setOrgType(IssueConstant.ISSUE_GRID); processEntity.setOrgId(entity.getGridId()); processEntity.setOperationExplain(formDTO.getCloseReason()); - processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName()); + // processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName()); + processEntity.setOrgName(gridInfoCache.getGridNamePath()); + processEntity.setCreatedTime(nowTime); + processEntity.setUpdatedTime(nowTime); + processEntity.setCustomerId(entity.getCustomerId()); issueProcessDao.insert(processEntity); //4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息 - //4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题) - Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); - if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { - throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); - } - ResiTopicDTO topicDTO = resultTopicDTO.getData(); - //4.2:创建消息模板 - String messageContent = ""; - if (IssueConstant.ISSUE_RESOLVED.equals(formDTO.getResolveType())) { - messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); - } else if (IssueConstant.ISSUE_UNRESOLVED.equals(formDTO.getResolveType())) { - messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); - } - //4.3:调用服务,发送消息 - if (!saveUserMessageList(topicDTO, messageContent, entity).success()) { - throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); - } - //4.4:2020.10.26 添加推送微信订阅消息功能 sun - if (!saveWxmpMessageList(topicDTO, messageContent, entity).success()) { - logger.error("议题关闭,推送微信订阅消息失败!"); + if (entity.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ + //4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题) + sendToTopicAndShiftIssueResiUser(entity.getSourceId(),formDTO.getResolveType(),entity,formDTO.getCloseReason()); + }else if(entity.getSourceType().equals("ic_event")){ + ColseProjectOrDemandFormDTO colseProjectOrDemandFormDTO=new ColseProjectOrDemandFormDTO(); + colseProjectOrDemandFormDTO.setCustomerId(entity.getCustomerId()); + colseProjectOrDemandFormDTO.setIcEventId(entity.getSourceId()); + colseProjectOrDemandFormDTO.setType("issue"); + colseProjectOrDemandFormDTO.setUserId(formDTO.getCurrentUserId()); + colseProjectOrDemandFormDTO.setCloseCaseTime(nowTime); + Result result = govProjectOpenFeignClient.closeProjectOrDemand(colseProjectOrDemandFormDTO); + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"议题关闭异常,该议题来源于事件,回写事件信息失败","议题关闭异常:事件办结异常"); + } } try { @@ -757,12 +789,57 @@ public class IssueServiceImpl extends BaseServiceImpl imp SelectIssueVotingDetailFormDTO dto = new SelectIssueVotingDetailFormDTO(); dto.setGridId(entity.getGridId()); dto.setIssueId(formDTO.getIssueId()); + dto.setSourceType(entity.getSourceType()); issueVoteDetailService.updateVote(dto); }catch (RenException e){ logger.error(e.getInternalMsg()); } } + /** + * 议题关闭时,填写的关闭理由,走内容审核 + * @param closeReason + */ + private void checkCloseReason(String closeReason) { + if (StringUtils.isNotBlank(closeReason)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(closeReason); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + + private void sendToTopicAndShiftIssueResiUser(String topicId,String resolveType,IssueEntity issueEntity,String closeReason) { + Result resultTopicDTO = resiGroupFeignClient.getTopicById(topicId); + if (resultTopicDTO.success() &&null != resultTopicDTO.getData()) { + ResiTopicDTO topicDTO = resultTopicDTO.getData(); + //4.2:创建消息模板 + String messageContent = ""; + if (IssueConstant.ISSUE_RESOLVED.equals(resolveType)) { + messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), closeReason); + } else if (IssueConstant.ISSUE_UNRESOLVED.equals(resolveType)) { + messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), closeReason); + } + //4.3:调用服务,发送消息 + if (!saveUserMessageList(topicDTO, messageContent, issueEntity).success()) { + throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); + } + //4.4:2020.10.26 添加推送微信订阅消息功能 sun + if (!saveWxmpMessageList(topicDTO, messageContent, issueEntity).success()) { + logger.warn("议题关闭,推送微信订阅消息失败!"); + } + } + } + /** * @Description 关闭议题时给话题创建人和议题发起人发送消息 * @author sun @@ -938,7 +1015,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp } try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ logger.error(e.getInternalMsg()); } @@ -1005,18 +1082,21 @@ public class IssueServiceImpl extends BaseServiceImpl imp //因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据 //2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用 - Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); - if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); + if("resi_topic".equals(entity.getSourceType())){ + Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); + if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); + } + ResiTopicDTO topicDTO = resultTopicDTO.getData(); + formDTO.setTopicDTO(topicDTO); } - ResiTopicDTO topicDTO = resultTopicDTO.getData(); - formDTO.setTopicDTO(topicDTO); //3:调用gov-project服务,新增项目各业务表初始数据 formDTO.setCategoryList(categoryList); formDTO.setGridId(entity.getGridId()); List tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId()); formDTO.setTagList(tagList); + // 议题转项目!!!!!!!!!!!!在这步 Result resultDTO = govProjectFeignClient.issueShiftProject(formDTO); if (!resultDTO.success() || null == resultDTO.getData()) { logger.error(resultDTO.getInternalMsg()); @@ -1065,9 +1145,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp //6:缓存中网格下表决中的议题总数减1 govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ - logger.error(e.getInternalMsg()); + logger.error("subtractWorkGrassrootsIssueRedDotValue报错:"+e.getInternalMsg()); } @@ -1104,32 +1184,50 @@ public class IssueServiceImpl extends BaseServiceImpl imp List msgList = new ArrayList<>(); //1:创建话题发起人、议题发表人消息对象 - UserMessageFormDTO msgDTO = new UserMessageFormDTO(); - msgDTO.setCustomerId(entity.getCustomerId()); - msgDTO.setGridId(entity.getGridId()); - msgDTO.setApp(AppClientConstant.APP_RESI); - msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); - String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); - msgDTO.setMessageContent(topicIssueMessage); - msgDTO.setReadFlag(ReadFlagConstant.UN_READ); - msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setGridId(entity.getGridId()); + msgDTO.setApp(AppClientConstant.APP_RESI); + msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(topicIssueMessage); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); - //21.09.10:记录消息类型和对应的业务id - msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); - msgDTO.setTargetId(entity.getId()); + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); - msgList.add(msgDTO); - //话题人和议题人是同一个人时则只发送一条居民消息 - if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { - UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); - msgIssue.setUserId(entity.getCreatedBy()); + msgList.add(msgDTO); - //21.09.10:记录消息类型和对应的业务id - msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); - msgIssue.setTargetId(entity.getId()); + //话题人和议题人是同一个人时则只发送一条居民消息 + if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { + UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); + msgIssue.setUserId(entity.getCreatedBy()); - msgList.add(msgIssue); + //21.09.10:记录消息类型和对应的业务id + msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgIssue.setTargetId(entity.getId()); + + msgList.add(msgIssue); + } + }else{ + //居民端发布的议题,只给议题发布人发送消息 + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setGridId(entity.getGridId()); + msgDTO.setApp(AppClientConstant.APP_RESI); + msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); + String issueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(issueMessage); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgDTO.setUserId(entity.getCreatedBy()); + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); } + //2:创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, entity.getIssueTitle()); //所选人员如果即在部门下又在网格下则只发一条消息 @@ -1161,20 +1259,34 @@ public class IssueServiceImpl extends BaseServiceImpl imp */ private Result wxmpShiftProjectMessage(IssueProjectResultDTO issueProjectResultDTO, ShiftProjectFormDTO formDTO, IssueEntity entity) { List msgList = new ArrayList<>(); - //1:创建话题发起人、议题发表人消息对象 - WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); - msgDTO.setCustomerId(entity.getCustomerId()); - msgDTO.setClientType(AppClientConstant.APP_RESI); - msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); - msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); - String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); - msgDTO.setMessageContent(topicIssueMessage); - msgDTO.setMessageTime(new Date()); - msgDTO.setGridId(entity.getGridId()); - msgList.add(msgDTO); - //话题人和议题人是同一个人时则只发送一条居民消息 - if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { - WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); + if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { + //1:创建话题发起人、议题发表人消息对象 + WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setClientType(AppClientConstant.APP_RESI); + msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(topicIssueMessage); + msgDTO.setMessageTime(new Date()); + msgDTO.setGridId(entity.getGridId()); + msgList.add(msgDTO); + //话题人和议题人是同一个人时则只发送一条居民消息 + if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { + WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); + msgIssue.setUserId(entity.getCreatedBy()); + msgList.add(msgIssue); + } + }else{ + //只给议题发布人发送微信消息 + WxSubscribeMessageFormDTO msgIssue = new WxSubscribeMessageFormDTO(); + msgIssue.setCustomerId(entity.getCustomerId()); + msgIssue.setClientType(AppClientConstant.APP_RESI); + msgIssue.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); + msgIssue.setMessageContent(topicIssueMessage); + msgIssue.setMessageTime(new Date()); + msgIssue.setGridId(entity.getGridId()); msgIssue.setUserId(entity.getCreatedBy()); msgList.add(msgIssue); } @@ -1342,11 +1454,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new RenException("查询议题来源网格名称失败......"); } list.forEach(l -> gridNameList.getData().stream().filter(o -> l.getGridId().equals(o.getGridId())).forEach(o -> l.setTopicReleaseGridName(o.getGridName()))); - Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().map(m -> m.getTopicId()).collect(Collectors.toList()))); + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().filter(l -> l.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)).map(m -> m.getTopicId()).collect(Collectors.toList()))); if (!groupNameList.success()){ throw new RenException("查询议题来源小组名称失败......"); } - list.forEach(l -> groupNameList.getData().stream().filter(g -> l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); + list.forEach(l -> groupNameList.getData().stream().filter(g -> org.apache.commons.lang3.StringUtils.isNotBlank(l.getTopicId()) && l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); } return list; } @@ -1500,12 +1612,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp if (!CollectionUtils.isEmpty(votedCount)){ userIds.addAll(votedCount); } - // 话题创建者 - Result topicCreatedUser = resiGroupOpenFeignClient.topicCreatedUser(issueEntity.getSourceId()); - if (!topicCreatedUser.success()){ - throw new RenException("【查询话题创建者失败】["+topicCreatedUser.getMsg()+"]"); + if("resi_topic".equals(issueEntity.getSourceType())){ + // 话题创建者 + Result topicCreatedUser = resiGroupOpenFeignClient.topicCreatedUser(issueEntity.getSourceId()); + if (!topicCreatedUser.success()){ + throw new RenException("【查询话题创建者失败】["+topicCreatedUser.getMsg()+"]"); + } + userIds.add(topicCreatedUser.getData()); } - userIds.add(topicCreatedUser.getData()); // 去重 return userIds.stream().distinct().collect(Collectors.toList()); } @@ -1572,7 +1686,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp /** * 无需解决解决列表 - * + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 * @param fromDTO * @return java.util.List * @author zhaoqifeng @@ -1581,28 +1695,56 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List getUnResolvedList(ShiftProjectListFromDTO fromDTO) { List resultList = new ArrayList<>(); + List allList = new ArrayList<>(); + //1、该网格下已关闭且无需解决的议题 List issueList = baseDao.selectUnResolvedList(fromDTO.getGridId()); if (CollectionUtils.isNotEmpty(issueList)) { - resultList.addAll(issueList); + allList.addAll(issueList); } + //2、来源于议题的项目,结案无需解决的项目 List projectList = govProjectOpenFeignClient.getUnResolvedList(fromDTO).getData(); if (CollectionUtils.isNotEmpty(projectList)) { - resultList.addAll(projectList); + allList.addAll(projectList); } - if (CollectionUtils.isNotEmpty(resultList)) { - resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(allList)) { + allList = allList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); if (fromDTO.getIsPage()) { int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); - if (fromIndex >= resultList.size()) { + if (fromIndex >= allList.size()) { return new ArrayList<>(); } - if (toIndex > resultList.size()) { - toIndex = resultList.size(); + if (toIndex > allList.size()) { + toIndex = allList.size(); } - resultList = resultList.subList(fromIndex, toIndex); + resultList = allList.subList(fromIndex, toIndex); } } + //重新查询一下所有议题的来源类型, 且来源于事件的议题,赋值icEventInfo + List issueIds=resultList.stream().map(i -> i.getIssueId()).collect(Collectors.toList()); + List issueEntityList = CollectionUtils.isEmpty(issueIds) ? new ArrayList<>() : baseDao.selectBatchIds(issueIds); + if(CollectionUtils.isNotEmpty(issueEntityList)){ + Map eventMap=new HashMap<>(); + // 来源于事件的 + List icEventIds = issueEntityList.stream().filter(t -> t.getSourceType().equals("ic_event")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!org.springframework.util.CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !org.springframework.util.CollectionUtils.isEmpty(eventInfoRes.getData())) { + eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getId, o -> o, (o1, o2) -> o1)); + } + } + Map issueMap=issueEntityList.stream().collect(Collectors.toMap(IssueEntity::getId, o -> o, (o1, o2) -> o1)); + Map finalEventMap = eventMap; + resultList.forEach(vi -> { + vi.setIssueSourceType(null != issueMap.get(vi.getIssueId()) ? issueMap.get(vi.getIssueId()).getSourceType() : StrConstant.EPMETY_STR); + IcEventDTO event = finalEventMap.get(vi.getSourceId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } return resultList; } @@ -1766,5 +1908,299 @@ public class IssueServiceImpl extends BaseServiceImpl imp return false; } + /** + * Desc: 创建议题【直接创建】 + * @param issueDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + @Override + public void createIssue(IssueDTO issueDTO) { + // 先审核 + if (org.apache.commons.lang3.StringUtils.isNotBlank(issueDTO.getIssueTitle()) || org.apache.commons.lang3.StringUtils.isNotBlank(issueDTO.getSuggestion())) { + TextScanParamDTO textScan = new TextScanParamDTO(); + //标题 + TextTaskDTO taskTitle = new TextTaskDTO(); + taskTitle.setContent(issueDTO.getIssueTitle()); + taskTitle.setDataId(IdWorker.getIdStr()); + textScan.getTasks().add(taskTitle); + //建议 + TextTaskDTO taskSuggestion = new TextTaskDTO(); + taskSuggestion.setDataId(IdWorker.getIdStr()); + taskSuggestion.setContent(issueDTO.getSuggestion()); + textScan.getTasks().add(taskSuggestion); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error(String.format(TopicConstant.SHIFT_ISSUE, issueDTO.getIssueTitle(), issueDTO.getSuggestion())); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + if (CollectionUtils.isNotEmpty(issueDTO.getAttachmentList())){ + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + issueDTO.getAttachmentList().forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(IdWorker.getIdStr()); + task.setUrl(url.getUrl()); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new EpmetException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + } + } + + // 是否开启 + String openStatus = configurationParameterService.checkIssueAuditSwitchIfOpen(issueDTO.getCustomerId()); + if (ModuleConstants.AUDIT_SWITCH_OPEN.equals(openStatus)){ + // 审核表 历史表 + IssueApplicationEntity iae = ConvertUtils.sourceToTarget(issueDTO, IssueApplicationEntity.class); + iae.setApplyStatus(ModuleConstants.UNDER_AUDITING); + applicationService.insert(iae); + IssueApplicationHistoryEntity iahe = new IssueApplicationHistoryEntity(); + iahe.setCustomerId(issueDTO.getCustomerId()); + iahe.setIssueApplicationId(iae.getId()); + iahe.setActionType(ModuleConstants.UNDER_AUDITING); + historyService.insert(iahe); + insertAtt(issueDTO.getAttachmentList(),iae.getId(),ModuleConstants.ISSUE_APPLICATION,issueDTO.getCustomerId()); + }else { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(issueDTO.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败"+issueDTO.getGridId()); + } + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(issueDTO.getUserId())); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询居民信息失败:"+issueDTO.getUserId()); + } + // 议题 议题进程 + issueDTO.setOrgId(gridInfo.getPid()); + issueDTO.setOrgIdPath(gridInfo.getPids()); + IssueEntity e = ConvertUtils.sourceToTarget(issueDTO, IssueEntity.class); + e.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING); + e.setSourceType(ModuleConstants.ISSUE); + e.setDecidedTime(new Date()); + baseDao.insert(e); + IssueProcessEntity issueProcessEntity = new IssueProcessEntity(); + issueProcessEntity.setIssueId(e.getId()); + issueProcessEntity.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING); + issueProcessEntity.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_GRID); + issueProcessEntity.setOrgId(issueDTO.getGridId()); + UserBaseInfoResultDTO user = userResult.getData().get(NumConstant.ZERO); + issueProcessEntity.setOperationExplain(user.getShowName() + "发表议题【"+issueDTO.getSuggestion()+"】"); + issueProcessEntity.setOrgName(gridInfo.getGridNamePath()); + issueProcessEntity.setCustomerId(issueDTO.getCustomerId()); + issueProcessService.insert(issueProcessEntity); + insertAtt(issueDTO.getAttachmentList(),e.getId(),ModuleConstants.ISSUE,issueDTO.getCustomerId()); + } + + } + + /** + * Desc: 附件插入 + * @param sourceList 附件集合 + * @param businessId 业务ID + * @param attachTo + * @param customerId + * @author zxc + * @date 2022/10/8 09:01 + */ + private void insertAtt(Collection sourceList,String businessId,String attachTo,String customerId){ + if (CollectionUtils.isNotEmpty(sourceList)){ + List list = ConvertUtils.sourceToTarget(sourceList, IssueAttachmentEntity.class); + Integer sort = NumConstant.ZERO; + for (IssueAttachmentEntity e : list) { + e.setCustomerId(customerId); + e.setBusinessId(businessId); + e.setAttachTo(attachTo); + e.setStatus(ModuleConstants.AUDITION_TYPE_AUTO_PASSED); + e.setSort(sort); + sort++; + } + issueAttachmentService.insertBatch(list); + } + } + + /** + * 根据议题ids查询议题简要信息 + * + * @param issueIds + * @return + */ + @Override + public List getIssueProfile(List issueIds) { + if(CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + return baseDao.selectIssueProfile(issueIds); + } + + /** + * Desc: 查询所有议题 + * @param formDTO + * @author zxc + * @date 2022/10/9 16:58 + */ + @Override + public PageData allIssueList(AllIssueListFormDTO formDTO) { + if (org.apache.commons.lang3.StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + } + PageData result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.allIssueList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List allIssueListResultDTOS = baseDao.allIssueList(formDTO); + result.setList(allIssueListResultDTOS); + result.setTotal(allIssueListResultDTOS.size()); + } + if (CollectionUtils.isNotEmpty(result.getList())){ + for (AllIssueListResultDTO l : result.getList()) { + if (l.getIssueStatus().equals(ModuleConstants.ISSUE_STATUS_VOTING)){ + String endDate = null == l.getVotingDeadline() ? + DateUtils.format(new Date(),DATE_PATTERN) : + DateUtils.format(l.getVotingDeadline(),DATE_PATTERN); + String today = LocalDate.now().toString(); + if (today.equals(endDate)){ + PolyLineDTO polyLineDTO = issueVoteDetailDao.polyLineData(l.getIssueId(), endDate); + l.setSupportCount(l.getSupportCount() + polyLineDTO.getSupportIncrement()); + l.setOppositionCount(l.getOppositionCount() + polyLineDTO.getOppositionIncrement()); + } + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if(null == gridInfo){ + logger.warn("查询网格信息失败:"+l.getGridId()); + continue; + } + l.setGridName(gridInfo.getGridNamePath()); + } + } + return result; + } + + @Override + public void allIssueListExport(AllIssueListFormDTO formDTO, HttpServletResponse response) throws IOException { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "议题管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), AllIssueListExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + List list = null; + do { + PageData data = allIssueList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), AllIssueListExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + logger.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 发布议题 + * 事件转议题 + * + * @param issueFormDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO) { + // 事件转议题,是由工作端无需审核 + IssueEntity issueEntity = ConvertUtils.sourceToTarget(issueFormDTO, IssueEntity.class); + baseDao.insert(issueEntity); + + IssueProcessEntity issueProcessEntity = new IssueProcessEntity(); + issueProcessEntity.setIssueId(issueEntity.getId()); + issueProcessEntity.setIssueStatus(issueEntity.getIssueStatus()); + issueProcessEntity.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(issueFormDTO.getCustomerId(),issueFormDTO.getCreatedBy()); + issueProcessEntity.setOrgId(staffInfo.getAgencyId()); + issueProcessEntity.setOperationExplain(String.format("【%s】发表的事件被【%s】转为议题【%s】", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName(), issueEntity.getIssueTitle())); + issueProcessEntity.setOrgName(staffInfo.getAgencyName()); + issueProcessEntity.setCustomerId(issueFormDTO.getCustomerId()); + issueProcessService.insert(issueProcessEntity); + + //查询网格的所属居民数 + AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO(); + allResiByGridFormDTO.setGridId(issueEntity.getGridId()); + Result regUserTotalRes=userOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO); + //3.新增议题表决统计表 + IssueVoteStatisticalDTO voteStatistical = new IssueVoteStatisticalDTO(); + voteStatistical.setIssueId(issueEntity.getId()); + //应表决数,该网格下所有的居民 + voteStatistical.setVotableCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO); + issueVoteStatisticalService.save(voteStatistical); + VoteRedisFormDTO voteInitCache = new VoteRedisFormDTO(); + voteInitCache.setIssueId(issueEntity.getId()); + voteInitCache.setShouldVoteCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO); + issueVoteDetailRedis.set(voteInitCache); + + IssueDTO issueDTO = ConvertUtils.sourceToTarget(issueEntity, IssueDTO.class); + issueDTO.setIssueId(issueEntity.getId()); + return issueDTO; + } + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * 删除issue、issue_category、issue_tags + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public List deleteIssueInternal(DelIssueFormDTO delIssueFormDTO) { + List shiftProjectIssueIds = new ArrayList<>(); + Date nowTime = new Date(); + for (String issueId : delIssueFormDTO.getIssueIds()) { + IssueEntity issueEntity = baseDao.selectById(issueId); + if (null == issueEntity) { + continue; + } + // 删除议题主表 + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueEntity::getId, issueId) + .set(IssueEntity::getUpdatedTime, nowTime) + .set(IssueEntity::getUpdatedBy, delIssueFormDTO.getUserId()) + .set(IssueEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + // 删除议题分类关系表 + issueCategoryService.delByIssueId(issueId, delIssueFormDTO.getUserId(), nowTime); + // 删除议题标签关系表 + issueTagsService.delByIssueId(issueId, delIssueFormDTO.getUserId(), nowTime); + if ("shift_project".equals(issueEntity.getIssueStatus())) { + shiftProjectIssueIds.add(issueEntity.getId()); + } + } + return shiftProjectIssueIds; + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java index 687ce57e47..2c02be5f3c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java @@ -9,10 +9,11 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.IssueShareConstant; import com.epmet.dao.IssueShareLinkRecordDao; import com.epmet.dao.IssueShareLinkVisitRecordDao; +import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueShareLinkRecordDTO; import com.epmet.dto.form.IssueCreateUrlFormDTO; import com.epmet.dto.form.IssueVisitFormDTO; @@ -20,9 +21,8 @@ import com.epmet.dto.result.IssueCreateUrlResultDTO; import com.epmet.dto.result.IssueVisitResultDTO; import com.epmet.entity.IssueShareLinkRecordEntity; import com.epmet.entity.IssueShareLinkVisitRecordEntity; -import com.epmet.resi.group.dto.topic.form.TopicBelongGroupFormDTO; -import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.service.IssueService; import com.epmet.service.IssueShareLinkRecordService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -118,19 +118,24 @@ public class IssueShareLinkRecordServiceImpl extends BaseServiceImpl topicInfo = resiGroupOpenFeignClient.selectTopicBelongGroup(topicBelongGroupFormDTO); - if (!topicInfo.success()){ - throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_FAILURE); - } + IssueDTO issueEntity= SpringContextUtils.getBean(IssueService.class).get(formDTO.getIssueId()); + //并改成兼容,发现不需要查询话题的网格id, 索性注释了吧 + /*if("resi_topic".equals(issueEntity.getSourceType())){ + TopicBelongGroupFormDTO topicBelongGroupFormDTO = new TopicBelongGroupFormDTO(); + topicBelongGroupFormDTO.setTopicId(issueInfo.getTopicId()); + // 查询议题来源所属小组【话题所属小组】 + Result topicInfo = resiGroupOpenFeignClient.selectTopicBelongGroup(topicBelongGroupFormDTO); + if (!topicInfo.success()){ + throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_FAILURE); + } + if (StringUtils.isBlank(topicInfo.getData().getGridId())){ + throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_NULL); + } + }*/ IssueShareLinkRecordEntity entity = new IssueShareLinkRecordEntity(); entity.setCustomerId(issueInfo.getCustomerId()); - if (StringUtils.isBlank(topicInfo.getData().getGridId())){ - throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_NULL); - } - entity.setGridId(topicInfo.getData().getGridId()); + // entity.setGridId(topicInfo.getData().getGridId());//注释原因同上 + entity.setGridId(issueEntity.getGridId()); entity.setIssueId(formDTO.getIssueId()); entity.setShareUserId(tokenDto.getUserId()); entity.setInviteContent(null); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java index 20e2d01e6e..1b303c85e9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; @@ -96,7 +97,7 @@ public class IssueSuggestionServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); if (!textSyncScanResult.success()) { - log.warn("居民端用户对议题发表建议,内容审核服务返回失败"); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); } else { if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); } } //赋值网格id IssueDTO issueDTO = issueService.get(dto.getIssueId()); if (null == issueDTO) { - throw new RenException(String.format("根据议题id%s,没有找到议题信息", dto.getIssueId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("根据议题id%s,没有找到议题信息", dto.getIssueId()),"议题不存在"); } dto.setGridId(issueDTO.getGridId()); dto.setCustomerId(issueDTO.getCustomerId()); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java index 1d24217321..c1b7a5c69e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -244,4 +246,13 @@ public class IssueTagsServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueTagsEntity::getIssueId, issueId) + .set(IssueTagsEntity::getUpdatedTime, delTime) + .set(IssueTagsEntity::getUpdatedBy, userId) + .set(IssueTagsEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java index 10b4673ce9..e0c4f58193 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -40,10 +41,13 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.CheckTopicPublisherResultDTO; import com.epmet.dto.result.JoinVoteResultDTO; import com.epmet.entity.IssueVoteDetailEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.redis.IssueVoteDetailRedis; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteDetailService; +import com.epmet.utils.ModuleConstants; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -73,6 +77,8 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -140,7 +146,7 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl integerResult = resiGroupFeignClient.votableCount(dto); - if (!integerResult.success()){ - throw new EpmetException("查询应表决人数失败..."); + /** + * 直接创建议题的,应表决数为网格下的注册居民数 + */ + if (formDTO.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ + Result integerResult = resiGroupFeignClient.votableCount(dto); + if (!integerResult.success()){ + throw new EpmetException("查询应表决人数失败..."); + } + redisData.setShouldVoteCount(integerResult.getData()); + }else { + Result allResi = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(issueDTO.getGridId())); + if (!allResi.success()){ + throw new EpmetException("查询网格下的注册居民失败:"+issueDTO.getGridId()); + } + redisData.setShouldVoteCount(allResi.getData()); } - redisData.setShouldVoteCount(integerResult.getData()); issueVoteDetailRedis.set(redisData); Integer checkoutVoteCount = baseDao.checkoutVote(formDTO); if (checkoutVoteCount==0){ @@ -196,10 +209,21 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IssueVoteDetailEntity::getIssueId,checkVoteFormDTO.getIssueId()) + .eq(IssueVoteDetailEntity::getCreatedBy,checkVoteFormDTO.getUserId()) + .orderByDesc(IssueVoteDetailEntity::getCreatedTime); + List list=baseDao.selectList(queryWrapper); + if(CollectionUtils.isNotEmpty(list)){ resultDTO.setJoinVote(true); - resultDTO.setAttitude(issueVoteDetailDTO.getAttitude()); + resultDTO.setAttitude(list.get(0).getAttitude()); return resultDTO; } if (issuePublisher > NumConstant.ZERO || publisherResult.getCheckTopicPublisher() > NumConstant.ZERO){ @@ -239,12 +263,21 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl votableCount = resiGroupFeignClient.votableCount(gridId); - if(votableCount.success() && null != votableCount.getData()){ - voteCache.setShouldVoteCount(votableCount.getData()); - }else{ - voteCache.setShouldVoteCount(NumConstant.ZERO); + if (StringUtils.isBlank(formDTO.getSourceType())){ + Result votableCount = resiGroupFeignClient.votableCount(gridId); + if(votableCount.success() && null != votableCount.getData()){ + voteCache.setShouldVoteCount(votableCount.getData()); + }else{ + voteCache.setShouldVoteCount(NumConstant.ZERO); + } + }else { + Result allResi = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(formDTO.getGridId())); + if (!allResi.success()){ + throw new EpmetException("查询网格下的注册居民失败:"+formDTO.getGridId()); + } + voteCache.setShouldVoteCount(allResi.getData()); } + return voteCache; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index b28378b26c..1b33806f47 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -23,6 +23,7 @@ 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.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -42,6 +43,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.redis.IssueVoteDetailRedis; @@ -98,6 +100,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl page(Map params) { @@ -259,6 +263,50 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl allResiByGrid = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(issueEntity.getGridId())); + if (!allResiByGrid.success()){ + throw new EpmetException("查询网格下注册居民失败:"+issueEntity.getGridId()); + } + voteRedisFormDTO.setShouldVoteCount(allResiByGrid.getData()); + } + VotingTrendResultDTO votingTrendResultDTO = new VotingTrendResultDTO(); + BeanUtils.copyProperties(voteRedisFormDTO, votingTrendResultDTO); + votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount()); + //DB获取表决 日统计详情 + List polyLineDTOS = issueVoteStatisticalDao.polyLineData(issueId); + String startDate = DateUtils.format(issueEntity.getDecidedTime(),DATE_PATTERN); + String endDate = null == issueEntity.getVotingDeadline() ? + DateUtils.format(new Date(),DATE_PATTERN) : + DateUtils.format(issueEntity.getVotingDeadline(),DATE_PATTERN); + List polyLine = getPolyLine(startDate, endDate); + String today = LocalDate.now().toString(); + if (today.equals(endDate)){ + PolyLineDTO polyLineDTO = issueVoteDetailDao.polyLineData(issueId.getIssueId(), endDate); + polyLine.get(polyLine.size() - NumConstant.ONE).setSupportIncrement(polyLineDTO.getSupportIncrement()); + polyLine.get(polyLine.size() - NumConstant.ONE).setOppositionIncrement(polyLineDTO.getOppositionIncrement()); + } + if (CollectionUtils.isEmpty(polyLineDTOS)){ + votingTrendResultDTO.setPolyLine(polyLine); + return votingTrendResultDTO; + } + polyLineDTOS.forEach(pd -> { + polyLine.forEach(p -> { + if (pd.getVoteDate().equals(p.getVoteDate())){ + p.setOppositionIncrement(pd.getOppositionIncrement()); + p.setSupportIncrement(pd.getSupportIncrement()); + } + }); + }); + votingTrendResultDTO.setPolyLine(polyLine); + return votingTrendResultDTO; + } + public List getPolyLine(String startTime, String endTime){ List result = new ArrayList<>(); Date start = DateUtils.parse(startTime, DATE_PATTERN); @@ -561,36 +609,50 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount = - resiGroupFeignClient.votableCount(gridParam); - if(votableCount.success() && null != votableCount.getData()){ + toUpd.setIssueId(issueEntity.getId()); + if ("resi_topic".equals(issueEntity.getSourceType())) { + CommonGridIdFormDTO gridParam = new CommonGridIdFormDTO(); + gridParam.setGridId(issueEntity.getGridId()); + Result votableCount = + resiGroupFeignClient.votableCount(gridParam); + if (votableCount.success() && null != votableCount.getData()) { toUpd.setVotableCount(votableCount.getData()); - } + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } else { + AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO(); + allResiByGridFormDTO.setGridId(issueEntity.getGridId()); + Result allResiByGrid=epmetUserOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO); + if(allResiByGrid.success()){ + toUpd.setVotableCount(allResiByGrid.getData()); + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } if(StringUtils.isNotBlank(statisticalId)){ toUpd.setId(statisticalId); update(toUpd); }else{ - IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId); + IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueEntity.getId()); if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){ toUpd.setId(existedStatistical.getId()); update(toUpd); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java index b6a7f4cd49..f19e282f64 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java @@ -178,4 +178,10 @@ public interface ModuleConstants { * 是否禁用 disable:禁用 */ String IS_DISABLE = "disable"; + + String UNDER_AUDITING = "under_auditing"; + + String ISSUE_APPLICATION = "issue_application"; + + String ISSUE = "issue"; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql new file mode 100644 index 0000000000..5015a8351b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql @@ -0,0 +1,36 @@ +ALTER TABLE issue MODIFY COLUMN SOURCE_ID varchar(32) NULL COMMENT '来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID),issue时为空' AFTER SOURCE_TYPE; +ALTER TABLE issue MODIFY COLUMN SOURCE_TYPE varchar(32) NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;' AFTER ISSUE_STATUS; + +ALTER TABLE issue_application MODIFY COLUMN GROUP_ID varchar(64) NULL COMMENT '小组id' AFTER TOPIC_ID; +ALTER TABLE issue_application MODIFY COLUMN TOPIC_ID varchar(32) NULL COMMENT '话题id' AFTER APPLY_STATUS; + + +alter table issue add column ADDRESS VARCHAR(255) DEFAULT '' COMMENT '地址' AFTER `SUGGESTION`; +alter table issue add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度' AFTER ADDRESS; +alter table issue add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度' AFTER LONGITUDE; + +alter table issue_application add column ADDRESS VARCHAR(255) DEFAULT '' COMMENT '地址' AFTER `SUGGESTION`; +alter table issue_application add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度' AFTER ADDRESS; +alter table issue_application add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度' AFTER LONGITUDE; + +CREATE TABLE `issue_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `BUSINESS_ID` varchar(64) NOT NULL COMMENT '业务id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '议题:issue', + `NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='issue库附件表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql new file mode 100644 index 0000000000..256b0ab6b6 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql @@ -0,0 +1,2 @@ +alter table issue_application add COLUMN ORG_ID VARCHAR(64) DEFAULT'' COMMENT '组织ID' AFTER GRID_ID; +alter table issue_application add COLUMN ORG_ID_PATH VARCHAR(1024) DEFAULT'' COMMENT '组织ID全路径,包括ORG_ID' AFTER ORG_ID; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql new file mode 100644 index 0000000000..ac49a686de --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql @@ -0,0 +1 @@ +alter table issue MODIFY COLUMN `SOURCE_TYPE` varchar(32) DEFAULT NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event'; diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index 2820a43019..64541d95c6 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml @@ -2,6 +2,28 @@ + + UPDATE issue_application + + + + when ID = #{i.id} then #{i.orgId} + + + + + when ID = #{i.id} then #{i.orgIdPath} + + + updated_time = now() + where 1=1 + + + ID = #{i.id} + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml new file mode 100644 index 0000000000..02e8513b09 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml index 078661e2a1..4a8deef951 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml @@ -16,7 +16,12 @@ a.sort AS "sort", CONCAT(b.category_name, '-', a.category_name) AS "category_name" FROM issue_project_category_dict a - INNER JOIN issue_project_category_dict b ON a.pid = b.id + INNER JOIN issue_project_category_dict b + ON (a.pid = b.id + and a.CUSTOMER_ID = #{customerId} + and b.CUSTOMER_ID = #{customerId} + and a.CUSTOMER_ID=b.CUSTOMER_ID + ) ) ip ON ic.category_id = ip.idd AND ic.customer_id = ip.customer_id WHERE diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 4dbcbb2e9a..77e9db60da 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -28,21 +28,46 @@ + + + + + + + + + + + + + + + - SELECT - source_id AS topicId, - issue_title AS issueTitle, - issue_status AS issueStatus, - suggestion AS issueSuggestion, - grid_id AS gridId, - created_by AS userId, - CREATED_TIME as shiftIssueTime + i.id as issueId, + ( + case when i.SOURCE_TYPE='resi_topic'then i.source_id + else '' + end + )as topicId, + i.source_id, + i.issue_title AS issueTitle, + i.issue_status AS issueStatus, + i.suggestion AS issueSuggestion, + i.grid_id AS gridId, + i.created_by AS userId, + i.CREATED_TIME as shiftIssueTime, + i.SOURCE_TYPE, + ia.URL FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - id = #{issueId} - AND del_flag = 0 + i.id = #{issueId} + AND i.del_flag = 0 + - + i.created_time DESC + + + + + + + + + + + + + - SELECT - ID AS issueId, - IFNULL(ISSUE_TITLE,'') AS issueTitle, - IFNULL(CLOSE_REASON,'') AS solution, - UNIX_TIMESTAMP( created_time ) AS issueClosedTime, - SOURCE_ID AS sourceId + i.ID AS issueId, + IFNULL(i.ISSUE_TITLE,'') AS issueTitle, + IFNULL(i.CLOSE_REASON,'') AS solution, + UNIX_TIMESTAMP( i.created_time ) AS issueClosedTime, + i.SOURCE_ID AS sourceId, + i.SOURCE_TYPE, + ia.URL FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - DEL_FLAG = '0' - AND GRID_ID = #{gridId} - AND ISSUE_STATUS = 'closed' - AND RESOLVE_TYPE = 'resolved' + i.DEL_FLAG = '0' + AND i.GRID_ID = #{gridId} + AND i.ISSUE_STATUS = 'closed' + AND i.RESOLVE_TYPE = 'resolved' ORDER BY - created_time DESC + i.created_time DESC - SELECT - ID AS issueId, - IFNULL(ISSUE_TITLE,'') AS issueTitle, - IFNULL(CLOSE_REASON,'') AS solution, - UNIX_TIMESTAMP( CLOSED_TIME ) AS closedTime, - SOURCE_ID AS sourceId + i.ID AS issueId, + IFNULL(i.ISSUE_TITLE,'') AS issueTitle, + IFNULL(i.CLOSE_REASON,'') AS solution, + UNIX_TIMESTAMP( i.CLOSED_TIME ) AS closedTime, + i.SOURCE_ID AS sourceId, + i.SOURCE_TYPE as issueSourceType, + i.LONGITUDE, + i.LATITUDE, + i.SOURCE_ID as topicId, + ia.url FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - DEL_FLAG = '0' - AND GRID_ID = #{gridId} - AND ISSUE_STATUS = 'closed' - AND RESOLVE_TYPE = 'unresolved' + i.DEL_FLAG = '0' + AND i.GRID_ID = #{gridId} + AND i.ISSUE_STATUS = 'closed' + AND i.RESOLVE_TYPE = 'unresolved' @@ -770,4 +851,79 @@ AND APPLY_STATUS = 'under_auditing' AND GRID_ID = #{gridId} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml index 00122cfade..60af2d5d12 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml @@ -102,13 +102,14 @@ SELECT - '转议题' AS processName, + '发起议题' AS processName, UNIX_TIMESTAMP( created_time ) AS processTime, operation_explain AS progressDesc, org_name AS departmentName, + 'issue' AS type, id AS processId FROM issue_process diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml index fa89630a63..8026d7b5ed 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml @@ -39,6 +39,7 @@ del_flag = 0 AND issue_id = #{issueId} AND created_by = #{userId} + order by CREATED_TIME desc limit 1 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java index 261b951496..9a8a2a145d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java @@ -63,4 +63,9 @@ public interface NeighborhoodConstant { */ String FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY = "focusGroupSpecialAttentionHistory"; + /** + * 员工疫情管理详情 + */ + String EMPLOYEE_EPIDEMIC_MANAGE_DETAIL = "employeeEpidemicManageDetail"; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDTO.java new file mode 100644 index 0000000000..365cf14365 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + + +/** + * 员工登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Data +public class IcEmployeeRegisterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + @NotBlank(message = "customerId不能为空",groups = {AddGroup.class}) + private String customerId; + + /** + * 场所id + */ + @NotBlank(message = "enterpriseId不能为空",groups = {AddGroup.class}) + private String enterpriseId; + + /** + * 姓名 + */ + @NotBlank(message = "name不能为空",groups = {AddGroup.class}) + private String name; + + /** + * 手机号 + */ + @NotBlank(message = "mobile不能为空",groups = {AddGroup.class}) + private String mobile; + + /** + * 身份证号或护照号 + */ + @NotBlank(message = "idCard不能为空",groups = {AddGroup.class}) + private String idCard; + + @NotNull(message = "ymjzCount不能为空",groups = {AddGroup.class}) + private Integer ymjzCount; + + @NotNull(message = "latestNatTime不能为空",groups = {AddGroup.class}) + @JsonFormat(pattern="yyyy-MM-dd") + private Date latestNatTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDetailDTO.java new file mode 100644 index 0000000000..40d12c1fd4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEmployeeRegisterDetailDTO.java @@ -0,0 +1,74 @@ +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-10-26 + */ +@Data +public class IcEmployeeRegisterDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_employee_register.ID + */ + private String registerId; + + /** + * 疫苗接种次数:0,1,2,3 + */ + private Integer ymjzCount; + + /** + * 最近一次核酸检测时间:yyyy-MM-dd 日期 + */ + private Date latestNatTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEnterpriseChangeRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEnterpriseChangeRecordDTO.java new file mode 100644 index 0000000000..b965382a6f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcEnterpriseChangeRecordDTO.java @@ -0,0 +1,144 @@ +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-16 + */ +@Data +public class IcEnterpriseChangeRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 网格所属的组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String agencyPids; + + /** + * 场所类型:来源于ic_coverage_category_dict + */ + private String placeType; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 最新巡查结果【0:合格 1:不合格】 + */ + private String latestResult; + + /** + * 最新检查时间 + */ + private Date latestPatrolTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 原始记录id + */ + private String originId; + + /** + * 操作类型,upd,del + */ + private String type; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcGroupPeopleRegisterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcGroupPeopleRegisterDTO.java new file mode 100644 index 0000000000..f3342f1177 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcGroupPeopleRegisterDTO.java @@ -0,0 +1,91 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + + +/** + * 受众群体登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Data +public class IcGroupPeopleRegisterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + @NotBlank(message = "customerId不能为空",groups = {AddGroup.class}) + private String customerId; + + /** + * 场所id + */ + @NotBlank(message = "enterpriseId不能为空",groups = {AddGroup.class}) + private String enterpriseId; + + /** + * 核酸检测时间:yyyy-MM-dd 日期 + */ + @NotNull(message = "natTime不能为空",groups = {AddGroup.class}) + @JsonFormat(pattern="yyyy-MM-dd") + private Date natTime; + + /** + * 受众人数 + */ + @NotNull(message = "szTotal不能为空",groups = {AddGroup.class}) + private Integer szTotal; + + /** + * 核酸检测人数 + */ + @NotNull(message = "customerId不能为空",groups = {AddGroup.class}) + private Integer hsjcTotal; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java index 47e3105b3d..e1b2602373 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java @@ -60,7 +60,7 @@ public class StaffOrgRelationDTO implements Serializable { private String orgId; /** - * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + * 工作人员的添加入口类型(组织:agency;部门:dept;网格:grid) */ private String orgType; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java index 705ddfaadb..7bc3b93076 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java @@ -73,4 +73,9 @@ public class AddStaffV2FromDTO implements Serializable { private String client; private List newRoles; + + /** + * 烟台用:当前登录用户 + */ + private String currentUserId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java index 45fc98f517..8a2d6c0444 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java @@ -17,6 +17,19 @@ public class DetailByTypeFormDTO implements Serializable { public interface DetailByTypeForm{} + /** + * 房屋:checkHouse + * 居民:checkIcResiUser + * 居民防疫信息:JMFYXX + * 行程随访:routeFollow + * 疫苗接种记录:vaccinationRecord + * 疫苗接种关注名单:vaccineSpecialAttention + * 未做核酸比对:noNatCompare + * 核酸检测记录:natRecord + * 重点人群关注名单【防疫隔离】:focusGroupSpecialAttentionQuarantine + * 重点人群关注名单【历史记录】:focusGroupSpecialAttentionHistory + * 员工疫情管理详情:employeeEpidemicManageDetail + */ @NotBlank(message = "type不能为空",groups = DetailByTypeForm.class) private String type; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EmployeeRegisterListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EmployeeRegisterListFormDTO.java new file mode 100644 index 0000000000..7a2fb690e2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EmployeeRegisterListFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/10/27 09:01 + */ +@Data +public class EmployeeRegisterListFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = -5327830228503748858L; + + private String customerId; + private String staffId; + private String agencyId; + + /** + * 核酸检测开始、结束日期,eg:2022-02-02 + */ + private String natStartDate; + private String natEndDate; + + /** + * 检查状态,1:已检测;0:未检测 + */ + private String checkStatus; + + private String placeOrgName; + + /** + * 场所类别:0九小场所、1企事业单位 + */ + private String placeCategory; + + private String name; + private String mobile; + private String idCard; + + public interface RegisterDetailList{} + + /** + * 人员详情列表使用 + */ + @NotBlank(message = "registerId不能为空",groups = RegisterDetailList.class) + private String registerId; + + private List registerIds; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterpriseFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterpriseFormDTO.java index 61f8470c60..eebdaa319d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterpriseFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterpriseFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -44,6 +45,14 @@ public class EnterpriseFormDTO implements Serializable { @NotBlank(message = "场所类型不能为空", groups = {AddShow.class}) private String placeType; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + @NotBlank(message = "场所类别不能为空", groups = {AddShow.class}) + private String placeCategory; + /** * 场所名称 */ @@ -77,9 +86,12 @@ public class EnterpriseFormDTO implements Serializable { 3:41-100人 4:100人以上】 */ - @NotBlank(message = "规模不能为空", groups = {AddShow.class}) + // @NotBlank(message = "规模不能为空", groups = {AddShow.class}) private String scale; + @NotNull(message = "规模不能为空",groups ={AddShow.class} ) + private Integer scaleTotal; + /** * 场所负责人 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java index 3c6c45d445..15bf7a402a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EnterprisePageFormDTO.java @@ -18,7 +18,7 @@ public class EnterprisePageFormDTO implements Serializable { * 场所类型 */ private String placeType; - + private String placeCategory; /** * 场所名称 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java index 95c371ad83..64dd258641 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -14,6 +16,12 @@ public class GetAgencyListFormDTO implements Serializable { private static final long serialVersionUID = -5846836779036328298L; + /** + * 这个接口在运营端统一认证,新增用户事也调用了 + */ + public interface OperAddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "运营端调用此接口必须传客户id",groups =OperAddUserShowGroup.class ) private String customerId; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupPeopleRegisterListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupPeopleRegisterListFormDTO.java new file mode 100644 index 0000000000..d9c82abb2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GroupPeopleRegisterListFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/27 10:47 + */ +@Data +public class GroupPeopleRegisterListFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 6837328932168590069L; + + private String customerId; + private String staffId; + private String agencyId; + + /** + * 核酸检测开始、结束日期,eg:2022-02-02 + */ + private String natStartDate; + private String natEndDate; + + private String placeOrgName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java index 4c32424b09..e2022b1420 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java @@ -16,6 +16,28 @@ public class IcHouseListFormDTO extends PageFormDTO { private static final long serialVersionUID = -1L; + /** + * 10.24需求http://zentao.elinkservice.cn/story-view-710.html + * 小区id + */ + private String neighborHoodId; + /** + * 10.24需求http://zentao.elinkservice.cn/story-view-710.html + * 新增楼栋id + */ + private String buildingId; + /** + * 10.24需求http://zentao.elinkservice.cn/story-view-710.html + * 新增单元id + */ + private String buildingUnitId; + /** + * 10.24需求http://zentao.elinkservice.cn/story-view-710.html + * 新增:房号 + */ + private String houseId; + + /** * 组织类别 */ @@ -51,14 +73,6 @@ public class IcHouseListFormDTO extends PageFormDTO { * 房屋状态 【1:出租 0:自住 2:闲置 3:未出售】 */ private String rentFlag; - /** - * 楼栋ID - */ - private String buildingId; - /** - * 小区ID - */ - private String neighborHoodId; /** * 搜索关键词,社区查询,搜索输入的关键词 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodOptionFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodOptionFormDTO.java new file mode 100644 index 0000000000..dbb6177931 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodOptionFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/10/25 15:44 + */ +@Data +public class NeighborHoodOptionFormDTO extends PageFormDTO { + private String agencyId; + private String gridId; + private String neighborHoodName; + + /** + * 当前登录用户:: + */ + private String staffId; + private String customerId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java index 133f0df8a4..9bcd6dcb8c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,6 +15,7 @@ import java.io.Serializable; @Data public class StaffInfoFromDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface EditStaffInitGroup extends CustomerClientShowGroup {} /** * 客户ID */ @@ -26,5 +28,6 @@ public class StaffInfoFromDTO implements Serializable { /** * 用户ID */ - String staffId; + @NotBlank(message = "staffId不能为空",groups = EditStaffInitGroup.class) + private String staffId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EmployeeRegisterListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EmployeeRegisterListResultDTO.java new file mode 100644 index 0000000000..98ddd2ab8c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EmployeeRegisterListResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/27 09:10 + */ +@Data +public class EmployeeRegisterListResultDTO implements Serializable { + private static final long serialVersionUID = -7966608283208846072L; + + private String placeOrgName; + private String name; + private String mobile; + private String idCard; + private Integer ymjzCount; + private String latestNatTime; + private String registerId; + + private String agencyId; + + public EmployeeRegisterListResultDTO() { + this.placeOrgName = ""; + this.name = ""; + this.mobile = ""; + this.idCard = ""; + this.ymjzCount = NumConstant.ZERO; + this.latestNatTime = ""; + this.registerId = ""; + this.agencyId = ""; + } +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EnterpriseDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EnterpriseDetailDTO.java index 2d787ab00f..001066cade 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EnterpriseDetailDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EnterpriseDetailDTO.java @@ -37,7 +37,19 @@ public class EnterpriseDetailDTO implements Serializable { * 场所类型:来源于ic_coverage_category_dict */ private String placeType; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + private String placeCategory; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + private String placeCategoryName; /** * 场所类型名称 */ @@ -73,6 +85,7 @@ public class EnterpriseDetailDTO implements Serializable { */ private String scale; + private Integer scaleTotal; /** * 规模名称 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupPeopleRegisterListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupPeopleRegisterListResultDTO.java new file mode 100644 index 0000000000..3fcb98125a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupPeopleRegisterListResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/27 10:53 + */ +@Data +public class GroupPeopleRegisterListResultDTO implements Serializable { + private static final long serialVersionUID = -3000826126115218664L; + + private String placeOrgName; + private String natTime; + private String szTotal; + private String hsjcTotal; + private String id; + private String agencyId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 36cc283268..87b641b564 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -13,6 +13,7 @@ import java.util.List; @Data public class StaffInitResultDTO implements Serializable { private static final long serialVersionUID = 1L; + private String customerId; /** * 人员ID */ @@ -46,4 +47,12 @@ public class StaffInitResultDTO implements Serializable { */ private List roleList; private List newRoleList; + /** + * customer_staff_agency.agency_id + */ + private String agencyId; + /** + * xxx-xxx + */ + private String agencyName; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index d738d662f8..aede67b81e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -89,4 +89,7 @@ public interface CustomerAgencyConstant { String AREA_CODE_SWITCH_CLOSED="closed"; String AREA_CODE_SWITCH_OPEN="open"; + + String JUMP_URL = "http://192.168.1.140/epmet-oper-gov/#/staffRegister?"; +// String JUMP_URL = "https://epmet-open.elinkservice.cn/epmet-oper-gov/#/staffRegister?"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index c1aba9bb3c..6a8c433250 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -348,8 +349,12 @@ public class CustomerAgencyController { */ @PostMapping("agencylist") public Result getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) { - if (StringUtils.isBlank(formDTO.getCustomerId())){ - formDTO.setCustomerId(tokenDTO.getCustomerId()); + if(AppClientConstant.APP_OPER.equals(tokenDTO.getApp())){ + ValidatorUtils.validateEntity(formDTO.getCustomerId(),GetAgencyListFormDTO.OperAddUserShowGroup.class); + }else{ + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(tokenDTO.getCustomerId()); + } } return new Result().ok(customerAgencyService.getAgencyList(formDTO)); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterController.java new file mode 100644 index 0000000000..07c748ce67 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterController.java @@ -0,0 +1,117 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcEmployeeRegisterDTO; +import com.epmet.dto.form.EmployeeRegisterListFormDTO; +import com.epmet.dto.result.EmployeeRegisterListResultDTO; +import com.epmet.service.IcEmployeeRegisterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 员工登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@RestController +@RequestMapping("icEmployeeRegister") +public class IcEmployeeRegisterController { + + @Autowired + private IcEmployeeRegisterService icEmployeeRegisterService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icEmployeeRegisterService.page(params); + return new Result>().ok(page); + } + + @PostMapping(value = "{id}") + public Result get(@PathVariable("id") String id){ + IcEmployeeRegisterDTO data = icEmployeeRegisterService.get(id); + return new Result().ok(data); + } + + /** + * @Description 新增 员工登记:http://yapi.elinkservice.cn/project/102/interface/api/8214 + * @param dto + * @Author zxc + * @Date 2022/10/27 08:57 + */ + @NoRepeatSubmit + @PostMapping("add") + public Result save(@RequestBody IcEmployeeRegisterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icEmployeeRegisterService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcEmployeeRegisterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icEmployeeRegisterService.update(dto); + return new Result(); + } + + /** + * @Description 批量删除 http://yapi.elinkservice.cn/project/102/interface/api/8238 + * @param ids + * @Author zxc + * @Date 2022/10/27 08:57 + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto,@RequestBody List ids){ + icEmployeeRegisterService.delete(ids,tokenDto.getUserId()); + return new Result(); + } + + /** + * @Description 员工疫情管理列表 + * @param formDTO + * @param tokenDto + * @Author zxc + * @Date 2022/10/27 09:15 + */ + @PostMapping("list") + @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) + public Result> employeeRegisterList(@RequestBody EmployeeRegisterListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icEmployeeRegisterService.employeeRegisterList(formDTO)); + } + + /** + * @Description 员工疫情管理详情列表 + * @param formDTO + * @param tokenDto + * @Author zxc + * @Date 2022/10/27 09:22 + */ + @PostMapping("detailList") + @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) + public Result> employeeRegisterDetailList(@RequestBody EmployeeRegisterListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, EmployeeRegisterListFormDTO.RegisterDetailList.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icEmployeeRegisterService.employeeRegisterDetailList(formDTO)); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterDetailController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterDetailController.java new file mode 100644 index 0000000000..6b23562985 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEmployeeRegisterDetailController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +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.IcEmployeeRegisterDetailDTO; +import com.epmet.service.IcEmployeeRegisterDetailService; +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-10-26 + */ +@RestController +@RequestMapping("icEmployeeRegisterDetail") +public class IcEmployeeRegisterDetailController { + + @Autowired + private IcEmployeeRegisterDetailService icEmployeeRegisterDetailService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icEmployeeRegisterDetailService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcEmployeeRegisterDetailDTO data = icEmployeeRegisterDetailService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcEmployeeRegisterDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icEmployeeRegisterDetailService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcEmployeeRegisterDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icEmployeeRegisterDetailService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icEmployeeRegisterDetailService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseChangeRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseChangeRecordController.java new file mode 100644 index 0000000000..6865c9dbe3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseChangeRecordController.java @@ -0,0 +1,46 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; +import com.epmet.service.IcEnterpriseChangeRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + + +/** + * 企事业单位变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-16 + */ +@RestController +@RequestMapping("icEnterpriseChangeRecord") +public class IcEnterpriseChangeRecordController { + + @Autowired + private IcEnterpriseChangeRecordService icEnterpriseChangeRecordService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = icEnterpriseChangeRecordService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { + IcEnterpriseChangeRecordDTO data = icEnterpriseChangeRecordService.get(id); + return new Result().ok(data); + } + + @RequestMapping("history/{originId}") + public Result> page(@PathVariable("originId") String originId, @RequestParam Map params) { + params.put("originId", originId); + PageData page = icEnterpriseChangeRecordService.page(params); + return new Result>().ok(page); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java index dba64a0964..7d9afd1a83 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; @@ -100,6 +101,33 @@ public class IcEnterpriseController implements ResultDataResolver { return new Result>().ok(icEnterpriseService.list(formDTO)); } + /** + * 操作日志基础表 + * + * @param params + * @return com.epmet.commons.tools.utils.Result> + * @author zhy + * @date 2022/8/16 16:52 + */ + @RequestMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestParam Map params){ + EnterprisePageFormDTO formDTO = new EnterprisePageFormDTO(); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + formDTO.setPageFlag(true); + formDTO.setPageNo(Integer.parseInt(params.get("page"))); + formDTO.setPageSize(Integer.parseInt(params.get("limit"))); + formDTO.setPlaceOrgName(params.get("placeOrgName")); + formDTO.setMobile(params.get("mobile")); + formDTO.setGridId(params.get("gridId")); + formDTO.setPlaceType(params.get("placeType")); + formDTO.setScale(params.get("scale")); + formDTO.setResult(params.get("result")); + + PageData page = icEnterpriseService.list(formDTO); + return new Result>().ok(page); + } + /** * 企事业单位列表导出 * @param tokenDto @@ -315,4 +343,20 @@ public class IcEnterpriseController implements ResultDataResolver { icEnterpriseService.sendEnterprisePatrolRemindMessage(); return new Result(); } + + /** + * @Description 登记码导出 + * @param formDTO + * @param tokenDto + * @Author zxc + * @Date 2022/10/26 15:55 + */ + @PostMapping("qrCodeExport") + public void qrCodeExport(@RequestBody EnterprisePageFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + formDTO.setPageFlag(false); + icEnterpriseService.qrCodeExport(formDTO,response); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcGroupPeopleRegisterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcGroupPeopleRegisterController.java new file mode 100644 index 0000000000..01b394c759 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcGroupPeopleRegisterController.java @@ -0,0 +1,99 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcGroupPeopleRegisterDTO; +import com.epmet.dto.form.GroupPeopleRegisterListFormDTO; +import com.epmet.dto.result.GroupPeopleRegisterListResultDTO; +import com.epmet.service.IcGroupPeopleRegisterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 受众群体登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@RestController +@RequestMapping("icGroupPeopleRegister") +public class IcGroupPeopleRegisterController { + + @Autowired + private IcGroupPeopleRegisterService icGroupPeopleRegisterService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icGroupPeopleRegisterService.page(params); + return new Result>().ok(page); + } + + @PostMapping(value = "{id}") + public Result get(@PathVariable("id") String id){ + IcGroupPeopleRegisterDTO data = icGroupPeopleRegisterService.get(id); + return new Result().ok(data); + } + + /** + * 受众群体登记 http://yapi.elinkservice.cn/project/102/interface/api/8220 + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("add") + public Result save(@RequestBody IcGroupPeopleRegisterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icGroupPeopleRegisterService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcGroupPeopleRegisterDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icGroupPeopleRegisterService.update(dto); + return new Result(); + } + + /** + * 受众群体管理删除 + * http://yapi.elinkservice.cn/project/102/interface/api/8250 + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto,@RequestBody List ids){ + icGroupPeopleRegisterService.delete(ids,tokenDto.getUserId()); + return new Result(); + } + + /** + * @Description 受众群体列表 http://yapi.elinkservice.cn/project/102/interface/api/8244 + * @param tokenDto + * @param formDTO + * @Author zxc + * @Date 2022/10/27 10:51 + */ + @PostMapping("list") + public Result> groupPeopleRegisterList(@LoginUser TokenDto tokenDto, @RequestBody GroupPeopleRegisterListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icGroupPeopleRegisterService.groupPeopleRegisterList(formDTO)); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java index f44e52c44f..a8cf04b4cb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -39,6 +39,7 @@ import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -151,6 +152,21 @@ public class IcNeighborHoodController { return new Result>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId(),tokenDto.getUserId(),tokenDto.getCustomerId())); } + /** + * 入参:gridId、agencyId + * 返回当前组织及下级下的所有小区 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("neighborhood-options") + public Result> queryNeighborHoodOptions(@LoginUser TokenDto tokenDto, @RequestBody NeighborHoodOptionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + List list=icNeighborHoodService.queryNeighborHoodOptions(formDTO); + return new Result>().ok(list); + } + /** * 获取用户组织下小区列表 * diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 939f740fc1..bcc8e2f55e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -4,13 +4,17 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.StaffService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -70,6 +74,7 @@ public class StaffController { @PostMapping("editstaffinit") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_DETAIL) public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + ValidatorUtils.validateEntity(fromDTO,StaffInfoFromDTO.EditStaffInitGroup.class); return staffService.editStaffInit(fromDTO); } @@ -96,9 +101,9 @@ public class StaffController { */ @PostMapping("editstaff") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) - public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ + public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); - return staffService.editStaff(tokenDto, fromDTO); + return staffService.editStaff(fromDTO); } /** @@ -196,15 +201,27 @@ public class StaffController { /** * 【通讯录】人员添加v2 + * 返回staffId * @author sun */ @PostMapping("addstaffv2") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE) - public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV2FromDTO fromDTO){ + public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV2FromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO, AddStaffV2FromDTO.AddStaff.class); - fromDTO.setCustomerId(tokenDto.getCustomerId()); - fromDTO.setApp(tokenDto.getApp()); - fromDTO.setClient(tokenDto.getClient()); + if(AppClientConstant.APP_OPER.equals(tokenDto.getApp())){ + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + // 该接口烟台运营端-统一认证也在用,所以客户id,运营端必传。 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"运营端操作,customerId不能为空","运营端操作,customerId不能为空"); + } + }else{ + //小程序端或者数字社区从token里面取 + fromDTO.setCustomerId(tokenDto.getCustomerId()); + } + //因为添加的是工作人员,这里写死吧! + fromDTO.setApp("gov"); + fromDTO.setClient("wxmp"); + //当前登录用户 + fromDTO.setCurrentUserId(tokenDto.getUserId()); return staffService.addStaffV2(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDao.java new file mode 100644 index 0000000000..2211398af1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDao.java @@ -0,0 +1,55 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEmployeeRegisterDTO; +import com.epmet.dto.form.EmployeeRegisterListFormDTO; +import com.epmet.dto.result.EmployeeRegisterListResultDTO; +import com.epmet.entity.IcEmployeeRegisterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 员工登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Mapper +public interface IcEmployeeRegisterDao extends BaseDao { + + /** + * @Description 根据身份证查询是否存在 + * @param idCard + * @Author zxc + * @Date 2022/10/26 17:34 + */ + IcEmployeeRegisterEntity getEmployeeRegisterByIdCard(@Param("idCard")String idCard); + + /** + * @Description 根据主表ID删除子表 + * @param registerIds + * @Author zxc + * @Date 2022/10/26 17:34 + */ + void delRegisterDetail(@Param("registerIds")List registerIds,@Param("operUserId")String operUserId); + + /** + * @Description 员工疫情管理列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 09:15 + */ + List employeeRegisterList(EmployeeRegisterListFormDTO formDTO); + List employeeRegisterListNoCheck(EmployeeRegisterListFormDTO formDTO); + + /** + * @Description 员工疫情管理详情列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 13:24 + */ + List employeeRegisterDetailList(EmployeeRegisterListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDetailDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDetailDao.java new file mode 100644 index 0000000000..a9d0408825 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEmployeeRegisterDetailDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcEmployeeRegisterDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 员工登记明细表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Mapper +public interface IcEmployeeRegisterDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseChangeRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseChangeRecordDao.java new file mode 100644 index 0000000000..548d9ccb40 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcEnterpriseChangeRecordDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; +import com.epmet.entity.IcEnterpriseChangeRecordEntity; +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-16 + */ +@Mapper +public interface IcEnterpriseChangeRecordDao extends BaseDao { + + /** + * 分页列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/8/9 17:23 + */ + List listPage(Map params); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcGroupPeopleRegisterDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcGroupPeopleRegisterDao.java new file mode 100644 index 0000000000..f8dbd340e7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcGroupPeopleRegisterDao.java @@ -0,0 +1,22 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.GroupPeopleRegisterListFormDTO; +import com.epmet.dto.result.GroupPeopleRegisterListResultDTO; +import com.epmet.entity.IcGroupPeopleRegisterEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 受众群体登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Mapper +public interface IcGroupPeopleRegisterDao extends BaseDao { + + List groupPeopleRegisterList(GroupPeopleRegisterListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index afe0374247..2fd4f25eee 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -18,12 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.NeighborHoodAndManagementDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.HouseInformationFormDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO; +import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; @@ -220,4 +222,6 @@ public interface IcNeighborHoodDao extends BaseDao { * @return */ IcNeighborHoodEntity getNeighborHoodInfoByName(CheckHouseInfoFormDTO formDTO); + + List queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterDetailEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterDetailEntity.java new file mode 100644 index 0000000000..14f90935c5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterDetailEntity.java @@ -0,0 +1,44 @@ +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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_employee_register_detail") +public class IcEmployeeRegisterDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_employee_register.ID + */ + private String registerId; + + /** + * 疫苗接种次数:0,1,2,3 + */ + private Integer ymjzCount; + + /** + * 最近一次核酸检测时间:yyyy-MM-dd 日期 + */ + private Date latestNatTime; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterEntity.java new file mode 100644 index 0000000000..dcae1e3c2d --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEmployeeRegisterEntity.java @@ -0,0 +1,49 @@ +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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_employee_register") +public class IcEmployeeRegisterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 场所id + */ + private String enterpriseId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号或护照号 + */ + private String idCard; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseChangeRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseChangeRecordEntity.java new file mode 100644 index 0000000000..119362360c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseChangeRecordEntity.java @@ -0,0 +1,114 @@ +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_enterprise_change_record") +public class IcEnterpriseChangeRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id【场所区域】 + */ + private String gridId; + + /** + * 网格所属的组织Id + */ + private String agencyId; + + /** + * agency_id的所有上级 + */ + private String agencyPids; + + /** + * 场所类型:来源于ic_coverage_category_dict + */ + private String placeType; + + /** + * 场所名称 + */ + private String placeOrgName; + + /** + * 场所地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 字典value,场所规模【 +0:10人以下 +1:10-20人 +2:21-40人 +3:41-100人 +4:100人以上】 + */ + private String scale; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 来源【新增:add 导入:import 】 + */ + private String sourceType; + + /** + * 最新巡查结果【0:合格 1:不合格】 + */ + private String latestResult; + + /** + * 最新检查时间 + */ + private Date latestPatrolTime; + + /** + * 原始记录id + */ + private String originId; + + /** + * 操作类型,upd,del + */ + private String type; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseEntity.java index d022fabf3d..931756bbac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcEnterpriseEntity.java @@ -45,6 +45,12 @@ public class IcEnterpriseEntity extends BaseEpmetEntity { */ private String placeType; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + private String placeCategory; /** * 场所名称 */ @@ -66,7 +72,8 @@ public class IcEnterpriseEntity extends BaseEpmetEntity { private String latitude; /** - * 字典value,场所规模【 + * 10.26需求:此列就不再用了 + * 字典value,场所规模【 0:10人以下 1:10-20人 2:21-40人 @@ -75,6 +82,12 @@ public class IcEnterpriseEntity extends BaseEpmetEntity { */ private String scale; + /** + * 10.26需求: + * 规模,手输数字 + */ + private Integer scaleTotal; + /** * 场所负责人 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcGroupPeopleRegisterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcGroupPeopleRegisterEntity.java new file mode 100644 index 0000000000..3f4dffc18e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcGroupPeopleRegisterEntity.java @@ -0,0 +1,49 @@ +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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_group_people_register") +public class IcGroupPeopleRegisterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 场所id + */ + private String enterpriseId; + + /** + * 核酸检测时间:yyyy-MM-dd 日期 + */ + private Date natTime; + + /** + * 受众人数 + */ + private Integer szTotal; + + /** + * 核酸检测人数 + */ + private Integer hsjcTotal; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java index 99c242b25d..04ef0c00d2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java @@ -56,7 +56,7 @@ public class StaffOrgRelationEntity extends BaseEpmetEntity { private String orgId; /** - * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + * 工作人员的添加入口类型(组织:agency;部门:dept;网格:grid) */ private String orgType; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseExportExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseExportExcelDTO.java index 213e0c294b..9188b748b7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseExportExcelDTO.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseExportExcelDTO.java @@ -22,7 +22,22 @@ public class EnterpriseExportExcelDTO { @ExcelProperty(value = "场所类型") @ColumnWidth(25) private String placeTypeName; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + @ExcelIgnore + private String placeCategory; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + @ExcelProperty(value = "场所类别") + @ColumnWidth(25) + private String placeCategoryName; /** * 网格所属的组织Id @@ -70,6 +85,7 @@ public class EnterpriseExportExcelDTO { @ExcelIgnore private String scale; + private Integer scaleTotal; /** * 规模名称 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java index 8507192422..91dfa20ed9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/EnterpriseImportExcelDTO.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** @@ -21,6 +22,16 @@ public class EnterpriseImportExcelDTO { private String placeTypeName; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + @NotBlank(message = "场所类别不能为空") + @ExcelProperty(value = "场所类别") + private String placeCategoryName; + + @NotBlank(message = "场所区域不能为空") @ExcelProperty(value = "场所区域") private String gridName; @@ -46,10 +57,11 @@ public class EnterpriseImportExcelDTO { * 2:21-40人 * 3:41-100人 * 4:100人以上】 + * 改为手输数字了 */ - @NotBlank(message = "规模不能为空") + @NotNull(message = "规模不能为空") @ExcelProperty(value = "规模") - private String scaleName; + private Integer scaleTotal; /** * 场所负责人 @@ -72,6 +84,15 @@ public class EnterpriseImportExcelDTO { @ExcelProperty(value = "场所类型") private String placeTypeName; + /** + * 10.26需求: + * 场所类别:0九小场所、1企事业单位 + * 默认0 + */ + @ColumnWidth(20) + @ExcelProperty(value = "场所类别(九小场所/企事业单位)") + private String placeCategoryName; + @ColumnWidth(20) @ExcelProperty(value = "场所区域") private String gridName; @@ -89,7 +110,7 @@ public class EnterpriseImportExcelDTO { @ColumnWidth(20) @ExcelProperty(value = "规模") - private String scaleName; + private Integer scaleTotal; @ColumnWidth(20) @ExcelProperty(value = "负责人") diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcEnterpriseChangeRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcEnterpriseChangeRecordExcel.java new file mode 100644 index 0000000000..921cb0b549 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcEnterpriseChangeRecordExcel.java @@ -0,0 +1,84 @@ +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-16 + */ +@Data +public class IcEnterpriseChangeRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "网格Id【场所区域】") + private String gridId; + + @Excel(name = "网格所属的组织Id") + private String agencyId; + + @Excel(name = "agency_id的所有上级") + private String agencyPids; + + @Excel(name = "场所类型:来源于ic_coverage_category_dict") + private String placeType; + + @Excel(name = "场所名称") + private String placeOrgName; + + @Excel(name = "场所地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "字典value,场所规模") + private String scale; + + @Excel(name = "场所负责人") + private String personInCharge; + + @Excel(name = "负责人电话") + private String mobile; + + @Excel(name = "来源【新增:add 导入:import 】") + private String sourceType; + + @Excel(name = "最新巡查结果【0:合格 1:不合格】") + private String latestResult; + + @Excel(name = "最新检查时间") + private Date latestPatrolTime; + + @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; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java index ac55be4e46..5495dd6ff6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java @@ -54,6 +54,12 @@ public class IcEnterpriseExcelImportListener implements ReadListener originList=icEnterpriseServiceImpl.selectForUniqueName(enterpriseEntity.getGridId(),enterpriseEntity.getPlaceOrgName(),null); @@ -117,10 +124,11 @@ public class IcEnterpriseExcelImportListener implements ReadListener { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEmployeeRegisterDetailDTO + * @author generator + * @date 2022-10-26 + */ + IcEmployeeRegisterDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void save(IcEmployeeRegisterDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void update(IcEmployeeRegisterDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-10-26 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEmployeeRegisterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEmployeeRegisterService.java new file mode 100644 index 0000000000..ebaa0a4d8b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEmployeeRegisterService.java @@ -0,0 +1,95 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEmployeeRegisterDTO; +import com.epmet.dto.form.EmployeeRegisterListFormDTO; +import com.epmet.dto.result.EmployeeRegisterListResultDTO; +import com.epmet.entity.IcEmployeeRegisterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 员工登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +public interface IcEmployeeRegisterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEmployeeRegisterDTO + * @author generator + * @date 2022-10-26 + */ + IcEmployeeRegisterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void save(IcEmployeeRegisterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void update(IcEmployeeRegisterDTO dto); + + /** + * 批量删除 + * @param ids + * @return void + * @author generator + * @date 2022-10-26 + */ + void delete(List ids,String operUserId); + + /** + * @Description 员工疫情管理列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 09:15 + */ + PageData employeeRegisterList(EmployeeRegisterListFormDTO formDTO); + + /** + * @Description 员工疫情管理详情列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 09:22 + */ + PageData employeeRegisterDetailList(EmployeeRegisterListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseChangeRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseChangeRecordService.java new file mode 100644 index 0000000000..de47def1b9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseChangeRecordService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; +import com.epmet.entity.IcEnterpriseChangeRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 企事业单位变更记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-16 + */ +public interface IcEnterpriseChangeRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-08-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-08-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcEnterpriseChangeRecordDTO + * @author generator + * @date 2022-08-16 + */ + IcEnterpriseChangeRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-08-16 + */ + void save(IcEnterpriseChangeRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-08-16 + */ + void update(IcEnterpriseChangeRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-08-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java index 3f06567ca8..e141e008e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; @@ -9,7 +10,12 @@ import com.epmet.dto.result.EnterpriseDetailDTO; import com.epmet.dto.result.EnterprisePatrolResultDTO; import com.epmet.entity.IcEnterpriseEntity; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.nio.file.Path; +import java.util.List; +import java.util.Map; /** * 企事业单位表 @@ -78,4 +84,23 @@ public interface IcEnterpriseService extends BaseService { * @Date 2022/9/6 17:30 */ void sendEnterprisePatrolRemindMessage(); + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-08-16 + */ + PageData page(Map params); + + /** + * @Description 登记码导出 + * @param formDTO + * @Author zxc + * @Date 2022/10/26 15:55 + */ + void qrCodeExport(EnterprisePageFormDTO formDTO, HttpServletResponse response) throws IOException; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcGroupPeopleRegisterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcGroupPeopleRegisterService.java new file mode 100644 index 0000000000..9dcad3b267 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcGroupPeopleRegisterService.java @@ -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.IcGroupPeopleRegisterDTO; +import com.epmet.dto.form.GroupPeopleRegisterListFormDTO; +import com.epmet.dto.result.GroupPeopleRegisterListResultDTO; +import com.epmet.entity.IcGroupPeopleRegisterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 受众群体登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +public interface IcGroupPeopleRegisterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcGroupPeopleRegisterDTO + * @author generator + * @date 2022-10-26 + */ + IcGroupPeopleRegisterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void save(IcGroupPeopleRegisterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-26 + */ + void update(IcGroupPeopleRegisterDTO dto); + + /** + * 批量删除 + * @param ids + * @return void + * @author generator + * @date 2022-10-26 + */ + void delete(List ids,String operUserId); + + /** + * @Description 受众群体列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 10:51 + */ + PageData groupPeopleRegisterList(GroupPeopleRegisterListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java index 266d0f9b41..2755cf3af0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -27,6 +27,7 @@ import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.NeighborHoodAndManagementDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; +import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcNeighborHoodDetailDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; @@ -195,4 +196,11 @@ public interface IcNeighborHoodService extends BaseService * @return com.epmet.commons.tools.utils.Result */ Result neighborhoodDetail(String neighborhoodId); + + /** + * 返回当前组织及下级下的所有小区 + * @param formDTO + * @return + */ + List queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index fc2f954b02..5a4a989166 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -62,7 +62,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result editStaff(TokenDto tokenDto,StaffSubmitFromDTO fromDTO); + Result editStaff(StaffSubmitFromDTO fromDTO); /** * 人员编辑 @@ -134,9 +134,10 @@ public interface StaffService { /** * 【通讯录】人员添加v2 + * 返回staffId * @author sun */ - Result addStaffV2(AddStaffV2FromDTO fromDTO); + Result addStaffV2(AddStaffV2FromDTO fromDTO); /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index de8806a781..31aa88b033 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -175,7 +175,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { try { entity.setHouseQrcodeUrl(createHouseQrcodeUrl(icHouseDTO.getId(),null)); } catch (Exception e) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败"); + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("二维码生成失败:"+errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败:","二维码生成失败"); } icHouseDao.updateById(entity); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterDetailServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterDetailServiceImpl.java new file mode 100644 index 0000000000..76c2e52a1f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterDetailServiceImpl.java @@ -0,0 +1,83 @@ +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.IcEmployeeRegisterDetailDao; +import com.epmet.dto.IcEmployeeRegisterDetailDTO; +import com.epmet.entity.IcEmployeeRegisterDetailEntity; +import com.epmet.service.IcEmployeeRegisterDetailService; +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-10-26 + */ +@Service +public class IcEmployeeRegisterDetailServiceImpl extends BaseServiceImpl implements IcEmployeeRegisterDetailService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEmployeeRegisterDetailDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEmployeeRegisterDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEmployeeRegisterDetailDTO get(String id) { + IcEmployeeRegisterDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEmployeeRegisterDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEmployeeRegisterDetailDTO dto) { + IcEmployeeRegisterDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEmployeeRegisterDetailDTO dto) { + IcEmployeeRegisterDetailEntity entity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterDetailEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterServiceImpl.java new file mode 100644 index 0000000000..01f6f90e68 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEmployeeRegisterServiceImpl.java @@ -0,0 +1,195 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ErrorCode; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; +import com.epmet.dao.IcEmployeeRegisterDao; +import com.epmet.dto.IcEmployeeRegisterDTO; +import com.epmet.dto.form.EmployeeRegisterListFormDTO; +import com.epmet.dto.result.EmployeeRegisterListResultDTO; +import com.epmet.entity.IcEmployeeRegisterDetailEntity; +import com.epmet.entity.IcEmployeeRegisterEntity; +import com.epmet.service.IcEmployeeRegisterDetailService; +import com.epmet.service.IcEmployeeRegisterService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.RegExUtils; +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.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 员工登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Service +public class IcEmployeeRegisterServiceImpl extends BaseServiceImpl implements IcEmployeeRegisterService { + + @Autowired + private IcEmployeeRegisterDetailService icEmployeeRegisterDetailService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcEmployeeRegisterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEmployeeRegisterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcEmployeeRegisterDTO get(String id) { + IcEmployeeRegisterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEmployeeRegisterDTO.class); + } + + /** + * @Description 新增 + * @param dto + * @Author zxc + * @Date 2022/10/27 08:57 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEmployeeRegisterDTO dto) { + if (!IdCardRegexUtils.validateIdCard(dto.getIdCard())) { + throw new EpmetException(EpmetErrorCode.ID_CARD_ERROR.getCode()); + } + IcEmployeeRegisterDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterDetailEntity.class); + // 先看看存在不 + IcEmployeeRegisterEntity origin = baseDao.getEmployeeRegisterByIdCard(dto.getIdCard()); + if (null == origin){ + IcEmployeeRegisterEntity insertEntity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterEntity.class); + insert(insertEntity); + detailEntity.setRegisterId(insertEntity.getId()); + }else { + if(!origin.getName().equals(dto.getName())||!origin.getMobile().equals(dto.getMobile())){ + origin.setMobile(dto.getMobile()); + origin.setName(dto.getName()); + origin.setUpdatedTime(new Date()); + updateById(origin); + } + detailEntity.setRegisterId(origin.getId()); + } + icEmployeeRegisterDetailService.insert(detailEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEmployeeRegisterDTO dto) { + IcEmployeeRegisterEntity entity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterEntity.class); + updateById(entity); + } + + /** + * @Description 批量删除 + * @param ids + * @Author zxc + * @Date 2022/10/27 08:57 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(List ids,String operUserId) { + if (CollectionUtils.isNotEmpty(ids)){ + LambdaUpdateWrapper updateWrapper=new LambdaUpdateWrapper<>(); + updateWrapper.in(IcEmployeeRegisterEntity::getId,ids); + updateWrapper.set(IcEmployeeRegisterEntity::getDelFlag, NumConstant.ONE_STR) + .set(IcEmployeeRegisterEntity::getUpdatedBy,operUserId) + .set(IcEmployeeRegisterEntity::getUpdatedTime,new Date()); + baseDao.update(null,updateWrapper); + baseDao.delRegisterDetail(ids,operUserId); + } + } + + /** + * @Description 员工疫情管理列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 09:15 + */ + @Override + public PageData employeeRegisterList(EmployeeRegisterListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息:"+formDTO.getStaffId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageData result = new PageData<>(); + // 未核酸检测的查询,根据所有企业下登记过的员工,筛出时间段内已检测的,剩下的就是未检测 + if (formDTO.getIsPage()){ + PageInfo pageInfo = new PageInfo<>(); + if (StringUtils.isNotBlank(formDTO.getCheckStatus()) && formDTO.getCheckStatus().equals(NumConstant.ZERO_STR)){ + // 已检测 + List checked = baseDao.employeeRegisterList(formDTO); + if (CollectionUtils.isNotEmpty(checked)){ + formDTO.setRegisterIds(checked.stream().map(m -> m.getRegisterId()).collect(Collectors.toList())); + pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.employeeRegisterListNoCheck(formDTO)); + } + }else { + pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.employeeRegisterList(formDTO)); + } + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + } + return result; + } + + /** + * @Description 员工疫情管理详情列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 09:22 + */ + @Override + public PageData employeeRegisterDetailList(EmployeeRegisterListFormDTO formDTO) { + PageData result = new PageData<>(); + List list; + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.employeeRegisterDetailList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + list = baseDao.employeeRegisterDetailList(formDTO); + result.setTotal(list.size()); + result.setList(list); + } + return result; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java new file mode 100644 index 0000000000..7b0f3882ef --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java @@ -0,0 +1,98 @@ +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.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.IcEnterpriseChangeRecordDao; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; +import com.epmet.dto.IcWorkLogDTO; +import com.epmet.entity.IcEnterpriseChangeRecordEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.redis.IcEnterpriseChangeRecordRedis; +import com.epmet.service.IcEnterpriseChangeRecordService; +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-16 + */ +@Service +public class IcEnterpriseChangeRecordServiceImpl extends BaseServiceImpl implements IcEnterpriseChangeRecordService { + + @Autowired + private IcEnterpriseChangeRecordRedis icEnterpriseChangeRecordRedis; + @Autowired + private LoginUserUtil loginUserUtil; + + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcEnterpriseChangeRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String originId = (String) params.get("originId"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(originId), "ORIGIN_ID", originId); + + return wrapper; + } + + @Override + public IcEnterpriseChangeRecordDTO get(String id) { + IcEnterpriseChangeRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcEnterpriseChangeRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcEnterpriseChangeRecordDTO dto) { + IcEnterpriseChangeRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcEnterpriseChangeRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcEnterpriseChangeRecordDTO dto) { + IcEnterpriseChangeRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcEnterpriseChangeRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java index 88de234e7d..679dde5615 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java @@ -2,14 +2,17 @@ package com.epmet.service.impl; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.Constant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum; -import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -18,19 +21,14 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.FileUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; -import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.IcEnterpriseEntity; -import com.epmet.entity.IcEnterprisePatrolAttachmentEntity; -import com.epmet.entity.IcEnterprisePatrolRecordEntity; +import com.epmet.entity.*; import com.epmet.excel.EnterpriseImportExcelDTO; import com.epmet.excel.handler.IcEnterpriseExcelImportListener; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -38,12 +36,12 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.CoverageService; +import com.epmet.service.IcEnterpriseChangeRecordService; import com.epmet.service.IcEnterpriseService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.collections4.MapUtils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -56,12 +54,21 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; +import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import static com.epmet.service.impl.HouseServiceImpl.bufferedImageToInputStream; /** * 企事业单位表 @@ -90,6 +97,13 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper(); @@ -146,14 +164,14 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl queryWrapper=new LambdaQueryWrapper<>(); - queryWrapper.eq(IcEnterprisePatrolRecordEntity::getEnterpriseId,origin.getEnterpriseId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcEnterprisePatrolRecordEntity::getEnterpriseId, origin.getEnterpriseId()); if (NumConstant.ZERO == enterprisePatrolRecordDao.selectCount(queryWrapper)) { - baseDao.updateLatestPatrol(origin.getEnterpriseId(),null,StrConstant.EPMETY_STR,currentUserId); + baseDao.updateLatestPatrol(origin.getEnterpriseId(), null, StrConstant.EPMETY_STR, currentUserId); } } /** * 巡查记录列表 * 暂时不分页 + * * @param enterpriseId * @return */ @@ -230,20 +249,28 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + // Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); + // resultDto.setScaleName(dictMap.containsKey(resultDto.getScale()) ? dictMap.get(resultDto.getScale()) : StrConstant.EPMETY_STR); //规模名称 - Result> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); - Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); - resultDto.setScaleName(dictMap.containsKey(resultDto.getScale()) ? dictMap.get(resultDto.getScale()) : StrConstant.EPMETY_STR); + resultDto.setScaleName(resultDto.getScaleTotal()+"人"); if (StringUtils.isNotBlank(enterpriseEntity.getLatestResult()) && "0".equals(enterpriseEntity.getLatestResult())) { resultDto.setLatestResultName("合格"); } else if (StringUtils.isNotBlank(enterpriseEntity.getLatestResult()) && "1".equals(enterpriseEntity.getLatestResult())) { resultDto.setLatestResultName("不合格"); } + if ("0".equals(resultDto.getPlaceCategory())) { + // 0九小场所、1企事业单位 + resultDto.setPlaceCategoryName("九小场所"); + } else if ("1".equals(resultDto.getPlaceCategory())) { + resultDto.setPlaceCategoryName("企事业单位"); + } return resultDto; } @@ -258,12 +285,17 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl list = baseDao.selectList(formDTO); + List list = new ArrayList<>(); + if (formDTO.getPageFlag()){ + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getPageFlag()); + list = baseDao.selectList(formDTO); + }else { + list = baseDao.selectList(formDTO); + } PageInfo pageInfo = new PageInfo<>(list); if (!org.springframework.util.CollectionUtils.isEmpty(list)) { - //规模名称 - Result> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); - Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); + //规模名称 已废弃用字典表,改为手动输入数字了 + // Result> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + // Map dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); for (EnterpriseDetailDTO detailDTO : list) { GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(detailDTO.getGridId()); if (null != gridInfoCache) { @@ -296,12 +333,19 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); @@ -309,26 +353,27 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl dictList = coverageService.dictMap(customerId, CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode()); Map placeTypeMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getLabel, IcCoverageCategoryDictListResultDTO::getValue)); //2、规模名称 - Result> dictMapRes = adminOpenFeignClient.dictDataList(DictTypeEnum.SCALE.getCode()); - Map scaleMap = dictMapRes.success() && CollectionUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData().stream().collect(Collectors.toMap(SysDictDataDTO::getDictLabel,SysDictDataDTO::getDictValue)) : new HashMap<>(); + // Result> dictMapRes = adminOpenFeignClient.dictDataList(DictTypeEnum.SCALE.getCode()); + // Map scaleMap = dictMapRes.success() && CollectionUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData().stream().collect(Collectors.toMap(SysDictDataDTO::getDictLabel, SysDictDataDTO::getDictValue)) : new HashMap<>(); + Map scaleMap=new HashMap<>(); //3、当前工作人员所属组织下的网格列表 List gridList = customerGridDao.selectGridList(staffInfo.getAgencyId()); if (CollectionUtils.isEmpty(gridList)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下没有网格", "当前组织下没有直属网格"); } - Map gridMap=gridList.stream().collect(Collectors.toMap(GridListResultDTO::getGridName,GridListResultDTO::getGridId)); + Map gridMap = gridList.stream().collect(Collectors.toMap(GridListResultDTO::getGridName, GridListResultDTO::getGridId)); - IcEnterpriseExcelImportListener listener = new IcEnterpriseExcelImportListener(customerId,staffInfo, this,placeTypeMap,scaleMap,gridMap); + IcEnterpriseExcelImportListener listener = new IcEnterpriseExcelImportListener(customerId, staffInfo, this, placeTypeMap, scaleMap, gridMap); EasyExcel.read(filePath.toFile(), EnterpriseImportExcelDTO.class, listener).headRowNumber(1).sheet(0).doRead(); Path errorDescFile = null; @@ -403,13 +448,13 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.apply("DATE_FORMAT(REVIEW_TIME,'%Y%m%d') = " + dateId); List list = enterprisePatrolRecordDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(list)) { - List smsList=new ArrayList<>(); + List smsList = new ArrayList<>(); list.forEach(item -> { IcEnterpriseEntity enterprise = baseDao.selectById(item.getEnterpriseId()); if (null != enterprise) { @@ -418,8 +463,8 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl paramMap = new HashMap<>(); - paramMap.put("name",enterprise.getPlaceOrgName()); - paramMap.put("date",DateUtils.format(item.getReviewTime(),DateUtils.DATE_PATTERN)); + paramMap.put("name", enterprise.getPlaceOrgName()); + paramMap.put("date", DateUtils.format(item.getReviewTime(), DateUtils.DATE_PATTERN)); sms.setParamMap(paramMap); smsList.add(sms); } @@ -428,6 +473,35 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EnterpriseDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String placeOrgName = (String) params.get("placeOrgName"); + String mobile = (String) params.get("mobile"); + String gridId = (String) params.get("gridId"); + String placeType = (String) params.get("placeType"); + String scale = (String) params.get("scale"); + String result = (String) params.get("result"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(placeOrgName), "PLACE_ORG_NAME", placeOrgName); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(placeType), "PLACE_TYPE", placeType); + wrapper.eq(StringUtils.isNotBlank(scale), "SCALE", scale); + wrapper.eq(StringUtils.isNotBlank(result), "LATEST_RESULT", result); + + return wrapper; + } + private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); if (null == staffInfo) { @@ -437,6 +511,166 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl selectForUniqueName(String gridId, String placeOrgName, String enterpriseId) { - return baseDao.selectForUniqueName(gridId, placeOrgName, enterpriseId); + return baseDao.selectForUniqueName(gridId, placeOrgName, enterpriseId); + } + + /** + * 记录操作日志 + * + * @param origin + * @param type + * @return void + * @author zhy + * @date 2022/8/16 15:36 + */ + private void log(IcEnterpriseEntity origin, EnterpriseFormDTO formDTO, String type) { + // 历史记录 + IcEnterpriseChangeRecordEntity record = ConvertUtils.sourceToTarget(origin, IcEnterpriseChangeRecordEntity.class); + + List categoryList = coverageService.dictMap(loginUserUtil.getLoginUserCustomerId(), "enterprise_patrol"); + Map categoryMap = categoryList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); + + CustomerGridEntity originGrid = customerGridDao.selectById(origin.getGridId()); + + /*Map scaleMap; + Result> result = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode()); + if (!result.success() || null == result.getData()) { + throw new EpmetException("查询字典信息失败" + JSON.toJSONString(result)); + } else { + scaleMap = result.getData(); + }*/ + + if (formDTO != null) { + if (!origin.getPlaceType().equals(formDTO.getPlaceType())) { + record.setPlaceType(categoryMap.get(origin.getPlaceType()).concat("->").concat(categoryMap.get(formDTO.getPlaceType()))); + } else { + record.setPlaceType(categoryMap.get(origin.getPlaceType())); + } + + if (!origin.getGridId().equals(formDTO.getGridId())) { + CustomerGridEntity thisGrid = customerGridDao.selectById(formDTO.getGridId()); + record.setGridId(origin.getGridId().concat("->").concat(thisGrid.getGridName())); + if (originGrid != null && thisGrid != null) { + record.setGridId(originGrid.getGridName().concat("->").concat(formDTO.getGridId())); + } + } else { + record.setGridId(originGrid.getGridName()); + } + + if (!origin.getPlaceOrgName().equals(formDTO.getPlaceOrgName())) { + record.setPlaceOrgName(origin.getPlaceOrgName().concat("->").concat(formDTO.getPlaceOrgName())); + } + /*if (!origin.getScale().equals(formDTO.getScale())) { + record.setScale(scaleMap.get(origin.getScale()).concat("->").concat(scaleMap.get(formDTO.getScale()))); + } else { + record.setScale(scaleMap.get(origin.getScale())); + }*/ + if (origin.getScaleTotal() != formDTO.getScaleTotal()) { + record.setScale(origin.getScaleTotal().toString().concat("->").concat(formDTO.getScaleTotal().toString())); + } else { + record.setScale(origin.getScaleTotal().toString()); + } + if (!origin.getPersonInCharge().equals(formDTO.getPersonInCharge())) { + record.setPersonInCharge(origin.getPersonInCharge().concat("->").concat(formDTO.getPersonInCharge())); + } + if (!origin.getMobile().equals(formDTO.getMobile())) { + record.setMobile(origin.getMobile().concat("->").concat(formDTO.getMobile())); + } + if (!origin.getAddress().equals(formDTO.getAddress())) { + record.setAddress(origin.getAddress().concat("->").concat(formDTO.getAddress())); + } + } + + record.setId(null); + record.setCreatedBy(null); + record.setCreatedTime(null); + record.setUpdatedBy(null); + record.setUpdatedTime(null); + record.setOriginId(origin.getId()); + record.setType(type); + + icEnterpriseChangeRecordService.insert(record); + } + + /** + * @Description 登记码导出 + * 开发环境:45687aa479955f9d06204d415238f7cc + * 微笑崂山:3fdd0380deff5b30f45376cdf995d1c1 + * 烟台:1535072605621841922 + * 目前只给烟台用,为了测试,生产微笑崂山也放开 + * @param formDTO + * @Author zxc + * @Date 2022/10/26 15:55 + */ + @Override + public void qrCodeExport(EnterprisePageFormDTO formDTO, HttpServletResponse response) throws IOException { + if (!"45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId()) + && !"3fdd0380deff5b30f45376cdf995d1c1".equals(formDTO.getCustomerId()) + && !"1535072605621841922".equals(formDTO.getCustomerId())) { + return; + } + List list = list(formDTO).getList(); + if (CollectionUtils.isEmpty(list)){ + log.error("根据条件未查询到企事业单位信息,登记码压缩包不能导出!"); + ServletOutputStream outputStream = response.getOutputStream(); + outputStream.write("{\"code\":9999,\"msg\":\"未查到企事业单位信息\",\"data\":{}}".getBytes()); + outputStream.flush(); + return; + } + response.reset(); + //文件的名称 + String downloadFilename = "登记码压缩包.zip"; + //转换中文否则可能会产生乱码 + downloadFilename = URLEncoder.encode(downloadFilename, "UTF-8"); + // 指明response的返回对象是文件流 + response.setContentType("application/octet-stream; charset=UTF-8"); + //设置下载格式和名称 + response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename); + ZipOutputStream zip = new ZipOutputStream(response.getOutputStream()); + + //不同环境的码,访问的地址不一样 + String jumpUrl=""; + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) { + if ("1535072605621841922".equals(formDTO.getCustomerId())) { + // 烟台的客户id + jumpUrl = "https://epmet-yantai.elinkservice.cn"; + } else if ("3fdd0380deff5b30f45376cdf995d1c1".equals(formDTO.getCustomerId())) { + // 微笑崂山 + jumpUrl = "https://epmet-open.elinkservice.cn"; + } + } else if (EnvEnum.TEST.getCode().equals(currentEnv.getCode())) { + // 最美琴岛 + jumpUrl = "https://epmet-dev.elinkservice.cn/"; + } else { + // 其余统一走开发环境 + jumpUrl = "http://192.168.1.140"; + } + + for (EnterpriseDetailDTO l : list) { + try { + // CustomerAgencyConstant.JUMP_URL = "http://192.168.1.140/epmet-oper-gov/#/staffRegister?"; + // String content = JUMP_URL + "enterpriseId=" + l.getEnterpriseId() + "&customerId=" + formDTO.getCustomerId() + "&placeOrgName=" + l.getPlaceOrgName(); + String content = jumpUrl.concat("/epmet-oper-gov/#/staffRegister?") + "enterpriseId=" + l.getEnterpriseId() + "&customerId=" + formDTO.getCustomerId() + "&placeOrgName=" + l.getPlaceOrgName(); + BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(l.getPlaceOrgName(), content); + byte[] buf = new byte[8192]; + int len; + //添加到zip + zip.putNextEntry(new ZipEntry(l.getPlaceOrgName()+"_"+l.getEnterpriseId()+".png")); + InputStream inputStream = bufferedImageToInputStream(image); + //输出压缩包 + while ((len = inputStream.read(buf)) > 0) { + zip.write(buf, 0, len); + } + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "组装zip信息有误", "组装zip信息有误"); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + zip.close(); } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcGroupPeopleRegisterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcGroupPeopleRegisterServiceImpl.java new file mode 100644 index 0000000000..e0ca969f52 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcGroupPeopleRegisterServiceImpl.java @@ -0,0 +1,133 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcGroupPeopleRegisterDao; +import com.epmet.dto.IcGroupPeopleRegisterDTO; +import com.epmet.dto.form.GroupPeopleRegisterListFormDTO; +import com.epmet.dto.result.GroupPeopleRegisterListResultDTO; +import com.epmet.entity.IcGroupPeopleRegisterEntity; +import com.epmet.service.IcGroupPeopleRegisterService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 受众群体登记表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-26 + */ +@Service +public class IcGroupPeopleRegisterServiceImpl extends BaseServiceImpl implements IcGroupPeopleRegisterService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcGroupPeopleRegisterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcGroupPeopleRegisterDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcGroupPeopleRegisterDTO get(String id) { + IcGroupPeopleRegisterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcGroupPeopleRegisterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcGroupPeopleRegisterDTO dto) { + IcGroupPeopleRegisterEntity entity = ConvertUtils.sourceToTarget(dto, IcGroupPeopleRegisterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcGroupPeopleRegisterDTO dto) { + IcGroupPeopleRegisterEntity entity = ConvertUtils.sourceToTarget(dto, IcGroupPeopleRegisterEntity.class); + updateById(entity); + } + + /** + * 受众群体管理删除 + * http://yapi.elinkservice.cn/project/102/interface/api/8250 + * @param ids + * @param operUserId 当前操作人 + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(List ids,String operUserId) { + if (CollectionUtils.isNotEmpty(ids)){ + LambdaUpdateWrapper updateWrapper=new LambdaUpdateWrapper<>(); + updateWrapper.in(IcGroupPeopleRegisterEntity::getId,ids) + .set(IcGroupPeopleRegisterEntity::getUpdatedBy,operUserId) + .set(IcGroupPeopleRegisterEntity::getUpdatedTime,new Date()) + .set(IcGroupPeopleRegisterEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null,updateWrapper); + // baseDao.deleteBatchIds(ids); + } + } + + /** + * @Description 受众群体列表 + * @param formDTO + * @Author zxc + * @Date 2022/10/27 10:51 + */ + @Override + public PageData groupPeopleRegisterList(GroupPeopleRegisterListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息:"+formDTO.getStaffId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageData result = new PageData<>(); + List list; + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.groupPeopleRegisterList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + list = baseDao.groupPeopleRegisterList(formDTO); + result.setList(list); + result.setTotal(list.size()); + } + return result; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java index e14ea745ab..56e473038d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -51,6 +51,7 @@ import com.epmet.dto.*; import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.excel.IcNeighborHoodExcel; @@ -824,4 +825,27 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl().ok(result); } + /** + * 返回当前组织及下级下的所有小区 + * + * @param formDTO + * @return + */ + @Override + public List queryNeighborHoodOptions(NeighborHoodOptionFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getGridId()) && StringUtils.isBlank(formDTO.getAgencyId())) { + // 默认查询当前工作人员所属组织及下级的 + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfoCacheResult.getAgencyId()); + } + List list = baseDao.queryNeighborHoodOptions(formDTO); + return list; + } + + + + + + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 6950cbcc3c..a81f868ac5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -17,6 +17,7 @@ import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dao.StaffOrgRelationDao; import com.epmet.dto.*; import com.epmet.dto.form.*; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.*; @@ -46,8 +47,6 @@ public class StaffServiceImpl implements StaffService { @Autowired private EpmetUserFeignClient epmetUserFeignClient; @Autowired - private OperCrmFeignClient operCrmFeignClient; - @Autowired private CustomerAgencyService customerAgencyService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; @@ -76,11 +75,11 @@ public class StaffServiceImpl implements StaffService { @Autowired private StaffOrgRelationService staffOrgRelationService; @Resource - private CustomerStaffRedis customerStaffRedis; - @Resource private StaffOrgRelationDao staffOrgRelationDao; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private EpmetThirdOpenFeignClient epmetThirdOpenFeignClient; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -127,18 +126,44 @@ public class StaffServiceImpl implements StaffService { return epmetUserFeignClient.getStaffList(fromDTO); } + /** + * 人员添加页面初始化 + * 备注:2022.10.18运营端-统一认证也会调用此接口,入参会给customerId + * @param fromDTO 参数 + * @return + */ @Override public Result> addStaffInit(StaffInfoFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + if(StringUtils.isNotBlank(fromDTO.getAgencyId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } + } return epmetUserFeignClient.addStaffInit(fromDTO); } @Override public Result editStaffInit(StaffInfoFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); - return epmetUserFeignClient.editStaffInit(fromDTO); + //运营端-统一认证调用此接口时,客户id传值了。 + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } + CustomerStaffAgencyDTO customerStaffAgencyDTO=customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); + if (null == customerStaffAgencyDTO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customer_staff_agency is null user_id :" + fromDTO.getStaffId(), "查询用户所属组织为空"); + } + //运营端-统一认证那调用的时候, agencyId为空,这里重新赋值下 + if(StringUtils.isBlank(fromDTO.getAgencyId())){ + fromDTO.setAgencyId(customerStaffAgencyDTO.getAgencyId()); + } + Result res=epmetUserFeignClient.editStaffInit(fromDTO); + if (res.success() && null != res.getData()) { + res.getData().setAgencyId(customerStaffAgencyDTO.getAgencyId()); + res.getData().setAgencyName(customerAgencyService.getAgencyName(customerStaffAgencyDTO.getAgencyId())); + } + return new Result().ok(res.getData()); } @Override @@ -179,26 +204,33 @@ public class StaffServiceImpl implements StaffService { return new Result(); } + /** + * + * @param tokenDto TokenDto tokenDto, + * @param fromDTO + * @return + */ @Override - public Result editStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); - - fromDTO.setApp(tokenDto.getApp()); - fromDTO.setClient(tokenDto.getClient()); + public Result editStaff(StaffSubmitFromDTO fromDTO) { + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } + // epmetUserFeignClient.editStaff没有用到这俩参数,就注释了。 + // fromDTO.setApp(tokenDto.getApp()); + // fromDTO.setClient(tokenDto.getClient()); Result result = epmetUserFeignClient.editStaff(fromDTO); if (!result.success()) { - if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { - return new Result().error(result.getCode(), result.getMsg()); - } - return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg()); - } - if (tokenDto.getClient().equals("web")){ - Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId(),fromDTO.getCustomerId())); - if (!roleUserAccess.success()){ - throw new EpmetException("save data to gov-role-user failure"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),result.getInternalMsg(),result.getMsg()); + } + // if (tokenDto.getClient().equals("web")){ + if(CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){ + Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId(),fromDTO.getCustomerId())); + if (!roleUserAccess.success()){ + throw new EpmetException("save data to gov-role-user failure"); + } } - } + // } //2021.8.24 sun 人员信息编辑时删除工作人员的缓存信息 CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); return result; @@ -537,12 +569,12 @@ public class StaffServiceImpl implements StaffService { */ @Override @Transactional(rollbackFor = Exception.class) - public Result addStaffV2(AddStaffV2FromDTO fromDTO) { + public Result addStaffV2(AddStaffV2FromDTO fromDTO) { //1.根据新增人员类型判断查询机关信息 OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(fromDTO.getOrgId(), fromDTO.getOrgType()); if (null == orgDTO) { - logger.error(String.format("工作人员新增,根据新增人员组织类型未查询到相关组织信息,orgId->%s,orgType->%s", fromDTO.getOrgId(), fromDTO.getOrgType())); - throw new RenException("根据新增人员组织类型未查询到相关组织信息"); + logger.warn(String.format("工作人员新增,根据新增人员组织类型未查询到相关组织信息,orgId->%s,orgType->%s", fromDTO.getOrgId(), fromDTO.getOrgType())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"根据新增人员组织类型未查询到相关组织信息","组织不存在"); } //2.调用user服务,新增用户信息 @@ -550,10 +582,7 @@ public class StaffServiceImpl implements StaffService { submitDTO.setAgencyId(orgDTO.getAgencyId()); Result result = epmetUserFeignClient.addStaff(submitDTO); if (!result.success()) { - if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { - return new Result().error(result.getCode(), result.getMsg()); - } - return new Result().error(EpmetErrorCode.STAFF_ADD_FAILED.getCode(), EpmetErrorCode.STAFF_ADD_FAILED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),result.getInternalMsg(),result.getMsg()); } //3.人员机关表总人数加一、关系表新增关系数据 @@ -612,8 +641,22 @@ public class StaffServiceImpl implements StaffService { throw new EpmetException("save data to gov-role-user failure"); } } - - return new Result(); + //如果是烟台的需要更新 根据手机号+姓名 更新data_sync_user_data置为已创建、记录staffId + // 开发环境默认:45687aa479955f9d06204d415238f7cc + // 测试环境:0c41b272ee9ee95ac6f184ad548a30eb + // 烟台: 1535072605621841922 + if ("1535072605621841922".equals(fromDTO.getCustomerId()) + || "45687aa479955f9d06204d415238f7cc".equals(fromDTO.getCustomerId()) + || "0c41b272ee9ee95ac6f184ad548a30eb".equals(fromDTO.getCustomerId())) { + YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO = ConvertUtils.sourceToTarget(fromDTO,YtSyncStaffIdFormDTO.class); + ytSyncStaffIdFormDTO.setStaffId(result.getData().getUserId()); + ytSyncStaffIdFormDTO.setOperUserId(fromDTO.getCurrentUserId()); + epmetThirdOpenFeignClient.dataSyncUpdateStaff(ytSyncStaffIdFormDTO); + } + //2022.10.18加个返参,借用下StaffDetailResultDTO不再新建dto了 + StaffDetailResultDTO resultDTO=new StaffDetailResultDTO(); + resultDTO.setStaffId(result.getData().getUserId()); + return new Result().ok(resultDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.44__add_enterprise_change_record.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.44__add_enterprise_change_record.sql new file mode 100644 index 0000000000..be6f30d58e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.44__add_enterprise_change_record.sql @@ -0,0 +1,52 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_cloud_dev_org + 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: 17/08/2022 14:20:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for ic_enterprise_change_record +-- ---------------------------- +DROP TABLE IF EXISTS `ic_enterprise_change_record`; +CREATE TABLE `ic_enterprise_change_record` ( + `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', + `GRID_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', + `AGENCY_PIDS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'agency_id的所有上级', + `PLACE_TYPE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所类型:来源于ic_coverage_category_dict', + `PLACE_ORG_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所名称', + `ADDRESS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所地址', + `LONGITUDE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度', + `SCALE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典value,场所规模【\r\n0:10人以下\r\n1:10-20人\r\n2:21-40人\r\n3:41-100人\r\n4:100人以上】', + `PERSON_IN_CHARGE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所负责人', + `MOBILE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人电话', + `SOURCE_TYPE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源【新增:add 导入:import 】', + `LATEST_RESULT` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最新巡查结果【0:合格 1:不合格】', + `LATEST_PATROL_TIME` datetime 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 '更新时间', + `ORIGIN_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '原始记录ID', + `TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作类型,upd,del', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企事业单位变更记录表' ROW_FORMAT = COMPACT; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.45__place_category.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.45__place_category.sql new file mode 100644 index 0000000000..cc1680ef63 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.45__place_category.sql @@ -0,0 +1,24 @@ +alter table ic_enterprise MODIFY COLUMN `SCALE` varchar(128) NOT NULL DEFAULT'-1' COMMENT '已弃用该字段,字典value,场所规模【\r\n0:10人以下\r\n1:10-20人\r\n2:21-40人\r\n3:41-100人\r\n4:100人以上】'; +alter table ic_enterprise ADD COLUMN `SCALE_TOTAL` int(11) NOT NULL COMMENT '规模,手输数字' AFTER SCALE; +alter table ic_enterprise add COLUMN PLACE_CATEGORY varchar(32) NOT NULL DEFAULT '0' COMMENT '场所类别:0九小场所、1企事业单位' after PLACE_TYPE; + + +update ic_enterprise e +set e.SCALE_TOTAL=5 +where e.SCALE=0; + +update ic_enterprise e +set e.SCALE_TOTAL=15 +where e.SCALE=1; + +update ic_enterprise e +set e.SCALE_TOTAL=30 +where e.SCALE=2; + +update ic_enterprise e +set e.SCALE_TOTAL=70 +where e.SCALE=3; + +update ic_enterprise e +set e.SCALE_TOTAL=100 +where e.SCALE=4; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.46__ic_employee.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.46__ic_employee.sql new file mode 100644 index 0000000000..cb637f8d03 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.46__ic_employee.sql @@ -0,0 +1,48 @@ +CREATE TABLE `ic_employee_register` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ENTERPRISE_ID` varchar(64) NOT NULL COMMENT '场所id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(32) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(32) NOT NULL COMMENT '身份证号或护照号', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `IDX_ENTERPRISE_ID` (`ENTERPRISE_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工登记表'; + +CREATE TABLE `ic_employee_register_detail` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `REGISTER_ID` varchar(64) NOT NULL COMMENT 'ic_employee_register.ID', + `YMJZ_COUNT` int(11) NOT NULL COMMENT '疫苗接种次数:0,1,2,3', + `LATEST_NAT_TIME` date NOT NULL COMMENT '最近一次核酸检测时间:yyyy-MM-dd 日期', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `IDX_REGISTER_ID` (`REGISTER_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工登记明细表'; + +CREATE TABLE `ic_group_people_register` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ENTERPRISE_ID` varchar(64) NOT NULL COMMENT '场所id', + `NAT_TIME` date NOT NULL COMMENT '核酸检测时间:yyyy-MM-dd 日期', + `SZ_TOTAL` int(11) NOT NULL COMMENT '受众人数', + `HSJC_TOTAL` int(11) NOT NULL COMMENT '核酸检测人数', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='受众群体登记表'; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx index 283b41c095..6981727e9b 100644 Binary files a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/enterprise_patrol_import_tem.xlsx differ diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDao.xml new file mode 100644 index 0000000000..5bb4bb0533 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDao.xml @@ -0,0 +1,152 @@ + + + + + + + + update ic_employee_register_detail + set del_flag = 1, + updated_time = NOW(), + UPDATED_BY = #{operUserId} + where REGISTER_ID in ( + + #{registerId} + + ) + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDetailDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDetailDao.xml new file mode 100644 index 0000000000..2ca17eecfd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEmployeeRegisterDetailDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseChangeRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseChangeRecordDao.xml new file mode 100644 index 0000000000..f69c54e9bd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseChangeRecordDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml index 0a3d9a321a..2b14cedbbb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcEnterpriseDao.xml @@ -43,11 +43,13 @@ ie.AGENCY_ID, ie.AGENCY_PIDS, ie.PLACE_TYPE, + ie.PLACE_CATEGORY, ie.PLACE_ORG_NAME, ie.ADDRESS, ie.LONGITUDE, ie.LATITUDE, ie.SCALE, + ie.SCALE_TOTAL, ie.PERSON_IN_CHARGE, ie.MOBILE, ie.SOURCE_TYPE, @@ -74,6 +76,9 @@ AND ie.PLACE_TYPE = #{placeType} + + AND ie.PLACE_CATEGORY = #{placeCategory} + AND ie.PLACE_ORG_NAME LIKE concat( '%', #{placeOrgName}, '%' ) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcGroupPeopleRegisterDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcGroupPeopleRegisterDao.xml new file mode 100644 index 0000000000..88e9d73f79 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcGroupPeopleRegisterDao.xml @@ -0,0 +1,29 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 6e417b0aed..441dfe7f1b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -147,6 +147,12 @@ AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId} + + AND a.BUILDING_UNIT_ID = #{buildingUnitId} + + + AND a.ID = #{houseId} + AND b.id = #{id} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 96ec0dd57f..0120d31bb0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -673,4 +673,25 @@ + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java index 3b14fc3266..3be3954934 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -103,12 +103,12 @@ public class IcEventDTO implements Serializable { private Date closeCaseTime; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java index 19e7d38344..ac1812c5c7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** @@ -13,7 +14,7 @@ public class ColseProjectOrDemandFormDTO implements Serializable { private static final long serialVersionUID = -590440160577071133L; //事件管理Id private String icEventId; - //类型 需求:demand 项目:project + //类型 需求:demand 项目:project 议题:issue private String type; //服务方【事件被转需求,需求在办结时的服务方名称】 private String serviceParty; @@ -22,4 +23,11 @@ public class ColseProjectOrDemandFormDTO implements Serializable { private String customerId; private String userId; + + /** + * 项目的结案时间 + * 需求的完成时间 + * 议题的关闭时间 + */ + private Date closeCaseTime; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java index 07d9a8bcf9..31010e536f 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -83,7 +84,7 @@ public class IcEventAddEditFormDTO implements Serializable { */ private String longitude; /** - * 处理方式[0:已回复 1:已转项目 2:已转需求] + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** @@ -117,4 +118,10 @@ public class IcEventAddEditFormDTO implements Serializable { private String app; private String client; + /** + * 新增事件直接转议题 + */ + @Valid + private IcEventToIssueFormDTO issueInfo; + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java new file mode 100644 index 0000000000..e5b99e66d7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/9 16:46 + */ +@Data +public class IcEventToIssueFormDTO implements Serializable { + private static final long serialVersionUID = -7227815962561508949L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface AddEventAndShiftIssue extends CustomerClientShowGroup { + } + /** + * 转议题默认传3即可;0:已回复 1:已转项目 2:已转需求3:转议题 + */ + @NotBlank(message = "处理方式不能为空", groups = AddUserInternalGroup.class) + private String operationType; + + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String icEventId; + + // /** + // * 二类分类Id + // */ + // private String categoryId; + + /** + * 项目所选分类集合,不可为空 + */ + @Valid + @NotEmpty(message = "事件分类不能为空", groups = AddUserShowGroup.class) + private List categoryList; + + @NotBlank(message = "议题标题不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + @Length(message = "议题标题最多输入120字",max = 120,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + private String issueTitle; + + @Length(message = "处理建议最多输入1000字",max = 1000,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + @NotBlank(message = "处理建议不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + private String suggestion; + + @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + @NotBlank(message = "currentUserId不能为空", groups = {AddUserInternalGroup.class}) + private String currentUserId; +} + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java index beac1277a0..349db1d45c 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -117,15 +117,15 @@ public class IcEventListResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date closeCaseTime; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationTypeName; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; /** diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java index 7b4b805e7e..4379252a67 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java @@ -14,7 +14,7 @@ import java.util.List; public class IcEventProcessListResultDTO implements Serializable { private static final long serialVersionUID = 5762152044573235897L; - + private String issueId; /** * 项目ID */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java index 46c2c9ff02..71378156e9 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java @@ -17,6 +17,8 @@ public class MyPubIssuesClosedResultDTO implements Serializable { * 议题id */ private String issueId; + private String sourceId; + private String sourceType; /** * 议题标题 @@ -36,11 +38,11 @@ public class MyPubIssuesClosedResultDTO implements Serializable { /** * 话题发表于哪个组 */ - private String topicReleaseGroupName; + private String topicReleaseGroupName = ""; /** * 话题发表于哪个网格 */ - private String topicReleaseGridName; + private String topicReleaseGridName = ""; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java index 8397d64b69..7931067f86 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java @@ -45,4 +45,6 @@ public class MyPubIssuesShiftProjectResultDTO implements Serializable { private String topicReleaseGroupName; private String issueId; + private String sourceId; + private String sourceType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java index ed9f0d8d16..a21e2f47d1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import lombok.NoArgsConstructor; @@ -20,14 +21,64 @@ public class PendingResultDTO implements Serializable { private static final long serialVersionUID = 2545519820222637112L; private String issueId; private String issueTitle; + /** + * 议题转成项目时间 + */ private Long issueShiftedTime; + /** + * 话题内容 + */ private String topicContent; + /** + * 当前处理部门名称数组 + */ private List currentHandleDepartMent; + /** + * 话题语音url列表 + */ private List topicVoices; + /** + * 话题内容 + */ private List topicImgs; + /** + * 项目的来源Id(话题或议题Id) + * sourceId=议题id + */ private String sourceId; - @JsonIgnore + // @JsonIgnore private String projectId; private String longitude; private String latitude; + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java index 7c9bb481e8..daf846a3a5 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java @@ -75,7 +75,15 @@ public class ProjectManageListResultDTO implements Serializable { private Boolean processable; private Boolean returnable; - + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String origin; public ProjectManageListResultDTO() { this.gridName = ""; this.title = ""; @@ -86,5 +94,6 @@ public class ProjectManageListResultDTO implements Serializable { this.status = ""; this.departmentNameList = new ArrayList<>(); this.projectId = ""; + this.origin=""; } } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java index 14187406e3..88ad6068c7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -13,6 +15,7 @@ import java.util.List; @Data public class ResolvedResultDTO implements Serializable { private static final long serialVersionUID = -6670213622289052352L; + private String projectId; /** * 议题Id */ @@ -53,4 +56,34 @@ public class ResolvedResultDTO implements Serializable { private String longitude; private String latitude; + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java index 53f183c389..7d65a6a6b1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -52,4 +54,36 @@ public class UnResolvedResultDTO implements Serializable { private String topicContent; private String longitude; private String latitude; + + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + private String projectId; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 7907ac7ec5..8220889e9e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcEventDTO; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; @@ -170,6 +171,7 @@ public interface GovProjectOpenFeignClient { /** * Desc: 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 * @author sun */ @PostMapping("gov/project/icEvent/closeprojectordemand") @@ -178,4 +180,20 @@ public interface GovProjectOpenFeignClient { @PostMapping("gov/project/project/staffpendingproject") Result> staffPendingProject(@RequestBody ProjectListFromDTO formDTO); + /** + * 批量查询事件信息 + * @param icEventIds + * @return + */ + @PostMapping("gov/project/icEvent/batchSelectById") + Result> batchSelectById(@RequestBody List icEventIds); + + /** + * @Description 议题处理进展——已转项目 + * @param formDTO + * @author zxc + */ + @PostMapping("/gov/project/projectprocess/projectprocesslist") + Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO); + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 51f7922ba5..bfb6d57f89 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcEventDTO; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; @@ -174,4 +175,22 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> staffPendingProject(ProjectListFromDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "staffPendingProject",formDTO); } + + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @Override + public Result> batchSelectById(List icEventIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "batchSelectById",icEventIds); + } + + @Override + public Result> projectProcessList(ProcessProjectIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "projectProcessList", formDTO); + } + + } diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 375daa8dd2..abb978b7ce 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -219,8 +219,9 @@ callerRunsPolicy false - https://epmet-dev.elinkservice.cn/api/epmetscan/api - + + + https://epmet-open.elinkservice.cn/api/epmetscan/api https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java index 5105ca27bf..c7bd63814f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -59,6 +59,12 @@ public class IcEventController { @Autowired private IcEventReplyService icEventReplyService; + /** + * 事件管理-列表 + * @param tokenDto + * @param formDTO + * @return + */ @RequestMapping("list") public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -83,6 +89,12 @@ public class IcEventController { return new Result().ok(data); } + /** + * 事件管理-新增 + * @param tokenDto + * @param formDTO + * @return + */ @NoRepeatSubmit @PostMapping("add") public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){ @@ -91,6 +103,9 @@ public class IcEventController { formDTO.setUserId(tokenDto.getUserId()); formDTO.setApp(tokenDto.getApp()); formDTO.setClient(tokenDto.getClient()); + if("3".equals(formDTO.getOperationType())){ + ValidatorUtils.validateEntity(formDTO.getIssueInfo(),IcEventToIssueFormDTO.AddEventAndShiftIssue.class); + } icEventService.save(formDTO); return new Result(); } @@ -242,6 +257,21 @@ public class IcEventController { return new Result(); } + /** + * 事件转议题 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("icEventToIssue") + public Result icEventToIssue(@LoginUser TokenDto tokenDto, @RequestBody IcEventToIssueFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcEventToIssueFormDTO.AddUserShowGroup.class, IcEventToIssueFormDTO.AddUserInternalGroup.class); + icEventService.icEventToIssue(formDTO); + return new Result(); + } + /** * 事件分类分析-一级分类下事件数量 * @@ -334,6 +364,7 @@ public class IcEventController { /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ @PostMapping("closeprojectordemand") public Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO) { @@ -382,7 +413,7 @@ public class IcEventController { @PostMapping("myreport-detail") public Result myReportDetail(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setUserId(tokenDto.getUserId()); + // formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.DetailGroup.class); return new Result().ok(icEventService.myReportDetail(formDTO)); } @@ -512,6 +543,18 @@ public class IcEventController { return new Result>().ok(icEventService.icEventPageUserReported(formDTO)); } - + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @PostMapping("batchSelectById") + public Result> batchSelectById(@RequestBody List icEventIds) { + if (CollectionUtils.isEmpty(icEventIds)) { + return new Result<>(); + } + return new Result>().ok(icEventService.batchSelectById(icEventIds)); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 02f813b232..101a735cfe 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -279,7 +279,7 @@ public class ProjectController { } /** - * 无需解决项目列表 + * 无需解决项目列表 来源于议题,已结案,无需解决的项目 * @author zhaoqifeng * @date 2021/7/27 14:55 * @param formDTO @@ -451,4 +451,16 @@ public class ProjectController { } } + /** + * 纯属为了测试.... + * 如果项目结案了,事件没有回写可以调用此方法 + * @param tokenDto + * @param projectId + * @return + */ + @PostMapping("test-close/{projectId}") + public Result testClose(@LoginUser TokenDto tokenDto,@PathVariable("projectId")String projectId){ + projectService.modifyIcEvent(null,tokenDto.getUserId(),new Date(),projectId); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java index e8829fda7a..c50f4b5fa7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java @@ -15,5 +15,4 @@ import org.apache.ibatis.annotations.Param; public interface IcEventCategoryDao extends BaseDao { IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); - } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 316fbc8de6..07786f5585 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -189,6 +189,14 @@ public interface ProjectDao extends BaseDao { */ List selectPendingListByGrid(@Param("gridId")String gridId); + /** + * 居民端议事厅-处理中列表 + * 查询的是已经转项目的议题,这里是查询来源于议题的项目 + * @param gridId + * @return + */ + List selectPendingListByGridV2(@Param("gridId")String gridId); + /** * 获取党建声音已结案列表 * @author zhaoqifeng diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index ce8d9bdd6a..81c5635aaf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -61,9 +61,9 @@ public class IcEventEntity extends BaseEpmetEntity { */ private String idCard; - /** - * 反映渠道【字典表】 - */ + /** + * 反映渠道【字典表】dictTypeKey:ic_event_source_type;随手拍随时讲0、多媒体反应1、社区电话2、12345:3、网格员手持终端:4 + */ private String sourceType; /** @@ -102,12 +102,12 @@ public class IcEventEntity extends BaseEpmetEntity { private Date closeCaseTime; /** - * 0:已回复 1:已转项目 2:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java index 209d70d4f3..d41ff83514 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java @@ -48,6 +48,7 @@ public class IcEventOperationLogEntity extends BaseEpmetEntity { * 4、转需求:shift_demand * 5、办结:close_case; * 6、需求办结:close_demand + * 转议题:shift_to_issue */ private String actionCode; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java index b5199a8392..4d8163c9ae 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java @@ -48,7 +48,12 @@ public class ProjectEntity extends BaseEpmetEntity { private String gridId; /** - * 来源:议题issue 项目立项:agency + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event */ private String origin; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java index 90c9fd9524..fef4ca591a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java @@ -82,4 +82,12 @@ public interface IcEventCategoryService extends BaseService categoryEntities); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java index 40a9f2e55d..d785949909 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -172,6 +172,7 @@ public interface IcEventService extends BaseService { /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO); @@ -225,4 +226,16 @@ public interface IcEventService extends BaseService { PageData icEventPageUserReported(PageUserReportEventFormDTO formDTO); + /** + * 事件转议题 + * @param formDTO + */ + void icEventToIssue(IcEventToIssueFormDTO formDTO); + + /** + * 批量查询事件信息 + * @param icEventIds + * @return + */ + List batchSelectById(List icEventIds); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java index 9ae8a7fdee..4940a4fbb1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO; import com.epmet.dto.result.ProjectCategoryTagListResultDTO; import com.epmet.entity.ProjectCategoryEntity; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; @@ -136,4 +137,13 @@ public interface ProjectCategoryService extends BaseService> getProjectCategoryMap(List projectIds); + + /** + * 根据项目id,删除项目分类,记录删除人、删除时间 + * @param projectId + * @param userId + * @param delTime + * @return + */ + int delByProjectId(String projectId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 7dba649107..f588edc374 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -11,6 +11,7 @@ import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Date; import java.util.List; import java.util.Map; @@ -308,7 +309,7 @@ public interface ProjectService extends BaseService { List getResolvedListByGrid(ShiftProjectListFromDTO fromDTO); /** - * 无需解决项目列表 + * 无需解决项目列表 来源于议题,已结案,无需解决的项目 * @author zhaoqifeng * @date 2021/7/27 14:40 * @param fromDTO @@ -399,11 +400,12 @@ public interface ProjectService extends BaseService { PageData orgProjectList(OrgProjectListFormDTO formDTO); /** - * desc:根据来源id和类型 删除项目 (只删了主表) + * desc:根据来源id和类型 删除项目 (只删了主表、项目分类表) * @param originId * @param origin * @return */ Integer deleteByOriginId(String originId, String origin); + void modifyIcEvent(ProjectEntity projectEntity, String userId, Date closeCaseTime, String projectId); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java index c1d4d6fac9..52a8b13be1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java @@ -1,21 +1,26 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcEventCategoryDao; import com.epmet.dto.IcEventCategoryDTO; import com.epmet.entity.IcEventCategoryEntity; import com.epmet.service.IcEventCategoryService; +import org.apache.commons.collections4.CollectionUtils; 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.Date; import java.util.List; import java.util.Map; @@ -27,7 +32,8 @@ import java.util.Map; */ @Service public class IcEventCategoryServiceImpl extends BaseServiceImpl implements IcEventCategoryService { - + @Autowired + private LoginUserUtil loginUserUtil; @Override public PageData page(Map params) { @@ -86,4 +92,18 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl categoryEntities) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IcEventCategoryEntity::getIcEventId,icEventId) + .set(IcEventCategoryEntity::getUpdatedTime,new Date()) + .set(IcEventCategoryEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) + .set(IcEventCategoryEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null,wrapper); + if(CollectionUtils.isNotEmpty(categoryEntities)){ + this.insertBatch(categoryEntities); + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index dda3a90647..b37344a620 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -182,6 +183,10 @@ public class IcEventServiceImpl extends BaseServiceImpl issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); + if (!issueRes.success() || null == issueRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); + } + formDTO.setOperationId(issueRes.getData().getIssueId()); + } //3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据 //3-1.事件数据保存 @@ -282,7 +317,7 @@ public class IcEventServiceImpl extends BaseServiceImpl resultDTOResult = govIssueOpenFeignClient.getCategoryTagList(categoryTag); - if (!resultDTOResult.success()) { - throw new RenException("项目立项,调用issue服务查询分类、标签基础信息失败"); + if (!resultDTOResult.success() || CollectionUtils.isEmpty(resultDTOResult.getData().getCategoryList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用issue服务查询分类基础信息失败", "分类信息查询异常"); } return resultDTOResult.getData(); } @@ -390,7 +429,7 @@ public class IcEventServiceImpl extends BaseServiceImpl effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode()); - log.info("delete userDemand result:{},eventId:{}", effectRow, id); + // log.info("delete userDemand result:{},eventId:{}", effectRow, id); + } else if(NumConstant.THREE_STR.equals(entity.getOperationType())){ + DelIssueFormDTO delIssueFormDTO = new DelIssueFormDTO(); + delIssueFormDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + delIssueFormDTO.setUserId(loginUserUtil.getLoginUserId()); + delIssueFormDTO.setIssueIds(Arrays.asList(entity.getOperationId())); + // 删除议题, 议题转了项目的,再单独去删除项目 + Result> delIssueRes = govIssueOpenFeignClient.deleteIssueInternal(delIssueFormDTO); + if(delIssueRes.success()&&!CollectionUtils.isEmpty(delIssueRes.getData())){ + // 议题被转了项目,需要删除项目 + SpringContextUtils.getBean(ProjectService.class).deleteByOriginId(delIssueRes.getData().get(0), ProjectOriginEnum.ISSUE.getCode()); + } } LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); wrapper.eq(IcEventEntity::getId,id).set(IcEventEntity::getUpdatedTime,new Date()) - .set(IcEventEntity::getCreatedBy,loginUserUtil.getLoginUserId()) + .set(IcEventEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) .set(IcEventEntity::getDelFlag,NumConstant.ONE_STR); baseDao.update(null,wrapper); + //把事件分类ic_event_category也删除了吧,以免后面数据分析用到这个表 + icEventCategoryService.delInsert(id,null); } } @@ -1048,58 +1105,58 @@ public class IcEventServiceImpl extends BaseServiceImpl list = baseDao.icEventList(formDTO); - if (!CollectionUtils.isEmpty(list)) { - resultDTO = list.get(0); - //查询网格名称(组织-网格) - List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); - Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); - List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); - Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); - - //事件管理字典表数据 - Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); - - //封装数据 - if (gridInfoMap.containsKey(resultDTO.getGridId())) { - resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); - } - if (StringUtils.isNotBlank(resultDTO.getSourceType())) { - resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); - } - //每个事件对应的图片数据 - if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ - List imageList = new ArrayList<>(); - List voiceList = new ArrayList<>(); - resultDTO.getAttachmentList().forEach(file -> { - if ("image".equals(file.getType())) { - imageList.add(file.getUrl()); - } else if ("voice".equals(file.getType())) { - voiceList.add(file); - } - }); - resultDTO.setImageList(imageList); - resultDTO.setVoiceList(voiceList); - } + if(CollectionUtils.isEmpty(list)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"事件不存在","事件已删除"); + } + resultDTO = list.get(0); + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + if (gridInfoMap.containsKey(resultDTO.getGridId())) { + resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); + } + if (StringUtils.isNotBlank(resultDTO.getSourceType())) { + resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + resultDTO.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file); + } + }); + resultDTO.setImageList(imageList); + resultDTO.setVoiceList(voiceList); + } - //分类信息 - if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ - List categoryList = new ArrayList<>(); - categoryList.add(resultDTO.getCategoryId()); - CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); - for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ - if (ca.getId().equals(resultDTO.getCategoryId())) { - resultDTO.setParentCategoryId(ca.getPid()); - resultDTO.setCategoryId(ca.getId()); - resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); - resultDTO.setCategoryCode(ca.getCategoryCode()); - resultDTO.setParentCategoryName(ca.getParentCategoryName()); - resultDTO.setCategoryName(ca.getCategoryName()); - } + //分类信息 + if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(resultDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(resultDTO.getCategoryId())) { + resultDTO.setParentCategoryId(ca.getPid()); + resultDTO.setCategoryId(ca.getId()); + resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); + resultDTO.setCategoryCode(ca.getCategoryCode()); + resultDTO.setParentCategoryName(ca.getParentCategoryName()); + resultDTO.setCategoryName(ca.getCategoryName()); } } } - return resultDTO; } @@ -1201,49 +1258,82 @@ public class IcEventServiceImpl extends BaseServiceImpl event = icEventReplyService.getByEventId(formDTO.getIcEventId()); - - //3.判断查询事件项目进展或需求进展信息 - //项目进展 + // operationType 0:已回复 1:已转项目 2:已转需求3:转议题 + //2.判断查询事件项目进展或需求进展信息或者议题进展 if ("1".equals(entity.getOperationType())) { + // 项目进展 ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); processListV2FormDTO.setProjectId(entity.getOperationId()); List project = projectTraceService.processListV2(processListV2FormDTO); List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); - projectList.forEach(p->p.setType("project")); + projectList.forEach(p -> p.setType("project")); resultList.addAll(projectList); - } - //需求进展 - if ("2".equals(entity.getOperationType())) { + } else if ("2".equals(entity.getOperationType())) { + // 需求进展 LinkedList demand = icEventOperationLogService.getByEventId(formDTO.getIcEventId()); resultList.addAll(demand); + } else if ("3".equals(entity.getOperationType())) { + // 议题处理进展 + IssueIdFormDTO issueIdFormDTO = new IssueIdFormDTO(); + issueIdFormDTO.setIssueId(entity.getOperationId()); + Result issueProcessRes = govIssueOpenFeignClient.queryIssueProcess(issueIdFormDTO); + if(!issueProcessRes.success()||CollectionUtils.isEmpty(issueProcessRes.getData().getProcessList())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件已转议题,议题处理进展查询异常", "事件已转议题,议题处理进展查询异常"); + } + IssueAdvanceResDTO issueAdvanceResDTO=issueProcessRes.getData(); + //如果议题已转项目,先放项目的处理进展 + if("shift_project".equals(issueAdvanceResDTO.getIssueStatus())){ + //根据议题id查询项目 + List projectEntityList=SpringContextUtils.getBean(ProjectService.class).getByOriginId(issueAdvanceResDTO.getIssueId()); + if(!CollectionUtils.isEmpty(projectEntityList)){ + // 项目进展 + ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); + processListV2FormDTO.setProjectId(projectEntityList.get(0).getId()); + List project = projectTraceService.processListV2(processListV2FormDTO); + List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); + projectList.forEach(p -> p.setType("project")); + resultList.addAll(projectList); + } + } + for(ProcessListResultDTOBak issueProcess:issueAdvanceResDTO.getProcessList()){ + IcEventProcessListResultDTO eventProcess=new IcEventProcessListResultDTO(); + eventProcess.setDepartmentName(issueProcess.getDepartmentName()); + eventProcess.setProcessId(issueProcess.getProcessId()); + eventProcess.setProcessName(issueProcess.getProcessName()); + eventProcess.setProcessTime(issueProcess.getProcessTime()); + eventProcess.setPublicReply(issueProcess.getProgressDesc()); + eventProcess.setIssueId(issueAdvanceResDTO.getIssueId()); + eventProcess.setType(issueProcess.getType()); + resultList.add(eventProcess); + } } + //最后拼上回复的!!!!!!!!!!!! + //3.查询事件回复信息 + LinkedList event = icEventReplyService.getByEventId(formDTO.getIcEventId()); resultList.addAll(event); - return resultList; } /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ @Override public void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { //1.查询事件数据 IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); if (null == entity || "closed_case".equals(entity.getStatus())) { - logger.error(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); + logger.warn(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在或已办结不允许修改"); } //2.修改事件数据 entity.setStatus("closed_case"); - entity.setCloseCaseTime(new Date()); - entity.setLatestOperatedTime(new Date()); + entity.setCloseCaseTime(formDTO.getCloseCaseTime()); + entity.setLatestOperatedTime(formDTO.getCloseCaseTime()); entity.setDifficultPoint("0"); baseDao.updateById(entity); @@ -1255,7 +1345,31 @@ public class IcEventServiceImpl extends BaseServiceImpl + // AND ie.REPORT_USER_ID = #{userId} + // List list=baseDao.selectMyReport(formDTO); + if(CollectionUtils.isEmpty(list)){ + return null; + } if (!CollectionUtils.isEmpty(list)) { //封装数据 for (MyReportIcEvResDTO dto : list) { @@ -1672,4 +1792,94 @@ public class IcEventServiceImpl extends BaseServiceImpl(pageInfo.getList(), pageInfo.getTotal()); } + /** + * 事件转议题 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void icEventToIssue(IcEventToIssueFormDTO formDTO) { + //校验下数据 + IcEventEntity icEventEntity=baseDao.selectById(formDTO.getIcEventId()); + if (null == icEventEntity || !"processing".equals(icEventEntity.getStatus())) { + log.error(String.format("事件不存在icEventId:%s",formDTO.getIcEventId())); + return; + } + //查询分类信息 + List categoryIdList = formDTO.getCategoryList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList); + Date nowTime = new Date(); + //调用issue服务转议题 + PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO(); + issueFormDTO.setIssueStatus("voting"); + issueFormDTO.setAddress(icEventEntity.getAddress()); + issueFormDTO.setLatitude(icEventEntity.getLatitude()); + issueFormDTO.setLongitude(icEventEntity.getLongitude()); + issueFormDTO.setIssueTitle(formDTO.getIssueTitle()); + issueFormDTO.setSuggestion(formDTO.getSuggestion()); + issueFormDTO.setGridId(icEventEntity.getGridId()); + issueFormDTO.setOrgId(icEventEntity.getAgencyId()); + issueFormDTO.setOrgIdPath(icEventEntity.getGridPids()); + issueFormDTO.setSourceType("ic_event"); + issueFormDTO.setSourceId(icEventEntity.getId()); + issueFormDTO.setCustomerId(formDTO.getCustomerId()); + issueFormDTO.setCreatedBy(formDTO.getCurrentUserId()); + issueFormDTO.setUpdatedBy(formDTO.getCurrentUserId()); + issueFormDTO.setCreatedTime(nowTime); + issueFormDTO.setUpdatedTime(nowTime); + issueFormDTO.setDecidedTime(nowTime); + issueFormDTO.setEventReportUserName(icEventEntity.getName()); + Result issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); + if (!issueRes.success() || null == issueRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); + } + //校验通过之后..... + //1、修改事件相关信息 + icEventEntity.setOperationType(formDTO.getOperationType()); + icEventEntity.setOperationId(issueRes.getData().getIssueId()); + if("0".equals(icEventEntity.getSourceType())){ + //来源于随手拍的,居民端需要显示红点 + icEventEntity.setRedDot(NumConstant.ONE); + } + icEventEntity.setLatestOperatedTime(nowTime); + icEventEntity.setUpdatedTime(nowTime); + baseDao.updateById(icEventEntity); + //2、插入事件分类表 ic_event_category + //分类全删全增吧 + List categoryEntities=new ArrayList<>(); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + IcEventCategoryEntity icEventCategoryEntity=new IcEventCategoryEntity(); + icEventCategoryEntity.setCustomerId(formDTO.getCustomerId()); + icEventCategoryEntity.setIcEventId(formDTO.getIcEventId()); + icEventCategoryEntity.setCategoryId(ca.getId()); + icEventCategoryEntity.setCategoryPids(ca.getPids()); + icEventCategoryEntity.setCategoryCode(ca.getCategoryCode()); + categoryEntities.add(icEventCategoryEntity); + } + icEventCategoryService.delInsert(formDTO.getIcEventId(),categoryEntities); + //3、插入操作日志表 ic_event_operation_log + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setIcEventId(formDTO.getIcEventId()); + logEntity.setUserId(formDTO.getCurrentUserId()); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode("shift_to_issue"); + logEntity.setActionDesc("转议题"); + logEntity.setOperateTime(nowTime); + icEventOperationLogService.insert(logEntity); + } + + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @Override + public List batchSelectById(List icEventIds) { + Listlist=baseDao.selectBatchIds(icEventIds); + return ConvertUtils.sourceToTarget(list,IcEventDTO.class); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java index 91d609d8e2..4caf803355 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -244,4 +245,20 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(ProjectCategoryEntity::getProjectId, projectId) + .set(ProjectCategoryEntity::getUpdatedTime,delTime) + .set(ProjectCategoryEntity::getUpdatedBy,userId) + .set(ProjectCategoryEntity::getDelFlag,NumConstant.ONE_STR); + return baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index b8b01aa5b9..4ab41b17a6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -725,7 +725,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl issueIds = new ArrayList<>(); + issueIds.add(projectEntity.getOriginId()); + Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); + if (issueRes.success() && CollectionUtils.isNotEmpty(issueRes.getData())) { + IssueProfileDTO issueProfileDTO = issueRes.getData().get(NumConstant.ZERO); + if ("ic_event".equals(issueProfileDTO.getIssueSourceType())) { + icEventFlag = true; + icEventId = issueProfileDTO.getSourceId(); + } + } + } else if ("ic_event".equals(projectEntity.getOrigin())) { + icEventId = projectEntity.getOriginId(); + } + if ("ic_event".equals(projectEntity.getOrigin()) || icEventFlag) { ColseProjectOrDemandFormDTO dto = new ColseProjectOrDemandFormDTO(); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setUserId(fromDTO.getUserId()); - dto.setIcEventId(projectEntity.getOriginId()); + dto.setCustomerId(projectEntity.getCustomerId()); + dto.setUserId(userId); + dto.setIcEventId(icEventId); dto.setType("project"); + dto.setCloseCaseTime(closeCaseTime); icEventService.closeProjectOrDemand(dto); } - //2022-5-19 sun end - } @Override @@ -1185,9 +1221,15 @@ public class ProjectServiceImpl extends BaseServiceImpl list = new ArrayList<>(); - ProjectRelatedPersonnelEntity entity1 = new ProjectRelatedPersonnelEntity(); - entity1.setCustomerId(issueDTO.getCustomerId()); - entity1.setProjectId(projectEntity.getId()); - entity1.setApp(AppClientConstant.APP_RESI); - entity1.setGridId(issueDTO.getGridId()); - entity1.setUserId(formDTO.getTopicDTO().getCreatedBy()); - entity1.setSourceType(AppClientConstant.TOPIC); - entity1.setSourceId(formDTO.getTopicDTO().getId()); - ProjectRelatedPersonnelEntity entity2 = ConvertUtils.sourceToTarget(entity1,ProjectRelatedPersonnelEntity.class); - entity2.setUserId(issueDTO.getCreatedBy()); - entity2.setSourceType(AppClientConstant.ISSUE); - entity2.setSourceId(issueDTO.getId()); - list.add(entity1); - list.add(entity2); + if("resi_topic".equals(formDTO.getIssueDTO().getSourceType())){ + //话题 + ProjectRelatedPersonnelEntity topic = new ProjectRelatedPersonnelEntity(); + topic.setCustomerId(issueDTO.getCustomerId()); + topic.setProjectId(projectEntity.getId()); + topic.setApp(AppClientConstant.APP_RESI); + topic.setGridId(issueDTO.getGridId()); + topic.setUserId(formDTO.getTopicDTO().getCreatedBy()); + topic.setSourceType(AppClientConstant.TOPIC); + topic.setSourceId(formDTO.getTopicDTO().getId()); + list.add(topic); + //议题 + ProjectRelatedPersonnelEntity issue = ConvertUtils.sourceToTarget(topic,ProjectRelatedPersonnelEntity.class); + issue.setUserId(issueDTO.getCreatedBy()); + issue.setSourceType(AppClientConstant.ISSUE); + issue.setSourceId(issueDTO.getId()); + list.add(issue); + }else{ + //只插入议题 + ProjectRelatedPersonnelEntity issue = new ProjectRelatedPersonnelEntity(); + issue.setCustomerId(issueDTO.getCustomerId()); + issue.setProjectId(projectEntity.getId()); + issue.setApp(AppClientConstant.APP_RESI); + issue.setGridId(issueDTO.getGridId()); + issue.setUserId(formDTO.getIssueDTO().getCreatedBy()); + issue.setSourceType(AppClientConstant.ISSUE); + issue.setSourceId(formDTO.getIssueDTO().getId()); + list.add(issue); + } projectRelatedPersonnelService.insertBatch(list); //项目分类和标签表初始数据 @@ -2219,7 +2276,7 @@ public class ProjectServiceImpl extends BaseServiceImpl(), null); } catch (Exception e) { String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); - log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + log.warn("【项目流转】上链失败,错误信息:{}", errorMsg); } } @@ -2883,8 +2941,10 @@ public class ProjectServiceImpl extends BaseServiceImpl getPendingList(ShiftProjectListFromDTO fromDTO) { + // PageInfo result = + // PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGrid(fromDTO.getGridId())); PageInfo result = - PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGrid(fromDTO.getGridId())); + PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGridV2(fromDTO.getGridId())); if (CollectionUtils.isNotEmpty(result.getList())) { result.getList().forEach(item -> { ProjectDTO dto = new ProjectDTO(); @@ -2919,6 +2979,7 @@ public class ProjectServiceImpl extends BaseServiceImpl getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO) { + //来源于议题,已结案,无需解决的项目 return baseDao.selectUnResolvedListByGrid(fromDTO.getGridId()); } @@ -3563,16 +3624,31 @@ public class ProjectServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + /** + * 根据项目来源id, 删除项目主表,项目分类关系表 + * @param originId + * @param origin + * @return + */ + @Transactional(rollbackFor = Exception.class) @Override public Integer deleteByOriginId(String originId, String origin) { - LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); - wrapper.eq(ProjectEntity::getOriginId, originId) - .eq(ProjectEntity::getOrigin,origin) - .set(ProjectEntity::getUpdatedTime,new Date()) - .set(ProjectEntity::getCreatedBy,loginUserUtil.getLoginUserId()) - .set(ProjectEntity::getDelFlag,NumConstant.ONE_STR); - return baseDao.update(null, wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(ProjectEntity::getOriginId, originId) + .eq(ProjectEntity::getOrigin, origin); + ProjectEntity projectEntity = baseDao.selectOne(queryWrapper); + if (null != projectEntity) { + Date nowTime = new Date(); + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(ProjectEntity::getId, projectEntity.getId()) + .set(ProjectEntity::getUpdatedTime, nowTime) + .set(ProjectEntity::getUpdatedBy, loginUserUtil.getLoginUserId()) + .set(ProjectEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + projectCategoryService.delByProjectId(projectEntity.getId(), loginUserUtil.getLoginUserId(), nowTime); + return 1; + } + return 0; } - } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql new file mode 100644 index 0000000000..c372ca3cee --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql @@ -0,0 +1,6 @@ +ALTER TABLE ic_event MODIFY COLUMN `OPERATION_TYPE` CHAR ( 1 ) DEFAULT NULL COMMENT '0:已回复 1:已转项目 2:已转需求3:转议题'; +ALTER TABLE ic_event MODIFY COLUMN `OPERATION_ID` VARCHAR ( 32 ) DEFAULT NULL COMMENT '项目、需求ID、议题id'; + +alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;3、立项:shift_project;4、转需求:shift_demand5、办结:close_case;6、需求办结:close_demand;转议题:shift_to_issue;项目结案:project_closed;议题关闭:close_issue'; + +alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;2、撤回事件:recall;n3、复:reply;n4、立项:shift_project;5、转需求: shift_demand;6、办结:close_case;7、需求办结:close_demand;8、选择是否已解决:choose_resolve;9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;转议题:shift_to_issue;项目结案:project_closed;议题关闭:close_issue'; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml index afb3965750..a5343119cf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml @@ -17,5 +17,4 @@ del_flag = '0' AND ic_event_id = #{icEventId} - \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index b0d42f5b0e..bd7853c4e0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -170,7 +170,14 @@ ie.satisfaction, IF(ie.satisfaction = 'bad','不满意',IF (ie.satisfaction = 'good','基本满意',IF (ie.satisfaction = 'perfect','非常满意',''))) satisfactionName, ie.operation_type, - IF(ie.operation_type = '0','已回复',IF (ie.operation_type = '1','已转项目',IF (ie.operation_type = '2','已转需求',''))) operationTypeName, + ( + case when ie.operation_type = '0' then '已回复' + when ie.operation_type = '1' then '已转项目' + when ie.operation_type = '2' then '已转需求' + when ie.operation_type = '3' then '已转议题' + else '' + end + )as operationTypeName, ie.operation_id, ie.read_flag, ie.red_dot, diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 73c2f11384..b57ebeca72 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -336,18 +336,47 @@ AND a.ORIGIN = 'issue' ORDER BY a.CREATED_TIME DESC + + + + + + + + SELECT + ac.* + FROM + article_content ac + WHERE + ac.DEL_FLAG = '0' + AND ac.ID = #{articleId} + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml index 684910ea8d..1bd90e218e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml @@ -3,5 +3,9 @@ - + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml index c58c230891..2b2fcb4e3b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml @@ -35,5 +35,11 @@ ORDER BY GRID_ID - + + update article_publish_range r + set r.del_flag='1', + r.UPDATED_BY = #{operUserId}, + r.UPDATED_TIME = now() + where r.ARTICLE_ID = #{articleId} + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java index 01886698a8..47d9286b89 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java @@ -44,7 +44,7 @@ public class CustomerFootBarFormDTO { @NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class, DeleteFootbarsGroup.class }) private String id; - @NotBlank(message = "客户ID不能为空", groups = { CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class , DeleteFootbarsGroup.class}) + @NotBlank(message = "客户ID不能为空", groups = { ListFootBarGroup.class,CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class , DeleteFootbarsGroup.class}) private String customerId; // 哪一个端:gov,resi diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java index 8dcccb0eae..2d84f8cb13 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java @@ -21,4 +21,9 @@ public class ApplicationDetailFormDTO implements Serializable { */ @NotBlank(message = "issueApplicationId不能为空",groups = {ApplicationDetail.class}) private String issueApplicationId; + + /** + * 话题ID是否为空 + */ + private Boolean topicIdIsNull; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java index 67202ed3f6..5012954cf0 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java @@ -67,5 +67,5 @@ public class ResiTopicDetailResultDTO implements Serializable { private String longitude; private String latitude; - + private String issueId; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java index fa5e644cf3..3ff103a039 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java @@ -73,53 +73,42 @@ public class GroupIssueServiceImpl implements GroupIssueService { List userIds = new ArrayList<>(); ApplicationDetailResultDTO data = result.getData(); userIds.add(data.getUserId()); - TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); - userIds.add(topicInfoResultDTO.getTopicUserId()); - // 查询小组类别 - ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); - if (null == resiGroupEntity){ - throw new RenException("此小组信息不存在"); - } - List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); - if(CollectionUtils.isEmpty(userInfos)){ - throw new RenException("未查询到用户信息"); - } - userInfos.forEach(u -> { - if (u.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(u.getReleaseUserName()); - data.setIssuePublisherMobile(u.getMobile()); + //如果来源于话题 + if (StringUtils.isNotBlank(data.getTopicId())){ + TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); + userIds.add(topicInfoResultDTO.getTopicUserId()); + // 查询小组类别 + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); + if (null == resiGroupEntity){ + throw new RenException("此小组信息不存在"); } - if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); - topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); + if(CollectionUtils.isEmpty(userInfos)){ + throw new RenException("未查询到用户信息"); } - }); - /*Result> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - if (!listResult.success()){ - throw new RenException("查询话题创建者,议题创建者失败......"); - } - listResult.getData().forEach(user -> { - if (user.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - data.setIssuePublisherMobile(user.getMobile()); + userInfos.forEach(u -> { + if (u.getUserId().equals(data.getUserId())){ + data.setIssuePublisher(u.getReleaseUserName()); + data.setIssuePublisherMobile(u.getMobile()); + } + if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ + topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); + topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + } + }); + List gridIds = new ArrayList<>(); + gridIds.add(data.getGridId()); + Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (!gridListByGridIds.success()){ + throw new RenException("查询议题所属网格名称失败......"); } - if (user.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - topicInfoResultDTO.setTopicPublishMobile(user.getMobile()); - } - });*/ - List gridIds = new ArrayList<>(); - gridIds.add(data.getGridId()); - Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); - if (!gridListByGridIds.success()){ - throw new RenException("查询议题所属网格名称失败......"); + gridListByGridIds.getData().forEach(grid -> { + if (grid.getGridId().equals(data.getGridId())){ + data.setGridName(grid.getGridName()); + } + }); + data.setTopicInfo(topicInfoResultDTO); } - gridListByGridIds.getData().forEach(grid -> { - if (grid.getGridId().equals(data.getGridId())){ - data.setGridName(grid.getGridName()); - } - }); - data.setTopicInfo(topicInfoResultDTO); return ConvertUtils.sourceToTarget(data,ApplicationDetailCopyResultDTO.class); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 493d176a07..8c2d43f75f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -1272,6 +1272,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO) { + if(CollectionUtils.isEmpty(groupInfoFormDTO.getTopicIds())){ + return new ArrayList<>(); + } return baseDao.selectGroupInfo(groupInfoFormDTO.getTopicIds()); } @@ -1343,6 +1346,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl achievementList = new ArrayList<>(); //1.小组创建时间 ResiGroupEntity group = baseDao.selectById(formDTO.getGroupId()); + if (null == group) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "resi_group is null groupId:" + formDTO.getGroupId(), "小组不存在"); + } resultDTO.setCreatedDate(DateUtils.dateToTimestamp(group.getCreatedTime())); //2.即将完成的3个成就 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 1695aaba09..f1b5c1d79a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -67,7 +67,7 @@ public class ResiTopicController { @PostMapping("gettopicdetail") public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ ValidatorUtils.validateEntity(topicDetailFormDTO); - return topicService.getTopicDetail(tokenDto,topicDetailFormDTO.getTopicId()); + return topicService.getTopicDetail(topicDetailFormDTO.getTopicId()); } /** @@ -419,7 +419,7 @@ public class ResiTopicController { **/ @PostMapping(value = "topicattachmentlist") public Result topicAttachmentList(@RequestBody TopicAttachmentFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, TopicAttachmentFormDTO.TopicForm.class); + // ValidatorUtils.validateEntity(formDTO, TopicAttachmentFormDTO.TopicForm.class);//暂时不校验了,service里判断 return new Result().ok(topicService.topicAttachmentList(formDTO)); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index c6e8ea45db..10600d85bf 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -170,7 +170,7 @@ public interface ResiTopicService extends BaseService { * @Author wangc * @Date 2020.04.01 15:56 **/ - Result getTopicDetail(TokenDto tokenDto, String topicId); + Result getTopicDetail(String topicId); /** * @return List diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 244bec4d5d..1592aa0fe7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -34,8 +34,11 @@ import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.commons.tools.enums.EventEnum; 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.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -892,7 +895,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getTopicDetail(TokenDto tokenDto, String topicId) { + public Result getTopicDetail(String topicId) { //1.获取话题基本信息 ResiTopicEntity topicDetail = baseDao.selectById(topicId); if(null == topicDetail || !StringUtils.equals(topicDetail.getId(),topicId)){ @@ -909,11 +912,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); - if(gridInfoRes.success()&&null!=gridInfoRes.getData()){ - resultDTO.setGridName(gridInfoRes.getData().getGridNamePath()); + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(resiGroupEntity.getGridId()); + if(null!=gridInfoCache){ + resultDTO.setGridName(gridInfoCache.getGridNamePath()); } } //2.查询话题附件 @@ -1327,7 +1328,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getTopicDetailGov(String topicId) { - Result result = getTopicDetail(null,topicId); + Result result = getTopicDetail(topicId); if(result.success() && null != result.getData() && StringUtils.isNotBlank(result.getData().getTopicId())){ return new Result().ok(ConvertUtils.sourceToTarget(result.getData(),ResiTopicDetailResultDTO.class)); } @@ -1533,6 +1534,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); @@ -1622,7 +1626,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl topicDetailResult = - getTopicDetail(null,topicIdFormDTO.getTopicId()); + getTopicDetail(topicIdFormDTO.getTopicId()); if(topicDetailResult.success() && null != topicDetailResult.getData()){ ResiTopicShiftIssueInitResultDTO result = ConvertUtils.sourceToTarget(topicDetailResult.getData(),ResiTopicShiftIssueInitResultDTO.class); try { @@ -1713,7 +1717,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl list = resiTopicAttachmentDao.selectTopicAttachmentList(formDTO.getTopicId()); @@ -2477,13 +2486,13 @@ public class ResiTopicServiceImpl extends BaseServiceImpl topicImgs; + /** + * 话题语音-2022.10.10 + */ + private List topicVoices; + /** * 话题发表人(山东路168-尹女士) */ @@ -40,6 +45,9 @@ public class TopicInfoDTO implements Serializable { */ private Long publishedTime; + + private String releaseTime; + /** * 小组类型(ordinary:楼院小组 branch:支部小组) */ @@ -54,4 +62,5 @@ public class TopicInfoDTO implements Serializable { * 话题所属小组名称 */ private String groupName; + } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java index 9fe2c9f69c..58d12671de 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java @@ -16,5 +16,10 @@ public class IssueIdFormDTO implements Serializable { @NotBlank(message = "议题id不能为空") private String issueId; + /** + * 当 sourceType = issue 时,是直接创建议题,无需加入小组即可表决 + */ + private String sourceType = "resi_topic"; + } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index da7574183f..06d8a2aee5 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -56,4 +58,22 @@ public class ClosedIssueListResultDTO implements Serializable { private String topicContent; private String longitude; private String latitude; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java index 27478b1f63..8b9a00446d 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Author zxc @@ -79,4 +80,16 @@ public class IssueDetailResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftIssueTime; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + private String sourceId; + + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index e1360eb01b..8c20128bca 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Author zxc @@ -49,4 +50,15 @@ public class IssueResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftIssueTime; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + + private String sourceId; + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java index 7f81035bf1..33207f51f8 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java @@ -31,7 +31,7 @@ public class VoteResultDTO implements Serializable { /** * 是否加入小组 已加入:true,未加入:false */ - private Boolean voteAuthorization; + private Boolean voteAuthorization = true; /** * 支持:support 反对:oppose diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index 3b9bee2505..d92fb105ef 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -19,6 +21,10 @@ public class VotingIssueListResultDTO implements Serializable { * 议题发布时间 * */ private Long issuePublishTime; + /** + * 议题发布时间 + */ + private String issuePublishTimeStr; /** * 议题Id @@ -40,11 +46,22 @@ public class VotingIssueListResultDTO implements Serializable { */ private String sourceId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; + + //最开始 那一版,话题的东西,是放在下面这几列的,做事件转议题时, 单独出来了topicInfoDTO,icEventInfo /** * 话题图片列表 */ private List topicImgs; + /** + * 发布议题的图片 + */ + private List issueImgs; + /** * 话题语音 */ @@ -57,4 +74,13 @@ public class VotingIssueListResultDTO implements Serializable { private String longitude; private String latitude; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java index e3c06ede7a..881b45bb13 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.GovIssueFeignClient; import com.epmet.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -28,9 +27,6 @@ public class IssueController { @Autowired private IssueService issueService; - @Autowired - private GovIssueFeignClient govIssueFeignClient; - /** * @Description 议题详情 * @param issueDetail @@ -183,7 +179,7 @@ public class IssueController { } /** - * @Description 获取表决中议题列表 + * @Description 居民端议事厅-获取表决中议题列表 * @param issueListFormDTO * @return Result> * @author wangc @@ -198,7 +194,7 @@ public class IssueController { } /** - * @Description 获取关闭议题列表 + * @Description 获取关闭议题列表 居民端-议事-已处理-已关闭 * @param issueListFormDTO * @return Result> * @author wangc @@ -237,7 +233,7 @@ public class IssueController { } /** - * 处理中列表 + * 居民端议事厅-处理中列表 * @author zhaoqifeng * @date 2021/7/27 17:50 * @param fromDTO @@ -250,6 +246,7 @@ public class IssueController { /** * 已结案列表 + * 居民端议事厅-已处理-已结案列表:议题已转项目,且项目结案选择已解决 * @author zhaoqifeng * @date 2021/7/27 17:50 * @param fromDTO diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java index c75ab67fa8..d10e341a06 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java @@ -118,6 +118,11 @@ public interface IssueService { **/ PublishSuggestionResultDTO publisSuggestion(PublishSuggestionFormDTO formDTO); + /** + * 居民端议事厅-表决中议题列表 + * @param issueListFormDTO + * @return + */ List listVotingIssues(CommonIssueListFormDTO issueListFormDTO); /** @@ -129,7 +134,7 @@ public interface IssueService { List getClosedList(CommonIssueListFormDTO issueListFormDTO); /** - * 处理中项目列表 + * 居民端议事厅-处理中项目列表 * @author zhaoqifeng * @date 2021/7/26 17:46 * @param formDTO @@ -140,6 +145,7 @@ public interface IssueService { /** * 已结案项目列表 + * 居民端议事厅-已处理-已结案列表:议题已转项目,且项目结案选择已解决 * @author zhaoqifeng * @date 2021/7/27 15:51 * @param formDTO diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index fabcb5939e..8db95668b7 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -2,12 +2,17 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; +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.security.dto.TokenDto; 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.constat.HallConstat; +import com.epmet.dto.IcEventDTO; import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.TopicInfoDTO; import com.epmet.dto.form.*; @@ -28,6 +33,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -88,10 +94,10 @@ public class IssueServiceImpl implements IssueService { TopicInfoFormDTO topicInfoFormDTO = new TopicInfoFormDTO(); topicInfoFormDTO.setTopicId(issueResult.getTopicId()); TopicInfoDTO topicInfoDTOResult = new TopicInfoDTO(); - if (!StringUtils.isBlank(issueResult.getTopicId())) { + if (!StringUtils.isBlank(issueResult.getTopicId())&&"resi_topic".equals(issueResult.getSourceType())) { topicInfoDTOResult = resiGroupFeignClient.selectDetail(topicInfoFormDTO).getData(); - issueDetailResult.setTopicInfo(topicInfoDTOResult == null ? new TopicInfoDTO() : topicInfoDTOResult); } + issueDetailResult.setTopicInfo(topicInfoDTOResult == null ? new TopicInfoDTO() : topicInfoDTOResult); if (null != topicInfoDTOResult && "branch".equals(topicInfoDTOResult.getGroupType())) {//支部小组话题发起人显示真实姓名 List userIdList = new ArrayList<>(); @@ -211,25 +217,25 @@ public class IssueServiceImpl implements IssueService { GridIdFormDTO gridIdFormDTO = new GridIdFormDTO(); gridIdFormDTO.setGridId(gridId.getGridId()); gridIdFormDTO.setUserId(tokenDto.getUserId()); - Result checkJoinTeam = resiGroupFeignClient.checkjointeam(gridIdFormDTO); - if (!checkJoinTeam.success()){ - throw new RenException("查询校验用户是否加入小组失败"); - } - CheckJoinTeamResultDTO check = checkJoinTeam.getData(); - //未加入小组 - if (check.getVoteAuthorization()==false){ - voteResultDTOResult.setVoteFlag(false); - voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); - voteResultDTOResult.setOppositionCount(NumConstant.ZERO); - voteResultDTOResult.setSupportCount(NumConstant.ZERO); - }else { - Result voteResult = govIssueFeignClient.voteCount(issueId); - if (!voteResult.success()){ - throw new RenException("查询表决中议题详情——支持、反对数失败"); + if (issueId.getSourceType().equals("resi_topic")){ + Result checkJoinTeam = resiGroupFeignClient.checkjointeam(gridIdFormDTO); + if (!checkJoinTeam.success()){ + throw new RenException("查询校验用户是否加入小组失败"); + } + CheckJoinTeamResultDTO check = checkJoinTeam.getData(); + //未加入小组 + if (check.getVoteAuthorization()==false){ + voteResultDTOResult.setVoteFlag(false); + voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); + voteResultDTOResult.setOppositionCount(NumConstant.ZERO); + voteResultDTOResult.setSupportCount(NumConstant.ZERO); } - voteResultDTOResult = voteResult.getData(); - voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); } + Result voteResult = govIssueFeignClient.voteCount(issueId); + if (!voteResult.success()){ + throw new RenException("查询表决中议题详情——支持、反对数失败"); + } + voteResultDTOResult = voteResult.getData(); return voteResultDTOResult; } @@ -386,10 +392,10 @@ public class IssueServiceImpl implements IssueService { issueSuggestionDTO.setPublicFlag(formDTO.getPublicFlag() == true ? NumConstant.ONE : NumConstant.ZERO); issueSuggestionDTO.setCreatedBy(loginUserUtil.getLoginUserId()); Result result = govIssueOpenFeignClient.saveIssueSuggestion(issueSuggestionDTO); - if (result.success() && null != result.getData()) { - return new PublishSuggestionResultDTO(result.getData().getIssueId(), result.getData().getSuggestionId()); + if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getSuggestionId())){ + throw new EpmetException(result.getCode(),"gov-issue saveIssueSuggestion error:"+result.getInternalMsg(),result.getMsg()); } - throw new RenException(result.getCode()); + return new PublishSuggestionResultDTO(result.getData().getIssueId(), result.getData().getSuggestionId()); } /** @@ -402,31 +408,65 @@ public class IssueServiceImpl implements IssueService { return govIssueFeignClient.processList(issueId).getData(); } + /** + * 居民端议事厅-表决中议题列表 + * @param issueListFormDTO + * @return + */ @Override public List listVotingIssues(CommonIssueListFormDTO issueListFormDTO) { + //1、查询表决中的议题列表,issue.created_time降序 Result> votingIssueListResult = govIssueFeignClient.votingList(issueListFormDTO); if (!votingIssueListResult.success()) { throw new RenException(String.format("调用gov-issue查询表决中列表失败")); } List votingIssueList = votingIssueListResult.getData(); if (votingIssueList != null && !CollectionUtils.isEmpty(votingIssueList)) { - List topicIds = votingIssueList.stream().map(i -> i.getSourceId()).collect(Collectors.toList()); - TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); - form.setTopicIdList(topicIds); - Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { + // 来源于话题的 + List topicIds = votingIssueList.stream().filter(t -> t.getSourceType().equals("resi_topic")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(topicIds)) { + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); List topicDetails = topicDetailsResult.getData(); - HashMap rtm = convertTopicDetailList2Map(topicDetails); - votingIssueList.forEach(vi -> { - ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); - vi.setTopicImgs(rr == null ? null : rr.getTopicImgs()); - vi.setTopicVoices(rr == null ? null : rr.getTopicImgs()); - vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); - vi.setLongitude(rr == null ? "" : rr.getLongitude()); - vi.setLatitude(rr == null ? "" : rr.getLatitude()); - }); + if (!CollectionUtils.isEmpty(topicDetails)) { + HashMap rtm = convertTopicDetailList2Map(topicDetails); + votingIssueList.forEach(vi -> { + ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + vi.setTopicImgs(rr == null ? null : rr.getTopicImgs()); + vi.setTopicVoices(rr == null ? null : rr.getTopicImgs()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + vi.setLongitude(rr == null ? "" : rr.getLongitude()); + vi.setLatitude(rr == null ? "" : rr.getLatitude()); + // 赋值话题详情 + if(null!=rr){ + TopicInfoComDTO topicInfoDTO=new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } + }); + } + } + // 来源于事件的 + List icEventIds = votingIssueList.stream().filter(t -> t.getSourceType().equals("ic_event")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getId, o -> o, (o1, o2) -> o1)); + votingIssueList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getSourceId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } } } return votingIssueList; @@ -444,6 +484,21 @@ public class IssueServiceImpl implements IssueService { return hm; } + /** + * 议题id作为key + * @param topicDetails + * @return + */ + private HashMap convertTopicDetailList2MapV2(List topicDetails) { + HashMap hm = new HashMap<>(); + topicDetails.stream().forEach(t -> { + if(StringUtils.isNotBlank(t.getIssueId())){ + hm.put(t.getIssueId(), t); + } + }); + return hm; + } + @Override public List getClosedList(CommonIssueListFormDTO issueListFormDTO) { Result> result = govIssueFeignClient.closedList(issueListFormDTO); @@ -454,9 +509,7 @@ public class IssueServiceImpl implements IssueService { TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); form.setTopicIdList(topicIds); Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { + if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); issueList.forEach(vi -> { @@ -466,15 +519,42 @@ public class IssueServiceImpl implements IssueService { vi.setTopicContent(rr == null ? "" :rr.getTopicContent()); vi.setLongitude(rr == null ? "" : rr.getLongitude()); vi.setLatitude(rr == null ? "" : rr.getLatitude()); + // 赋值话题详情 + if(null!=rr){ + TopicInfoComDTO topicInfoDTO=new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } }); } + // 来源于事件的 + List icEventIds = issueList.stream().filter(t -> t.getSourceType().equals("ic_event")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getId, o -> o, (o1, o2) -> o1)); + issueList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getSourceId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } + } } return issueList; } /** - * 处理中项目列表 + * 居民端议事厅-处理中项目列表 * * @param formDTO * @return java.util.List @@ -483,36 +563,93 @@ public class IssueServiceImpl implements IssueService { */ @Override public List getProcessing(ShiftProjectListFromDTO formDTO) { - List resultList = govProjectOpenFeignClient.getPendingList(formDTO).getData(); + //1、查询由议题转的项目,且正在处理中的 + Result> projectRes=govProjectOpenFeignClient.getPendingList(formDTO); + if(!projectRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + List resultList =projectRes.getData(); if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { return new ArrayList<>(); } - - List topicIds = resultList.stream().map(PendingResultDTO::getSourceId).collect(Collectors.toList()); - TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); - form.setTopicIdList(topicIds); - Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { - List topicDetails = topicDetailsResult.getData(); - HashMap rtm = convertTopicDetailList2Map(topicDetails); + // 话题信息 + HashMap rtm=new HashMap<>(); + // 议题信息 + //2、根据议题id查询话题id + List issueIds = resultList.stream().map(PendingResultDTO::getIssueId).collect(Collectors.toList()); + // 根据议题id查询话题id + Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); + + if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { + // 3.1、如果存在议题来源于话题 + List topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(topicIds)) { + // 3.1 查询话题详情 + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { + List topicDetails = topicDetailsResult.getData(); + topicDetails.stream().forEach(t -> { + if(StringUtils.isNotBlank(t.getIssueId())){ + rtm.put(t.getIssueId(), t); + } + }); + } + } + //3.2 如果存在议题来源于事件 + List icEventIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("ic_event")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + //key:议题id;value:事件信息 + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getOperationId, o -> o, (o1, o2) -> o1)); + resultList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getIssueId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event,IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } + } + Map issueMap=issueRes.getData().stream().collect(Collectors.toMap(IssueProfileDTO::getIssueId, o -> o, (o1, o2) -> o1)); + // 赋值话题信息、议题来源、议题图片 resultList.forEach(vi -> { - ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); - vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); - vi.setLongitude(rr == null ? "" : rr.getLongitude()); - vi.setLatitude(rr == null ? "" : rr.getLatitude()); + vi.setTopicContent(rr == null ? StrConstant.EPMETY_STR : rr.getTopicContent()); + vi.setLongitude(rr == null ? StrConstant.EPMETY_STR : rr.getLongitude()); + vi.setLatitude(rr == null ? StrConstant.EPMETY_STR : rr.getLatitude()); + vi.setTopicId(null == rr ? StrConstant.EPMETY_STR : rr.getTopicId()); + // 赋值话题详情 + if (null != rr) { + TopicInfoComDTO topicInfoDTO = new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } + IssueProfileDTO issue = issueMap.get(vi.getIssueId()); + vi.setIssueSourceType(null != issue ? issue.getIssueSourceType() : StrConstant.EPMETY_STR); + vi.setIssueImgs(null != issue ? issue.getIssueImgs() : new ArrayList<>()); + if(StringUtils.isBlank(vi.getLatitude())||StringUtils.isBlank(vi.getLongitude())){ + vi.setLatitude(issue.getLatitude()); + vi.setLongitude(issue.getLongitude()); + } }); } - return resultList; } /** - * 已结案项目列表 - * + * 居民端议事-已处理-已结案项目列表 + * 居民端议事厅-已处理-已结案列表:议题已转项目,且项目结案选择已解决 * @param formDTO * @return java.util.List * @author zhaoqifeng @@ -520,36 +657,99 @@ public class IssueServiceImpl implements IssueService { */ @Override public List getClosedProjectList(ShiftProjectListFromDTO formDTO) { - List resultList = govProjectOpenFeignClient.getResolvedList(formDTO).getData(); + //查询项目(来源于议题的)已结案已解决的 + Result> projectRes=govProjectOpenFeignClient.getResolvedList(formDTO); + if(!projectRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + List resultList = projectRes.getData(); if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { return new ArrayList<>(); } - List topicIds = resultList.stream().map(ResolvedResultDTO::getSourceId).collect(Collectors.toList()); - TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); - form.setTopicIdList(topicIds); - Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { - List topicDetails = topicDetailsResult.getData(); - HashMap rtm = convertTopicDetailList2Map(topicDetails); + // 话题信息 + HashMap rtm=new HashMap<>(); + // 议题信息 + //2、根据议题id查询话题id + List issueIds = resultList.stream().map(ResolvedResultDTO::getIssueId).collect(Collectors.toList()); + // 根据议题id查询话题id + Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); + + if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { + // 3.1、如果存在议题来源于话题 + List topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(topicIds)) { + // 3.1 查询话题详情 + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { + List topicDetails = topicDetailsResult.getData(); + topicDetails.stream().forEach(t -> { + if(StringUtils.isNotBlank(t.getIssueId())){ + rtm.put(t.getIssueId(), t); + } + }); + } + } + //3.2 如果存在议题来源于事件 + List icEventIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("ic_event")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !CollectionUtils.isEmpty(eventInfoRes.getData())) { + //key:议题id;value:事件信息 + Map eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getOperationId, o -> o, (o1, o2) -> o1)); + resultList.forEach(vi -> { + IcEventDTO event = eventMap.get(vi.getIssueId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event,IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } + } + Map issueMap=issueRes.getData().stream().collect(Collectors.toMap(IssueProfileDTO::getIssueId, o -> o, (o1, o2) -> o1)); + // 赋值话题信息、议题来源、议题图片 resultList.forEach(vi -> { - ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); - vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); - vi.setLongitude(rr == null ? "" : rr.getLongitude()); - vi.setLatitude(rr == null ? "" : rr.getLatitude()); + vi.setTopicContent(rr == null ? StrConstant.EPMETY_STR : rr.getTopicContent()); + vi.setLongitude(rr == null ? StrConstant.EPMETY_STR : rr.getLongitude()); + vi.setLatitude(rr == null ? StrConstant.EPMETY_STR : rr.getLatitude()); + vi.setTopicId(null == rr ? StrConstant.EPMETY_STR : rr.getTopicId()); + // 赋值话题详情 + if (null != rr) { + TopicInfoComDTO topicInfoDTO = new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } + IssueProfileDTO issue = issueMap.get(vi.getIssueId()); + vi.setIssueSourceType(null != issue ? issue.getIssueSourceType() : StrConstant.EPMETY_STR); + vi.setIssueImgs(null != issue ? issue.getIssueImgs() : new ArrayList<>()); + if(StringUtils.isBlank(vi.getLatitude())||StringUtils.isBlank(vi.getLongitude())){ + vi.setLatitude(issue.getLatitude()); + vi.setLongitude(issue.getLongitude()); + } }); } - return resultList; } /** * 无需解决项目议题列表 - * + * 1、表决中:议题 + * 2、处理中:已转项目的议题,项目未结案的; + * 3、已处理: + * 3.1、已结案:议题已转项目,且项目结案选择已解决 + * 3.2、已关闭:议题关闭且选择的是已解决 + * 3.3、无需解决:议题关闭无需解决+议题已转项目无需解决 ❤ * @param formDTO * @return java.util.List * @author zhaoqifeng @@ -561,14 +761,12 @@ public class IssueServiceImpl implements IssueService { if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { return new ArrayList<>(); } - - List topicIds = resultList.stream().map(UnResolvedResultDTO::getSourceId).collect(Collectors.toList()); + //补充话题信息 + List topicIds = resultList.stream().map(UnResolvedResultDTO::getTopicId).collect(Collectors.toList()); TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); form.setTopicIdList(topicIds); Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (!topicDetailsResult.success()) { - logger.error("调用resi-group批量查询详情失败"); - } else { + if (topicDetailsResult.success()) { List topicDetails = topicDetailsResult.getData(); HashMap rtm = convertTopicDetailList2Map(topicDetails); resultList.forEach(vi -> { @@ -578,9 +776,19 @@ public class IssueServiceImpl implements IssueService { vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); vi.setLongitude(rr == null ? "" : rr.getLongitude()); vi.setLatitude(rr == null ? "" : rr.getLatitude()); + // 赋值话题详情 + if(null!=rr){ + TopicInfoComDTO topicInfoDTO=new TopicInfoComDTO(); + topicInfoDTO.setTopicId(rr.getTopicId()); + topicInfoDTO.setTopicContent(rr.getTopicContent()); + topicInfoDTO.setTopicImgs(rr.getTopicImgs()); + topicInfoDTO.setTopicVoices(rr.getTopicVoices()); + topicInfoDTO.setPublishedUser(rr.getReleaseUserName()); + topicInfoDTO.setReleaseTime(rr.getReleaseTime()); + vi.setTopicInfo(topicInfoDTO); + } }); } - return resultList; } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index f4fbf8f8ce..7dd49f2afc 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -188,11 +188,17 @@ public class IssueServiceImpl implements IssueService { } //查询话题来源小组名称 Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + if (!CollectionUtils.isEmpty(topicIds)){ + groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + } if (!groupNameList.success()){ logger.error("查询议题来源小组名称失败......"); } //查询项目基本信息 - Result> projectRes=govProjectOpenFeignClient.queryProjectInfoByIds(projectIds); + Result> projectRes = new Result<>(); + if (!CollectionUtils.isEmpty(projectIds)){ + projectRes = govProjectOpenFeignClient.queryProjectInfoByIds(projectIds); + } if(!projectRes.success()){ logger.error("查询项目信息失败......"); } @@ -201,14 +207,21 @@ public class IssueServiceImpl implements IssueService { MyPubIssuesShiftProjectResultDTO resultDTO=new MyPubIssuesShiftProjectResultDTO(); resultDTO.setIssueId(issueDTO.getId()); resultDTO.setProjectId(issueDTO.getProjectId()); - gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); - groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + resultDTO.setSourceId(issueDTO.getSourceId()); + resultDTO.setSourceType(issueDTO.getSourceType()); + if (!CollectionUtils.isEmpty(gridNameList.getData())){ + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); + } + if (!CollectionUtils.isEmpty(groupNameList.getData())){ + groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + } resultDTO.setShiftProjectTime(issueDTO.getShiftedTimeStamp()); - - projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setProjectTitle(projectDTO.getTitle())); - //当前处理部门名称列表 - projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setDepartmentNameList(projectDTO.getCurrentDepartmentNameList())); + if (!CollectionUtils.isEmpty(projectRes.getData())){ + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setProjectTitle(projectDTO.getTitle())); + //当前处理部门名称列表 + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setDepartmentNameList(projectDTO.getCurrentDepartmentNameList())); + } list.add(resultDTO); } return list; @@ -243,9 +256,12 @@ public class IssueServiceImpl implements IssueService { logger.error("查询议题来源网格名称失败......"); } //查询话题来源小组名称 - Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); - if (!groupNameList.success()){ - logger.error("查询议题来源小组名称失败......"); + List groupInfoResultDTOS=new ArrayList<>(); + if (!CollectionUtils.isEmpty(topicIds)){ + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + if (groupNameList.success()&&!CollectionUtils.isEmpty(groupNameList.getData())){ + groupInfoResultDTOS=groupNameList.getData(); + } } List resultDTOList=new ArrayList<>(); for(IssueDTO issueDTO:issueResult.getData()){ @@ -254,8 +270,14 @@ public class IssueServiceImpl implements IssueService { resultDTO.setIssueTitle(issueDTO.getIssueTitle()); resultDTO.setSuggestion(issueDTO.getSuggestion()); resultDTO.setClosedTime(issueDTO.getClosedTimeStamp()); - gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); - groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + resultDTO.setSourceId(issueDTO.getSourceId()); + resultDTO.setSourceType(issueDTO.getSourceType()); + if (!CollectionUtils.isEmpty(gridNameList.getData())){ + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); + } + if (!CollectionUtils.isEmpty(groupInfoResultDTOS)){ + groupInfoResultDTOS.stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + } resultDTOList.add(resultDTO); } return resultDTOList; diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java index a2cda91a24..6e567e606a 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartymemberStyleDTO.java @@ -19,6 +19,7 @@ package com.epmet.resi.partymember.dto.partymember; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; import java.util.List; @@ -34,10 +35,11 @@ import java.util.List; public class IcPartymemberStyleDTO implements Serializable { private static final long serialVersionUID = 1L; - + public interface DetailGroup {} /** - * 楼栋主键 + * 主键 */ + @NotBlank(message = "党员风采主键不能为空",groups = DetailGroup.class) private String id; /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java index ef2469b7b0..786f22d542 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java @@ -84,6 +84,7 @@ public class IcPartymemberStyleController { @PostMapping("detail") public Result get(@RequestBody IcPartymemberStyleDTO dto) { + ValidatorUtils.validateEntity(dto,IcPartymemberStyleDTO.DetailGroup.class); IcPartymemberStyleDTO data = icPartymemberStyleService.get(dto.getId()); return new Result().ok(data); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java index d277201298..435038822f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java @@ -156,6 +156,9 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl memberList; private String orgIdPath; + + private List orgIdPathList; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java index 4cd9156ea1..147bcad3ee 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java @@ -67,6 +67,12 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab * 结束日期 */ private String endDate; + + /** + * 核酸检测开始、结束时间 eg:2022-10-10 + */ + private String natStartDate; + private String natEndDate; /** * 疫苗接种次数 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/yqfk/IcNatCompareRecordPageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/yqfk/IcNatCompareRecordPageFormDTO.java index c5f6ddd53e..101b9c07d2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/yqfk/IcNatCompareRecordPageFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/yqfk/IcNatCompareRecordPageFormDTO.java @@ -38,5 +38,20 @@ public class IcNatCompareRecordPageFormDTO extends PageFormDTO { private String customerId; private String userId; private String agencyId; + /** + * 采样日期:yyyyMMdd + */ + private String cyDate; + + /** + * 检测时间 + */ + private String natDate; + /** + * 1:已检测 + * 0:未检测 + */ + private String natStatus; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java index ee3f03e5e9..a93294b14f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -89,6 +89,12 @@ public class NatListResultDTO implements Serializable { @ExcelIgnore private String isResiUser; + /** + * 是否本辖区居民(0:否 1:是) + */ + @ExcelIgnore + private String isLocalResiUser; + /** * 检测地点 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OrgInfoIdAndNameResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OrgInfoIdAndNameResultDTO.java new file mode 100644 index 0000000000..53223ed6ad --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OrgInfoIdAndNameResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/11 13:41 + * @DESC + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OrgInfoIdAndNameResultDTO implements Serializable { + + private static final long serialVersionUID = 7478605833438304330L; + + private String id; + private String name; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RelationAndNatResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RelationAndNatResultDTO.java new file mode 100644 index 0000000000..cc3da4c846 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RelationAndNatResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/25 09:37 + */ +@Data +public class RelationAndNatResultDTO implements Serializable { + private static final long serialVersionUID = 5245015978083295931L; + + private String relationId; + private String natId; + private String staffAgencyIdPath; + private String idCard; + + /** + * 默认不是本辖区居民 + */ + private String isLocalResiUser = NumConstant.ZERO_STR; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiAndLocalResiResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiAndLocalResiResultDTO.java new file mode 100644 index 0000000000..d03e83d124 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiAndLocalResiResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/24 16:09 + */ +@Data +public class ResiAndLocalResiResultDTO implements Serializable { + private static final long serialVersionUID = -7702043408016900850L; + + private Integer isLocal; + private Integer isResi; + + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 1a61d61a3c..9abd3a1073 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -924,4 +924,23 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/dataSyncConfig/natInfoScanTask") Result natInfoScanTask(@RequestBody DataSyncTaskParam formDTO); + + /** + * Desc: 客户下所有工作人员放缓存 + * @param customerId + * @author zxc + * @date 2022/10/19 14:07 + */ + @PostMapping("/epmetuser/customerstaff/allCustomerStaffInCache") + Result allCustomerStaffInCache(@RequestParam("customerId")String customerId); + + + /** + * Desc: 根据网格ID查询所有注册居民 + * @param formDTO + * @author zxc + * @date 2022/10/8 10:41 + */ + @PostMapping("/epmetuser/registerrelation/getAllResiByGrid") + Result getAllResiByGrid(@RequestBody AllResiByGridFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 630e838db7..2e198c04d9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -716,4 +716,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result natInfoScanTask(DataSyncTaskParam formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "natInfoScanTask", formDTO); } + + @Override + public Result allCustomerStaffInCache(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "allCustomerStaffInCache", customerId); + } + + @Override + public Result getAllResiByGrid(AllResiByGridFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getAllResiByGrid", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 6c9d46dbb5..8bea2e4fbf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -618,5 +618,16 @@ public class CustomerStaffController { return new Result>().ok(customerStaffService.customerStaff(formDTO)); } + /** + * Desc: 客户下所有工作人员放缓存 + * @param customerId + * @author zxc + * @date 2022/10/19 14:07 + */ + @PostMapping("allCustomerStaffInCache") + public Result allCustomerStaffInCache(@RequestParam("customerId")String customerId){ + customerStaffService.allCustomerStaffInCache(customerId); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java index 3fd2bd60fc..695a739b89 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java @@ -33,6 +33,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; /** @@ -67,6 +69,13 @@ public class IcEpidemicPreventionController{ return new Result>().ok(result); } + @PostMapping("epidemicPreventionExport") + public void epidemicPreventionExport(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + icResiUserService.epidemicPreventionExport(formDTO,response); + } + @PostMapping("user-list") public Result> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatCompareRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatCompareRecordController.java index aa611e8252..8c1c245fde 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatCompareRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatCompareRecordController.java @@ -27,6 +27,7 @@ import com.epmet.service.IcNatCompareRecordService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; @@ -61,6 +62,7 @@ public class IcNatCompareRecordController implements ResultDataResolver { /** * 未做核酸比对-分页查询 + * http://yapi.elinkservice.cn/project/245/interface/api/8129 * @param tokenDto * @param formDTO * @return @@ -68,6 +70,9 @@ public class IcNatCompareRecordController implements ResultDataResolver { @RequestMapping("page") @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcNatCompareRecordPageFormDTO formDTO){ + if (StringUtils.isNotBlank(formDTO.getNatDate()) && StringUtils.isBlank(formDTO.getNatStatus())) { + formDTO.setNatStatus(NumConstant.ONE_STR); + } formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); PageData page = icNatCompareRecordService.page(formDTO); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index bcb2a2d134..00fa15ae2e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -314,5 +314,18 @@ public class IcNatController implements ResultDataResolver { } } + /** + * 需求原描述:http://zentao.elinkservice.cn/story-view-709.html + * 3、核酸检测信息页面,本辖区居民选项,查询是都是居民信息里居民,现在的是否意思是你点新增的时候,是从居民信息里选的,还是你手动录入的 + * 无论是导入、新增、定时任务拉取 + * 根据身份证号取居民信息表数,如果agencyId与当前操作用户所属组织id一致,那说明就是他组织下的 本辖区居民 + * 上线后需要此接口:/epmetuser/icNat/initNatLocal + * @return + */ + @PostMapping("initNatLocal") + public Result initNatLocal(){ + icNucleinService.initNatLocal(); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java index 8f0322f02e..d801a5e6e9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RegisterRelationController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.RegisterRelationDTO; +import com.epmet.dto.form.AllResiByGridFormDTO; import com.epmet.dto.form.EnterGridFormDTO; import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; import com.epmet.excel.RegisterRelationExcel; @@ -107,4 +108,16 @@ public class RegisterRelationController { return registerRelationService.getUserInfoAndRoles(enterGridFormDTO); } + + /** + * Desc: 根据网格ID查询所有注册居民 + * @param formDTO + * @author zxc + * @date 2022/10/8 10:41 + */ + @PostMapping("getAllResiByGrid") + public Result getAllResiByGrid(@RequestBody AllResiByGridFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AllResiByGridFormDTO.AllResiByGridForm.class); + return new Result().ok(registerRelationService.getAllResiByGrid(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 1c127d7aa5..682c279996 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -251,5 +251,7 @@ public interface CustomerStaffDao extends BaseDao { List getStaffByCustomerId(@Param("customerId") String customerId); + List getAllStaffByCustomerId(@Param("customerId") String customerId); + void edit(CustomerStaffDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index f21ec91eb3..7b8b0a0ab7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -6,7 +6,9 @@ import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; import com.epmet.dto.result.NatUserInfoResultDTO; +import com.epmet.dto.result.RelationAndNatResultDTO; import com.epmet.entity.IcNatEntity; +import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +68,22 @@ public interface IcNatDao extends BaseDao { void updateBatchNat(@Param("list")List entities); + List getRelationAndNat(); + + List getResiByIdCards(@Param("idCards")List idCards); + + /** + * @Description 批量更新关系 + * @param list + * @Author zxc + * @Date 2022/10/25 10:56 + */ + void updateRelation(@Param("list") List list); + + /** + * @Description 更新的 userType != 'import' + * @Author zxc + * @Date 2022/10/25 11:13 + */ + void updateRelationOther(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index dd9e97bbae..8caa220af2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -430,4 +430,13 @@ public interface IcResiUserDao extends BaseDao { List getIcUserCount(IcUserCountFormDTO formDTO); List icUserStatisList(UserChartFormDTO formDTO); + + /** + * @Description 根据身份证获取组织下的居民个数 + * @param agencyId + * @param idCard + * @Author zxc + * @Date 2022/10/24 15:47 + */ + ResiAndLocalResiResultDTO getResiCount(@Param("agencyId")String agencyId,@Param("idCard")String idCard,@Param("customerId")String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java index c5bdfcdbf7..a0a579e1cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java @@ -6,6 +6,7 @@ import com.epmet.dto.IcVaccinePrarmeterDTO; import com.epmet.dto.form.VaccinePrarmeterListFormDTO; import com.epmet.entity.IcVaccinePrarmeterEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -28,4 +29,6 @@ public interface IcVaccinePrarmeterDao extends BaseDao */ List getPhrasePage(Map params); + void deleteByIdCard(@Param("isCardList") List isCardList); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index 6c6e3aa4fb..f5f4cdfd35 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -63,4 +63,12 @@ public interface RegisterRelationDao extends BaseDao { * @date 2021/12/30 3:14 下午 */ RegisterRelationDTO resiRelationInfo(@Param("userId")String userId); + + /** + * Desc: 根据网格ID查询所有注册居民 + * @param gridId + * @author zxc + * @date 2022/10/8 10:48 + */ + Integer getAllResiByGrid(@Param("gridId")String gridId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatCompareRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatCompareRecordEntity.java index 0110312ed9..75b18618fe 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatCompareRecordEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatCompareRecordEntity.java @@ -45,7 +45,10 @@ public class IcNatCompareRecordEntity extends BaseEpmetEntity { * 是否客户下居民,ic_resi_user.id */ private String icResiUserId; - + /** + * 最近一次采样时间:接口填入 + */ + private Date latestCyTime; /** * 最近一次核酸时间:接口填入 */ @@ -68,4 +71,9 @@ public class IcNatCompareRecordEntity extends BaseEpmetEntity { * 最新一次导入时间,对应ic_nat_compare_rec_relation.IMPORT_TIME */ private Date latestImportTime; + + /** + * 备注;系统内部使用,方便看看错误 + */ + private String internalRemark; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java index 7dd51b4d55..4e48d55d36 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java @@ -41,6 +41,11 @@ public class IcNatRelationEntity extends BaseEpmetEntity { */ private String icNatId; + /** + * 是否本辖区居民,1:是;0:否 + */ + private String isLocalResiUser; + /** * 关系数据的绑定途径【居民端录入:resi; 数字社区录入:icresi; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/EpidemicPreventionExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/EpidemicPreventionExportExcel.java new file mode 100644 index 0000000000..33486ab15a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/EpidemicPreventionExportExcel.java @@ -0,0 +1,34 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/10/24 14:36 + */ +@Data +public class EpidemicPreventionExportExcel { + + @ExcelProperty(value = "姓名") + @ColumnWidth(20) + private String name; + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "所属房屋") + @ColumnWidth(20) + private String houseName; + + @ExcelProperty(value = "手机号") + @ColumnWidth(20) + private String mobile; + + @ExcelProperty(value = "证件号") + @ColumnWidth(20) + private String idCard; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java index 52135be6e5..c31e0f0cd0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java @@ -30,7 +30,7 @@ public class ImportEpidemicSpecialAttention extends ExcelVerifyInfo { /** * 身份证号 */ - @Excel(name = "身份证号") + @Excel(name = "证件号") private String idCard; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatCompareRecordExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatCompareRecordExcelImportListener.java index 03c01a2f37..44ed565c6e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatCompareRecordExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatCompareRecordExcelImportListener.java @@ -5,6 +5,7 @@ import com.alibaba.excel.read.listener.ReadListener; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDetailDTO; import com.epmet.commons.tools.enums.EnvEnum; @@ -84,27 +85,54 @@ public class IcNatCompareRecordExcelImportListener implements ReadListener otherRows = new ArrayList<>(); private IcNatServiceImpl icNatService; + private IcResiUserDao icResiUserDao; - public IcNatExcelImportListener(String currentUserId, String currentAgencyId, String currentAgencyPids, IcNatServiceImpl icNatService) { + public IcNatExcelImportListener(String currentUserId, String currentAgencyId, String currentAgencyPids, IcNatServiceImpl icNatService, IcResiUserDao icResiUserDao) { this.currentUserId = currentUserId; this.currentAgencyId = currentAgencyId; this.currentAgencyPids = currentAgencyPids; this.icNatService = icNatService; + this.icResiUserDao = icResiUserDao; } @Override @@ -116,6 +121,7 @@ public class IcNatExcelImportListener implements ReadListener gridResult = - govOrgOpenFeignClient.getGridNameByGridId(gridParam); - if(gridResult.success() && null != gridResult.getData() - && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())){ - String gridFullName = gridResult.getData().getBelongsGridName(); + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(relation.getGridId()); + if (null != gridInfoCache) { + String gridFullName = gridInfoCache.getGridNamePath(); baseInfo.setRegisteredGridName(gridFullName); StringBuffer buffer = new StringBuffer(baseInfo.getSurname()); switch (baseInfo.getGender()) { @@ -217,14 +212,10 @@ public class UserBaseInfoRedis { RegisterRelationEntity relation = registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(userId,customerId); if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ baseInfo.setCustomerId(relation.getCustomerId()); - BelongGridNameFormDTO gridParam = new BelongGridNameFormDTO(); - gridParam.setGridId(relation.getGridId()); baseInfo.setRegisteredGridId(relation.getGridId()); - Result gridResult = - govOrgOpenFeignClient.getGridNameByGridId(gridParam); - if(gridResult.success() && null != gridResult.getData() - && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())){ - String gridFullName = gridResult.getData().getBelongsGridName(); + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(relation.getGridId()); + if (null != gridInfoCache) { + String gridFullName = gridInfoCache.getGridNamePath(); baseInfo.setRegisteredGridName(gridFullName); StringBuffer buffer = new StringBuffer(gridFullName.split(ModuleConstant.DASH)[NumConstant.ONE]).append(ModuleConstant.DASH).append(baseInfo.getSurname()); switch (baseInfo.getGender()) { @@ -309,14 +300,10 @@ public class UserBaseInfoRedis { //如果没有首次注册网格,则没有网格名称(xx机关-xx网格)、显示昵称(xx网格-x先生/女士) if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ currentCache.setCustomerId(relation.getCustomerId()); - BelongGridNameFormDTO gridParam = new BelongGridNameFormDTO(); - gridParam.setGridId(relation.getGridId()); currentCache.setRegisteredGridId(relation.getGridId()); - Result gridResult = - govOrgOpenFeignClient.getGridNameByGridId(gridParam); - if(gridResult.success() && null != gridResult.getData() - && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())) { - String gridFullName = gridResult.getData().getBelongsGridName(); + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(relation.getGridId()); + if (null != gridInfoCache) { + String gridFullName = gridInfoCache.getGridNamePath(); currentCache.setRegisteredGridName(gridFullName); if (StringUtils.isBlank(currentCache.getGender())) { currentCache.setGender(NumConstant.ZERO_STR); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index b2a3442172..8c88c7680d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -398,4 +398,6 @@ public interface CustomerStaffService extends BaseService { void editToStaff(CustomerStaffDTO formDTO); List customerStaff(GridStaffUploadtFormDTO formDTO); + + void allCustomerStaffInCache(String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index 430a66424a..b9f89d921e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -94,4 +94,7 @@ public interface IcNatService extends BaseService { Integer updateIsResiFlag(String customerId, String icResiUserId); void updateBatchNat(List entities); + + void initNatLocal(); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index e3e0f75e1f..246f87a15d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -32,6 +32,8 @@ import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -521,4 +523,6 @@ public interface IcResiUserService extends BaseService { void updateYlfn(); IcResiUserInfoCache getIcResiUserInfo(String userId); + + void epidemicPreventionExport(EpidemicPreventionFormDTO formDTO, HttpServletResponse response) throws IOException; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java index 96814c5fce..7179b78530 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.form.AllResiByGridFormDTO; import com.epmet.dto.form.EnterGridFormDTO; import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; import com.epmet.entity.RegisterRelationEntity; @@ -114,4 +115,12 @@ public interface RegisterRelationService extends BaseService().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + // return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); } //USER表插入数据 UserEntity userEntity = new UserEntity(); @@ -466,12 +471,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + // return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); } CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); //Customer_Staff表插入数据 CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setCustomerId(customerStaffEntity.getCustomerId()); staffEntity.setId(customerStaffEntity.getId()); staffEntity.setRealName(fromDTO.getName()); staffEntity.setMobile(fromDTO.getMobile()); @@ -490,6 +497,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.getAllStaffByCustomerId(customerId)); + size = pageInfo.getList().size(); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(pageInfo.getList())){ + pageInfo.getList().forEach(c -> { + String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, c.getMobile()); + Map map = BeanUtil.beanToMap(c, false, true); + redisUtils.hMSet(key,map); + }); + } + no++; + }while (size == NumConstant.ONE_HUNDRED); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index a72a56edeb..6d4c42690d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -526,7 +526,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl imp if (null == agencyInfo) { throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId())); } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo){ + throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId())); + } + ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId()); //2.新增核酸基础信息数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); - if (StringUtils.isNotBlank(formDTO.getUserId())) { + /*if (StringUtils.isNotBlank(formDTO.getUserId())) { entity.setIsResiUser("1"); - } + }*/ + entity.setIsResiUser(org.apache.commons.lang3.StringUtils.isNotBlank(resiCount.getUserId()) ? NumConstant.ONE_STR : NumConstant.ZERO_STR); + entity.setUserId(null == resiCount.getUserId() ? "" : resiCount.getUserId()); insert(entity); //3.核酸记录关系表新增与组织的关系数据 IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class); relationEntity.setIcNatId(entity.getId()); - relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId()); + relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR); + relationEntity.setAgencyId(staffInfo.getAgencyId()); + relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId()); icNatRelationDao.insert(relationEntity); //3.新增通知表信息 @@ -345,7 +354,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp String agencyId = loginUserDetails.getAgencyId(); - IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, agencyId, loginUserDetails.getOrgIdPath().replace(":".concat(agencyId), ""), this); + IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, agencyId, loginUserDetails.getOrgIdPath().replace(":".concat(agencyId), ""), this, icResiUserDao); EasyExcel.read(filePath.toFile(), IcNatImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead(); @@ -472,6 +481,55 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } } + @Override + public void initNatLocal() { + Integer no = NumConstant.ONE; + Integer size; + // 查询关系表 + do { + // user_type = 'import' + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_THOUSAND).doSelectPageInfo(() -> baseDao.getRelationAndNat()); + List list = pageInfo.getList(); + size = list.size(); + if (CollectionUtils.isNotEmpty(list)){ + List users = baseDao.getResiByIdCards(list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList())); + if (CollectionUtils.isNotEmpty(users)){ + for (RelationAndNatResultDTO l : list) { + for (IcResiUserEntity u : users) { + if (l.getStaffAgencyIdPath().contains(u.getAgencyId())){ + l.setIsLocalResiUser(NumConstant.ONE_STR); + break; + } + } + } + updateRelation(list,NumConstant.ONE_STR); + } + } + no++; + }while (size == NumConstant.ONE_THOUSAND); + // 其他类型的userType直接是居民的组织信息,所以直接赋值 is_local_resi_user = '1' + updateRelation(null,NumConstant.TWO_STR); + log.error("/epmetuser/icNat/initNatLocal更新核酸检测记录关系表,是否是本辖区居民标志 end"); + } + + /** + * @Description 更新核酸关系表 + * @param list + * @param type 1:userType为import;2:除了import + * @Author zxc + * @Date 2022/10/25 10:55 + */ + @Transactional(rollbackFor = Exception.class) + public void updateRelation(List list,String type){ + if (NumConstant.ONE_STR.equals(type)){ + if (CollectionUtils.isNotEmpty(list)){ + baseDao.updateRelation(list); + } + }else { + baseDao.updateRelationOther(); + } + } + /** * 批量持久化 * @param entities @@ -535,6 +593,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return; } + // 存在某时间的核酸检测信息 if (resiNat != null) { boolean needUpdate = false; // 有这个人,也是导入的,那就要更新le @@ -586,8 +645,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } // 还要创建关系。只有本辖区及下级居民,才建立关系 + // 2022-10-25 修改:导入的都插入关系 if (resi != null) { - createNatRelation(resiNat.getId(), resi.getAgencyId(), resi.getPids()); + createNatRelation(resiNat.getId(), resi.getAgencyId(), agencyPids,agencyId); } return; @@ -602,7 +662,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp // 还要创建关系。只有本辖区及下级居民,才建立关系 if (resi != null) { - createNatRelation(e.getId(), resi.getAgencyId(), resi.getPids()); + createNatRelation(e.getId(), resi.getAgencyId(), agencyPids,agencyId); } } @@ -642,11 +702,15 @@ public class IcNatServiceImpl extends BaseServiceImpl imp /** * 创建nat关系 * @param natId - * @param currentUserAgencyId + * @param currentUserAgencyId 居民所属组织 + * @param staffAgencyId 工作人员所属组织 + * @param agencyPids 工作人员所属组织路径 */ - private void createNatRelation(String natId, String currentUserAgencyId, String agencyPids) { + private void createNatRelation(String natId, String currentUserAgencyId, String agencyPids,String staffAgencyId) { // 没有关系创建关系,有关系就跳过 + // 2022-10-25 修改:不管是不是本辖区居民,都创建关系,用 is_local_resi_user区分是不是本辖区居民 + // 组织ID都改成工作人员所属组织ID LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(IcNatRelationEntity::getIcNatId, natId); query.eq(IcNatRelationEntity::getAgencyId, currentUserAgencyId); @@ -659,6 +723,8 @@ public class IcNatServiceImpl extends BaseServiceImpl imp relation.setPids(String.join(":", Arrays.asList(agencyPids, currentUserAgencyId))); relation.setIcNatId(natId); relation.setUserType("import"); + relation.setIsLocalResiUser(agencyPids.contains(currentUserAgencyId) ? NumConstant.ONE_STR : NumConstant.ZERO_STR); icNatRelationDao.insert(relation); } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index 3d2cfd552b..c519210d7b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -225,6 +225,17 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl orgInfoList = new ArrayList<>(); + for (String orgId : split) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + if (null == agencyInfo){ + throw new EpmetException("查询组织信息失败:"+orgId); + } + OrgInfoIdAndNameResultDTO orgInfoResultDTO = new OrgInfoIdAndNameResultDTO(orgId,agencyInfo.getOrganizationName()); + orgInfoList.add(orgInfoResultDTO); + } + result.setOrgIdPathList(orgInfoList); //查询成员信息 List memberList = icResiMemberDao.selectListByCollectId(dto.getId()); result.setMemberList(memberList); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index bae8e89c0b..4b7a485d71 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -19,6 +19,9 @@ package com.epmet.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -47,6 +50,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.*; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.constant.IcPlatformConstant; import com.epmet.constant.IcResiUserConstant; import com.epmet.constant.UserConstant; @@ -59,6 +63,8 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; import com.epmet.entity.*; +import com.epmet.excel.DataSyncRecordDisabilityExcel; +import com.epmet.excel.EpidemicPreventionExportExcel; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO; @@ -83,6 +89,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.Timestamp; @@ -312,13 +321,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : formMap.get("ic_party_member")) { if (!hash.containsKey("SSZB")) { - String errorMsg = "党员信息所属支部不能为空"; - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + // 10.26灵山卫的暂时放开,不校验 + if(!"57eaadaab264b816e7159c1a91ac50c1".equals(tokenDto.getCustomerId())){ + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } } } } else { - String errorMsg = "党员信息所属支部不能为空"; - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + // 10.26灵山卫的暂时放开,不校验 + if(!"57eaadaab264b816e7159c1a91ac50c1".equals(tokenDto.getCustomerId())){ + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } } partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); @@ -541,20 +556,29 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : formMap.get("ic_party_member")) { if (!hash.containsKey("ID") && !hash.containsKey("SSZB")) { - String errorMsg = "党员信息所属支部不能为空"; - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + // 10.26灵山卫的暂时放开,不校验 + if(!"57eaadaab264b816e7159c1a91ac50c1".equals(tokenDto.getCustomerId())){ + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } } } } else { - String errorMsg = "党员信息所属支部不能为空"; - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + // 10.26灵山卫的暂时放开,不校验 + if(!"57eaadaab264b816e7159c1a91ac50c1".equals(tokenDto.getCustomerId())){ + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } } } else if (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty())) { if (formMap.containsKey("ic_party_member")) { for (LinkedHashMap hash : formMap.get("ic_party_member")) { if (!hash.containsKey("ID") && !hash.containsKey("SSZB")) { - String errorMsg = "党员信息所属支部不能为空"; - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + // 10.26灵山卫的暂时放开,不校验 + if(!"57eaadaab264b816e7159c1a91ac50c1".equals(tokenDto.getCustomerId())){ + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } } } } @@ -1673,8 +1697,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = baseDao.getEpidemicPreventionList(formDTO); + List list = new ArrayList<>(); + if (formDTO.getIsPage()){ + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + list = baseDao.getEpidemicPreventionList(formDTO); + }else { + list = baseDao.getEpidemicPreventionList(formDTO); + } + PageInfo pageInfo = new PageInfo<>(list); if (CollectionUtils.isNotEmpty(list)) { //查询网格名称 @@ -3544,4 +3574,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = null; + do { + PageData data = epidemicPreventionList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), EpidemicPreventionExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java index e56c8d5a0a..4c4da7574b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java @@ -225,11 +225,11 @@ public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl errorInfo.size()){ - Map groupByName = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getName, Collectors.counting())); - groupByName.forEach((name,count) -> { + Map groupByIdCard = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getIdCard, Collectors.counting())); + groupByIdCard.forEach((idCard,count) -> { if (Integer.valueOf(count.toString()).compareTo(1) != 0){ for (IcVaccinePrarmeterImportExcel i : list) { - if (name.equals(i.getName()) && !i.getAddStatus()){ + if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); i.setAddStatus(true); } @@ -241,12 +241,21 @@ public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl needInsert = groupByStatus.get(false); if (CollectionUtils.isNotEmpty(needInsert)){ List entities = ConvertUtils.sourceToTarget(needInsert, IcVaccinePrarmeterEntity.class); + // 要删除的身份证号 + List isCardList = new ArrayList(); entities.forEach(e -> { // 设置客户ID e.setCustomerId(tokenDto.getCustomerId()); // 设置审核状态为待审核 e.setCheckState("0"); + // 存储删除身份证号 + isCardList.add(e.getIdCard()); }); + + // 先根据身份证号删除 + baseDao.deleteByIdCard(isCardList); + + // 再新增 insertBatch(entities); } if (CollectionUtils.isNotEmpty(errorInfo)){ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index d853d884dc..11cca8346e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -378,4 +378,15 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml index 0e3fcaa606..897493f745 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml @@ -11,6 +11,7 @@ c.MOBILE, c.ID_CARD, c.`NAME`, + c.LATEST_CY_TIME, c.LATEST_NAT_TIME, c.NAT_ADDRESS, c.NAT_RESULT, @@ -55,6 +56,18 @@ AND (r.AGENCY_ID = #{agencyId} or r.pids like concat('%',#{agencyId},'%') ) + + and DATE_FORMAT(c.LATEST_CY_TIME,'%Y%m%d') = #{cyDate} + + + + + AND DATE_FORMAT( c.LATEST_NAT_TIME, '%Y%m%d' ) = #{natDate} + + + AND DATE_FORMAT( c.LATEST_NAT_TIME, '%Y%m%d' ) != #{natDate} + + ORDER BY r.IMPORT_TIME DESC,r.AGENCY_ID desc diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 991bc5220d..37fcc7dc3b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -38,6 +38,7 @@ a.user_type userType, b.user_id userId, b.is_resi_user isResiUser, + a.is_local_resi_user isLocalResiUser, b.`name` `name`, b.mobile mobile, b.id_card idCard, @@ -75,7 +76,7 @@ AND b.sample_time #{sampleEndTime} - AND b.is_resi_user = #{isResiUser} + AND a.is_local_resi_user = #{isResiUser} ORDER BY b.nat_time DESC, b.id ASC @@ -169,6 +170,29 @@ + + + + DELETE FROM ic_nat WHERE id = #{icNatId} @@ -222,4 +246,27 @@ ) + + + + UPDATE ic_nat_relation + + + + when ID = #{l.relationId} then #{l.isLocalResiUser} + + + UPDATED_TIME = NOW() + + WHERE ID IN( + + #{l.relationId} + ) + + + UPDATE ic_nat_relation + set IS_LOCAL_RESI_USER = '1', + UPDATED_TIME = NOW() + where user_type != 'import' + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index e8b69faefa..497d96a25b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -849,10 +849,10 @@ FROM ic_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") > #{startDate} + AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") >= #{startDate} - AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") < #{endDate} + AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") <= #{endDate} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD LEFT JOIN ( @@ -860,10 +860,16 @@ FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") > #{startDate} + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") >= #{startDate} - AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") < #{endDate} + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") <= #{endDate} + + + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") >= #{natStartDate} + + + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") <= #{natEndDate} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD WHERE @@ -1377,4 +1383,23 @@ ORDER BY `name` ASC + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml index ebbebfe289..0a82a1f665 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml @@ -185,5 +185,13 @@ order by CREATED_TIME desc + + update ic_vaccine_prarmeter set DEL_FLAG = '1' , UPDATED_TIME = now() + where ID_CARD IN + + #{idCard} + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index 3ce51f018a..c43cea28cc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -87,5 +87,15 @@ SELECT * FROM register_relation WHERE DEL_FLAG = 0 AND USER_ID = #{userId} + + +