一些优化
This commit is contained in:
parent
d350079342
commit
7e9dc3e702
|
|
@ -73,6 +73,9 @@ public class InCostCenterBackController extends BaseController {
|
|||
@Resource
|
||||
private InMaterialScanRecordRespository inMaterialScanRecordRespository;
|
||||
|
||||
@Resource
|
||||
private IWmsStorageService storageService;
|
||||
|
||||
/**
|
||||
* 查询SAP领料订单数据
|
||||
*/
|
||||
|
|
@ -162,12 +165,25 @@ public class InCostCenterBackController extends BaseController {
|
|||
.setRsnum(order.getRsnum())
|
||||
.setItems(datas.stream()
|
||||
.filter(item -> item.getLeft().compareTo(BigDecimal.ZERO) > 0)
|
||||
.map(item -> new OutProduceItemVO()
|
||||
.setLgort2(item.getLgort())
|
||||
.setLgpbe(item.getLgpbe())
|
||||
.setMaktx2(item.getMaktx())
|
||||
.setMatnr(item.getMatnr())
|
||||
.setNum(item.getLeft())).toList()
|
||||
.map(item -> {
|
||||
OutProduceItemVO vo = new OutProduceItemVO()
|
||||
.setLgort2(item.getLgort())
|
||||
.setLgpbe(item.getLgpbe())
|
||||
.setMaktx2(item.getMaktx())
|
||||
.setMatnr(item.getMatnr())
|
||||
.setNum(item.getLeft());
|
||||
if (StrUtil.isBlank(vo.getLgort2())) {
|
||||
String warehouseNo = storageService.getWarehouseNo(order.getWerks(), item.getMatnr());
|
||||
if (StrUtil.isBlank(warehouseNo)) {
|
||||
warehouseNo = order.getLgort();
|
||||
}
|
||||
vo.setLgort2(warehouseNo);
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getLgort2()) && StrUtil.isBlank(vo.getLgpbe())) {
|
||||
vo.setLgpbe(StrUtil.join("/", storageService.getBinNos(item.getMatnr(), order.getWerks(), vo.getLgort2())));
|
||||
}
|
||||
return vo;
|
||||
}).toList()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -182,6 +198,7 @@ public class InCostCenterBackController extends BaseController {
|
|||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
VUtil.trueThrowBusinessError(Objects.equals(order.getState(), 2)).throwMessage("该订单已完成");
|
||||
WmsInCostcenterBackTicket ticket = new WmsInCostcenterBackTicket()
|
||||
.setId(IdUtil.getSnowflakeNextId())
|
||||
.setNo(NoUtil.getOutProduceTicketNo())
|
||||
.setOrderId(order.getId())
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
|
|
@ -247,7 +264,7 @@ public class InCostCenterBackController extends BaseController {
|
|||
.setItems(dmaps.values().stream().map(its -> {
|
||||
WmsInCostcenterBackItem item = datas.stream().filter(d -> StrUtil.equals(d.getMatnr(), its.get(0).getMaterialNo())).findFirst().get();
|
||||
return new C_MaterialReturnItemQO()
|
||||
.setResbRspos(order.getRsnum())
|
||||
.setResbRspos(item.getRspos())
|
||||
.setResbMatnr(item.getMatnr())
|
||||
.setMaktx(item.getMaktx())
|
||||
.setResbLgort(order.getLgort())
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
||||
|
|
@ -14,8 +16,7 @@ import com.nflg.wms.admin.util.QRCodeUtil;
|
|||
import com.nflg.wms.admin.util.ThymeleafUtil;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
||||
import com.nflg.wms.common.pojo.dto.*;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.*;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
|
|
@ -115,7 +116,7 @@ public class InProduceBackController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 保存领料订单
|
||||
* 保存订单
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("save")
|
||||
|
|
@ -139,6 +140,13 @@ public class InProduceBackController extends BaseController {
|
|||
items.forEach(item -> {
|
||||
WmsInProduceBackItem data = Convert.convert(WmsInProduceBackItem.class, item);
|
||||
data.setOrderId(order.getId());
|
||||
ZWM3A21ResultDTO dto = CollectionUtil.get(sapService.zwm3a21(new ZWM3A21QueryDTO()
|
||||
.setI_werks(item.getDwerk())
|
||||
.setIt_matnr(List.of(new ZWM3A21MatnrItemDTO().setMatnr(item.getMatnr())))
|
||||
.setIt_lgort(List.of(new ZWM3A21LgortItemDTO().setLgort(item.getLgort2())))
|
||||
), 0);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(dto)).throwMessage("未查到" + item.getMatnr() + "的标识信息");
|
||||
data.setLbprt(dto.getXchpf());
|
||||
inProduceBackItemService.save(data);
|
||||
});
|
||||
});
|
||||
|
|
@ -215,7 +223,7 @@ public class InProduceBackController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 提交领料物料列表(PDA使用)
|
||||
* 提交物料列表(PDA使用)
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("pda/submit")
|
||||
|
|
@ -232,12 +240,19 @@ public class InProduceBackController extends BaseController {
|
|||
List<InMaterialScanRecord> records = new ArrayList<>();
|
||||
List<MaterialQRCodeContentDTO> dtos = new ArrayList<>();
|
||||
List<WmsInProduceBackTicketItem> ticketItems = new ArrayList<>();
|
||||
Multimap<String, String> input2 = ArrayListMultimap.create();
|
||||
request.getQrCodes().forEach(qrCode -> {
|
||||
MaterialQRCodeContentDTO qrCodeContent = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||
dtos.add(qrCodeContent);
|
||||
String materialNo = qrCodeContent.getMaterialNo();
|
||||
WmsInProduceBackItem item = datas.stream().filter(d -> StrUtil.equals(d.getMatnr(), materialNo)).findFirst().orElse(null);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("物料" + materialNo + "不需要退料");
|
||||
// VUtil.trueThrowBusinessError(List.of("3","4").contains(item.getLbprt()) && StrUtil.isBlank(qrCodeContent.getSerialNo()))
|
||||
// .throwMessage("物料" + materialNo + "必须有序列号");
|
||||
// if (List.of("3","4").contains(item.getLbprt())){
|
||||
// input2.put(item.getRspos(),qrCodeContent.getSerialNo());
|
||||
// }
|
||||
input2.put(item.getRspos(), qrCodeContent.getSerialNo());
|
||||
WmsInProduceBackTicketItem pti = ticketItems.stream()
|
||||
.filter(ti -> Objects.equals(ti.getProduceBackItemId(), item.getId()))
|
||||
.findFirst()
|
||||
|
|
@ -295,10 +310,14 @@ public class InProduceBackController extends BaseController {
|
|||
.setWerks(order.getDwerk())
|
||||
.setLgort(order.getLgort2())
|
||||
.setMenge(its.stream().map(MaterialQRCodeContentDTO::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
.setMenge_T(BigDecimal.ZERO)
|
||||
.setMenge_T(item.getEnmng())
|
||||
.setMeins(item.getMeins());
|
||||
}).toList()
|
||||
)
|
||||
.setInput2(input2.entries().stream().map(it -> new Zwm3a11Input2QO()
|
||||
.setRspos(it.getKey())
|
||||
.setSernr(it.getValue())).toList()
|
||||
)
|
||||
);
|
||||
BigDecimal totalNum = datas.stream().map(WmsInProduceBackItem::getSqsl).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal inNum = datas.stream().map(WmsInProduceBackItem::getNum).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
|
@ -348,6 +367,7 @@ public class InProduceBackController extends BaseController {
|
|||
// for (int i = 0, count = RandomUtil.randomInt(1, 100); i < count; i++) {
|
||||
// list.add(new WmsInProduceBackItem().setMatnr(RandomUtil.randomNumbers(10)));
|
||||
// }
|
||||
list.forEach(it -> it.setNum(null));
|
||||
Map<String, String> base = new HashMap<>();
|
||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||
base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100));
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ public class InventoryController extends BaseController {
|
|||
.batchNo(qrCodeContent.getBatchNo())
|
||||
.serialNo(qrCodeContent.getSerialNo())
|
||||
.num(qrCodeContent.getNum())
|
||||
.content(qrCode)
|
||||
.createBy(UserUtil.getUserName())
|
||||
.createTime(Instant.now())
|
||||
.build()
|
||||
|
|
@ -241,15 +242,15 @@ public class InventoryController extends BaseController {
|
|||
return ApiResult.success("保存" + newRecords.size() + "条数据成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成盘点任务(PDA使用)
|
||||
* @param taskId 任务ID
|
||||
*/
|
||||
@PostMapping("check/complete")
|
||||
public ApiResult<Void> complete(@Valid @RequestParam @NotNull Long taskId) {
|
||||
inventoryCheckTaskService.complete(taskId);
|
||||
return ApiResult.success();
|
||||
}
|
||||
// /**
|
||||
// * 完成盘点任务(PDA使用)
|
||||
// * @param taskId 任务ID
|
||||
// */
|
||||
// @PostMapping("check/complete")
|
||||
// public ApiResult<Void> complete(@Valid @RequestParam @NotNull Long taskId) {
|
||||
// inventoryCheckTaskService.complete(taskId);
|
||||
// return ApiResult.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查看盘点结果
|
||||
|
|
|
|||
|
|
@ -18,12 +18,13 @@ import com.nflg.wms.common.pojo.qo.SearchDeliverOrderQO;
|
|||
import com.nflg.wms.common.pojo.vo.DeliverNormalOrderVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.UserSupplier;
|
||||
import com.nflg.wms.repository.entity.WmsNormalPrintOrder;
|
||||
import com.nflg.wms.repository.entity.WmsSrmOrder;
|
||||
import com.nflg.wms.repository.entity.WmsSrmOrderItem;
|
||||
import com.nflg.wms.repository.service.IUserSupplierService;
|
||||
import com.nflg.wms.repository.service.IWmsSrmOrderItemService;
|
||||
import com.nflg.wms.repository.service.IWmsSrmOrderService;
|
||||
import com.nflg.wms.repository.service.IWmsWorkbenchService;
|
||||
import com.nflg.wms.repository.service.WmsNormalPrintOrderService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
|
|
@ -53,7 +54,7 @@ public class NormalOrderController extends BaseController {
|
|||
private WmsNormalPrintOrderService deliverNormalOrderService;
|
||||
|
||||
@Resource
|
||||
private IWmsWorkbenchService workbenchService;
|
||||
private IUserSupplierService userSupplierService;
|
||||
|
||||
private static final DecimalFormat DF = new DecimalFormat("0.00");
|
||||
|
||||
|
|
@ -69,8 +70,8 @@ public class NormalOrderController extends BaseController {
|
|||
@Transactional
|
||||
@PostMapping("save")
|
||||
public ApiResult<Void> save(@Valid @RequestBody DeliverNormalOrderSaveQO request) {
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(UserUtil.getType(), UserType.Supplier))
|
||||
.throwMessage("您不是供应商");
|
||||
// VUtil.trueThrowBusinessError(!Objects.equals(UserUtil.getType(), UserType.Supplier))
|
||||
// .throwMessage("您不是供应商");
|
||||
// Set<String> workbenchNos = request.getItems().stream().map(DeliverNormalOrderSaveItemQO::getWorkbenchNo).collect(Collectors.toSet());
|
||||
// List<WmsWorkbench> workbenches = workbenchService.getBatch(workbenchNos);
|
||||
// Set<String> difference = Sets.difference(
|
||||
|
|
@ -98,9 +99,11 @@ public class NormalOrderController extends BaseController {
|
|||
request.getItems().forEach(it -> {
|
||||
WmsNormalPrintOrder item = Convert.convert(WmsNormalPrintOrder.class, it);
|
||||
// item.setWorkbenchId(workbenches.stream().filter(w->Objects.equals(w.getNo(),it.getWorkbenchNo())).findFirst().get().getId());
|
||||
UserSupplier supplier = userSupplierService.getByCode(it.getSupplierNo());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(supplier)).throwMessage("供应商不存在");
|
||||
if (Objects.isNull(item.getId())) {
|
||||
item.setOrderNo(orderNo);
|
||||
item.setSupplierId(UserUtil.getUserId());
|
||||
item.setSupplierId(supplier.getUserId());
|
||||
item.setCreateBy(UserUtil.getUserName());
|
||||
item.setCreateTime(LocalDateTime.now());
|
||||
forAdd.add(item);
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
.map(order -> new SAPOrderDTO()
|
||||
.setIndex(IdUtil.getSnowflakeNextId())
|
||||
.setOrderNo(order.getEbeln())
|
||||
.setSupplierNo(request.getSupplierNo())
|
||||
.setSupplierName(supplier.getSupplierName())
|
||||
.setOrderRowNo(order.getEbelp())
|
||||
.setMaterialNo(order.getMatnr())
|
||||
|
|
@ -146,9 +147,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
.toList();
|
||||
if (Objects.equals(request.getType(), 1)) {
|
||||
datas.forEach(it -> {
|
||||
if (StrUtil.equals("2", it.getLbprt()) || StrUtil.equals("4", it.getLbprt())) {
|
||||
it.setBatchNo(NoUtil.getBatchNo(request.getSupplierNo()));
|
||||
}
|
||||
it.setBatchNo(NoUtil.getBatchNo(request.getSupplierNo()));
|
||||
});
|
||||
}
|
||||
return ApiResult.success(datas);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@ public class InventoryCheckTaskScanRecord {
|
|||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,8 +76,9 @@ public class SapService {
|
|||
JCoFunction function = exec("ZWM00_MB007", parameters);
|
||||
|
||||
JCoStructure sreturn = function.getExportParameterList().getStructure("E_RETURN");
|
||||
log.info("sreturn:" + sreturn);
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(sreturn.getString("TYPE"), "S"))
|
||||
.throwMessage("SAP错误:" + sreturn.getString("MSG"));
|
||||
.throwMessage("SAP错误:" + sreturn.getString("MESSAGE"));
|
||||
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("E_OUTPUT");
|
||||
return JCoUtil.toBean(structure, ZWM00MB007DTO.class);
|
||||
|
|
@ -407,12 +408,12 @@ public class SapService {
|
|||
|
||||
// 处理返回表 T_RETURN,判断执行是否成功
|
||||
JCoTable returnTable = function.getTableParameterList().getTable("T_RETURN");
|
||||
VUtil.trueThrowBusinessError(returnTable.getNumRows() <= 0).throwMessage("获取Type信息有误");
|
||||
log.info("SAP返回: {}", returnTable);
|
||||
VUtil.trueThrowBusinessError(returnTable.getNumRows() <= 0).throwMessage("SAP未返回结果状态");
|
||||
|
||||
returnTable.setRow(0);
|
||||
VUtil.trueThrowBusinessError(StrUtil.equals(returnTable.getString("E_TYPE"), "E"))
|
||||
.throwMessage(returnTable.getString("E_MSG"));
|
||||
log.info("SAP返回: {}", returnTable);
|
||||
VUtil.trueThrowBusinessError(StrUtil.equals(returnTable.getString("TYPE"), "E"))
|
||||
.throwMessage(returnTable.getString("MESSAGE"));
|
||||
|
||||
// 获取导出参数,构造返回结果对象
|
||||
JCoParameterList exportParam = function.getExportParameterList();
|
||||
|
|
@ -823,20 +824,13 @@ public class SapService {
|
|||
// 调用 SAP RFC 函数 ZWM00_MB112
|
||||
JCoFunction function = exec("ZWM3A11", parameters, tables);
|
||||
|
||||
// 处理返回表 T_RETURN,判断执行是否成功
|
||||
JCoTable returnTable = function.getTableParameterList().getTable("OUTPUT2");
|
||||
VUtil.trueThrowBusinessError(returnTable.getNumRows() <= 0).throwMessage("获取Type信息有误");
|
||||
returnTable.setRow(0);
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(returnTable.getString("TYPE"), "S"))
|
||||
.throwMessage(returnTable.getString("MESSAGE"));
|
||||
log.info("SAP返回: {}", returnTable);
|
||||
JCoStructure output1 = function.getExportParameterList().getStructure("OUTPUT1");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(output1.getString("TYPE"), "S"))
|
||||
.throwMessage(output1.getString("MSG"));
|
||||
|
||||
// 获取导出参数,构造返回结果对象
|
||||
JCoParameterList exportParam = function.getExportParameterList();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(exportParam)).throwMessage("无法获取到有效的物料凭证信息");
|
||||
Zwm3a11VO result = new Zwm3a11VO()
|
||||
.setMat_doc(exportParam.getString("MAT_DOC"))
|
||||
.setDocYear(exportParam.getString("DOC_YEAR"));
|
||||
.setMat_doc(output1.getString("MAT_DOC"))
|
||||
.setDocYear(output1.getString("DOC_YEAR"));
|
||||
log.info("SAP返回物料凭证信息: MBLNR={}, MJAHR={}", result.getMat_doc(), result.getDocYear());
|
||||
return result;
|
||||
}
|
||||
|
|
@ -1154,8 +1148,8 @@ public ZWM00MB113DTO zwm00_mb113(ZWM00MB113QO query) {
|
|||
// 获取并校验导出参数,判断调用是否成功
|
||||
JCoParameterList exportParam = function.getExportParameterList();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(exportParam)).throwMessage("无法获取到有效的物料信息");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(exportParam.getString("TYPE"), "S"))
|
||||
.throwMessage(exportParam.getString("MESSAGE"));
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(exportParam.getString("E_TYPE"), "S"))
|
||||
.throwMessage(exportParam.getString("E_MSG"));
|
||||
|
||||
// 处理返回表数据,转换为结果对象列表
|
||||
JCoTable returnTable = function.getTableParameterList().getTable("T_OUT");
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class StructuralPackageControllerService {
|
|||
List<PackageMaterialDTO> materials = JSONUtil.toList(p.getMaterials(), PackageMaterialDTO.class);
|
||||
WmsStructuralPackage structuralPackage = Convert.convert(WmsStructuralPackage.class, request);
|
||||
structuralPackage.setId(null);
|
||||
structuralPackage.setOrderNo(p.getOrderNo());
|
||||
structuralPackage.setOrderNo(getOrderNo());
|
||||
structuralPackage.setCreateBy(UserUtil.getUserName());
|
||||
structuralPackage.setCreateTime(LocalDateTime.now());
|
||||
structuralPackage.setModelIds(StrUtil.join(",", request.getModelIds()));
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.nflg.wms.common.util.BeanUtil;
|
|||
import com.sap.conn.jco.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JCoUtil {
|
||||
|
||||
|
|
@ -47,7 +48,11 @@ public class JCoUtil {
|
|||
}
|
||||
|
||||
public static <T> List<Map<String, Object>> toMapList(List<T> datas) {
|
||||
return datas.stream().map(BeanUtil::toMap).toList();
|
||||
return datas.stream().map(BeanUtil::toMap)
|
||||
.map(list -> list.entrySet().stream()
|
||||
.collect(Collectors.toMap(entry -> entry.getKey().toUpperCase(),
|
||||
Map.Entry::getValue)))
|
||||
.toList();
|
||||
}
|
||||
|
||||
public static <T> List<Map<String, Object>> toMapList(T data) {
|
||||
|
|
|
|||
|
|
@ -100,6 +100,15 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 预留/相关需求的项目编号
|
||||
*/
|
||||
private String rspos;
|
||||
|
||||
public String getRspos() {
|
||||
return StrUtil.removeAllPrefix(rspos, "0");
|
||||
}
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return Objects.isNull(num) ? bdmng : num;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,11 @@ public class SAPOrderDTO {
|
|||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierNo;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ZWM3A21QueryDTO{
|
||||
//工厂
|
||||
private String i_werks;
|
||||
|
|
|
|||
|
|
@ -87,4 +87,10 @@ public class DeliverNormalOrderSaveItemQO {
|
|||
*/
|
||||
@NotBlank
|
||||
private String lbprt;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
@NotBlank
|
||||
private String supplierNo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class Zwm3a11Input2QO {
|
||||
//序列号
|
||||
private String sernr;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.nflg.wms.common.pojo.vo;
|
|||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@Data
|
||||
public class InventoryCheckTaskItemMaterialVO {
|
||||
|
|
@ -65,6 +67,10 @@ public class InventoryCheckTaskItemMaterialVO {
|
|||
private BigDecimal differenceNum;
|
||||
|
||||
public BigDecimal getDifferenceNum() {
|
||||
return this.inventoryNum.subtract(this.num);
|
||||
if (Objects.isNull(inventoryNum)) {
|
||||
return num.multiply(new BigDecimal("-1"));
|
||||
} else {
|
||||
return this.inventoryNum.subtract(Optional.ofNullable(num).orElse(BigDecimal.ZERO));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class QCTaskVO {
|
||||
|
|
@ -31,5 +32,5 @@ public class QCTaskVO {
|
|||
/***
|
||||
* 创建时间
|
||||
*/
|
||||
private DateTime createTime;
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class BeanUtil {
|
|||
return cn.hutool.core.bean.BeanUtil.toBean(map, clazz);
|
||||
}
|
||||
|
||||
public static Map<String, Object> toMap(Object source) {
|
||||
public static <T> Map<String, Object> toMap(T source) {
|
||||
return new HashMap<>(BeanMap.create(source));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,4 +86,9 @@ public class WmsInCostcenterBackItem implements Serializable {
|
|||
*/
|
||||
@TableField(value = "\"left\"")
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* 预留/相关需求的项目编号
|
||||
*/
|
||||
private String rspos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,4 +129,9 @@ public class WmsInProduceBackItem implements Serializable {
|
|||
* 已上架数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
private String lbprt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
and plnbez like concat('%', #{request.plnbez}, '%')
|
||||
</if>
|
||||
<if test="request.lgort2!=null and request.lgort2!=''">
|
||||
and plnbez like concat('%', #{request.lgort2}, '%')
|
||||
and lgort2 like concat('%', #{request.lgort2}, '%')
|
||||
</if>
|
||||
<if test="request.startDate!=null">
|
||||
and create_time >= #{request.startDate}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.InventoryCheckTaskItemVO">
|
||||
SELECT icti.id,ict.*,di."name" AS "factory_no",wh."name" AS "warehouse_name"
|
||||
SELECT icti.id,icti.task_id,ict.*,di."name" AS "factory_no",wh."name" AS "warehouse_name"
|
||||
FROM wms_inventory_check_task ict
|
||||
INNER JOIN wms_inventory_check_task_item icti ON ict."id"=icti.task_id
|
||||
LEFT JOIN wms_warehouse wh ON wh."id"=icti.warehouse_id
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@ public class InventoryCheckTaskProcessor implements BasicProcessor {
|
|||
public ProcessResult process(TaskContext context) {
|
||||
OmsLogger omsLogger = context.getOmsLogger();
|
||||
omsLogger.info("开始");
|
||||
List<WmsInventoryCheckTask> datas = inventoryCheckTaskService.lambdaQuery().eq(WmsInventoryCheckTask::getState, InventoryCheckTaskState.Published.getState()).list();
|
||||
omsLogger.info("共【{}】条已发布数据", datas.size());
|
||||
List<WmsInventoryCheckTask> datas = inventoryCheckTaskService.lambdaQuery()
|
||||
.in(WmsInventoryCheckTask::getState, List.of(InventoryCheckTaskState.Published.getState(), InventoryCheckTaskState.InProgress.getState()))
|
||||
.list();
|
||||
omsLogger.info("共【{}】条数据", datas.size());
|
||||
datas.forEach(data -> {
|
||||
omsLogger.info("处理【{}】开始", data.getTaskNo());
|
||||
if (LocalDate.now().isAfter(data.getEndTime())) {
|
||||
|
|
|
|||
|
|
@ -130,6 +130,11 @@
|
|||
<artifactId>minio</artifactId>
|
||||
<version>8.5.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
|||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
|
|
@ -27,6 +28,7 @@ public class JacksonConfig {
|
|||
return new ObjectMapper()
|
||||
.registerModule(customDateTimeModule())
|
||||
.registerModule(bigDecimalModule())
|
||||
.registerModule(new JavaTimeModule())
|
||||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.configure(SerializationFeature.INDENT_OUTPUT, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue