|
@@ -28,6 +28,7 @@ import javax.validation.Valid;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
@@ -36,7 +37,9 @@ import org.springblade.manager.entity.ProjectInfo;
|
|
import org.springblade.manager.entity.SignPfxDeputy;
|
|
import org.springblade.manager.entity.SignPfxDeputy;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
|
|
+import org.springblade.system.entity.DictBiz;
|
|
import org.springblade.system.entity.Role;
|
|
import org.springblade.system.entity.Role;
|
|
|
|
+import org.springblade.system.feign.IDictBizClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.vo.RoleVO;
|
|
import org.springblade.system.vo.RoleVO;
|
|
@@ -47,6 +50,7 @@ import org.springblade.manager.entity.SignPfxFile;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -75,6 +79,8 @@ public class SignPfxFileController extends BladeController {
|
|
|
|
|
|
private final ISignPfxDeputyService signPfxDeputyService;
|
|
private final ISignPfxDeputyService signPfxDeputyService;
|
|
|
|
|
|
|
|
+ private final IDictBizClient dictBizClient;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据合同段ID获取项目下的所有合同段
|
|
* 根据合同段ID获取项目下的所有合同段
|
|
* @return 结果
|
|
* @return 结果
|
|
@@ -158,6 +164,9 @@ public class SignPfxFileController extends BladeController {
|
|
@ApiOperationSupport(order = 9)
|
|
@ApiOperationSupport(order = 9)
|
|
@ApiOperation(value = "获取系统所有角色划分")
|
|
@ApiOperation(value = "获取系统所有角色划分")
|
|
public R<List<RoleSignPfxUserVO>> queryAllRoleList(@RequestParam String contractId){
|
|
public R<List<RoleSignPfxUserVO>> queryAllRoleList(@RequestParam String contractId){
|
|
|
|
+ //获取字典
|
|
|
|
+ List<DictBiz> dictBizList = this.dictBizClient.getList("pfx_type", "notRoot").getData();
|
|
|
|
+
|
|
//获取当前系统配置的角色划分
|
|
//获取当前系统配置的角色划分
|
|
List<RoleVO> roleVOS = this.sysClient.search().getData();
|
|
List<RoleVO> roleVOS = this.sysClient.search().getData();
|
|
//获取项目人员
|
|
//获取项目人员
|
|
@@ -172,6 +181,21 @@ public class SignPfxFileController extends BladeController {
|
|
pfxUnitVo.setRoleName("单位证书");
|
|
pfxUnitVo.setRoleName("单位证书");
|
|
List<SignPfxFile> unitPfxList = this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().like(SignPfxFile::getProjectContractRole, contractId));
|
|
List<SignPfxFile> unitPfxList = this.signPfxFileService.list(Wrappers.<SignPfxFile>lambdaQuery().like(SignPfxFile::getProjectContractRole, contractId));
|
|
if(unitPfxList != null && unitPfxList.size() > 0){
|
|
if(unitPfxList != null && unitPfxList.size() > 0){
|
|
|
|
+
|
|
|
|
+ unitPfxList.forEach(userSignPfx -> {
|
|
|
|
+ //存在证书则设置进结果对象的证书集合中
|
|
|
|
+ if(StringUtils.isNotEmpty(userSignPfx.getPfxType()) && dictBizList != null && dictBizList.size() > 0){
|
|
|
|
+ for(DictBiz biz : dictBizList){
|
|
|
|
+ if(userSignPfx.getPfxType().equals(biz.getDictKey())){
|
|
|
|
+ userSignPfx.setPfxType(biz.getDictValue());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ userSignPfx.setPfxType("-1");
|
|
|
|
+ }
|
|
|
|
+ } );
|
|
|
|
+
|
|
RoleSignPfxUserVO pfxChildUnitVo = new RoleSignPfxUserVO();
|
|
RoleSignPfxUserVO pfxChildUnitVo = new RoleSignPfxUserVO();
|
|
pfxChildUnitVo.setRoleId(2L);
|
|
pfxChildUnitVo.setRoleId(2L);
|
|
pfxChildUnitVo.setRoleName("单位证书");
|
|
pfxChildUnitVo.setRoleName("单位证书");
|
|
@@ -222,7 +246,6 @@ public class SignPfxFileController extends BladeController {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- //存在证书则设置进结果对象的证书集合中
|
|
|
|
childPfxUserVo.getSignPfxFileList().add(userSignPfx);
|
|
childPfxUserVo.getSignPfxFileList().add(userSignPfx);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -359,12 +382,13 @@ public class SignPfxFileController extends BladeController {
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperation(value = "新增", notes = "传入signPfxFile")
|
|
@ApiOperation(value = "新增", notes = "传入signPfxFile")
|
|
- public R save(@Valid @RequestBody SignPfxFileVO vo) {
|
|
|
|
|
|
+ public R<Boolean> save(@Valid @RequestBody SignPfxFileVO vo) {
|
|
|
|
|
|
if(new Integer("2").equals(vo.getCertificateType())){
|
|
if(new Integer("2").equals(vo.getCertificateType())){
|
|
this.saveSignPfxDeputy(vo, true);
|
|
this.saveSignPfxDeputy(vo, true);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ vo.setCreateUser(AuthUtil.getUserId());
|
|
|
|
+ vo.setCreateTime(new Date());
|
|
return R.status(this.signPfxFileService.save(vo));
|
|
return R.status(this.signPfxFileService.save(vo));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -374,7 +398,7 @@ public class SignPfxFileController extends BladeController {
|
|
@PostMapping("/update")
|
|
@PostMapping("/update")
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperation(value = "修改", notes = "传入signPfxFile")
|
|
@ApiOperation(value = "修改", notes = "传入signPfxFile")
|
|
- public R update(@Valid @RequestBody SignPfxFileVO vo) {
|
|
|
|
|
|
+ public R<Boolean> update(@Valid @RequestBody SignPfxFileVO vo) {
|
|
if(new Integer("2").equals(vo.getCertificateType())){
|
|
if(new Integer("2").equals(vo.getCertificateType())){
|
|
//查询旧数据
|
|
//查询旧数据
|
|
SignPfxFile oldData = this.signPfxFileService.getById(vo.getId());
|
|
SignPfxFile oldData = this.signPfxFileService.getById(vo.getId());
|
|
@@ -428,7 +452,7 @@ public class SignPfxFileController extends BladeController {
|
|
@PostMapping("/remove")
|
|
@PostMapping("/remove")
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
|
|
|
+ public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
|
|
return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
|
|
}
|
|
}
|
|
|
|
|