3 changed files with 68 additions and 35 deletions
@ -0,0 +1,12 @@
|
||||
package com.logpm.factory.comfac.service; |
||||
|
||||
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity; |
||||
import com.logpm.factory.snm.entity.OrderStatusLog; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface IOrderPackageStatusPushFailLogService extends BaseService<OrderPackageStatusPushFailLogEntity> { |
||||
|
||||
|
||||
void saveOrderPackageStatusFaleLog(String unitNo, String currentWarehouseId, String status,String operationTime, Integer trayId); |
||||
|
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.logpm.factory.comfac.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.factory.comfac.mapper.OrderPackageStatusPushFailLogMapper; |
||||
import com.logpm.factory.comfac.service.IOrderPackageStatusPushFailLogService; |
||||
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.exception.CustomerException; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
public class OrderPackageStatusPushFailLogServiceImpl extends BaseServiceImpl<OrderPackageStatusPushFailLogMapper, OrderPackageStatusPushFailLogEntity> implements IOrderPackageStatusPushFailLogService { |
||||
|
||||
@Override |
||||
public void saveOrderPackageStatusFaleLog(String unitNo, String currentWarehouseId, String status,String operationTime, Integer trayId) { |
||||
log.info("##############dealWithDataHandler: unitNo={} 没有查询到数据 保存到待处理数据库", unitNo); |
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper(); |
||||
queryWrapper.eq("unit_no", unitNo); |
||||
queryWrapper.eq("warehouse_id", currentWarehouseId); |
||||
|
||||
List list = baseMapper.selectList(queryWrapper); |
||||
|
||||
if (list == null || list.isEmpty()) { |
||||
OrderPackageStatusPushFailLogEntity orderPackageStatusPushFailLogEntity = new OrderPackageStatusPushFailLogEntity(); |
||||
orderPackageStatusPushFailLogEntity.setOrderPackageStatus(status); |
||||
orderPackageStatusPushFailLogEntity.setUnitNo(unitNo); |
||||
orderPackageStatusPushFailLogEntity.setWarehouseId(currentWarehouseId); |
||||
orderPackageStatusPushFailLogEntity.setOperationTime(operationTime); |
||||
orderPackageStatusPushFailLogEntity.setTrayId(trayId); |
||||
orderPackageStatusPushFailLogEntity.setDataStatus(0); |
||||
|
||||
// 插入之前判断这条数据是否存在系统中
|
||||
log.info(">>>>>>>>>>>>>>>> 保存到定时任务队列"); |
||||
baseMapper.insert(orderPackageStatusPushFailLogEntity); |
||||
}else{ |
||||
throw new CustomerException(405, "失败的包件数据状态记录已存在"); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue