diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
index 0275695054..6b4803d4d8 100644
--- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
+++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: epmet-admin-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common
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 20a0b534f6..b7844243d3 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
@@ -77,9 +77,6 @@ public enum EpmetErrorCode {
CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"),
NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"),
GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"),
- EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"),
- EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"),
- CAN_NOT_SELF(8410,"无法对自己进行操作"),
ALREADY_EVALUATE(8501,"您已评价"),
ALREADY_VOTE(8502,"您已表态"),
@@ -107,7 +104,9 @@ public enum EpmetErrorCode {
OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"),
OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"),
OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"),
- OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
+ OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
+ OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
+ OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),
diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml
index 5af513a4a4..de94f499a2 100644
--- a/epmet-gateway/src/main/resources/bootstrap.yml
+++ b/epmet-gateway/src/main/resources/bootstrap.yml
@@ -11,7 +11,7 @@ spring:
name: epmet-gateway-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
index 5899ead6dd..d3ebec947d 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: data-report-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
index d0f69c2502..f9a372c94e 100644
--- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
@@ -8,7 +8,7 @@ spring:
name: epmet-activiti-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
index ec2f2c7a2b..e521fd36ff 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: common-service-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml
index c34d1822b8..1352c66f87 100644
--- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
allow-bean-definition-overriding: true
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
index 8f43acbf19..a1948620e3 100644
--- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: epmet-ext-server
# dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
index 0f7b365814..0f9afbef03 100644
--- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: epmet-message-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
index 390608e0f4..115f991f57 100644
--- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: epmet-oss-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/epmet-point/epmet-point-client/pom.xml b/epmet-module/epmet-point/epmet-point-client/pom.xml
index c43496fa40..479b51156e 100644
--- a/epmet-module/epmet-point/epmet-point-client/pom.xml
+++ b/epmet-module/epmet-point/epmet-point-client/pom.xml
@@ -27,6 +27,12 @@
io.springfox
springfox-swagger-ui
+
+ com.epmet
+ epmet-user-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java
index 3dd0e34ac9..c37afa2921 100644
--- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java
+++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java
@@ -26,4 +26,7 @@ public class CommonPageUserFormDTO implements Serializable {
private Integer pageNo = 1;
private Integer pageSize = 10;
+
+ @NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class)
+ private String customerId;
}
diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
index 7920d68c66..8726a2659b 100644
--- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
+++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
@@ -52,4 +52,6 @@ public class PointVerificationFormDTO implements Serializable {
@NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class)
private String address;
+
+ private String customerId;
}
diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
index deaa7bb6d5..d5b9edd6c6 100644
--- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
+++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
@@ -1,13 +1,12 @@
package com.epmet.feign;
-import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant;
-import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@@ -20,11 +19,11 @@ public interface EpmetPointOpenFeignClient {
/**
* @Description 获取指定居民的积分信息
- * @param dto
+ * @param
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
- @GetMapping("/point/resi/point/mypoint")
- Result myPoint(TokenDto dto);
+ @PostMapping("/point/resi/point/mypoint")
+ Result myPoint(CommonUserFormDTO param);
}
diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
index 8901a0724b..7d5cda718f 100644
--- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
+++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
@@ -1,9 +1,9 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
-import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.EpmetPointOpenFeignClient;
import org.springframework.stereotype.Component;
@@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
@Component
public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient {
@Override
- public Result myPoint(TokenDto dto) {
- return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint", dto);
+ public Result myPoint(CommonUserFormDTO param) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param);
}
}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
index 21336dccb2..535b717e0c 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
@@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
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.CommonUserFormDTO;
import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
@@ -59,7 +60,8 @@ public class AdjustmentController {
**/
@PostMapping("userdetail")
@RequirePermission(requirePermission = RequirePermissionEnum.MORE_POINT_USER_MANAGE_DETAIL_VIEW)
- public Result userDetail(@RequestBody IssueInitiatorFormDTO param){
+ public Result userDetail(@LoginUser TokenDto staffToken,@RequestBody CommonUserFormDTO param){
+ param.setCustomerId(staffToken.getCustomerId());
ValidatorUtils.validateEntity(param,IssueInitiatorFormDTO.UserIdGroup.class);
return new Result().ok(pointAdjustmentLogService.userDetail(param));
}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
index ff4bdd2285..8bb1d31cc5 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
@@ -39,6 +39,7 @@ public class ExchangeController {
@PostMapping("execute")
public Result execute(@LoginUser TokenDto token, @RequestBody PointVerificationFormDTO verificationParam){
verificationParam.setOperatorId(token.getUserId());
+ verificationParam.setCustomerId(token.getCustomerId());
ValidatorUtils.validateEntity(verificationParam, PointVerificationFormDTO.PointVerificationGroup.class);
return new Result().ok(pointVerificationLogService.verifyPoint(verificationParam));
}
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
index bca69b050a..f4e5ce6bb4 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
@@ -5,7 +5,7 @@ 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.CommonPageUserFormDTO;
-import com.epmet.dto.form.ResiCommonUserIdFormDTO;
+import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.PointExchangeResponseResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
@@ -46,12 +46,11 @@ public class ResiPointController {
* @author wangc
* @date 2020.07.22 15:58
**/
- @GetMapping("mypoint")
- public Result myPoint(@LoginUser TokenDto dto){
- ResiCommonUserIdFormDTO param = new ResiCommonUserIdFormDTO();
- param.setUserId(dto.getUserId());
- ValidatorUtils.validateEntity(param,ResiCommonUserIdFormDTO.UserIdGroup.class);
- return new Result().ok(userPointTotalService.getMyPoint(param));
+ @PostMapping("mypoint")
+ public Result myPoint(@LoginUser TokenDto dto, @RequestBody CommonUserFormDTO userParam){
+ userParam.setUserId(dto.getUserId());
+ ValidatorUtils.validateEntity(userParam, CommonUserFormDTO.CustomerId_UserIdGroup.class);
+ return new Result().ok(userPointTotalService.getMyPoint(userParam));
}
/**
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
index 5b90380b88..52c76a7c4c 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
@@ -43,7 +43,7 @@ public interface PointVerificationLogDao extends BaseDao selectVerificationLog(@Param("userId") String userId);
+ List selectVerificationLog(@Param("userId") String userId,@Param("customerId")String customerId);
/**
* @Description 获取工作人员月度核销记录
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
index a16ce26c67..42d7cb404b 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
@@ -42,7 +42,8 @@ public interface UserPointActionLogDao extends BaseDao
* @author wangc
* @date 2020.07.22 13:56
**/
- List selectPointActionLogList(@Param("userId") String userId);
+ List selectPointActionLogList(@Param("userId") String userId,@Param("customerId")String customerId);
+
/**
* @Description 查询指定用户在某条规则下所得的积分总和
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java
index 36b2540ac1..c78d265734 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java
@@ -44,6 +44,15 @@ public interface UserPointTotalDao extends BaseDao {
**/
ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId);
+ /**
+ * @Description 根据用户Id和客户Id查询他的累计积分以及可用积分
+ * @param userId
+ * @return
+ * @author wangc
+ * @date 2020.07.21 13:38
+ **/
+ ResiPointDetailResultDTO selectPointByCustomerUserId(@Param("userId")String userId,@Param("customerId")String customerId);
+
/**
* @Description 查询客户下的用户累计积分排名榜
* @param customerId
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java
index 02df12d652..6e77b0f7c8 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java
@@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointAdjustmentLogDTO;
+import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
@@ -113,7 +114,7 @@ public interface PointAdjustmentLogService extends BaseService
/**
* @Description 获取指定居民的积分信息
- * @param userId
+ * @param param
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
- ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId);
+ ResiPointDetailResultDTO getMyPoint(CommonUserFormDTO param);
/**
* @Description 获取客户下用户积分排名榜
@@ -125,4 +126,13 @@ public interface UserPointTotalService extends BaseService
void insertOrUpdate(UserPointTotalEntity entity);
void testInsertOrUpdate(UserPointTotalEntity entity);
+
+ /**
+ * @Description 获取指定居民的积分信息 - 使用客户Id匹配,兼容多客户情况
+ * @param customerUserParam
+ * @return
+ * @author wangc
+ * @date 2020.07.22 15:58
+ **/
+ ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam);
}
\ No newline at end of file
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
index a78e6f70bf..cdbf4e882b 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
@@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PointAdjustmentLogDao;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.PointAdjustmentLogDTO;
+import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
@@ -150,13 +151,14 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl detailResult = epmetUserOpenFeignClient.customerUserDetail(param);
+ public CustomerUserDetailResultDTO userDetail(CommonUserFormDTO param) {
+ IssueInitiatorFormDTO userParam = new IssueInitiatorFormDTO();
+ userParam.setUserId(param.getUserId());
+ Result detailResult = epmetUserOpenFeignClient.customerUserDetail(userParam);
if(!detailResult.success()){
throw new RenException(detailResult.getCode());
}
- ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class);
- ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam);
+ ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPointGroupByCustomer(param);
if(null != detailResult.getData()){
CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO();
result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO);
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
index f8f3974e80..8dec019109 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
@@ -147,7 +147,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyExchangeRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
- List logList = baseDao.selectVerificationLog(pageUser.getUserId());
+ List logList = baseDao.selectVerificationLog(pageUser.getUserId(),pageUser.getCustomerId());
List result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map> map =
@@ -256,9 +256,10 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyPointRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
- List logList = baseDao.selectPointActionLogList(pageUser.getUserId());
+ List logList = baseDao.selectPointActionLogList(pageUser.getUserId(),pageUser.getCustomerId());
List result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map> map =
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
index 6be4ae538e..a36a0c39d9 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
@@ -38,6 +38,7 @@ import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -53,6 +54,7 @@ import java.util.stream.Collectors;
* @since v1.0.0 2020-07-20
*/
@Service
+@Slf4j
public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointStatisticalDailyService {
@Autowired
@@ -131,6 +133,8 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointTotalService {
+
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@@ -111,14 +115,14 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
@@ -244,4 +250,20 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
index 9777f506d3..994bca4ad4 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
@@ -36,6 +36,8 @@
DEL_FLAG = '0'
AND
USER_ID = #{userId}
+ AND
+ CUSTOMER_ID = #{customerId}
ORDER BY
CREATED_TIME DESC
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
index d84b1b02ed..e64d984a00 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
@@ -31,6 +31,21 @@
USER_ID = #{userId}
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
index 9aaa3e9556..e8a2685e37 100644
--- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-access-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
index c56eefd656..6b8729cd4e 100644
--- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-grid-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common
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 bdbf47bc78..c6334dd86e 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
@@ -148,4 +148,15 @@ public interface IssueVoteStatisticalService extends BaseService imp
//5:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
+ try {
+ issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
+ }catch (RenException e){
+ logger.error(e.getMsg());
+ }
}
/**
@@ -581,6 +586,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp
//6:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
+ try{
+ issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
+ }catch(RenException e){
+ logger.error(e.getMsg());
+ }
}
/**
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 320138bfc5..60b0aabbc3 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
@@ -252,7 +252,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl issues =
issueDao.selectIssueIdsByCondition(issueParam);
- if(null == issues || issues.size()< NumConstant.ONE){
+ if(null == issues || issues.isEmpty()){
return;
}
Set ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet());
@@ -285,9 +285,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl listToUpdate = new ArrayList<>();
setVotableCountsAndUpdateCache(listToUpdate,
existedIds.stream().flatMap(existedId -> issues.stream().filter(issue ->
- StringUtils.equals(issue.getId(),existedId)).map(issueDTO -> {
- return issueDTO;
- })).collect(Collectors.toSet()),
+ StringUtils.equals(issue.getId(),existedId))).collect(Collectors.toSet()),
votableCountMap);
// 批量更新listToUpdate
@@ -417,8 +415,10 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount =
+ resiGroupFeignClient.votableCount(gridParam);
+ if(votableCount.success() && null != votableCount.getData()){
+ toUpd.setVotableCount(votableCount.getData());
+ }
+
+ if(StringUtils.isNotBlank(statisticalId)){
+ toUpd.setId(statisticalId);
+ update(toUpd);
+ }else{
+ IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId);
+ if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){
+ toUpd.setId(existedStatistical.getId());
+ update(toUpd);
+ }
+ }
+
+ }
+
/**
* @Description 遍历应表决数
* @param list - List | Set | Map
diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
index 93f2568a4b..e523016b91 100644
--- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-issue-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
index 372d057000..f19d228c96 100644
--- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-mine-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index 215e32b471..140bd8cd43 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -215,18 +215,22 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) {
- CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId());
+ CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(addGridFormDTO.getAgencyId());
// 1. 查询该客户下可创建网格的最大数量
GridCountFormDTO gridCount = new GridCountFormDTO();
String customerId = customerAgencyDTO.getCustomerId();
gridCount.setCustomerId(customerId);
GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData();
- if (grid.getGridCount().equals(NumConstant.ZERO)){
+ log.info("客户信息为:" + grid);
+ if (null == grid) {
+ throw new RenException("未查出该客户信息");
+ }
+ if (null == grid.getGridCount() || grid.getGridCount().equals(NumConstant.ZERO)) {
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 2. 判断当前客户下存在的网格数量
Integer gridCounts = customerGridDao.selectGridCount(customerId);
- if (gridCounts >= grid.getGridCount()){
+ if (gridCounts >= grid.getGridCount()) {
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 3. 查询网格名称是否重名
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
index 123fa48ad4..4657c30354 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-org-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common
diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
index ddd3113ac5..31d7d1ef6d 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-project-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
index 8504cb2d5a..8e85f694ed 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: gov-voice-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
index b57b255fe6..b7cbcbe1af 100644
--- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: oper-access-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
index c434e9de81..422a4459a9 100644
--- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: oper-crm-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java
index 2cc9b89b0e..9a33b3161d 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java
@@ -43,6 +43,11 @@ public class CustomerFootBarDTO implements Serializable {
*/
private String barName;
+ /**
+ * 默认的bar名称
+ */
+ private String defaultBarName;
+
/**
* KEY
*/
@@ -93,4 +98,6 @@ public class CustomerFootBarDTO implements Serializable {
*/
private Date updatedTime;
+ private Boolean display;
+
}
\ 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 1d5218fd4b..d5981860fd 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
@@ -1,17 +1,98 @@
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.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
@Data
public class CustomerFootBarFormDTO {
- //@NotBlank(message = "客户ID不能为空")
+ // 创建footbar的分组
+ public interface CreateFootBarGroup extends CustomerClientShowGroup {}
+
+ // 查询footbar列表分组
+ public interface ListFootBarGroup extends CustomerClientShowGroup {}
+
+ // 运营端查询footbar列表分组
+ public interface ListFootBarGroup4Oper extends CustomerClientShowGroup {}
+
+ // 更新footbar
+ public interface UpdateFootBarGroup extends CustomerClientShowGroup {}
+
+ // 保存顺序
+ public interface SaveOrderGroup extends CustomerClientShowGroup {}
+
+ // 明细分组
+ public interface FootBarDetailGroup extends CustomerClientShowGroup {}
+
+ // 更新显示状态分组
+ public interface UpdateDisplayStatusGroup extends CustomerClientShowGroup {}
+
+ // 为客户添加默认footbar
+ public interface AddDefaultFootbars4Customer extends CustomerClientShowGroup {}
+
+ // 删除footbar
+ public interface DeleteFootbarsGroup extends CustomerClientShowGroup {}
+
+ @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 })
private String customerId;
// 哪一个端:gov,resi
- @NotBlank(message = "app类型不能为空")
+ @NotBlank(message = "app类型不能为空", groups = { ListFootBarGroup.class, CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class })
private String appType;
+ @NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class })
+ private String barName;
+
+ @NotBlank(message = "key不能为空", groups = { CreateFootBarGroup.class })
+ private String barKey;
+
+ @NotBlank(message = "页面标题不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class })
+ private String pageTitle;
+
+ //@NotBlank(message = "图标路径不能为空", groups = { UpdateFootBarGroup.class })
+ private String iconPath;
+
+ //@NotBlank(message = "选中的图标路径不能为空", groups = { UpdateFootBarGroup.class })
+ private String selectedIconPath;
+
+ @NotEmpty(message = "顺序不能为空", groups = { SaveOrderGroup.class })
+ private List orderList;
+
+ @NotNull(message = "显示状态不能为空", groups = { UpdateDisplayStatusGroup.class })
+ private Boolean display;
+
+ /**
+ * 排序索引号dto
+ */
+ public static class OrderIndexDTO {
+ private String id;
+ private Integer orderIndex;
+
+ public OrderIndexDTO() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Integer getOrderIndex() {
+ return orderIndex;
+ }
+
+ public void setOrderIndex(Integer orderIndex) {
+ this.orderIndex = orderIndex;
+ }
+ }
}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java
index 832e06944c..c517c835ad 100644
--- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java
@@ -39,6 +39,10 @@ public class CustomerFootBarResultDTO implements Serializable {
*/
private String id;
+ private String customerId;
+
+ private String appType;
+
/**
* bar名称
*/
@@ -94,4 +98,14 @@ public class CustomerFootBarResultDTO implements Serializable {
*/
private Date updatedTime;
+ private Boolean display;
+
+ private String defaultBarName;
+
+ private String defaultIconPath;
+
+ private String defaultSelectedIconPath;
+
+ private String defaultPageTitle;
+
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
index 1be0943b60..5b9c7a0da8 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
@@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
+import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import com.epmet.excel.CustomerFootBarExcel;
import com.epmet.service.CustomerFootBarService;
@@ -35,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.NotBlank;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -103,17 +103,130 @@ public class CustomerFootBarController {
*/
@PostMapping("customerfootbars")
public Result> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO) {
- ValidatorUtils.validateEntity(formDTO);
+ ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup.class);
String customerId = formDTO.getCustomerId();
String appType = formDTO.getAppType();
List footbars = customerFootBarService.listCustomerFootBars(customerId, appType);
List barDTOS = new LinkedList<>();
footbars.forEach(barEntity -> {
+ CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey());
+
CustomerFootBarDTO barDTO = new CustomerFootBarDTO();
BeanUtils.copyProperties(barEntity, barDTO);
+ barDTO.setDefaultBarName(defaultFootBarEntity.getBarName());
barDTOS.add(barDTO);
});
return new Result>().ok(barDTOS);
}
+
+ /**
+ * 运营端查询footbar列表
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("customerfootbars4oper")
+ public Result> getCustomerfootbars4Oper(@RequestBody CustomerFootBarFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup4Oper.class);
+ String customerId = formDTO.getCustomerId();
+ String appType = formDTO.getAppType();
+
+ List footbars = customerFootBarService.listAllCustomerFootBars(customerId, appType);
+ List barDTOS = new LinkedList<>();
+ footbars.forEach(barEntity -> {
+ CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey());
+
+ CustomerFootBarDTO barDTO = new CustomerFootBarDTO();
+ BeanUtils.copyProperties(barEntity, barDTO);
+ barDTO.setDefaultBarName(defaultFootBarEntity.getBarName());
+ barDTOS.add(barDTO);
+ });
+ return new Result>().ok(barDTOS);
+ }
+
+
+ /**
+ * 创建footbar,只能创建默认的,不能直接为客户创建
+ * @param form
+ * @return
+ */
+ @PostMapping("createfootbar")
+ public Result createFootBar(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class);
+ customerFootBarService.createFootBar(form);
+ return new Result();
+ }
+
+ /**
+ * 更新footbar
+ * @param form
+ * @return
+ */
+ @PostMapping("updatefootbar")
+ public Result updateFootbar(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateFootBarGroup.class);
+ customerFootBarService.updateFootBar(form);
+ return new Result();
+ }
+
+ /**
+ *
+ * @param form
+ * @return
+ */
+ @PostMapping("footbardetail")
+ public Result footbarDetail(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.FootBarDetailGroup.class);
+ CustomerFootBarResultDTO dto = customerFootBarService.getFootBarDetail(form.getId());
+ return new Result().ok(dto);
+ }
+
+ /**
+ * 保存排序
+ * @param form
+ * @return
+ */
+ @PostMapping("saveorder")
+ public Result saveOrder(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.SaveOrderGroup.class);
+ customerFootBarService.saveOrder(form.getOrderList());
+ return new Result();
+ }
+
+ /**
+ * 更新显示状态
+ * @param form
+ * @return
+ */
+ @PostMapping("updatedisplaystatus")
+ public Result updateDisplayStatus(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateDisplayStatusGroup.class);
+ customerFootBarService.updateDisplayStatus(form.getId(), form.getDisplay());
+ return new Result();
+ }
+
+ /**
+ * 为客户初始化默认的footbar
+ * @param form
+ * @return
+ */
+ @PostMapping("initdefault4customer")
+ public Result initDefault4Customer(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.AddDefaultFootbars4Customer.class);
+ customerFootBarService.addDefault4Customer(form.getCustomerId(), form.getAppType());
+ return new Result();
+ }
+
+ /**
+ * 删除footbar
+ * @param form
+ * @return
+ */
+ @PostMapping("deletefootbar")
+ public Result deleteFootBar(@RequestBody CustomerFootBarFormDTO form) {
+ ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.DeleteFootbarsGroup.class);
+ customerFootBarService.deleteFootBar(form.getId());
+ return new Result();
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
index 480e148b60..30fac6164c 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
@@ -33,6 +33,55 @@ import java.util.List;
@Mapper
public interface CustomerFootBarDao extends BaseDao {
- List listCustomerFootBars(@Param("customerId") String customerId,
+ List listDisplayCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType);
+
+ List listAllCustomerFootBars(@Param("customerId") String customerId,
+ @Param("appType") String appType);
+
+ /**
+ * 唯一性count
+ * @param appType
+ * @param barKey
+ * @return
+ */
+ int count4Unique(@Param("customerId") String customerId,
+ @Param("appType") String appType,
+ @Param("barKey") String barKey,
+ @Param("barName") String barName);
+
+ /**
+ * 获取下一个顺序号
+ * @param customerId
+ * @param appType
+ * @return
+ */
+ Integer fetchNextOrder(@Param("customerId") String customerId, @Param("appType") String appType);
+
+ /**
+ * 更新顺序号
+ * @param id
+ * @param orderIndex
+ * @return
+ */
+ Integer updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex);
+
+ CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(@Param("customerId") String customerId,
+ @Param("appType") String appType,
+ @Param("barKey") String barKey);
+
+ CustomerFootBarEntity getByAppTypeAndBarNameOfCustomer(@Param("customerId") String customerId,
+ @Param("appType") String appType,
+ @Param("barName") String barName);
+
+ List listByAppTypeAndCustomerId(@Param("customerId") String customerId,
+ @Param("appType") String appType);
+
+ void updateDisplayStatus(@Param("id") String id, @Param("display") Boolean display);
+
+ List listFootBarOwnerCustomerIds();
+
+ void physicsDeleteById(@Param("id") String id);
+
+ void physicsDeleteByAppTypeAndBarKey(@Param("appType") String appType, @Param("barKey") String barKey);
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
index 2161fc4bdc..9abc736b13 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
@@ -38,6 +38,11 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
+ /**
+ * 客户id
+ */
+ private String customerId;
+
/**
* bar名称
*/
@@ -65,6 +70,14 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/
private String selectedIconPath;
- private Integer order;
+ /**
+ * 顺序号
+ */
+ private Integer orderIndex;
+
+ /**
+ * 是否显示
+ */
+ private Boolean display;
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
index f38eab950d..0ed3c9e0e5 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
@@ -20,6 +20,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerFootBarDTO;
+import com.epmet.dto.form.CustomerFootBarFormDTO;
+import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import java.util.List;
@@ -94,4 +96,22 @@ public interface CustomerFootBarService extends BaseService listCustomerFootBars(String customerId, String appType);
+
+ List listAllCustomerFootBars(String customerId, String appType);
+
+ void createFootBar(CustomerFootBarFormDTO form);
+
+ void updateFootBar(CustomerFootBarFormDTO form);
+
+ CustomerFootBarResultDTO getFootBarDetail(String id);
+
+ void saveOrder(List orderList);
+
+ CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey);
+
+ void updateDisplayStatus(String id, Boolean display);
+
+ void addDefault4Customer(String customerId, String appType);
+
+ void deleteFootBar(String id);
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
index 417555be13..594674b283 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
@@ -20,11 +20,15 @@ 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.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.RenException;
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.CustomerFootBarDao;
import com.epmet.dto.CustomerFootBarDTO;
+import com.epmet.dto.form.CustomerFootBarFormDTO;
+import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import com.epmet.redis.CustomerFootBarRedis;
import com.epmet.service.CustomerFootBarService;
@@ -103,7 +107,157 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl listCustomerFootBars(String customerId, String appType) {
- return baseDao.listCustomerFootBars(customerId, appType);
+ return baseDao.listDisplayCustomerFootBars(customerId, appType);
}
+ @Override
+ public List listAllCustomerFootBars(String customerId, String appType) {
+ return baseDao.listAllCustomerFootBars(customerId, appType);
+ }
+
+ @Override
+ public void createFootBar(CustomerFootBarFormDTO form) {
+
+ validateBeforeCreate(form);
+
+ CustomerFootBarEntity entity = new CustomerFootBarEntity();
+ entity.setAppType(form.getAppType());
+ entity.setCustomerId("default"); // 只能为默认客户创建
+ entity.setBarKey(form.getBarKey());
+ entity.setBarName(form.getBarName());
+ entity.setIconPath(form.getIconPath());
+ entity.setPageTitle(form.getPageTitle());
+ entity.setSelectedIconPath(form.getSelectedIconPath());
+ entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType()));
+ entity.setDisplay(true);
+ baseDao.insert(entity);
+
+ sync2Customers(entity);
+ }
+
+ /**
+ * 同步到客户
+ * @param entity
+ */
+ private void sync2Customers(CustomerFootBarEntity entity) {
+ List customerIds = baseDao.listFootBarOwnerCustomerIds();
+ for (String customerId : customerIds) {
+ CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, entity.getAppType(), entity.getBarKey());
+ if (bar == null) {
+ // 该客户还没有该bar
+ CustomerFootBarEntity newBar = new CustomerFootBarEntity();
+ newBar.setCustomerId(customerId);
+ newBar.setIconPath(entity.getIconPath());
+ newBar.setPageTitle(entity.getPageTitle());
+ newBar.setBarKey(entity.getBarKey());
+ newBar.setBarName(entity.getBarName());
+ newBar.setSelectedIconPath(entity.getSelectedIconPath());
+ newBar.setOrderIndex(baseDao.fetchNextOrder(customerId, entity.getAppType()));
+ newBar.setAppType(entity.getAppType());
+ newBar.setDisplay(true);
+ baseDao.insert(newBar);
+ }
+ }
+ }
+
+ @Override
+ public void updateFootBar(CustomerFootBarFormDTO form) {
+ validateBeforeUpdate(form);
+ CustomerFootBarEntity entity = baseDao.selectById(form.getId());
+ if (entity == null) {
+ throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getCode(),
+ EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getMsg());
+ }
+ entity.setSelectedIconPath(form.getSelectedIconPath());
+ entity.setBarName(form.getBarName());
+ entity.setPageTitle(form.getPageTitle());
+ entity.setIconPath(form.getIconPath());
+
+ baseDao.updateById(entity);
+ }
+
+ @Override
+ public CustomerFootBarResultDTO getFootBarDetail(String id) {
+ CustomerFootBarEntity entity = baseDao.selectById(id);
+ if (entity == null) {
+ return new CustomerFootBarResultDTO();
+ }
+ CustomerFootBarResultDTO dto = ConvertUtils.sourceToTarget(entity, CustomerFootBarResultDTO.class);
+ CustomerFootBarEntity defaultBar = baseDao.getByAppTypeAndBarKeyOfCustomer("default", entity.getAppType(), entity.getBarKey());
+ dto.setDefaultBarName(defaultBar.getBarName());
+ dto.setDefaultIconPath(defaultBar.getIconPath());
+ dto.setDefaultSelectedIconPath(defaultBar.getSelectedIconPath());
+ dto.setDefaultPageTitle(defaultBar.getPageTitle());
+ return dto;
+ }
+
+ @Transactional
+ @Override
+ public void saveOrder(List orderList) {
+ for (CustomerFootBarFormDTO.OrderIndexDTO idx : orderList) {
+ baseDao.updateOrder(idx.getId(), idx.getOrderIndex());
+ }
+ }
+
+ @Override
+ public CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey) {
+ return baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, barKey);
+ }
+
+ @Override
+ public void updateDisplayStatus(String id, Boolean display) {
+ baseDao.updateDisplayStatus(id, display);
+ }
+
+ @Transactional
+ @Override
+ public void addDefault4Customer(String customerId, String appType) {
+ List defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType);
+ for (CustomerFootBarEntity defaultBar : defaultBars) {
+ CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, defaultBar.getBarKey());
+ if (bar != null) {
+ // 该客户已经有该bar了,不再添加
+ continue;
+ }
+
+ defaultBar.setCustomerId(customerId);
+ defaultBar.setId(null);
+ defaultBar.setCreatedTime(null);
+ defaultBar.setCreatedBy(null);
+ defaultBar.setUpdatedTime(null);
+ defaultBar.setUpdatedBy(null);
+ baseDao.insert(defaultBar);
+ }
+ }
+
+ @Override
+ public void deleteFootBar(String id) {
+ CustomerFootBarEntity defaultFootbar = baseDao.selectById(id);
+ baseDao.physicsDeleteByAppTypeAndBarKey(defaultFootbar.getAppType(), defaultFootbar.getBarKey());
+ }
+
+ /**
+ * 添加footbar之前的校验
+ * @param form
+ */
+ private void validateBeforeCreate(CustomerFootBarFormDTO form) {
+ synchronized (this) {
+ int uniqueCount1 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), form.getBarKey(), null);
+ int uniqueCount2 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), null, form.getBarName());
+ if (uniqueCount1 > 0 || uniqueCount2 > 0) {
+ throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(),
+ EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg());
+ }
+ }
+ }
+
+ private void validateBeforeUpdate(CustomerFootBarFormDTO form) {
+ synchronized (this) {
+ CustomerFootBarEntity entity = baseDao.getByAppTypeAndBarNameOfCustomer(form.getCustomerId(), form.getAppType(), form.getBarName());
+ if (entity != null && !entity.getId().equals(form.getId())) {
+ throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(),
+ EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg());
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
index f65f7d24eb..14755776eb 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
@@ -10,7 +10,7 @@ spring:
name: oper-customize-server
#环境 dev|test|prod
profiles:
- active: dev
+ active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql
new file mode 100644
index 0000000000..d6301a196a
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql
@@ -0,0 +1,2 @@
+alter table customer_foot_bar add column DISPLAY tinyint(1) default 1;
+alter table customer_foot_bar change `ORDER` ORDER_INDEX tinyint(1) default 1;
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
index e41b42ddb3..b320a9c1d2 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
@@ -11,7 +11,8 @@
-
+
+
@@ -20,34 +21,194 @@
+
+
+ update customer_foot_bar
+ set ORDER_INDEX = #{orderIndex}
+ where ID = #{id}
+
+
+
+ update customer_foot_bar
+ set DISPLAY=#{display}
+ where ID = #{id}
+
+
+
+
+ delete
+ from customer_foot_bar
+ where ID = #{id}
+
+
+
+ delete
+ from customer_foot_bar
+ where app_type = #{appType}
+ and BAR_KEY = #{barKey}
+
+
-