Browse Source

Merge branches 'dev' and 'dev_thirdplatform' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_thirdplatform

master
sunyuchao 5 years ago
parent
commit
6c4b4f27ff
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 4
      epmet-auth/pom.xml
  3. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  4. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  5. 11
      epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/GovFootBarFormDTO.java
  6. 2
      epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml
  7. 2
      epmet-module/gov-mine/gov-mine-server/pom.xml
  8. 18
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java
  9. 21
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java
  10. 22
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java
  11. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml
  12. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml
  13. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  14. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  15. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  16. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java
  17. 11
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  18. 11
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  19. 2
      epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml
  20. 2
      epmet-module/oper-customize/oper-customize-server/pom.xml
  21. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
  22. 3
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
  23. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
  24. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
  25. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
  26. 11
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.2__add_footbar_columns.sql
  27. 22
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
  28. 10
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/ResiFootBarFormDTO.java
  29. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml
  30. 9
      epmet-module/resi-mine/resi-mine-server/pom.xml
  31. 39
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/app/controller/AppController.java
  32. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java
  33. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  34. 2
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml
  35. 2
      epmet-user/epmet-user-server/pom.xml
  36. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  37. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  38. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  39. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  40. 1
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.4__add_rootmanager.sql
  41. 18
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

2
epmet-auth/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.44
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.47
ports:
- "8081:8081"
network_mode: host # 使用现有网络

4
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.44</version>
<version>0.3.47</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>
@ -182,6 +182,8 @@
<!--政府端小程序配置-->
<gov.wx.ma.appId>wx3d1372029eb816a3</gov.wx.ma.appId>
<gov.wx.ma.secret>651f02d71ed3f123dfb584b8bf0f4d8b</gov.wx.ma.secret>
<!--<gov.wx.ma.appId>wx2679392c4cc2af22</gov.wx.ma.appId>
<gov.wx.ma.secret>e5e72147737cfeb2b0f3a43624cadb3f</gov.wx.ma.secret>-->
</properties>
</profile>

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.48
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.55
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.48</version>
<version>0.0.55</version>
<parent>
<groupId>com.epmet</groupId>

11
epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/GovFootBarFormDTO.java

@ -0,0 +1,11 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GovFootBarFormDTO {
//@NotBlank(message = "客户ID不能为空")
private String customerId;
}

2
epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-mine-server:
container_name: gov-mine-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-mine-server:0.3.32
image: 192.168.1.130:10080/epmet-cloud-dev/gov-mine-server:0.3.33
ports:
- "8098:8098"
network_mode: host # 使用现有网络

2
epmet-module/gov-mine/gov-mine-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.32</version>
<version>0.3.33</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-mine</artifactId>

18
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java

@ -1,9 +1,11 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.dto.form.GovFootBarFormDTO;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
@ -18,19 +20,21 @@ import java.util.List;
public class AppController {
@Autowired
private OperCustomizeFeignClient operCustomizeFeign;
private OperCustomizeOpenFeignClient operCustomizeFeign;
/**
* 查询
* @param formDTO
* @return
*/
@PostMapping("getcustomerfootbars")
public Result<List<CustomerFootBarDTO>> getCustomerFootBars(@RequestBody CustomerFootBarFormDTO formDTO) {
Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(formDTO);
public Result<List<CustomerFootBarDTO>> getCustomerFootBars(@RequestBody GovFootBarFormDTO input) {
CustomerFootBarFormDTO form = new CustomerFootBarFormDTO();
form.setCustomerId(input.getCustomerId());
form.setAppType(AppClientConstant.APP_GOV);
Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(form);
if (CollectionUtils.isEmpty(result.getData())) {
formDTO.setCustomerId("default");
result = operCustomizeFeign.getCustomerfootbars(formDTO);
form.setCustomerId("default");
result = operCustomizeFeign.getCustomerfootbars(form);
}
return result;
}

21
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java

@ -1,21 +0,0 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.fallback.OperCustomizeFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class)
public interface OperCustomizeFeignClient {
@PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO);
}

22
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java

@ -1,22 +0,0 @@
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.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerHomeFormDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.feign.OperCustomizeFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class OperCustomizeFeignClientFallBack implements OperCustomizeFeignClient {
@Override
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(CustomerFootBarFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars",formDTO);
}
}

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.28
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.30
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.25
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.29
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.28</version>
<version>0.3.30</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-crm</artifactId>

2
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -197,7 +197,7 @@ public class CustomerController {
/**
*
* 添加管理员
* 添加管理员(不能被取消角色的管理员)
* @param form
* @return
*/

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -158,7 +158,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
//2.查询客户的根级组织对应的管理员角色列表,批量查询
StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO();
staffRoleFormDTO.setOrgIds(rootAgencyIds);
staffRoleFormDTO.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);// TODO ,此处应该将所有的角色key放到EpmetUser的client中
staffRoleFormDTO.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER);// TODO ,此处应该将所有的角色key放到EpmetUser的client中
Result<Map<String, List<GovStaffRoleResultDTO>>> managersResult = epmetUserFeignClient.getStaffsInRoleOfOrgs(staffRoleFormDTO);
if (managersResult.success()) {
Map<String, List<GovStaffRoleResultDTO>> rootAgencyManagerMap = managersResult.getData();
@ -250,7 +250,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
// 查询客户具有指定RoleKey的角色信息
CustomerRoleFormDTO customerRoleForm = new CustomerRoleFormDTO();
customerRoleForm.setCustomerId(form.getCustomerId());
customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);
// customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_MANAGER);
customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER);
Result<GovStaffRoleDTO> getRoleResult = epmetUserFeignClient.getRoleOfCustomer(customerRoleForm);
if (!getRoleResult.success()) {
log.error("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString()));

4
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java

@ -10,4 +10,8 @@ public class CustomerFootBarFormDTO {
//@NotBlank(message = "客户ID不能为空")
private String customerId;
// 哪一个端:gov,resi
@NotBlank(message = "app类型不能为空")
private String appType;
}

11
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -1,9 +1,17 @@
package com.epmet.feign;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -14,4 +22,7 @@ import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback;
@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class)
public interface OperCustomizeOpenFeignClient {
@PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO);
}

11
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -1,8 +1,15 @@
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.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
*
@ -11,4 +18,8 @@ import org.springframework.stereotype.Component;
*/
@Component
public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient {
@Override
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(CustomerFootBarFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars", formDTO);
}
}

2
epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-customize-server:
container_name: oper-customize-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.23
image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.24
ports:
- "8089:8089"
network_mode: host # 使用现有网络

2
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.23</version>
<version>0.3.24</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-customize</artifactId>

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java

@ -35,6 +35,7 @@ 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;
@ -104,8 +105,9 @@ public class CustomerFootBarController {
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
String customerId = formDTO.getCustomerId();
String appType = formDTO.getAppType();
List<CustomerFootBarEntity> footbars = customerFootBarService.listCustomerFootBars(customerId);
List<CustomerFootBarEntity> footbars = customerFootBarService.listCustomerFootBars(customerId, appType);
List<CustomerFootBarDTO> barDTOS = new LinkedList<>();
footbars.forEach(barEntity -> {
CustomerFootBarDTO barDTO = new CustomerFootBarDTO();

3
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java

@ -33,5 +33,6 @@ import java.util.List;
@Mapper
public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
List<CustomerFootBarEntity> listCustomerFootBars(@Param("customerId") String customerId);
List<CustomerFootBarEntity> listCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType);
}

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java

@ -48,6 +48,8 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/
private String barKey;
private String appType;
/**
* 页面标题
*/
@ -63,4 +65,6 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/
private String selectedIconPath;
private Integer order;
}

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java

@ -93,5 +93,5 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
*/
void delete(String[] ids);
List<CustomerFootBarEntity> listCustomerFootBars(String customerId);
List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType);
}

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java

@ -102,8 +102,8 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
}
@Override
public List<CustomerFootBarEntity> listCustomerFootBars(String customerId) {
return baseDao.listCustomerFootBars(customerId);
public List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType) {
return baseDao.listCustomerFootBars(customerId, appType);
}
}

11
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.2__add_footbar_columns.sql

@ -0,0 +1,11 @@
alter table customer_foot_bar add column `app_type` varchar(20) not null after `CUSTOMER_ID`;
alter table customer_foot_bar add column `order` int(2) not null after `SELECTED_ICON_PATH`;
update customer_foot_bar set `app_type`='gov' , `order`=1 where CUSTOMER_ID='default' and BAR_KEY='work';
update customer_foot_bar set `app_type`='gov' , `order`=2 where CUSTOMER_ID='default' and BAR_KEY='org';
update customer_foot_bar set `app_type`='gov' , `order`=3 where CUSTOMER_ID='default' and BAR_KEY='data';
update customer_foot_bar set `app_type`='gov' , `order`=4 where CUSTOMER_ID='default' and BAR_KEY='find';
INSERT INTO epmet_oper_customize.customer_foot_bar (ID, CUSTOMER_ID, app_type, BAR_KEY, BAR_NAME, PAGE_TITLE, ICON_PATH, SELECTED_ICON_PATH, `order`, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES (uuid(), 'default', 'resi', 'garden', '党建园地', '党建园地', null, null, 1, 0, 0, 'APP_USER', now(), 'APP_USER', now());
INSERT INTO epmet_oper_customize.customer_foot_bar (ID, CUSTOMER_ID, app_type, BAR_KEY, BAR_NAME, PAGE_TITLE, ICON_PATH, SELECTED_ICON_PATH, `order`, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES (uuid(), 'default', 'resi', 'issue', '党群议事', '党群议事', null, null, 2, 0, 0, 'APP_USER', now(), 'APP_USER', now());
INSERT INTO epmet_oper_customize.customer_foot_bar (ID, CUSTOMER_ID, app_type, BAR_KEY, BAR_NAME, PAGE_TITLE, ICON_PATH, SELECTED_ICON_PATH, `order`, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES (uuid(), 'default', 'resi', 'group', '楼院小组', '楼院小组', null, null, 3, 0, 0, 'APP_USER', now(), 'APP_USER', now());

22
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

@ -7,9 +7,11 @@
<result property="id" column="ID"/>
<result property="barName" column="BAR_NAME"/>
<result property="barKey" column="BAR_KEY"/>
<result property="appType" column="APP_TYPE"/>
<result property="pageTitle" column="PAGE_TITLE"/>
<result property="iconPath" column="ICON_PATH"/>
<result property="selectedIconPath" column="SELECTED_ICON_PATH"/>
<result property="order" column="ORDER"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -21,13 +23,31 @@
<!--查询客户的footbar列表-->
<select id="listCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
SELECT
*
id,
customer_id,
app_type,
bar_key,
bar_name,
app_type,
page_title,
icon_path,
selected_icon_path,
`order`,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time,
`order`
FROM
customer_foot_bar
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND APP_TYPE = #{appType}
</where>
ORDER BY `order` ASC
</select>

10
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/ResiFootBarFormDTO.java

@ -0,0 +1,10 @@
package com.epmet.resi.mine.dto.from;
import lombok.Data;
@Data
public class ResiFootBarFormDTO {
private String customerId;
}

2
epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-mine-server:
container_name: resi-mine-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.29
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.30
ports:
- "8094:8094"
network_mode: host # 使用现有网络

9
epmet-module/resi-mine/resi-mine-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.29</version>
<version>0.3.30</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>resi-mine</artifactId>
@ -83,6 +83,13 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-customize-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

39
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/app/controller/AppController.java

@ -0,0 +1,39 @@
package com.epmet.modules.app.controller;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.resi.mine.dto.from.ResiFootBarFormDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
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 java.util.List;
@RestController
@RequestMapping("app")
public class AppController {
@Autowired
private OperCustomizeOpenFeignClient operCustomizeFeign;
@PostMapping("footbar")
public Result getResiFootBars(@RequestBody ResiFootBarFormDTO input) {
CustomerFootBarFormDTO form = new CustomerFootBarFormDTO();
form.setCustomerId(input.getCustomerId());
form.setAppType(AppClientConstant.APP_RESI);
Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(form);
if (CollectionUtils.isEmpty(result.getData())) {
form.setCustomerId("default");
result = operCustomizeFeign.getCustomerfootbars(form);
}
return result;
}
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java

@ -9,6 +9,11 @@ public class RoleKeyConstants {
*/
public static final String ROLE_KEY_MANAGER = "manager";
/**
* 根管理员(不能通过工作端取消的角色且不会再工作端显示)
*/
public static final String ROLE_KEY_ROOT_MANAGER = "root_manager";
/**
* 党建负责人
*/

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.77
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.79
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.75
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.79
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.77</version>
<version>0.3.79</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -98,4 +98,6 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @return java.util.List<com.epmet.dto.result.CustomerStaffRoleResultDTO>
*/
List<CustomerStaffRoleResultDTO> selectStaffRoles(@Param("staffId") String staffId);
List<StaffRoleEntity> listStaffRoleEntytiesByStaffIdAndOrgId(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java

@ -148,4 +148,6 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
* @return java.util.List<com.epmet.dto.result.CustomerStaffRoleResultDTO>
*/
List<CustomerStaffRoleResultDTO> getStaffRoles(String staffId);
List<StaffRoleEntity> getStaffRoleEntytiesByStaffIdAndOrgId(String agencyId, String staffId);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerStaffConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserConstant;
import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.CustomerStaffDao;
@ -55,6 +56,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -244,14 +246,17 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
List<GovStaffRoleDTO> roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO);
//获取工作人员角色
List<GovStaffRoleEntity> staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId());
List<StaffRoleResultDTO> staffRoleList = roleList.stream().map(p -> {
StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO();
staffRoleResultDTO.setRoleId(p.getId());
staffRoleResultDTO.setRoleName(p.getRoleName());
staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly());
staffRoleResultDTO.setSelected(false);
return staffRoleResultDTO;
}).collect(Collectors.toList());
List<StaffRoleResultDTO> staffRoleList = roleList
.stream()
.filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey()))
.map(p -> {
StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO();
staffRoleResultDTO.setRoleId(p.getId());
staffRoleResultDTO.setRoleName(p.getRoleName());
staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly());
staffRoleResultDTO.setSelected(false);
return staffRoleResultDTO;
}).collect(Collectors.toList());
staffRoleList.forEach(role -> staffRoles.forEach(staffRole -> {
if (role.getRoleId().equals(staffRole.getId())) {
@ -337,11 +342,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffRoleService.insert(staffRoleEntity);
});
// 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员)
List<StaffRoleEntity> staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId());
List<String> roleIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) {
roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList());
}
// redis缓存角色修改
UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO();
updateRolesForm.setOrgId(fromDTO.getAgencyId());
updateRolesForm.setStaffId(fromDTO.getStaffId());
updateRolesForm.setRoleIds(fromDTO.getRoles());
updateRolesForm.setRoleIds(roleIds);
try {
Result result = authFeignClient.updateCachedRoles(updateRolesForm);
if (!result.success()) {

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -19,7 +19,6 @@ 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.annotation.DataFilter;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
@ -36,9 +35,7 @@ import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.StaffRoleService;
@ -180,4 +177,9 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
return baseDao.selectStaffRoles(staffId);
}
@Override
public List<StaffRoleEntity> getStaffRoleEntytiesByStaffIdAndOrgId(String agencyId, String staffId) {
return baseDao.listStaffRoleEntytiesByStaffIdAndOrgId(agencyId, staffId);
}
}

