rev:1.成品出库分配站点设置明细显示 2.成品出库分配查询站点下拉框未锁定的 3.配粉发货区锁定4.新增页面:成品发货区

This commit is contained in:
2023-08-18 09:42:00 +08:00
parent 2300b7db66
commit 8da0178d04
7 changed files with 272 additions and 10 deletions

View File

@@ -139,5 +139,13 @@ public class SchBasePointController {
}
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/outUnLock")
@Log("发货区解锁")
//("发货区解锁")
public ResponseEntity<Object> outUnLock(@RequestBody JSONObject whereJson) {
basePointService.outUnLock(whereJson);
return new ResponseEntity<>( HttpStatus.OK);
}
}

View File

@@ -62,4 +62,10 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* @param jo
*/
void taskOperate(JSONObject jo);
/**
* 发货区解锁
* @param whereJson
*/
void outUnLock(JSONObject whereJson);
}

View File

@@ -1,6 +1,7 @@
package org.nl.wms.scheduler_manage.service.point.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -17,6 +18,7 @@ import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.DateUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
@@ -25,8 +27,10 @@ import org.nl.wms.scheduler_manage.service.region.ISchBaseRegionService;
import org.nl.wms.scheduler_manage.service.region.dao.SchBaseRegion;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.IOSEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
@@ -220,4 +224,26 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.set("lock_type",StatusEnum.LOCK_OFF.getCode()).set("point_code",one.getPoint_code2()));
}
}
@Override
@Transactional
public void outUnLock(JSONObject whereJson) {
JSONArray data = whereJson.getJSONArray("data");
ArrayList<SchBasePoint> listDao = new ArrayList<>();
for (int i = 0; i < data.size(); i++) {
JSONObject json = data.getJSONObject(i);
json.put("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"));
json.put("vehicle_code","");
json.put("update_id",SecurityUtils.getCurrentUserId());
json.put("update_name",SecurityUtils.getCurrentNickName());
json.put("update_time", new Date());
listDao.add(JSONObject.toJavaObject(json, SchBasePoint.class));
}
this.updateBatchById(listDao);
}
}

View File

@@ -439,6 +439,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getIs_used, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.eq(SchBasePoint::getRegion_code, PDAEnum.REGION_CODE.code("发货区域"))
.orderByAsc(SchBasePoint::getPoint_code)
@@ -460,9 +461,16 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
}
}
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("出库点位为空,请检查!");
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("出库点位为空,请检查是否有空位或未解锁");
}
// 锁定出库点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁"))
.eq(SchBasePoint::getPoint_code, pointDao.getPoint_code())
);
// 2.2 生成任务
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT)
@@ -480,6 +488,21 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
whereJson.put("task_id", disDao.getTask_id());
sendTask(whereJson);
// 2.4 更新明细表已设置站点 - remark_ext
List<StIvtIostorinvdisCp> disList = iostorinvdisCpService.list(
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getIostorinv_id, disDao.getIostorinv_id())
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
);
for (StIvtIostorinvdisCp row : disList) {
iostorinvdtlCpService.update(
new UpdateWrapper<StIvtIostorinvdtlCp>().lambda()
.set(StIvtIostorinvdtlCp::getRemark_ext, "已设置站点")
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, row.getIostorinvdtl_id())
);
}
}
// 3.更新分配表
iostorinvdisCpService.update(
@@ -534,10 +557,14 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getIs_used, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getRegion_code, PDAEnum.REGION_CODE.code("发货区域"))
.eq(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.orderByAsc(SchBasePoint::getPoint_code)
);
// 校验货位数量是否满足
if (disMapList.size() > pointList.size()) throw new BadRequestException("发货区点位不足!");
for (String struct_code : disMapList.keySet()) {
StIvtIostorinvdisCp disDao = disMapList.get(struct_code).get(0);
@@ -581,11 +608,30 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
);
// 6.更新发货区点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁"))
.eq(SchBasePoint::getPoint_code, dao.getPoint_code())
);
break;
}
}
}
// 6.更新明细为已设置站点 - remark_ext
for (List<StIvtIostorinvdisCp> disList : disMapList.values()) {
disList.forEach(item -> {
iostorinvdtlCpService.update(
new UpdateWrapper<StIvtIostorinvdtlCp>().lambda()
.set(StIvtIostorinvdtlCp::getRemark_ext, "已设置站点")
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, item.getIostorinvdtl_id())
);
});
}
}
@Override
@@ -663,6 +709,15 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(MdPbBucketrecord::getMaterial_id, dao.getMaterial_id())
.eq(MdPbBucketrecord::getStatus, MasterEnum.BOX_STATUS.code("出库"))
);*/
// 5) 更新发货区终点
if (ObjectUtil.isNotEmpty(dao.getPoint_code())) {
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getVehicle_code,dao.getStoragevehicle_code() )
.eq(SchBasePoint::getPoint_code, dao.getPoint_code())
);
}
}
// 5.更新箱记录表为出库
@@ -751,6 +806,8 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
String task_id = form.getString("task_id");
String status = form.getString("status");
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getOne(new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getTask_id, task_id),false);
@@ -785,6 +842,13 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
iostorinvdisCpService.confirm(mst_jo);
}
// 更新发货点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getVehicle_code, taskDao.getVehicle_code())
.eq(SchBasePoint::getPoint_code, taskDao.getPoint_code3())
);
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
// 更新任务为执行中
iSchBaseTaskService.update(
@@ -804,6 +868,13 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
JSONObject param = new JSONObject();
param.put("iostorinvdis_id",disDao.getIostorinvdis_id());
delTask(param);
// 更新发货点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.eq(SchBasePoint::getPoint_code, taskDao.getPoint_code3())
);
}
}

