opt:更新

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-07-28 17:42:21 +08:00
parent 971e1c99ae
commit 73dd8ac0b7
23 changed files with 206 additions and 244 deletions

View File

@@ -46,13 +46,11 @@ public class SecurityUtils {
* @return 系统用户名称 * @return 系统用户名称
*/ */
public static String getCurrentNickName() { public static String getCurrentNickName() {
// CurrentUser user = getCurrentUser(); CurrentUser user = getCurrentUser();
// if (user!=null){ if (user!=null){
// return user.getPresonName(); return user.getPresonName();
// } }
// return null; return "default";
//tofix postMan测试完成后改回
return "admin";
} }
/** /**
@@ -61,9 +59,7 @@ public class SecurityUtils {
* @return 系统用户Id * @return 系统用户Id
*/ */
public static String getCurrentUserId() { public static String getCurrentUserId() {
//return getCurrentUser().getId(); return getCurrentUser().getId();
//tofix postMan测试完成后改回
return "1";
} }
/** /**
@@ -72,7 +68,7 @@ public class SecurityUtils {
*/ */
@Deprecated @Deprecated
public static Long getDeptId() { public static Long getDeptId() {
// return getCurrentUser().getUser().getDept().getId(); //return getCurrentUser().getUser().getDept().getId();
return 1L; return 1L;
} }

View File

@@ -22,10 +22,23 @@ public class StructattrVechielDto extends GroupPlate {
* 仓位编码 * 仓位编码
*/ */
private String struct_code; private String struct_code;
/**
* 仓位编码
*/
private String struct_name;
/**
* 库区标识
*/
private String sect_id;
/** /**
* 库区标识 * 库区标识
*/ */
private String sect_code; private String sect_code;
/**
* 库区标识
*/
private String sect_name;
/** /**
* 仓库标识 * 仓库标识
*/ */

View File

@@ -87,5 +87,5 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
* @param whereJson * @param whereJson
* @return * @return
*/ */
List<MdPbStoragevehicleextDto> queryAvailableInv(@Param("params") Map whereJson); List<JSONObject> queryAvailableInv(@Param("params") Map whereJson);
} }

View File

@@ -254,7 +254,7 @@
ORDER BY ext.create_time Desc ORDER BY ext.create_time Desc
</select> </select>
<select id="queryAvailableInv" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto"> <select id="queryAvailableInv" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
ext.group_id as storagevehicleext_id, ext.group_id as storagevehicleext_id,
ext.storagevehicle_code, ext.storagevehicle_code,
@@ -277,7 +277,10 @@
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
<where> <where>
1 = 1 attr.lock_type = '0'
AND attr.is_used = "1"
AND ext.status = '02'
and ext.frozen_qty = 0
<if test="params.stor_id != null and params.stor_id != ''"> <if test="params.stor_id != null and params.stor_id != ''">
AND AND
attr.stor_id = #{params.stor_id} attr.stor_id = #{params.stor_id}

View File

@@ -114,7 +114,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成")); jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
jsonDtl.setStor_id(storDao.getStor_id()); jsonDtl.setStor_id(storDao.getStor_id());
jsonDtl.setStor_name(storDao.getStor_name()); jsonDtl.setStor_name(storDao.getStor_name());
jsonDtl.setForm_type(json.getString("order_type")); jsonDtl.setForm_type("0001");
jsonDtl.setSource_form_date(DateUtil.today()); jsonDtl.setSource_form_date(DateUtil.today());
jsonDtl.setMaterial_code(json.getString("mater_code")); jsonDtl.setMaterial_code(json.getString("mater_code"));
jsonDtl.setMaterial_id(materDao.getMaterial_id()); jsonDtl.setMaterial_id(materDao.getMaterial_id());
@@ -140,7 +140,8 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
plate.setQty(BigDecimal.valueOf(json.getDoubleValue("qty"))); plate.setQty(BigDecimal.valueOf(json.getDoubleValue("qty")));
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成")); plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("生成"));
plate.setExt_code(json.getString("order_code")); plate.setExt_code(json.getString("order_code"));
plate.setExt_type(json.getString("order_type")); plate.setExt_type("0001");
plate.setExt_id(jsonDtl.getId());
plate.setCreate_name("ERP"); plate.setCreate_name("ERP");
plate.setCreate_time(DateUtil.now()); plate.setCreate_time(DateUtil.now());
plates.add(plate); plates.add(plate);
@@ -204,7 +205,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成")); jsonDtl.setStatus(IOSEnum.BILL_STATUS.code("生成"));
jsonDtl.setStor_id(storDao.getStor_id()); jsonDtl.setStor_id(storDao.getStor_id());
jsonDtl.setStor_name(storDao.getStor_name()); jsonDtl.setStor_name(storDao.getStor_name());
jsonDtl.setForm_type(json.getString("order_type")); jsonDtl.setForm_type("1001");
jsonDtl.setSource_form_date(DateUtil.today()); jsonDtl.setSource_form_date(DateUtil.today());
jsonDtl.setMaterial_code(json.getString("mater_code")); jsonDtl.setMaterial_code(json.getString("mater_code"));
jsonDtl.setMaterial_id(materDao.getMaterial_id()); jsonDtl.setMaterial_id(materDao.getMaterial_id());

View File

