fix(销售出货):增加可控过账日期弹窗
This commit is contained in:
parent
ac268862b3
commit
592a66278d
@ -13,8 +13,17 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@Data
|
||||
public class StringWithDateTimeDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 单据号
|
||||
*/
|
||||
private String str;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dateTime;
|
||||
|
||||
/**
|
||||
* 过账日期
|
||||
*/
|
||||
private String postDate;
|
||||
|
||||
}
|
||||
|
||||
@ -809,7 +809,7 @@ public class DocumentController {
|
||||
public R postOutPurchaseReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -820,7 +820,7 @@ public class DocumentController {
|
||||
public R postOutSalesOut(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -831,7 +831,7 @@ public class DocumentController {
|
||||
public R postOutCostCenterReceive(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ public class DocumentController {
|
||||
public R postOutEngineerReceive(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -853,7 +853,7 @@ public class DocumentController {
|
||||
public R postOutRanddReceive(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -864,7 +864,7 @@ public class DocumentController {
|
||||
public R postOutSecrecyReceive(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -875,7 +875,7 @@ public class DocumentController {
|
||||
public R postOutUnplanedStorage(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -886,7 +886,7 @@ public class DocumentController {
|
||||
public R postInUnplannedReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -897,7 +897,7 @@ public class DocumentController {
|
||||
public R postOutScrapOut(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -908,7 +908,7 @@ public class DocumentController {
|
||||
public R postOutInterCompanyStorage(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -919,7 +919,7 @@ public class DocumentController {
|
||||
public R postOutInterCompanyThStorage(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -930,7 +930,7 @@ public class DocumentController {
|
||||
public R postOutStoreReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postOutDocument(site, user, dto.getStr());
|
||||
documentService.postOutDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -943,7 +943,7 @@ public class DocumentController {
|
||||
public R postInProcurementStorage(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ public class DocumentController {
|
||||
public R postInSalesReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -965,7 +965,7 @@ public class DocumentController {
|
||||
public R postInCostCenterReturned(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -976,7 +976,7 @@ public class DocumentController {
|
||||
public R postInEngineerReturned(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -987,7 +987,7 @@ public class DocumentController {
|
||||
public R postInRandReturned(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -998,7 +998,7 @@ public class DocumentController {
|
||||
public R postInSecrecyReturned(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1009,7 +1009,7 @@ public class DocumentController {
|
||||
public R postInInterCompanyReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1020,7 +1020,7 @@ public class DocumentController {
|
||||
public R postInInterCompanyThReturn(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postInDocument(site, user, dto.getStr());
|
||||
documentService.postInDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1032,7 +1032,7 @@ public class DocumentController {
|
||||
public R postTransferStoresRequisition(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1043,7 +1043,7 @@ public class DocumentController {
|
||||
public R postTransferConvertItem(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1054,7 +1054,7 @@ public class DocumentController {
|
||||
public R postTransferStoresReturned(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1065,7 +1065,7 @@ public class DocumentController {
|
||||
public R postTransferStorRequest(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1076,7 +1076,7 @@ public class DocumentController {
|
||||
public R postTransferLocalTransfer(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1087,7 +1087,7 @@ public class DocumentController {
|
||||
public R postTransferAttributeTransfer(@RequestBody StringWithDateTimeDTO dto) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
documentService.postTransferDocument(site, user, dto.getStr());
|
||||
documentService.postTransferDocument(site, user, dto);
|
||||
return R.ok();
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
@ -293,27 +293,27 @@ public interface DocumentService extends IService<Document> {
|
||||
*
|
||||
* @param site
|
||||
* @param user
|
||||
* @param documentNo
|
||||
* @param dto
|
||||
*/
|
||||
void postOutDocument(String site, String user, String documentNo);
|
||||
void postOutDocument(String site, String user, StringWithDateTimeDTO dto);
|
||||
|
||||
/**
|
||||
* 单据入库过账
|
||||
*
|
||||
* @param site
|
||||
* @param user
|
||||
* @param documentNo
|
||||
* @param dto
|
||||
*/
|
||||
void postInDocument(String site, String user, String documentNo);
|
||||
void postInDocument(String site, String user, StringWithDateTimeDTO dto);
|
||||
|
||||
/**
|
||||
* 单据调拨过账
|
||||
*
|
||||
* @param site
|
||||
* @param user
|
||||
* @param documentNo
|
||||
* @param dto
|
||||
*/
|
||||
void postTransferDocument(String site, String user, String documentNo);
|
||||
void postTransferDocument(String site, String user, StringWithDateTimeDTO dto);
|
||||
|
||||
void iqcResultNotice(IqcResultNoticeDto dto);
|
||||
|
||||
|
||||
@ -1905,6 +1905,8 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
document.setDocumentNo(documentNo);
|
||||
document.setCreateDate(now);
|
||||
document.setCreateUser(user);
|
||||
// 保存OA审批状态
|
||||
document.setCustomer(document.getCustomer());
|
||||
String state = document.getState();
|
||||
for (DocumentDetailed parameter : list) {
|
||||
parameter.setDocumentType(documentType);
|
||||
@ -3418,7 +3420,8 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void postOutDocument(String site, String user, String documentNo) {
|
||||
public void postOutDocument(String site, String user, StringWithDateTimeDTO dto) {
|
||||
String documentNo = dto.getStr();
|
||||
Document document = getDocument(site, documentNo);
|
||||
|
||||
String documentBo = document.getHandle();
|
||||
@ -3487,7 +3490,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
documentSfcService.saveBatch(documentSfcList);
|
||||
updateDocumentAndDetailStatus(user, documentBo, now, Constant.DOCUMENT_STATUS_CLOSE);
|
||||
// FSMM008-1-MES 出库
|
||||
doPostErp(document, site, user, documentNo, "OUT");
|
||||
doPostErp(document, site, user, dto, "OUT");
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("单据状态不允许过账");
|
||||
@ -3495,12 +3498,12 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
}
|
||||
|
||||
// 调拨、出库、入库通用接口
|
||||
public void doPostErp(Document document, String site, String user, String documentNo, String types) {
|
||||
public void doPostErp(Document document, String site, String user, StringWithDateTimeDTO dto, String types) {
|
||||
// 开个后门,如果用指定的账号登录就无需呼叫SAP
|
||||
if("sapCancel".equalsIgnoreCase(SecurityUtils.getUserName())){
|
||||
return;
|
||||
}
|
||||
List<DocumentSfc> documentSfcs = documentSfcService.findDocumentSfcList(site, documentNo);
|
||||
List<DocumentSfc> documentSfcs = documentSfcService.findDocumentSfcList(site, dto.getStr());
|
||||
if (documentSfcs.isEmpty()) {
|
||||
throw BusinessException.build("交货单明细不可为空,无法传送SAP");
|
||||
}
|
||||
@ -3517,7 +3520,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
JSONObject sapJsonBody = assemble0082RequestBody(document, user, documentSfcs);
|
||||
resultMap = remoteFssm0082Service.doExecute(sapJsonBody).getData();
|
||||
} else {
|
||||
JSONObject sapJsonBody = assembleRequestBody(document, user, documentSfcs, types);
|
||||
JSONObject sapJsonBody = assembleRequestBody(document, user, documentSfcs, types, dto.getPostDate());
|
||||
resultMap = remoteFssm0081Service.doExecute(sapJsonBody).getData();
|
||||
}
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
@ -3563,7 +3566,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
return jsonBody;
|
||||
}
|
||||
|
||||
private JSONObject assembleRequestBody(Document document, String user, List<DocumentSfc> documentSfcs, String types) {
|
||||
private JSONObject assembleRequestBody(Document document, String user, List<DocumentSfc> documentSfcs, String types, String postDate) {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
JSONObject jsonHead = new JSONObject();
|
||||
String externalNo = document.getExternalDocumentNo();
|
||||
@ -3577,7 +3580,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
}
|
||||
jsonHead.put("VBELN", document.getExternalDocumentNo());
|
||||
jsonHead.put("ZPARTNER", user);
|
||||
jsonHead.put("WADAT_IST", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
jsonHead.put("WADAT_IST", postDate);
|
||||
jsonHead.put("Z005", filePath);
|
||||
jsonHead.put("BOLNR", deliveryNo); // 物流单号
|
||||
jsonBody.put("IS_HEAD", jsonHead);
|
||||
@ -3620,7 +3623,8 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void postInDocument(String site, String user, String documentNo) {
|
||||
public void postInDocument(String site, String user, StringWithDateTimeDTO dto) {
|
||||
String documentNo = dto.getStr();
|
||||
Document document = getDocument(site, documentNo);
|
||||
|
||||
String documentBo = document.getHandle();
|
||||
@ -3677,7 +3681,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
documentSfcService.saveBatch(documentSfcList);
|
||||
updateDocumentAndDetailStatus(user, documentBo, now, Constant.DOCUMENT_STATUS_CLOSE);
|
||||
// FSMM008-1-MES 入库
|
||||
doPostErp(document, site, user, documentNo, "IN");
|
||||
doPostErp(document, site, user, dto, "IN");
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("单据状态不允许过账");
|
||||
@ -3686,7 +3690,8 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void postTransferDocument(String site, String user, String documentNo) {
|
||||
public void postTransferDocument(String site, String user, StringWithDateTimeDTO dto) {
|
||||
String documentNo = dto.getStr();
|
||||
Document document = getDocument(site, documentNo);
|
||||
|
||||
String documentType = document.getDocumentType();
|
||||
@ -3794,7 +3799,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
.update();
|
||||
}
|
||||
// FSMM008-1-MES
|
||||
doPostErp(document, site, user, documentNo, "MOVE");
|
||||
doPostErp(document, site, user, dto, "MOVE");
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("单据状态不允许过账");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user