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