Browse Source

数字平台初始化新增默认角色信息

master
sunyuchao 3 years ago
parent
commit
63924cb4a0
  1. 4
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java
  2. 5
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java
  3. 10
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java
  4. 2
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java
  5. 17
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java
  6. 6
      epmet-module/oper-customize/oper-customize-server/pom.xml
  7. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java

4
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java

@ -9,6 +9,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.NewUserRoleResultDTO;
import com.epmet.feign.fallback.GovAccessFeignClientFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -64,4 +65,7 @@ public interface GovAccessFeignClient {
@PostMapping("/gov/access/govrole/getgovrole")
Result<GovRoleDTO> getGovRole(@RequestBody GovRoleListDTO formDTO);
@PostMapping("/gov/access/govrole/initgovrole/{customerId}")
Result initGovRole(@PathVariable(value = "customerId") String customerId);
}

5
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java

@ -50,4 +50,9 @@ public class GovAccessFeignClientFallBack implements GovAccessFeignClient {
public Result<GovRoleDTO> getGovRole(GovRoleListDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getGovRole", formDTO);
}
@Override
public Result initGovRole(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "initGovRole", customerId);
}
}

10
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java

@ -108,4 +108,14 @@ public class GovRoleController {
return new Result<GovRoleDTO>().ok(govRoleService.getGovRole(fromDTO));
}
/**
* 数字平台客户初始化化设置默认角色数据
* @Author sun
*/
@PostMapping("initgovrole/{customerId}")
public Result initGovRole(@PathVariable(value = "customerId") String customerId){
govRoleService.initGovRole(customerId);
return new Result();
}
}

2
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java

@ -95,4 +95,6 @@ public interface GovRoleService extends BaseService<GovRoleEntity> {
void delete(String[] ids);
GovRoleDTO getGovRole(GovRoleListDTO fromDTO);
void initGovRole(String customerId);
}

17
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java

@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -135,4 +136,20 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit
return baseDao.selectGovRole(fromDTO.getCustomerId(), fromDTO.getName());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void initGovRole(String customerId) {
List<GovRoleEntity> list = new ArrayList<>();
GovRoleEntity entity = new GovRoleEntity();
entity.setCustomerId(customerId);
entity.setName("联建单位负责人");
entity.setRemark("默认角色");
entity.setDefaultRole("1");
list.add(entity);
GovRoleEntity entity1 = entity;
entity1.setName("社区自组织负责人");
list.add(entity1);
insertBatch(list);
}
}

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

@ -95,6 +95,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-access-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java

@ -37,6 +37,7 @@ import com.epmet.dto.result.FormGroupDTO;
import com.epmet.dto.result.FormItemResult;
import com.epmet.entity.*;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.GovAccessFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.redis.CustomerFootBarRedis;
import com.epmet.service.IcFormService;
@ -83,6 +84,8 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Resource
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Resource
private GovAccessFeignClient govAccessFeignClient;
/**
* 获取居民信息表单
@ -329,6 +332,12 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
throw new EpmetException(dictResult.getCode(), dictResult.getMsg());
}
//7-29 初始化为客户设置(联建单位负责人、社区自组织负责人)两个默认角色数据
Result accessResult = govAccessFeignClient.initGovRole(customerId);
if (!accessResult.success()) {
throw new EpmetException(accessResult.getCode(), accessResult.getMsg());
}
return "初始化成功!客户ID:" + customerId + " formCode:" + formCode;
}
}

Loading…
Cancel
Save