|
|
|
@ -6,14 +6,13 @@ import com.hw.common.core.utils.DateUtils;
|
|
|
|
|
import com.hw.common.core.utils.StringUtils;
|
|
|
|
|
import com.hw.common.core.utils.uuid.Seq;
|
|
|
|
|
import com.hw.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
|
|
|
|
|
import com.hw.mes.domain.MesMaterialAssignInfo;
|
|
|
|
|
import com.hw.mes.domain.MesMaterialCheckResult;
|
|
|
|
|
import com.hw.mes.domain.MesProductPlan;
|
|
|
|
|
import com.hw.mes.domain.MesProductPlanDetail;
|
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
|
|
|
|
|
import com.hw.mes.mapper.MesMaterialBomMapper;
|
|
|
|
|
import com.hw.mes.mapper.MesMaterialCheckResultMapper;
|
|
|
|
|
import com.hw.mes.mapper.MesProductPlanDetailMapper;
|
|
|
|
|
import com.hw.mes.mapper.MesProductPlanMapper;
|
|
|
|
|
import com.hw.mes.mapper.*;
|
|
|
|
|
import com.hw.mes.service.IMesProductPlanDetailService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -42,6 +41,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesMaterialCheckResultMapper mesMaterialCheckResultMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesMaterialAssignInfoMapper mesMaterialAssignInfoMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询生产计划明细
|
|
|
|
|
*
|
|
|
|
@ -61,7 +66,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail) {
|
|
|
|
|
if(mesProductPlanDetail.getPlanId()==null){
|
|
|
|
|
if (mesProductPlanDetail.getPlanId() == null) {
|
|
|
|
|
return new ArrayList<MesProductPlanDetail>();
|
|
|
|
|
}
|
|
|
|
|
return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail);
|
|
|
|
@ -304,11 +309,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
|
|
|
|
|
* 开始下一生产计划明细
|
|
|
|
|
*
|
|
|
|
|
* @param mesProductPlanDetail 生产计划明细
|
|
|
|
|
* @param startType (0:其他工位,1:五楼装配工位)
|
|
|
|
|
* @return MesProductPlanDetail
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) {
|
|
|
|
|
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) {
|
|
|
|
|
//根据planId获取最新一条的生产计划明细
|
|
|
|
|
MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail);
|
|
|
|
|
//todo:在开始生产计划时,更新生产工单状态、开始时间;
|
|
|
|
@ -326,6 +332,24 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//五楼装配工位要扫码开始
|
|
|
|
|
if (startType.equals(MesConstants.MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE)) {
|
|
|
|
|
String materialBarcode = mesProductPlanDetail.getMaterialBarcode();
|
|
|
|
|
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
|
|
|
|
|
if (mesBaseBarcodeInfo == null) {
|
|
|
|
|
throw new ServiceException("物料条码有误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MesMaterialAssignInfo queryMaterialAssignInfo = new MesMaterialAssignInfo();
|
|
|
|
|
// queryMaterialAssignInfo.setMaterialBarcode(materialBarcode);
|
|
|
|
|
// List<MesMaterialAssignInfo> mesMaterialAssignInfoList = mesMaterialAssignInfoMapper.selectMesMaterialAssignInfoList(queryMaterialAssignInfo);
|
|
|
|
|
// if (mesMaterialAssignInfoList == null || mesMaterialAssignInfoList.isEmpty()) {
|
|
|
|
|
// throw new ServiceException("此物料条码还没下发到工位");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
|
|
|
|
|
//判断生产计划的状态
|
|
|
|
|
String planStatus = mesProductPlan.getPlanStatus();
|
|
|
|
|