feat: 销售出货处理平台路由修改
This commit is contained in:
parent
6c4248f2c6
commit
4d6c7fd52b
@ -12,9 +12,9 @@ import java.time.LocalDateTime;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DocumentNoAndDateTimeDTO {
|
||||
public class StringWithDateTimeDTO {
|
||||
|
||||
String documentNo;
|
||||
private String str;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
LocalDateTime dateTime;
|
||||
private LocalDateTime dateTime;
|
||||
}
|
||||
@ -824,20 +824,20 @@ public class DocumentController {
|
||||
@ApiOperation(value = "无实物过账", notes = "无实物过账")
|
||||
@PostMapping("/noEntity/post")
|
||||
@SysLog("无实物过账")
|
||||
public R noEntityPost(@RequestBody DocumentNoAndDateTimeDTO dto) {
|
||||
public R noEntityPost(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.noEntityPost(site, user, dto.getDocumentNo(), dto.getDateTime());
|
||||
documentService.noEntityPost(site, user, dto.getStr(), dto.getDateTime());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "无实物过账冲销", notes = "无实物过账冲销")
|
||||
@PostMapping("/noEntity/cancel")
|
||||
@SysLog("无实物过账冲销")
|
||||
public R noEntityPostCancel(@RequestBody DocumentNoAndDateTimeDTO dto) {
|
||||
public R noEntityPostCancel(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.noEntityPostCancel(site, user, dto.getDocumentNo(), dto.getDateTime());
|
||||
documentService.noEntityPostCancel(site, user, dto.getStr(), dto.getDateTime());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -928,11 +928,11 @@ public class DocumentController {
|
||||
@ApiOperation(value = "单据拣货清除", notes = "单据拣货清除")
|
||||
@DeleteMapping("/picking/clean")
|
||||
@SysLog("单据拣货清除")
|
||||
public R savePicking(@RequestBody SingleStringDTO dto) {
|
||||
public R cleanPicking(@RequestBody ListWithStringDTO<String> dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.cleanPicking(site, user, dto.getStr());
|
||||
return R.ok();
|
||||
documentService.cleanPicking(site, user, dto.getStr(), dto.getList());
|
||||
return R.ok(true);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单据拒收", notes = "单据拒收")
|
||||
@ -958,7 +958,7 @@ public class DocumentController {
|
||||
@ApiOperation(value = "单据出库过账", notes = "单据出库过账")
|
||||
@PostMapping("/postOut")
|
||||
@SysLog("单据出库过账")
|
||||
public R postOut(@RequestBody SingleStringDTO dto) {
|
||||
public R postOut(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
@ -968,7 +968,7 @@ public class DocumentController {
|
||||
@ApiOperation(value = "单据入库过账", notes = "单据入库过账")
|
||||
@PostMapping("/postIn")
|
||||
@SysLog("单据入库过账")
|
||||
public R postIn(@RequestBody SingleStringDTO dto) {
|
||||
public R postIn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
@ -978,7 +978,7 @@ public class DocumentController {
|
||||
@ApiOperation(value = "单据调拨过账", notes = "单据调拨过账")
|
||||
@PostMapping("/postTransfer")
|
||||
@SysLog("单据调拨过账")
|
||||
public R postTransferDocument(@RequestBody SingleStringDTO dto) {
|
||||
public R postTransferDocument(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
|
||||
@ -245,10 +245,10 @@ public class PickingController {
|
||||
@ApiOperation(value = "销售出货过账", notes = "销售出货过账")
|
||||
@SysLog("销售出货过账")
|
||||
@PostMapping("/saleOut/post")
|
||||
public R saleOutPost(@RequestBody DocumentNoAndDateTimeDTO dto) {
|
||||
public R saleOutPost(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String userName = SecurityUtils.getUserName();
|
||||
pickingService.saleOutPost(site, userName, dto.getDocumentNo(), dto.getDateTime());
|
||||
pickingService.saleOutPost(site, userName, dto.getStr(), dto.getDateTime());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -280,10 +280,10 @@ public class PickingController {
|
||||
@ApiOperation(value = "销售出货过账冲销", notes = "销售出货过账冲销")
|
||||
@SysLog("销售出货过账冲销")
|
||||
@PostMapping("/saleOut/cancel")
|
||||
public R saleOutPostCancel(@RequestBody DocumentNoAndDateTimeDTO dto) {
|
||||
public R saleOutPostCancel(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String userName = SecurityUtils.getUserName();
|
||||
pickingService.saleOutPostCancel(site, userName, dto.getDocumentNo(), dto.getDateTime());
|
||||
pickingService.saleOutPostCancel(site, userName, dto.getStr(), dto.getDateTime());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ -332,8 +332,9 @@ public interface DocumentService extends IService<Document> {
|
||||
* @param site
|
||||
* @param user
|
||||
* @param documentNo
|
||||
* @param seqList
|
||||
*/
|
||||
void cleanPicking(String site, String user, String documentNo);
|
||||
void cleanPicking(String site, String user, String documentNo, List<String> seqList);
|
||||
|
||||
/**
|
||||
* 单据拒收
|
||||
|
||||
@ -6284,11 +6284,11 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanPicking(String site, String user, String documentNo) {
|
||||
public void cleanPicking(String site, String user, String documentNo, List<String> seqList) {
|
||||
Document document = getDocument(site, documentNo);
|
||||
String documentBo = document.getHandle();
|
||||
if (Constant.DOCUMENT_STATUS_PICKING.equals(document.getState()) || Constant.DOCUMENT_STATUS_TBC.equals(document.getState())) {
|
||||
pickingService.lambdaUpdate().eq(Picking::getSite, site).eq(Picking::getDocumentNo, documentNo).remove();
|
||||
pickingService.lambdaUpdate().eq(Picking::getSite, site).eq(Picking::getDocumentNo, documentNo).in(CollectionUtil.isNotEmpty(seqList), Picking::getSeq, seqList).remove();
|
||||
updateDocumentAndDetailStatus(user, documentBo, null, Constant.DOCUMENT_STATUS_SUBMIT);
|
||||
//FSMM007-MES 空
|
||||
} else {
|
||||
@ -6378,7 +6378,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
.set(Inventory::getWmsStorageBinBo, null)
|
||||
.set(Inventory::getQtyOnHand, BigDecimal.ZERO)
|
||||
.set(Inventory::getUpdateTime, now)
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
inventoryLogService.saveBatch(inventoryLogs);
|
||||
|
||||
updatePickingStatus(site, user, documentNo, now, Constant.PICKING_STATUS_CLOSE);
|
||||
@ -6437,7 +6437,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
.set(Inventory::getErpStorageLocation, documentDetailed.getTargetWarehouse())
|
||||
.set(Inventory::getQtyOnHand, picking.getQty())
|
||||
.set(Inventory::getUpdateTime, now)
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
}
|
||||
documentDetailedService.lambdaUpdate().eq(DocumentDetailed::getDocumentBo, documentBo)
|
||||
.set(DocumentDetailed::getActualQuantity, qty).update();
|
||||
@ -6460,7 +6460,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
String documentBo = document.getHandle();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if (Constant.DOCUMENT_STATUS_TBC.equals(document.getState())) {
|
||||
List<Picking> pickingList = pickingService.lambdaQuery().eq(Picking::getSite, site).eq(Picking::getDocumentNo, documentNo).list();
|
||||
List<Picking> pickingList = pickingService.lambdaQuery().eq(Picking::getSite, site).eq(Picking::getDocumentNo, documentNo).list();
|
||||
List<String> inventoryBoList = pickingList.stream().map(o -> Inventory.genHandle(site, o.getInventoryId())).collect(Collectors.toList());
|
||||
List<Inventory> inventories = inventoryService.listByIds(inventoryBoList);
|
||||
if (inventories.size() != pickingList.size()) {
|
||||
@ -6492,11 +6492,11 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
documentSfc.setQualityInspectionStatus(picking.getQualityInspectionStatus());
|
||||
documentSfcList.add(documentSfc);
|
||||
qty = qty.add(picking.getQty());
|
||||
inventoryService.lambdaUpdate().eq(Inventory::getHandle, Inventory.genHandle(site, picking.getInventoryId()))
|
||||
inventoryService.lambdaUpdate().eq(Inventory::getHandle, Inventory.genHandle(site, picking.getInventoryId()))
|
||||
.set(Inventory::getErpStorageLocation, documentDetailed.getTargetWarehouse())
|
||||
.set(Inventory::getWmsStorageBinBo, StrUtil.isNotBlank(documentDetailed.getWmsStorageBinBo()) ? documentDetailed.getWmsStorageBinBo() : null)
|
||||
.set(Inventory::getWmsStorageBinBo, StrUtil.isNotBlank(documentDetailed.getWmsStorageBinBo()) ? documentDetailed.getWmsStorageBinBo() : null)
|
||||
.set(Inventory::getUpdateTime, now)
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
.set(Inventory::getUpdater, user).update();
|
||||
}
|
||||
documentDetailedService.lambdaUpdate().eq(DocumentDetailed::getDocumentBo, documentBo)
|
||||
.set(DocumentDetailed::getActualQuantity, qty).update();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user