一些优化
This commit is contained in:
parent
70a1d57c55
commit
d350079342
|
|
@ -52,7 +52,6 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/in/costcenter")
|
||||
public class InCostCenterBackController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private SapService sapService;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ package com.nflg.wms.admin.controller;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
|
|
@ -77,43 +75,43 @@ public class InProduceBackController extends BaseController {
|
|||
*/
|
||||
@PostMapping("searchSAP")
|
||||
public ApiResult<List<Zwm3a09VO>> searchSAP(@Valid @RequestBody Zwm3a09QO request) {
|
||||
// return ApiResult.success(sapService.zwm3a09(request));
|
||||
List<Zwm3a09VO> vos = new ArrayList<>();
|
||||
for (int i = 0, count = RandomUtil.randomInt(3, 30); i < count; i++) {
|
||||
vos.add(new Zwm3a09VO()
|
||||
.setBdter(DateUtil.format(RandomUtil.randomDate(DateUtil.date(), DateField.DAY_OF_YEAR, 1, 300), "yyyy-MM-dd"))
|
||||
.setAufnr(RandomUtil.randomNumbers(10))
|
||||
.setKtext(RandomUtil.randomString(10))
|
||||
.setPlnbez(RandomUtil.randomString(10))
|
||||
.setMaktx(RandomUtil.randomString(10))
|
||||
.setLgpbe(RandomUtil.randomString(4))
|
||||
.setMatnr(RandomUtil.randomString(11))
|
||||
.setName(RandomUtil.randomString(10))
|
||||
.setQlsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setSqsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setSqsl2(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setSqsl3(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setBdmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setLabst(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setKcqls(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setLgort2(RandomUtil.randomString(4))
|
||||
.setMeins(RandomUtil.randomString(4))
|
||||
.setEkgrp(RandomUtil.randomString(4))
|
||||
.setDispo(RandomUtil.randomString(4))
|
||||
.setRsnum(RandomUtil.randomNumbers(10))
|
||||
.setMaktx2(RandomUtil.randomString(10))
|
||||
.setVornr(RandomUtil.randomNumbers(10))
|
||||
.setSernr(RandomUtil.randomNumbers(10))
|
||||
.setJtsn(RandomUtil.randomNumbers(10))
|
||||
.setCusn(RandomUtil.randomNumbers(10))
|
||||
.setDwerk(RandomUtil.randomString(4))
|
||||
.setRsnum2(RandomUtil.randomNumbers(10))
|
||||
.setRspos(RandomUtil.randomNumbers(10))
|
||||
.setEnmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setInsme(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
);
|
||||
}
|
||||
return ApiResult.success(vos);
|
||||
return ApiResult.success(sapService.zwm3a09(request));
|
||||
// List<Zwm3a09VO> vos = new ArrayList<>();
|
||||
// for (int i = 0, count = RandomUtil.randomInt(3, 30); i < count; i++) {
|
||||
// vos.add(new Zwm3a09VO()
|
||||
// .setBdter(DateUtil.format(RandomUtil.randomDate(DateUtil.date(), DateField.DAY_OF_YEAR, 1, 300), "yyyy-MM-dd"))
|
||||
// .setAufnr(RandomUtil.randomNumbers(10))
|
||||
// .setKtext(RandomUtil.randomString(10))
|
||||
// .setPlnbez(RandomUtil.randomString(10))
|
||||
// .setMaktx(RandomUtil.randomString(10))
|
||||
// .setLgpbe(RandomUtil.randomString(4))
|
||||
// .setMatnr(RandomUtil.randomString(11))
|
||||
// .setName(RandomUtil.randomString(10))
|
||||
// .setQlsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setSqsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setSqsl2(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setSqsl3(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setBdmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setLabst(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setKcqls(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setLgort2(RandomUtil.randomString(4))
|
||||
// .setMeins(RandomUtil.randomString(4))
|
||||
// .setEkgrp(RandomUtil.randomString(4))
|
||||
// .setDispo(RandomUtil.randomString(4))
|
||||
// .setRsnum(RandomUtil.randomNumbers(10))
|
||||
// .setMaktx2(RandomUtil.randomString(10))
|
||||
// .setVornr(RandomUtil.randomNumbers(10))
|
||||
// .setSernr(RandomUtil.randomNumbers(10))
|
||||
// .setJtsn(RandomUtil.randomNumbers(10))
|
||||
// .setCusn(RandomUtil.randomNumbers(10))
|
||||
// .setDwerk(RandomUtil.randomString(4))
|
||||
// .setRsnum2(RandomUtil.randomNumbers(10))
|
||||
// .setRspos(RandomUtil.randomNumbers(10))
|
||||
// .setEnmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setInsme(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// );
|
||||
// }
|
||||
// return ApiResult.success(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
|
|
@ -98,18 +97,18 @@ public class InProduceOrderController extends BaseController {
|
|||
*/
|
||||
@GetMapping("searchFromSAP")
|
||||
public ApiResult<ZWM00MB007DTO> searchFromSAP(@Valid @RequestParam @NotBlank String no){
|
||||
// return ApiResult.success(sapService.zwm00Mb007(no));
|
||||
return ApiResult.success(new ZWM00MB007DTO()
|
||||
.setAufnr(RandomUtil.randomNumbers(10))
|
||||
.setMatnr(RandomUtil.randomString(11))
|
||||
.setMaktx(RandomUtil.randomString(20))
|
||||
.setLgort(RandomUtil.randomNumbers(4))
|
||||
.setPwerk("1010")
|
||||
.setPsmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
.setMeins(RandomUtil.randomString(2))
|
||||
.setWemng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("50")))
|
||||
.setWshsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("50")))
|
||||
);
|
||||
return ApiResult.success(sapService.zwm00Mb007(no));
|
||||
// return ApiResult.success(new ZWM00MB007DTO()
|
||||
// .setAufnr(RandomUtil.randomNumbers(10))
|
||||
// .setMatnr(RandomUtil.randomString(11))
|
||||
// .setMaktx(RandomUtil.randomString(20))
|
||||
// .setLgort(RandomUtil.randomNumbers(4))
|
||||
// .setPwerk("1010")
|
||||
// .setPsmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100")))
|
||||
// .setMeins(RandomUtil.randomString(2))
|
||||
// .setWemng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("50")))
|
||||
// .setWshsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("50")))
|
||||
// );
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ public class InPurchaseController extends BaseController {
|
|||
return ApiResult.success(new OutProduce1VO()
|
||||
.setId(order.getId())
|
||||
.setEbeln(order.getExternalOrderNo())
|
||||
.setSupplierName(order.getSupplierName())
|
||||
.setItems(datas.stream()
|
||||
.map(item -> new OutProduceItemVO()
|
||||
.setEbelp(item.getRowNo())
|
||||
|
|
|
|||
|
|
@ -6,14 +6,15 @@ package com.nflg.wms.admin.controller;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.nflg.wms.admin.pojo.document.SrmMaterialReceiptScanCodes;
|
||||
import com.nflg.wms.admin.pojo.dto.*;
|
||||
import com.nflg.wms.admin.pojo.dto.QCMaterialSyncDTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item1DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item2DTO;
|
||||
import com.nflg.wms.admin.repository.SrmMaterialReceiptScanCodesRepository;
|
||||
import com.nflg.wms.admin.service.NormalPGIControllerService;
|
||||
import com.nflg.wms.admin.service.SAPCommonService;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.dto.*;
|
||||
|
|
@ -22,6 +23,7 @@ import com.nflg.wms.common.pojo.qo.PoReceiveTaskItemConfirmQO;
|
|||
import com.nflg.wms.common.pojo.qo.SRMOrderSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.SrmMaterialReceiptQO;
|
||||
import com.nflg.wms.common.pojo.vo.*;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.*;
|
||||
|
|
@ -31,10 +33,10 @@ import com.nflg.wms.starter.annotation.ApiMark;
|
|||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.redisson.api.queue.FailedAckArgs;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
@ -459,7 +461,7 @@ public class NormalPGIController extends BaseController {
|
|||
srmItem.setSerialNum(code.getSerialNumbers());
|
||||
srmItem.setLineNumber(Integer.valueOf(item.getLineNumber()));
|
||||
srmItem.setNoteNum(item.getNoteNum());
|
||||
srmItem.setReceivedDate(DateTime.now());
|
||||
srmItem.setReceivedDate(DateTimeUtil.format(LocalDate.now(), "yyyy-MM-dd"));
|
||||
srmItem.setInspectionFlag("Y");
|
||||
pushDto.getContent().getLineVOList().add(srmItem);
|
||||
});
|
||||
|
|
@ -475,7 +477,7 @@ public class NormalPGIController extends BaseController {
|
|||
srmItem.setSerialNum("");
|
||||
srmItem.setLineNumber(Integer.valueOf(item.getLineNumber()));
|
||||
srmItem.setNoteNum(item.getNoteNum());
|
||||
srmItem.setReceivedDate(DateTime.now());
|
||||
srmItem.setReceivedDate(DateTimeUtil.format(LocalDate.now(), "yyyy-MM-dd"));
|
||||
srmItem.setInspectionFlag("Y");
|
||||
pushDto.getContent().getLineVOList().add(srmItem);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.admin.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
|
@ -32,6 +33,10 @@ public class SAPMaterialInfoInOrderDTO {
|
|||
*/
|
||||
private String ebelp;
|
||||
|
||||
public String getEbelp() {
|
||||
return StrUtil.removeAllPrefix(ebelp, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
package com.nflg.wms.admin.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.nflg.wms.admin.pojo.document.SrmMaterialReceiptScanCodes;
|
||||
import com.nflg.wms.admin.pojo.dto.QCMaterialSyncDTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17DTO;
|
||||
|
|
@ -29,7 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -243,7 +240,6 @@ public class NormalPGIControllerService {
|
|||
if (CollectionUtil.isNotEmpty(srmMaterialReceiptScanCodes)) {
|
||||
srmMaterialReceiptCanCodesRepository.insert(srmMaterialReceiptScanCodes);
|
||||
}
|
||||
/** 调试暂时关闭
|
||||
if (CollectionUtil.isNotEmpty(qcMaterialSyncDTOS)) {
|
||||
for (QCMaterialSyncDTO dto : qcMaterialSyncDTOS) {
|
||||
//导入SAP
|
||||
|
|
@ -264,7 +260,6 @@ public class NormalPGIControllerService {
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
@ -326,6 +321,8 @@ public class NormalPGIControllerService {
|
|||
String token = GetSRMToken();
|
||||
VUtil.trueThrowBusinessError(token.trim().isEmpty()).throwMessage("获取SRM的TOKEN失败");
|
||||
|
||||
log.info("收货单推送SRM数据:" + JSONUtil.toJsonStr(request));
|
||||
|
||||
// 构建HTTP请求头信息
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import jakarta.annotation.Resource;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -23,24 +22,23 @@ public class SAPCommonService {
|
|||
|
||||
public SAPSyncParamsDTO getMaterialInfoInOrder(String orderNo, String supplierNo, String materialNo) {
|
||||
|
||||
SAPSyncParamsDTO dto = new SAPSyncParamsDTO();
|
||||
dto.setMaktx("物料描述");
|
||||
dto.setEbelp("1");
|
||||
dto.setMatnr(materialNo);
|
||||
dto.setMenge(new BigDecimal(100));
|
||||
dto.setWemng(new BigDecimal(10));
|
||||
dto.setMeins("PC");
|
||||
dto.setEbeln(orderNo);
|
||||
dto.setTransportNum(new BigDecimal(80));
|
||||
dto.setMatkl("物料组");
|
||||
dto.setWgbez("物料描述");
|
||||
dto.setWerks("1010");
|
||||
dto.setLbprt("1");
|
||||
dto.setKzkri("");
|
||||
dto.setWarehouseNo("122222");
|
||||
dto.setBinNos("2121");
|
||||
return dto;
|
||||
/**
|
||||
// SAPSyncParamsDTO dto = new SAPSyncParamsDTO();
|
||||
// dto.setMaktx("物料描述");
|
||||
// dto.setEbelp("1");
|
||||
// dto.setMatnr(materialNo);
|
||||
// dto.setMenge(new BigDecimal(100));
|
||||
// dto.setWemng(new BigDecimal(10));
|
||||
// dto.setMeins("PC");
|
||||
// dto.setEbeln(orderNo);
|
||||
// dto.setTransportNum(new BigDecimal(80));
|
||||
// dto.setMatkl("物料组");
|
||||
// dto.setWgbez("物料描述");
|
||||
// dto.setWerks("1010");
|
||||
// dto.setLbprt("1");
|
||||
// dto.setKzkri("");
|
||||
// dto.setWarehouseNo("122222");
|
||||
// dto.setBinNos("2121");
|
||||
// return dto;
|
||||
//获取订单信息
|
||||
SAPMaterialInfoInOrderDTO materialInfoInOrder = CollectionUtil.get(sapService.zim004(orderNo, supplierNo, materialNo), 0);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(materialInfoInOrder)).throwMessage("无法获取到有效订单信息" + orderNo);
|
||||
|
|
@ -73,7 +71,6 @@ public class SAPCommonService {
|
|||
syncParams.setBinNos(dbWarehouse.getBinNos());
|
||||
}
|
||||
return syncParams;
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -316,7 +316,10 @@ public class SapService {
|
|||
.throwMessage("SAP错误:" + structure.getString("MSG"));
|
||||
|
||||
JCoTable table = function.getTableParameterList().getTable("T_OUT");
|
||||
return JCoUtil.toBeanList(table, SAPMaterialInfoInOrderDTO.class);
|
||||
log.info("SAP返回: {}", table);
|
||||
List<SAPMaterialInfoInOrderDTO> datas = JCoUtil.toBeanList(table, SAPMaterialInfoInOrderDTO.class);
|
||||
log.debug("数据:{}", JSONUtil.toJsonStr(datas));
|
||||
return datas;
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
@ -774,6 +777,9 @@ public class SapService {
|
|||
// 调用SAP RFC函数
|
||||
JCoFunction function = exec("ZWM3A09", parameters, tables);
|
||||
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(function.getExportParameterList().getString("E_TYPE"), "S"))
|
||||
.throwMessage(function.getExportParameterList().getString("E_MSG"));
|
||||
|
||||
// 处理返回的OUTPUT1表数据
|
||||
JCoTable tOut = function.getTableParameterList().getTable("OUTPUT1");
|
||||
log.info("SAP返回: {}", tOut);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
|
@ -37,10 +37,7 @@ public class DepartmentMaterialRequisitionDTO {
|
|||
private String bdter;
|
||||
|
||||
public String getBdter() {
|
||||
if (NumberUtil.isNumber(bdter)) {
|
||||
return DateTimeUtil.formatFromMillis(bdter);
|
||||
}
|
||||
return bdter;
|
||||
return DateTimeUtil.formatFromMillis(bdter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -88,6 +85,10 @@ public class DepartmentMaterialRequisitionDTO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本计量单位
|
||||
*/
|
||||
|
|
@ -141,6 +142,6 @@ public class DepartmentMaterialRequisitionDTO {
|
|||
private String key1;
|
||||
|
||||
public String getKey1() {
|
||||
return werks + "|" + getBdter() + "|" + aufnr + "|" + bwart + "|" + rsnum + "|" + mblnr + "|" + kostl;
|
||||
return werks + "|" + getBdter() + "|" + aufnr + "|" + bwart + "|" + getRsnum() + "|" + mblnr + "|" + kostl;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
|
@ -25,6 +27,10 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
*/
|
||||
private String bdter;
|
||||
|
||||
public String getBdter() {
|
||||
return DateTimeUtil.formatFromMillis(bdter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料组
|
||||
*/
|
||||
|
|
@ -60,6 +66,10 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本计量单位
|
||||
*/
|
||||
|
|
@ -97,6 +107,6 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
return this.werks + "|" + this.bdter + "|" + aufnr + "|" + bwart + "|" + rsnum + "|" + kostl + "|" + lgort;
|
||||
return this.werks + "|" + getBdter() + "|" + aufnr + "|" + bwart + "|" + getRsnum() + "|" + kostl + "|" + lgort;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -17,6 +16,6 @@ public class SRMLineVOListItem {
|
|||
private String itemCode;
|
||||
private Integer lineNumber;
|
||||
private String noteNum;
|
||||
private DateTime receivedDate;
|
||||
private String receivedDate;
|
||||
private String inspectionFlag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import com.nflg.wms.common.pojo.qo.SRMOrderReceiveItemQO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SRMOrderReceiveDTO {
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
private String noteNum;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*/
|
||||
private String ouCode;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String iuCode;
|
||||
|
||||
/**
|
||||
* 采购组
|
||||
*/
|
||||
private String purchaseGroup;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private String deliveryNoteDate;
|
||||
|
||||
/**
|
||||
* 运单号
|
||||
*/
|
||||
private String waybillNum;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierNum;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
private List<SRMOrderReceiveItemQO> ResultSet;
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SRMQualityInspectionResultDTO {
|
||||
|
||||
/**
|
||||
* 质检单号
|
||||
*/
|
||||
public String inspectionNum;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
public String factory;
|
||||
|
||||
/**
|
||||
* 送货数量
|
||||
*/
|
||||
public BigDecimal deliveryQty;
|
||||
|
||||
/**
|
||||
* 检验结果
|
||||
*/
|
||||
public String inspectionResult;
|
||||
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
public String itemCode;
|
||||
|
||||
/**
|
||||
* 供应商代码
|
||||
*/
|
||||
public String supplierNum;
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
public String inspectionType;
|
||||
|
||||
/**
|
||||
* 采购单行号
|
||||
*/
|
||||
public String poLineNumber;
|
||||
|
||||
/**
|
||||
* 检验数量
|
||||
*/
|
||||
public BigDecimal inspectionQty;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
public String itemName;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
public String unit;
|
||||
|
||||
/**
|
||||
* 收货仓库
|
||||
*/
|
||||
public String receivedWarehouse;
|
||||
|
||||
/**
|
||||
* 不合格原因
|
||||
*/
|
||||
public String unqualifiedReason;
|
||||
|
||||
/**
|
||||
* 采购订单号
|
||||
*/
|
||||
public String poNum;
|
||||
|
||||
/**
|
||||
* 物料凭证(收货时SAP返回的凭证)
|
||||
*/
|
||||
public String receiveNum;
|
||||
|
||||
/**
|
||||
* 不合格数量
|
||||
*/
|
||||
public BigDecimal unqualifiedQty;
|
||||
|
||||
/**
|
||||
* 合格数量合格数量
|
||||
*/
|
||||
public BigDecimal qualifiedQty;
|
||||
|
||||
/**
|
||||
* 收货时的凭证
|
||||
*/
|
||||
public String materialBatch;
|
||||
|
||||
/**
|
||||
* 收货时的批次
|
||||
*/
|
||||
public String receiveBatchNum;
|
||||
|
||||
/**
|
||||
* 收货时的序列号
|
||||
*/
|
||||
public String serialNum;
|
||||
|
||||
|
||||
/**
|
||||
* 送货单行号
|
||||
*/
|
||||
public String lineNumber;
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
public String noteNum;
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
|
@ -31,6 +33,10 @@ public class TransferOrderDTO {
|
|||
*/
|
||||
private String bdter;
|
||||
|
||||
public String getBdter() {
|
||||
return DateTimeUtil.formatFromMillis(bdter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料组
|
||||
*/
|
||||
|
|
@ -81,6 +87,10 @@ public class TransferOrderDTO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本计量单位
|
||||
*/
|
||||
|
|
@ -135,6 +145,6 @@ public class TransferOrderDTO {
|
|||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
return werks + "|" + rsnum + "|" + bwart + "|" + mblnr + "|" + lgort + "|" + umlgo + "|" + bdter;
|
||||
return werks + "|" + getRsnum() + "|" + bwart + "|" + mblnr + "|" + lgort + "|" + umlgo + "|" + getBdter();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
|
@ -25,6 +26,10 @@ public class OutCostcenterSearchQO extends SearchBaseQO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成本中心
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,5 +65,5 @@ public class SRMOrderReceiveItemQO {
|
|||
/**
|
||||
* 是否质检
|
||||
*/
|
||||
private Boolean isQuality;
|
||||
private String isQuality;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,50 +2,8 @@ package com.nflg.wms.common.pojo.qo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SRMOrderReceiveQO {
|
||||
|
||||
/**
|
||||
* 送货单号
|
||||
*/
|
||||
private String noteNum;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*/
|
||||
private String ouCode;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String iuCode;
|
||||
|
||||
/**
|
||||
* 采购组
|
||||
*/
|
||||
private String purchaseGroup;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private String deliveryNoteDate;
|
||||
|
||||
/**
|
||||
* 运单号
|
||||
*/
|
||||
private String waybillNum;
|
||||
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierNum;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
private List<SRMOrderReceiveItemQO> resultSet;
|
||||
private String jsonstring;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,119 +2,8 @@ package com.nflg.wms.common.pojo.qo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SRMQualityInspectionResult {
|
||||
/**
|
||||
质检单号
|
||||
*/
|
||||
public String inspectionNum;
|
||||
|
||||
/**
|
||||
工厂
|
||||
*/
|
||||
public String factory;
|
||||
|
||||
/**
|
||||
送货数量
|
||||
*/
|
||||
public BigDecimal deliveryQty;
|
||||
|
||||
/**
|
||||
检验结果
|
||||
*/
|
||||
public String inspectionResult;
|
||||
|
||||
/**
|
||||
物料号
|
||||
*/
|
||||
public String itemCode;
|
||||
|
||||
/**
|
||||
供应商代码
|
||||
*/
|
||||
public String supplierNum;
|
||||
|
||||
/**
|
||||
检验类型
|
||||
*/
|
||||
public String inspectionType;
|
||||
|
||||
/**
|
||||
采购单行号
|
||||
*/
|
||||
public String poLineNumber;
|
||||
|
||||
/**
|
||||
检验数量
|
||||
*/
|
||||
public BigDecimal inspectionQty;
|
||||
|
||||
/**
|
||||
物料描述
|
||||
*/
|
||||
public String itemName;
|
||||
|
||||
/**
|
||||
单位
|
||||
*/
|
||||
public String unit;
|
||||
|
||||
/**
|
||||
收货仓库
|
||||
*/
|
||||
public String receivedWarehouse;
|
||||
|
||||
/**
|
||||
不合格原因
|
||||
*/
|
||||
public String unqualifiedReason;
|
||||
|
||||
/**
|
||||
采购订单号
|
||||
*/
|
||||
public String poNum;
|
||||
|
||||
/**
|
||||
物料凭证(收货时SAP返回的凭证)
|
||||
*/
|
||||
public String receiveNum;
|
||||
|
||||
/**
|
||||
不合格数量
|
||||
*/
|
||||
public BigDecimal unqualifiedQty;
|
||||
|
||||
/**
|
||||
合格数量合格数量
|
||||
*/
|
||||
public BigDecimal qualifiedQty;
|
||||
|
||||
/**
|
||||
收货时的凭证
|
||||
*/
|
||||
public String materialBatch;
|
||||
|
||||
/**
|
||||
收货时的批次
|
||||
*/
|
||||
public String receiveBatchNum;
|
||||
|
||||
/**
|
||||
收货时的序列号
|
||||
*/
|
||||
public String serialNum;
|
||||
|
||||
|
||||
/**
|
||||
送货单行号
|
||||
*/
|
||||
public String lineNumber;
|
||||
|
||||
/**
|
||||
送货单号
|
||||
*/
|
||||
public String noteNum;
|
||||
|
||||
private String jsonstring;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -17,9 +17,11 @@ public class SrmMaterialReceiptQO {
|
|||
* 送货单行ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@NotBlank
|
||||
private String noteNum;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
|
@ -15,6 +16,10 @@ public class TransferFactorySearchQO extends SearchBaseQO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 调出仓
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -45,6 +46,10 @@ public class InCostcenterBackInfoVO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成本中心
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -44,6 +45,10 @@ public class InCostcenterBackVO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成本中心
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -99,6 +100,10 @@ public class InProduceBackItemVO {
|
|||
*/
|
||||
private String rsnum2;
|
||||
|
||||
public String getRsnum2() {
|
||||
return StrUtil.removeAllPrefix(rsnum2, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购组
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
|
@ -96,6 +97,10 @@ public class InProduceBackTicketItemVO {
|
|||
*/
|
||||
private String rsnum2;
|
||||
|
||||
public String getRsnum2() {
|
||||
return StrUtil.removeAllPrefix(rsnum2, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购组
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -24,6 +25,10 @@ public class InProduceBackVO {
|
|||
*/
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -26,5 +26,10 @@ public class OutProduce1VO {
|
|||
*/
|
||||
private String ebeln;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
|
||||
private List<OutProduceItemVO> items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
|
@ -18,6 +19,10 @@ public class Zwm3a07VO {
|
|||
//预留/相关需求的编号
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
//物料号
|
||||
private String plnbez;
|
||||
|
||||
|
|
@ -93,6 +98,10 @@ public class Zwm3a07VO {
|
|||
//预留/相关需求的编号
|
||||
private String rsnum2;
|
||||
|
||||
public String getRsnum2() {
|
||||
return StrUtil.removeAllPrefix(rsnum2, "0");
|
||||
}
|
||||
|
||||
//物料描述(短文本)
|
||||
private String maktx2;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
|
@ -16,6 +17,10 @@ public class Zwm3a09VO {
|
|||
//预留/相关需求的编号
|
||||
private String rsnum;
|
||||
|
||||
public String getRsnum() {
|
||||
return StrUtil.removeAllPrefix(rsnum, "0");
|
||||
}
|
||||
|
||||
//物料号
|
||||
private String plnbez;
|
||||
|
||||
|
|
@ -25,6 +30,9 @@ public class Zwm3a09VO {
|
|||
//操作/活动编号
|
||||
private String vornr;
|
||||
|
||||
public String getVornr() {
|
||||
return StrUtil.removeAllPrefix(vornr, "0");
|
||||
}
|
||||
//序列号
|
||||
private String sernr;
|
||||
|
||||
|
|
@ -58,6 +66,10 @@ public class Zwm3a09VO {
|
|||
//预留/相关需求的项目编号
|
||||
private String rspos;
|
||||
|
||||
public String getRspos() {
|
||||
return StrUtil.removeAllPrefix(rspos, "0");
|
||||
}
|
||||
|
||||
//其它预留
|
||||
private BigDecimal sqsl2;
|
||||
|
||||
|
|
@ -91,6 +103,10 @@ public class Zwm3a09VO {
|
|||
//预留/相关需求的编号
|
||||
private String rsnum2;
|
||||
|
||||
public String getRsnum2() {
|
||||
return StrUtil.removeAllPrefix(rsnum2, "0");
|
||||
}
|
||||
|
||||
//物料描述(短文本)
|
||||
private String maktx2;
|
||||
|
||||
|
|
@ -100,6 +116,8 @@ public class Zwm3a09VO {
|
|||
//MRP 控制者(物料计划人)
|
||||
private String dispo;
|
||||
|
||||
private String name1;
|
||||
|
||||
@JsonIgnore
|
||||
private String key2;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nflg.wms.common.util;
|
|||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
@ -77,7 +78,7 @@ public class DateTimeUtil {
|
|||
}
|
||||
|
||||
public static String formatFromMillis(String millis, String format) {
|
||||
if (StrUtil.isBlank(millis)) {
|
||||
if (StrUtil.isBlank(millis) || !NumberUtil.isNumber(millis)) {
|
||||
return millis;
|
||||
}
|
||||
return LocalDateTimeUtil.format(LocalDateTimeUtil.of(Long.parseLong(millis)), format);
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ public class WmsSrmOrder implements Serializable {
|
|||
private String ouCode;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
* 发货日期
|
||||
*/
|
||||
private LocalDateTime deliveryNoteDate;
|
||||
private String deliveryNoteDate;
|
||||
|
||||
/**
|
||||
* 是否已完结
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@
|
|||
<mapper namespace="com.nflg.wms.repository.mapper.WmsPoReceiptItemMapper">
|
||||
|
||||
<select id="getTask" resultType="com.nflg.wms.repository.entity.WmsPoReceipt">
|
||||
select id,in_num,order_no,create_time,create_user_name from wms_po_receipt
|
||||
<where>
|
||||
<if test="orederNo !=null and orederNo !='' ">
|
||||
and ( order_no like #{orederNo} or in_num like #{orederNo} )
|
||||
</if>
|
||||
</where>
|
||||
and is_completed=false
|
||||
order by create_time desc
|
||||
select *
|
||||
from wms_po_receipt
|
||||
where is_completed=false
|
||||
<if test="orederNo !=null and orederNo !='' ">
|
||||
and ( order_no like #{orederNo} or in_num like #{orederNo} )
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -9,14 +9,10 @@
|
|||
create_time,
|
||||
factory_code
|
||||
from wms_qc_receive
|
||||
<where>
|
||||
and is_completed = 0
|
||||
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and ( in_no like concat( '%',#{orderNo},'%') or order_no like concat( '%',#{orderNo},'%') )
|
||||
</if>
|
||||
</where>
|
||||
|
||||
where is_completed = 0
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and ( in_no like concat( '%',#{orderNo},'%') or order_no like concat( '%',#{orderNo},'%') )
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,18 @@
|
|||
<!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.WmsSrmOrderMapper">
|
||||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.SrmOrderVO">
|
||||
select a.id, a.iu_code,a.note_num,a.purchase_group,a.waybill_num,a.supplier_num,a.create_time, a.delivery_note_date
|
||||
,a.ou_code, a.is_completed,
|
||||
b.supplier_name from wms_srm_order a left join user_supplier b on a.supplier_num=b.supplier_code
|
||||
|
||||
select a.*,b.supplier_name
|
||||
from wms_srm_order a left join user_supplier b on a.supplier_num=b.supplier_code
|
||||
<if test="request.noteNum !=null and request.noteNum !='' ">
|
||||
and a.note_num like concat('%', #{request.noteNum}, '%')
|
||||
</if>
|
||||
|
||||
<if test="request.supplierNum !=null and request.supplierNum !='' ">
|
||||
and a.supplier_num =#{request.supplierNum}
|
||||
</if>
|
||||
|
||||
<if test="request.poNum !=null and request.poNum !='' ">
|
||||
and EXISTS (select 1 from wms_srm_order_item where a.id=wms_srm_order_item.order_id and
|
||||
wms_srm_order_item.po_num like concat('%', #{request.poNum}, '%')
|
||||
</if>
|
||||
|
||||
<if test="request.itemCode !=null and request.itemCode !='' ">
|
||||
and EXISTS (select 1 from wms_srm_order_item where a.id=wms_srm_order_item.order_id and
|
||||
wms_srm_order_item.item_code like concat('%', #{request.itemCode}, '%')
|
||||
|
|
@ -26,7 +21,6 @@
|
|||
<if test="request.startDate !=null and request.startDate !='' ">
|
||||
and a.delivery_note_date >= #{request.startDate}
|
||||
</if>
|
||||
|
||||
<if test="request.endDate !=null and request.endDate !='' ">
|
||||
and a.delivery_note_date < #{request.endDate}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.nflg.wms.srm.receive.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.nflg.wms.common.pojo.dto.SRMOrderReceiveDTO;
|
||||
import com.nflg.wms.common.pojo.dto.SRMQualityInspectionResultDTO;
|
||||
import com.nflg.wms.common.pojo.qo.SRMOrderReceiveItemQO;
|
||||
import com.nflg.wms.common.pojo.qo.SRMOrderReceiveQO;
|
||||
import com.nflg.wms.common.pojo.qo.SRMQualityInspectionResult;
|
||||
|
|
@ -20,7 +22,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -58,32 +59,31 @@ public class SRMController extends BaseController {
|
|||
@PostMapping("/SendNFDelivery")
|
||||
public Object receiveOrder(@RequestBody SRMOrderReceiveQO request) {
|
||||
try {
|
||||
WmsSrmOrder order = srmOrderService.lambdaQuery().eq(WmsSrmOrder::getNoteNum, request.getNoteNum()).one();
|
||||
SRMOrderReceiveDTO data = JSONUtil.toBean(request.getJsonstring(), SRMOrderReceiveDTO.class);
|
||||
WmsSrmOrder order = srmOrderService.lambdaQuery().eq(WmsSrmOrder::getNoteNum, data.getNoteNum()).one();
|
||||
if (Objects.isNull(order)) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime deliveryDate = LocalDateTime.parse(request.getDeliveryNoteDate(), formatter);
|
||||
order = new WmsSrmOrder()
|
||||
.setId(IdUtil.getSnowflakeNextId())
|
||||
.setIuCode(request.getIuCode())
|
||||
.setSupplierNum(request.getSupplierNum())
|
||||
.setSupplierName(request.getSupplierName())
|
||||
.setNoteNum(request.getNoteNum())
|
||||
.setWaybillNum(request.getWaybillNum())
|
||||
.setPurchaseGroup(request.getPurchaseGroup())
|
||||
.setOuCode(request.getOuCode())
|
||||
.setDeliveryNoteDate(deliveryDate)
|
||||
.setIuCode(data.getIuCode())
|
||||
.setSupplierNum(data.getSupplierNum())
|
||||
.setSupplierName(data.getSupplierName())
|
||||
.setNoteNum(data.getNoteNum())
|
||||
.setWaybillNum(data.getWaybillNum())
|
||||
.setPurchaseGroup(data.getPurchaseGroup())
|
||||
.setOuCode(data.getOuCode())
|
||||
.setDeliveryNoteDate(data.getDeliveryNoteDate())
|
||||
.setIsCompleted(false)
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
srmOrderService.save(order);
|
||||
}
|
||||
//判断是否存在子集
|
||||
if (CollectionUtil.isNotEmpty(request.getResultSet())) {
|
||||
if (CollectionUtil.isNotEmpty(data.getResultSet())) {
|
||||
List<WmsSrmOrderItem> items = new ArrayList<>();
|
||||
for (SRMOrderReceiveItemQO it : request.getResultSet()) {
|
||||
for (SRMOrderReceiveItemQO it : data.getResultSet()) {
|
||||
WmsSrmOrderItem item = srmOrderItemService.lambdaQuery().eq(WmsSrmOrderItem::getLineNumber, it.getLineNumber())
|
||||
.eq(WmsSrmOrderItem::getNoteNum, request.getNoteNum())
|
||||
.eq(WmsSrmOrderItem::getNoteNum, data.getNoteNum())
|
||||
.one();
|
||||
if (Objects.isNull(item) || item.getNoteNum().equals(null) || item.getNoteNum().equals("")) {
|
||||
if (Objects.isNull(item)) {
|
||||
WmsSrmOrderItem updateItem = new WmsSrmOrderItem()
|
||||
.setId(IdUtil.getSnowflakeNextId())
|
||||
.setOrderId(order.getId())
|
||||
|
|
@ -98,8 +98,8 @@ public class SRMController extends BaseController {
|
|||
.setNoteLineStatus(it.getNoteLineStatus())
|
||||
.setOrderType(it.getOrderType())
|
||||
.setDeliveryQty(it.getDeliveryQty())
|
||||
.setIsQuality(it.getIsQuality())
|
||||
.setNoteNum(request.getNoteNum())
|
||||
.setIsQuality(StrUtil.equalsIgnoreCase(it.getIsQuality(), "Y"))
|
||||
.setNoteNum(data.getNoteNum())
|
||||
.setReceiptQty(new BigDecimal(0));
|
||||
items.add(updateItem);
|
||||
}
|
||||
|
|
@ -121,8 +121,9 @@ public class SRMController extends BaseController {
|
|||
@Transactional
|
||||
@PostMapping("/SendNFInspect")
|
||||
public Object receiveQualityInspection(@RequestBody SRMQualityInspectionResult request) {
|
||||
SRMQualityInspectionResultDTO data = JSONUtil.toBean(request.getJsonstring(), SRMQualityInspectionResultDTO.class);
|
||||
List<WmsSrmQualityInspection> inspects = srmQualityInspectionService.lambdaQuery()
|
||||
.eq(WmsSrmQualityInspection::getInspectionNum, request.getInspectionNum())
|
||||
.eq(WmsSrmQualityInspection::getInspectionNum, data.getInspectionNum())
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(inspects))
|
||||
return 2;
|
||||
|
|
@ -130,39 +131,39 @@ public class SRMController extends BaseController {
|
|||
Integer result = 1;
|
||||
// 找到入库的明细
|
||||
WmsQcReceiveItem receiveItem = qcReceiveItemService.lambdaQuery()
|
||||
.eq(WmsQcReceiveItem::getItemCode, request.getItemCode())
|
||||
.eq(WmsQcReceiveItem::getMaterialDoc, request.getReceiveNum())
|
||||
.eq(WmsQcReceiveItem::getLineNumber, request.getLineNumber())
|
||||
.eq(WmsQcReceiveItem::getNoteNum, request.getNoteNum())
|
||||
.eq(WmsQcReceiveItem::getItemCode, data.getItemCode())
|
||||
.eq(WmsQcReceiveItem::getMaterialDoc, data.getReceiveNum())
|
||||
.eq(WmsQcReceiveItem::getLineNumber, data.getLineNumber())
|
||||
.eq(WmsQcReceiveItem::getNoteNum, data.getNoteNum())
|
||||
.one();
|
||||
if (Objects.isNull(receiveItem)) {
|
||||
log.error("接收到无效的质检信息" + request.getInspectionNum());
|
||||
log.error("接收到无效的质检信息" + data.getInspectionNum());
|
||||
return 2;
|
||||
}
|
||||
|
||||
WmsSrmQualityInspection inspect = new WmsSrmQualityInspection()
|
||||
.setId(IdUtil.getSnowflakeNextId())
|
||||
.setInspectionNum(request.getInspectionNum())
|
||||
.setFactory(request.getFactory())
|
||||
.setDeliveryQty(request.getDeliveryQty())
|
||||
.setInspectionResult(request.getInspectionResult())
|
||||
.setItemCode(request.getItemCode())
|
||||
.setSupplerNum(request.getSupplierNum())
|
||||
.setInspectionType(request.getInspectionType())
|
||||
.setPoLineNumber(String.valueOf(request.getPoLineNumber()))
|
||||
.setInspectionQty(request.getInspectionQty())
|
||||
.setItemName(request.getItemName())
|
||||
.setUnit(request.getUnit())
|
||||
.setReceivedWarehouse(request.getReceivedWarehouse())
|
||||
.setUnqualifiedReason(request.getUnqualifiedReason())
|
||||
.setReceiveNum(request.getReceiveNum())
|
||||
.setPoNum(request.getPoNum())
|
||||
.setUnqualifiedQty(request.getUnqualifiedQty())
|
||||
.setQualifiedQty(request.getQualifiedQty())
|
||||
.setMaterialBatch(request.getMaterialBatch())
|
||||
.setSerialNum(request.getSerialNum())
|
||||
.setLineNumber(request.getLineNumber())
|
||||
.setNoteNum(request.getNoteNum())
|
||||
.setInspectionNum(data.getInspectionNum())
|
||||
.setFactory(data.getFactory())
|
||||
.setDeliveryQty(data.getDeliveryQty())
|
||||
.setInspectionResult(data.getInspectionResult())
|
||||
.setItemCode(data.getItemCode())
|
||||
.setSupplerNum(data.getSupplierNum())
|
||||
.setInspectionType(data.getInspectionType())
|
||||
.setPoLineNumber(String.valueOf(data.getPoLineNumber()))
|
||||
.setInspectionQty(data.getInspectionQty())
|
||||
.setItemName(data.getItemName())
|
||||
.setUnit(data.getUnit())
|
||||
.setReceivedWarehouse(data.getReceivedWarehouse())
|
||||
.setUnqualifiedReason(data.getUnqualifiedReason())
|
||||
.setReceiveNum(data.getReceiveNum())
|
||||
.setPoNum(data.getPoNum())
|
||||
.setUnqualifiedQty(data.getUnqualifiedQty())
|
||||
.setQualifiedQty(data.getQualifiedQty())
|
||||
.setMaterialBatch(data.getMaterialBatch())
|
||||
.setSerialNum(data.getSerialNum())
|
||||
.setLineNumber(data.getLineNumber())
|
||||
.setNoteNum(data.getNoteNum())
|
||||
.setReceiveId(receiveItem.getReceiveId())
|
||||
.setIsIn(false)
|
||||
.setAcceptTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ spring:
|
|||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
name: srm-receive
|
||||
name: srm-receive-local
|
||||
profiles:
|
||||
active: sit
|
||||
config:
|
||||
|
|
|
|||
Loading…
Reference in New Issue