|
@@ -120,7 +120,11 @@ public class TPssrBlindController extends BaseController {
|
|
TPssrBlind blind = new TPssrBlind();
|
|
TPssrBlind blind = new TPssrBlind();
|
|
blind.setSubId(tPssrBlind.getSubId());
|
|
blind.setSubId(tPssrBlind.getSubId());
|
|
blind.setCurrentUser(getUserId().toString());
|
|
blind.setCurrentUser(getUserId().toString());
|
|
- blind.setApproveStatus(1L);
|
|
|
|
|
|
+ if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
+ blind.setApproveStatus(1L);
|
|
|
|
+ } else if (tPssrBlind.getTaskType() == 1) {
|
|
|
|
+ blind.setApproveStatus(3L);
|
|
|
|
+ }
|
|
for (TPssrBlind item : tPssrBlindService.selectTPssrBlindList(blind)) {
|
|
for (TPssrBlind item : tPssrBlindService.selectTPssrBlindList(blind)) {
|
|
item.setTaskType(tPssrBlind.getTaskType());
|
|
item.setTaskType(tPssrBlind.getTaskType());
|
|
setEntity(item);
|
|
setEntity(item);
|
|
@@ -130,28 +134,40 @@ public class TPssrBlindController extends BaseController {
|
|
//查询当前待审批的确认人
|
|
//查询当前待审批的确认人
|
|
TPssrBlind entity = new TPssrBlind();
|
|
TPssrBlind entity = new TPssrBlind();
|
|
entity.setSubId(tPssrBlind.getSubId());
|
|
entity.setSubId(tPssrBlind.getSubId());
|
|
- entity.setApproveStatus(1L);
|
|
|
|
- long status=1;
|
|
|
|
|
|
+ if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
+ entity.setApproveStatus(1L);
|
|
|
|
+ } else if (tPssrBlind.getTaskType() == 1) {
|
|
|
|
+ entity.setApproveStatus(3L);
|
|
|
|
+ }
|
|
|
|
+ long status = 1;
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
for (TPssrBlind item : tPssrBlindService.selectTPssrBlindList(entity)) {
|
|
for (TPssrBlind item : tPssrBlindService.selectTPssrBlindList(entity)) {
|
|
item.setTaskType(tPssrBlind.getTaskType());
|
|
item.setTaskType(tPssrBlind.getTaskType());
|
|
- if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
- if (item.getInstallStatus().split(",")[setEntity(item)].equals("0")) {
|
|
|
|
- return AjaxResult.success();
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (item.getRemoveStatus().split(",")[setEntity(item)].equals("0")) {
|
|
|
|
- return AjaxResult.success();
|
|
|
|
|
|
+ for (String s : setEntity(item).split(",")) {
|
|
|
|
+ int current = Integer.parseInt(s);
|
|
|
|
+ if (current == -1)
|
|
|
|
+ continue;
|
|
|
|
+ if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
+ if (item.getInstallStatus().split(",")[current].equals("0")) {
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
|
|
+ } else if (tPssrBlind.getTaskType()==1) {
|
|
|
|
+ if (item.getRemoveStatus().split(",")[current].equals("0")) {
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (item.getInstallStatus().equals("1,1,1,1,1")) {
|
|
if (item.getInstallStatus().equals("1,1,1,1,1")) {
|
|
item.setApproveStatus(3L);//已确认安装
|
|
item.setApproveStatus(3L);//已确认安装
|
|
- status=3L;
|
|
|
|
|
|
+ status = 3L;
|
|
|
|
+ flag = true;
|
|
tPssrBlindService.updateTPssrBlind(item);
|
|
tPssrBlindService.updateTPssrBlind(item);
|
|
|
|
+
|
|
}
|
|
}
|
|
if (item.getRemoveStatus().equals("1,1,1,1,1")) {
|
|
if (item.getRemoveStatus().equals("1,1,1,1,1")) {
|
|
item.setApproveStatus(2L);//已确认拆除
|
|
item.setApproveStatus(2L);//已确认拆除
|
|
- status=2L;
|
|
|
|
|
|
+ status = 4L;
|
|
|
|
+ flag = true;
|
|
tPssrBlindService.updateTPssrBlind(item);
|
|
tPssrBlindService.updateTPssrBlind(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -172,7 +188,7 @@ public class TPssrBlindController extends BaseController {
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
- private int setEntity(TPssrBlind tPssrBlind) {
|
|
|
|
|
|
+ private String setEntity(TPssrBlind tPssrBlind) {
|
|
//安装人员
|
|
//安装人员
|
|
String inProcess = tPssrBlind.getInProcess();
|
|
String inProcess = tPssrBlind.getInProcess();
|
|
String inCoordinator = tPssrBlind.getInCoordinator();
|
|
String inCoordinator = tPssrBlind.getInCoordinator();
|
|
@@ -188,43 +204,50 @@ public class TPssrBlindController extends BaseController {
|
|
String reConfirm2 = tPssrBlind.getReConfirm2();
|
|
String reConfirm2 = tPssrBlind.getReConfirm2();
|
|
|
|
|
|
//获取当前人员操作下标
|
|
//获取当前人员操作下标
|
|
- int current = -1;
|
|
|
|
|
|
+ String currents = "-1,";
|
|
if (inProcess.equals(getUserId().toString()) || reProcess.equals(getUserId().toString())) {
|
|
if (inProcess.equals(getUserId().toString()) || reProcess.equals(getUserId().toString())) {
|
|
- current = 0;
|
|
|
|
- } else if (inCoordinator.equals(getUserId().toString()) || reCoordinator.equals(getUserId().toString())) {
|
|
|
|
- current = 1;
|
|
|
|
- } else if (inContractor.equals(getUserId().toString()) || reContractor.equals(getUserId().toString())) {
|
|
|
|
- current = 2;
|
|
|
|
- } else if (inConfirm1.equals(getUserId().toString()) || reConfirm1.equals(getUserId().toString())) {
|
|
|
|
- current = 3;
|
|
|
|
- } else if (inConfirm2.equals(getUserId().toString()) || reConfirm2.equals(getUserId().toString())) {
|
|
|
|
- current = 4;
|
|
|
|
|
|
+ currents += "0,";
|
|
}
|
|
}
|
|
- //修改状态
|
|
|
|
- if (current != -1) {
|
|
|
|
- if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
- if (tPssrBlind.getInstallDate() == null) {
|
|
|
|
- tPssrBlind.setInstallDate(new Date());
|
|
|
|
- }
|
|
|
|
- String[] is = tPssrBlind.getInstallStatus().split(",");
|
|
|
|
- is[current] = "1";
|
|
|
|
- tPssrBlind.setInstallStatus(String.join(",", is));
|
|
|
|
- if (tPssrBlind.getInstallDate() == null) {
|
|
|
|
- tPssrBlind.setInstallDate(new Date());
|
|
|
|
- }
|
|
|
|
- } else if (tPssrBlind.getTaskType() == 1) {
|
|
|
|
- if (tPssrBlind.getRemovedDate() == null) {
|
|
|
|
- tPssrBlind.setRemovedDate(new Date());
|
|
|
|
- }
|
|
|
|
- String[] rs = tPssrBlind.getRemoveStatus().split(",");
|
|
|
|
- rs[current] = "1";
|
|
|
|
- tPssrBlind.setRemoveStatus(String.join(",", rs));
|
|
|
|
- if (tPssrBlind.getRemovedDate() == null) {
|
|
|
|
- tPssrBlind.setRemovedDate(new Date());
|
|
|
|
|
|
+ if (inCoordinator.equals(getUserId().toString()) || reCoordinator.equals(getUserId().toString())) {
|
|
|
|
+ currents += "1,";
|
|
|
|
+ }
|
|
|
|
+ if (inContractor.equals(getUserId().toString()) || reContractor.equals(getUserId().toString())) {
|
|
|
|
+ currents += "2,";
|
|
|
|
+ }
|
|
|
|
+ if (inConfirm1.equals(getUserId().toString()) || reConfirm1.equals(getUserId().toString())) {
|
|
|
|
+ currents += "3,";
|
|
|
|
+ }
|
|
|
|
+ if (inConfirm2.equals(getUserId().toString()) || reConfirm2.equals(getUserId().toString())) {
|
|
|
|
+ currents += "4,";
|
|
|
|
+ }
|
|
|
|
+ for (String val : currents.split(",")) {
|
|
|
|
+ int current = Integer.parseInt(val);
|
|
|
|
+ //修改状态
|
|
|
|
+ if (current != -1) {
|
|
|
|
+ if (tPssrBlind.getTaskType() == 0) {
|
|
|
|
+ if (tPssrBlind.getInstallDate() == null) {
|
|
|
|
+ tPssrBlind.setInstallDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ String[] is = tPssrBlind.getInstallStatus().split(",");
|
|
|
|
+ is[current] = "1";
|
|
|
|
+ tPssrBlind.setInstallStatus(String.join(",", is));
|
|
|
|
+ if (tPssrBlind.getInstallDate() == null) {
|
|
|
|
+ tPssrBlind.setInstallDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ } else if (tPssrBlind.getTaskType() == 1) {
|
|
|
|
+ if (tPssrBlind.getRemovedDate() == null) {
|
|
|
|
+ tPssrBlind.setRemovedDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ String[] rs = tPssrBlind.getRemoveStatus().split(",");
|
|
|
|
+ rs[current] = "1";
|
|
|
|
+ tPssrBlind.setRemoveStatus(String.join(",", rs));
|
|
|
|
+ if (tPssrBlind.getRemovedDate() == null) {
|
|
|
|
+ tPssrBlind.setRemovedDate(new Date());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return current;
|
|
|
|
|
|
+ return currents;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|