fix:组盘、入库相关业务修改为混料
This commit is contained in:
@@ -2,7 +2,9 @@ package org.nl.wms.basedata_manage.controller;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -17,6 +19,7 @@ import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
|||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -24,8 +27,11 @@ import org.springframework.util.Assert;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,6 +52,8 @@ public class GroupController {
|
|||||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||||
|
@Autowired
|
||||||
|
private final MdPbGroupplateMapper mdPbGroupplateMapper;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("分页查询")
|
@Log("分页查询")
|
||||||
@@ -57,24 +65,30 @@ public class GroupController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增组盘组盘")
|
@Log("新增组盘组盘")
|
||||||
public ResponseEntity<Object> createSingle(@RequestBody JSONObject group) {
|
public ResponseEntity<Object> createSingle(@RequestBody JSONObject group) {
|
||||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
Assert.noNullElements(new Object[]{group, group.get("tableData"), group.get("storagevehicle_code")}, "请求参数不能为空");
|
||||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
String storagevehicleCode = group.getString("storagevehicle_code");
|
||||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
|
||||||
{
|
{
|
||||||
iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
||||||
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
||||||
.eq(GroupPlate::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code, storagevehicleCode)
|
||||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||||
if (has>0){
|
if (has > 0) {
|
||||||
throw new BadRequestException("当前载具组盘信息已存在");
|
throw new BadRequestException("当前载具组盘信息已存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
JSONArray rows = group.getJSONArray("tableData");
|
||||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
JSONObject row = rows.getJSONObject(i);
|
||||||
groupPlate.setCreate_time(DateUtil.now());
|
GroupPlate groupPlate = row.toJavaObject(GroupPlate.class);
|
||||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
groupPlate.setStoragevehicle_code(storagevehicleCode);
|
||||||
iMdPbGroupplateService.save(groupPlate);
|
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||||
|
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||||
|
groupPlate.setCreate_time(DateUtil.now());
|
||||||
|
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||||
|
iMdPbGroupplateService.save(groupPlate);
|
||||||
|
}
|
||||||
|
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,4 +98,18 @@ public class GroupController {
|
|||||||
iMdPbGroupplateService.delete(ids);
|
iMdPbGroupplateService.delete(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/getAllGroupInfo")
|
||||||
|
@Log("通过载具号获取全部组盘信息")
|
||||||
|
public ResponseEntity<Object> getAllGroupInfo(@RequestBody JSONArray rows) {
|
||||||
|
List<String> vehicle_list = rows.stream()
|
||||||
|
.map(obj -> (HashMap<String, String>) obj)
|
||||||
|
.map(json -> json.get("storagevehicle_code"))
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<JSONObject> list = mdPbGroupplateMapper.getVehicleMaterial(new JSONObject() {{
|
||||||
|
put("vehicle_codes", vehicle_list);
|
||||||
|
}});
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,12 @@ public class MdMeMaterialbase implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 基本计量单位
|
* 基本计量单位
|
||||||
*/
|
*/
|
||||||
private String base_unit_id;
|
private String qty_unit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基本计量单位名称
|
||||||
|
*/
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 辅助计量单位
|
* 辅助计量单位
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
|||||||
String qty = whereJson.getString("qty");
|
String qty = whereJson.getString("qty");
|
||||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialId);
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialId);
|
||||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getBase_unit_id());
|
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
||||||
// 校验
|
// 校验
|
||||||
if (ObjectUtil.isEmpty(vehicleDao) || ObjectUtil.isEmpty(materDao) || ObjectUtil.isEmpty(materDao)) {
|
if (ObjectUtil.isEmpty(vehicleDao) || ObjectUtil.isEmpty(materDao) || ObjectUtil.isEmpty(materDao)) {
|
||||||
throw new BadRequestException("载具,物料或单位信息有误!");
|
throw new BadRequestException("载具,物料或单位信息有误!");
|
||||||
|
|||||||
@@ -49,12 +49,16 @@
|
|||||||
|
|
||||||
<select id="getGroupPlate" resultType="org.nl.wms.warehouse_manage.service.dto.GroupPlateDto">
|
<select id="getGroupPlate" resultType="org.nl.wms.warehouse_manage.service.dto.GroupPlateDto">
|
||||||
SELECT group_id,
|
SELECT group_id,
|
||||||
storagevehicle_code,
|
storagevehicle_code,
|
||||||
gp.material_id,pcsn,
|
gp.material_id,
|
||||||
qty_unit_id,
|
pcsn,
|
||||||
qty_unit_name,qty,frozen_qty,remark,
|
gp.qty_unit_id,
|
||||||
status,ext_code,ext_type,
|
gp.qty_unit_name,
|
||||||
mater.material_name,mater.material_spec,mater.material_code
|
qty,
|
||||||
|
frozen_qty,
|
||||||
|
remark,
|
||||||
|
status,ext_code,ext_type,
|
||||||
|
mater.material_name,mater.material_spec,mater.material_code
|
||||||
FROM md_pb_groupplate gp
|
FROM md_pb_groupplate gp
|
||||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = gp.material_id
|
LEFT JOIN md_me_materialbase mater ON mater.material_id = gp.material_id
|
||||||
<where>
|
<where>
|
||||||
@@ -65,11 +69,11 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="params.pcsn != null">
|
<if test="params.pcsn != null">
|
||||||
AND
|
AND
|
||||||
gp.pcsn LIKE CONCAT('%', #{params.pcsn}, '%')
|
gp.pcsn LIKE CONCAT('%', #{params.pcsn}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.storagevehicle_code != null">
|
<if test="params.storagevehicle_code != null">
|
||||||
AND
|
AND
|
||||||
gp.storagevehicle_code LIKE CONCAT('%', #{params.storagevehicle_code}, '%')
|
gp.storagevehicle_code LIKE CONCAT('%', #{params.storagevehicle_code}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.begin_time != null">
|
<if test="params.begin_time != null">
|
||||||
AND
|
AND
|
||||||
|
|||||||
@@ -76,6 +76,12 @@
|
|||||||
AND
|
AND
|
||||||
gro.qty>0
|
gro.qty>0
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.vehicle_codes != null and params.vehicle_codes.size > 0">
|
||||||
|
AND gro.storagevehicle_code IN
|
||||||
|
<foreach collection="params.vehicle_codes" item="storagevehicle_code" open="(" separator="," close=")">
|
||||||
|
#{storagevehicle_code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY gro.create_time Desc
|
ORDER BY gro.create_time Desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -230,7 +230,22 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
materialChoose(row) {
|
materialChoose(row) {
|
||||||
this.form.tableData = row
|
debugger
|
||||||
|
// 对新增的行进行校验不能存在相同物料批次
|
||||||
|
row.forEach((item) => {
|
||||||
|
debugger
|
||||||
|
let same_mater = true
|
||||||
|
this.form.tableData.forEach((row) => {
|
||||||
|
debugger
|
||||||
|
if (row.material_code === item.material_code && row.pcsn === item.pcsn) {
|
||||||
|
debugger
|
||||||
|
same_mater = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (same_mater) {
|
||||||
|
this.form.tableData.splice(-1, 0, item)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async insertEvent(row) {
|
async insertEvent(row) {
|
||||||
this.dtlShow = true
|
this.dtlShow = true
|
||||||
|
|||||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del }
|
export function getAllGroupInfo(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/group/getAllGroupInfo',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getAllGroupInfo }
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
ref="table"
|
ref="table2"
|
||||||
v-loading="crud.loading"
|
v-loading="crud.loading"
|
||||||
:data="crud.data"
|
:data="crud.data"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
|
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
|
||||||
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
|
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
|
||||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||||
<el-table-column prop="unit_name" label="计量单位" />
|
<el-table-column prop="qty_unit_name" label="计量单位" />
|
||||||
<el-table-column prop="product_series_name" label="系列" />
|
<el-table-column prop="product_series_name" label="系列" />
|
||||||
<el-table-column prop="update_optname" label="修改人" />
|
<el-table-column prop="update_optname" label="修改人" />
|
||||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||||
@@ -112,20 +112,21 @@ export default {
|
|||||||
this.tableRadio = item
|
this.tableRadio = item
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
this.crud.refresh()
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.crud.resetQuery(false)
|
this.crud.resetQuery(false)
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
|
debugger
|
||||||
// 处理单选
|
// 处理单选
|
||||||
if (this.isSingle && this.tableRadio) {
|
if (this.isSingle && this.tableRadio) {
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
this.$emit('materialChoose', this.tableRadio)
|
this.$emit('materialChoose', this.tableRadio)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.rows = this.$refs.table.selection
|
this.rows = this.$refs.table2.selection
|
||||||
if (this.rows.length <= 0) {
|
if (this.rows.length <= 0) {
|
||||||
this.$message('请先勾选物料')
|
this.$message('请先勾选物料')
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -77,12 +77,12 @@ 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 DateRangePicker from '@/components/DateRangePicker/index'
|
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
import group, { getAllGroupInfo } from '@/views/wms/basedata/group/group.js'
|
||||||
|
|
||||||
const start = new Date()
|
const start = new Date()
|
||||||
export default {
|
export default {
|
||||||
name: 'AddDtl',
|
name: 'AddDtl',
|
||||||
components: { crudOperation, rrOperation, pagination, DateRangePicker },
|
components: { crudOperation, rrOperation, pagination, DateRangePicker, group },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '用户',
|
title: '用户',
|
||||||
@@ -149,10 +149,10 @@ export default {
|
|||||||
console.log('获取的rows:')
|
console.log('获取的rows:')
|
||||||
console.log(this.rows)
|
console.log(this.rows)
|
||||||
this.$emit('tableChanged', this.rows)
|
this.$emit('tableChanged', this.rows)
|
||||||
// crudRawAssist.queryBoxMater(this.rows).then(res => {
|
group.getAllGroupInfo(this.rows).then(res => {
|
||||||
// this.rows = res
|
this.rows = res.content
|
||||||
// this.$emit('tableChanged', this.rows)
|
this.$emit('tableChanged', this.rows)
|
||||||
// })
|
})
|
||||||
// this.form = this.$options.data().form
|
// this.form = this.$options.data().form
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user