add:手持增加库存出库功能
This commit is contained in:
@@ -16,6 +16,7 @@ import org.nl.common.utils.RedissonUtils;
|
|||||||
import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService;
|
import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService;
|
||||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
||||||
|
import org.nl.wms.pda_manage.iostorage.server.dto.PdaMaterOutMst;
|
||||||
import org.nl.wms.pda_manage.iostorage.sevice.PdaIOService;
|
import org.nl.wms.pda_manage.iostorage.sevice.PdaIOService;
|
||||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||||
@@ -101,5 +102,15 @@ public class PdaOutController {
|
|||||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("materConfirm")
|
||||||
|
@Log("物料出库确认")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<TableDataInfo> materConfirm(@RequestBody PdaMaterOutMst pdaMaterOutMst) {
|
||||||
|
RedissonUtils.lock(() -> {
|
||||||
|
pdaIOService.PdaMaterOutStorage(pdaMaterOutMst);
|
||||||
|
}, pdaMaterOutMst.getStruct_code(), null);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.nl.wms.pda_manage.iostorage.server.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 物料出库
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2024-03-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PdaMaterOutMst {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库仓库
|
||||||
|
*/
|
||||||
|
private String stor_code;
|
||||||
|
/**
|
||||||
|
* 出库仓位
|
||||||
|
*/
|
||||||
|
private String struct_code;
|
||||||
|
/**
|
||||||
|
* 出库车间
|
||||||
|
*/
|
||||||
|
private String product_area;
|
||||||
|
/**
|
||||||
|
* 出库托盘
|
||||||
|
*/
|
||||||
|
private String vehicle_code;
|
||||||
|
/**
|
||||||
|
* 出库物料
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
/**
|
||||||
|
* 出库数量默认等于qty允许修改
|
||||||
|
*/
|
||||||
|
private BigDecimal now_assign_qty;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
|||||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutDtl;
|
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutDtl;
|
||||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
||||||
|
import org.nl.wms.pda_manage.iostorage.server.dto.PdaMaterOutMst;
|
||||||
import org.nl.wms.pda_manage.iostorage.server.dto.ReceiveBillData;
|
import org.nl.wms.pda_manage.iostorage.server.dto.ReceiveBillData;
|
||||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||||
@@ -37,11 +38,14 @@ import org.nl.wms.stor_manage.io.service.iostor.dao.StIvtIostorinv;
|
|||||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
|
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
|
||||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.dao.StIvtIostorinvdtl;
|
import org.nl.wms.stor_manage.io.service.iostor_dtl.dao.StIvtIostorinvdtl;
|
||||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
import org.nl.wms.stor_manage.struct.service.dao.StructAssignQty;
|
import org.nl.wms.stor_manage.struct.service.dao.StructAssignQty;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.dto.StructattrVechielDto;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -55,9 +59,6 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class PdaIOService {
|
public class PdaIOService {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ErpServiceUtils erpServiceUtils;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ErpSec erpSec;
|
private ErpSec erpSec;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -82,6 +83,69 @@ public class PdaIOService {
|
|||||||
private IMdPbVehicleMaterService iMdPbVehicleMaterService;
|
private IMdPbVehicleMaterService iMdPbVehicleMaterService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持物料出库不回传
|
||||||
|
* @param pdaFormOutMst
|
||||||
|
*/
|
||||||
|
public void PdaMaterOutStorage(PdaMaterOutMst pdaFormOutMst) {
|
||||||
|
String vehicleCode = pdaFormOutMst.getVehicle_code();
|
||||||
|
String structCode = pdaFormOutMst.getStruct_code();
|
||||||
|
String storCode = pdaFormOutMst.getStor_code();
|
||||||
|
String pcsn = pdaFormOutMst.getPcsn();
|
||||||
|
String product_area = pdaFormOutMst.getProduct_area();
|
||||||
|
BigDecimal now_assign_qty = pdaFormOutMst.getNow_assign_qty();
|
||||||
|
Assert.noNullElements(new Object[]{product_area,pcsn,vehicleCode,structCode,storCode,now_assign_qty},"出库失败,请求参数不能为空");
|
||||||
|
List<StructattrVechielDto> structattrVechielDtos = iStIvtStructattrService.structVehicle(MapOf.of("stor_code", storCode, "struct_code", structCode, "vehicle_code", vehicleCode, "pcsn", pcsn));
|
||||||
|
if (CollectionUtils.isEmpty(structattrVechielDtos)){
|
||||||
|
throw new BadRequestException("当前库存不存在或库存锁定");
|
||||||
|
}
|
||||||
|
|
||||||
|
StructattrVechielDto structattrVechielDto = structattrVechielDtos.get(0);
|
||||||
|
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
|
.set("frozen_qty",now_assign_qty)
|
||||||
|
.eq("id",structattrVechielDto.getVm_id()));
|
||||||
|
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||||
|
.set("lock_type", StatusEnum.LOCK.code("出库锁"))
|
||||||
|
.set("update_time", DateUtil.now())
|
||||||
|
.set("update_name", SecurityUtils.getCurrentNickName())
|
||||||
|
.in("struct_code", structCode));
|
||||||
|
|
||||||
|
StructattrVechielDto vechielDto = structattrVechielDto;
|
||||||
|
StIvtIostorinv mst = new StIvtIostorinv();
|
||||||
|
{
|
||||||
|
mst.setId(IdUtil.getStringId());
|
||||||
|
mst.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
mst.setCreate_time(DateUtil.now());
|
||||||
|
mst.setCode(CodeUtil.getNewCode("IO_CODE"));
|
||||||
|
mst.setStatus(StatusEnum.FORM_STATUS.code("已分配"));
|
||||||
|
mst.setProduct_area(product_area);
|
||||||
|
mst.setBill_type(StatusEnum.IOBILL_TYPE_OUT.code("生产出库"));
|
||||||
|
mst.setIn_storage(false);
|
||||||
|
mst.setProduct_area(pdaFormOutMst.getProduct_area());
|
||||||
|
mst.setForm_data(new JSONObject(MapOf.of("shipper", null, "product_area", pdaFormOutMst.getProduct_area())));
|
||||||
|
}
|
||||||
|
StIvtIostorinvdtl ivtDtl = new StIvtIostorinvdtl();
|
||||||
|
{
|
||||||
|
ivtDtl.setMaterial_id(vechielDto.getMaterial_id());
|
||||||
|
ivtDtl.setForm_data(new JSONObject());
|
||||||
|
ivtDtl.setQty(now_assign_qty);
|
||||||
|
ivtDtl.setPcsn(pcsn);
|
||||||
|
ivtDtl.setStor_code(storCode);
|
||||||
|
ivtDtl.setId(IdUtil.getStringId());
|
||||||
|
ivtDtl.setVehicle_code(vehicleCode);
|
||||||
|
ivtDtl.setVehicle_id(vechielDto.getVm_id());
|
||||||
|
ivtDtl.setInv_id(mst.getId());
|
||||||
|
ivtDtl.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||||
|
ivtDtl.setSource_form_data(new JSONObject());
|
||||||
|
}
|
||||||
|
iStIvtIostorinvdtlService.save(ivtDtl);
|
||||||
|
iStIvtIostorinvService.save(mst);
|
||||||
|
this.pdaTaskOpen(mst);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 手持单据出库
|
||||||
|
* @param pdaFormOutMst
|
||||||
|
*/
|
||||||
public void PpdaOrderOutStorage(PdaFormOutMst pdaFormOutMst) {
|
public void PpdaOrderOutStorage(PdaFormOutMst pdaFormOutMst) {
|
||||||
PdaIOService ioService = SpringContextHolder.getBean(PdaIOService.class);
|
PdaIOService ioService = SpringContextHolder.getBean(PdaIOService.class);
|
||||||
//创建单据分配货位
|
//创建单据分配货位
|
||||||
@@ -90,6 +154,11 @@ public class PdaIOService {
|
|||||||
this.pdaTaskOpen(byId);
|
this.pdaTaskOpen(byId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分配检查
|
||||||
|
* @param pdaFormOutMst
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public StIvtIostorinv createPadIvtAndoutDispense(PdaFormOutMst pdaFormOutMst) {
|
public StIvtIostorinv createPadIvtAndoutDispense(PdaFormOutMst pdaFormOutMst) {
|
||||||
// || StringUtils.isEmpty(pdaFormOutMst.getStor_code())
|
// || StringUtils.isEmpty(pdaFormOutMst.getStor_code())
|
||||||
|
|||||||
@@ -45,6 +45,12 @@
|
|||||||
<if test="query.stor_code != null and query.stor_code != ''">
|
<if test="query.stor_code != null and query.stor_code != ''">
|
||||||
and struct.stor_code = #{query.stor_code}
|
and struct.stor_code = #{query.stor_code}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.pcsn != null and query.pcsn != ''">
|
||||||
|
and md_pb_vehicleMater.pcsn = #{query.pcsn}
|
||||||
|
</if>
|
||||||
|
<if test="query.material_code != null and query.material_code != ''">
|
||||||
|
and md_pb_vehicleMater.material_code = #{query.material_code}
|
||||||
|
</if>
|
||||||
<if test="query.sect_code != null and query.sect_code != ''">
|
<if test="query.sect_code != null and query.sect_code != ''">
|
||||||
and struct.sect_code = #{query.sect_code}
|
and struct.sect_code = #{query.sect_code}
|
||||||
</if>
|
</if>
|
||||||
@@ -105,6 +111,16 @@
|
|||||||
<if test="stor_code != null and stor_code != ''">
|
<if test="stor_code != null and stor_code != ''">
|
||||||
and st_ivt_structattr.stor_code = #{stor_code}
|
and st_ivt_structattr.stor_code = #{stor_code}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="struct_code != null and struct_code != ''">
|
||||||
|
and st_ivt_structattr.struct_code = #{struct_code}
|
||||||
|
</if>
|
||||||
|
<if test="pcsn != null and pcsn != ''">
|
||||||
|
and md_pb_vehicleMater.pcsn = #{pcsn}
|
||||||
|
</if>
|
||||||
|
<if test="vehicle_code != null and vehicle_code != ''">
|
||||||
|
and st_ivt_structattr.vehicle_code = #{vehicle_code}
|
||||||
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStructIvt" resultType="java.util.Map">
|
<select id="getStructIvt" resultType="java.util.Map">
|
||||||
@@ -120,6 +136,7 @@
|
|||||||
vm.qty,
|
vm.qty,
|
||||||
vm.frozen_qty,
|
vm.frozen_qty,
|
||||||
vm.unit_id,
|
vm.unit_id,
|
||||||
|
vm.vehicle_id,
|
||||||
vm.parent_vehicle_code,
|
vm.parent_vehicle_code,
|
||||||
material.material_code,
|
material.material_code,
|
||||||
material.material_name,
|
material.material_name,
|
||||||
@@ -154,6 +171,9 @@
|
|||||||
<if test="query.stor_code != null and query.stor_code != ''">
|
<if test="query.stor_code != null and query.stor_code != ''">
|
||||||
and struct.stor_code = #{query.stor_code}
|
and struct.stor_code = #{query.stor_code}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.struct_code != null and query.struct_code != ''">
|
||||||
|
and struct.struct_code = #{query.struct_code}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getStructIvtAssign" resultType="org.nl.wms.stor_manage.struct.service.dao.StructAssignQty">
|
<select id="getStructIvtAssign" resultType="org.nl.wms.stor_manage.struct.service.dao.StructAssignQty">
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class StructattrQuery extends BaseQuery<StIvtStructattr> {
|
|||||||
private String material;
|
private String material;
|
||||||
private Boolean has;
|
private Boolean has;
|
||||||
private String pcsn;
|
private String pcsn;
|
||||||
|
private String material_code;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paramMapping() {
|
public void paramMapping() {
|
||||||
super.doP.put("search", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
super.doP.put("search", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
||||||
|
|||||||
Reference in New Issue
Block a user