Compare commits
8 Commits
afb0b214a9
...
fc3e06863a
| Author | SHA1 | Date |
|---|---|---|
|
|
fc3e06863a | |
|
|
e326e5ac14 | |
|
|
924bf4c5ff | |
|
|
a42df50cd8 | |
|
|
508576debb | |
|
|
13889b2703 | |
|
|
7b76691afa | |
|
|
429a9ed448 |
|
|
@ -64,7 +64,7 @@
|
|||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.20.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
<dependency>
|
||||
<groupId>cn.idev.excel</groupId>
|
||||
<artifactId>fastexcel</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
|
|
@ -143,16 +143,16 @@
|
|||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<version>3.50.0</version>
|
||||
<version>3.52.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<groupId>com.github.mwiede</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
<version>0.1.55</version>
|
||||
<version>2.27.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,235 @@
|
|||
package com.nflg.wms.admin.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.wms.admin.util.PdfGeneratorUtil;
|
||||
import com.nflg.wms.admin.util.QRCodeUtil;
|
||||
import com.nflg.wms.admin.util.ThymeleafUtil;
|
||||
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.BarcodePrintingAddDTO;
|
||||
import com.nflg.wms.common.pojo.dto.DeliverNormalOrderItemDTO;
|
||||
import com.nflg.wms.common.pojo.dto.GongZhuangTaiZhangExcelCheckDTO;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingEditQO;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingIdsQO;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingQO;
|
||||
import com.nflg.wms.common.pojo.qo.SRMOrderSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.BarcodePrintingVO;
|
||||
import com.nflg.wms.common.pojo.vo.SrmOrderVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.EecExcelUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsInProduceOrder;
|
||||
import com.nflg.wms.repository.entity.WmsInProduceOrderItem;
|
||||
import com.nflg.wms.repository.entity.WmsInventoryBarcodePrinting;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryBarcodePrintingService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import com.nflg.wms.starter.annotation.ApiMark;
|
||||
import com.nflg.wms.starter.service.FileUploadService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.ttzero.excel.entity.ListSheet;
|
||||
import org.ttzero.excel.entity.Workbook;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URL;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 库存物料条码打印
|
||||
* @author nflg
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/barcode")
|
||||
public class BarcodePrintingController extends BaseController {
|
||||
@Resource
|
||||
private IWmsInventoryBarcodePrintingService printingService;
|
||||
|
||||
@Resource
|
||||
private FileUploadService fileUploadService;
|
||||
|
||||
private static final DecimalFormat DF = new DecimalFormat("0.00");
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@PostMapping("search")
|
||||
@ApiMark(moduleName = "仓储物流打印", apiName = "打印记录")
|
||||
public ApiResult<PageData<BarcodePrintingVO>> search(@Valid @RequestBody BarcodePrintingQO request) {
|
||||
return ApiResult.success(printingService.search(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量获取编辑内容,可多选
|
||||
*/
|
||||
@PostMapping("items")
|
||||
@ApiMark(moduleName = "仓储物流打印", apiName = "获取编辑记录")
|
||||
public ApiResult<List<BarcodePrintingVO>> getItems(@Valid @RequestBody BarcodePrintingIdsQO request) {
|
||||
List<WmsInventoryBarcodePrinting> items = printingService.listByIds(request.getIds());
|
||||
List<BarcodePrintingVO> vos = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(items)) {
|
||||
vos = Convert.toList(BarcodePrintingVO.class, items);
|
||||
}
|
||||
return ApiResult.success(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
@ApiMark(moduleName = "仓储物流打印", apiName = "批量删除记录")
|
||||
public ApiResult<Void> deleteBarcodes(@Valid @RequestBody BarcodePrintingIdsQO request) {
|
||||
if (CollectionUtil.isEmpty(request.getIds())) {
|
||||
VUtil.trueThrowBusinessError(true).throwMessage("没有需要删除的数据");
|
||||
}
|
||||
printingService.removeByIds(request.getIds());
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@PostMapping("save")
|
||||
@ApiMark(moduleName = "仓储物流打印", apiName = "保存记录")
|
||||
public ApiResult<Void> saveBarcodes(@Valid @RequestBody List<BarcodePrintingEditQO> request) {
|
||||
//修改
|
||||
if (CollectionUtil.isEmpty(request)) {
|
||||
VUtil.trueThrowBusinessError(true).throwMessage("没有需要保存的数据");
|
||||
}
|
||||
List<WmsInventoryBarcodePrinting> items = Convert.toList(WmsInventoryBarcodePrinting.class, request);
|
||||
printingService.saveOrUpdateBatch(items);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入物料清单
|
||||
* @param file 文件
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("import")
|
||||
public ApiResult importFromExcel(@RequestParam(value = "file") MultipartFile file) throws IOException {
|
||||
List<BarcodePrintingAddDTO> data = EecExcelUtil.getExcelContext(file.getInputStream(), BarcodePrintingAddDTO.class);
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(data)).throwMessage("导入文件内容为空");
|
||||
// 检查
|
||||
List<WmsInventoryBarcodePrinting> codes = new ArrayList<>();
|
||||
|
||||
for (BarcodePrintingAddDTO item : data) {
|
||||
StringBuilder errorBuild = new StringBuilder();
|
||||
if (StrUtil.isBlank(item.getMaterialNo())) {
|
||||
errorBuild.append("物料编号必填");
|
||||
}
|
||||
if (StrUtil.isBlank(item.getMaterialDes())) {
|
||||
errorBuild.append("物料描述必填");
|
||||
}
|
||||
if (StrUtil.isBlank(item.getUnit())) {
|
||||
errorBuild.append("单位必填");
|
||||
}
|
||||
if (item.getQty() == null || item.getQty().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
errorBuild.append("数量必填");
|
||||
}
|
||||
if (item.getPackingNum() == null || item.getPackingNum().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
errorBuild.append("最小包装量必填");
|
||||
}
|
||||
if (errorBuild.length() > 0) {
|
||||
item.setError(errorBuild.toString());
|
||||
} else {
|
||||
codes.add(Convert.convert(WmsInventoryBarcodePrinting.class, item));
|
||||
}
|
||||
}
|
||||
if (data.stream().noneMatch(it -> StrUtil.isNotBlank(it.getError()))
|
||||
&& CollectionUtil.isNotEmpty(codes)
|
||||
) {
|
||||
printingService.saveBatch(codes);
|
||||
return ApiResult.success();
|
||||
} else {
|
||||
try (ByteArrayOutputStream osOut = new ByteArrayOutputStream()) {
|
||||
new Workbook()
|
||||
.addSheet(new ListSheet<>(data))
|
||||
.writeTo(osOut);
|
||||
try (ByteArrayInputStream isIn = new ByteArrayInputStream(osOut.toByteArray())) {
|
||||
return ApiResult.error(STATE.DataNoCheckPass, "导入文件失败", fileUploadService.upload("temp/" + DateTimeUtil.format(LocalDate.now(), "yyyyMMdd") + "/" + IdUtil.fastUUID() + ".xlsx", isIn, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return ApiResult.error(STATE.BusinessError, "保存文件出错");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String generateQRContent(DeliverNormalOrderItemDTO order, String indexNo) {
|
||||
String content = StrUtil.format("{}${}${}${}${}${}${}${}"
|
||||
, order.getPrintNo(), order.getExternalOrderNo(), order.getRowNo(), order.getMaterialNo(), order.getPrintNum()
|
||||
, order.getMaterialDesc(), order.getBatchNo(), Optional.ofNullable(indexNo).orElse(""));
|
||||
log.debug("二维码内容:" + content);
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料条码pdf(整张或者一张一个)
|
||||
* @param request 打印IDs
|
||||
* @param type 1:逐个,2:一页
|
||||
*/
|
||||
@PostMapping("exportMaterialsPdf")
|
||||
public void exportMaterials(HttpServletResponse response, @Valid @RequestParam @NotNull BarcodePrintingIdsQO request, @Valid @RequestParam @NotNull Integer type) throws Exception {
|
||||
List<WmsInventoryBarcodePrinting> codelist = printingService.listByIds(request.getIds());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(codelist)).throwMessage("订单不存在");
|
||||
List<DeliverNormalOrderItemDTO> datas = new ArrayList<>();
|
||||
// Integer i = 1;
|
||||
for (WmsInventoryBarcodePrinting item : codelist) {
|
||||
DeliverNormalOrderItemDTO dto = new DeliverNormalOrderItemDTO();
|
||||
dto.setMaterialNo(item.getMaterialNo());
|
||||
dto.setMaterialDesc(item.getMaterialDes());
|
||||
dto.setBatchNo(StrUtil.isBlank(item.getBatchNumber()) ? "" : item.getBatchNumber());
|
||||
dto.setExternalOrderNo("");
|
||||
dto.setRowNo("");
|
||||
if (StrUtil.isNotBlank(item.getSerialNumbers())) {
|
||||
List<String> serialNumbers = StrUtil.split(item.getSerialNumbers(), ",");
|
||||
for (String serialNumber : serialNumbers) {
|
||||
dto.setPrintNo(IdUtil.getSnowflakeNextIdStr());
|
||||
dto.setPrintNum("1");
|
||||
String qCode = QRCodeUtil.generateQRCodeBase64(generateQRContent(dto, serialNumber), 100, 100);
|
||||
dto.setQrCode(qCode);
|
||||
//i += 1;
|
||||
}
|
||||
} else {
|
||||
Integer codeNum = item.getQty().divide(item.getPackingNum(), 0, RoundingMode.UP).intValue();
|
||||
for (int j = 0; j < codeNum; j++) {
|
||||
dto.setPrintNo(IdUtil.getSnowflakeNextIdStr());
|
||||
dto.setPrintNum(item.getPackingNum().toString());
|
||||
String qCode = QRCodeUtil.generateQRCodeBase64(generateQRContent(dto, ""), 100, 100);
|
||||
dto.setQrCode(qCode);
|
||||
}
|
||||
|
||||
}
|
||||
datas.add(dto);
|
||||
}
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("list", datas);
|
||||
if (Objects.equals(type, 1)) {
|
||||
String html = ThymeleafUtil.generator("/template/qrcode/", "Inv-1", ".html", variables);
|
||||
URL baseUrl = new ClassPathResource("template/qrcode/").getURL();
|
||||
PdfGeneratorUtil.generatePdf("库存物料条码(逐个)", html, baseUrl.toString(), response);
|
||||
} else {
|
||||
String html = ThymeleafUtil.generator("/template/qrcode/", "Inv-2", ".html", variables);
|
||||
URL baseUrl = new ClassPathResource("template/qrcode/").getURL();
|
||||
PdfGeneratorUtil.generatePdf("库存物料条码(整张)", html, baseUrl.toString(), response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ public class InProduceOrderController extends BaseController {
|
|||
* @return 订单信息
|
||||
*/
|
||||
@GetMapping("searchFromSAP")
|
||||
public ApiResult<ZWM00MB007DTO> searchFromSAP(@Valid @RequestParam @NotBlank String no){
|
||||
public ApiResult<ZWM00MB007DTO> searchFromSAP(@Valid @RequestParam @NotBlank String no) {
|
||||
return ApiResult.success(sapService.zwm00Mb007(no));
|
||||
// return ApiResult.success(new ZWM00MB007DTO()
|
||||
// .setAufnr(RandomUtil.randomNumbers(10))
|
||||
|
|
@ -153,8 +153,8 @@ public class InProduceOrderController extends BaseController {
|
|||
@Transactional
|
||||
@PostMapping("save")
|
||||
public ApiResult<Long> save(@Valid @RequestBody InProduceOrderSaveQO request) {
|
||||
if (Objects.isNull(request.getId())){
|
||||
WmsInProduceOrder order=new WmsInProduceOrder()
|
||||
if (Objects.isNull(request.getId())) {
|
||||
WmsInProduceOrder order = new WmsInProduceOrder()
|
||||
.setNo(serialNumberControllerService.generateSerialNumber(8))
|
||||
.setOrderNo(request.getAufnr())
|
||||
.setList(request.getList())
|
||||
|
|
@ -162,17 +162,17 @@ public class InProduceOrderController extends BaseController {
|
|||
.setCreateTime(LocalDateTime.now());
|
||||
produceOrderService.save(order);
|
||||
request.setId(order.getId());
|
||||
}else {
|
||||
WmsInProduceOrder order=produceOrderService.getById(request.getId());
|
||||
} else {
|
||||
WmsInProduceOrder order = produceOrderService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(),(short)0))
|
||||
.throwMessage("保存失败:非待收货状态");
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short) 0))
|
||||
.throwMessage("保存失败:非待收货状态");
|
||||
order.setUpdateBy(UserUtil.getUserName());
|
||||
order.setUpdateTime(LocalDateTime.now());
|
||||
produceOrderService.updateById(order);
|
||||
produceOrderItemService.deleteByOrderId(order.getId());
|
||||
}
|
||||
WmsInProduceOrderItem parent=new WmsInProduceOrderItem()
|
||||
WmsInProduceOrderItem parent = new WmsInProduceOrderItem()
|
||||
.setOrderId(request.getId())
|
||||
.setParentId(0L)
|
||||
.setNum(request.getNum())
|
||||
|
|
@ -184,7 +184,7 @@ public class InProduceOrderController extends BaseController {
|
|||
.setOrderNum(request.getPsmng());
|
||||
// .setBatchNo(NoUtil.getBatchNo(""));
|
||||
produceOrderItemService.save(parent);
|
||||
if (request.getList()){
|
||||
if (request.getList()) {
|
||||
List<WmsBom> children = bomService.getChildren(request.getMatnr());
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(children)).throwMessage("请先添加齐套信息");
|
||||
produceOrderItemService.saveBatch(children.stream().map(it -> new WmsInProduceOrderItem()
|
||||
|
|
@ -210,7 +210,7 @@ public class InProduceOrderController extends BaseController {
|
|||
* @return 搜索结果
|
||||
*/
|
||||
@PostMapping("search")
|
||||
public ApiResult<PageData<WmsInProduceOrder>> search(@Valid @RequestBody InProduceOrderSearchQO request){
|
||||
public ApiResult<PageData<WmsInProduceOrder>> search(@Valid @RequestBody InProduceOrderSearchQO request) {
|
||||
return ApiResult.success(produceOrderService.search(request));
|
||||
}
|
||||
|
||||
|
|
@ -220,9 +220,9 @@ public class InProduceOrderController extends BaseController {
|
|||
* @return 列表
|
||||
*/
|
||||
@GetMapping("getList")
|
||||
public ApiResult<InProduceOrderMaterialVO> getList(@Valid @RequestParam @NotNull Long id){
|
||||
List<WmsInProduceOrderItem> list=produceOrderItemService.getByOrderId(id);
|
||||
WmsInProduceOrderItem parent=list.stream().filter(item -> Objects.equals(item.getParentId(), 0L)).findFirst().get();
|
||||
public ApiResult<InProduceOrderMaterialVO> getList(@Valid @RequestParam @NotNull Long id) {
|
||||
List<WmsInProduceOrderItem> list = produceOrderItemService.getByOrderId(id);
|
||||
WmsInProduceOrderItem parent = list.stream().filter(item -> Objects.equals(item.getParentId(), 0L)).findFirst().get();
|
||||
InProduceOrderMaterialVO vo = Convert.convert(InProduceOrderMaterialVO.class, parent);
|
||||
vo.setChildren(list.stream()
|
||||
.filter(item -> Objects.equals(item.getParentId(), parent.getId()))
|
||||
|
|
@ -238,10 +238,10 @@ public class InProduceOrderController extends BaseController {
|
|||
*/
|
||||
@Transactional
|
||||
@GetMapping("delete")
|
||||
public ApiResult<Void> delete(@Valid @RequestParam @NotNull Long id){
|
||||
WmsInProduceOrder order=produceOrderService.getById(id);
|
||||
public ApiResult<Void> delete(@Valid @RequestParam @NotNull Long id) {
|
||||
WmsInProduceOrder order = produceOrderService.getById(id);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(),(short)0))
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short) 0))
|
||||
.throwMessage("删除失败:非待收货状态");
|
||||
produceOrderService.removeById(id);
|
||||
produceOrderItemService.deleteByOrderId(id);
|
||||
|
|
@ -254,7 +254,7 @@ public class InProduceOrderController extends BaseController {
|
|||
* @param type 1:逐个,2:一页
|
||||
*/
|
||||
@GetMapping("exportMaterialsPdf")
|
||||
public void exportMaterials(HttpServletResponse response, @Valid @RequestParam @NotNull Long id,@Valid @RequestParam @NotNull Integer type) throws Exception {
|
||||
public void exportMaterials(HttpServletResponse response, @Valid @RequestParam @NotNull Long id, @Valid @RequestParam @NotNull Integer type) throws Exception {
|
||||
WmsInProduceOrder order = produceOrderService.getById(id);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
List<WmsInProduceOrderItem> list = produceOrderItemService.getByOrderId(id);
|
||||
|
|
@ -284,22 +284,22 @@ public class InProduceOrderController extends BaseController {
|
|||
}
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("list", datas);
|
||||
if (Objects.equals(type,1)) {
|
||||
if (Objects.equals(type, 1)) {
|
||||
String html = ThymeleafUtil.generator("/template/qrcode/", "dp-1", ".html", variables);
|
||||
URL baseUrl = new ClassPathResource("template/qrcode/").getURL();
|
||||
PdfGeneratorUtil.generatePdf("普通物料条码(逐个)", html, baseUrl.toString(), response);
|
||||
}else {
|
||||
} else {
|
||||
String html = ThymeleafUtil.generator("/template/qrcode/", "dp-2", ".html", variables);
|
||||
URL baseUrl = new ClassPathResource("template/qrcode/").getURL();
|
||||
PdfGeneratorUtil.generatePdf("普通物料条码(整张)", html, baseUrl.toString(), response);
|
||||
}
|
||||
}
|
||||
|
||||
private String generateQRContent(DeliverNormalOrderItemDTO order,String indexNo){
|
||||
String content= StrUtil.format("{}${}${}${}${}${}${}${}"
|
||||
, order.getPrintNo(), order.getExternalOrderNo(),order.getRowNo(),order.getMaterialNo(),order.getPrintNum()
|
||||
,order.getMaterialDesc(),order.getBatchNo(),Optional.ofNullable(indexNo).orElse(""));
|
||||
log.debug("二维码内容:"+ content);
|
||||
private String generateQRContent(DeliverNormalOrderItemDTO order, String indexNo) {
|
||||
String content = StrUtil.format("{}${}${}${}${}${}${}${}"
|
||||
, order.getPrintNo(), order.getExternalOrderNo(), order.getRowNo(), order.getMaterialNo(), order.getPrintNum()
|
||||
, order.getMaterialDesc(), order.getBatchNo(), Optional.ofNullable(indexNo).orElse(""));
|
||||
log.debug("二维码内容:" + content);
|
||||
return content;
|
||||
}
|
||||
|
||||
|
|
@ -371,10 +371,10 @@ public class InProduceOrderController extends BaseController {
|
|||
*/
|
||||
@Transactional
|
||||
@PostMapping("receive")
|
||||
public ApiResult<Void> receive(@Valid @RequestBody InProduceOrderReceiveQO request){
|
||||
public ApiResult<Void> receive(@Valid @RequestBody InProduceOrderReceiveQO request) {
|
||||
WmsInProduceOrder order = produceOrderService.getByNo(request.getNo());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short)0))
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short) 0))
|
||||
.throwMessage("该订单非待收货状态");
|
||||
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
||||
if (order.getList()) {
|
||||
|
|
@ -392,7 +392,7 @@ public class InProduceOrderController extends BaseController {
|
|||
List<String> materialNos = new ArrayList<>();
|
||||
List<InMaterialScanRecord> records = new ArrayList<>();
|
||||
List<Zwm00Mb107QO> input1 = new ArrayList<>();
|
||||
list.forEach(it->{
|
||||
list.forEach(it -> {
|
||||
BigDecimal num = BigDecimal.ZERO;
|
||||
InProduceOrderReceiveMaterialQO materialQO = request.getItems().stream().filter(q -> StrUtil.equals(q.getMaterialNo(), it.getMaterialNo())).findFirst().orElse(null);
|
||||
if (Objects.isNull(materialQO)) {
|
||||
|
|
@ -433,11 +433,13 @@ public class InProduceOrderController extends BaseController {
|
|||
materialNos.add(it.getMaterialNo());
|
||||
}
|
||||
//是否更改了储位
|
||||
syncStorage(it, StrUtil.split(materialQO.getBinNos(), "/"));
|
||||
if (Objects.isNull(materialQO.getBinNos())) {
|
||||
syncStorage(it, StrUtil.split(materialQO.getBinNos(), "/"));
|
||||
}
|
||||
}
|
||||
});
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(materialNos))
|
||||
.throwMessage("以下物料的扫码数量与收货数量不一致:"+StrUtil.join(",", materialNos));
|
||||
.throwMessage("以下物料的扫码数量与收货数量不一致:" + StrUtil.join(",", materialNos));
|
||||
inventoryService.in(input1.stream().map(it -> new InventoryDTO()
|
||||
.setMaterialNo(request.getItems().get(0).getMaterialNo())
|
||||
.setNum(it.getPSMNG())
|
||||
|
|
@ -450,7 +452,7 @@ public class InProduceOrderController extends BaseController {
|
|||
Zwm00Mb107DTO dto = sapService.zwm00_mb107(order.getOrderNo(), UserUtil.getUserName(), input1, null);
|
||||
order.setMblnr(dto.getE_MBLNR());
|
||||
order.setMjahr(dto.getE_MJAHR());
|
||||
order.setState((short)1);
|
||||
order.setState((short) 1);
|
||||
order.setUpdateBy(UserUtil.getUserName());
|
||||
order.setUpdateTime(LocalDateTime.now());
|
||||
produceOrderService.updateById(order);
|
||||
|
|
@ -458,6 +460,9 @@ public class InProduceOrderController extends BaseController {
|
|||
}
|
||||
|
||||
private void syncStorage(InProduceOrderItemVO it, Collection<String> binNos) {
|
||||
if(CollectionUtil.isEmpty(binNos))
|
||||
return;
|
||||
|
||||
produceOrderItemService.lambdaUpdate()
|
||||
.set(WmsInProduceOrderItem::getBinNos, StrUtil.join(",", binNos))
|
||||
.eq(WmsInProduceOrderItem::getId, it.getId())
|
||||
|
|
|
|||
|
|
@ -942,7 +942,7 @@ public class NormalPGIController extends BaseController {
|
|||
*/
|
||||
@PostMapping("unscan/task/confirm")
|
||||
@ApiMark(moduleName = "送货单管理", apiName = "普通物料任务上架确认")
|
||||
public ApiResult<Void> takeDeliveryConfirm(@Valid @RequestBody ReceiveQO request) {
|
||||
public ApiResult<Void> takeDeliveryConfirm(@Valid @RequestBody NormalReceiveQO request) {
|
||||
WmsPoReceipt wmsPoReceipt = wmsPoReceiptService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(wmsPoReceipt)).throwMessage("无此任务");
|
||||
VUtil.trueThrowBusinessError(!wmsPoReceipt.getSourceType().equals(1)).throwMessage("不属于无码收货的采购单");
|
||||
|
|
|
|||
|
|
@ -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.qo.OutPurchaseSearchQO;
|
||||
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.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -106,38 +107,42 @@ public class OutPurchaseController extends BaseController {
|
|||
item.setId(IdUtil.getSnowflakeNextId());
|
||||
item.setOrderId(order.getId());
|
||||
item.setNum(BigDecimal.ZERO);
|
||||
it.getQrCodes().forEach(qrCode -> {
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
||||
.throwMessage("物料" + it.getMatnr() + "与二维码不匹配");
|
||||
VUtil.trueThrowBusinessError(!check(dto, it.getCharg(), it.getSernrs()))
|
||||
.throwMessage("物料" + it.getMatnr() + "包含不符合批次号和序列号的扫码记录");
|
||||
item.setNum(item.getNum().add(dto.getNum()));
|
||||
records.add(new OutMaterialScanRecord()
|
||||
.setSource(6)
|
||||
.setSourceId(order.getId())
|
||||
.setSourceItemId(item.getId())
|
||||
.setTicketId(order.getId())
|
||||
.setTicketItemId(item.getId())
|
||||
.setMaterialNo(dto.getMaterialNo())
|
||||
.setContent(qrCode)
|
||||
.setBatchNo(dto.getBatchNo())
|
||||
.setSerialNo(dto.getSerialNo())
|
||||
.setUniqNo(dto.getUniqNo())
|
||||
.setFactoryNo(item.getWerks())
|
||||
.setWarehouseNo(item.getLgort())
|
||||
.setNum(dto.getNum())
|
||||
.setUnit(it.getMeins())
|
||||
.setEbeln(order.getEbeln())
|
||||
.setEbeln(it.getEbelp())
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
.setCreateTime(Instant.now())
|
||||
);
|
||||
});
|
||||
if (CollectionUtil.isNotEmpty(it.getQrCodes())) {
|
||||
it.getQrCodes().forEach(qrCode -> {
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
||||
.throwMessage("物料" + it.getMatnr() + "与二维码不匹配");
|
||||
VUtil.trueThrowBusinessError(!check(dto, it.getCharg(), it.getSernrs()))
|
||||
.throwMessage("物料" + it.getMatnr() + "包含不符合批次号和序列号的扫码记录");
|
||||
item.setNum(item.getNum().add(dto.getNum()));
|
||||
records.add(new OutMaterialScanRecord()
|
||||
.setSource(6)
|
||||
.setSourceId(order.getId())
|
||||
.setSourceItemId(item.getId())
|
||||
.setTicketId(order.getId())
|
||||
.setTicketItemId(item.getId())
|
||||
.setMaterialNo(dto.getMaterialNo())
|
||||
.setContent(qrCode)
|
||||
.setBatchNo(dto.getBatchNo())
|
||||
.setSerialNo(dto.getSerialNo())
|
||||
.setUniqNo(dto.getUniqNo())
|
||||
.setFactoryNo(item.getWerks())
|
||||
.setWarehouseNo(item.getLgort())
|
||||
.setNum(dto.getNum())
|
||||
.setUnit(it.getMeins())
|
||||
.setEbeln(order.getEbeln())
|
||||
.setEbeln(it.getEbelp())
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
.setCreateTime(Instant.now())
|
||||
);
|
||||
});
|
||||
}
|
||||
VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||
VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||
items.add(item);
|
||||
if (item.getNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
items.add(item);
|
||||
input1.add(new ZWM3A06Input1DTO()
|
||||
.setEbelp(it.getEbelp())
|
||||
.setRetpo(it.getRetpo())
|
||||
|
|
@ -213,7 +218,7 @@ public class OutPurchaseController extends BaseController {
|
|||
* 搜索列表
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>普通物料标签</title>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 5mm; /* 关键!清除默认页边距 */
|
||||
}
|
||||
@media print {
|
||||
body {
|
||||
font-size: 9pt;
|
||||
}
|
||||
}
|
||||
body {
|
||||
font-family: SimSun, Arial, sans-serif;
|
||||
font-size: 9pt;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
table {
|
||||
margin: 3px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table, th, td {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.div-with-border {
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 5px;
|
||||
width: 200px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table th:each="item, iterStat : ${list}" th:style="${iterStat.index == 0} ? 'page-break-before: auto;' : 'page-break-before: always;'">
|
||||
<tr>
|
||||
<td style="width: 150px;text-align: center;padding: 5px;">
|
||||
<img height="120" th:src="${item.qrCode}" width="120"/>
|
||||
<div th:text="${item.printNo}">20250227100950-0</div>
|
||||
</td>
|
||||
<td style="width: 200px;text-align: left;vertical-align: top">
|
||||
<div class="title div-with-border"><img alt="logo" height="20" src="../../img/logo2.png" style="margin-right: 5px;" /></div>
|
||||
<div class="div-with-border">SAP编码: <span th:text="${item.materialNo}"></span></div>
|
||||
<div class="div-with-border">名称: <span th:text="${item.materialDesc}"></span></div>
|
||||
<div class="div-with-border">数量: <span th:text="${item.printNum}"></span></div>
|
||||
<div style="padding: 5px;">批次号: <span th:text="${item.batchNo}"></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>普通物料标签</title>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<style>
|
||||
body {
|
||||
font-size: 9px;
|
||||
font-family: SimSun, Arial, sans-serif;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
overflow: hidden; /* 清除浮动 */
|
||||
}
|
||||
|
||||
.item {
|
||||
float: left;
|
||||
width: 23%;
|
||||
box-sizing: border-box;
|
||||
margin: 5px;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* 清除浮动 */
|
||||
.container::after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 100%">
|
||||
<div style="text-align: center">
|
||||
<img alt="" src="../../img/logo1.png" style="width: 300px;" />
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="item" th:each="item : ${list}">
|
||||
<table>
|
||||
<tr>
|
||||
<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>
|
||||
<td><span>SAP编码: <span style="display: inline;" th:text="${item.materialNo}"></span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>名称: <span style="display: inline;" th:text="${item.materialDesc}"></span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>数量: <span style="display: inline;" th:text="${item.printNum}"></span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>批次号: <span style="display: inline;" th:text="${item.batchNo}"></span></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -54,7 +54,10 @@
|
|||
<div class="item" th:each="item : ${list}">
|
||||
<table>
|
||||
<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>
|
||||
<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="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">材料调拨单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">外协发料单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">委外发货清单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -138,7 +138,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">部门退料单</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>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">部门领料单</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>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">成品/半成品入库单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">补 料 单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">生产订单退料单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
<div style="position:relative;">
|
||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">生产订单发料单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@
|
|||
<div class="package-logo"><img src="../img/logo1.png"/></div>
|
||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">生产订单领料单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">采购入(退)库单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
<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>
|
||||
<div class="company-name">福建南方路面机械有限公司</div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">转储单</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingAddQO;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.ttzero.excel.annotation.ExcelColumn;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BarcodePrintingAddDTO extends BarcodePrintingAddQO {
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
@JsonIgnore
|
||||
@ExcelColumn("错误信息")
|
||||
private String error;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.ttzero.excel.annotation.ExcelColumn;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BarcodePrintingAddQO {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@NotBlank
|
||||
@ExcelColumn("物料编号(*)")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@NotBlank
|
||||
@ExcelColumn("物料描述(*)")
|
||||
private String materialDes;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@NotBlank
|
||||
@ExcelColumn("单位(*)")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
@ExcelColumn("数量(*)")
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ExcelColumn("批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 序列号,多个使用,号隔开
|
||||
*/
|
||||
@ExcelColumn("序列号")
|
||||
private String serialNumbers;
|
||||
|
||||
/**
|
||||
* 最小包装量
|
||||
*/
|
||||
@NotNull
|
||||
@ExcelColumn("最小包装量(*)")
|
||||
private BigDecimal packingNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BarcodePrintingEditQO {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDes;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 序列号,多个使用,号隔开
|
||||
*/
|
||||
private String serialNumbers;
|
||||
|
||||
/**
|
||||
* 最小包装量
|
||||
*/
|
||||
private BigDecimal packingNum;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BarcodePrintingIdsQO {
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BarcodePrintingQO extends SearchBaseQO {
|
||||
/**
|
||||
* 物料编号,多个用逗号隔开
|
||||
*/
|
||||
private String materialNos;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDes;
|
||||
|
||||
/**
|
||||
* 批次号 多个用逗号隔开
|
||||
*/
|
||||
private String batchNumbers;
|
||||
|
||||
/**
|
||||
* 序列号,单个输入
|
||||
*/
|
||||
private String serialNumber;
|
||||
}
|
||||
|
|
@ -18,7 +18,6 @@ public class InProduceOrderReceiveMaterialQO {
|
|||
/**
|
||||
* 储位编号列表
|
||||
*/
|
||||
@NotBlank
|
||||
private String binNos;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class NormalReceiveQO {
|
||||
@NotNull
|
||||
private Long id;
|
||||
}
|
||||
|
|
@ -10,3 +10,4 @@ public class ReceiveQO {
|
|||
@NotNull
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BarcodePrintingVO {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDes;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 序列号,多个使用,号隔开
|
||||
*/
|
||||
private String serialNumbers;
|
||||
|
||||
/**
|
||||
* 最小包装量
|
||||
*/
|
||||
private BigDecimal packingNum;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 最后更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
|
|
@ -56,6 +56,7 @@ public class ZWM3A05ItemVO {
|
|||
/**
|
||||
* 退货数量
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal temng;
|
||||
|
||||
/**
|
||||
|
|
@ -91,9 +92,14 @@ public class ZWM3A05ItemVO {
|
|||
/**
|
||||
* 实际退货数量(扫码后计算)
|
||||
*/
|
||||
@NotNull(message = "实际退货数量不能为空")
|
||||
private BigDecimal num;
|
||||
|
||||
@NotEmpty(message = "请扫码添加物料")
|
||||
public BigDecimal getNum() {
|
||||
return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维码列表
|
||||
*/
|
||||
private List<String> qrCodes = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("wms_inventory_barcode_printing")
|
||||
public class WmsInventoryBarcodePrinting implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDes;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 序列号,多个使用,号隔开
|
||||
*/
|
||||
private String serialNumbers;
|
||||
|
||||
/**
|
||||
* 最小包装量
|
||||
*/
|
||||
private BigDecimal packingNum;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 最后更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingQO;
|
||||
import com.nflg.wms.common.pojo.qo.SRMOrderSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.BarcodePrintingVO;
|
||||
import com.nflg.wms.common.pojo.vo.SrmOrderVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventoryBarcodePrinting;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface WmsInventoryBarcodePrintingMapper extends BaseMapper<WmsInventoryBarcodePrinting> {
|
||||
IPage<BarcodePrintingVO> search(BarcodePrintingQO request, Page<?> objectPage);
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||
|
||||
/**
|
||||
|
|
@ -12,4 +16,6 @@ import com.nflg.wms.repository.entity.WmsOutPurchase;
|
|||
* @since 2025
|
||||
*/
|
||||
public interface WmsOutPurchaseMapper extends BaseMapper<WmsOutPurchase> {
|
||||
|
||||
IPage<OutPurchaseVO> search(OutPurchaseSearchQO request, Page<?> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingQO;
|
||||
import com.nflg.wms.common.pojo.vo.BarcodePrintingVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventoryBarcodePrinting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface IWmsInventoryBarcodePrintingService extends IService<WmsInventoryBarcodePrinting> {
|
||||
|
||||
IPage<BarcodePrintingVO> search(@Valid BarcodePrintingQO request);
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.repository.service;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.qo.OutPurchaseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.OutPurchaseVO;
|
||||
import com.nflg.wms.repository.entity.WmsOutPurchase;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
|
|
@ -16,5 +17,5 @@ import jakarta.validation.Valid;
|
|||
*/
|
||||
public interface IWmsOutPurchaseService extends IService<WmsOutPurchase> {
|
||||
|
||||
IPage<WmsOutPurchase> search(@Valid OutPurchaseSearchQO request);
|
||||
IPage<OutPurchaseVO> search(@Valid OutPurchaseSearchQO request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.nflg.wms.repository.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.BarcodePrintingQO;
|
||||
import com.nflg.wms.common.pojo.vo.BarcodePrintingVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventoryBarcodePrinting;
|
||||
import com.nflg.wms.repository.mapper.WmsInventoryBarcodePrintingMapper;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryBarcodePrintingService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Service
|
||||
public class WmsInventoryBarcodePrintingServiceImpl extends ServiceImpl<WmsInventoryBarcodePrintingMapper, WmsInventoryBarcodePrinting> implements IWmsInventoryBarcodePrintingService {
|
||||
|
||||
@Override
|
||||
public IPage<BarcodePrintingVO> search(BarcodePrintingQO request) {
|
||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,15 @@
|
|||
package com.nflg.wms.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.mapper.WmsOutPurchaseMapper;
|
||||
import com.nflg.wms.repository.service.IWmsOutPurchaseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 退库-采购中心退库 服务实现类
|
||||
|
|
@ -23,14 +21,7 @@ import java.util.Objects;
|
|||
public class WmsOutPurchaseServiceImpl extends ServiceImpl<WmsOutPurchaseMapper, WmsOutPurchase> implements IWmsOutPurchaseService {
|
||||
|
||||
@Override
|
||||
public IPage<WmsOutPurchase> search(OutPurchaseSearchQO request) {
|
||||
return lambdaQuery()
|
||||
.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()));
|
||||
public IPage<OutPurchaseVO> search(OutPurchaseSearchQO request) {
|
||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.wms.repository.mapper.WmsInventoryBarcodePrintingMapper">
|
||||
|
||||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.BarcodePrintingVO">
|
||||
SELECT
|
||||
id,
|
||||
material_no,
|
||||
material_des,
|
||||
unit,
|
||||
qty,
|
||||
batch_number,
|
||||
serial_numbers,
|
||||
packing_num,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
FROM
|
||||
wms_inventory_barcode_printing
|
||||
<where>
|
||||
<if test="request != null and request.materialNos != null and request.materialNos != ''">
|
||||
AND material_no IN
|
||||
<foreach item="materialNo" index="index" collection="request.materialNos.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{materialNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request != null and request.batchNumbers != null and request.batchNumbers != ''">
|
||||
AND batch_number IN
|
||||
<foreach item="batchNo" index="index" collection="request.batchNumbers.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{batchNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request != null and request.serialNumber != null and request.serialNumber != ''">
|
||||
AND serial_numbers LIKE CONCAT('%', #{serialNumber}, '%')
|
||||
</if>
|
||||
<if test="request != null and request.materialDes != null and request.materialDes != ''">
|
||||
AND material_des LIKE CONCAT('%', #{request.materialDes}, '%')
|
||||
</if>
|
||||
<if test="request != null and request.startDate != null">
|
||||
AND create_time >= #{request.startDate}
|
||||
</if>
|
||||
<if test="request != null and request.endDate != null">
|
||||
AND create_time <= #{request.endDate}
|
||||
</if>
|
||||
</where>
|
||||
order by
|
||||
id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,4 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.wms.repository.mapper.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>
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@
|
|||
and latest=true
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<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"
|
||||
from wms_structural_package
|
||||
where no=#{no}
|
||||
order by id desc
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.PackageVO">
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
SELECT *
|
||||
FROM wms_structural_package
|
||||
WHERE "no"=#{materialNo}
|
||||
ORDER BY id DESC
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
|||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder
|
||||
.addInclude("user_supplier") //只生成指定表
|
||||
.addInclude("wms_inventory_barcode_printing") //只生成指定表
|
||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.nflg.wms.starter.config;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
|
@ -27,14 +29,15 @@ public class JacksonConfig {
|
|||
public ObjectMapper objectMapper() {
|
||||
return new ObjectMapper()
|
||||
.registerModule(new JavaTimeModule())
|
||||
.registerModule(customDateTimeModule())
|
||||
.registerModule(dateTimeModule())
|
||||
.registerModule(bigDecimalModule())
|
||||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.configure(SerializationFeature.INDENT_OUTPUT, false);
|
||||
.registerModule(stringModule())
|
||||
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||
.disable(SerializationFeature.INDENT_OUTPUT);
|
||||
}
|
||||
|
||||
private SimpleModule customDateTimeModule() {
|
||||
private SimpleModule dateTimeModule() {
|
||||
SimpleModule module = new SimpleModule();
|
||||
module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(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;
|
||||
}
|
||||
|
||||
private SimpleModule stringModule() {
|
||||
SimpleModule module = new SimpleModule();
|
||||
module.addDeserializer(String.class, new TrimStringDeserializer());
|
||||
return module;
|
||||
}
|
||||
|
||||
public static class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> {
|
||||
@Override
|
||||
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>
|
||||
<mybatis-plus.version>3.5.12</mybatis-plus.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>
|
||||
<minio.version>8.5.17</minio.version>
|
||||
<spring-boot-starter-actuator.version>3.4.0</spring-boot-starter-actuator.version>
|
||||
|
|
|
|||
Loading…
Reference in New Issue