Browse Source

add:新增 缓存区一键移库 功能

master
zds 5 months ago
parent
commit
c1624606e8
  1. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/ReportController.java
  2. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/IReportService.java
  3. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.java
  4. 31
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml
  5. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/impl/ReportServiceImpl.java
  6. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  7. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/WorkorderController.java
  8. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java
  9. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml
  10. 66
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java
  11. 67
      lms/nladmin-ui/src/views/wms/sch/movestor/detail.js
  12. 226
      lms/nladmin-ui/src/views/wms/sch/movestor/index.vue
  13. 4
      lms/nladmin-ui/src/views/wms/sch/point/index.vue
  14. 4
      lms/nladmin-ui/src/views/wms/ycl/detail/index.vue
  15. 2
      lms/nladmin-ui/src/views/wms/ycl/out/index.vue

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/ReportController.java

@ -49,6 +49,14 @@ public class ReportController {
return new ResponseEntity<>(TableDataInfo.build(reportService.queryYlOutDetail(whereJson,page)),HttpStatus.OK);
}
@GetMapping("/yl/movedetail")
@Log("原料库工单库存明细")
@ApiOperation("原料库工单库存明细")
//@SaCheckPermission("@el.check('material:list')")
public ResponseEntity<Object> queryMoveDetail(ReportQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail(whereJson,page)),HttpStatus.OK);
}
@GetMapping("/yl/in")
@Log("原材入库明细")
@ApiOperation("原材入库明细")

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/IReportService.java

@ -40,6 +40,14 @@ public interface IReportService extends IService<ReportDto> {
*/
IPage<YCLKCDto> queryYlOutDetail(ReportQuery whereJson, PageQuery pageable);
/**
* 查询原料缓存区库存
* @param whereJson
* @param pageable
* @return
*/
IPage<YCLKCDto> queryMoveDetail(ReportQuery whereJson, PageQuery pageable);
IPage<YlDto> queryYlIn(ReportQuery whereJson, PageQuery pageable);
IPage<YlDto> queryYlOut(ReportQuery whereJson, PageQuery pageable);

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.java

@ -27,6 +27,8 @@ public interface ReportMapper extends BaseMapper<ReportDto> {
IPage<YCLKCDto> queryYlOutDetail(IPage<YCLKCDto> pages, ReportQuery query);
IPage<YCLKCDto> queryMoveDetail(IPage<YCLKCDto> pages, ReportQuery query);
IPage<YlDto> queryYlIn(IPage<YlDto> pages, ReportQuery query);
IPage<YlDto> queryYlOut(IPage<YlDto> pages, ReportQuery query);

31
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml

@ -121,6 +121,7 @@
AND p.vehicle_code2 IS NOT NULL
AND t.STATUS IN ( '0','1')
AND p.region_code IN ( 'YL','YLHC','KJHC' )
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
<if test="query.supplierName != null">
and m2.supplierName like CONCAT('%', #{query.supplierName}, '%')
</if>
@ -147,6 +148,36 @@
ORDER BY point_code ASC
</select>
<select id="queryMoveDetail" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">
SELECT
a.*
FROM
(
SELECT
p.point_code AS pointCode,
p.region_name AS regionName,
p.vehicle_code2 AS subTray,
p.vehicle_code AS motherTray,
( CASE WHEN ( p.ing_task_code = '' OR p.ing_task_code IS NULL ) THEN 0 ELSE 1 END ) AS STATUS,
p.update_time AS updateTime
FROM
sch_base_point p
WHERE
p.vehicle_code2 != ''
AND p.vehicle_code2 IS NOT NULL
AND p.is_used = '1'
AND P.vehicle_code2 NOT LIKE '%YBHC%'
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
AND p.region_code IN ( 'YLHC' )) a
<if test="query.point_code != null">
and a.point_code like CONCAT('%', #{query.point_code}, '%')
</if>
<if test="query.status != null">
and a.status = #{query.point_code}
</if>
ORDER BY a.pointCode ASC
</select>
<select id="queryYlIn" resultType="org.nl.wms.sch.report.service.dto.YlDto">
SELECT
m.lotSN,

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/impl/ReportServiceImpl.java

@ -54,6 +54,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
return pages;
}
@Override
public IPage<YCLKCDto> queryMoveDetail(ReportQuery query, PageQuery pageQuery){
IPage<YCLKCDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
pages = reportMapper.queryMoveDetail(pages, query);
return pages;
}
@Override
public IPage<YlDto> queryYlIn(ReportQuery query, PageQuery pageQuery){
IPage<YlDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -59,6 +59,8 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
@Autowired
private AcsToWmsService acsToWmsService;
@Autowired
private ISchBasePointService pointService;
@Override
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page) {
@ -293,6 +295,9 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
.eq(SchBasePoint::getRegion_code, "YL")
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getVehicle_qty, 0)
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
.or()
.eq(SchBasePoint::getVehicle_code2, ""))
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")));
@ -302,13 +307,23 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return;
}
JSONObject param = new JSONObject();
SchBasePoint nexSchBasePoint = nextList.get(0);
param.put("start_point", schBasePoint.getPoint_code());
param.put("next_point", nextList.get(0).getPoint_code());
param.put("next_point", nexSchBasePoint.getPoint_code());
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("device_code", param.getString("start_point"));
param.put("vehicle_code",schBasePoint.getVehicle_code());
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
param.put("device_code", schBasePoint.getPoint_code());
acsToWmsService.pdaApply(param);
//发起任务时先把点位占用,防止发起重复任务
schBasePoint.setIng_task_code("1");
pointService.update(schBasePoint);
nexSchBasePoint.setIng_task_code("1");
pointService.update(nexSchBasePoint);
nextList.remove(0);
}
}
}

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/WorkorderController.java

@ -68,4 +68,13 @@ public class WorkorderController {
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/batchCreate")
@Log("批量生成移库任务")
@ApiOperation("批量生成移库任务")
public ResponseEntity<Object> batchCreate(@RequestBody PointDetailAdd pointDetailAdd){
log.info("批量生成移库任务:"+pointDetailAdd.toString());
workorderService.batchCreate(pointDetailAdd);
return new ResponseEntity<>(HttpStatus.OK);
}
}

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java

@ -53,6 +53,12 @@ public interface IWorkorderService extends IService<Workorder> {
*/
void batchChange( PointDetailAdd pointDetailAdd);
/**
* 批量生成移库任务
* @param pointDetailAdd
*/
void batchCreate( PointDetailAdd pointDetailAdd);
/**
* 批量生成工单出库任务
*/

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml

@ -57,6 +57,7 @@
AND p.vehicle_code2 IS NOT NULL
AND t.STATUS = '1'
AND p.region_code IN ( 'YL','YLHC','KJHC' )
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
GROUP BY
pointCode
ORDER BY point_code ASC
@ -105,6 +106,7 @@
AND p.vehicle_code2 IS NOT NULL
AND t.STATUS IN ( '0' )
AND p.region_code IN ( 'YL','YLHC','KJHC' )
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
GROUP BY
pointCode
ORDER BY point_code ASC

66
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

@ -12,8 +12,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.pda.service.PdaService;
import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.report.service.dto.YCLKCDto;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
@ -44,6 +47,12 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
private ISchBaseTaskService taskService;
@Autowired
private PdaService pdaService;
@Autowired
private ISchBasePointService schBasePointService;
@Autowired
private AcsToWmsService acsToWmsService;
@Autowired
private ISchBasePointService pointService;
@Override
public IPage<Workorder> queryAll(WorkorderQuery whereJson, PageQuery page){
@ -111,6 +120,63 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
//更新工单状态和回温模式
workorderMapper.batchChange(pointCodes,mode,status);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void batchCreate( PointDetailAdd pointDetailAdd){
log.info("管理端发起一键移库!");
//点位集合
List<String> pointCodes = pointDetailAdd.getPointCodes();
//下发状态
String status = pointDetailAdd.getStatus();
if("1".equals(status)){
for(String pointCode : pointCodes){
//查询当前点位最新信息
SchBasePoint schBasePoint =schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getRegion_code, "YLHC")
.eq(SchBasePoint::getPoint_code, pointCode)
.notLike(SchBasePoint::getVehicle_code2, "YBHC")
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")
));
if(ObjectUtil.isNull(schBasePoint)){
continue;
}
//查询是否有目的空点位
SchBasePoint nexSchBasePoint = schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getRegion_code, "YL")
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getVehicle_qty, 0)
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
.or()
.eq(SchBasePoint::getVehicle_code2, ""))
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")));
if(ObjectUtil.isNull(nexSchBasePoint)){
log.info("原料库存区无可用点位,取消后续循环");
break;
}
JSONObject param = new JSONObject();
param.put("start_point", schBasePoint.getPoint_code());
param.put("next_point", nexSchBasePoint.getPoint_code());
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("vehicle_code",schBasePoint.getVehicle_code());
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
param.put("device_code", schBasePoint.getPoint_code());
acsToWmsService.pdaApply(param);
//发起任务时先把点位占用,防止发起重复任务
schBasePoint.setIng_task_code("1");
pointService.update(schBasePoint);
nexSchBasePoint.setIng_task_code("1");
pointService.update(nexSchBasePoint);
}
}
}
@Override
//@Transactional(rollbackFor = Exception.class)
public void batchCreateTask(){

67
lms/nladmin-ui/src/views/wms/sch/movestor/detail.js

@ -0,0 +1,67 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/report',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/report/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/report',
method: 'put',
data
})
}
export function getGroup(data) {
return request({
url: 'api/report/getGroup',
method: 'post',
data
})
}
export function getSupplierNameList(data) {
return request({
url: 'api/report/getSupplierNameList',
method: 'get',
data
})
}
export function getProductDescriptionList(data) {
return request({
url: 'api/report/getProductDescriptionList',
method: 'get',
data
})
}
export function getLotSNList(data) {
return request({
url: 'api/report/getLotSNList',
method: 'get',
data
})
}
export function getIngotBatchList(data) {
return request({
url: 'api/report/getIngotBatchList',
method: 'get',
data
})
}
export default { add, edit, del, getGroup, getSupplierNameList, getProductDescriptionList, getLotSNList, getIngotBatchList }

226
lms/nladmin-ui/src/views/wms/sch/movestor/index.vue

@ -0,0 +1,226 @@
<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="90px"
label-suffix=":"
>
<el-form-item label="点位编码">
<el-select
v-model="query.point_code"
clearable
size="mini"
placeholder="点位编码"
class="filter-item"
filterable
@remote-method="getPointList"
>
<el-option
v-for="item in pointList"
:label="item.point_code"
:value="item.point_code"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
提交移库
</el-button>
<el-button
slot="right"
class="filter-item"
type="primary"
icon="el-icon-s-promotion"
size="mini"
@click="autoMove"
>
一键移库
</el-button>
</crudOperation>
<el-dialog
title="确认"
:visible.sync="dialogVisible"
width="30%"
>
<span>您确定要移库吗</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmMove">确定</el-button>
</span>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
:cell-style="cellStyle"
style="width: 100%;"
height="550"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="pointCode" label="点位名称" :min-width="flexWidth('pointCode',crud.data,'点位名称')" />
<el-table-column prop="regionName" label="区域名称" :min-width="flexWidth('regionName',crud.data,'区域名称')" />
<el-table-column prop="subTray" label="子托编码" :min-width="flexWidth('subTray',crud.data,'子托编码')" />
<el-table-column prop="motherTray" label="母托编码" :min-width="flexWidth('motherTray',crud.data,'母托编码')" />
<el-table-column prop="status" label="提交状态" :formatter="format_work_order_two_status" :min-width="flexWidth('status',crud.data,'工单状态')" />
<el-table-column prop="updateTime" label="入库时间" :min-width="flexWidth('updateTime',crud.data,'入库时间')" />
</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 crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
export default {
name: 'moveStor',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '缓存区一键移库',
url: 'api/report/yl/movedetail',
idField: 'pointCode',
sort: 'pointCode,desc',
optShow: {
add: false,
edit: false,
del: false,
download: false,
reset: false
},
query: {}
})
},
data() {
return {
permission: {
},
confirm_flag: false,
dialogVisible: false,
rows: [],
pointList: [],
choose: '物料'
}
},
created() {
this.getPointList()
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
this.handleCurrentChange(null)
return true
},
confirm() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选托盘!')
return
}
// subTray
const pointCodes = this.rows.map(row => row.pointCode)
//
this.$axios.post('/api/workorder/batchCreate', {
pointCodes: pointCodes,
status: '1'
}).then(response => {
//
this.$message.success('移库提交成功!')
this.crud.toQuery()
}).catch(error => {
//
this.$message.error('移库提交失败,请重试')
})
},
autoMove(){
this.dialogVisible = true
},
confirmMove(){///api/schBaseTask/move
this.$axios.post('/api/schBaseTask/move', { })
.then(response => {
//
this.$message.success('一键移库提交成功!')
console.log(response.data)
})
.catch(error => {
//
this.$message.error('一键移库提交失败,请重试')
console.error(error)
}) .finally(() => {
this.dialogVisible = false // Close the dialog
})
},
handleSelectionChange(val, row) {
this.rows = this.$refs.table.selection
var strs = ''
this.handleCurrentChange(null)
if (this.rows.length > 0) {
this.rows.forEach(now => {
strs += now.status
})
if (strs.indexOf('1') != -1) {
this.confirm_flag = true
}
}
},
handleCurrentChange(current) {
if (current === null) {
this.confirm_flag = false
}
},
cellStyle({ row, column, rowIndex, columnIndex }) {
const status = row.status
if (column.property === 'status') {
if (status == '1') {
return 'background: #13ce66'
} else {
return 'background: #FFBA00'
}
}
},
format_work_order_two_status(row, column) {
if(row.status ==='1'){
return '已提交';
}
return '未提交';
},
getPointList() { //
crudSchBasePoint.getPointsByRegionCodes('YLHC').then(res => {
this.pointList = res
})
}
}
}
</script>
<style scoped>
</style>

4
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -175,7 +175,7 @@
>
禁用
</el-button>
<el-button
<!-- <el-button
slot="right"
class="filter-item"
size="mini"
@ -184,7 +184,7 @@
@click="showConfirmationDialog"
>
缓存区一键移库
</el-button>
</el-button>-->
<!-- Confirmation Dialog -->
</crudOperation>
<el-dialog

4
lms/nladmin-ui/src/views/wms/ycl/detail/index.vue

@ -102,7 +102,7 @@
<el-table-column prop="motherTray" label="母托编码" :min-width="flexWidth('motherTray',crud.data,'母托编码')" />
<el-table-column prop="supplierName" label="供应商名称" :min-width="flexWidth('supplierName',crud.data,'供应商名称')" />
<el-table-column prop="productDescription" label="物料名称" :min-width="flexWidth('productDescription',crud.data,'物料名称')" />
<el-table-column prop="productName" label="物料名称" :min-width="flexWidth('productName',crud.data,'物料名称')" />
<el-table-column prop="productName" label="物料编码" :min-width="flexWidth('productName',crud.data,'物料编码')" />
<el-table-column prop="lotSN" label="晶体编号" :min-width="flexWidth('lotSN',crud.data,'晶体编号')" />
<el-table-column prop="ingotBatch" label="批次" :min-width="flexWidth('ingotBatch',crud.data,'批次')" />
<el-table-column prop="siliconGrade" label="棒源等级" :min-width="flexWidth('siliconGrade',crud.data,'棒源等级')" />
@ -180,7 +180,7 @@ export default {
return true
},
getPointList() { //
crudSchBasePoint.getPointList().then(res => {
crudSchBasePoint.getPointsByRegionCodes('YL').then(res => {
this.pointList = res
})
},

2
lms/nladmin-ui/src/views/wms/ycl/out/index.vue

@ -178,7 +178,7 @@ export default {
return true
},
getPointList() { //
crudSchBasePoint.getPointList().then(res => {
crudSchBasePoint.getPointsByRegionCodes('YL,YLHC').then(res => {
this.pointList = res
})
},

Loading…
Cancel
Save