Commit 70177008 by 翁国栋

Merge remote-tracking branch 'origin/feature_20220222_huayi' into feature_20220222_huayi

# Conflicts:
#	src/main/java/cn/timer/api/controller/spmk/SpmkController.java
#	src/main/java/cn/timer/api/controller/spmk/service/SpmkService.java
#	src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
#	src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
parents 1e161490 ed3e6247
......@@ -34,7 +34,7 @@ import lombok.NoArgsConstructor;
public class SpmkApprovalG extends Model<SpmkApprovalG> {
/**
*
*
*/
private static final long serialVersionUID = 1L;
......@@ -58,5 +58,4 @@ public class SpmkApprovalG extends Model<SpmkApprovalG> {
@ApiModelProperty(value = "是否可编辑 0是 1否", example = "101")
private Integer isEditable;
}
\ No newline at end of file
}
......@@ -114,7 +114,6 @@ public class SpmkController {
@Autowired
private SpmkApproveDetailDraftsMapper spmkApproveDetailDraftsMapper;
private static com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
private boolean ISFIRST = true; // 第一次启动审批流程
......@@ -125,6 +124,7 @@ public class SpmkController {
@Autowired
private SpmkApproveDraftsMapper spmkApproveDraftsMapper;
//TODO 审批模板组
/**
* 新增或编辑-审批模板组
......@@ -758,19 +758,6 @@ public class SpmkController {
}
/**
* 审批详情
*/
@GetMapping(value = "/select_drafts_detail/{id}")
@ApiOperation(value = "草稿箱审批详情", httpMethod = "GET", notes = "审批详情")
@Log(title = "审批-审批详情", businessType = BusinessType.OTHER)
public Result<Object> selectdd(@CurrentUser UserBean userBean,@PathVariable(required = true) Integer id) {
SpmkApproveDetailDto adD = spmkService.selectDraftsDetailByAsId(id);
System.out.println(ResultUtil.data(adD));
return ResultUtil.data(adD);
}
//TODO 审批人审批
/**
* 审批人审批
......@@ -1209,89 +1196,89 @@ public class SpmkController {
@Log(title = "审批-存入草稿箱", businessType = BusinessType.INSERT)
public Result<Object> saveDrafts(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{
try {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
);
if (ygglMainEmp == null)
return ResultUtil.error("发起人不存在!");
if (ygglMainEmp == null)
return ResultUtil.error("发起人不存在!");
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
Router router = spmkApproveSummaryDto.getRouter();
Router router = spmkApproveSummaryDto.getRouter();
// routers = RouterUtils.clearRouters(routers);
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if(ent != null) {
/*超管和管理员不受权限控制*/
if(ent.getUserType() == 2) {
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId,userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId,"/Approvalspbutonspbuton020101"));
/*如果没有该权限*/
if(zzglAuth==null){
SpmkCustomApproval ca = SpmkCustomApproval.builder().build().selectOne(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName,spmkApproveSummaryDto.getApproveName()).eq(SpmkCustomApproval::getOrgCode,userBean.getOrgCode()));
Router oldRouter=ObjectUtil.deserialize(ca.getRouter());
if(isTrue(router.getChildren(),oldRouter.getChildren())){
return ResultUtil.error("您没有新增审批人的权限");
}
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if(ent != null) {
/*超管和管理员不受权限控制*/
if(ent.getUserType() == 2) {
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId,userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId,"/Approvalspbutonspbuton020101"));
/*如果没有该权限*/
if(zzglAuth==null){
SpmkCustomApproval ca = SpmkCustomApproval.builder().build().selectOne(new QueryWrapper<SpmkCustomApproval>().lambda()
.eq(SpmkCustomApproval::getName,spmkApproveSummaryDto.getApproveName()).eq(SpmkCustomApproval::getOrgCode,userBean.getOrgCode()));
Router oldRouter=ObjectUtil.deserialize(ca.getRouter());
if(isTrue(router.getChildren(),oldRouter.getChildren())){
return ResultUtil.error("您没有新增审批人的权限");
}
}
}
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(router);
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.set("orgCode", userBean.getOrgCode())
.set("initiator", ygglMainEmp.getName())
.set("headUrl", ygglMainEmp.getHeadUrl())
.set("id", userBean.getEmpNum());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter,listFlowChildren);
String currentApprover = jSONObject.getStr("current_approver");
}
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(router);
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.set("orgCode", userBean.getOrgCode())
.set("initiator", ygglMainEmp.getName())
.set("headUrl", ygglMainEmp.getHeadUrl())
.set("id", userBean.getEmpNum());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
RouterUtils.getIsFlowChildren(listRouter,listFlowChildren);
String currentApprover = jSONObject.getStr("current_approver");
SpmkApproveDrafts as = SpmkApproveDrafts
.builder()
.orgCode(userBean.getOrgCode())
.empNum(userBean.getEmpNum())
.title(spmkApproveSummaryDto.getTitle())
.initiator(spmkApproveSummaryDto.getInitiator())
.approveName(spmkApproveSummaryDto.getApproveName())
.assoType(spmkApproveSummaryDto.getAssoType())
.sts(ApproveSummarySts.IN.ordinal())
.currentApprover(currentApprover).isUrgent(spmkApproveSummaryDto.getIsUrgent())
.build();
.builder()
.orgCode(userBean.getOrgCode())
.empNum(userBean.getEmpNum())
.title(spmkApproveSummaryDto.getTitle())
.initiator(spmkApproveSummaryDto.getInitiator())
.approveName(spmkApproveSummaryDto.getApproveName())
.assoType(spmkApproveSummaryDto.getAssoType())
.sts(ApproveSummarySts.IN.ordinal())
.currentApprover(currentApprover).isUrgent(spmkApproveSummaryDto.getIsUrgent())
.build();
if(spmkApproveSummaryDto.getId()!=null){
as.setId(spmkApproveSummaryDto.getId());
as.setUpdateTime(new Date());
as.setId(spmkApproveSummaryDto.getId());
as.setUpdateTime(new Date());
}
if (!as.insertOrUpdate()) {
throw new CustomException("审批草稿汇总-新增异常");
}
// 草稿不插入执审批流程
if (!as.insertOrUpdate()) {
throw new CustomException("审批草稿汇总-新增异常");
}
// 草稿不插入执审批流程
// RouterUtils.insertogExecuteRecord(listFlowChildren, as.getId());
// 封装 审批详情
SpmkApproveDetailDrafts adm = SpmkApproveDetailDrafts.builder().build();
adm.setApproveSummaryId(as.getId());
adm.setName(spmkApproveSummaryDto.getTitle());
adm.setRequestData(spmkApproveSummaryDto.getRequestData().toString());
adm.setFroms(spmkApproveSummaryDto.getFroms().toString());
adm.setRouter(listRouter.get(0).toJSONString());
adm.setFlowChildren(JSONArray.fromObject(listFlowChildren).toString());
// 封装 审批详情
SpmkApproveDetailDrafts adm = SpmkApproveDetailDrafts.builder().build();
adm.setApproveSummaryId(as.getId());
adm.setName(spmkApproveSummaryDto.getTitle());
adm.setRequestData(spmkApproveSummaryDto.getRequestData().toString());
adm.setFroms(spmkApproveSummaryDto.getFroms().toString());
adm.setRouter(listRouter.get(0).toJSONString());
adm.setFlowChildren(JSONArray.fromObject(listFlowChildren).toString());
if(spmkApproveSummaryDto.getId()!=null){
SpmkApproveDetailDrafts sp = SpmkApproveDetailDrafts.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailDrafts>().lambda().eq(SpmkApproveDetailDrafts::getApproveSummaryId,spmkApproveSummaryDto.getId()));
adm.setId(sp.getId());
spmkApproveDetailDraftsMapper.updateById(adm);
}else {
spmkApproveDetailDraftsMapper.insert(adm);
}
return ResultUtil.data(as.getId());
if(spmkApproveSummaryDto.getId()!=null){
SpmkApproveDetailDrafts sp = SpmkApproveDetailDrafts.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailDrafts>().lambda().eq(SpmkApproveDetailDrafts::getApproveSummaryId,spmkApproveSummaryDto.getId()));
adm.setId(sp.getId());
spmkApproveDetailDraftsMapper.updateById(adm);
}else {
spmkApproveDetailDraftsMapper.insert(adm);
}
return ResultUtil.data(as.getId());
}catch (Exception e){
// throw new CustomException("审批草稿详情-新增异常");
e.printStackTrace();
......
......@@ -17,4 +17,5 @@ public interface SpmkService {
String addApproveDetail();
SpmkApproveDetailDto selectDraftsDetailByAsId(Integer asId);
}
......@@ -64,4 +64,5 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty
private Integer id;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment