|
@@ -58,13 +58,13 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
|
|
|
// queryWrapper.eq("order_type", "");
|
|
|
queryWrapper.eq("status", 0);
|
|
|
queryWrapper.eq("del_flag", 0);
|
|
|
- List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
|
|
|
+ List<BaseApproverHead> headList = baseApproverHeadMapper.selectList(queryWrapper);
|
|
|
|
|
|
- if (head.size() == 0) {
|
|
|
+ if (headList.size() == 0) {
|
|
|
throw new JeecgBootException("该单据无需审批");
|
|
|
}
|
|
|
-
|
|
|
- List<BaseApproverDetails> list = baseApproverDetailsMapper.selectByMainId(head.get(0).getId());
|
|
|
+ BaseApproverHead head = headList.get(0);
|
|
|
+ List<BaseApproverDetails> list = baseApproverDetailsMapper.selectByMainId(head.getId());
|
|
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String userName = sysUser.getUsername();
|
|
@@ -126,7 +126,7 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
|
|
|
detail.setApproverInfo(approveInfo);
|
|
|
baseApproverDetailsMapper.updateById(detail);
|
|
|
|
|
|
- List<BaseApproverDetails> list2 = baseApproverDetailsMapper.selectByMainId(head.get(0).getId());
|
|
|
+ List<BaseApproverDetails> list2 = baseApproverDetailsMapper.selectByMainId(head.getId());
|
|
|
for (BaseApproverDetails o : list2) {
|
|
|
|
|
|
int isEnd = o.getIsEnd() == null ? 0 : o.getIsEnd();//是否即将审批(1-是,0-否)
|
|
@@ -140,13 +140,17 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
|
|
|
}
|
|
|
|
|
|
List<BaseApproverDetails> childListNext = findMinObjects(list2, nextIndex);
|
|
|
+ if(childListNext.size()==0){
|
|
|
+ head.setStatus(approveType);
|
|
|
+ baseApproverHeadMapper.updateById(head);
|
|
|
+ }
|
|
|
for (BaseApproverDetails o : childListNext) {
|
|
|
//是否即将审批(1-是,0-否)
|
|
|
o.setIsEnd(1);
|
|
|
baseApproverDetailsMapper.updateById(o);
|
|
|
}
|
|
|
|
|
|
- return "true";
|
|
|
+ return "执行成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -155,24 +159,24 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String submitApproveReturn( String orderId) {
|
|
|
-
|
|
|
- QueryWrapper<BaseApproverHead> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("order_id", orderId);
|
|
|
-// queryWrapper.eq("order_type", "");
|
|
|
- queryWrapper.eq("status", 1);
|
|
|
- queryWrapper.eq("del_flag", 0);
|
|
|
- List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
|
|
|
-
|
|
|
- if(head.size() > 0){
|
|
|
-
|
|
|
- return "该订单已审批结束,无法取消";
|
|
|
-
|
|
|
- }else{
|
|
|
+ public String submitApproveReturn(String orderId) {
|
|
|
+
|
|
|
+// QueryWrapper<BaseApproverHead> queryWrapper = new QueryWrapper<>();
|
|
|
+// queryWrapper.eq("order_id", orderId);
|
|
|
+//// queryWrapper.eq("order_type", "");
|
|
|
+// queryWrapper.eq("status", 1);
|
|
|
+// queryWrapper.eq("del_flag", 0);
|
|
|
+// List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
|
|
|
+//
|
|
|
+// if(head.size() > 0){
|
|
|
+//
|
|
|
+// return "该订单已审批结束,无法取消";
|
|
|
+//
|
|
|
+// }else{
|
|
|
baseApproverHeadMapper.deleteHeadByOrderId(orderId);
|
|
|
baseApproverHeadMapper.deleteChildByOrderId(orderId);
|
|
|
return null;
|
|
|
- }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
}
|
|
@@ -229,7 +233,7 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
|
|
|
|
|
|
//仅查看(1-是,0-否)
|
|
|
child.setIsView(o.getIsView());
|
|
|
- if (o.getIsView() == 0) {
|
|
|
+ if (o.getIsView() == 1) {
|
|
|
isView = true;
|
|
|
}
|
|
|
|