Commit 2c937facc8b153bc2da5c03c4a955d6f3cc22151

Authored by 肖超群
2 parents 4f58bfcf 6ca14666

Merge branch 'develop' of http://172.16.29.40:8010/wms/wms4 into develop

ant-design-vue-jeecg/src/api/api.js
... ... @@ -165,6 +165,8 @@ export const selectSupplePort = (params) => postAction('/receipt/receiptContaine
165 165 export const inventoryPort = (params) => postAction('/cycleCountDetail/cycleCountDetail/inventoryPort', params);
166 166 //创建空托盘入库任务
167 167 export const createEmptyIn = (params) => postAction('/task/taskHeader/createEmptyIn', params);
  168 +//修改优先级
  169 +export const updatePriority = (params, priority) => postAction('/task/taskHeader/updatePriority?id=' + params + '&priority=' + priority, params);
168 170 //创建空托盘出库任务
169 171 export const createEmptyOut = (params) => postAction('/task/taskHeader/createEmptyOut', params);
170 172 //选择空托盘出库整出口
... ...
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... ... @@ -168,6 +168,8 @@
168 168 <a-divider type="vertical"/></a>
169 169 <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1 && record.status == 100" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button>
170 170 <a-divider type="vertical"/></a>
  171 + <a v-if="record.status < 20 " v-has="'taskHeader:priority'" @click="handlePriority(record)"><a-button type="danger">优先级</a-button>
  172 + <a-divider type="vertical"/></a>
171 173 <!-- <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a>-->
172 174 <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)">
173 175 <a-button type="danger">取消</a-button>
... ... @@ -186,6 +188,7 @@
186 188 <taskHeader-modal ref="modalForm" @ok="modalFormOk"></taskHeader-modal>
187 189 <empty-in-task-modal ref="emptyInModal" @ok="modalFormOk"></empty-in-task-modal>
188 190 <many-empty-in-task-modal ref="manyEmptyInModal" @ok="modalFormOk"></many-empty-in-task-modal>
  191 + <update-priority ref="updatePriority" @ok="modalFormOk"></update-priority>
189 192 <MaterialTaskModal ref="materialTaskModal" @ok="modalFormOk"></MaterialTaskModal>
190 193 <call-receipt-box-modal ref="modalForm5" @ok="modalFormOk"></call-receipt-box-modal>
191 194 <call-receipt-empty-box-modal ref="modalForm6" @ok="modalFormOk"></call-receipt-empty-box-modal>
... ... @@ -204,6 +207,7 @@ import {completeTaskByWMS, cancelTask} from &#39;@/api/api&#39;
204 207 import {execute} from '@/api/api'
205 208 import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn} from '@/api/api'
206 209 import EmptyInTaskModal from './modules/EmptyInTaskModal'
  210 +import UpdatePriority from './modules/UpdatePriority'
