add:1.外包材收货2.外包材转运
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/*
|
||||
* @author Liuxy
|
||||
* @Date 2025/12/25
|
||||
*/
|
||||
public class JSONObjectOf implements Serializable {
|
||||
|
||||
public static <K> JSONObject of(K... key) {
|
||||
JSONObject map = new JSONObject();
|
||||
for (int i = 0; i < (key.length & ~1); i = i + 2) {
|
||||
map.put((String) key[i], key[i + 1]);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -87,4 +87,10 @@ public class GroupController {
|
||||
iMdPbGroupplateService.printDelete(dto);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryMaterList")
|
||||
@Log("查询物料集合")
|
||||
public ResponseEntity<Object> queryMaterList() {
|
||||
return new ResponseEntity<>(iMdPbGroupplateService.queryMaterList(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -27,4 +28,14 @@ public interface MdMeMaterialbaseMapper extends BaseMapper<MdMeMaterialbase> {
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 手持公共接口服务类 -> 查询物料信息
|
||||
* @param whereJson {
|
||||
* class_code: 物料分类编码
|
||||
* material_code: 物料编码
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryPdaMaterInfo(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -20,4 +20,32 @@
|
||||
ORDER BY mater.update_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryPdaMaterInfo" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
mater.*,
|
||||
class.class_name,
|
||||
class.class_code,
|
||||
unit.unit_code,
|
||||
unit.unit_name
|
||||
FROM
|
||||
md_me_materialbase mater
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mater.material_type_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mater.base_unit_id
|
||||
<where>
|
||||
mater.is_used = '1'
|
||||
AND mater.is_delete = '0'
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.material_code} or
|
||||
mater.material_name LIKE #{param.material_code})
|
||||
</if>
|
||||
|
||||
<if test="param.class_code != null and param.class_code != ''">
|
||||
AND
|
||||
class.class_code = #{param.class_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mater.update_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.nl.wms.pda.general_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaPublicInterfaceService;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持公共接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pda/publicInterface")
|
||||
@Slf4j
|
||||
public class PdaPublicInterfaceController {
|
||||
|
||||
@Autowired
|
||||
private PdaPublicInterfaceService pdaUpdatePointService;
|
||||
|
||||
@PostMapping("/queryMaterInfo")
|
||||
@Log("查询物料信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryMaterInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.queryMaterInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryRegionDropdown")
|
||||
@Log("查询区域下拉框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryRegionDropdown(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.queryRegionDropdown(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.nl.wms.pda.general_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaUpdatePointService;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板点位更新
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pdaUpdatePoint")
|
||||
@Slf4j
|
||||
public class PdaUpdatePointController {
|
||||
|
||||
@Autowired
|
||||
private PdaUpdatePointService pdaUpdatePointService;
|
||||
|
||||
@PostMapping("/queryPointInfo")
|
||||
@Log("查询点位物料信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryPointInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.queryPointInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/bindVehicle")
|
||||
@Log("绑定")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> bindVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.bindVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearVehicle")
|
||||
@Log("清载具")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.clearVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearMaterial")
|
||||
@Log("清物料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaUpdatePointService.clearMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.nl.wms.pda.general_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持公共接口 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
public interface PdaPublicInterfaceService {
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
* @param whereJson {
|
||||
* class_code: 物料分类编码
|
||||
* material_code: 物料编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryMaterInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询区域下拉框
|
||||
* @param whereJson {
|
||||
* region_code: 区域编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryRegionDropdown(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package org.nl.wms.pda.general_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板点位更新 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
public interface PdaUpdatePointService {
|
||||
|
||||
/**
|
||||
* 查询点位物料信息
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryPointInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse bindVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 清载具
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 清物料
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* storagevehicle_code: 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse clearMaterial(JSONObject whereJson);
|
||||
}
|
||||
@@ -3,124 +3,51 @@ package org.nl.wms.pda.general_management.service.impl;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pda.general_management.service.PdaUpdatePointService;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdMeMaterialbaseMapper;
|
||||
import org.nl.wms.pda.general_management.service.PdaPublicInterfaceService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
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.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平板点位更新 实现类
|
||||
* 手持公共接口 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-09-03
|
||||
*/
|
||||
@Service
|
||||
public class PdaUpdatePointServiceImpl implements PdaUpdatePointService {
|
||||
public class PdaUpdatePointServiceImpl implements PdaPublicInterfaceService {
|
||||
|
||||
/**
|
||||
* 组盘mapper
|
||||
* 基础物料mapper
|
||||
*/
|
||||
@Autowired
|
||||
private MdPbGroupplateMapper mdPbGroupplateMapper;
|
||||
@Resource
|
||||
private MdMeMaterialbaseMapper mdMeMaterialbaseMapper;
|
||||
|
||||
/**
|
||||
* 点位mapper
|
||||
* 区域服务类
|
||||
*/
|
||||
@Autowired
|
||||
private SchBasePointMapper schBasePointMapper;
|
||||
@Resource
|
||||
private ISchBaseRegionService iSchBaseRegionService;
|
||||
|
||||
@Override
|
||||
public PdaResponse queryPointInfo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdPbGroupplateMapper.pdaGetPointDtl(whereJson));
|
||||
public PdaResponse queryMaterInfo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdMeMaterialbaseMapper.queryPdaMaterInfo(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse bindVehicle(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
throw new BadRequestException("载具不能为空!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
// 判断当前点位是否已经有载具
|
||||
if (ObjectUtil.isNotEmpty(pointDao.getVehicle_code())) {
|
||||
throw new BadRequestException("当前点位已存在载具!【"+pointDao.getVehicle_code()+"】");
|
||||
}
|
||||
|
||||
pointDao.setVehicle_code(whereJson.getString("storagevehicle_code"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearVehicle(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code")) && ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code")) ) {
|
||||
throw new BadRequestException("请先扫码!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao ;
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
pointDao = schBasePointMapper.selectOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
);
|
||||
} else if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
} else {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
}
|
||||
|
||||
pointDao.setVehicle_code("");
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("空位"));
|
||||
pointDao.setIng_task_code("");
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse clearMaterial(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code")) && ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code")) ) {
|
||||
throw new BadRequestException("请先扫码!");
|
||||
}
|
||||
|
||||
SchBasePoint pointDao ;
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
|
||||
pointDao = schBasePointMapper.selectOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
);
|
||||
} else if (ObjectUtil.isEmpty(whereJson.getString("storagevehicle_code"))) {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
} else {
|
||||
pointDao = schBasePointMapper.selectById(whereJson.getString("point_code"));
|
||||
}
|
||||
|
||||
// 更新点位状态为空位
|
||||
pointDao.setPoint_status(IOSEnum.POINT_STATUS.code("空载具"));
|
||||
schBasePointMapper.updateById(pointDao);
|
||||
|
||||
mdPbGroupplateMapper.delete(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getVehicle_code, pointDao.getVehicle_code())
|
||||
.in(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"),
|
||||
IOSEnum.GROUP_PLATE_STATUS.code("出库")
|
||||
)
|
||||
public PdaResponse queryRegionDropdown(JSONObject whereJson) {
|
||||
String region_code = whereJson.getString("region_code");
|
||||
List<SchBaseRegion> regionList = iSchBaseRegionService.list(
|
||||
new QueryWrapper<SchBaseRegion>().lambda()
|
||||
.eq(ObjectUtil.isNotEmpty(region_code), SchBaseRegion::getRegion_code, region_code)
|
||||
);
|
||||
return PdaResponse.requestOk();
|
||||
return PdaResponse.requestParamOk(regionList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.pda.packaging_management.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pda.general_management.service.PdaPublicInterfaceService;
|
||||
import org.nl.wms.pda.packaging_management.service.PdaPackagingService;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 外包材管理控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-12-25
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pda/packaging")
|
||||
@Slf4j
|
||||
public class PdaPackagingController {
|
||||
|
||||
@Autowired
|
||||
private PdaPackagingService pdaPackagingService;
|
||||
|
||||
@PostMapping("/queryPointRegion")
|
||||
@Log("外包材收货-根据点位查询下拉框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryPointRegion(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPackagingService.queryPointRegion(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmStock")
|
||||
@Log("外包材收货-确认收货")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmStock(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPackagingService.confirmStock(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTransferDtl")
|
||||
@Log("外包材转运-查询明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryTransferDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPackagingService.queryTransferDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmTransfer")
|
||||
@Log("外包材转运-确认转运")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmTransfer(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPackagingService.confirmTransfer(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.nl.wms.pda.packaging_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 外包材管理接口 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-12-225
|
||||
*/
|
||||
public interface PdaPackagingService {
|
||||
|
||||
/**
|
||||
* 外包材收货-根据点位查询下拉框
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryPointRegion(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 外包材收货-确认收货
|
||||
* @param whereJson {
|
||||
* point_code: 点位编码
|
||||
* region_code: 区域编码
|
||||
* material_id: 物料标识
|
||||
* material_code: 物料编码
|
||||
* material_name: 物料名称
|
||||
* pcsn: 批次
|
||||
* qty: 数量
|
||||
* qty_unit_name: 计量单位名称
|
||||
* remark: 备注
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse confirmStock(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 外包材转运-查询明细
|
||||
* @param whereJson {
|
||||
* out_point: 移出点位
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryTransferDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 外包材转运-确认转运
|
||||
* @param whereJson {
|
||||
* out_point: 移出点位
|
||||
* in_point: 移入点位
|
||||
* rows: 勾选的列表明细
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse confirmTransfer(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package org.nl.wms.pda.packaging_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.JSONObjectOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pda.general_management.service.PdaPublicInterfaceService;
|
||||
import org.nl.wms.pda.packaging_management.service.PdaPackagingService;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.nl.wms.pdm_management.service.IMdPdmPackagingService;
|
||||
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||
import org.nl.wms.pdm_management.service.dao.mapper.MdPdmPackagingMapper;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 外包材管理接口 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-12-25
|
||||
*/
|
||||
@Service
|
||||
public class PdaPackagingServiceImpl implements PdaPackagingService {
|
||||
|
||||
/**
|
||||
* 点位服务类
|
||||
*/
|
||||
@Resource
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* PDA公共接口服务类
|
||||
*/
|
||||
@Resource
|
||||
private PdaPublicInterfaceService pdaPublicInterfaceService;
|
||||
|
||||
/**
|
||||
* 外包材服务类
|
||||
*/
|
||||
@Resource
|
||||
private IMdPdmPackagingService iMdPdmPackagingService;
|
||||
|
||||
/**
|
||||
* 外包材mapper
|
||||
*/
|
||||
@Resource
|
||||
private MdPdmPackagingMapper mdPdmPackagingMapper;
|
||||
|
||||
@Override
|
||||
public PdaResponse queryPointRegion(JSONObject whereJson) {
|
||||
SchBasePoint pointDao = iSchBasePointService.getById(whereJson.getString("point_code"));
|
||||
if (ObjectUtil.isEmpty(pointDao)) {
|
||||
throw new BadRequestException("当前点位不存在!【"+whereJson.getString("point_code")+"】");
|
||||
}
|
||||
return pdaPublicInterfaceService.queryRegionDropdown(JSONObjectOf.of("region", pointDao.getRegion_code()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmStock(JSONObject whereJson) {
|
||||
// 类型转换
|
||||
MdPdmPackaging dto = JSONObject.parseObject(JSONObject.toJSONString(whereJson), MdPdmPackaging.class);
|
||||
// 调用新增
|
||||
iMdPdmPackagingService.create(dto);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryTransferDtl(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(mdPdmPackagingMapper.queryTransferDtl(whereJson));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmTransfer(JSONObject whereJson) {
|
||||
// 判断移出点位和移入点位不能相同
|
||||
String out_point = whereJson.getString("out_point");
|
||||
String in_point = whereJson.getString("in_point");
|
||||
if (out_point.equals(in_point)) {
|
||||
throw new BadRequestException("移出点位和移入点位不能相同!");
|
||||
}
|
||||
List<JSONObject> rows = whereJson.getJSONArray("rows").toJavaList(JSONObject.class);
|
||||
// 查询原移出点位库存
|
||||
List<MdPdmPackaging> oldPackDaoList = iMdPdmPackagingService.list(
|
||||
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||
.in(MdPdmPackaging::getPacking_id, rows.stream()
|
||||
.map(row -> row.getString("packing_id"))
|
||||
.collect(Collectors.toList()))
|
||||
);
|
||||
|
||||
List<MdPdmPackaging> insertPackList = new ArrayList<>();
|
||||
for (JSONObject json : rows) {
|
||||
// 减扣数量
|
||||
MdPdmPackaging oldPackDao = oldPackDaoList.stream()
|
||||
.filter(row -> row.getPacking_id().equals(json.getString("packing_id")))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
double new_qty = NumberUtil.sub(oldPackDao.getQty(), json.getBigDecimal("qty")).doubleValue();
|
||||
if (new_qty == 0) {
|
||||
// 删除当前记录
|
||||
iMdPdmPackagingService.removeById(oldPackDao);
|
||||
oldPackDao.setPoint_code(in_point);
|
||||
oldPackDao.setPacking_id(null);
|
||||
insertPackList.add(oldPackDao);
|
||||
} else {
|
||||
// 更新移出点位重量
|
||||
oldPackDao.setQty(BigDecimal.valueOf(new_qty));
|
||||
oldPackDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
oldPackDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
oldPackDao.setCreate_time(DateUtil.now());
|
||||
iMdPdmPackagingService.updateById(oldPackDao);
|
||||
|
||||
// 插入移入点位
|
||||
oldPackDao.setQty(json.getBigDecimal("qty"));
|
||||
oldPackDao.setPoint_code(in_point);
|
||||
oldPackDao.setPacking_id(null);
|
||||
insertPackList.add(oldPackDao);
|
||||
}
|
||||
}
|
||||
insertPackList.forEach(row -> {
|
||||
iMdPdmPackagingService.create(row);
|
||||
});
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
}
|
||||
@@ -39,14 +39,12 @@ public class PackagingController {
|
||||
@GetMapping
|
||||
@Log("外包材收货分页查询")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
whereJson.put("is_transfer", IOSConstant.ZERO);
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPdmPackagingService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryTransfer")
|
||||
@Log("外包材转运分页查询")
|
||||
public ResponseEntity<Object> queryTransfer(@RequestParam Map whereJson, PageQuery page) {
|
||||
whereJson.put("is_transfer", IOSConstant.ONE);
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPdmPackagingService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,4 @@ public interface IMdPdmPackagingService extends IService<MdPdmPackaging> {
|
||||
* @param ids 标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 确认转运
|
||||
*
|
||||
* @param dto 外包材收货记录实体类
|
||||
*/
|
||||
void confirmTransfer(MdPdmPackaging dto);
|
||||
}
|
||||
|
||||
@@ -60,15 +60,10 @@ public class MdPdmPackaging implements Serializable {
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 转运点位
|
||||
* 当前点位
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 是否转运
|
||||
*/
|
||||
private String is_transfer;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -26,4 +27,14 @@ public interface MdPdmPackagingMapper extends BaseMapper<MdPdmPackaging> {
|
||||
* @return IPage<StIvtMoveinv>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 手持
|
||||
* 外包材转运-查询明细
|
||||
* @param whereJson {
|
||||
* out_point: 移出点位
|
||||
* }
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryTransferDtl(@Param("param") JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
pack.create_name LIKE #{param.create_name}
|
||||
</if>
|
||||
|
||||
<if test="param.is_transfer != null and param.is_transfer != ''">
|
||||
AND
|
||||
pack.is_transfer = #{param.is_transfer}
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
pack.pcsn LIKE #{param.pcsn}
|
||||
@@ -37,4 +32,26 @@
|
||||
</where>
|
||||
ORDER BY pack.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryTransferDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
pack.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_model,
|
||||
'KG' AS unit_name
|
||||
FROM
|
||||
md_pdm_packaging pack
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = pack.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
|
||||
<if test="param.out_point != null and param.out_point != ''">
|
||||
AND
|
||||
pack.point_code = #{param.out_point}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pack.create_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -9,16 +9,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pdm_management.service.IMdPdmPackagingService;
|
||||
import org.nl.wms.pdm_management.service.dao.MdPdmPackaging;
|
||||
import org.nl.wms.pdm_management.service.dao.mapper.MdPdmPackagingMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -33,8 +37,11 @@ import java.util.Set;
|
||||
@Service
|
||||
public class MdPdmPackagingServiceImpl extends ServiceImpl<MdPdmPackagingMapper, MdPdmPackaging> implements IMdPdmPackagingService {
|
||||
|
||||
/**
|
||||
* 点位服务类
|
||||
*/
|
||||
@Resource
|
||||
private IMdPdmPackagingService iMdPdmPackagingService;
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -45,36 +52,82 @@ public class MdPdmPackagingServiceImpl extends ServiceImpl<MdPdmPackagingMapper,
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(MdPdmPackaging dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getPoint_code())) {
|
||||
// 外包材转运操作
|
||||
iMdPdmPackagingService.confirmTransfer(dto);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* 判断点位是哪个区的
|
||||
* 1.临时储存区:唯一点位,物料、批号无须判断,每次均增加收货记录
|
||||
* 2.AGV对接区:物料必须一样、批号必须不同,若批号相同则提示是否更新收货
|
||||
*/
|
||||
SchBasePoint pointDao = iSchBasePointService.getById(dto.getPoint_code());
|
||||
if (pointDao.getRegion_code().equals(IOSEnum.REGION_CODE.code("临时储存区"))) {
|
||||
// 临时储存区:查询当前点位是否有相同物料、批次的库存信息
|
||||
MdPdmPackaging packDao = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||
.eq(MdPdmPackaging::getMaterial_id, dto.getMaterial_id())
|
||||
.eq(MdPdmPackaging::getPcsn, dto.getPcsn())
|
||||
.eq(MdPdmPackaging::getPoint_code, dto.getPoint_code())
|
||||
);
|
||||
if (ObjectUtil.isEmpty(packDao)) {
|
||||
// 插入
|
||||
dto.setPacking_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
} else {
|
||||
// 更新数量
|
||||
packDao.setQty(NumberUtil.add(packDao.getQty(), dto.getQty()));
|
||||
packDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
packDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
packDao.setCreate_time(DateUtil.now());
|
||||
this.updateById(packDao);
|
||||
}
|
||||
|
||||
// 查询此物料此批次是否有收过货的
|
||||
MdPdmPackaging packDao = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||
.eq(MdPdmPackaging::getMaterial_id, dto.getMaterial_id())
|
||||
.eq(MdPdmPackaging::getPcsn, dto.getPcsn())
|
||||
.eq(MdPdmPackaging::getIs_transfer, IOSConstant.ZERO)
|
||||
);
|
||||
} else if (pointDao.getRegion_code().equals(IOSEnum.REGION_CODE.code("AGV对接区"))) {
|
||||
// 查询此点位上的库存信息
|
||||
List<MdPdmPackaging> packDaoList = this.baseMapper.selectList(
|
||||
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||
.eq(MdPdmPackaging::getPoint_code, dto.getPoint_code())
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(packDao)) {
|
||||
// 数量叠加
|
||||
packDao.setQty(NumberUtil.add(packDao.getQty(), dto.getQty()));
|
||||
packDao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
packDao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
packDao.setCreate_time(DateUtil.now());
|
||||
this.updateById(packDao);
|
||||
if (ObjectUtil.isNotEmpty(packDaoList)) {
|
||||
// 判断是否相同物料
|
||||
boolean is_like = packDaoList.stream()
|
||||
.allMatch(row -> row.getMaterial_id().equals(dto.getMaterial_id()));
|
||||
if (!is_like) {
|
||||
throw new BadRequestException("当前物料与点位物料不相同,请更换其他点位!");
|
||||
}
|
||||
|
||||
// 判断是否有相同批次
|
||||
MdPdmPackaging packLikePcsn = packDaoList.stream()
|
||||
.filter(row -> row.getPcsn().equals(dto.getPcsn()))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(packLikePcsn)) {
|
||||
// 更新当前库存信息重量
|
||||
packLikePcsn.setQty(dto.getQty());
|
||||
packLikePcsn.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
packLikePcsn.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
packLikePcsn.setCreate_time(DateUtil.now());
|
||||
this.updateById(packLikePcsn);
|
||||
} else {
|
||||
// 插入
|
||||
dto.setPacking_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
} else {
|
||||
// 插入
|
||||
dto.setPacking_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
} else {
|
||||
// 新增
|
||||
dto.setPacking_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
throw new BadRequestException("当前点位区域类型错误,请检查!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,21 +141,4 @@ public class MdPdmPackagingServiceImpl extends ServiceImpl<MdPdmPackagingMapper,
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirmTransfer(MdPdmPackaging dto) {
|
||||
MdPdmPackaging mdPdmPackaging = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPdmPackaging>().lambda()
|
||||
.eq(MdPdmPackaging::getMaterial_id, dto.getMaterial_id())
|
||||
.eq(MdPdmPackaging::getPcsn, dto.getPcsn())
|
||||
);
|
||||
|
||||
mdPdmPackaging.setIs_transfer(IOSConstant.ONE);
|
||||
mdPdmPackaging.setPoint_code(dto.getPoint_code());
|
||||
mdPdmPackaging.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mdPdmPackaging.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
mdPdmPackaging.setCreate_time(DateUtil.now());
|
||||
this.updateById(mdPdmPackaging);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,9 @@ public enum IOSEnum {
|
||||
// 盘点明细状态
|
||||
CHECK_DTL_STATUS(MapOf.of("生成", "10", "移库中", "15", "盘点中", "20", "回库中", "30", "完成", "99")),
|
||||
|
||||
// 区域编码
|
||||
REGION_CODE(MapOf.of("出入库区域", "INOUR01", "AGV对接区", "AGVDJ01", "临时储存区", "LSCC01")),
|
||||
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -106,4 +106,11 @@ public interface IMdPbGroupplateService extends IService<GroupPlate> {
|
||||
List<JSONObject> getPalletViewByVehicleCode(String search, List<String> status);
|
||||
|
||||
List<JSONObject> getStockGroupInfo(JSONObject param);
|
||||
|
||||
/**
|
||||
* 查询物料集合
|
||||
*
|
||||
* @return List<MdMeMaterialbase>
|
||||
*/
|
||||
List<MdMeMaterialbase> queryMaterList();
|
||||
}
|
||||
|
||||
@@ -203,4 +203,13 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
public List<JSONObject> getStockGroupInfo(JSONObject param) {
|
||||
return this.baseMapper.getStockGroupInfo(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdMeMaterialbase> queryMaterList() {
|
||||
return iMdMeMaterialbaseService.list(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.eq(MdMeMaterialbase::getIs_delete, IOSConstant.ZERO)
|
||||
.eq(MdMeMaterialbase::getIs_used, IOSConstant.ONE)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,4 +64,12 @@ export function printDelete(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryMater, checkVehicle, querySupp, copySave, printDelete }
|
||||
export function queryMaterList(data) {
|
||||
return request({
|
||||
url: 'api/group/queryMaterList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryMater, checkVehicle, querySupp, copySave, printDelete, queryMaterList }
|
||||
|
||||
@@ -93,7 +93,23 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||
<el-select
|
||||
v-model="form.material_code"
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
filterable
|
||||
:disabled="crud.status.edit > 0"
|
||||
@change="queryMater"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materList"
|
||||
:key="item.material_code"
|
||||
:label="item.material_name"
|
||||
:value="item.material_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -260,6 +276,7 @@ export default {
|
||||
return {
|
||||
permission: {},
|
||||
openParam: {},
|
||||
materList: [],
|
||||
openAddDtlDialog: false,
|
||||
suppList: [],
|
||||
rules: {
|
||||
@@ -285,6 +302,9 @@ export default {
|
||||
crudGroup.querySupp({}).then(row => {
|
||||
this.suppList = row
|
||||
})
|
||||
crudGroup.queryMaterList({}).then(res => {
|
||||
this.materList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
|
||||
@@ -45,7 +45,23 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||
<el-select
|
||||
v-model="form.material_code"
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
filterable
|
||||
:disabled="crud.status.edit > 0"
|
||||
@change="queryMater"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materList"
|
||||
:key="item.material_code"
|
||||
:label="item.material_name"
|
||||
:value="item.material_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -65,7 +81,7 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料批号" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" style="width: 200px;" />
|
||||
<el-input v-model="form.pcsn" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -74,6 +90,12 @@
|
||||
<el-input-number v-model="form.qty" :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="点位编码" prop="point_code">
|
||||
<el-input v-model="form.point_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -100,6 +122,7 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
|
||||
@@ -177,6 +200,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
materList: [],
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||
@@ -184,12 +208,20 @@ export default {
|
||||
pcsn: [
|
||||
{ required: true, message: '批次不能为空', trigger: 'blur' }
|
||||
],
|
||||
point_code: [
|
||||
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
qty: [
|
||||
{ required: true, message: '收货重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudGroup.queryMaterList({}).then(res => {
|
||||
this.materList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
|
||||
Reference in New Issue
Block a user