rev:球磨下料加锁
This commit is contained in:
@@ -2,13 +2,17 @@
|
|||||||
package org.nl.pda.pdm.rest;
|
package org.nl.pda.pdm.rest;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.annotation.Log;
|
import org.nl.annotation.Log;
|
||||||
|
import org.nl.pda.exception.PdaRequestException;
|
||||||
import org.nl.pda.pdm.service.PdmWorkTaskService;
|
import org.nl.pda.pdm.service.PdmWorkTaskService;
|
||||||
|
import org.nl.wms.common.util.RedissonUtils;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -97,7 +101,16 @@ public class PdmWorkTaskController {
|
|||||||
@Log("球磨下料完成")
|
@Log("球磨下料完成")
|
||||||
@ApiOperation("球磨下料完成")
|
@ApiOperation("球磨下料完成")
|
||||||
public ResponseEntity<Object> moveQMVehicle(@RequestBody Map whereJson) {
|
public ResponseEntity<Object> moveQMVehicle(@RequestBody Map whereJson) {
|
||||||
return new ResponseEntity<>(workTaskService.moveQMVehicle(whereJson),HttpStatus.OK);
|
if (ObjectUtil.isEmpty(whereJson)) {
|
||||||
|
throw new PdaRequestException("传入参数不能为空!");
|
||||||
|
}
|
||||||
|
RedissonUtils.lock(a->{
|
||||||
|
workTaskService.moveQMVehicle(whereJson);
|
||||||
|
},String.valueOf(whereJson.get("device_code")),null);
|
||||||
|
JSONObject returnjo = new JSONObject();
|
||||||
|
returnjo.put("code", "1");
|
||||||
|
returnjo.put("desc", "操作成功!");
|
||||||
|
return new ResponseEntity<>(returnjo,HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryMixDevice")
|
@PostMapping("/queryMixDevice")
|
||||||
|
|||||||
@@ -967,7 +967,6 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public Map<String, Object> moveQMVehicle(Map jsonObject) {
|
public Map<String, Object> moveQMVehicle(Map jsonObject) {
|
||||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||||
throw new PdaRequestException("传入参数不能为空!");
|
throw new PdaRequestException("传入参数不能为空!");
|
||||||
|
|||||||
Reference in New Issue
Block a user