rev: 成品出库:新增出库单时将同一货位上的所有物料带出、设置任务时同一货位的任务不在生成、发货单状态修改
This commit is contained in:
@@ -16,6 +16,8 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Api(tags = "成品出库")
|
@Api(tags = "成品出库")
|
||||||
@@ -142,6 +144,13 @@ public class IStivtlostorivnCpOutController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryStructAll")
|
||||||
|
@Log("查找此货位上的所有库存")
|
||||||
|
//("查找此货位上的所有库存")
|
||||||
|
public ResponseEntity<Object> queryStructAll(@RequestBody Map whereJson) {
|
||||||
|
return new ResponseEntity<>(iStIvtIostorinvCpOutService.queryStructAll(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/initAttr")
|
@GetMapping("/initAttr")
|
||||||
@Log("初始化仓位")
|
@Log("初始化仓位")
|
||||||
//("初始化仓位")
|
//("初始化仓位")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv;
|
package org.nl.wms.storage_manage.productmanage.service.iostorInv;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
@@ -7,6 +8,7 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostor
|
|||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -185,4 +187,13 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
|
|||||||
初始化仓位
|
初始化仓位
|
||||||
*/
|
*/
|
||||||
void initAttr();
|
void initAttr();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找此货位上的所有库存
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* 数组
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
JSONArray queryStructAll(Map whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,6 +405,16 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(disDao.getPoint_id())) throw new BadRequestException("此明细已生成任务!");
|
if (ObjectUtil.isNotEmpty(disDao.getPoint_id())) throw new BadRequestException("此明细已生成任务!");
|
||||||
|
|
||||||
|
StIvtIostorinvdisCp disIsnull = iostorinvdisCpService.getOne(
|
||||||
|
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdisCp::getIostorinv_id, disDao.getIostorinv_id())
|
||||||
|
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
|
||||||
|
.ne(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("未生成"))
|
||||||
|
, false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(disIsnull)) throw new BadRequestException("此货位已生成任务!");
|
||||||
|
|
||||||
// 2.下发任务
|
// 2.下发任务
|
||||||
SchBasePoint pointDao = iSchBasePointService.getOne(
|
SchBasePoint pointDao = iSchBasePointService.getOne(
|
||||||
new QueryWrapper<SchBasePoint>().lambda()
|
new QueryWrapper<SchBasePoint>().lambda()
|
||||||
@@ -727,6 +737,20 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray queryStructAll(Map whereJson) {
|
||||||
|
List<Map> data = (List) whereJson.get("data");
|
||||||
|
|
||||||
|
// 拼接字符串
|
||||||
|
List<String> struct_code = data.stream()
|
||||||
|
.map(row -> row.get("struct_code").toString())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<Map> result = iStIvtStructivtCpService.getStructAll(struct_code);
|
||||||
|
|
||||||
|
return JSONArray.parseArray(JSON.toJSONString(result));
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
||||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||||
@@ -797,10 +821,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, iostorinv_id)
|
.eq(StIvtIostorinvdtlCp::getIostorinv_id, iostorinv_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
// 判断是否都为分配完
|
// 判断是否都为分配完 或者为完成
|
||||||
boolean is_true = dtlDaoList
|
boolean is_true = dtlDaoList
|
||||||
.stream()
|
.stream()
|
||||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
|
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")));
|
||||||
|
|
||||||
if (is_true) {
|
if (is_true) {
|
||||||
// 更新主表为分配完
|
// 更新主表为分配完
|
||||||
|
|||||||
@@ -786,6 +786,11 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(orderDao)) {
|
if (ObjectUtil.isNotEmpty(orderDao)) {
|
||||||
orderDao.setProduct_qty(NumberUtil.add(orderDao.getProduct_qty(),dao.getAssign_qty()));
|
orderDao.setProduct_qty(NumberUtil.add(orderDao.getProduct_qty(),dao.getAssign_qty()));
|
||||||
|
|
||||||
|
if (orderDao.getSale_qty().doubleValue() <= orderDao.getProduct_qty().doubleValue()) {
|
||||||
|
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||||
|
}
|
||||||
|
|
||||||
iMpsSaleOrderService.updateById(orderDao);
|
iMpsSaleOrderService.updateById(orderDao);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
|||||||
if (IOSEnum.IO_TYPE.code("入库").equals(mstDao.getIo_type())){
|
if (IOSEnum.IO_TYPE.code("入库").equals(mstDao.getIo_type())){
|
||||||
// 入库: 更新销售单状态
|
// 入库: 更新销售单状态
|
||||||
if (orderDao!=null){
|
if (orderDao!=null){
|
||||||
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
// orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||||
iMpsSaleOrderService.updateById(orderDao);
|
iMpsSaleOrderService.updateById(orderDao);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -68,4 +68,13 @@ public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
|
|||||||
*/
|
*/
|
||||||
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
|
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取此货位下所有库存
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* struct_code: '拼接货位'
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
List<Map> getStructAll(List<String> whereJson);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,7 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
|
|||||||
List<Map> getStructIvtMoreBox(JSONObject json);
|
List<Map> getStructIvtMoreBox(JSONObject json);
|
||||||
|
|
||||||
List<Map> packageQuery(@Param("query") CpIvtQuery query);
|
List<Map> packageQuery(@Param("query") CpIvtQuery query);
|
||||||
|
|
||||||
|
List<Map> getStructAll(@Param("chanList") List<String> list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,4 +198,41 @@
|
|||||||
order by ivt.instorage_time DESC,attr.struct_code ASC
|
order by ivt.instorage_time DESC,attr.struct_code ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStructAll" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
attr.stor_name,
|
||||||
|
attr.sect_name,
|
||||||
|
ivt.struct_code,
|
||||||
|
ivt.struct_name,
|
||||||
|
mater.material_id,
|
||||||
|
mater.material_name,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_spec,
|
||||||
|
attr.storagevehicle_code,
|
||||||
|
ivt.canuse_qty,
|
||||||
|
ivt.frozen_qty,
|
||||||
|
ivt.ivt_qty,
|
||||||
|
ivt.warehousing_qty,
|
||||||
|
unit.unit_name,
|
||||||
|
unit.measure_unit_id,
|
||||||
|
ivt.instorage_time,
|
||||||
|
sale.sale_code,
|
||||||
|
sale.seq_no,
|
||||||
|
sale.sale_id,
|
||||||
|
sale.sale_type
|
||||||
|
FROM
|
||||||
|
st_ivt_structivt_cp ivt
|
||||||
|
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||||
|
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||||
|
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||||
|
LEFT JOIN mps_sale_order sale ON sale.sale_id = ivt.sale_id
|
||||||
|
<where>
|
||||||
|
attr.struct_code in
|
||||||
|
<foreach collection="chanList" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -144,6 +144,11 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
|||||||
return structIvtList;
|
return structIvtList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> getStructAll(List<String> whereJson) {
|
||||||
|
return this.baseMapper.getStructAll(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
加待入
|
加待入
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -170,7 +170,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" />
|
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" />
|
||||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" />
|
<el-table-column show-overflow-tooltip prop="source_bill_code" label="发货单号" />
|
||||||
|
|
||||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ import CRUD, { crud, header, presenter } from '@crud/crud'
|
|||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
|
import productOut from '@/views/wms/storage_manage/product/productOut/productout'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddDtl',
|
name: 'AddDtl',
|
||||||
@@ -200,14 +201,24 @@ export default {
|
|||||||
this.$emit('tableChanged', this.tableRadio)
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rows = this.$refs.multipleTable.selection
|
this.rows = this.$refs.multipleTable.selection
|
||||||
if (this.rows.length <= 0) {
|
if (this.rows.length <= 0) {
|
||||||
this.$message('请先勾选物料')
|
this.$message('请先勾选物料')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.crud.resetQuery(false)
|
|
||||||
this.$emit('update:dialogShow', false)
|
// 将此托盘上的所有物料都带出
|
||||||
this.$emit('tableChanged', this.rows)
|
const data = {
|
||||||
|
'data': this.rows
|
||||||
|
}
|
||||||
|
productOut.queryStructAll(data).then(res => {
|
||||||
|
debugger
|
||||||
|
this.rows = res
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ export default {
|
|||||||
name: 'ProductOut',
|
name: 'ProductOut',
|
||||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
|
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/productOut', crudMethod: { ...productOut },
|
return CRUD({ title: '出库单', idField: 'iostorinv_id', url: 'api/productOut', crudMethod: { ...productOut },
|
||||||
optShow: {
|
optShow: {
|
||||||
add: true,
|
add: true,
|
||||||
edit: false,
|
edit: false,
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ export function confirmTask(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function queryStructAll(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/productOut/queryStructAll',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
@@ -126,5 +134,6 @@ export default {
|
|||||||
manualDiv,
|
manualDiv,
|
||||||
delTask,
|
delTask,
|
||||||
sendTask,
|
sendTask,
|
||||||
confirmTask
|
confirmTask,
|
||||||
|
queryStructAll
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user