|
@@ -64,9 +64,6 @@ public class Mrp10201Controller extends BaseController {
|
|
|
@Resource
|
|
|
private IBizTechnologicalProcessService technologicalProcessService;
|
|
|
|
|
|
- @Resource
|
|
|
- private SysFeignService sysFeignService;
|
|
|
-
|
|
|
/**
|
|
|
* 查询mrp10200列表
|
|
|
*/
|
|
@@ -98,7 +95,7 @@ public class Mrp10201Controller extends BaseController {
|
|
|
* P2中,获取领料时间大于上一次拉取时间的新数据,再存入新系统中。
|
|
|
*/
|
|
|
BizPullP2Time lastPullDetail = null;
|
|
|
- if (pullDetails.size() > 0) {
|
|
|
+ if (!pullDetails.isEmpty()) {
|
|
|
int lastIndex = pullDetails.size() - 1;
|
|
|
lastPullDetail = pullDetails.get(lastIndex);
|
|
|
}
|
|
@@ -112,12 +109,13 @@ public class Mrp10201Controller extends BaseController {
|
|
|
* 这里应该根据新系统中记录的最大的拉取日期
|
|
|
* lldate:P2中的领料日期,为了避免重复拉取,需要做条件判断。lldate必须大于上一次拉取时间
|
|
|
* llsta:领料状态,Y:领料,N:未领料,这里只需要拉取Y状态的领料
|
|
|
+ * lotbz:lotbz=‘Y’,表示正常领料;='G':改料;='B':补料
|
|
|
*/
|
|
|
- queryWrapper.apply("lldate IS NOT NULL AND lldate > {0} AND llbz='Y'", newCondition);
|
|
|
+ queryWrapper.apply("lldate IS NOT NULL AND lldate > {0} AND llbz='Y' AND lotbz='Y'", newCondition);
|
|
|
}
|
|
|
List<Mrp10201> mrp10201List = mrp10201Service.getList(queryWrapper);
|
|
|
// 如果从P2中拉取到数据,则需要保存到当前数据库中
|
|
|
- if (mrp10201List.size() > 0) {
|
|
|
+ if (!mrp10201List.isEmpty()) {
|
|
|
List<BizProductionPlanDetail> newPlanDetails = new ArrayList<>();
|
|
|
for (Mrp10201 mrp10201:mrp10201List) {
|
|
|
BizProductionPlanDetail newPlanDetail = new BizProductionPlanDetail();
|
|
@@ -323,7 +321,7 @@ public class Mrp10201Controller extends BaseController {
|
|
|
newPlanDetails.add(newPlanDetail);
|
|
|
}
|
|
|
}
|
|
|
- if (newPlanDetails.size() > 0) {
|
|
|
+ if (!newPlanDetails.isEmpty()) {
|
|
|
// productionPlanDetailService.saveBatchByRawSql(newPlanDetails);
|
|
|
productionPlanDetailService.saveBatch(newPlanDetails);
|
|
|
// 当数据拉取成功,并将数据保存到 production_plan_detail 表中,则将 pull_p2_time 表中的 pull_time 属性置为当前时间
|