Commit aabdb4ea 张少辉

1.物料日志增加唯一码查询

2.缺料报表优化,去掉已删除的
1 个父辈 0c55e268
......@@ -18,7 +18,7 @@ public class TaskQueryCondition {
@ApiModelProperty("模糊搜索")
private String blurry;
@QueryCondition
@QueryCondition(propName = "barcode")
@ApiModelProperty("条码编号")
private String barcode;
......
......@@ -45,11 +45,23 @@ public class TowerInventoryController {
@Autowired
private ITowerInventoryService towerInventoryService;
@Scheduled(fixedRate = 1000*60*2, initialDelay = 1000 * 30)
@Scheduled(fixedRate = 1000*60*1, initialDelay = 1000 * 30)
public void syncTowerInventoryData() {
try {
List<ReelConsumption> consumptionList = reelConsumptionManager.findByQuery(new Query());
if (consumptionList != null && !consumptionList.isEmpty()) {
List<String> partNumberList = new ArrayList<>();
for (ReelConsumption reelConsumption : consumptionList) {
partNumberList.add(reelConsumption.getPartNumber());
}
if (partNumberList != null && !partNumberList.isEmpty()){
partNumberList = partNumberList.stream().distinct().collect(Collectors.toList());
towerInventoryService.removeByNoPartNumber(partNumberList);
}
log.info("开始同步 Tower 库存数据...");
List<TowerInventory> towerInventoryList = getTowerInventoryDetail(consumptionList);
for (TowerInventory towerInventory : towerInventoryList) {
......
......@@ -4,6 +4,10 @@ import com.neotel.smfcore.common.base.IBaseManager;
import com.neotel.smfcore.custom.lizhen.report.bean.dto.TowerInventory;
import org.springframework.data.mongodb.core.query.Query;
import java.util.List;
public interface ITowerInventoryService extends IBaseManager<TowerInventory> {
TowerInventory findOne(Query partNumber);
void removeByNoPartNumber(List<String> partNumberList);
}
......@@ -7,6 +7,7 @@ import com.neotel.smfcore.custom.lizhen.report.dao.ITowerInventoryDao;
import com.neotel.smfcore.custom.lizhen.report.service.ITowerInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
......@@ -50,4 +51,9 @@ public class TowerInventoryServiceImpl implements ITowerInventoryService {
public TowerInventory findOne(Query query) {
return towerInventoryDao.findOne(query);
}
@Override
public void removeByNoPartNumber(List<String> partNumberList) {
towerInventoryDao.removeByQuery(new Query(Criteria.where("partNumber").not().in(partNumberList)));
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!