@@ -156,7 +156,7 @@ public class PmFormData implements Serializable {
/** /**
* 是否完结 * 是否完结
*/ */
private Integer is_finish; private String is_finish;
/** /**
* 是否合单 * 是否合单

View File

@@ -125,6 +125,9 @@
<if test="query.form_type != null and query.form_type != ''"> <if test="query.form_type != null and query.form_type != ''">
and form_type = #{query.form_type} and form_type = #{query.form_type}
</if> </if>
<if test="query.is_finish != null and query.is_finish != ''">
and is_finish = #{query.is_finish}
</if>
<if test="query.pcsn != null and query.pcsn != ''"> <if test="query.pcsn != null and query.pcsn != ''">
and pcsn = #{query.pcsn} and pcsn = #{query.pcsn}
</if> </if>

View File

@@ -22,6 +22,7 @@ public class FormDataQuery extends BaseQuery<PmFormData> {
private String pcsn; private String pcsn;
private String parent_id; private String parent_id;
private String material_code; private String material_code;
private String is_finish;
private String[] status; private String[] status;
private String start_time; private String start_time;
private String end_time; private String end_time;

View File

@@ -116,7 +116,7 @@ public interface IOutBillService extends IService<IOStorInv> {
* @param whereJson * @param whereJson
* @return * @return
*/ */
List<MdPbStoragevehicleextDto> queryAvailableInv(Map whereJson); List<JSONObject> queryAvailableInv(Map whereJson);
/** /**
* 出库单手动分配 * 出库单手动分配

View File

@@ -113,4 +113,9 @@ public class GroupPlate implements Serializable {
* 来源单据类型 * 来源单据类型
*/ */
private String ext_type; private String ext_type;
/**
* 来源单据id
*/
private String ext_id;
} }

View File