207 211 import ManyEmptyInTaskModal from "./modules/ManyEmptyInTaskModal";
208 212 import {filterObj} from "@/utils/util";
209 213 import MaterialTaskModal from "./modules/MaterialTaskModal";
... ... @@ -221,7 +225,8 @@ export default {
221 225 EmptyInTaskModal,
222 226 TaskDetailList,
223 227 TaskHeaderModal,
224   - MaterialTaskModal
  228 + MaterialTaskModal,
  229 + UpdatePriority
225 230 },
226 231 data() {
227 232 return {
... ... @@ -306,6 +311,11 @@ export default {
306 311 dataIndex: 'exceptionName'
307 312 },
308 313 {
  314 + title: '优先级',
  315 + align: "center",
  316 + dataIndex: 'priority'
  317 + },
  318 + {
309 319 title: '创建人',
310 320 align: "center",
311 321 dataIndex: 'createBy'
... ... @@ -525,6 +535,10 @@ export default {
525 535 quickReceipt(){
526 536 this.$refs.materialTaskModal.edit();
527 537 },
  538 + handlePriority(record){
  539 + this.$refs.updatePriority.edit(record);
  540 + this.$refs.updatePriority.title = "修改优先级";
  541 + },
528 542 solutionZoneCode(value) {
529 543 var actions = []
530 544 Object.keys(this.zoneList).some((key) => {
... ...
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... ... @@ -168,6 +168,8 @@
168 168 <a-divider type="vertical"/></a>
169 169 <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button>
170 170 <a-divider type="vertical"/></a>
  171 + <a v-if="record.status < 20 " v-has="'taskHeader:priority'" @click="handlePriority(record)"><a-button type="danger">优先级</a-button>
  172 + <a-divider type="vertical"/></a>
171 173 <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)">
172 174 <a-button type="danger">取消</a-button>
173 175 <a-divider type="vertical"/>
... ... @@ -191,6 +193,7 @@
191 193 <empty-out-task-modal ref="emptyOutModal" @ok="modalFormOk"></empty-out-task-modal>
192 194 <batch-empty-out-task-modal ref="batchEmptyOutModal" @ok="modalFormOk"></batch-empty-out-task-modal>
193 195 <many-empty-out-task-modal ref="manyEmptyOutModal" @ok="modalFormOk"></many-empty-out-task-modal>
  196 + <update-priority ref="updatePriority" @ok="modalFormOk"></update-priority>
194 197 <call-shipment-box-modal ref="modalForm5" @ok="modalFormOk"></call-shipment-box-modal>
195 198  
196 199 </a-card>
... ... @@ -211,6 +214,7 @@ import EmptyOutTaskModal from &#39;./modules/EmptyOutTaskModal&#39;
211 214 import BatchEmptyOutTaskModal from './modules/BatchEmptyOutTaskModal'
212 215 import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal";
213 216 import CallShipmentBoxModal from "@views/system/task/modules/CallShipmentBoxModal";
  217 +import UpdatePriority from "@views/system/task/modules/UpdatePriority.vue";
214 218  
215 219 export default {
216 220 name: "ShipmentTaskHeaderList",
... ... @@ -221,7 +225,8 @@ export default {
221 225 EmptyOutTaskModal,
222 226 BatchEmptyOutTaskModal,
223 227 TaskDetailList,
224   - TaskHeaderModal
  228 + TaskHeaderModal,
  229 + UpdatePriority
225 230 },
226 231 data() {
227 232 return {
... ... @@ -299,6 +304,11 @@ export default {
299 304 dataIndex: 'exceptionName'
300 305 },
301 306 {
  307 + title: '优先级',
  308 + align: "center",
  309 + dataIndex: 'priority'
  310 + },
  311 + {
302 312 title: '创建人',
303 313 align: "center",
304 314 dataIndex: 'createBy'
... ... @@ -494,6 +504,10 @@ export default {
494 504 this.$refs.manyEmptyOutModal.edit();
495 505 this.$refs.manyEmptyOutModal.title = "创建空托盘组出库";
496 506 },
  507 + handlePriority(record){
  508 + this.$refs.updatePriority.edit(record);
  509 + this.$refs.updatePriority.title = "修改优先级";
  510 + },
497 511 solutionZoneCode(value) {
498 512 var actions = []
499 513 Object.keys(this.zoneList).some((key) => {
... ...
ant-design-vue-jeecg/src/views/system/task/modules/UpdatePriority.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="优先级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority" :min='0' :precision='0'>
  16 + <a-input v-model="model.priority" placeholder="请输入优先级" type="number"></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + </a-row>
  20 + </a-form-model>
  21 + </a-spin>
  22 + </j-modal>
  23 +</template>
  24 +
  25 +<script>
  26 +
  27 +
  28 +import { updatePriority} from '@/api/api'
  29 +
  30 +export default {
  31 + name: "UpdatePriorityModal",
  32 + components: {},
  33 + data() {
  34 + return {
  35 + title: "操作",
  36 + width: 500,
  37 + visible: false,
  38 + id: '',
  39 + model: {},
  40 + labelCol: {
  41 + xs: {span: 24},
  42 + sm: {span: 5},
  43 + },
  44 + wrapperCol: {
  45 + xs: {span: 24},
  46 + sm: {span: 16},
  47 + },
  48 +
  49 + confirmLoading: false,
  50 + validatorRules: {
  51 + priority: [
  52 + {required: true, message: '请输入优先级!'},
  53 + ],
  54 + },
  55 + }
  56 + },
  57 + created() {
  58 + //备份model原始值
  59 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  60 + },
  61 + methods: {
  62 + edit(record) {
  63 + console.log(record)
  64 + this.id = record.id;
  65 + this.visible = true;
  66 + },
  67 + close() {
  68 + this.$emit('close');
  69 + this.visible = false;
  70 + this.$refs.form.clearValidate();
  71 + },
  72 + handleOk() {
  73 + const that = this;
  74 + // 触发表单验证
  75 + this.$refs.form.validate(valid => {
  76 + if (valid) {
  77 + that.confirmLoading = true;
  78 + updatePriority(this.id,this.model.priority,).then((res) => {
  79 + if (res.success) {
  80 + that.$message.success(res.message);
  81 + that.$emit('ok');
  82 + that.model.priority = '';
  83 + } else {
  84 + that.$message.warning(res.message);
  85 + }
  86 + }).finally(() => {
  87 + that.confirmLoading = false;
  88 + that.close();
  89 + })
  90 + } else {
  91 + return false
  92 + }
  93 + })
  94 + },
  95 + handleCancel() {
  96 + this.close()
  97 + },
  98 + }
  99 +}
  100 +</script>
0 101 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... ... @@ -498,7 +498,6 @@ public class WcsServiceImpl implements WcsService {
498 498 wcsTask.setShipmentOrder(taskHeader.getShipmentOrder());
499 499 wcsTask.setSequence(taskHeader.getSequence());
500 500 wcsTask.setSequenceNumber(taskHeader.getSequenceNumber());
501   - wcsTask.setPriority(10);
502 501 wcsTask.setRemark(QuantityConstant.EMPTY_STRING);
503 502 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
504 503 if (container == null) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... ... @@ -871,4 +871,23 @@ public class TaskHeaderController extends HuahengBaseController {
871 871 });
872 872 return result;
873 873 }
  874 +
  875 + /**
  876 + * 修改优先级
  877 + * @return
  878 + */
  879 + @AutoLog(value = "修改优先级")
  880 + @PostMapping("updatePriority")
  881 + @ApiOperation("修改优先级")
  882 + @ResponseBody
  883 + public Result updatePriority(@RequestBody @RequestParam(name = "id") String id, @RequestParam(name = "priority") String priority, HttpServletRequest req) {
  884 + Result result = handleMultiProcess("updatePriority", new MultiProcessListener() {
  885 + @Override
  886 + public Result<?> doProcess() {
  887 + Result result = taskHeaderService.updatePriority(id, priority);
  888 + return result;
  889 + }
  890 + });
  891 + return result;
  892 + }
874 893 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
... ... @@ -115,6 +115,10 @@ public class TaskHeader implements Serializable {
115 115 @Excel(name = "起始出入口", width = 15)
116 116 @ApiModelProperty(value = "起始出入口")
117 117 private String fromPortCode;
  118 + /** 优先级 */
  119 + @Excel(name = "优先级", width = 15)
  120 + @ApiModelProperty(value = "优先级")
  121 + private Integer priority;
118 122 /** 目标出入口 */
119 123 @Excel(name = "目标出入口", width = 15)
120 124 @ApiModelProperty(value = "目标出入口")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -454,4 +454,6 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
454 454 List<String> findCommonData(List<String> dataList1, List<String> dataList2, boolean flag);
455 455  
456 456 boolean delMain (Integer id);
  457 +
  458 + Result updatePriority(String id, String priority);
457 459 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -9,8 +9,10 @@ import javax.annotation.Resource;
9 9  
10 10 import org.jeecg.common.api.vo.Result;
11 11 import org.jeecg.common.exception.JeecgBootException;
  12 +import org.jeecg.modules.wms.api.wcs.entity.WcsTask;
12 13 import org.jeecg.modules.wms.api.wcs.service.LocationAllocationService;
13 14 import org.jeecg.modules.wms.api.wcs.service.WcsService;
  15 +import org.jeecg.modules.wms.config.address.service.IAddressService;
14 16 import org.jeecg.modules.wms.config.container.entity.Container;
15 17 import org.jeecg.modules.wms.config.container.service.IContainerService;
16 18 import org.jeecg.modules.wms.config.location.entity.Location;
... ... @@ -68,6 +70,7 @@ import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
68 70 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
69 71 import org.jeecg.modules.wms.task.taskHeaderHistory.service.ITaskHeaderHistoryService;
70 72 import org.jeecg.utils.HuahengJwtUtil;
  73 +import org.jeecg.utils.OkHttpUtils;
71 74 import org.jeecg.utils.StringUtils;
72 75 import org.jeecg.utils.constant.QuantityConstant;
73 76 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -198,6 +201,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
198 201 @Resource
199 202 private IMaterialMultipleService materialMultipleService;
200 203  
  204 + @Resource
  205 + private IAddressService addressService;
  206 +
201 207 @Override
202 208 @Transactional
203 209 public void delMain(String id) {
... ... @@ -3528,4 +3534,43 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3528 3534 QuantityConstant.TASK_STATUS_COMPLETED);
3529 3535 return super.update(taskHeader, taskHeaderLambdaQueryWrapper);
3530 3536 }
  3537 +
  3538 + @Override
  3539 + @Transactional(rollbackFor = Exception.class)
  3540 + public Result updatePriority(String id, String priority) {
  3541 + TaskHeader task = taskHeaderService.getById(id);
  3542 + if (task == null) {
  3543 + return Result.error("修改优先级时,根据任务号没有找到任务");
  3544 + }
  3545 + if (task.getStatus() > QuantityConstant.TASK_STATUS_RELEASE) {
  3546 + return Result.error("任务已经开始执行或完成,不能修改优先级");
  3547 + }
  3548 + TaskHeader taskHeader = new TaskHeader();
  3549 + taskHeader.setId(task.getId());
  3550 + taskHeader.setPriority(Integer.valueOf(priority));
  3551 + if (!taskHeaderService.updateById(taskHeader)) {
  3552 + throw new JeecgBootException("修改优先级失败Id:" + id);
  3553 + }
  3554 + WcsTask wcsTask = new WcsTask();
  3555 + wcsTask.setTaskNo(id);
  3556 + wcsTask.setPriority(Integer.valueOf(priority));
  3557 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_CONNECT_WCS, task.getZoneCode());
  3558 + if (StringUtils.isEmpty(value)) {
  3559 + throw new JeecgBootException("任务下发,没有找到连接WCS的数据配置");
  3560 + }
  3561 + int connectWCS = Integer.parseInt(value);
  3562 + if (connectWCS == QuantityConstant.RULE_WCS_CONNECT) {
  3563 + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_TASK_PRIORITY_CHANGE, task.getWarehouseCode(), task.getZoneCode());
  3564 + String jsonParam = JSON.toJSONString(wcsTask);
  3565 + String body = OkHttpUtils.sendPostByJsonStr(url, jsonParam);
  3566 + if (StringUtils.isEmpty(body)) {
  3567 + throw new JeecgBootException("任务下发, 接口地址错误或返回为空");
  3568 + }
  3569 + Result result = JSON.parseObject(body, Result.class);
  3570 + if (result.getCode() != QuantityConstant.HTTP_OK) {
  3571 + throw new JeecgBootException("WCS修改优先级失败:" + result.getMessage());
  3572 + }
  3573 + }
  3574 + return Result.ok("修改优先级成功");
  3575 + }
3531 3576 }
... ...