rev:成品损益修改

This commit is contained in:
2023-05-29 20:34:40 +08:00
parent 3de19fcecb
commit 02bc0fdb96
14 changed files with 140 additions and 11 deletions

View File

@@ -21,6 +21,7 @@ public class StructarrQuery extends BaseQuery<StIvtStructattr> {
private String is_semi_finished;
private String is_virtualstore;
private String sect_id;
private String struct_code;
@Override
public void paramMapping() {

View File

@@ -1,5 +1,13 @@
package org.nl.wms.storage_manage.productmanage.controller.structIvt;
import io.swagger.annotations.ApiOperation;
import org.nl.common.anno.Log;
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -12,8 +20,19 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2023-05-04
*/
@RestController
@RequestMapping("/stIvtStructivtCp")
@RequestMapping("/api/stIvtStructivtCp")
public class StIvtStructivtCpController {
@Autowired
private IStIvtStructivtCpService iStIvtStructivtCpService;
@PostMapping("/getStructIvt")
@Log("查询库存")
@ApiOperation("查询库存")
public ResponseEntity<Object> getStructIvt(StructIvtYLQuery query) {
return new ResponseEntity<>(iStIvtStructivtCpService.getStructIvtMore(query), HttpStatus.OK);
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -25,6 +26,7 @@ public class StIvtMoreorlessdtlCp implements Serializable {
/**
* 损溢单明细id
*/
@TableId
private String mol_dtl_id;
/**

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -26,6 +27,7 @@ public class StIvtMoreorlessmstCp implements Serializable {
/**
* 损溢单标识
*/
@TableId
private String mol_id;
/**

View File

@@ -6,6 +6,7 @@
mst.*,
a.total_qty,
a.struct_name,
a.storagevehicle_code,
sa.struct_code,
sa.struct_id,
sa.sect_id,
@@ -17,9 +18,11 @@
dtl.struct_name,
dtl.struct_id,
SUM( dtl.mol_qty ) AS total_qty,
dtl.mol_id
dtl.mol_id,
dtl.bucketunique,
MAX(dtl.storagevehicle_code) AS storagevehicle_code
FROM
st_ivt_moreorlessdtl_yl dtl
st_ivt_moreorlessdtl_cp dtl
GROUP BY
dtl.struct_name,
dtl.mol_id,

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -8,10 +9,13 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIvtMoreorlessdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIvtMoreorlessdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIvtMoreorlessmstCp;
@@ -43,6 +47,10 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
@Autowired
private IStIvtStructattrService structattrService; // 仓位属性服务
@Autowired
protected IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService; // 载具信息表服务
@Override
public List<Map> getMlDtl(JSONObject form) {
return this.baseMapper.getMlDtl(form);
@@ -62,6 +70,7 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
row.setMol_dtl_id(mol_dtl_id);
row.setMol_id(mst.getMol_id());
row.setMol_code(mst.getMol_code());
row.setPcsn(DateUtil.today());
row.setSeq_no(BigDecimal.valueOf(i + 1));
// 获取库区信息
@@ -79,13 +88,28 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
if (ObjectUtil.isEmpty(structDao)) throw new BadRequestException("仓位不存在或未启用!");
row.setStruct_name(structDao.getStruct_name());
row.setStoragevehicle_id("999999");
row.setStoragevehicle_code("999999");
// 获取载具信息
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getStoragevehicle_code())
.eq(MdPbStoragevehicleinfo::getIs_used, true)
.eq(MdPbStoragevehicleinfo::getIs_delete, false)
);
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
row.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
row.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
row.setStoragevehicle_type(vehicleDao.getStoragevehicle_type());
row.setStatus(MLEnum.DTL_STATUS.code("生成"));
this.save(row);
//锁定货位
structattrService.update(new UpdateWrapper<StIvtStructattr>().set("lock_type", "1").set("inv_code",mst.getMol_code()).eq("struct_id", row.getStruct_id()));
structattrService.update(
new UpdateWrapper<StIvtStructattr>()
.set("lock_type", IOSEnum.LOCK_TYPE.code("盘点锁"))
.set("inv_code",mst.getMol_code())
.eq("struct_id", row.getStruct_id()));
}
}
return total_qty;

View File

@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import java.util.List;
import java.util.Map;
@@ -48,4 +49,13 @@ public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
* }
*/
List<Map> getStructIvt(JSONObject whereJson);
/**
* 获取手工分配库存
* @param whereJson
* {
* 明细row
* }
*/
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
}

View File

@@ -2,7 +2,9 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import java.util.List;
import java.util.Map;
@@ -21,4 +23,6 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
List<Map> getStructIvt(JSONObject json);
List<Map> getStructIvtMore(@Param("query") StructIvtYLQuery query);
}

View File

@@ -62,4 +62,39 @@
</select>
<select id="getStructIvtMore" resultType="java.util.Map">
SELECT
ivt.*,
mu.unit_name AS qty_unit_name,
mb.material_code,
mb.material_name,
sa.sect_id,
sa.sect_code,
sa.sect_name,
sa.struct_id,
sa.struct_code,
sa.struct_name,
class.class_name
FROM
ST_IVT_StructIvt_CP ivt
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
<where>
ivt.canuse_qty > 0
AND
sa.lock_type = '0'
<if test="query.material_search != null and query.material_search != ''">
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
</if>
<if test="query.sect_id != null and query.sect_id != ''">
and sa.sect_id = #{query.sect_id}
</if>
<if test="query.struct_id != null and query.struct_id != ''">
and sa.struct_id = #{query.struct_id}
</if>
</where>
</select>
</mapper>

View File

@@ -16,6 +16,7 @@ import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivt
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper.StIvtStructivtCpMapper;
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -92,6 +93,11 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
return baseMapper.getStructIvt(whereJson);
}
@Override
public List<Map> getStructIvtMore(StructIvtYLQuery whereJson) {
return this.baseMapper.getStructIvtMore(whereJson);
}
/*
加待入
*/

View File

@@ -149,6 +149,18 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="storagevehicle_code" label="载具号" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.storagevehicle_code" class="input-with-select"/>
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
</template>
</el-table-column>
<el-table-column prop="bucketunique" label="箱号" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.bucketunique" class="input-with-select"/>
<span v-show="scope.row.edit">{{ scope.row.bucketunique }}</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
@@ -284,7 +296,7 @@ export default {
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({'stor_type': '3'}).then(res => {
crudStorattr.getStor({'stor_type': '4'}).then(res => {
this.storlist = res.content
})
},
@@ -408,6 +420,11 @@ export default {
this.nowrow = row
},
async insertdtl() {
if (!this.form.struct_code) {
this.crud.notify('请先选择货位', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.form.tableData.push({
quality_scode: '02',
ivt_qty: 0,
@@ -447,6 +464,12 @@ export default {
return false
}
}
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].storagevehicle_code !== row.storagevehicle_code) {
this.crud.notify('载具号不一致!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
// 修改行的编辑状态
row.edit = !row.edit
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新

View File

@@ -22,7 +22,7 @@
</el-col>
<el-col :span="6">
<el-input
v-model="query.search"
v-model="query.struct_code"
clearable
style="width: 200px"
size="mini"
@@ -123,7 +123,7 @@ export default {
methods: {
open() {
this.crud.resetQuery(false)
crudSectattr.getSect({ 'stor_type': '3' }).then(res => {
crudSectattr.getSect({ 'stor_type': '4' }).then(res => {
this.sects = res.content
})
if (this.sect) {

View File

@@ -218,7 +218,7 @@ export default {
}
},
created() {
crudStorattr.getStor({ 'stor_type': '3' }).then(res => {
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res.content
})
},

View File

@@ -26,7 +26,7 @@ export function edit(data) {
export function getStructIvt(params) {
return request({
url: '/api/stIvtStructivtYl/getStructIvt',
url: '/api/stIvtStructivtCp/getStructIvt',
method: 'post',
params
})