|
@@ -2,6 +2,7 @@ package com.rongwei.bsserver.controller;
|
|
|
|
|
|
|
|
|
|
import com.rongwei.bscommon.sys.service.ZhcxOutsideInspectionItpService;
|
|
import com.rongwei.bscommon.sys.service.ZhcxOutsideInspectionItpService;
|
|
|
|
+import com.rongwei.bscommon.sys.utils.LockUtils;
|
|
import com.rongwei.bsentity.vo.OperOutsideInspectionVo;
|
|
import com.rongwei.bsentity.vo.OperOutsideInspectionVo;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,10 +17,25 @@ import java.util.List;
|
|
public class ZhcxOperOutsideInspectionController {
|
|
public class ZhcxOperOutsideInspectionController {
|
|
@Autowired
|
|
@Autowired
|
|
private ZhcxOutsideInspectionItpService inspectionService;
|
|
private ZhcxOutsideInspectionItpService inspectionService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private LockUtils lockUtils;
|
|
|
|
|
|
@RequestMapping("/OperInspectionStatus")
|
|
@RequestMapping("/OperInspectionStatus")
|
|
public R OperInspectionStatus(@RequestBody List<OperOutsideInspectionVo> vo) {
|
|
public R OperInspectionStatus(@RequestBody List<OperOutsideInspectionVo> vo) {
|
|
- R r = inspectionService.operInspectionStatus(vo);
|
|
|
|
- return r;
|
|
|
|
|
|
+ try {
|
|
|
|
+ for(OperOutsideInspectionVo inspectionVo : vo){
|
|
|
|
+ String itpId = inspectionVo.getItpId();
|
|
|
|
+ lockUtils.lock("itpid",itpId);
|
|
|
|
+ }
|
|
|
|
+ R r = inspectionService.operInspectionStatus(vo);
|
|
|
|
+ return r;
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return R.errorWithMsg("操作失败");
|
|
|
|
+ }finally {
|
|
|
|
+ for(OperOutsideInspectionVo inspectionVo : vo){
|
|
|
|
+ String itpId = inspectionVo.getItpId();
|
|
|
|
+ lockUtils.lock("itpid",itpId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|