|
|
|
@ -10,6 +10,7 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
|
|
|
|
|
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
|
|
|
|
|
import com.hw.mes.config.MesConfig;
|
|
|
|
|
import com.hw.mes.domain.*;
|
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanDetailPauseVo;
|
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
|
|
|
|
|
import com.hw.mes.mapper.*;
|
|
|
|
|
import com.hw.mes.service.IMesProductPlanDetailService;
|
|
|
|
@ -753,4 +754,57 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产计划明细暂停
|
|
|
|
|
*
|
|
|
|
|
* @param mesProductPlanDetailPauseVo 生产计划明细暂停VO对象
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int productPlanDetailPause(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
|
|
|
|
|
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
|
|
|
|
|
|
|
|
|
|
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
|
|
|
|
|
|
|
|
|
|
// 明细状态:1-未开始;2-已开始;3-已完成;4-暂停,9-异常完成(校验物料信息不完整)
|
|
|
|
|
//已开始的可以改为暂停
|
|
|
|
|
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)){
|
|
|
|
|
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
|
|
|
|
|
throw new ServiceException(String.format("此生产计划明细已经%s,不能暂停!", planDetailStatusPrompt));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE);
|
|
|
|
|
mesProductPlanDetail.setUpdateTime(new Date());
|
|
|
|
|
mesProductPlanDetail.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产计划明细继续
|
|
|
|
|
*
|
|
|
|
|
* @param mesProductPlanDetailPauseVo 生产计划明细暂停VO对象
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
|
|
|
|
|
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
|
|
|
|
|
|
|
|
|
|
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
|
|
|
|
|
|
|
|
|
|
// 明细状态:1-未开始;2-已开始;3-已完成;4-暂停,9-异常完成(校验物料信息不完整)
|
|
|
|
|
//已开始的可以改为暂停
|
|
|
|
|
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)){
|
|
|
|
|
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
|
|
|
|
|
throw new ServiceException(String.format("此生产计划明细已经%s,不能继续!", planDetailStatusPrompt));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED);
|
|
|
|
|
mesProductPlanDetail.setUpdateTime(new Date());
|
|
|
|
|
mesProductPlanDetail.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|