|
|
|
|
@ -42,7 +42,6 @@ import org.springblade.desk.efficiency.enums.BsSalaryStandardEnum; |
|
|
|
|
import org.springblade.desk.efficiency.pojo.entity.BsSalaryStandardEntity; |
|
|
|
|
import org.springblade.desk.efficiency.service.IBsSalaryStandardService; |
|
|
|
|
import org.springblade.desk.efficiency.util.BsSalaryUtil; |
|
|
|
|
import org.springblade.desk.energy.util.DateTime; |
|
|
|
|
import org.springblade.desk.energy.util.HttpRequestService; |
|
|
|
|
import org.springblade.desk.logistics.pojo.dto.AllocationMessPageDTO; |
|
|
|
|
import org.springblade.desk.logistics.pojo.vo.AllocationMessVO; |
|
|
|
|
@ -50,9 +49,9 @@ import org.springblade.desk.order.mapper.YieldOrderMapper; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.YieldOrder; |
|
|
|
|
import org.springblade.desk.order.pojo.enums.YieldOrderEnum; |
|
|
|
|
import org.springblade.desk.order.service.IYieldOrderService; |
|
|
|
|
import org.springblade.desk.order.service.IYieldPlanService; |
|
|
|
|
import org.springblade.desk.produce.mapper.PlateAroundMapper; |
|
|
|
|
import org.springblade.desk.produce.mapper.WorkOrderMapper; |
|
|
|
|
import org.springblade.desk.produce.mapper.WorkPlanMapper; |
|
|
|
|
import org.springblade.desk.produce.pojo.dto.*; |
|
|
|
|
import org.springblade.desk.produce.pojo.entity.*; |
|
|
|
|
import org.springblade.desk.produce.pojo.enums.ProcessCycleEnum; |
|
|
|
|
@ -70,7 +69,6 @@ import org.springblade.erpdata.feign.IErpDataProduceClient; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.QualityGradeEntity; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.WorkOrderEntity; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.WorkPlanEntity; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.YieldOrderEntity; |
|
|
|
|
import org.springblade.system.cache.DictCache; |
|
|
|
|
import org.springblade.system.cache.UserCache; |
|
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
|
@ -114,12 +112,6 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
private final StGlassCakeOutClient stGlassCakeOutClient; |
|
|
|
|
|
|
|
|
|
// 关键:用set方法注入
|
|
|
|
|
// @Autowired
|
|
|
|
|
// public void setWorkPlanService(IWorkPlanService workPlanService) {
|
|
|
|
|
// this.workPlanService = workPlanService;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private final IBsProcessSetService bsProcessSetService; |
|
|
|
|
|
|
|
|
|
private final IWorkPlanItemService workPlanItemService; |
|
|
|
|
@ -172,14 +164,6 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
private final IReviewSheetService reviewSheetService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private final WorkPlanMapper workPlanMapper; |
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// public void setReviewSheetService(IReviewSheetService reviewSheetService) {
|
|
|
|
|
// this.reviewSheetService = reviewSheetService;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private final IOemCraftAbilityService oemCraftAbilityService; |
|
|
|
|
|
|
|
|
|
private final IWorkCenterService workCenterService; |
|
|
|
|
@ -207,6 +191,8 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
private final ICenterTeamService centerTeamService; |
|
|
|
|
|
|
|
|
|
private final IYieldPlanService yieldPlanService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private final IErpDataCheckerSealClient erpDataCheckerSealClient; |
|
|
|
|
|
|
|
|
|
@ -2962,6 +2948,52 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean planUpdateToQty() { |
|
|
|
|
int successCount = 0; |
|
|
|
|
int failCount = 0; |
|
|
|
|
// 1. 查询需要同步的前2000条计划单
|
|
|
|
|
List<String> poCodeList = yieldPlanService.selectNeedSyncPoCodes(); |
|
|
|
|
if (CollectionUtils.isEmpty(poCodeList)) { |
|
|
|
|
log.error("没有需要同步的计划单"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
for (String code : poCodeList) { |
|
|
|
|
try { |
|
|
|
|
this.processSinglePlan(code); |
|
|
|
|
successCount++; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
failCount++; |
|
|
|
|
log.error("同步计划单失败,poCode:{}", code, e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.info("同步计划单总数量完成,成功:{}条,失败:{}条", successCount, failCount); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void processSinglePlan(String code) { |
|
|
|
|
// 第一步:查询t_wo表
|
|
|
|
|
Double woTotqty = erpDataProduceClient.selectMaxWototqtyByWono(code).getData(); |
|
|
|
|
|
|
|
|
|
if (woTotqty != null) { |
|
|
|
|
// 存在WO记录,更新数量和检查时间
|
|
|
|
|
yieldPlanService.updateWithWo(code, woTotqty); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 第二步:查询t_wocls表
|
|
|
|
|
Double woclsTotqty = erpDataProduceClient.selectMaxWoclstotqtyByWono(code).getData(); |
|
|
|
|
|
|
|
|
|
if (woclsTotqty != null) { |
|
|
|
|
// 存在已关闭WO记录,更新数量、检查时间并关闭状态
|
|
|
|
|
yieldPlanService.updateWithWocls(code, woclsTotqty); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 第三步:两个表都没有记录,仅更新检查时间
|
|
|
|
|
yieldPlanService.updateOnlyCheckTime(code); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void launchTest(Map<String, Object> data, BladeUser user) throws Exception { |
|
|
|
|
// 提取参数
|
|
|
|
|
|