|
|
@@ -25,11 +25,14 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.bank.autodata.dto.AutoDataDTO;
|
|
|
import org.springblade.bank.autodata.entity.ApproveBean;
|
|
|
import org.springblade.bank.autodata.entity.AutoData;
|
|
|
import org.springblade.bank.autodata.service.IAutoDataService;
|
|
|
import org.springblade.bank.autodata.vo.AutoDataVO;
|
|
|
import org.springblade.bank.autodata.wrapper.AutoDataWrapper;
|
|
|
+import org.springblade.bank.autosetting.entity.AutoSetting;
|
|
|
+import org.springblade.bank.autosetting.service.IAutoSettingService;
|
|
|
import org.springblade.bank.autostruct.entity.AutoStruct;
|
|
|
import org.springblade.bank.autostruct.service.IAutoStructService;
|
|
|
import org.springblade.bank.constant.*;
|
|
|
@@ -71,6 +74,7 @@ public class AutoDataController extends BladeController {
|
|
|
private final IAutoStructService autoStructService;
|
|
|
private final IDeptService deptService;
|
|
|
private final IUserService userService;
|
|
|
+ private final IAutoSettingService autoSettingService;
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
@@ -135,6 +139,7 @@ public class AutoDataController extends BladeController {
|
|
|
IPage<AutoDataVO> pages = autoDataService.selectAutoDataPage(Condition.getPage(query), autoData);
|
|
|
List<AutoDataVO> records = pages.getRecords();
|
|
|
List<AutoDataVO> list = new ArrayList<>();
|
|
|
+ boolean flag = ApproveSwitch.OPEN.equals(autoStruct.getApproveSwitch()) && ApproveType.SERIAL.equals(autoStruct.getApproveType()) && SettingType.GRADUALLY.equals(autoStruct.getSettingType());
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
AutoDataVO autoDataVO = new AutoDataVO();
|
|
|
BeanUtil.copyProperties(records.get(i), autoDataVO);
|
|
|
@@ -142,6 +147,13 @@ public class AutoDataController extends BladeController {
|
|
|
if (createUser != null){
|
|
|
autoDataVO.setCreateUserName(createUser.getName());
|
|
|
}
|
|
|
+ if (flag) {
|
|
|
+ AutoSetting autoSetting = autoSettingService.getUserSettingByBusinessId(autoDataVO.getId());
|
|
|
+ if (autoSetting != null) {
|
|
|
+ autoDataVO.setCreateSettingType(autoSetting.getCreateSettingType());
|
|
|
+ autoDataVO.setCreateSetting(autoSetting.getSetting());
|
|
|
+ }
|
|
|
+ }
|
|
|
list.add(autoDataVO);
|
|
|
}
|
|
|
pages.setRecords(list);
|
|
|
@@ -154,25 +166,58 @@ public class AutoDataController extends BladeController {
|
|
|
@PostMapping("/save")
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "新增", notes = "传入autoData")
|
|
|
- public R save(@Valid @RequestBody AutoData autoData) {
|
|
|
+ public R save(@Valid @RequestBody AutoDataDTO autoData) {
|
|
|
+ autoDataService.save(autoData);
|
|
|
autoData.setProcess(Process.FIRST);
|
|
|
autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
|
|
|
Long tableId = autoData.getTableId();
|
|
|
AutoStruct struct = autoStructService.getById(tableId);
|
|
|
// if (struct.getApproveType().equals(1) && struct.getSettingType().equals(1)){
|
|
|
- if (new Integer(1).equals(struct.getApproveSwitch())){
|
|
|
- JSONArray jsonArray = JSONUtil.parseArray(struct.getSetting());
|
|
|
+ if (ApproveSwitch.OPEN.equals(struct.getApproveSwitch())){
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(StringUtil.isBlank(struct.getSetting()) ? "[]" : struct.getSetting());
|
|
|
// 串行 & 统一设置
|
|
|
- if (new Integer(1).equals(struct.getApproveType()) && new Integer(1).equals(struct.getSettingType())){
|
|
|
- // 取出下一個審批人
|
|
|
- Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(0);
|
|
|
- autoData.setReceiverId(tobePerson.get("id"));
|
|
|
- autoData.setReceiverName(tobePerson.get("name"));
|
|
|
- autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ if (ApproveType.SERIAL.equals(struct.getApproveType())){
|
|
|
+ if ( SettingType.UNIFIED.equals(struct.getSettingType())){
|
|
|
+ // 取出下一個審批人
|
|
|
+ Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(0);
|
|
|
+ autoData.setReceiverId(tobePerson.get("id"));
|
|
|
+ autoData.setReceiverName(tobePerson.get("name"));
|
|
|
+ autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ }else {
|
|
|
+ // 逐級設置
|
|
|
+ AutoSetting autoSetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ if (autoSetting == null) {
|
|
|
+ autoSetting = new AutoSetting();
|
|
|
+ autoSetting.setTableId(tableId);
|
|
|
+ }
|
|
|
+ autoSetting.setCreateSettingType(autoData.getCreateSettingType());
|
|
|
+ if (CreateSettingType.All.equals(autoData.getCreateSettingType())){
|
|
|
+ autoSetting.setSetting(autoData.getCreateSetting());
|
|
|
+ JSONArray settingArray = JSONUtil.parseArray(autoData.getCreateSetting());
|
|
|
+ Map<String, String> receiverMap = (Map<String, String>) settingArray.get(0);
|
|
|
+ autoData.setReceiverId(receiverMap.get("id"));
|
|
|
+ autoData.setReceiverName(receiverMap.get("name"));
|
|
|
+ autoData.setReceiverNo(receiverMap.get("ehr"));
|
|
|
+ }else{
|
|
|
+ JSONArray settingArray = new JSONArray();
|
|
|
+ Map<String, String > tobePerson = new HashMap<>();
|
|
|
+ tobePerson.put("id", autoData.getReceiverId());
|
|
|
+ tobePerson.put("name", autoData.getReceiverName());
|
|
|
+ tobePerson.put("ehr", autoData.getReceiverNo());
|
|
|
+ settingArray.set(tobePerson);
|
|
|
+ autoSetting.setSetting(settingArray.toJSONString(0));
|
|
|
+
|
|
|
+ autoData.setReceiverId(autoData.getReceiverId());
|
|
|
+ autoData.setReceiverName(autoData.getReceiverName());
|
|
|
+ autoData.setReceiverNo(autoData.getReceiverNo());
|
|
|
+ }
|
|
|
+ autoSetting.setBusinessId(autoData.getId());
|
|
|
+ autoSettingService.saveOrUpdate(autoSetting);
|
|
|
+ }
|
|
|
}
|
|
|
// 并行
|
|
|
- if (new Integer(2).equals(struct.getApproveType())){
|
|
|
+ if (ApproveType.PARALLEL.equals(struct.getApproveType())){
|
|
|
List<String> idArr = new ArrayList<>();
|
|
|
List<String> nameArr = new ArrayList<>();
|
|
|
List<String> ehrArr = new ArrayList<>();
|
|
|
@@ -186,9 +231,10 @@ public class AutoDataController extends BladeController {
|
|
|
autoData.setReceiverName(StringUtil.join(nameArr, ","));
|
|
|
autoData.setReceiverNo(StringUtil.join(ehrArr, ","));
|
|
|
}
|
|
|
+ Assert.isTrue(!autoData.getReceiverId().contains(AuthUtil.getUserId()+""), "審批人不能為本人!");
|
|
|
}
|
|
|
|
|
|
- return R.status(autoDataService.save(autoData));
|
|
|
+ return R.status(autoDataService.saveOrUpdate(autoData));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -197,24 +243,56 @@ public class AutoDataController extends BladeController {
|
|
|
@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改", notes = "传入autoData")
|
|
|
- public R update(@Valid @RequestBody AutoData autoData) {
|
|
|
+ public R update(@Valid @RequestBody AutoDataDTO autoData) {
|
|
|
autoData.setProcess(Process.FIRST);
|
|
|
autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
|
|
|
Long tableId = autoData.getTableId();
|
|
|
AutoStruct struct = autoStructService.getById(tableId);
|
|
|
- if (new Integer(1).equals(struct.getApproveSwitch())){
|
|
|
- JSONArray jsonArray = JSONUtil.parseArray(struct.getSetting());
|
|
|
+ if (ApproveSwitch.OPEN.equals(struct.getApproveSwitch())){
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(StringUtil.isBlank(struct.getSetting()) ? "[]" : struct.getSetting());
|
|
|
// 串行 & 统一设置
|
|
|
- if (new Integer(1).equals(struct.getApproveType()) && new Integer(1).equals(struct.getSettingType())){
|
|
|
- // 取出下一個審批人
|
|
|
- Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(0);
|
|
|
- autoData.setReceiverId(tobePerson.get("id"));
|
|
|
- autoData.setReceiverName(tobePerson.get("name"));
|
|
|
- autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ if (ApproveType.SERIAL.equals(struct.getApproveType())){
|
|
|
+ if ( SettingType.UNIFIED.equals(struct.getSettingType())){
|
|
|
+ // 取出下一個審批人
|
|
|
+ Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(0);
|
|
|
+ autoData.setReceiverId(tobePerson.get("id"));
|
|
|
+ autoData.setReceiverName(tobePerson.get("name"));
|
|
|
+ autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ }else {
|
|
|
+ // 逐級設置
|
|
|
+ AutoSetting autoSetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ if (autoSetting == null) {
|
|
|
+ autoSetting = new AutoSetting();
|
|
|
+ autoSetting.setTableId(tableId);
|
|
|
+ }
|
|
|
+ autoSetting.setCreateSettingType(autoData.getCreateSettingType());
|
|
|
+ if (CreateSettingType.All.equals(autoData.getCreateSettingType())){
|
|
|
+ autoSetting.setSetting(autoData.getCreateSetting());
|
|
|
+ JSONArray settingArray = JSONUtil.parseArray(autoData.getCreateSetting());
|
|
|
+ Map<String, String> receiverMap = (Map<String, String>) settingArray.get(0);
|
|
|
+ autoData.setReceiverId(receiverMap.get("id"));
|
|
|
+ autoData.setReceiverName(receiverMap.get("name"));
|
|
|
+ autoData.setReceiverNo(receiverMap.get("ehr"));
|
|
|
+ }else{
|
|
|
+ JSONArray settingArray = new JSONArray();
|
|
|
+ Map<String, String > tobePerson = new HashMap<>();
|
|
|
+ tobePerson.put("id", autoData.getReceiverId());
|
|
|
+ tobePerson.put("name", autoData.getReceiverName());
|
|
|
+ tobePerson.put("ehr", autoData.getReceiverNo());
|
|
|
+ settingArray.set(tobePerson);
|
|
|
+ autoSetting.setSetting(settingArray.toJSONString(0));
|
|
|
+
|
|
|
+ autoData.setReceiverId(autoData.getReceiverId());
|
|
|
+ autoData.setReceiverName(autoData.getReceiverName());
|
|
|
+ autoData.setReceiverNo(autoData.getReceiverNo());
|
|
|
+ }
|
|
|
+ autoSetting.setBusinessId(autoData.getId());
|
|
|
+ autoSettingService.saveOrUpdate(autoSetting);
|
|
|
+ }
|
|
|
}
|
|
|
// 并行
|
|
|
- if (new Integer(2).equals(struct.getApproveType())){
|
|
|
+ if (ApproveType.PARALLEL.equals(struct.getApproveType())){
|
|
|
List<String> idArr = new ArrayList<>();
|
|
|
List<String> nameArr = new ArrayList<>();
|
|
|
List<String> ehrArr = new ArrayList<>();
|
|
|
@@ -228,9 +306,9 @@ public class AutoDataController extends BladeController {
|
|
|
autoData.setReceiverName(StringUtil.join(nameArr, ","));
|
|
|
autoData.setReceiverNo(StringUtil.join(ehrArr, ","));
|
|
|
}
|
|
|
+ Assert.isTrue(!autoData.getReceiverId().contains(AuthUtil.getUserId()+""), "審批人不能為本人!");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return R.status(autoDataService.updateById(autoData));
|
|
|
}
|
|
|
|
|
|
@@ -248,65 +326,93 @@ public class AutoDataController extends BladeController {
|
|
|
/**
|
|
|
* 審批通過
|
|
|
*/
|
|
|
- @PostMapping("/approveYes")
|
|
|
+ @PostMapping("/approveYes/{end}")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "審批通過", notes = "传入autoData")
|
|
|
- public R approveYes(@Valid @RequestBody AutoData autoData) {
|
|
|
+ public R approveYes(@Valid @RequestBody AutoDataDTO autoData, @PathVariable("end") Boolean end) {
|
|
|
Long tableId = autoData.getTableId();
|
|
|
AutoStruct struct = autoStructService.getById(tableId);
|
|
|
|
|
|
-
|
|
|
// 並行-直接把審批人信息追加到已審批人字段
|
|
|
AutoData oldData = autoDataService.getById(autoData.getId());
|
|
|
- if (struct.getApproveType().equals(ApproveType.PARALLEL)){
|
|
|
- if (autoData.getApproveHistory() != null){
|
|
|
- JSONArray jsonArray = JSONUtil.parseArray(autoData.getApproveHistory());
|
|
|
- JSONArray jsonArray1 = JSONUtil.parseArray(struct.getSetting());
|
|
|
- if ((jsonArray.size()+1) == jsonArray1.size()){
|
|
|
- autoData.setProcessStatus(ProcessStatus.PASSED);
|
|
|
- }else{
|
|
|
- autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- // 串行-統一設置-從設置中拿出相應位置的人員,填充到下一個審批人字段,process+1
|
|
|
- String settingStr = struct.getSetting();
|
|
|
- if (oldData.getProcess() < struct.getNum()){
|
|
|
- if (struct.getSettingType().equals(SettingType.UNIFIED)){
|
|
|
- JSONArray jsonArray = JSONUtil.parseArray(settingStr);
|
|
|
- // 取出下一個審批人
|
|
|
- Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(oldData.getProcess());
|
|
|
- autoData.setReceiverId(tobePerson.get("id"));
|
|
|
- autoData.setReceiverName(tobePerson.get("name"));
|
|
|
- autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
- jsonArray.toJSONString(0);
|
|
|
- }else{
|
|
|
- // 串行-逐級設置-把前端傳過來的審批人,保存到待審批人字段,保存,process+1
|
|
|
- JSONArray jsonArray;
|
|
|
- if (settingStr == null){
|
|
|
- jsonArray = new JSONArray(1);
|
|
|
+ if (end){
|
|
|
+ //逐級設置-清空節點審核人
|
|
|
+ autoData.setProcessStatus(ProcessStatus.PASSED);
|
|
|
+ /*if (struct.getSettingType().equals(SettingType.GRADUALLY)){
|
|
|
+ AutoSetting autosetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ autosetting.setSetting("");
|
|
|
+ autoSettingService.updateById(autosetting);
|
|
|
+ }*/
|
|
|
+ } else {
|
|
|
+ // 並行
|
|
|
+ if (struct.getApproveType().equals(ApproveType.PARALLEL)){
|
|
|
+ if (oldData.getApproveHistory() != null){
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(oldData.getApproveHistory());
|
|
|
+ JSONArray jsonArray1 = JSONUtil.parseArray(struct.getSetting());
|
|
|
+ if ((jsonArray.size()+1) == jsonArray1.size()){
|
|
|
+ autoData.setProcessStatus(ProcessStatus.PASSED);
|
|
|
}else{
|
|
|
- jsonArray = JSONUtil.parseArray(settingStr);
|
|
|
+ autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ // 串行-統一設置-從設置中拿出相應位置的人員,填充到下一個審批人字段,process+1
|
|
|
+ String settingStr = struct.getSetting();
|
|
|
+ if (oldData.getProcess() < struct.getNum()){
|
|
|
+ if (struct.getSettingType().equals(SettingType.UNIFIED)){
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(settingStr);
|
|
|
+ // 取出下一個審批人
|
|
|
+ Map<String, String > tobePerson = (Map<String, String>) jsonArray.get(oldData.getProcess());
|
|
|
+ autoData.setReceiverId(tobePerson.get("id"));
|
|
|
+ autoData.setReceiverName(tobePerson.get("name"));
|
|
|
+ autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ }else {
|
|
|
+ // 串行-逐級設置-把前端傳過來的審批人,保存到待審批人字段,保存,process+1
|
|
|
+ AutoSetting autosetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ Assert.notNull(autosetting, "找不到相應設置!");
|
|
|
+ if (autosetting.getCreateSettingType().equals(CreateSettingType.All)){
|
|
|
+ String setting = autosetting.getSetting();
|
|
|
+ JSONArray settingArray = JSONUtil.parseArray(setting);
|
|
|
+ Map<String, String > tobePerson = (Map<String, String>) settingArray.get(oldData.getProcess());
|
|
|
+ autoData.setReceiverId(tobePerson.get("id"));
|
|
|
+ autoData.setReceiverName(tobePerson.get("name"));
|
|
|
+ autoData.setReceiverNo(tobePerson.get("ehr"));
|
|
|
+ }else{
|
|
|
+ Assert.isTrue(!autoData.getReceiverId().contains(AuthUtil.getUserId()+""), "審批人不能為本人!");
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONArray jsonArray;
|
|
|
+ if (StringUtil.isBlank(settingStr)){
|
|
|
+ jsonArray = new JSONArray(1);
|
|
|
+ }else{
|
|
|
+ jsonArray = JSONUtil.parseArray(settingStr);
|
|
|
+ }
|
|
|
+ Map<String, String > tobePerson = new HashMap<>();
|
|
|
+ tobePerson.put("id", autoData.getReceiverId());
|
|
|
+ tobePerson.put("name", autoData.getReceiverName());
|
|
|
+ tobePerson.put("ehr", autoData.getReceiverNo());
|
|
|
+ jsonArray.set(tobePerson);
|
|
|
+ String newSettingStr = jsonArray.toJSONString(0);
|
|
|
+ struct.setSetting(newSettingStr);
|
|
|
+ autoStructService.updateById(struct);
|
|
|
}
|
|
|
- Map<String, String > tobePerson = new HashMap<>();
|
|
|
- tobePerson.put("id", autoData.getReceiverId());
|
|
|
- tobePerson.put("name", autoData.getReceiverName());
|
|
|
- tobePerson.put("ehr", autoData.getReceiverNo());
|
|
|
- jsonArray.set(tobePerson);
|
|
|
- String newSettingStr = jsonArray.toJSONString(0);
|
|
|
- struct.setSetting(newSettingStr);
|
|
|
- autoStructService.updateById(struct);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- autoData.setProcess(oldData.getProcess()+1);
|
|
|
- if (oldData.getProcess().equals(struct.getNum())){
|
|
|
- autoData.setProcessStatus(ProcessStatus.PASSED);
|
|
|
- }else{
|
|
|
- autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
+ autoData.setProcess(oldData.getProcess()+1);
|
|
|
+ if (oldData.getProcess().equals(struct.getNum())){
|
|
|
+ autoData.setProcessStatus(ProcessStatus.PASSED);
|
|
|
+ /*if (struct.getSettingType().equals(SettingType.GRADUALLY)){
|
|
|
+ AutoSetting autosetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ autosetting.setSetting("");
|
|
|
+ autoSettingService.updateById(autosetting);
|
|
|
+ }*/
|
|
|
+ }else{
|
|
|
+ autoData.setProcessStatus(ProcessStatus.TOBEREVIEWED);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//審批記錄
|
|
|
User user = userService.getById(AuthUtil.getUserId());
|
|
|
if (StringUtil.isBlank(oldData.getApproveId())){
|
|
|
@@ -322,7 +428,7 @@ public class AutoDataController extends BladeController {
|
|
|
approveBean.setUserId(user.getId()+"");
|
|
|
approveBean.setUserName(user.getName());
|
|
|
approveBean.setUserEhr(user.getEhr());
|
|
|
- approveBean.setApprove(Approve.AGREE);
|
|
|
+ approveBean.setApprove(end ? Approve.AGREE_END : Approve.AGREE);
|
|
|
approveBean.setRemark(autoData.getRemark());
|
|
|
approveBean.setApproveTime(DateUtil.format(DateUtil.now(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
@@ -344,7 +450,7 @@ public class AutoDataController extends BladeController {
|
|
|
@PostMapping("/approveReject")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "審批駁回-退回", notes = "传入autoData")
|
|
|
- public R approveReject(@Valid @RequestBody AutoData autoData) {
|
|
|
+ public R approveReject(@Valid @RequestBody AutoDataDTO autoData) {
|
|
|
AutoData oldData = autoDataService.getById(autoData.getId());
|
|
|
// Assert.isTrue(!oldData.getProcess().equals(1), "無法駁回!因為已無路可退!");
|
|
|
Long tableId = autoData.getTableId();
|
|
|
@@ -404,14 +510,14 @@ public class AutoDataController extends BladeController {
|
|
|
@PostMapping("/approveNo")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "審批不通过", notes = "传入autoData")
|
|
|
- public R approveNo(@Valid @RequestBody AutoData autoData) {
|
|
|
+ public R approveNo(@Valid @RequestBody AutoDataDTO autoData) {
|
|
|
Long tableId = autoData.getTableId();
|
|
|
AutoStruct struct = autoStructService.getById(tableId);
|
|
|
User user = userService.getById(AuthUtil.getUserId());
|
|
|
|
|
|
// 並行-直接把審批人信息追加到已審批人字段
|
|
|
AutoData oldData = autoDataService.getById(autoData.getId());
|
|
|
- if (struct.getApproveType().equals(ApproveType.PARALLEL)) {
|
|
|
+// if (struct.getApproveType().equals(ApproveType.PARALLEL)) {
|
|
|
if (StringUtil.isBlank(oldData.getApproveId())){
|
|
|
autoData.setApproveId(user.getId()+"");
|
|
|
autoData.setApproveName(user.getName());
|
|
|
@@ -439,7 +545,56 @@ public class AutoDataController extends BladeController {
|
|
|
JSONArray history = JSONUtil.parseArray(approveHistory);
|
|
|
history.add(approveBean);
|
|
|
autoData.setApproveHistory(history.toJSONString(0));
|
|
|
+// }
|
|
|
+
|
|
|
+ /*if (struct.getApproveType().equals(ApproveType.SERIAL)) {
|
|
|
+ if (struct.getSettingType().equals(SettingType.GRADUALLY)){
|
|
|
+ AutoSetting autosetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ autosetting.setSetting("");
|
|
|
+ autoSettingService.updateById(autosetting);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ return R.status(autoDataService.saveOrUpdate(autoData));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 直接結束流程
|
|
|
+ */
|
|
|
+ @PostMapping("/setEnd")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation(value = "直接結束流程", notes = "传入id")
|
|
|
+ public R setEnd(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
|
|
|
+ AutoData autoData = autoDataService.getById(id);
|
|
|
+ //審批記錄
|
|
|
+ User user = userService.getById(AuthUtil.getUserId());
|
|
|
+ ApproveBean approveBean = new ApproveBean();
|
|
|
+ approveBean.setUserId(user.getId()+"");
|
|
|
+ approveBean.setUserName(user.getName());
|
|
|
+ approveBean.setUserEhr(user.getEhr());
|
|
|
+ approveBean.setApprove(Approve.INTERRUPT_END);
|
|
|
+// approveBean.setRemark("管理員【" + user.getName() + "】" + Approve.INTERRUPT_END);
|
|
|
+ approveBean.setApproveTime(DateUtil.format(DateUtil.now(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+
|
|
|
+ String approveHistory = autoData.getApproveHistory();
|
|
|
+ if (approveHistory == null){
|
|
|
+ approveHistory = "[]";
|
|
|
}
|
|
|
+ JSONArray history = JSONUtil.parseArray(approveHistory);
|
|
|
+ history.add(approveBean);
|
|
|
+ autoData.setApproveHistory(history.toJSONString(0));
|
|
|
+
|
|
|
+ // 逐級設置-清空節點審核人
|
|
|
+ /*Long tableId = autoData.getTableId();
|
|
|
+ AutoStruct struct = autoStructService.getById(tableId);
|
|
|
+ if (struct.getApproveType().equals(ApproveType.SERIAL)) {
|
|
|
+ if (struct.getSettingType().equals(SettingType.GRADUALLY)){
|
|
|
+ AutoSetting autosetting = autoSettingService.getUserSettingByBusinessId(autoData.getId());
|
|
|
+ autosetting.setSetting("");
|
|
|
+ autoSettingService.updateById(autosetting);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ autoData.setProcessStatus(ProcessStatus.CLOSE);
|
|
|
|
|
|
return R.status(autoDataService.saveOrUpdate(autoData));
|
|
|
}
|