@@ -54,20 +54,22 @@
gp.material_id, gp.material_id,
gp.qty_unit_id, gp.qty_unit_id,
gp.qty_unit_name, gp.qty_unit_name,
gp.qty, gp.qty as plan_qty,
gp.frozen_qty, gp.frozen_qty,
gp.remark, gp.remark,
gp.STATUS, gp.STATUS,
mater.material_name, mater.material_name,
mater.material_spec, mater.material_spec,
mater.material_code, mater.material_code,
gp.ext_code, gp.ext_code as source_bill_code,
gp.ext_type gp.ext_type as source_bill_type,
gp.ext_id as source_billdtl_id
FROM FROM
md_pb_groupplate gp 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>
gp.status = '01' and frozen_qty = 0 gp.status = '01' and frozen_qty = 0
and gp.ext_type = '0001'
<if test="params.material_code != null"> <if test="params.material_code != null">
AND AND
gp.material_code LIKE CONCAT('%', #{params.material_code}, '%') gp.material_code LIKE CONCAT('%', #{params.material_code}, '%')
@@ -120,7 +122,7 @@
</select> </select>
<select id="getIODtl" resultType="org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto"> <select id="getIODtl" resultType="org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto">
SELECT DISTINCT SELECT
dtl.*, dtl.*,
mb.material_code, mb.material_code,
mb.material_name, mb.material_name,

View File

@@ -3,13 +3,18 @@ package org.nl.wms.warehouse_manage.service.dto;
import lombok.Data; import lombok.Data;
import org.nl.wms.warehouse_manage.service.dao.GroupPlate; import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
import java.math.BigDecimal;
/** /**
* @author dsh * @author dsh
* 2025/5/20 * 2025/5/20
*/ */
@Data @Data
public class GroupPlateDto extends GroupPlate{ public class GroupPlateDto extends GroupPlate{
/**
* 组盘数量
*/
private BigDecimal plan_qty;
/** /**
* 物料编码 * 物料编码
*/ */
@@ -21,4 +26,19 @@ public class GroupPlateDto extends GroupPlate{
* 物料名称 * 物料名称
*/ */
private String material_name; private String material_name;
/**
* 物料名称
*/
private String source_bill_code;
/**
* 物料名称
*/
private String source_bill_type;
/**
* 物料名称
*/
private String source_billdtl_id;
} }

View File

@@ -21,13 +21,18 @@ import org.nl.config.SpringContextHolder;
import org.nl.wms.basedata_manage.enums.BaseDataEnum; import org.nl.wms.basedata_manage.enums.BaseDataEnum;
import org.nl.wms.basedata_manage.service.IBsrealStorattrService; import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService; import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
import org.nl.wms.basedata_manage.service.ISectattrService;
import org.nl.wms.basedata_manage.service.IStructattrService; import org.nl.wms.basedata_manage.service.IStructattrService;
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr; import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
import org.nl.wms.basedata_manage.service.dao.Sectattr;
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper; import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto; import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto;
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO; import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam; import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto; import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
import org.nl.wms.pm_manage.service.IPmFormDataService;
import org.nl.wms.pm_manage.service.dao.PmFormData;
import org.nl.wms.pm_manage.service.dao.mapper.PmFormDataMapper;
import org.nl.wms.sch_manage.enums.TaskStatus; import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService; import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBasePoint; import org.nl.wms.sch_manage.service.dao.SchBasePoint;
@@ -72,7 +77,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
@Resource @Resource
private IStructattrService iStructattrService; private IStructattrService iStructattrService;
@Resource
private ISectattrService iSectattrService;
/** /**
* 载具扩展属性mapper * 载具扩展属性mapper
*/ */
@@ -84,6 +90,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
*/ */
@Resource @Resource
private ISchBaseTaskService iSchBaseTaskService; private ISchBaseTaskService iSchBaseTaskService;
@Resource
private IPmFormDataService iPmFormDataService;
@Resource @Resource
private IBsrealStorattrService iBsrealStorattrService; private IBsrealStorattrService iBsrealStorattrService;
@@ -91,6 +99,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
@Resource @Resource
private IOStorInvDtlMapper ioStorInvDtlMapper; private IOStorInvDtlMapper ioStorInvDtlMapper;
@Resource
private PmFormDataMapper pmFormDataMapper;
@Resource @Resource
private SchBasePointMapper schBasePointMapper; private SchBasePointMapper schBasePointMapper;
@@ -223,6 +233,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ioStorInvDtl.put("iostorinv_id", iostorinv_id); ioStorInvDtl.put("iostorinv_id", iostorinv_id);
ioStorInvDtl.put("seq_no", (i + 1) + ""); ioStorInvDtl.put("seq_no", (i + 1) + "");
ioStorInvDtl.put("material_id", row.get("material_id")); ioStorInvDtl.put("material_id", row.get("material_id"));
ioStorInvDtl.put("material_code", row.get("material_code"));
ioStorInvDtl.put("Pcsn", row.get("pcsn")); ioStorInvDtl.put("Pcsn", row.get("pcsn"));
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("生成")); ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id")); ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id"));
@@ -251,6 +262,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//暂时只软删除出入库单主表 //暂时只软删除出入库单主表
ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class)); ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class));
//先删除该单据下的所有明细
ioStorInvDtlMapper.delete(new LambdaQueryWrapper<>(IOStorInvDtl.class).eq(IOStorInvDtl::getIostorinv_id,id));
ioStorInvDisMapper.delete(new LambdaQueryWrapper<>(IOStorInvDis.class).eq(IOStorInvDis::getIostorinv_id,id));
} }
} }
@@ -351,9 +366,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
String sectCode = whereJson.getString("sect_code");
String iostorinv_id = whereJson.getString("iostorinv_id"); String iostorinv_id = whereJson.getString("iostorinv_id");
Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
if (ObjectUtil.isEmpty(sect)) {
throw new BadRequestException("分配库区不能为空!");
}
//查询主表信息 //查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id); IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) { if (ObjectUtil.isEmpty(ioStorInv)) {
@@ -362,7 +379,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//查询生成和未分配完的明细 //查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject(); JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配")); queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配"));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("")); queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id); queryDtl.put("iostorinv_id", iostorinv_id);
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl); List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
@@ -375,21 +392,16 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
BigDecimal unassign_qty = dtl.getUnassign_qty(); BigDecimal unassign_qty = dtl.getUnassign_qty();
String pcsn = dtl.getPcsn(); String pcsn = dtl.getPcsn();
String material_id = dtl.getMaterial_id(); String material_id = dtl.getMaterial_id();
String material_code = dtl.getMaterial_code();
// 根据物料和批次号查询库存可用 // 根据物料和批次号查询库存可用
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv( List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(
StrategyStructParam.builder() StrategyStructParam.builder()
.qty(unassign_qty) .qty(unassign_qty)
.pcsn(pcsn) .pcsn(pcsn)
.material_code(material_code) .material_id(material_id)
.stor_code(ioStorInv.getStor_code()) .stor_code(ioStorInv.getStor_code())
.sect_code(sectCode) .sect_code(sect.getSect_code())
.build() .build()
); );
List<MdPbStoragevehicleextDto> outAllocationList = mdPbStoragevehicleextMapper.queryOutAllocation(pcsn,material_id);
int seq_no = 1; int seq_no = 1;
BigDecimal allocation_canuse_qty=BigDecimal.ZERO; BigDecimal allocation_canuse_qty=BigDecimal.ZERO;
for (StrategyStructMaterialVO outAllocation : structMaterials) { for (StrategyStructMaterialVO outAllocation : structMaterials) {
@@ -542,7 +554,10 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
String sectCode = whereJson.getString("sect_code"); Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
if (ObjectUtil.isEmpty(sect)) {
throw new BadRequestException("分配库区不能为空!");
}
String iostorinv_id = whereJson.getString("iostorinv_id"); String iostorinv_id = whereJson.getString("iostorinv_id");
//查询主表信息 //查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id); IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
@@ -552,7 +567,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//查询生成和未分配完的明细 //查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject(); JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配")); queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配"));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("")); queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id); queryDtl.put("iostorinv_id", iostorinv_id);
queryDtl.put("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")); queryDtl.put("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"));
@@ -564,15 +579,15 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
IOStorInvDtlDto dtl = dtls.get(i); IOStorInvDtlDto dtl = dtls.get(i);
BigDecimal unassign_qty = dtl.getUnassign_qty(); BigDecimal unassign_qty = dtl.getUnassign_qty();
String pcsn = dtl.getPcsn(); String pcsn = dtl.getPcsn();
String material_code = dtl.getMaterial_code(); String material_id = dtl.getMaterial_id();
//调用分配规则获取分配的库位:如果库存不足则直接报错 //调用分配规则获取分配的库位:如果库存不足则直接报错
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv( List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(
StrategyStructParam.builder() StrategyStructParam.builder()
.qty(unassign_qty) .qty(unassign_qty)
.pcsn(pcsn) .pcsn(pcsn)
.material_code(material_code) .material_id(material_id)
.stor_code(ioStorInv.getStor_code()) .stor_code(ioStorInv.getStor_code())
.sect_code(sectCode) .sect_code(sect.getSect_code())
.build() .build()
); );
int seq_no = 1; int seq_no = 1;
@@ -584,12 +599,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ioStorInvDis.setIostorinv_id(dtl.getIostorinv_id()); ioStorInvDis.setIostorinv_id(dtl.getIostorinv_id());
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id()); ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
ioStorInvDis.setSeq_no((seq_no++)+""); ioStorInvDis.setSeq_no((seq_no++)+"");
ioStorInvDis.setSect_id(outAllocation.getSect_id());
ioStorInvDis.setPcsn(outAllocation.getPcsn());
ioStorInvDis.setMaterial_id(outAllocation.getMaterial_id()); ioStorInvDis.setMaterial_id(outAllocation.getMaterial_id());
ioStorInvDis.setMaterial_code(outAllocation.getMaterial_code()); ioStorInvDis.setMaterial_code(outAllocation.getMaterial_code());
ioStorInvDis.setSect_name(outAllocation.getSect_name()); ioStorInvDis.setSect_id(outAllocation.getSect_id());
ioStorInvDis.setSect_code(outAllocation.getSect_code()); ioStorInvDis.setSect_name(sect.getSect_name());
ioStorInvDis.setSect_code(sect.getSect_code());
ioStorInvDis.setStruct_id(outAllocation.getStruct_id()); ioStorInvDis.setStruct_id(outAllocation.getStruct_id());
ioStorInvDis.setStruct_name(outAllocation.getStruct_name()); ioStorInvDis.setStruct_name(outAllocation.getStruct_name());
ioStorInvDis.setStruct_code(outAllocation.getStruct_code()); ioStorInvDis.setStruct_code(outAllocation.getStruct_code());
@@ -725,7 +739,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
} }
@Override @Override
public List<MdPbStoragevehicleextDto> queryAvailableInv(Map whereJson) { public List<JSONObject> queryAvailableInv(Map whereJson) {
return mdPbStoragevehicleextMapper.queryAvailableInv(whereJson); return mdPbStoragevehicleextMapper.queryAvailableInv(whereJson);
} }
@@ -750,7 +764,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//查询生成和未分配完的明细 //查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject(); JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配")); queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配"));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code("")); queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id); queryDtl.put("iostorinv_id", iostorinv_id);
queryDtl.put("iostorinvdtl_id", row.getString("iostorinvdtl_id")); queryDtl.put("iostorinvdtl_id", row.getString("iostorinvdtl_id"));
@@ -760,12 +774,15 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
} }
for (IOStorInvDtlDto dtl:dtls){ for (IOStorInvDtlDto dtl:dtls){
double unassign_qty = dtl.getUnassign_qty().doubleValue(); BigDecimal unassign_qty = dtl.getUnassign_qty();
if (unassign_qty.equals(BigDecimal.ZERO)){
throw new BadRequestException("已全部分配完未分配数量为0");
}
//分配数量 //分配数量
double allocation_canuse_qty = 0; BigDecimal allocation_canuse_qty = BigDecimal.ZERO;
for (int i = 0; i < rows.size(); i++){ for (int i = 0; i < rows.size(); i++){
JSONObject ivt = rows.getJSONObject(i); JSONObject ivt = rows.getJSONObject(i);
double canuse_qty = ivt.getDoubleValue("canuse_qty"); BigDecimal qty = ivt.getBigDecimal("qty");
//分配明细 //分配明细
IOStorInvDis ioStorInvDis = new IOStorInvDis(); IOStorInvDis ioStorInvDis = new IOStorInvDis();
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId()); ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
@@ -773,7 +790,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id()); ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
ioStorInvDis.setSeq_no((i+1)+""); ioStorInvDis.setSeq_no((i+1)+"");
ioStorInvDis.setSect_id(ivt.getString("sect_id")); ioStorInvDis.setSect_id(ivt.getString("sect_id"));
ioStorInvDis.setPcsn(ivt.getString("pcsn")); ioStorInvDis.setMaterial_code(dtl.getMaterial_code());
ioStorInvDis.setMaterial_id(dtl.getMaterial_id()); ioStorInvDis.setMaterial_id(dtl.getMaterial_id());
ioStorInvDis.setSect_name(ivt.getString("sect_name")); ioStorInvDis.setSect_name(ivt.getString("sect_name"));
ioStorInvDis.setSect_code(ivt.getString("sect_code")); ioStorInvDis.setSect_code(ivt.getString("sect_code"));
@@ -786,26 +803,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name()); ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成")); ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出 unassign_qty = unassign_qty.subtract(qty);
// double canuse_qty = outAllocation.getCanuse_qty().doubleValue(); if (unassign_qty.compareTo(BigDecimal.ZERO) <0){
// if (unassign_qty-canuse_qty>=0){ unassign_qty = BigDecimal.ZERO;
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(canuse_qty));
// }else {
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(unassign_qty));
// }
// unassign_qty = unassign_qty-canuse_qty;
// if (unassign_qty<0){
// unassign_qty=0;
// }
if (unassign_qty <= 0){
throw new BadRequestException("已全部分配完未分配数量为0");
} }
unassign_qty = unassign_qty-canuse_qty; allocation_canuse_qty = allocation_canuse_qty.add(qty);
if (unassign_qty<0){ ioStorInvDis.setPlan_qty(qty);
unassign_qty=0;
}
allocation_canuse_qty = allocation_canuse_qty + canuse_qty;
ioStorInvDis.setPlan_qty(BigDecimal.valueOf(canuse_qty));
//锁定货位 //锁定货位
JSONObject lock_map = new JSONObject(); JSONObject lock_map = new JSONObject();
@@ -834,10 +837,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
} }
//更新详情 //更新详情
dtl.setBill_status(unassign_qty==0 ? IOSEnum.BILL_STATUS.code("分配完"): IOSEnum.BILL_STATUS.code("分配中")); dtl.setBill_status((unassign_qty.compareTo(BigDecimal.ZERO) ==0) ? IOSEnum.BILL_STATUS.code("分配完"): IOSEnum.BILL_STATUS.code("分配中"));
double assign_qty = allocation_canuse_qty + dtl.getAssign_qty().doubleValue(); dtl.setUnassign_qty(unassign_qty);
dtl.setUnassign_qty(BigDecimal.valueOf(unassign_qty)); dtl.setAssign_qty(allocation_canuse_qty.add(dtl.getAssign_qty()));
dtl.setAssign_qty(BigDecimal.valueOf(assign_qty));
ioStorInvDtlMapper.updateById(dtl); ioStorInvDtlMapper.updateById(dtl);
} }
@@ -1163,6 +1165,23 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
// 更新明细表状态 // 更新明细表状态
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成")); ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
ioStorInvDtlMapper.updateById(ioStorInvDtl); ioStorInvDtlMapper.updateById(ioStorInvDtl);
//判断是否有源单据,更新源单据
if(ObjectUtil.isNotEmpty(ioStorInvDtl.getSource_billdtl_id())){
PmFormData form = iPmFormDataService.getById(ioStorInvDtl.getSource_billdtl_id());
form.setStatus(IOSEnum.BILL_STATUS.code("完成"));
form.setIs_finish("1");
form.setAssign_qty(form.getQty());
iPmFormDataService.updateById(form);
//更新被合单单据
if(ObjectUtil.isNotEmpty(form.getMerge_codes())){
String[] codes = form.getMerge_codes().split(",");
pmFormDataMapper.update(null,new LambdaUpdateWrapper<>(PmFormData.class)
.set(PmFormData::getStatus,IOSEnum.BILL_STATUS.code("完成"))
.set(PmFormData::getIs_finish,"1")
.in(PmFormData::getCode,codes)
);
}
}
// 查看明细是否全部完成 // 查看明细是否全部完成
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class) int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id()) .eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())

View File

@@ -29,6 +29,8 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper; import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam; import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto; import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
import org.nl.wms.pm_manage.service.IPmFormDataService;
import org.nl.wms.pm_manage.service.dao.PmFormData;
import org.nl.wms.sch_manage.enums.StatusEnum; import org.nl.wms.sch_manage.enums.StatusEnum;
import org.nl.wms.sch_manage.service.dao.SchBaseTask; import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.sch_manage.service.util.tasks.StInTask; import org.nl.wms.sch_manage.service.util.tasks.StInTask;
@@ -46,6 +48,7 @@ import org.nl.wms.warehouse_manage.service.dao.mapper.IOStorInvMapper;
import org.nl.wms.warehouse_manage.service.dto.GroupPlateDto; import org.nl.wms.warehouse_manage.service.dto.GroupPlateDto;
import org.nl.wms.warehouse_manage.service.dto.IOStorInvDisDto; import org.nl.wms.warehouse_manage.service.dto.IOStorInvDisDto;
import org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto; import org.nl.wms.warehouse_manage.service.dto.IOStorInvDtlDto;
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.Assert;
@@ -89,6 +92,9 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
@Resource @Resource
private MdPbGroupplateServiceImpl mdPbGroupplateService; private MdPbGroupplateServiceImpl mdPbGroupplateService;
@Resource
private IPmFormDataService iPmFormDataService;
@Override @Override
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) { public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
@@ -182,16 +188,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
ioStorInvDtl.put("seq_no",(i + 1)+""); ioStorInvDtl.put("seq_no",(i + 1)+"");
ioStorInvDtl.put("material_id",row.get("material_id")); ioStorInvDtl.put("material_id",row.get("material_id"));
ioStorInvDtl.put("material_code",row.get("material_code")); ioStorInvDtl.put("material_code",row.get("material_code"));
ioStorInvDtl.put("Pcsn",row.get("pcsn"));
ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成")); ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id")); ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name")); ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
ioStorInvDtl.put("source_bill_type",row.get("ext_type")); ioStorInvDtl.put("source_bill_type",row.get("source_bill_type"));
ioStorInvDtl.put("source_bill_code",row.get("ext_code")); ioStorInvDtl.put("source_bill_code",row.get("source_bill_code"));
ioStorInvDtl.put("source_billdtl_id",row.get("source_billdtl_id"));
ioStorInvDtl.put("assign_qty","0"); ioStorInvDtl.put("assign_qty","0");
ioStorInvDtl.put("unassign_qty",row.get("qty")); ioStorInvDtl.put("unassign_qty",row.get("plan_qty"));
ioStorInvDtl.put("plan_qty",row.get("qty")); ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
Double qty = new Double(String.valueOf(row.get("qty"))); Double qty = new Double(String.valueOf(row.get("plan_qty")));
total_qty = total_qty.add(new BigDecimal(qty)); total_qty = total_qty.add(new BigDecimal(qty));
//判断该载具编号是否已经存在库内 //判断该载具编号是否已经存在库内
@@ -208,13 +214,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
dis.put("seq_no", 1); dis.put("seq_no", 1);
dis.put("material_id", row.get("material_id")); dis.put("material_id", row.get("material_id"));
dis.put("material_code", row.get("material_code")); dis.put("material_code", row.get("material_code"));
dis.put("pcsn", row.get("pcsn"));
dis.put("storagevehicle_code", row.get("storagevehicle_code")); dis.put("storagevehicle_code", row.get("storagevehicle_code"));
dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成")); dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成"));
dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code("")); dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code(""));
dis.put("qty_unit_id", row.get("qty_unit_id")); dis.put("qty_unit_id", row.get("qty_unit_id"));
dis.put("qty_unit_name", row.get("qty_unit_name")); dis.put("qty_unit_name", row.get("qty_unit_name"));
dis.put("plan_qty", row.get("qty")); dis.put("plan_qty", row.get("plan_qty"));
ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class)); ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class));
} }
io_mst.put("total_qty", total_qty); io_mst.put("total_qty", total_qty);
@@ -239,6 +244,11 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
//暂时只软删除出入库单主表 //暂时只软删除出入库单主表
ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class)); ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class));
//先删除该单据下的所有明细
ioStorInvDtlMapper.delete(new LambdaQueryWrapper<>(IOStorInvDtl.class).eq(IOStorInvDtl::getIostorinv_id,id));
ioStorInvDisMapper.delete(new LambdaQueryWrapper<>(IOStorInvDis.class).eq(IOStorInvDis::getIostorinv_id,id));
} }
} }
@@ -287,13 +297,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
ioStorInvDtl.put("iostorinv_id",iostorinv_id); ioStorInvDtl.put("iostorinv_id",iostorinv_id);
ioStorInvDtl.put("seq_no",(i + 1)+""); ioStorInvDtl.put("seq_no",(i + 1)+"");
ioStorInvDtl.put("material_id",row.get("material_id")); ioStorInvDtl.put("material_id",row.get("material_id"));
ioStorInvDtl.put("Pcsn",row.get("pcsn")); ioStorInvDtl.put("material_code",row.get("material_code"));
ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成")); ioStorInvDtl.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id")); ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name")); ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
ioStorInvDtl.put("source_bill_type",row.get("source_bill_type"));
ioStorInvDtl.put("source_bill_code",row.get("source_bill_code"));
ioStorInvDtl.put("source_billdtl_id",row.get("source_billdtl_id"));
ioStorInvDtl.put("assign_qty",0); ioStorInvDtl.put("assign_qty",0);
ioStorInvDtl.put("plan_qty",row.get("plan_qty")); ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
ioStorInvDtl.put("unassign_qty",row.get("qty")); ioStorInvDtl.put("unassign_qty",row.get("plan_qty"));
//判断该载具编号是否已经存在库内 //判断该载具编号是否已经存在库内
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code"))); Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
@@ -309,7 +322,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
dis.put("iostorinvdtl_id", ioStorInvDtl.getString("iostorinvdtl_id")); dis.put("iostorinvdtl_id", ioStorInvDtl.getString("iostorinvdtl_id"));
dis.put("seq_no", 1); dis.put("seq_no", 1);
dis.put("material_id", row.get("material_id")); dis.put("material_id", row.get("material_id"));
dis.put("pcsn", row.get("pcsn")); dis.put("material_code", row.get("material_code"));
dis.put("storagevehicle_code", row.get("storagevehicle_code")); dis.put("storagevehicle_code", row.get("storagevehicle_code"));
dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成")); dis.put("work_status", IOSEnum.INBILL_DIS_STATUS.code("未生成"));
dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code("")); dis.put("is_issued", BaseDataEnum.IS_YES_NOT.code(""));
@@ -653,12 +666,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
// 明细 // 明细
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id()); IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
if (ObjectUtil.isEmpty(ioStorInvDtl)){ if (ObjectUtil.isEmpty(ioStorInvDtl)){
throw new BadRequestException("未找到明细"); throw new BadRequestException("未找到入库单明细记录");
} }
// 明细 // 明细
IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id()); IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id());
if (ObjectUtil.isEmpty(ioStorInv)){ if (ObjectUtil.isEmpty(ioStorInv)){
throw new BadRequestException("未找到明细"); throw new BadRequestException("未找到入库单");
} }
// 完成当前分配明细 // 完成当前分配明细
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class) ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class)
@@ -693,6 +706,14 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty()); ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty());
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成")); ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
ioStorInvDtlMapper.updateById(ioStorInvDtl); ioStorInvDtlMapper.updateById(ioStorInvDtl);
//判断是否有源单据,更新源单据
if(ObjectUtil.isNotEmpty(ioStorInvDtl.getSource_billdtl_id())){
PmFormData form = iPmFormDataService.getById(ioStorInvDtl.getSource_billdtl_id());
form.setStatus(IOSEnum.BILL_STATUS.code("完成"));
form.setIs_finish("1");
form.setAssign_qty(form.getQty());
iPmFormDataService.updateById(form);
}
// 查看明细是否全部完成 // 查看明细是否全部完成
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class) int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id()) .eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())

