Merge remote-tracking branch 'refs/remotes/origin/rakor' into dev_zhangke
This commit is contained in:
commit
e326e5ac14
|
|
@ -64,7 +64,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.17.0</version>
|
<version>2.20.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.idev.excel</groupId>
|
<groupId>cn.idev.excel</groupId>
|
||||||
<artifactId>fastexcel</artifactId>
|
<artifactId>fastexcel</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.retry</groupId>
|
<groupId>org.springframework.retry</groupId>
|
||||||
|
|
@ -143,16 +143,16 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||||
<version>3.50.0</version>
|
<version>3.52.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.github.mwiede</groupId>
|
||||||
<artifactId>jsch</artifactId>
|
<artifactId>jsch</artifactId>
|
||||||
<version>0.1.55</version>
|
<version>2.27.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.nflg.wms.common.pojo.dto.ZWM3A06Input1DTO;
|
||||||
import com.nflg.wms.common.pojo.dto.ZWM3A06Input2DTO;
|
import com.nflg.wms.common.pojo.dto.ZWM3A06Input2DTO;
|
||||||
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
||||||
import com.nflg.wms.common.pojo.qo.zwm3A05QO;
|
import com.nflg.wms.common.pojo.qo.zwm3A05QO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||||
import com.nflg.wms.common.pojo.vo.ZWM3A05VO;
|
import com.nflg.wms.common.pojo.vo.ZWM3A05VO;
|
||||||
import com.nflg.wms.common.util.UserUtil;
|
import com.nflg.wms.common.util.UserUtil;
|
||||||
import com.nflg.wms.common.util.VUtil;
|
import com.nflg.wms.common.util.VUtil;
|
||||||
|
|
@ -106,6 +107,7 @@ public class OutPurchaseController extends BaseController {
|
||||||
item.setId(IdUtil.getSnowflakeNextId());
|
item.setId(IdUtil.getSnowflakeNextId());
|
||||||
item.setOrderId(order.getId());
|
item.setOrderId(order.getId());
|
||||||
item.setNum(BigDecimal.ZERO);
|
item.setNum(BigDecimal.ZERO);
|
||||||
|
if (CollectionUtil.isNotEmpty(it.getQrCodes())) {
|
||||||
it.getQrCodes().forEach(qrCode -> {
|
it.getQrCodes().forEach(qrCode -> {
|
||||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||||
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
||||||
|
|
@ -134,10 +136,13 @@ public class OutPurchaseController extends BaseController {
|
||||||
.setCreateTime(Instant.now())
|
.setCreateTime(Instant.now())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||||
|
.throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||||
VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
.throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||||
if (item.getNum().compareTo(BigDecimal.ZERO) > 0) {
|
|
||||||
items.add(item);
|
items.add(item);
|
||||||
|
if (item.getNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
input1.add(new ZWM3A06Input1DTO()
|
input1.add(new ZWM3A06Input1DTO()
|
||||||
.setEbelp(it.getEbelp())
|
.setEbelp(it.getEbelp())
|
||||||
.setRetpo(it.getRetpo())
|
.setRetpo(it.getRetpo())
|
||||||
|
|
@ -213,7 +218,7 @@ public class OutPurchaseController extends BaseController {
|
||||||
* 搜索列表
|
* 搜索列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("search")
|
@PostMapping("search")
|
||||||
public ApiResult<PageData<WmsOutPurchase>> search(@Valid @RequestBody OutPurchaseSearchQO request) {
|
public ApiResult<PageData<OutPurchaseVO>> search(@Valid @RequestBody OutPurchaseSearchQO request) {
|
||||||
return ApiResult.success(outPurchaseService.search(request));
|
return ApiResult.success(outPurchaseService.search(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,10 @@
|
||||||
<div class="item" th:each="item : ${list}">
|
<div class="item" th:each="item : ${list}">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center"><img alt="" style="height: 100px;margin: 5px;" th:src="${item.qrCode}"/></td>
|
<td style="text-align: center;padding: 5px;">
|
||||||
|
<img alt="" style="height: 100px;" th:src="${item.qrCode}"/>
|
||||||
|
<div th:text="${item.printNo}">20250227100950-0</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span>SAP编码: <span style="display: inline;" th:text="${item.materialNo}"></span></span></td>
|
<td><span>SAP编码: <span style="display: inline;" th:text="${item.materialNo}"></span></span></td>
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">材料调拨单</div>
|
<div class="title">材料调拨单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">外协发料单</div>
|
<div class="title">外协发料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">委外发货清单</div>
|
<div class="title">委外发货清单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">部门退料单</div>
|
<div class="title">部门退料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/><span th:text="${info.no}">ICO2156115651</span>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/><span th:text="${info.no}">ICO2156115651</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">部门领料单</div>
|
<div class="title">部门领料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/><span th:text="${info.no}">ICO2156115651</span>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/><span th:text="${info.no}">ICO2156115651</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">成品/半成品入库单</div>
|
<div class="title">成品/半成品入库单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">补 料 单</div>
|
<div class="title">补 料 单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">生产订单退料单</div>
|
<div class="title">生产订单退料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
<div style="position:relative;">
|
<div style="position:relative;">
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">生产订单发料单</div>
|
<div class="title">生产订单发料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
<div class="package-logo"><img src="../img/logo1.png"/></div>
|
<div class="package-logo"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">生产订单领料单</div>
|
<div class="title">生产订单领料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">采购入(退)库单</div>
|
<div class="title">采购入(退)库单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">转储单</div>
|
<div class="title">转储单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OutPurchaseVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退库单号
|
||||||
|
*/
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购凭证号
|
||||||
|
*/
|
||||||
|
private String ebeln;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商或债权人的帐号
|
||||||
|
*/
|
||||||
|
private String lifnr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商或债权人名称
|
||||||
|
*/
|
||||||
|
private String lifnrName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料凭证编号
|
||||||
|
*/
|
||||||
|
private String matDoc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料凭证年度
|
||||||
|
*/
|
||||||
|
private String docYear;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
package com.nflg.wms.common.pojo.vo;
|
package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
|
@ -56,6 +56,7 @@ public class ZWM3A05ItemVO {
|
||||||
/**
|
/**
|
||||||
* 退货数量
|
* 退货数量
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
private BigDecimal temng;
|
private BigDecimal temng;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,9 +92,14 @@ public class ZWM3A05ItemVO {
|
||||||
/**
|
/**
|
||||||
* 实际退货数量(扫码后计算)
|
* 实际退货数量(扫码后计算)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "实际退货数量不能为空")
|
|
||||||
private BigDecimal num;
|
private BigDecimal num;
|
||||||
|
|
||||||
@NotEmpty(message = "请扫码添加物料")
|
public BigDecimal getNum() {
|
||||||
|
return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二维码列表
|
||||||
|
*/
|
||||||
private List<String> qrCodes = new ArrayList<>();
|
private List<String> qrCodes = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
package com.nflg.wms.repository.mapper;
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.qo.OutPurchaseSearchQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||||
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,4 +16,6 @@ import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||||
* @since 2025
|
* @since 2025
|
||||||
*/
|
*/
|
||||||
public interface WmsOutPurchaseMapper extends BaseMapper<WmsOutPurchase> {
|
public interface WmsOutPurchaseMapper extends BaseMapper<WmsOutPurchase> {
|
||||||
|
|
||||||
|
IPage<OutPurchaseVO> search(OutPurchaseSearchQO request, Page<?> page);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.repository.service;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||||
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
|
@ -16,5 +17,5 @@ import jakarta.validation.Valid;
|
||||||
*/
|
*/
|
||||||
public interface IWmsOutPurchaseService extends IService<WmsOutPurchase> {
|
public interface IWmsOutPurchaseService extends IService<WmsOutPurchase> {
|
||||||
|
|
||||||
IPage<WmsOutPurchase> search(@Valid OutPurchaseSearchQO request);
|
IPage<OutPurchaseVO> search(@Valid OutPurchaseSearchQO request);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
package com.nflg.wms.repository.service.impl;
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||||
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||||
import com.nflg.wms.repository.mapper.WmsOutPurchaseMapper;
|
import com.nflg.wms.repository.mapper.WmsOutPurchaseMapper;
|
||||||
import com.nflg.wms.repository.service.IWmsOutPurchaseService;
|
import com.nflg.wms.repository.service.IWmsOutPurchaseService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 退库-采购中心退库 服务实现类
|
* 退库-采购中心退库 服务实现类
|
||||||
|
|
@ -23,14 +21,7 @@ import java.util.Objects;
|
||||||
public class WmsOutPurchaseServiceImpl extends ServiceImpl<WmsOutPurchaseMapper, WmsOutPurchase> implements IWmsOutPurchaseService {
|
public class WmsOutPurchaseServiceImpl extends ServiceImpl<WmsOutPurchaseMapper, WmsOutPurchase> implements IWmsOutPurchaseService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<WmsOutPurchase> search(OutPurchaseSearchQO request) {
|
public IPage<OutPurchaseVO> search(OutPurchaseSearchQO request) {
|
||||||
return lambdaQuery()
|
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||||
.eq(StrUtil.isNotBlank(request.getNo()), WmsOutPurchase::getNo, request.getNo())
|
|
||||||
.eq(StrUtil.isNotBlank(request.getEbeln()), WmsOutPurchase::getEbeln, request.getEbeln())
|
|
||||||
.eq(StrUtil.isNotBlank(request.getLifnr()), WmsOutPurchase::getLifnr, request.getLifnr())
|
|
||||||
.ge(Objects.nonNull(request.getStartDate()), WmsOutPurchase::getCreateTime, request.getStartDate())
|
|
||||||
.le(Objects.nonNull(request.getEndDate()), WmsOutPurchase::getCreateTime, request.getEndDate())
|
|
||||||
.orderByDesc(WmsOutPurchase::getId)
|
|
||||||
.page(new Page<>(request.getPage(), request.getPageSize()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,27 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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.WmsOutPurchaseMapper">
|
<mapper namespace="com.nflg.wms.repository.mapper.WmsOutPurchaseMapper">
|
||||||
|
|
||||||
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.OutPurchaseVO">
|
||||||
|
select op.*,us.supplier_name as "lifnr_name"
|
||||||
|
from wms_out_purchase op
|
||||||
|
left join user_supplier us on op.lifnr=us.supplier_code
|
||||||
|
<where>
|
||||||
|
<if test="request.startDate != null">
|
||||||
|
and op.create_time >= #{request.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="request.endDate != null">
|
||||||
|
and op.create_time <= #{request.endDate}
|
||||||
|
</if>
|
||||||
|
<if test="request.no!=null and request.no!=''">
|
||||||
|
and op."no" ilike concat('%', #{request.no}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="request.ebeln!=null and request.ebeln!=''">
|
||||||
|
and op.ebeln ilike concat('%', #{request.ebeln}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="request.lifnr!=null and request.lifnr!=''">
|
||||||
|
and op.lifnr ilike concat('%', #{request.lifnr}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@
|
||||||
and latest=true
|
and latest=true
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY id DESC
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getHistory" resultType="com.nflg.wms.common.pojo.vo.PackageVO">
|
<select id="getHistory" resultType="com.nflg.wms.common.pojo.vo.PackageVO">
|
||||||
select id,"no","order_no","name",drawing_no,weight,cate,eco,version,remark,enable,create_by,create_time,update_by,update_time,get_modelnos(model_ids) as "modelNos"
|
select id,"no","order_no","name",drawing_no,weight,cate,eco,version,remark,enable,create_by,create_time,update_by,update_time,get_modelnos(model_ids) as "modelNos"
|
||||||
from wms_structural_package
|
from wms_structural_package
|
||||||
where no=#{no}
|
where no=#{no}
|
||||||
order by id desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.PackageVO">
|
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.PackageVO">
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM wms_structural_package
|
FROM wms_structural_package
|
||||||
WHERE "no"=#{materialNo}
|
WHERE "no"=#{materialNo}
|
||||||
ORDER BY id DESC
|
ORDER BY create_time DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.nflg.wms.starter.config;
|
package com.nflg.wms.starter.config;
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
import com.fasterxml.jackson.databind.*;
|
import com.fasterxml.jackson.databind.*;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
@ -27,14 +29,15 @@ public class JacksonConfig {
|
||||||
public ObjectMapper objectMapper() {
|
public ObjectMapper objectMapper() {
|
||||||
return new ObjectMapper()
|
return new ObjectMapper()
|
||||||
.registerModule(new JavaTimeModule())
|
.registerModule(new JavaTimeModule())
|
||||||
.registerModule(customDateTimeModule())
|
.registerModule(dateTimeModule())
|
||||||
.registerModule(bigDecimalModule())
|
.registerModule(bigDecimalModule())
|
||||||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
.registerModule(stringModule())
|
||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||||
.configure(SerializationFeature.INDENT_OUTPUT, false);
|
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||||
|
.disable(SerializationFeature.INDENT_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SimpleModule customDateTimeModule() {
|
private SimpleModule dateTimeModule() {
|
||||||
SimpleModule module = new SimpleModule();
|
SimpleModule module = new SimpleModule();
|
||||||
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||||
module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||||
|
|
@ -52,6 +55,12 @@ public class JacksonConfig {
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SimpleModule stringModule() {
|
||||||
|
SimpleModule module = new SimpleModule();
|
||||||
|
module.addDeserializer(String.class, new TrimStringDeserializer());
|
||||||
|
return module;
|
||||||
|
}
|
||||||
|
|
||||||
public static class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> {
|
public static class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> {
|
||||||
@Override
|
@Override
|
||||||
public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers)
|
public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers)
|
||||||
|
|
@ -64,4 +73,15 @@ public class JacksonConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去除字符串首尾空格
|
||||||
|
*/
|
||||||
|
public static class TrimStringDeserializer extends JsonDeserializer<String> {
|
||||||
|
@Override
|
||||||
|
public String deserialize(JsonParser p, DeserializationContext ctxt)
|
||||||
|
throws IOException {
|
||||||
|
return StrUtil.trim(p.getValueAsString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -37,7 +37,7 @@
|
||||||
<sa-token.version>1.42.0</sa-token.version>
|
<sa-token.version>1.42.0</sa-token.version>
|
||||||
<mybatis-plus.version>3.5.12</mybatis-plus.version>
|
<mybatis-plus.version>3.5.12</mybatis-plus.version>
|
||||||
<!-- <mysql-connector.version>8.4.0</mysql-connector.version>-->
|
<!-- <mysql-connector.version>8.4.0</mysql-connector.version>-->
|
||||||
<postgresql.version>42.7.5</postgresql.version>
|
<postgresql.version>42.7.7</postgresql.version>
|
||||||
<oss.version>3.17.4</oss.version>
|
<oss.version>3.17.4</oss.version>
|
||||||
<minio.version>8.5.17</minio.version>
|
<minio.version>8.5.17</minio.version>
|
||||||
<spring-boot-starter-actuator.version>3.4.0</spring-boot-starter-actuator.version>
|
<spring-boot-starter-actuator.version>3.4.0</spring-boot-starter-actuator.version>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue