parent
7f9c737cb8
commit
9663744367
|
|
@ -859,8 +859,12 @@ public class NormalPGIController extends BaseController {
|
||||||
order.getSupplierNum(),
|
order.getSupplierNum(),
|
||||||
item.getItemCode(), item.getPoLineNumber());
|
item.getItemCode(), item.getPoLineNumber());
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(materialInfoInOrder)).throwMessage("当前物料信息【" + item.getItemCode() + "】,订单号【" + item.getPoNum() + "】,供应商【" + order.getSupplierName() + "】在SAP中搜索不到有效信息");
|
VUtil.trueThrowBusinessError(Objects.isNull(materialInfoInOrder)).throwMessage("当前物料信息【" + item.getItemCode() + "】,订单号【" + item.getPoNum() + "】,供应商【" + order.getSupplierName() + "】在SAP中搜索不到有效信息");
|
||||||
String batchNumber = (materialInfoInOrder.getLbprt().equals("2")
|
String batchNumber =NoUtil.getBatchNo(order.getSupplierNum());
|
||||||
|
/*
|
||||||
|
(materialInfoInOrder.getLbprt().equals("2")
|
||||||
|| materialInfoInOrder.getLbprt().equals("4")) ? NoUtil.getBatchNo(order.getSupplierNum()) : "";
|
|| materialInfoInOrder.getLbprt().equals("4")) ? NoUtil.getBatchNo(order.getSupplierNum()) : "";
|
||||||
|
|
||||||
|
*/
|
||||||
qo.setItemName(materialInfoInOrder.getMaktx());
|
qo.setItemName(materialInfoInOrder.getMaktx());
|
||||||
qo.setUomCode(materialInfoInOrder.getMeins());
|
qo.setUomCode(materialInfoInOrder.getMeins());
|
||||||
qo.setReceivedWarehouse(materialInfoInOrder.getWarehouseNo());
|
qo.setReceivedWarehouse(materialInfoInOrder.getWarehouseNo());
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.nflg.wms.admin.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.nflg.wms.common.pojo.PageData;
|
||||||
|
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.OptRecordQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OptRecordVO;
|
||||||
|
import com.nflg.wms.repository.service.IOptRecordService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印/过账操作记录
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/operation/record")
|
||||||
|
public class OptRecordController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOptRecordService optRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询打印/过账操作记录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("search")
|
||||||
|
public List<OptRecordVO> searchRecord(@Valid @RequestBody OptRecordQO optRecordQO){
|
||||||
|
return optRecordService.search(optRecordQO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入打印/过账操作记录
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
public void add(@Valid @RequestBody OptRecordDTO optRecordDTO){
|
||||||
|
optRecordService.add(optRecordDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -109,11 +109,15 @@ public class OutProduceController extends BaseController {
|
||||||
Map<String, List<Zwm3a07VO>> maps = vos.stream().collect(Collectors.groupingBy(Zwm3a07VO::getKey1));
|
Map<String, List<Zwm3a07VO>> maps = vos.stream().collect(Collectors.groupingBy(Zwm3a07VO::getKey1));
|
||||||
maps.forEach((key, items) -> {
|
maps.forEach((key, items) -> {
|
||||||
List<InventoryInDTO> imaps = inventoryService.getNum(items.get(0).getDwerk(), items.get(0).getLgort2(), items.stream().map(Zwm3a07VO::getMatnr).toList());
|
List<InventoryInDTO> imaps = inventoryService.getNum(items.get(0).getDwerk(), items.get(0).getLgort2(), items.stream().map(Zwm3a07VO::getMatnr).toList());
|
||||||
items.forEach(item -> item.setLeftNum(imaps.stream()
|
String wname = inventoryService.getName(items.get(0).getDwerk(), items.get(0).getLgort2());
|
||||||
.filter(it -> StrUtil.equals(it.getMaterialNo(), item.getMatnr()))
|
items.forEach(item -> {
|
||||||
.findFirst()
|
item.setLeftNum(imaps.stream()
|
||||||
.orElse(new InventoryInDTO().setNum(BigDecimal.ZERO)).getNum())
|
.filter(it -> StrUtil.equals(it.getMaterialNo(), item.getMatnr()))
|
||||||
);
|
.findFirst()
|
||||||
|
.orElse(new InventoryInDTO().setNum(BigDecimal.ZERO)).getNum());
|
||||||
|
item.setWname(wname);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ public class StructuralPackageOrderController extends BaseController {
|
||||||
.setLbprt(order.getLbprt())
|
.setLbprt(order.getLbprt())
|
||||||
.setUnit(order.getMeins())
|
.setUnit(order.getMeins())
|
||||||
.setWerks(order.getWerks())
|
.setWerks(order.getWerks())
|
||||||
|
.setBatchNo(NoUtil.getBatchNo(order.getLifnr()))
|
||||||
.setWarehouseNo(order.getWarehouseNo())
|
.setWarehouseNo(order.getWarehouseNo())
|
||||||
.setKzkri(order.getKzkri());
|
.setKzkri(order.getKzkri());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.nflg.wms.common.constant;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum OperationType {
|
||||||
|
Print((short) 0, "打印"),
|
||||||
|
Post((short) 1, "过账");
|
||||||
|
|
||||||
|
private final Short state;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
public static OperationType findByValue(Short value) {
|
||||||
|
for (OperationType valueEnum : OperationType.values()) {
|
||||||
|
if (Objects.equals(valueEnum.getState(), value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.nflg.wms.common.pojo.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OptRecordDTO {
|
||||||
|
/**
|
||||||
|
* 单号(必传)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "单号不能为空")
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间(必传)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "操作时间不能为空")
|
||||||
|
private LocalDateTime operationTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型(必传)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "操作类型不能为空")
|
||||||
|
private Short operationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员id(必传)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "操作人员id不能为空")
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员(必传)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "操作人员不能为空")
|
||||||
|
private String operator;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OptRecordQO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单号
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private Short operationType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OptRecordVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单号
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime operationTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private Short operationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员id
|
||||||
|
*/
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
}
|
||||||
|
|
@ -125,6 +125,9 @@ public class Zwm3a07VO {
|
||||||
//MRP 控制者(物料计划人)
|
//MRP 控制者(物料计划人)
|
||||||
private String dispo;
|
private String dispo;
|
||||||
|
|
||||||
|
//仓库名
|
||||||
|
private String wname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库可领用数量
|
* 仓库可领用数量
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 操作记录表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("opt_record")
|
||||||
|
public class OptRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单号
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime operationTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private Short operationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员id
|
||||||
|
*/
|
||||||
|
private String operatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.OptRecordQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OptRecordVO;
|
||||||
|
import com.nflg.wms.repository.entity.OptRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 操作记录表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface OptRecordMapper extends BaseMapper<OptRecord> {
|
||||||
|
|
||||||
|
List<OptRecordVO> search(OptRecordQO request);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,8 @@ public interface WmsInventoryMapper extends BaseMapper<WmsInventory> {
|
||||||
|
|
||||||
List<InventoryInDTO> getLockedNum(String factoryNo, String warehouseNo, List<String> materialNos);
|
List<InventoryInDTO> getLockedNum(String factoryNo, String warehouseNo, List<String> materialNos);
|
||||||
|
|
||||||
|
String getWname(String factoryNo, String warehouseNo);
|
||||||
|
|
||||||
BigDecimal getNumOne(String factoryNo, String warehouseNo, String materialNo);
|
BigDecimal getNumOne(String factoryNo, String warehouseNo, String materialNo);
|
||||||
|
|
||||||
BigDecimal getLockedNumOne(String factoryNo, String warehouseNo, String materialNo);
|
BigDecimal getLockedNumOne(String factoryNo, String warehouseNo, String materialNo);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.OptRecordQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OptRecordVO;
|
||||||
|
import com.nflg.wms.repository.entity.OptRecord;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 操作记录表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface IOptRecordService extends IService<OptRecord> {
|
||||||
|
List<OptRecordVO> search(OptRecordQO request);
|
||||||
|
|
||||||
|
void add(OptRecordDTO optRecordDTO);
|
||||||
|
}
|
||||||
|
|
@ -39,6 +39,14 @@ public interface IWmsInventoryService extends IService<WmsInventory> {
|
||||||
*/
|
*/
|
||||||
List<InventoryInDTO> getNum(String factoryNo, String warehouseNo, List<String> materialNos);
|
List<InventoryInDTO> getNum(String factoryNo, String warehouseNo, List<String> materialNos);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可用的库存数量,实际库存减去锁定库存
|
||||||
|
* @param factoryNo 工厂编号
|
||||||
|
* @param warehouseNo 仓库编号
|
||||||
|
* @return 工厂名
|
||||||
|
*/
|
||||||
|
String getName(String factoryNo, String warehouseNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取可用的库存数量,实际库存减去锁定库存
|
* 获取可用的库存数量,实际库存减去锁定库存
|
||||||
* @param factoryNo 工厂编号
|
* @param factoryNo 工厂编号
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.OptRecordQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OptRecordVO;
|
||||||
|
import com.nflg.wms.repository.entity.OptRecord;
|
||||||
|
import com.nflg.wms.repository.mapper.OptRecordMapper;
|
||||||
|
import com.nflg.wms.repository.service.IOptRecordService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 操作记录表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OptRecordServiceImpl extends ServiceImpl<OptRecordMapper, OptRecord> implements IOptRecordService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OptRecordVO> search(OptRecordQO request) {
|
||||||
|
return baseMapper.search(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(OptRecordDTO optRecordDTO) {
|
||||||
|
OptRecord optRecord = new OptRecord();
|
||||||
|
BeanUtils.copyProperties(optRecordDTO, optRecord);
|
||||||
|
// baseMapper.insert(optRecord);
|
||||||
|
boolean saveSuccess = this.save(optRecord);
|
||||||
|
if (!saveSuccess) {
|
||||||
|
throw new RuntimeException("新增操作记录失败,请稍后重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -179,6 +179,11 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
||||||
return inventoryNums;
|
return inventoryNums;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(String factoryNo, String warehouseNo) {
|
||||||
|
return baseMapper.getWname(factoryNo,warehouseNo);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getNumOne(String factoryNo, String warehouseNo, String materialNo) {
|
public BigDecimal getNumOne(String factoryNo, String warehouseNo, String materialNo) {
|
||||||
return Optional.ofNullable(baseMapper.getNumOne(factoryNo, warehouseNo, materialNo)).orElse(BigDecimal.ZERO)
|
return Optional.ofNullable(baseMapper.getNumOne(factoryNo, warehouseNo, materialNo)).orElse(BigDecimal.ZERO)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nflg.wms.repository.mapper.OptRecordMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.OptRecordVO">
|
||||||
|
SELECT order_id,operation_time,operation_type,operator_id,operator
|
||||||
|
FROM opt_record
|
||||||
|
WHERE order_id = #{orderId} AND operation_type = #{operationType}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
||||||
)
|
)
|
||||||
.strategyConfig(builder -> {
|
.strategyConfig(builder -> {
|
||||||
builder
|
builder
|
||||||
.addInclude("wms_qc_receive") //只生成指定表
|
.addInclude("opt_record") //只生成指定表
|
||||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||||
.enableLombok()
|
.enableLombok()
|
||||||
.enableChainModel()
|
.enableChainModel()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue