rev:调度任务
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -120,7 +120,6 @@ public class AcsToWmsController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/taskPublish")
|
||||
@Log("taskPublish")
|
||||
@ApiOperation("taskPublish")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -132,11 +132,12 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<el-button type="primary" @click="taskScheduler()" >任务调度</el-button>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -242,6 +243,7 @@ import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import {scheduler} from "./task";
|
||||
|
||||
export default {
|
||||
name: 'Task',
|
||||
@@ -255,7 +257,7 @@ export default {
|
||||
title: '任务',
|
||||
url: 'api/task',
|
||||
idField: 'task_id',
|
||||
sort: 'task_id,desc',
|
||||
sort: 'task_code,desc',
|
||||
crudMethod: { ...crudTask },
|
||||
query: {
|
||||
task_code: '',
|
||||
@@ -323,6 +325,11 @@ export default {
|
||||
this.classes1 = data
|
||||
})
|
||||
},
|
||||
taskScheduler() {
|
||||
crudTask.scheduler().then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
buildTree(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
|
||||
@@ -58,6 +58,12 @@ export function operation(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function scheduler() {
|
||||
return request({
|
||||
url: '/api/acsToWms/task/taskPublish',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
@@ -67,5 +73,6 @@ export default {
|
||||
getTaskStatus,
|
||||
getTaskType,
|
||||
getAcsTaskType,
|
||||
getFinishType
|
||||
getFinishType,
|
||||
scheduler
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<!-- <AddDialog @AddChanged="querytable" />-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -168,13 +168,13 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/AddDialog'
|
||||
// import AddDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/AddDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
|
||||
export default {
|
||||
name: 'MoreOrLess',
|
||||
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
|
||||
Reference in New Issue
Block a user