1
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.4__add_rootmanager.sql

@ -0,0 +1 @@
INSERT INTO epmet_user.gov_staff_role_template (ID, ROLE_KEY, ROLE_NAME, ORG_TYPE, FULL_TIME_ONLY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES (uuid(), 'root_manager', '根管理员', 'agency', 1, 0, 0, 'APP_USER', now(), 'APP_USER', now());

18
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -17,11 +17,11 @@
</resultMap>
<update id="delStaffRoles" parameterType="com.epmet.dto.StaffRoleDTO">
update
staff_role
set DEL_FLAG = '1'
where STAFF_ID = #{staffId}
and ORG_ID = #{orgId}
and DEL_FLAG = '0'
staff_role sr inner join gov_staff_role gsr on (sr.ROLE_ID = gsr.ID and gsr.ROLE_KEY != 'root_manager')
set sr.DEL_FLAG = '1'
where sr.STAFF_ID = #{staffId}
and sr.ORG_ID = #{orgId}
and sr.DEL_FLAG = '0'
</update>
@ -156,4 +156,12 @@
AND gsr.del_flag = '0'
AND sr.staff_id = #{staffId}
</select>
<select id="listStaffRoleEntytiesByStaffIdAndOrgId" resultType="com.epmet.entity.StaffRoleEntity">
select *
from staff_role sr
where sr.STAFF_ID = #{staffId}
and sr.ORG_ID = #{agencyId}
and sr.DEL_FLAG='0'
</select>
</mapper>
Loading…
Cancel
Save