rev:调度任务
This commit is contained in:
@@ -34,7 +34,7 @@ public class RedissonUtils {
|
|||||||
if (isLock){
|
if (isLock){
|
||||||
process.process();
|
process.process();
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("当前业务 key:"+key+"正在锁定请稍后再试");
|
throw new BadRequestException("当前业务 key:"+key+"正在执行请稍后再试");
|
||||||
}
|
}
|
||||||
}finally {
|
}finally {
|
||||||
if (isLock){
|
if (isLock){
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ public class AcsToWmsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/taskPublish")
|
@GetMapping("/taskPublish")
|
||||||
@Log("taskPublish")
|
@Log("taskPublish")
|
||||||
@ApiOperation("taskPublish")
|
@ApiOperation("taskPublish")
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.anno.Log;
|
import org.nl.common.anno.Log;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.common.utils.api.ResultCode;
|
||||||
import org.nl.modules.common.exception.BizCoreException;
|
import org.nl.modules.common.exception.BizCoreException;
|
||||||
import org.nl.wms.mps.service.ProduceshiftorderService;
|
import org.nl.wms.mps.service.ProduceshiftorderService;
|
||||||
@@ -93,7 +95,10 @@ public class ProduceshiftorderController{
|
|||||||
@Log("看板开工")
|
@Log("看板开工")
|
||||||
@ApiOperation("看板开工")
|
@ApiOperation("看板开工")
|
||||||
public ResponseEntity<Object> openStart(@RequestBody JSONObject param) {
|
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")
|
@PostMapping("/saveReport")
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("flag", "1");
|
map.put("flag", "1");
|
||||||
|
|
||||||
JSONObject whereJson = JSONObject.parseObject(JSON.toJSONString(form));
|
JSONObject whereJson = JSONObject.parseObject(JSON.toJSONString(form));
|
||||||
|
|
||||||
String task_status = whereJson.getString("task_status");
|
String task_status = whereJson.getString("task_status");
|
||||||
|
|||||||
@@ -223,7 +223,6 @@ public class SpeFullTask extends AbstractAcsTask {
|
|||||||
vehilematerial.setQuantity(task.getMaterial_qty());
|
vehilematerial.setQuantity(task.getMaterial_qty());
|
||||||
cacheLineVechileService.save(vehilematerial);
|
cacheLineVechileService.save(vehilematerial);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case STATUS_FINISH:
|
case STATUS_FINISH:
|
||||||
taskService.update(new UpdateWrapper<SchBaseTask>()
|
taskService.update(new UpdateWrapper<SchBaseTask>()
|
||||||
@@ -251,12 +250,17 @@ public class SpeFullTask extends AbstractAcsTask {
|
|||||||
.set("update_name", "acs")
|
.set("update_name", "acs")
|
||||||
.set("update_time", DateUtil.now()).eq("task_id", task.getTask_id());
|
.set("update_time", DateUtil.now()).eq("task_id", task.getTask_id());
|
||||||
log.info("生坑到料完成:"+param.toString());
|
log.info("生坑到料完成:"+param.toString());
|
||||||
|
taskService.update(wrapper);
|
||||||
if (extParam.get("fall_finish") != null){
|
if (extParam.get("fall_finish") != null){
|
||||||
|
//TODO:添加任务唯一性校验防止重复更新
|
||||||
PdmBiDevice one = deviceService.getOne(new QueryWrapper<PdmBiDevice>().eq("device_code", task.getPoint_code2()));
|
PdmBiDevice one = deviceService.getOne(new QueryWrapper<PdmBiDevice>().eq("device_code", task.getPoint_code2()));
|
||||||
deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
if (!one.getRemark().equals("fall_finish"+task.getTask_id())){
|
||||||
.set("material_id", task.getMaterial_id())
|
deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||||
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
.set("material_id", task.getMaterial_id())
|
||||||
.eq("device_code", task.getPoint_code2()));
|
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
||||||
|
.set("remark","fall_finish"+task.getTask_id())
|
||||||
|
.eq("device_code", task.getPoint_code2()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATUS_FINISH:
|
case STATUS_FINISH:
|
||||||
|
|||||||
@@ -8,11 +8,9 @@
|
|||||||
<item spec="22" value="A1_HCX_02"></item>
|
<item spec="22" value="A1_HCX_02"></item>
|
||||||
</param>
|
</param>
|
||||||
</flow>
|
</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>
|
||||||
<flow id="A1_TK" name="镗孔" sourceRef="A1_TWYTJ" targetRef="A1_SKQX"></flow>
|
|
||||||
|
|
||||||
<flow id="A1_SKQX" name="深坑清洗" sourceRef="A1_TWYTJ" targetRef="end"></flow>
|
<flow id="A1_SKQX" name="深坑清洗" sourceRef="A1_TWYTJ" targetRef="end"></flow>
|
||||||
<end id="end" name="Junior Reject End" sourceRef="A1_SKQX"></end>
|
<end id="end" name="Junior Reject End" sourceRef="A1_SKQX"></end>
|
||||||
</process>
|
</process>
|
||||||
|
|||||||
@@ -132,11 +132,12 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<rrOperation />
|
<rrOperation />
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<el-button type="primary" @click="taskScheduler()" >任务调度</el-button>
|
||||||
<crudOperation :permission="permission" />
|
<crudOperation :permission="permission" />
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
@@ -242,6 +243,7 @@ import pagination from '@crud/Pagination'
|
|||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||||
|
import {scheduler} from "./task";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Task',
|
name: 'Task',
|
||||||
@@ -255,7 +257,7 @@ export default {
|
|||||||
title: '任务',
|
title: '任务',
|
||||||
url: 'api/task',
|
url: 'api/task',
|
||||||
idField: 'task_id',
|
idField: 'task_id',
|
||||||
sort: 'task_id,desc',
|
sort: 'task_code,desc',
|
||||||
crudMethod: { ...crudTask },
|
crudMethod: { ...crudTask },
|
||||||
query: {
|
query: {
|
||||||
task_code: '',
|
task_code: '',
|
||||||
@@ -323,6 +325,11 @@ export default {
|
|||||||
this.classes1 = data
|
this.classes1 = data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
taskScheduler() {
|
||||||
|
crudTask.scheduler().then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
},
|
||||||
buildTree(classes) {
|
buildTree(classes) {
|
||||||
classes.forEach(data => {
|
classes.forEach(data => {
|
||||||
if (data.children) {
|
if (data.children) {
|
||||||
|
|||||||
@@ -58,6 +58,12 @@ export function operation(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function scheduler() {
|
||||||
|
return request({
|
||||||
|
url: '/api/acsToWms/task/taskPublish',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
add,
|
add,
|
||||||
@@ -67,5 +73,6 @@ export default {
|
|||||||
getTaskStatus,
|
getTaskStatus,
|
||||||
getTaskType,
|
getTaskType,
|
||||||
getAcsTaskType,
|
getAcsTaskType,
|
||||||
getFinishType
|
getFinishType,
|
||||||
|
scheduler
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@
|
|||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
</div>
|
</div>
|
||||||
<AddDialog @AddChanged="querytable" />
|
<!-- <AddDialog @AddChanged="querytable" />-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -168,13 +168,13 @@ import crudOperation from '@crud/CRUD.operation'
|
|||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
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 { mapGetters } from 'vuex'
|
||||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MoreOrLess',
|
name: 'MoreOrLess',
|
||||||
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '',
|
title: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user