同步BUG修复

This commit is contained in:
dengjun 2024-03-01 17:19:35 +08:00
parent 9bf5504fbf
commit bdf6232e15
3 changed files with 12 additions and 9 deletions

View File

@ -1312,6 +1312,12 @@ public class ExportInHandler implements BaseHandler {
@ApiOperation("整船审核") @ApiOperation("整船审核")
@PostMapping("/check/voyage") @PostMapping("/check/voyage")
public Result<String> checkVoyage(@RequestBody @Validated(ValidationGroup.insert.class) VoyageAuditVo check) throws Exception { public Result<String> checkVoyage(@RequestBody @Validated(ValidationGroup.insert.class) VoyageAuditVo check) throws Exception {
// 待审核的数据
List<CustomerExportIn> list = customerExportInService.lambdaQuery()
.eq(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT)
.eq(CustomerExportIn::getShipId, check.getShipId())
.eq(CustomerExportIn::getVoyageId, check.getVoyageId()).list();
boolean row = customerExportInService.lambdaUpdate() boolean row = customerExportInService.lambdaUpdate()
.set(CustomerExportIn::getCheckManId, UserContext.getUser().getUserId()) .set(CustomerExportIn::getCheckManId, UserContext.getUser().getUserId())
.set(CustomerExportIn::getCheckTime, new Date()) .set(CustomerExportIn::getCheckTime, new Date())
@ -1323,15 +1329,6 @@ public class ExportInHandler implements BaseHandler {
.update(); .update();
if (row) { if (row) {
List<CustomerExportIn> list = customerExportInService.lambdaQuery()
.eq(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT)
.eq(CustomerExportIn::getShipId, check.getShipId())
.eq(CustomerExportIn::getVoyageId, check.getVoyageId()).list();
if (check.getCheckStatus() == AuditEnum.AUDIT_PASS) {
customerService.syncAddExportInToOld(list);
}
// 记录日志 // 记录日志
for (CustomerExportIn exportIn : list) { for (CustomerExportIn exportIn : list) {
LogRecordDTO log = new LogRecordDTO(); LogRecordDTO log = new LogRecordDTO();
@ -1343,6 +1340,10 @@ public class ExportInHandler implements BaseHandler {
EsLogApprovalUtil.writeLog(log); EsLogApprovalUtil.writeLog(log);
} }
if (check.getCheckStatus() == AuditEnum.AUDIT_PASS) {
customerService.syncAddExportInToOld(list);
}
return ResultUtil.success("success"); return ResultUtil.success("success");
} }

View File

@ -789,6 +789,8 @@ public class CustomerServiceImpl implements CustomerService {
@Async @Async
public void syncAddExportInToOld(List<CustomerExportIn> list) { public void syncAddExportInToOld(List<CustomerExportIn> list) {
log.info("进入同步方法"); log.info("进入同步方法");
log.info("同步配置: " + JSONObject.toJSONString(syncConfig));
log.info("同步原始数据:" + JSONObject.toJSONString(list));
if (!syncConfig.getSync() || CollectionUtils.isEmpty(list)) { // 没有打开同步或列表为空真直接返回 if (!syncConfig.getSync() || CollectionUtils.isEmpty(list)) { // 没有打开同步或列表为空真直接返回
return; return;
} }