View File

@@ -68,4 +68,12 @@ export function changeLock(data) {
})
}
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock }
export function outUnLock(data) {
return request({
url: 'api/point/outUnLock',
method: 'post',
data: data
})
}
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, changeLock, outUnLock }

View File

@@ -124,8 +124,9 @@
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配数量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_type" label="单类型" align="center" :formatter="formatSourceType"/>
<el-table-column show-overflow-tooltip prop="source_bill_code" label="单号" align="center" />
<el-table-column show-overflow-tooltip prop="base_bill_type" label="销售单类型" align="center" :formatter="formatSourceType"/>
<el-table-column show-overflow-tooltip prop="base_bill_code" label="销售单号" align="center" />
<el-table-column show-overflow-tooltip prop="remark_ext" label="是否设置站点" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
@@ -243,7 +244,7 @@ export default {
name: 'DivDialog',
components: { StructIvt },
mixins: [crud()],
dicts: ['IO_BILL_STATUS', 'work_status', 'PCS_DELIVER_TYPE'],
dicts: ['IO_BILL_STATUS', 'work_status', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
@@ -319,13 +320,22 @@ export default {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
const area_type = 'A1_FH01'
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
this.pointList = res
})
this.getPoint()
this.mstrow.stor_id = this.defaultList[0]
this.mstrow.sect_id = this.defaultList[1]
},
getPoint() {
const area_type = 'A1_FH01'
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
this.pointList = []
for (const item of res) {
if (item.lock_type === '0') {
this.pointList.push(item)
}
}
})
},
close() {
this.$refs['form2'].resetFields()
this.tabledis = []
@@ -336,7 +346,7 @@ export default {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
formatSourceType(row, column) {
return this.dict.label.PCS_DELIVER_TYPE[row.source_bill_type]
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
},
quality_scodeFormat(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
@@ -473,6 +483,7 @@ export default {
this.queryTableDtl()
this.tabledis = []
this.form2.point_code = ''
this.getPoint()
}).finally(() => {
this.loadingSetAllPoint = false
})
@@ -484,6 +495,7 @@ export default {
this.queryTableDtl()
this.tabledis = []
this.form2.point_code = ''
this.getPoint()
}).finally(() => {
this.loadingSetAllPoint = false
})

View File

@@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="点位编码">
<el-input
v-model="query.name"
size="mini"
clearable
placeholder="点位编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" >
<el-button
slot="right"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-circle-close"
:disabled="crud.selections.length === 0"
@click="outUnLock"
>
解锁
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
size="mini"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip min-width="120" prop="point_code" label="点位编码" />
<el-table-column show-overflow-tooltip min-width="120" prop="point_name" label="点位名称" />
<el-table-column show-overflow-tooltip min-width="120" prop="region_name" label="区域名称" />
<el-table-column show-overflow-tooltip prop="lock_type" label="锁定类型" >
<template slot-scope="scope">
{{ scope.row.lock_type == '0' ? '未锁定' : '出库锁' }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="vehicle_code" label="载具编码" />
<el-table-column prop="is_used" label="是否启用">
<template slot-scope="scope">
{{ scope.row.is_used == '1' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="update_name" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="170" />
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudPoint, { outUnLock } from '@/views/wms/scheduler_manage/point/point'
export default {
name: 'ProductIn',
components: { crudOperation, rrOperation, udOperation, pagination },
cruds() {
return CRUD({
title: '发货区',
optShow: { add: false, reset: true },
idField: 'point_id',
url: '/api/point',
crudMethod: { ...crudPoint }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: [],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {}
}
},
created() {
this.query.region_code = 'A1_FH01'
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.query.region_code = 'A1_FH01'
return true
},
outUnLock() {
const data = { 'data': this.$refs.table.selection }
outUnLock(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>