View File

@@ -99,9 +99,6 @@ public class UpdateIvtUtils {
if (ObjectUtil.isEmpty(where.getString("material_id"))) { if (ObjectUtil.isEmpty(where.getString("material_id"))) {
throw new BadRequestException("物料标识不能为空!"); throw new BadRequestException("物料标识不能为空!");
} }
if (ObjectUtil.isEmpty(where.getString("pcsn"))) {
throw new BadRequestException("批次不能为空!");
}
if (ObjectUtil.isEmpty(where.getString("qty_unit_id"))) { if (ObjectUtil.isEmpty(where.getString("qty_unit_id"))) {
throw new BadRequestException("计量单位标识不能为空!"); throw new BadRequestException("计量单位标识不能为空!");
} }
@@ -164,7 +161,7 @@ public class UpdateIvtUtils {
} }
// 加冻结数 // 加冻结数
double frozen_qty = NumberUtil.add(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue(); double frozen_qty = NumberUtil.add(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
extDao.setQty(BigDecimal.valueOf(canuse_qty)); //extDao.setQty(BigDecimal.valueOf(canuse_qty));
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty)); extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
extDao.setUpdate_id(SecurityUtils.getCurrentUserId()); extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
extDao.setUpdate_name(SecurityUtils.getCurrentNickName()); extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
@@ -219,7 +216,7 @@ public class UpdateIvtUtils {
new QueryWrapper<GroupPlate>().lambda() new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code")) .eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id")) .eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")) .eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
); );
if (ObjectUtil.isEmpty(extDao)) { if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!"); throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
@@ -232,7 +229,6 @@ public class UpdateIvtUtils {
// 加可用 // 加可用
// double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue(); // double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
extDao.setFrozen_qty(BigDecimal.ZERO); extDao.setFrozen_qty(BigDecimal.ZERO);
extDao.setQty(BigDecimal.valueOf(qty));
extDao.setUpdate_id(SecurityUtils.getCurrentUserId()); extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
extDao.setUpdate_name(SecurityUtils.getCurrentNickName()); extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
extDao.setUpdate_time(DateUtil.now()); extDao.setUpdate_time(DateUtil.now());

View File

@@ -69,16 +69,6 @@
class="filter-item" class="filter-item"
/> />
</el-form-item> </el-form-item>
<el-form-item label="批次">
<el-input
v-model="query.pcsn"
clearable
size="mini"
placeholder="请输入批次"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<el-form-item label="单据日期" prop="analyseData"> <el-form-item label="单据日期" prop="analyseData">
<el-date-picker <el-date-picker
v-model="query.datepick" v-model="query.datepick"
@@ -89,50 +79,11 @@
end-placeholder="结束日期" end-placeholder="结束日期"
/> />
</el-form-item> </el-form-item>
<!-- <template v-for="(col,index) in cols" v-if="hideShowDialog">-->
<!-- <el-form-item label="col.lable">-->
<!-- <label slot="label">{{ col.lable }}:</label>-->
<!-- <el-input v-model="query.form_query[col.value]" :value="col.value" clearable style="width: 210px" />-->
<!-- </el-form-item>-->
<!-- </template>-->
<rrOperation :crud="crud" /> <rrOperation :crud="crud" />
</el-form> </el-form>
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
size="mini"
type="success"
icon="el-icon-s-operation"
>
全部展开
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="warning"-->
<!-- icon="el-icon-upload2"-->
<!-- size="mini"-->
<!-- >-->
<!-- 导入-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- icon="el-icon-view"-->
<!-- size="mini"-->
<!-- @click="hideShow"-->
<!-- >-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"
icon="el-icon-view"
size="mini"
@click="hideShow"
/>
</crudOperation> </crudOperation>
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="820px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="820px">
@@ -241,34 +192,10 @@
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" /> <el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
<el-table-column prop="unit_name" label="单位" show-overflow-tooltip width="120" /> <el-table-column prop="unit_name" label="单位" show-overflow-tooltip width="120" />
<el-table-column prop="source_form_date" label="源单日期" show-overflow-tooltip width="120" /> <el-table-column prop="source_form_date" label="源单日期" show-overflow-tooltip width="120" />
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"> <el-table-column prop="status" label="单据状态" show-overflow-tooltip :formatter="status_Format" width="120" />
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip width="120" /> <el-table-column prop="remark" label="备注" show-overflow-tooltip width="120" />
<el-table-column prop="create_name" label="创建人" /> <el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> <el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
<el-table-column
v-permission="['admin','Classstandard:edit','Classstandard:del']"
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:permission="permission"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除此操作不能撤销"
/>
</template>
</el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
@@ -281,14 +208,11 @@
import crudFormData from './formData' import crudFormData from './formData'
import CRUD, { crud, form, header, presenter } from '@crud/crud' import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation.vue' import crudOperation from '@crud/CRUD.operation.vue'
import udOperation from '@crud/UD.operation.vue'
import rrOperation from '@crud/RR.operation.vue' import rrOperation from '@crud/RR.operation.vue'
import pagination from '@crud/Pagination.vue' import pagination from '@crud/Pagination.vue'
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
import ViewDialog from './ViewDialog.vue' import ViewDialog from './ViewDialog.vue'
import MaterDialog from '@/views/wms/pub/MaterDialog' import MaterDialog from '@/views/wms/pub/MaterDialog'
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr' import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
// import UploadDialog from './UploadDialog'
const defaultForm = { const defaultForm = {
id: null, id: null,
code: null, code: null,
@@ -314,7 +238,7 @@ const defaultForm = {
export default { export default {
name: 'FormData', name: 'FormData',
dicts: ['base_data', 'ST_INV_IN_TYPE', 'INANDOUT_BILL_TYPE', 'io_bill_status'], dicts: ['base_data', 'ST_INV_IN_TYPE', 'INANDOUT_BILL_TYPE', 'io_bill_status'],
components: { pagination, crudOperation, rrOperation, udOperation, ViewDialog, MaterDialog }, components: { pagination, crudOperation, rrOperation, ViewDialog, MaterDialog },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
@@ -324,7 +248,7 @@ export default {
sort: 'id,desc', sort: 'id,desc',
crudMethod: { ...crudFormData }, crudMethod: { ...crudFormData },
optShow: { optShow: {
add: true, add: false,
reset: true reset: true
}, },
query: { query: {
@@ -390,17 +314,6 @@ export default {
this.query.start_time = '' this.query.start_time = ''
this.query.end_time = '' this.query.end_time = ''
} }
// if (this.fromTypes.length > 0) {
// // formstruc.getHeader(this.query.form_type).then(res => {
// // this.cols = res
// // res.forEach(a => {
// // this.form.form_data[a.value, '']
// // this.$set(this.query, 'form_query', {})
// // })
// // })
// // return true
// }
// return false
}, },
bill_typeFormat(row, column) { bill_typeFormat(row, column) {
return this.dict.label.INANDOUT_BILL_TYPE[row.form_type] return this.dict.label.INANDOUT_BILL_TYPE[row.form_type]
@@ -416,21 +329,9 @@ export default {
this.form.material_spec = row.material_spec this.form.material_spec = row.material_spec
this.form.unit_id = row.base_unit_id this.form.unit_id = row.base_unit_id
}, },
// getFromTypes() { status_Format(row, column) {
// crudFormData.getParentFormTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树 return this.dict.label.io_bill_status[row.status]
// this.fromTypes = res },
// if (this.fromTypes.length > 0) {
// this.$set(this.query, 'form_type', this.fromTypes[0].value)
// this.crud.toQuery()
// }
// })
// },
// hideShow() {
// if (this.hideShowDialog) {
// // this.$set(this.query, 'form_query', {})
// }
// this.hideShowDialog = !this.hideShowDialog
// },
toView(row) { toView(row) {
if (row !== null) { if (row !== null) {
this.$refs.viewDialog.setForm(row) this.$refs.viewDialog.setForm(row)

View File

@@ -171,14 +171,15 @@ export default {
reset: true reset: true
}, },
query: { query: {
form_type: '1001' form_type: '1001',
is_finish: '0'
} }
}) })
}, },
data() { data() {
return { return {
permission: {}, permission: {},
rows : [], rows: [],
rules: { rules: {
} }
} }

View File

@@ -130,15 +130,15 @@
border border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"
> >
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" min-width="55" align="center" />
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具号" /> <el-table-column show-overflow-tooltip min-width="150" prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" /> <el-table-column show-overflow-tooltip min-width="150" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" /> <el-table-column show-overflow-tooltip min-width="150" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" /> <el-table-column show-overflow-tooltip min-width="170" prop="plan_qty" label="数量" />
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" /> <el-table-column show-overflow-tooltip min-width="170" prop="qty_unit_name" label="计量单位名称" />
<el-table-column show-overflow-tooltip width="150" prop="ext_code" label="源单号" /> <el-table-column show-overflow-tooltip min-width="150" prop="source_bill_code" label="源单号" />
<el-table-column show-overflow-tooltip width="150" prop="ext_type" label="源单类型" /> <el-table-column show-overflow-tooltip min-width="150" prop="source_bill_type" label="源单类型" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right"> <el-table-column v-if="crud.status.cu > 0" align="center" label="操作" min-width="120" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button <el-button
type="danger" type="danger"
@@ -157,7 +157,6 @@
</template> </template>
<script> <script>
import crudOperation from '@crud/CRUD.operation'
import CRUD, { crud, form } from '@crud/crud' import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/st/inbill/AddDtl' import AddDtl from '@/views/wms/st/inbill/AddDtl'
import crudRawAssist from '@/views/wms/st/inbill/rawassist' import crudRawAssist from '@/views/wms/st/inbill/rawassist'
@@ -234,12 +233,8 @@ export default {
[CRUD.HOOK.afterToEdit]() { [CRUD.HOOK.afterToEdit]() {
// 获取入库单明细 // 获取入库单明细
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => { crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
debugger
this.form.tableData = res this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
}) })
}, },
[CRUD.HOOK.afterToAdd]() { [CRUD.HOOK.afterToAdd]() {
@@ -251,11 +246,6 @@ export default {
this.mater_btn = true this.mater_btn = true
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => { crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
}) })
}, },

View File

@@ -46,10 +46,10 @@
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具编码" /> <el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" /> <el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" /> <el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" /> <el-table-column show-overflow-tooltip width="170" prop="plan_qty" label="数量" />
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" /> <el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
<el-table-column prop="ext_code" label="来源单号" :min-width="flexWidth('ext_code',crud.data,'来源单号')" /> <el-table-column prop="source_bill_code" label="来源单号" :min-width="flexWidth('source_bill_code',crud.data,'来源单号')" />
<el-table-column prop="ext_type" label="来源单据类型" :min-width="flexWidth('ext_type',crud.data,'来源单据类型')" /> <el-table-column prop="source_bill_type" label="来源单据类型" :min-width="flexWidth('source_bill_type',crud.data,'来源单据类型')" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />

View File

@@ -164,7 +164,7 @@
show-overflow-tooltip show-overflow-tooltip
prop="plan_qty" prop="plan_qty"
:formatter="crud.formatNum3" :formatter="crud.formatNum3"
label="量" label="量"
align="center" align="center"
/> />
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" /> <el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />

View File

@@ -141,13 +141,13 @@
border border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"
> >
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" min-width="50" align="center" />
<el-table-column prop="material_code" label="物料编码" width="190" align="center" /> <el-table-column prop="material_code" label="物料编码" min-width="190" align="center" />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip /> <el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
<el-table-column prop="plan_qty" label="数量" width="150" align="center" /> <el-table-column prop="plan_qty" label="数量" min-width="150" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center" /> <el-table-column prop="qty_unit_name" label="单位" min-width="150" align="center" />
<el-table-column prop="source_bill_code" label="用料清单号" :min-width="flexWidth('source_bill_code',crud.data,'用料清单号')" /> <el-table-column prop="source_bill_code" label="用料清单号" :min-width="flexWidth('source_bill_code',crud.data,'用料清单号')" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right"> <el-table-column v-if="crud.status.cu > 0" align="center" label="操作" min-width="120" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" /> <el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
</template> </template>

View File

@@ -23,7 +23,7 @@
<span class="role-span">出库明细</span> <span class="role-span">出库明细</span>
<div class="crud-opts-form"> <div class="crud-opts-form">
<el-form ref="form" :inline="true" :model="form" size="mini"> <el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="库区" prop="gender2"> <el-form-item label="分配库区" prop="gender2">
<el-cascader <el-cascader
placeholder="请选择" placeholder="请选择"
:options="sects" :options="sects"
@@ -220,11 +220,6 @@
<el-table-column show-overflow-tooltip prop="insert_time" width="150px" label="入库时间" align="center" /> <el-table-column show-overflow-tooltip prop="insert_time" width="150px" label="入库时间" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" width="150px" label="任务号" align="center" /> <el-table-column show-overflow-tooltip prop="task_code" width="150px" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" /> <el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" />
<el-table-column align="center" label="操作" width="120" fixed="right">
<template scope="scope">
<el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" />
</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl2" /> <StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl2" />
@@ -365,11 +360,6 @@ export default {
return true return true
} }
}, },
deleteRow(row) {
checkoutbill.oneCancel(row).then(res => {
this.queryTableDtl()
})
},
handleDtlCurrentChange(current) { handleDtlCurrentChange(current) {
if (current !== null) { if (current !== null) {
this.currentRow = current this.currentRow = current

View File

@@ -80,7 +80,7 @@
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" /> <el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" /> <el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" /> <el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" /> <el-table-column show-overflow-tooltip prop="qty" label="可出重量" align="center" />
<el-table-column align="center" label="操作" width="160" fixed="right"> <el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> <el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
@@ -187,15 +187,15 @@ export default {
} }
row.edit = !row.edit row.edit = !row.edit
if (row.edit) { if (row.edit) {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty) this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.qty)
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty) this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.qty)
} else { } else {
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty) this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.qty)
// 如果待分配重量等于0则 明细重量 - 已分配重量 // 如果待分配重量等于0则 明细重量 - 已分配重量
if (parseInt(this.queryrow.unassign_qty) === 0) { if (parseInt(this.queryrow.unassign_qty) === 0) {
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty) this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
} else { } else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty) this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.qty)
} }
if (this.queryrow.unassign_qty > this.goal_unassign_qty) { if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty)) this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))