|
|
@@ -10,6 +10,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@@ -723,6 +724,7 @@ public class StockLandService extends BaseService<StockLand> {
|
|
|
* @return void 返回类型
|
|
|
* @author jiangjz
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.SUPPORTS)
|
|
|
public ResponseMessage submit(StockLandApprovalDto slad, Integer apply_type, StockLand apply, String departmentIds) {
|
|
|
//单据id
|
|
|
int id = slad.getApply_id();
|
|
|
@@ -770,11 +772,19 @@ public class StockLandService extends BaseService<StockLand> {
|
|
|
//还有其他审核人
|
|
|
nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");
|
|
|
//保存审核记录,并更新附件
|
|
|
- saveApprovalAndUpdateAttach(slad, id, comment, nextChecker,Constant.LandApproveStatus.COMPLIANCE_AUDIT,type == 5?Constant.OperType.SUBMIT_COMMENT:Constant.OperType.REJECT,approval_round);
|
|
|
-
|
|
|
+ Approval currentApprval = saveApprovalAndUpdateAttach(slad, id, comment, nextChecker, Constant.LandApproveStatus.COMPLIANCE_AUDIT, type == 5 ? Constant.OperType.SUBMIT_COMMENT : Constant.OperType.REJECT, approval_round);
|
|
|
//如果是经办人,新增领导待办,如果是领导,不新增待办,直接完成
|
|
|
-
|
|
|
- String handler = getNextLevelByDepartment(ShiroUtils.getUserId(),nextChecker);
|
|
|
+ String handler = null;
|
|
|
+ try{
|
|
|
+ handler = getNextLevelByDepartment(ShiroUtils.getUserId(),nextChecker);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e.getMessage());
|
|
|
+ currentApprval.setIs_withdraw(Constant.True_False.TRUE);
|
|
|
+ currentApprval.setDel_flag(true);
|
|
|
+ approvalService.deleteById(currentApprval.getId());
|
|
|
+ throw new BaseException(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
if(StringUtils.isNotBlank(handler)) {
|
|
|
waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + stockLand.getId(), Constant.WaitToDo_OperType.AUDIT, stockLand.getId(),
|
|
|
Constant.DictionaryType.STOCKLAND,stockLand.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_PARALLEL);
|
|
|
@@ -1375,7 +1385,7 @@ public class StockLandService extends BaseService<StockLand> {
|
|
|
return sameCheckers;
|
|
|
}
|
|
|
|
|
|
- public void saveApprovalAndUpdateAttach(StockLandApprovalDto slad, int id, String comment, String userIdInThisGroup,String afterStatu,String Oper_type,Integer approval_round) {
|
|
|
+ public Approval saveApprovalAndUpdateAttach(StockLandApprovalDto slad, int id, String comment, String userIdInThisGroup,String afterStatu,String Oper_type,Integer approval_round) {
|
|
|
Approval approval1 = new Approval();
|
|
|
String department = "" ;
|
|
|
if(null != userService.findById(ShiroUtils.getUserId()).getDepartment_id()) {
|
|
|
@@ -1398,6 +1408,7 @@ public class StockLandService extends BaseService<StockLand> {
|
|
|
//保存审核记录
|
|
|
approvalService.insertAndGetId(approval1);
|
|
|
updateAttachment(slad, approval1.getId());
|
|
|
+ return approval1;
|
|
|
}
|
|
|
|
|
|
public String findUserIdByGroupName(String groupName) {
|