一些优化
This commit is contained in:
parent
95c7809730
commit
55bdb3c95a
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.admin.controller;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||||
|
|
@ -19,10 +20,7 @@ import com.nflg.wms.common.pojo.dto.DepartmentMaterialReturnSlipDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoItemVO;
|
import com.nflg.wms.common.pojo.vo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
|
||||||
import com.nflg.wms.common.pojo.vo.OutProduce1VO;
|
|
||||||
import com.nflg.wms.common.pojo.vo.OutProduceItemVO;
|
|
||||||
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;
|
||||||
import com.nflg.wms.repository.entity.WmsInCostcenterBack;
|
import com.nflg.wms.repository.entity.WmsInCostcenterBack;
|
||||||
|
|
@ -157,6 +155,7 @@ public class InCostCenterBackController extends BaseController {
|
||||||
public ApiResult<OutProduce1VO> getItems(@Valid @RequestParam @NotNull String no) {
|
public ApiResult<OutProduce1VO> getItems(@Valid @RequestParam @NotNull String no) {
|
||||||
WmsInCostcenterBack order = inCostcenterBackService.lambdaQuery().eq(WmsInCostcenterBack::getNo, no).one();
|
WmsInCostcenterBack order = inCostcenterBackService.lambdaQuery().eq(WmsInCostcenterBack::getNo, no).one();
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||||
|
VUtil.trueThrowBusinessError(Objects.equals(order.getState(), 2)).throwMessage("该订单已完成");
|
||||||
List<WmsInCostcenterBackItem> datas = inCostcenterBackItemService.getList(order.getId());
|
List<WmsInCostcenterBackItem> datas = inCostcenterBackItemService.getList(order.getId());
|
||||||
return ApiResult.success(new OutProduce1VO()
|
return ApiResult.success(new OutProduce1VO()
|
||||||
.setId(order.getId())
|
.setId(order.getId())
|
||||||
|
|
@ -175,19 +174,19 @@ public class InCostCenterBackController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交领料物料列表(PDA使用)
|
* 入库(PDA使用)
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("pda/submit")
|
@PostMapping("pda/submit")
|
||||||
public ApiResult<Void> submit(@Valid @RequestBody OutProduceSubmitQO request) {
|
public ApiResult<Void> submit(@Valid @RequestBody OutProduceSubmitQO request) {
|
||||||
WmsInCostcenterBack order = inCostcenterBackService.lambdaQuery().eq(WmsInCostcenterBack::getNo, request.getNo()).one();
|
WmsInCostcenterBack order = inCostcenterBackService.lambdaQuery().eq(WmsInCostcenterBack::getNo, request.getNo()).one();
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||||
|
VUtil.trueThrowBusinessError(Objects.equals(order.getState(), 2)).throwMessage("该订单已完成");
|
||||||
WmsInCostcenterBackTicket ticket = new WmsInCostcenterBackTicket()
|
WmsInCostcenterBackTicket ticket = new WmsInCostcenterBackTicket()
|
||||||
.setNo(NoUtil.getOutProduceTicketNo())
|
.setNo(NoUtil.getOutProduceTicketNo())
|
||||||
.setOrderId(order.getId())
|
.setOrderId(order.getId())
|
||||||
.setCreateBy(UserUtil.getUserName())
|
.setCreateBy(UserUtil.getUserName())
|
||||||
.setCreateTime(LocalDateTime.now());
|
.setCreateTime(LocalDateTime.now());
|
||||||
inCostcenterBackTicketService.save(ticket);
|
|
||||||
List<WmsInCostcenterBackItem> datas = inCostcenterBackItemService.getList(order.getId());
|
List<WmsInCostcenterBackItem> datas = inCostcenterBackItemService.getList(order.getId());
|
||||||
List<InMaterialScanRecord> records = new ArrayList<>();
|
List<InMaterialScanRecord> records = new ArrayList<>();
|
||||||
List<MaterialQRCodeContentDTO> dtos = new ArrayList<>();
|
List<MaterialQRCodeContentDTO> dtos = new ArrayList<>();
|
||||||
|
|
@ -203,20 +202,21 @@ public class InCostCenterBackController extends BaseController {
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseGet(() -> {
|
.orElseGet(() -> {
|
||||||
WmsInCostcenterBackTicketItem ti = new WmsInCostcenterBackTicketItem()
|
WmsInCostcenterBackTicketItem ti = new WmsInCostcenterBackTicketItem()
|
||||||
|
.setId(IdUtil.getSnowflakeNextId())
|
||||||
.setTicketId(ticket.getId())
|
.setTicketId(ticket.getId())
|
||||||
.setOrderItemId(item.getId())
|
.setOrderItemId(item.getId())
|
||||||
.setNum(BigDecimal.ZERO);
|
.setNum(BigDecimal.ZERO);
|
||||||
ticketItems.add(ti);
|
ticketItems.add(ti);
|
||||||
return ti;
|
return ti;
|
||||||
});
|
});
|
||||||
BigDecimal num = item.getBdmng().subtract(item.getNum());
|
|
||||||
VUtil.trueThrowBusinessError(num.compareTo(qrCodeContent.getNum()) < 0)
|
|
||||||
.throwMessage("物料" + materialNo + "的入库数量超出申请数量");
|
|
||||||
item.setLeft(item.getLeft().subtract(qrCodeContent.getNum()));
|
item.setLeft(item.getLeft().subtract(qrCodeContent.getNum()));
|
||||||
|
VUtil.trueThrowBusinessError(item.getLeft().compareTo(BigDecimal.ZERO) < 0)
|
||||||
|
.throwMessage("物料" + materialNo + "的入库数量超出申请数量");
|
||||||
pti.setNum(pti.getNum().add(qrCodeContent.getNum()));
|
pti.setNum(pti.getNum().add(qrCodeContent.getNum()));
|
||||||
records.add(new InMaterialScanRecord()
|
records.add(new InMaterialScanRecord()
|
||||||
.setSource(2)
|
.setSource(2)
|
||||||
.setSourceId(item.getId())
|
.setSourceId(item.getId())
|
||||||
|
.setTicketItemId(pti.getId())
|
||||||
.setMaterialNo(materialNo)
|
.setMaterialNo(materialNo)
|
||||||
.setContent(qrCode)
|
.setContent(qrCode)
|
||||||
.setBatchNo(qrCodeContent.getBatchNo())
|
.setBatchNo(qrCodeContent.getBatchNo())
|
||||||
|
|
@ -265,6 +265,9 @@ public class InCostCenterBackController extends BaseController {
|
||||||
}).toList()
|
}).toList()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
ticket.setDocYear(vo.getEMJahr());
|
||||||
|
ticket.setMatDoc(vo.getEMblnr());
|
||||||
|
inCostcenterBackTicketService.save(ticket);
|
||||||
inCostcenterBackService.lambdaUpdate()
|
inCostcenterBackService.lambdaUpdate()
|
||||||
.set(WmsInCostcenterBack::getSapStatus, true)
|
.set(WmsInCostcenterBack::getSapStatus, true)
|
||||||
.set(WmsInCostcenterBack::getSapError, "")
|
.set(WmsInCostcenterBack::getSapError, "")
|
||||||
|
|
@ -276,6 +279,35 @@ public class InCostCenterBackController extends BaseController {
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索入库单
|
||||||
|
*/
|
||||||
|
@PostMapping("searchTicket")
|
||||||
|
public ApiResult<PageData<InCostcenterBackVO>> searchTicket(@Valid @RequestBody OutCostcenterSearchQO request) {
|
||||||
|
return ApiResult.success(inCostcenterBackTicketService.search(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库单详情
|
||||||
|
*/
|
||||||
|
@GetMapping("getTicketInfo")
|
||||||
|
public ApiResult<InCostcenterBackInfoVO> getTicketInfo(@Valid @RequestParam @NotNull Long id) {
|
||||||
|
InCostcenterBackInfoVO vo = inCostcenterBackTicketService.getInfo(id);
|
||||||
|
VUtil.trueThrowBusinessError(Objects.isNull(vo)).throwMessage("入库单不存在");
|
||||||
|
vo.setItems(Convert.toList(InCostcenterBackInfoItemVO.class, inCostcenterBackTicketItemService.getList(id)));
|
||||||
|
return ApiResult.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库单扫码记录
|
||||||
|
* @param ticketItemId 入库单项ID
|
||||||
|
* @return 扫码记录
|
||||||
|
*/
|
||||||
|
@GetMapping("getScanRecords")
|
||||||
|
public ApiResult<List<InMaterialScanRecord>> getScanRecords(@Valid @RequestParam @NotNull Long ticketItemId) {
|
||||||
|
return ApiResult.success(inMaterialScanRecordRespository.findByTicketItemId(ticketItemId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出退料单
|
* 导出退料单
|
||||||
*/
|
*/
|
||||||
|
|
@ -303,12 +335,12 @@ public class InCostCenterBackController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出退料出货单
|
* 导出退料入库单
|
||||||
*/
|
*/
|
||||||
@GetMapping("exportTicket")
|
@GetMapping("exportTicket")
|
||||||
public void exportTicket(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
public void exportTicket(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
||||||
InCostcenterBackInfoVO order = inCostcenterBackTicketService.getInfo(id);
|
InCostcenterBackInfoVO order = inCostcenterBackTicketService.getInfo(id);
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("退料出库单不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("退料入库单不存在");
|
||||||
order.setNo(order.getTicketNo());
|
order.setNo(order.getTicketNo());
|
||||||
List<WmsInCostcenterBackItem> list = inCostcenterBackTicketItemService.getList(id);
|
List<WmsInCostcenterBackItem> list = inCostcenterBackTicketItemService.getList(id);
|
||||||
// InCostcenterBackInfoVO order = new InCostcenterBackInfoVO();
|
// InCostcenterBackInfoVO order = new InCostcenterBackInfoVO();
|
||||||
|
|
@ -325,6 +357,6 @@ public class InCostCenterBackController extends BaseController {
|
||||||
variables.put("base", base);
|
variables.put("base", base);
|
||||||
variables.put("pages", PdfPageDTO.create(list, 17, new WmsInCostcenterBackItem()));
|
variables.put("pages", PdfPageDTO.create(list, 17, new WmsInCostcenterBackItem()));
|
||||||
String html = ThymeleafUtil.generator("/template/", "成本中心退料单", ".html", variables);
|
String html = ThymeleafUtil.generator("/template/", "成本中心退料单", ".html", variables);
|
||||||
PdfGeneratorUtil.generatePdf("成本中心领料单" + order.getNo(), html, response);
|
PdfGeneratorUtil.generatePdf("成本中心退料入库单" + order.getNo(), html, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||||
|
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
||||||
import com.nflg.wms.admin.service.BinService;
|
import com.nflg.wms.admin.service.BinService;
|
||||||
import com.nflg.wms.admin.service.SapService;
|
import com.nflg.wms.admin.service.SapService;
|
||||||
import com.nflg.wms.admin.util.NoUtil;
|
import com.nflg.wms.admin.util.NoUtil;
|
||||||
|
|
@ -36,8 +38,10 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产订单入库管理
|
* 生产订单入库管理
|
||||||
|
|
@ -82,6 +86,9 @@ public class InProduceOrderController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private IWmsBinService wmsBinService;
|
private IWmsBinService wmsBinService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InMaterialScanRecordRespository inMaterialScanRecordRespository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从SAP查询生产订单信息
|
* 从SAP查询生产订单信息
|
||||||
* @param no 生产订单号
|
* @param no 生产订单号
|
||||||
|
|
@ -210,6 +217,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
vo.setChildren(list.stream()
|
vo.setChildren(list.stream()
|
||||||
.filter(item -> Objects.equals(item.getParentId(), parent.getId()))
|
.filter(item -> Objects.equals(item.getParentId(), parent.getId()))
|
||||||
.map(item -> new InProduceOrderMaterialVO()
|
.map(item -> new InProduceOrderMaterialVO()
|
||||||
|
.setId(item.getId())
|
||||||
.setMaterialNo(item.getMaterialNo())
|
.setMaterialNo(item.getMaterialNo())
|
||||||
.setMaterialDesc(item.getMaterialDesc())
|
.setMaterialDesc(item.getMaterialDesc())
|
||||||
.setUnit(item.getUnit())
|
.setUnit(item.getUnit())
|
||||||
|
|
@ -222,6 +230,16 @@ public class InProduceOrderController extends BaseController {
|
||||||
return ApiResult.success(vo);
|
return ApiResult.success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库单扫码记录
|
||||||
|
* @param itemId 项ID
|
||||||
|
* @return 扫码记录
|
||||||
|
*/
|
||||||
|
@GetMapping("getScanRecords")
|
||||||
|
public ApiResult<List<InMaterialScanRecord>> getScanRecords(@Valid @RequestParam @NotNull Long itemId) {
|
||||||
|
return ApiResult.success(inMaterialScanRecordRespository.findByTicketItemId(itemId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
* @param id 订单ID
|
* @param id 订单ID
|
||||||
|
|
@ -334,9 +352,22 @@ public class InProduceOrderController extends BaseController {
|
||||||
WmsInProduceOrder order = produceOrderService.getByNo(no);
|
WmsInProduceOrder order = produceOrderService.getByNo(no);
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||||
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
||||||
|
if (order.getList()) {
|
||||||
|
list = list.stream()
|
||||||
|
.filter(it -> !Objects.equals(it.getParentId(), 0L))
|
||||||
|
.collect(Collectors.groupingBy(InProduceOrderItemVO::getMaterialNo))
|
||||||
|
.values()
|
||||||
|
.stream().map(it -> {
|
||||||
|
InProduceOrderItemVO vo = it.get(0);
|
||||||
|
vo.setNum(it.stream().map(InProduceOrderItemVO::getNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
vo.setBinNos(binService.getBinNos(vo.getMaterialNo(), vo.getFactoryNo(), vo.getWarehouseNo()));
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
} else {
|
||||||
list.forEach(it -> {
|
list.forEach(it -> {
|
||||||
it.setBinNos(binService.getBinNos(it.getMaterialNo(), it.getFactoryNo(), it.getWarehouseNo()));
|
it.setBinNos(binService.getBinNos(it.getMaterialNo(), it.getFactoryNo(), it.getWarehouseNo()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return ApiResult.success(list);
|
return ApiResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -352,7 +383,20 @@ public class InProduceOrderController extends BaseController {
|
||||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short)0))
|
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short)0))
|
||||||
.throwMessage("该订单非待收货状态");
|
.throwMessage("该订单非待收货状态");
|
||||||
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
||||||
|
if (order.getList()) {
|
||||||
|
list = list.stream()
|
||||||
|
.filter(it -> !Objects.equals(it.getParentId(), 0L))
|
||||||
|
.collect(Collectors.groupingBy(InProduceOrderItemVO::getMaterialNo))
|
||||||
|
.values()
|
||||||
|
.stream().map(it -> {
|
||||||
|
InProduceOrderItemVO vo = it.get(0);
|
||||||
|
vo.setNum(it.stream().map(InProduceOrderItemVO::getNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
vo.setBinNos(binService.getBinNos(vo.getMaterialNo(), vo.getFactoryNo(), vo.getWarehouseNo()));
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
List<String> materialNos = new ArrayList<>();
|
List<String> materialNos = new ArrayList<>();
|
||||||
|
List<InMaterialScanRecord> records = new ArrayList<>();
|
||||||
list.forEach(it->{
|
list.forEach(it->{
|
||||||
BigDecimal num = BigDecimal.ZERO;
|
BigDecimal num = BigDecimal.ZERO;
|
||||||
InProduceOrderReceiveMaterialQO materialQO = request.getItems().stream().filter(q -> StrUtil.equals(q.getMaterialNo(), it.getMaterialNo())).findFirst().orElse(null);
|
InProduceOrderReceiveMaterialQO materialQO = request.getItems().stream().filter(q -> StrUtil.equals(q.getMaterialNo(), it.getMaterialNo())).findFirst().orElse(null);
|
||||||
|
|
@ -364,6 +408,19 @@ public class InProduceOrderController extends BaseController {
|
||||||
if (Objects.nonNull(content.getNum())) {
|
if (Objects.nonNull(content.getNum())) {
|
||||||
num = num.add(content.getNum());
|
num = num.add(content.getNum());
|
||||||
}
|
}
|
||||||
|
records.add(new InMaterialScanRecord()
|
||||||
|
.setSource(4)
|
||||||
|
.setSourceId(it.getId())
|
||||||
|
.setTicketItemId(it.getId())
|
||||||
|
.setMaterialNo(it.getMaterialNo())
|
||||||
|
.setContent(qrCode)
|
||||||
|
.setBatchNo(content.getBatchNo())
|
||||||
|
.setSerialNo(content.getSerialNo())
|
||||||
|
.setUniqNo(content.getUniqNo())
|
||||||
|
.setNum(content.getNum())
|
||||||
|
.setCreateBy(UserUtil.getUserName())
|
||||||
|
.setCreateTime(Instant.now())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (num.compareTo(it.getNum()) != 0) {
|
if (num.compareTo(it.getNum()) != 0) {
|
||||||
materialNos.add(it.getMaterialNo());
|
materialNos.add(it.getMaterialNo());
|
||||||
|
|
@ -399,6 +456,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
.setWarehouseNo(it.getWarehouseNo())
|
.setWarehouseNo(it.getWarehouseNo())
|
||||||
.setBatchNumber(it.getBatchNo())).toList()
|
.setBatchNumber(it.getBatchNo())).toList()
|
||||||
);
|
);
|
||||||
|
inMaterialScanRecordRespository.saveAll(records);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class InMaterialScanRecord {
|
||||||
private BigDecimal num;
|
private BigDecimal num;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 来源,1:生产退料,2:成本中心退料;3:采购退库
|
* 来源,1:生产退料,2:成本中心退料;3:采购退库;4:生产订单入库
|
||||||
*/
|
*/
|
||||||
private Integer source;
|
private Integer source;
|
||||||
|
|
||||||
|
|
@ -83,6 +83,11 @@ public class InMaterialScanRecord {
|
||||||
*/
|
*/
|
||||||
private Long sourceItemId;
|
private Long sourceItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 凭证项ID
|
||||||
|
*/
|
||||||
|
private Long ticketItemId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位
|
* 单位
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ import com.nflg.wms.admin.pojo.document.InMaterialScanRecord;
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface InMaterialScanRecordRespository extends MongoRepository<InMaterialScanRecord, String> {
|
public interface InMaterialScanRecordRespository extends MongoRepository<InMaterialScanRecord, String> {
|
||||||
|
|
||||||
|
List<InMaterialScanRecord> findByTicketItemId(Long ticketItemId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InCostcenterBackVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料单单号
|
||||||
|
*/
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单号
|
||||||
|
*/
|
||||||
|
private String ticketNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂
|
||||||
|
*/
|
||||||
|
private String werks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的需求日期
|
||||||
|
*/
|
||||||
|
private String bdter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private String aufnr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动类型(库存管理)
|
||||||
|
*/
|
||||||
|
private String bwart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预留/相关需求的编号
|
||||||
|
*/
|
||||||
|
private String rsnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成本中心
|
||||||
|
*/
|
||||||
|
private String kostl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成本中心描述
|
||||||
|
*/
|
||||||
|
private String ktext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存地点
|
||||||
|
*/
|
||||||
|
private String lgort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SAP 同步成功或失败
|
||||||
|
*/
|
||||||
|
private Boolean sapStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SAP同步失败原因
|
||||||
|
*/
|
||||||
|
private String sapError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态,0:待上架;1:上架中;2:已上架
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
}
|
||||||
|
|
@ -49,4 +49,14 @@ public class WmsInCostcenterBackTicket implements Serializable {
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料凭证编号
|
||||||
|
*/
|
||||||
|
private String matDoc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料凭证年度
|
||||||
|
*/
|
||||||
|
private String docYear;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
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.OutCostcenterSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackVO;
|
||||||
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,4 +18,6 @@ import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
||||||
public interface WmsInCostcenterBackTicketMapper extends BaseMapper<WmsInCostcenterBackTicket> {
|
public interface WmsInCostcenterBackTicketMapper extends BaseMapper<WmsInCostcenterBackTicket> {
|
||||||
|
|
||||||
InCostcenterBackInfoVO getInfo(Long id);
|
InCostcenterBackInfoVO getInfo(Long id);
|
||||||
|
|
||||||
|
IPage<InCostcenterBackVO> search(OutCostcenterSearchQO request, Page<?> objectPage);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.nflg.wms.repository.service;
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
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.OutCostcenterSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackVO;
|
||||||
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
@ -16,4 +19,6 @@ import jakarta.validation.constraints.NotNull;
|
||||||
public interface IWmsInCostcenterBackTicketService extends IService<WmsInCostcenterBackTicket> {
|
public interface IWmsInCostcenterBackTicketService extends IService<WmsInCostcenterBackTicket> {
|
||||||
|
|
||||||
InCostcenterBackInfoVO getInfo(@Valid @NotNull Long id);
|
InCostcenterBackInfoVO getInfo(@Valid @NotNull Long id);
|
||||||
|
|
||||||
|
IPage<InCostcenterBackVO> search(@Valid OutCostcenterSearchQO request);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.nflg.wms.repository.service.impl;
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nflg.wms.common.pojo.qo.OutCostcenterSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackInfoVO;
|
||||||
|
import com.nflg.wms.common.pojo.vo.InCostcenterBackVO;
|
||||||
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
import com.nflg.wms.repository.entity.WmsInCostcenterBackTicket;
|
||||||
import com.nflg.wms.repository.mapper.WmsInCostcenterBackTicketMapper;
|
import com.nflg.wms.repository.mapper.WmsInCostcenterBackTicketMapper;
|
||||||
import com.nflg.wms.repository.service.IWmsInCostcenterBackTicketService;
|
import com.nflg.wms.repository.service.IWmsInCostcenterBackTicketService;
|
||||||
|
|
@ -21,4 +25,9 @@ public class WmsInCostcenterBackTicketServiceImpl extends ServiceImpl<WmsInCostc
|
||||||
public InCostcenterBackInfoVO getInfo(Long id) {
|
public InCostcenterBackInfoVO getInfo(Long id) {
|
||||||
return baseMapper.getInfo(id);
|
return baseMapper.getInfo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<InCostcenterBackVO> search(OutCostcenterSearchQO request) {
|
||||||
|
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,33 @@
|
||||||
INNER JOIN wms_in_costcenter_back icb ON icbt.order_id=icb."id"
|
INNER JOIN wms_in_costcenter_back icb ON icbt.order_id=icb."id"
|
||||||
WHERE icbt."id"=#{id}
|
WHERE icbt."id"=#{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.InCostcenterBackVO">
|
||||||
|
SELECT icbt.id,icbt."no" AS "ticket_no",icbt.create_by,icbt.create_time,icb.*
|
||||||
|
FROM wms_in_costcenter_back_ticket icbt
|
||||||
|
INNER JOIN wms_in_costcenter_back icb ON icbt.order_id=icb."id"
|
||||||
|
<where>
|
||||||
|
<if test="request.startDate!=null">
|
||||||
|
and icbt.create_time >= #{request.startDate}
|
||||||
|
</if>
|
||||||
|
<if test="request.endDate!=null">
|
||||||
|
and icbt.create_time <= #{request.endDate}
|
||||||
|
</if>
|
||||||
|
<if test="request.no != null and request.no!=''">
|
||||||
|
AND icb."no" LIKE CONCAT('%',#{request.no},'%')
|
||||||
|
</if>
|
||||||
|
<if test="request.aufnr != null and request.aufnr!=''">
|
||||||
|
AND icb."aufnr" LIKE CONCAT('%',#{request.aufnr},'%')
|
||||||
|
</if>
|
||||||
|
<if test="request.werks != null and request.werks!=''">
|
||||||
|
AND icb."werks" LIKE CONCAT('%',#{request.werks},'%')
|
||||||
|
</if>
|
||||||
|
<if test="request.rsnum != null and request.rsnum!=''">
|
||||||
|
AND icb."rsnum" LIKE CONCAT('%',#{request.rsnum},'%')
|
||||||
|
</if>
|
||||||
|
<if test="request.kostl != null and request.kostl!=''">
|
||||||
|
AND icb."kostl" LIKE CONCAT('%',#{request.kostl},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue