rev:调度任务

This commit is contained in:
zhangzhiqiang
2023-05-30 14:56:34 +08:00
parent 602baf8ba1
commit d172223109
10 changed files with 37 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ public class RedissonUtils {
if (isLock){
process.process();
} else {
throw new BadRequestException("当前业务 key:"+key+"正在锁定请稍后再试");
throw new BadRequestException("当前业务 key:"+key+"正在执行请稍后再试");
}
}finally {
if (isLock){

View File

@@ -120,7 +120,6 @@ public class AcsToWmsController {
}
@GetMapping("/taskPublish")
@Log("taskPublish")
@ApiOperation("taskPublish")

View File

@@ -8,6 +8,8 @@ import lombok.RequiredArgsConstructor;
import org.nl.common.TableDataInfo;
import org.nl.common.anno.Log;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.RedissonUtils;
import org.nl.common.utils.api.RestBusinessTemplate;
import org.nl.common.utils.api.ResultCode;
import org.nl.modules.common.exception.BizCoreException;
import org.nl.wms.mps.service.ProduceshiftorderService;
@@ -93,7 +95,10 @@ public class ProduceshiftorderController{
@Log("看板开工")
@ApiOperation("看板开工")
public ResponseEntity<Object> openStart(@RequestBody JSONObject param) {
return new ResponseEntity<>(iPdmProduceWorkorderService.openStart(param), HttpStatus.OK);
RedissonUtils.lock(()->{
iPdmProduceWorkorderService.openStart(param);
},param.getString("workorder_id"),null);
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> new JSONObject()),HttpStatus.OK);
}
@PostMapping("/saveReport")

View File

@@ -50,7 +50,6 @@ public class TaskServiceImpl implements TaskService {
HashMap<String, String> map = new HashMap<>();
map.put("flag", "1");
JSONObject whereJson = JSONObject.parseObject(JSON.toJSONString(form));
String task_status = whereJson.getString("task_status");

View File

@@ -223,7 +223,6 @@ public class SpeFullTask extends AbstractAcsTask {
vehilematerial.setQuantity(task.getMaterial_qty());
cacheLineVechileService.save(vehilematerial);
}
break;
case STATUS_FINISH:
taskService.update(new UpdateWrapper<SchBaseTask>()
@@ -251,12 +250,17 @@ public class SpeFullTask extends AbstractAcsTask {
.set("update_name", "acs")
.set("update_time", DateUtil.now()).eq("task_id", task.getTask_id());
log.info("生坑到料完成:"+param.toString());
taskService.update(wrapper);
if (extParam.get("fall_finish") != null){
//TODO:添加任务唯一性校验防止重复更新
PdmBiDevice one = deviceService.getOne(new QueryWrapper<PdmBiDevice>().eq("device_code", task.getPoint_code2()));
deviceService.update(new UpdateWrapper<PdmBiDevice>()
.set("material_id", task.getMaterial_id())
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
.eq("device_code", task.getPoint_code2()));
if (!one.getRemark().equals("fall_finish"+task.getTask_id())){
deviceService.update(new UpdateWrapper<PdmBiDevice>()
.set("material_id", task.getMaterial_id())
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
.set("remark","fall_finish"+task.getTask_id())
.eq("device_code", task.getPoint_code2()));
}
}
break;
case STATUS_FINISH:

View File

@@ -8,11 +8,9 @@
<item spec="22" value="A1_HCX_02"></item>
</param>
</flow>
<flow id="A1_TWYTJ" name="推弯一体工序" sourceRef="A1_JGXL" targetRef="A1_TK">
<flow id="A1_TWYTJ" name="推弯一体工序" sourceRef="A1_JGXL" targetRef="A1_SKQX">
</flow>
<flow id="A1_TK" name="镗孔" sourceRef="A1_TWYTJ" targetRef="A1_SKQX"></flow>
<flow id="A1_SKQX" name="深坑清洗" sourceRef="A1_TWYTJ" targetRef="end"></flow>
<end id="end" name="Junior Reject End" sourceRef="A1_SKQX"></end>
</process>