feat(wms): 添加生产订单入库功能并优化组件包装逻辑
- 新增 InProduceOrderController 实现生产订单入库管理功能 - 在 BOM 服务中添加 isQiTao 方法用于判断物料是否为齐套物料 - 重构组件包装控制器中的齐套判断逻辑,统一使用 isQiTao 方法 - 移除 ComponentPackingController 中未使用的 PageUtil 导入 - 为生产订单添加完整的 CRUD 操作和 PDF 导出功能 - 实现 PDA 端生产订单收货和入库流程 - 添加物料扫描记录和库存同步功能 - 优化多个出库控制器中的齐套判断逻辑 - 实现出库单据的批量处理和打印功能
This commit is contained in:
parent
981d1f4a96
commit
a9cbdbed26
|
|
@ -16,7 +16,6 @@ import com.nflg.wms.common.pojo.qo.ComponentPackingEditInputQO;
|
|||
import com.nflg.wms.common.pojo.qo.ComponentPackingInputQO;
|
||||
import com.nflg.wms.common.pojo.qo.ComponentPackingQO;
|
||||
import com.nflg.wms.common.pojo.vo.*;
|
||||
import com.nflg.wms.common.util.PageUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsComponentPacking;
|
||||
import com.nflg.wms.repository.entity.WmsComponentPackingItem;
|
||||
|
|
@ -195,12 +194,12 @@ public class ComponentPackingController {
|
|||
if (CollectionUtil.isEmpty(tasks)) {
|
||||
return ApiResult.success(Collections.emptyList());
|
||||
}
|
||||
Integer type = bomService.getScanType(packing.getMatnr());
|
||||
// 转换为 VO 对象
|
||||
List<ComponentPackingItemPdaVO> daVos = tasks.stream()
|
||||
.map(item1 -> {
|
||||
ComponentPackingItemPdaVO vo = Convert.convert(ComponentPackingItemPdaVO.class, item1);
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(vo.getIdnrk()));
|
||||
Integer type = bomService.getScanType(vo.getIdnrk());
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(vo.getIdnrk()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 从SAP查询生产订单信息
|
||||
*
|
||||
* @param no 生产订单号
|
||||
* @return 订单信息
|
||||
*/
|
||||
|
|
@ -129,7 +128,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@Transactional
|
||||
|
|
@ -222,7 +220,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 搜索
|
||||
*
|
||||
* @param request 搜索参数
|
||||
* @return 搜索结果
|
||||
*/
|
||||
|
|
@ -233,7 +230,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取订单的物料列表
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 列表
|
||||
*/
|
||||
|
|
@ -252,7 +248,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 订单ID
|
||||
*/
|
||||
@Transactional
|
||||
|
|
@ -269,7 +264,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 导出物料条码pdf(逐个)
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @param type 1:逐个,2:一页
|
||||
*/
|
||||
|
|
@ -378,7 +372,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取订单信息(PDA使用)
|
||||
*
|
||||
* @param no 报工单号
|
||||
*/
|
||||
@GetMapping("getOrderInfo")
|
||||
|
|
@ -398,13 +391,13 @@ public class InProduceOrderController extends BaseController {
|
|||
List<InProduceOrderItemVO> children = list.stream()
|
||||
.filter(child -> Objects.equals(child.getParentId(), it.getId()))
|
||||
.toList();
|
||||
it.setQiTao(CollectionUtil.isNotEmpty(children));
|
||||
Integer type = bomService.getScanType(it.getMaterialNo());
|
||||
it.setQiTao(type > 0);
|
||||
if (Objects.equals(type, 0)) {
|
||||
it.setMustScan(false);
|
||||
}
|
||||
children.forEach(child -> {
|
||||
child.setQiTao(it.isQiTao());
|
||||
child.setQiTao(false);
|
||||
child.setMustScan(it.isMustScan());
|
||||
child.setBinNo(binService.getBinNo(child.getMaterialNo(), child.getFactoryNo(), child.getWarehouseNo()));
|
||||
child.setIsDisableLocation(warehouseService.isEnableLocation(child.getFactoryNo(), child.getWarehouseNo()));
|
||||
|
|
@ -418,7 +411,6 @@ public class InProduceOrderController extends BaseController {
|
|||
|
||||
/**
|
||||
* 收货和入库(PDA使用)
|
||||
*
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@Transactional
|
||||
|
|
@ -438,7 +430,7 @@ public class InProduceOrderController extends BaseController {
|
|||
.toList();
|
||||
Integer type = bomService.getScanType(it.getMaterialNo());
|
||||
children.forEach(child -> {
|
||||
child.setQiTao(type > 0);
|
||||
child.setQiTao(false);
|
||||
if (Objects.equals(type, 0)) {
|
||||
child.setMustScan(false);
|
||||
}
|
||||
|
|
@ -459,9 +451,9 @@ public class InProduceOrderController extends BaseController {
|
|||
List<WmsQrCodeMaster> qrCodeMasters = CollectionUtil.isEmpty(allQrCodes)
|
||||
? Collections.emptyList()
|
||||
: qrCodeMasterService.lambdaQuery()
|
||||
.ne(WmsQrCodeMaster::getProcessStage, BarCodeProcessStage.InBound.getState())
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, allQrCodes)
|
||||
.list();
|
||||
.ne(WmsQrCodeMaster::getProcessStage, BarCodeProcessStage.InBound.getState())
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, allQrCodes)
|
||||
.list();
|
||||
datas.forEach(it -> {
|
||||
InventoryIn1ItemQO qitem = request.getItems().stream()
|
||||
.filter(item -> Objects.equals(item.getItemId(), it.getId()))
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ public class OutAssistanceController extends BaseController {
|
|||
.setMatnr(item.getMatnr1())
|
||||
.setMeins(item.getMeins())
|
||||
.setNum(item.getLeft());
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(item.getMatnr1()));
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(item.getMatnr1()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ public class OutCostCenterController extends BaseController {
|
|||
.setMatnr(item.getMatnr())
|
||||
.setNum(item.getLeft())
|
||||
.setMeins(item.getMeins());
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(item.getMatnr()));
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(item.getMatnr()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ public class OutProduceController extends BaseController {
|
|||
.setMeins(item.getMeins())
|
||||
.setNum(item.getSqsl().subtract(item.getNum()));
|
||||
Integer type = bomService.getScanType(item.getMatnr());
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(item.getMatnr()));
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(item.getMatnr()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ public class TransferCompanyController extends BaseController {
|
|||
.setMaktx(item.getMaktx())
|
||||
.setNum(item.getLeft())
|
||||
.setMeins(item.getMeins());
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(item.getMatnr()));
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(item.getMatnr()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ public class TransferFactoryController extends BaseController {
|
|||
.setMeins(item.getMeins())
|
||||
.setBinIn(StrUtil.join("/", storageService.getBinNo(item.getMatnr(), order.getWerks(), order.getUmlgo())))
|
||||
.setBinOut(StrUtil.join("/", storageService.getBinNo(item.getMatnr(), order.getWerks(), order.getLgort())));
|
||||
vo.setQiTao(type > 0);
|
||||
vo.setQiTao(bomService.isQiTao(item.getMatnr()));
|
||||
if (Objects.equals(type, 1)) {
|
||||
vo.setChildren(bomService.getChildrenVO(item.getMatnr()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ public interface IWmsBomService extends IService<WmsBom> {
|
|||
// boolean isParent(String materialNo);
|
||||
|
||||
Integer getScanType(String materialNo);
|
||||
|
||||
boolean isQiTao(String materialNo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,4 +188,12 @@ public class WmsBomServiceImpl extends ServiceImpl<WmsBomMapper, WmsBom> impleme
|
|||
).orElse(new WmsBom().setScanType(-1))
|
||||
.getScanType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQiTao(String materialNo) {
|
||||
return lambdaQuery()
|
||||
.eq(WmsBom::getParentId, 0)
|
||||
.eq(WmsBom::getNo, materialNo)
|
||||
.exists();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue