|
@@ -131,9 +131,14 @@ public class TApplySafetychangeController extends BaseController {
|
|
public AjaxResult add(@RequestBody TApplySafetychange tApplySafetychange) {
|
|
public AjaxResult add(@RequestBody TApplySafetychange tApplySafetychange) {
|
|
String userId = getUserId().toString();
|
|
String userId = getUserId().toString();
|
|
for (String s : tApplySafetychange.getLockNo().split(",")) {
|
|
for (String s : tApplySafetychange.getLockNo().split(",")) {
|
|
- TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(s.substring(0,s.indexOf("(")));
|
|
|
|
- if (tApplyLock.getStatus()==1||tApplyLock.getStatus()==2){
|
|
|
|
- return AjaxResult.error("该锁不可用。");
|
|
|
|
|
|
+ TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(s.substring(0, s.indexOf("(")));
|
|
|
|
+ if (tApplyLock!=null) {
|
|
|
|
+ if (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2) {
|
|
|
|
+ return AjaxResult.error("该锁不可用。");
|
|
|
|
+ }
|
|
|
|
+ //修改锁状态
|
|
|
|
+ tApplyLock.setStatus(1L);
|
|
|
|
+ tApplyLockService.updateTApplyLock(tApplyLock);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
tApplySafetychange.setApplicant(userId);
|
|
tApplySafetychange.setApplicant(userId);
|
|
@@ -278,17 +283,6 @@ public class TApplySafetychangeController extends BaseController {
|
|
form.setChangeExecutor(getUserId().toString());
|
|
form.setChangeExecutor(getUserId().toString());
|
|
form.setChangeExecutorName(getNickName());
|
|
form.setChangeExecutorName(getNickName());
|
|
form.setChangeExecutorTime(new Date());
|
|
form.setChangeExecutorTime(new Date());
|
|
- //修改锁状态
|
|
|
|
- for (String lockNo : tApplySafetychange.getLockNo().split(",")) {
|
|
|
|
- TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo.substring(0,lockNo.indexOf("(")));
|
|
|
|
- if (tApplyLock != null) {
|
|
|
|
- if (tApplyLock.getStatus() == 1 || tApplyLock.getStatus() == 2) {
|
|
|
|
- return AjaxResult.error("该锁已被使用。");
|
|
|
|
- }
|
|
|
|
- tApplyLock.setStatus(1L);//将锁状态改为已拆锁
|
|
|
|
- tApplyLockService.updateTApplyLock(tApplyLock);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
break;
|
|
break;
|
|
case "安全评估人2":
|
|
case "安全评估人2":
|
|
TStaffmgr tStaffmgr = new TStaffmgr();
|
|
TStaffmgr tStaffmgr = new TStaffmgr();
|
|
@@ -314,7 +308,7 @@ public class TApplySafetychangeController extends BaseController {
|
|
form.setStatus(1L);
|
|
form.setStatus(1L);
|
|
//修改锁状态
|
|
//修改锁状态
|
|
for (String lockNo : tApplySafetychange.getLockNo().split(",")) {
|
|
for (String lockNo : tApplySafetychange.getLockNo().split(",")) {
|
|
- TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo.substring(0,lockNo.indexOf("(")));
|
|
|
|
|
|
+ TApplyLock tApplyLock = tApplyLockService.selectTApplyLockByLockCode(lockNo.substring(0, lockNo.indexOf("(")));
|
|
if (tApplyLock != null) {
|
|
if (tApplyLock != null) {
|
|
tApplyLock.setStatus(0L);//将锁状态改为已拆锁
|
|
tApplyLock.setStatus(0L);//将锁状态改为已拆锁
|
|
tApplyLockService.updateTApplyLock(tApplyLock);
|
|
tApplyLockService.updateTApplyLock(tApplyLock);
|