生产派工:4楼对内生产和5楼外部销售派工逻辑完善;
车间生产:5楼拆分工位完善(开始逻辑判断工单状态并更新工单状态,打印背板和门板条码唯一,完成时判断条码绑定信息,申请领柜体一个明细只能领取一个,返库前判断是否已经绑定);5楼装配工位完善(判断工单状态,校验背板或门板码是否是同一派工,生产明细显示规格型号,申请领料完成调用调度通知完成领料);
master
xs 11 months ago
parent 3b17b2879e
commit 68a276854c

@ -124,6 +124,10 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "项目号") @Excel(name = "项目号")
private String projectNo; private String projectNo;
/**
* 使使mes_product_plan_detailplan_detail_code*/
private String transferredPlanDetailCode;
/** 流水号 */ /** 流水号 */
@Excel(name = "流水号") @Excel(name = "流水号")
private String serialNumber; private String serialNumber;
@ -401,6 +405,15 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return projectNo; return projectNo;
} }
public String getTransferredPlanDetailCode() {
return transferredPlanDetailCode;
}
public void setTransferredPlanDetailCode(String transferredPlanDetailCode) {
this.transferredPlanDetailCode = transferredPlanDetailCode;
}
public void setSerialNumber(String serialNumber) public void setSerialNumber(String serialNumber)
{ {
this.serialNumber = serialNumber; this.serialNumber = serialNumber;

@ -137,6 +137,9 @@ public class MesConstants {
public static final String MES_BARCODE_PRINT_FLAG_NO = "0";//否 public static final String MES_BARCODE_PRINT_FLAG_NO = "0";//否
/**工序类型*/
public static final String MES_PROCESS_TYPE_FIFTH_SPLIT = "1";//五楼拆分工序
} }

@ -240,4 +240,9 @@ public class WmsConstants {
//车间生产区域类型 //车间生产区域类型
public static final String MES_AREA_TYPE_FOUTHFLOOR_ASSEMBLE = "3";//四楼装配区域 public static final String MES_AREA_TYPE_FOUTHFLOOR_ASSEMBLE = "3";//四楼装配区域
public static final String MES_AREA_TYPE_FOUTHFLOOR_PARTS = "4";//四楼零配件仓库 public static final String MES_AREA_TYPE_FOUTHFLOOR_PARTS = "4";//四楼零配件仓库
//原材料出库拆分标识
public static final String WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES = "1";
} }

@ -149,27 +149,57 @@ public class MesProductPlanController extends BaseController
return toAjax(mesProductPlanService.orderAddMesProductPlanList(productPlanEditVo)); return toAjax(mesProductPlanService.orderAddMesProductPlanList(productPlanEditVo));
} }
/** /* *//**
* List * List()
* @param planId * @param planId
* @return * @return
*/ *//*
@GetMapping(value = "/drawingList/{planId}") @GetMapping(value = "/drawingList/{planId}")
public AjaxResult getDispatchDrawingList(@PathVariable("planId") Long planId) public AjaxResult getDispatchDrawingList(@PathVariable("planId") Long planId)
{ {
return success(mesProductPlanService.getDispatchAttachList(planId, MesConstants.MES_ATTACH_TYPE_DRAWING)); return success(mesProductPlanService.getDispatchAttachList(planId, MesConstants.MES_ATTACH_TYPE_DRAWING));
} }
/** *//**
* SOPList * SOPList
* @param planId * @param planId
* @return * @return
*/ *//*
@GetMapping(value = "/SOPAttachList/{planId}") @GetMapping(value = "/SOPAttachList/{planId}")
public AjaxResult getDispatchSOPAttachList(@PathVariable("planId") Long planId) public AjaxResult getDispatchSOPAttachList(@PathVariable("planId") Long planId)
{ {
return success(mesProductPlanService.getDispatchAttachList(planId, MesConstants.MES_ATTACH_TYPE_SOP)); return success(mesProductPlanService.getDispatchAttachList(planId, MesConstants.MES_ATTACH_TYPE_SOP));
} }
*/
/**
* List
* @param dispatchCode
* @param processId
* @return
*/
@GetMapping(value = "/drawingList/{dispatchCode}/{processId}")
public AjaxResult getDispatchDrawingList(@PathVariable("dispatchCode") String dispatchCode,
@PathVariable("processId") Long processId)
{
return success(mesProductPlanService.getDispatchAttachList(dispatchCode,processId, MesConstants.MES_ATTACH_TYPE_DRAWING));
}
/**
* SOPList
* @param dispatchCode
* @param processId
* @return
*/
@GetMapping(value = "/SOPAttachList/{dispatchCode}/{processId}")
public AjaxResult getDispatchSOPAttachList(@PathVariable("dispatchCode") String dispatchCode,
@PathVariable("processId") Long processId)
{
return success(mesProductPlanService.getDispatchAttachList(dispatchCode,processId,MesConstants.MES_ATTACH_TYPE_SOP));
}
/** /**
* *

@ -167,6 +167,11 @@ public class MesProductPlan extends BaseEntity
*/ */
private String materialName; private String materialName;
/**
*
*/
private String materialSpec;
/** 生产计划明细信息 */ /** 生产计划明细信息 */
@ -495,6 +500,14 @@ public class MesProductPlan extends BaseEntity
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getProcessType() { public String getProcessType() {
return processType; return processType;
} }

@ -66,6 +66,8 @@ public class MesProductPlanDetail extends BaseEntity
private String materialBarcode; private String materialBarcode;
private String processType;//工序类型1五楼拆分工序
public void setPlanDetailId(Long planDetailId) public void setPlanDetailId(Long planDetailId)
{ {
this.planDetailId = planDetailId; this.planDetailId = planDetailId;
@ -190,6 +192,14 @@ public class MesProductPlanDetail extends BaseEntity
this.materialBarcode = materialBarcode; this.materialBarcode = materialBarcode;
} }
public String getProcessType() {
return processType;
}
public void setProcessType(String processType) {
this.processType = processType;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -126,4 +126,13 @@ public interface MesProductPlanMapper
*/ */
public int deleteMesProductPlanByDispatchCode(String dispatchCode); public int deleteMesProductPlanByDispatchCode(String dispatchCode);
/**
*
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectOnlyMesProductPlans(MesProductPlan mesProductPlan);
} }

@ -112,6 +112,16 @@ public interface IMesProductPlanService
*/ */
public List<MesBaseAttachInfo> getDispatchAttachList(Long planId, String attachType); public List<MesBaseAttachInfo> getDispatchAttachList(Long planId, String attachType);
/**
* List
*
* @param dispatchCode
* @param processId
* @param attachType
* @return
*/
public List<MesBaseAttachInfo> getDispatchAttachList(String dispatchCode,Long processId, String attachType);
/** /**
* *
* *

@ -8,12 +8,15 @@ import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesPalletInfoBindVo; import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper; import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.printer.api.RemotePrinterService; import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo; import com.hw.printer.api.domain.vo.PrintContentVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBasePalletInfoMapper; import com.hw.mes.mapper.MesBasePalletInfoMapper;
@ -31,6 +34,9 @@ import javax.annotation.Resource;
*/ */
@Service @Service
public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService { public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
private static final Logger log = LoggerFactory.getLogger(MesBasePalletInfoServiceImpl.class);
@Autowired @Autowired
private MesBasePalletInfoMapper mesBasePalletInfoMapper; private MesBasePalletInfoMapper mesBasePalletInfoMapper;
@ -119,16 +125,18 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int bindPalletInfo(MesPalletInfoBindVo mesPalletInfoBindVo) { public int bindPalletInfo(MesPalletInfoBindVo mesPalletInfoBindVo) {
String palletInfoCode = mesPalletInfoBindVo.getPalletInfoCode(); String palletInfoCode = mesPalletInfoBindVo.getPalletInfoCode().trim();
String materialBarcode = mesPalletInfoBindVo.getMaterialBarcode(); String materialBarcode = mesPalletInfoBindVo.getMaterialBarcode().trim();
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode); MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (mesBaseBarcodeInfo == null) { if (mesBaseBarcodeInfo == null) {
log.error("palletInfoCode:"+palletInfoCode+",materialBarcode:"+materialBarcode);
throw new ServiceException("物料条码有误"); throw new ServiceException("物料条码有误");
} }
MesBasePalletInfo mesBasePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByPalletInfoCode(palletInfoCode); MesBasePalletInfo mesBasePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByPalletInfoCode(palletInfoCode);
if (mesBasePalletInfo == null) { if (mesBasePalletInfo == null) {
log.error("palletInfoCode:"+palletInfoCode+",materialBarcode:"+materialBarcode);
throw new ServiceException("托盘码有误"); throw new ServiceException("托盘码有误");
} }

@ -101,14 +101,16 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
*/ */
@Override @Override
public MesBaseStationInfo getLoginStationInfo() { public MesBaseStationInfo getLoginStationInfo() {
//TODO:正式时需要修改回来
String ipAddress = SecurityUtils.getLoginUser().getIpaddr(); String ipAddress = SecurityUtils.getLoginUser().getIpaddr();
ipAddress = "192.168.2.20";//TODO:正式时需要删除 // ipAddress = "192.168.2.25";
MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress); MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress);
Integer processFloor = SecurityUtils.getProcessFloor(); Integer processFloor = SecurityUtils.getProcessFloor();
if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) { if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) {
throw new ServiceException("请在" + processFloor + "楼登录此工序"); throw new ServiceException("请在" + processFloor + "楼登录此工序");
} }
// MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationId(526l);
return mesBaseStationInfo; return mesBaseStationInfo;
} }
} }

@ -79,6 +79,9 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
}else{ }else{
mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount()); mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount());
} }
if (mesProductOrder.getSaleOrderId() == null) {
mesProductOrder.setSaleOrderId(0L);
}
return mesProductOrderMapper.insertMesProductOrder(mesProductOrder); return mesProductOrderMapper.insertMesProductOrder(mesProductOrder);
} }

@ -7,6 +7,7 @@ import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*; import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesProductPlanDetailVo; import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.mapper.*; import com.hw.mes.mapper.*;
@ -224,21 +225,33 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
selectMesProductPlanDetailByPlanDetailId(planDetailId); selectMesProductPlanDetailByPlanDetailId(planDetailId);
String planDetailStatus = dbProductPlanDetail.getPlanDetailStatus(); String planDetailStatus = dbProductPlanDetail.getPlanDetailStatus();
if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) { if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) {
throw new ServiceException("此生产计划明细未开始"); throw new ServiceException("此生产明细未开始");
} else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) { } else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
throw new ServiceException("此生产计划明细已结束"); throw new ServiceException("此生产明细已结束");
} }
Long planId = dbProductPlanDetail.getPlanId(); Long planId = dbProductPlanDetail.getPlanId();
MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId); MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
String planStatus = dbProductPlan.getPlanStatus(); String planStatus = dbProductPlan.getPlanStatus();
if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) { if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) {
throw new ServiceException("此生产计划未派工,不能结束"); throw new ServiceException("此生产明细未派工,不能结束");
} else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) { } else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) {
throw new ServiceException("此生产计划已结束"); throw new ServiceException("此生产派工已结束");
} }
//校验生产计划明细校验信息(如果是多个工序只校验最后一个工序,一楼和四楼都是一个工序,暂时不校验最后一个工序), //如果是五楼拆分,校验是否有绑定条码
if (mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) {
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPlanDetailCode(dbProductPlanDetail.getPlanDetailCode());
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
List<MesBaseBarcodeInfo> bindBaseBarcodeInfos = mesBaseBarcodeInfos.stream().filter(mesBaseBarcodeInfo ->
StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBindBarcode())).collect(Collectors.toList());
if (bindBaseBarcodeInfos == null || bindBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("请绑定条码执行返库后再执行完成");
}
}
//校验生产计划明细物料使用情况校验信息(如果是多个工序只校验最后一个工序,一楼是一个工序,暂时不校验最后一个工序)
List<MesMaterialCheckResult> checkResults = List<MesMaterialCheckResult> checkResults =
mesMaterialCheckResultMapper.selectMesMaterialCheckResult(planId, planDetailId, "0," + dbProductPlan.getMaterialBomId()); mesMaterialCheckResultMapper.selectMesMaterialCheckResult(planId, planDetailId, "0," + dbProductPlan.getMaterialBomId());
List<MesMaterialCheckResult> filterCheckResults = checkResults.stream().filter( List<MesMaterialCheckResult> filterCheckResults = checkResults.stream().filter(
@ -270,9 +283,9 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
dbProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH); dbProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH);
dbProductPlan.setRealEndTime(currentDate); dbProductPlan.setRealEndTime(currentDate);
//todo更新生产任务状态、结束时间和完成数量根据finalprocessFlag更新生产任务
//todo更新生产工单状态、结束时间和完成数量根据finalprocessFlag更新生产工单
} }
dbProductPlan.setCompleteAmount(newComplementAmount); dbProductPlan.setCompleteAmount(newComplementAmount);
dbProductPlan.setUpdateTime(currentDate); dbProductPlan.setUpdateTime(currentDate);
dbProductPlan.setUpdateBy(userName); dbProductPlan.setUpdateBy(userName);
@ -330,31 +343,13 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH) if (!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)
&& !planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH)) { && !planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH)) {
//如果不是完成状态则不能开始下一任务明细 //如果不是完成状态则不能开始下一任务明细
throw new ServiceException("请先完成上一任务明细"); throw new ServiceException("请先完成上一生产明细");
} else { } else {
Date realEndTime = newestPlanDetail.getRealEndTime(); Date realEndTime = newestPlanDetail.getRealEndTime();
//todo:在完成任务后需要过多久才能继续下一任务 //在完成任务后需要过多久才能继续下一任务,先不考虑
} }
} }
//五楼装配工位要扫码开始
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()); MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//判断生产计划的状态 //判断生产计划的状态
String planStatus = mesProductPlan.getPlanStatus(); String planStatus = mesProductPlan.getPlanStatus();
@ -368,8 +363,58 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
String planDetailCode = Seq.getId(Seq.mesProductPlanDetailSeqType, Seq.mesProductPlanDetailCode);
//五楼装配工位要扫码开始
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("条码有误");
}
if (!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BACKPLATE) &&
!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_DOOR)) {
throw new ServiceException("请扫描背板或门板条码开始");
}
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getBindBarcode())) {
throw new ServiceException("此条码有误,未绑定任何柜体");
}
if(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getTransferredPlanDetailCode())){
throw new ServiceException("此条码已经扫描使用过,不能再次使用");
}
//校验此条码是否是同一派工单
MesProductPlan barcodeProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(mesBaseBarcodeInfo.getPlanCode());
if (barcodeProductPlan == null) {
throw new ServiceException("条码有误,没有相关派工");
}
if (!barcodeProductPlan.getDispatchCode().equals(mesProductPlan.getDispatchCode())) {
throw new ServiceException("此条码的派工单号为:" + barcodeProductPlan.getDispatchCode() + ",与此派工单号不符");
}
// MesMaterialAssignInfo queryMaterialAssignInfo = new MesMaterialAssignInfo();
// queryMaterialAssignInfo.setMaterialBarcode(materialBarcode);
// List<MesMaterialAssignInfo> mesMaterialAssignInfoList = mesMaterialAssignInfoMapper.selectMesMaterialAssignInfoList(queryMaterialAssignInfo);
// if (mesMaterialAssignInfoList == null || mesMaterialAssignInfoList.isEmpty()) {
// throw new ServiceException("此物料条码还没下发到工位");
// }
mesBaseBarcodeInfo.setTransferredPlanDetailCode(planDetailCode);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
//判断生产任务状态,并根据状态更新生产任务
startProductOrder(mesProductPlan, currentDate, userName); startProductOrder(mesProductPlan, currentDate, userName);
if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)) {//如果状态是已开始,需要修改计划的状态和开始时间 if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)) {//如果状态是已开始,需要修改计划的状态和开始时间
mesProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED); mesProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED);
mesProductPlan.setRealBeginTime(currentDate); mesProductPlan.setRealBeginTime(currentDate);
@ -379,7 +424,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
} }
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED); mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED);
mesProductPlanDetail.setPlanDetailCode(Seq.getId(Seq.mesProductPlanDetailSeqType, Seq.mesProductPlanDetailCode)); mesProductPlanDetail.setPlanDetailCode(planDetailCode);
mesProductPlanDetail.setPlanCode(mesProductPlan.getPlanCode()); mesProductPlanDetail.setPlanCode(mesProductPlan.getPlanCode());
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED); mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED);
mesProductPlanDetail.setIsFlag("1"); mesProductPlanDetail.setIsFlag("1");
@ -391,21 +436,22 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail); mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
return mesProductPlanDetail; return mesProductPlanDetail;
} }
public void startProductOrder(MesProductPlan productPlan, Date currentDate, String userName) { public void startProductOrder(MesProductPlan productPlan, Date currentDate, String userName) {
MesProductOrder productOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId()); MesProductOrder productOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId());
if (productOrder == null) { if (productOrder == null) {
throw new ServiceException("无此生产工单"); throw new ServiceException("无此生产任务");
} }
String orderStatus = productOrder.getOrderStatus(); String orderStatus = productOrder.getOrderStatus();
if (!orderStatus.equals(MesConstants.BEGIN) && !orderStatus.equals(MesConstants.PUBLISHED)) { if (!orderStatus.equals(MesConstants.BEGIN) && !orderStatus.equals(MesConstants.PUBLISHED)) {
String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(orderStatus); String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(orderStatus);
throw new ServiceException(String.format("此生产工单已经%s,不能开始!", orderStatusPrompt)); throw new ServiceException(String.format("此生产任务已经%s,不能开始!", orderStatusPrompt));
} }

@ -307,6 +307,54 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
} }
} }
/**
* List
*
* @param dispatchCode
* @param processId
* @param attachType
* @return
*/
@Override
public List<MesBaseAttachInfo> getDispatchAttachList(String dispatchCode, Long processId, String attachType) {
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setProcessId(processId);
queryProductPlan.setDispatchCode(dispatchCode);
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
if (mesProductPlans != null && !mesProductPlans.isEmpty()) {
MesProductPlan mesProductPlan = mesProductPlans.get(0);
try {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
return new ArrayList<>();
}
Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
if (StringUtils.isEmpty(mesProductPlan.getSopId())) {
return new ArrayList<>();
}
Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds);
} else {
return new ArrayList<>();
}
} catch (Exception e) {
return new ArrayList<>();
}
}
return new ArrayList<>();
}
/** /**
* *
* *

@ -32,6 +32,7 @@
<result property="saleOrderId" column="sale_order_id"/> <result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/> <result property="saleorderCode" column="saleorder_code"/>
<result property="projectNo" column="project_no"/> <result property="projectNo" column="project_no"/>
<result property="transferredPlanDetailCode" column="transferred_plan_detail_code"/>
<result property="serialNumber" column="serial_number"/> <result property="serialNumber" column="serial_number"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="bindStatus" column="bind_status"/> <result property="bindStatus" column="bind_status"/>
@ -42,7 +43,7 @@
<result property="materialCode" column="material_code"/> <result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/> <result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/> <result property="materialSpec" column="material_spec"/>
<result property="bindFlag" column="bind_flag"/> <result property="alwaysFlag" column="always_flag"/>
<result property="checkStatus" column="checkStatus"/> <result property="checkStatus" column="checkStatus"/>
</resultMap> </resultMap>
@ -74,6 +75,7 @@
bbi.sale_order_id, bbi.sale_order_id,
bbi.saleorder_code, bbi.saleorder_code,
bbi.project_no, bbi.project_no,
bbi.transferred_plan_detail_code,
bbi.print_flag, bbi.print_flag,
bbi.serial_number, bbi.serial_number,
bbi.remark, bbi.remark,
@ -141,6 +143,7 @@
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if> <if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
<if test="batchCode != null and batchCode != ''">batch_code,</if> <if test="batchCode != null and batchCode != ''">batch_code,</if>
<if test="palletInfoCode != null">pallet_info_code,</if> <if test="palletInfoCode != null">pallet_info_code,</if>
<if test="bindBarcode != null">bind_barcode,</if>
<if test="materialId != null">material_id,</if> <if test="materialId != null">material_id,</if>
<if test="manufacturerId != null">manufacturer_id,</if> <if test="manufacturerId != null">manufacturer_id,</if>
<if test="amount != null">amount,</if> <if test="amount != null">amount,</if>
@ -175,6 +178,7 @@
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if> <if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">#{batchCode},</if> <if test="batchCode != null and batchCode != ''">#{batchCode},</if>
<if test="palletInfoCode != null">#{palletInfoCode},</if> <if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="bindBarcode != null">#{bindBarcode},</if>
<if test="materialId != null">#{materialId},</if> <if test="materialId != null">#{materialId},</if>
<if test="manufacturerId != null">#{manufacturerId},</if> <if test="manufacturerId != null">#{manufacturerId},</if>
<if test="amount != null">#{amount},</if> <if test="amount != null">#{amount},</if>
@ -227,6 +231,7 @@
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if> <if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if> <if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="projectNo != null">project_no = #{projectNo},</if> <if test="projectNo != null">project_no = #{projectNo},</if>
<if test="transferredPlanDetailCode != null">transferred_plan_detail_code = #{transferredPlanDetailCode},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if> <if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="bindBarcode != null">bind_barcode = #{bindBarcode},</if> <if test="bindBarcode != null">bind_barcode = #{bindBarcode},</if>
@ -342,7 +347,7 @@
bmi.material_code, bmi.material_code,
bmi.material_name, bmi.material_name,
bmi.material_spec, bmi.material_spec,
bmi.bind_flag, bmi.always_flag,
qcr.check_status qcr.check_status
from mes_base_barcode_info bbi from mes_base_barcode_info bbi
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id left join mes_base_material_info bmi on bmi.material_id = bbi.material_id

@ -22,7 +22,7 @@
<result property="materialSpec" column="material_spec"/> <result property="materialSpec" column="material_spec"/>
<result property="netWeight" column="net_weight"/> <result property="netWeight" column="net_weight"/>
<result property="grossWeight" column="gross_weight"/> <result property="grossWeight" column="gross_weight"/>
<result property="bindFlag" column="bind_flag" /> <result property="alwaysFlag" column="always_flag" />
<result property="factoryId" column="factory_id"/> <result property="factoryId" column="factory_id"/>
<result property="createOrgId" column="create_org_id"/> <result property="createOrgId" column="create_org_id"/>
<result property="useOrgId" column="use_org_id"/> <result property="useOrgId" column="use_org_id"/>
@ -58,6 +58,7 @@
bmi.material_spec, bmi.material_spec,
bmi.net_weight, bmi.net_weight,
bmi.gross_weight, bmi.gross_weight,
bmi.always_flag,
bmi.factory_id, bmi.factory_id,
bmi.create_org_id, bmi.create_org_id,
bmi.purchase_price_unit_id, bmi.purchase_price_unit_id,
@ -200,7 +201,7 @@
<if test="materialSpec != null">material_spec = #{materialSpec},</if> <if test="materialSpec != null">material_spec = #{materialSpec},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if> <if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if> <if test="grossWeight != null">gross_weight = #{grossWeight},</if>
<if test="bindFlag != null and bindFlag != ''">bind_flag = #{bindFlag},</if> <if test="alwaysFlag != null and alwaysFlag != ''">always_flag = #{alwaysFlag},</if>
<if test="factoryId != null">factory_id = #{factoryId},</if> <if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="createOrgId != null">create_org_id = #{createOrgId},</if> <if test="createOrgId != null">create_org_id = #{createOrgId},</if>
<if test="useOrgId != null">use_org_id = #{useOrgId},</if> <if test="useOrgId != null">use_org_id = #{useOrgId},</if>
@ -214,7 +215,7 @@
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="approveDate != null">approve_date = #{approveDate},</if> <if test="approveDate != null">approve_date = #{approveDate},</if>
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if> <if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
<if test="bindFlag != null">bind_flag = #{bindFlag},</if> <if test="alwaysFlag != null">always_flag = #{alwaysFlag},</if>
<if test="batchAmount != null">batch_amount = #{batchAmount},</if> <if test="batchAmount != null">batch_amount = #{batchAmount},</if>
</trim> </trim>
where material_id = #{materialId} where material_id = #{materialId}
@ -322,7 +323,7 @@
bmi.material_spec, bmi.material_spec,
bmi.net_weight, bmi.net_weight,
bmi.gross_weight, bmi.gross_weight,
bmi.bind_flag, bmi.always_flag,
bmi.factory_id, bmi.factory_id,
bmi.create_org_id, bmi.create_org_id,
bmi.use_org_id, bmi.use_org_id,

@ -41,6 +41,7 @@
<result property="planDeliveryDate" column="plan_delivery_date"/> <result property="planDeliveryDate" column="plan_delivery_date"/>
<result property="materialCode" column="material_code"/> <result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/> <result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="processName" column="process_name"/> <result property="processName" column="process_name"/>
<result property="processType" column="process_type"/> <result property="processType" column="process_type"/>
<result property="stationName" column="station_name"/> <result property="stationName" column="station_name"/>
@ -198,7 +199,7 @@
insert into mes_product_plan insert into mes_product_plan
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if> <if test="productOrderId != null">product_order_id,</if>
<if test="saleOrderId != null and saleOrderId != ''">sale_order_id,</if> <if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null and saleorderCode != ''">saleorder_code,</if> <if test="saleorderCode != null and saleorderCode != ''">saleorder_code,</if>
<if test="planCode != null and planCode != ''">plan_code,</if> <if test="planCode != null and planCode != ''">plan_code,</if>
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code,</if> <if test="dispatchCode != null and dispatchCode != ''">dispatch_code,</if>
@ -337,7 +338,7 @@
mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.user_id, mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.user_id,
mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time,
mpp.real_begin_time, mpp.real_end_time, mpp.real_begin_time, mpp.real_end_time,
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name,mbmi.material_spec
from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
<where> <where>
@ -457,4 +458,38 @@
where dispatch_code = #{dispatchCode} where dispatch_code = #{dispatchCode}
</delete> </delete>
<select id="selectOnlyMesProductPlans" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
select a.plan_id,
a.product_order_id,
a.plan_code,
a.dispatch_code,
a.material_id,
a.material_bom_id,
a.process_id,
a.process_order,
a.last_process_id,
a.station_id,
a.user_id,
a.production_time,
a.dispatch_amount,
a.plan_amount,
a.complete_amount,
a.plan_begin_time,
a.plan_end_time,
a.real_begin_time,
a.real_end_time,
a.attach_id,
a.sop_id,
a.plan_status,
a.is_flag
from mes_product_plan a
<where>
<if test="dispatchCode != null and dispatchCode != ''">and a.dispatch_code = #{dispatchCode}</if>
<if test="processId != null ">and a.process_id = #{processId}</if>
</where>
</select>
</mapper> </mapper>

@ -18,6 +18,11 @@ public class WmsConfig {
*/ */
private String fifthAssembleStationCode; private String fifthAssembleStationCode;
/**
*
*/
private String fifthSplitStationCode;
/** /**
* ID * ID
*/ */
@ -57,6 +62,14 @@ public class WmsConfig {
this.fifthAssembleStationCode = fifthAssembleStationCode; this.fifthAssembleStationCode = fifthAssembleStationCode;
} }
public String getFifthSplitStationCode() {
return fifthSplitStationCode;
}
public void setFifthSplitStationCode(String fifthSplitStationCode) {
this.fifthSplitStationCode = fifthSplitStationCode;
}
public Long getFifthSemiWarehouseId() { public Long getFifthSemiWarehouseId() {
return fifthSemiWarehouseId; return fifthSemiWarehouseId;
} }

@ -225,7 +225,7 @@ public class WmsMobileController extends BaseController {
/** /**
* 5 * 5
*/ */
@Log(title = "成品入库记录", businessType = BusinessType.INSERT) @Log(title = "成品入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/addProductInstock")) @PostMapping(("/addProductInstock"))

@ -45,6 +45,8 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "入库批次号") @Excel(name = "入库批次号")
private String productBatch; private String productBatch;
private String palletInfoCode;
/** 质检状态(1检验中,2质检通过,3质检不通过) */ /** 质检状态(1检验中,2质检通过,3质检不通过) */
@Excel(name = "质检状态(1检验中,2质检通过,3质检不通过)") @Excel(name = "质检状态(1检验中,2质检通过,3质检不通过)")
private String qualityStatus; private String qualityStatus;
@ -166,6 +168,15 @@ public class WmsProductStock extends BaseEntity
{ {
return productBatch; return productBatch;
} }
public String getPalletInfoCode() {
return palletInfoCode;
}
public void setPalletInfoCode(String palletInfoCode) {
this.palletInfoCode = palletInfoCode;
}
public void setQualityStatus(String qualityStatus) public void setQualityStatus(String qualityStatus)
{ {
this.qualityStatus = qualityStatus; this.qualityStatus = qualityStatus;

@ -55,6 +55,8 @@ public class WmsRawOutstock extends BaseEntity {
@Excel(name = "销售订单ID") @Excel(name = "销售订单ID")
private Long orderId; private Long orderId;
private Long saleOrderId;
/** /**
* ,pd_base_plan_infoplan_id * ,pd_base_plan_infoplan_id
*/ */
@ -115,6 +117,9 @@ public class WmsRawOutstock extends BaseEntity {
@Excel(name = "任务类型(1生产领料,2移库出库,3合库出库,9其他领料)") @Excel(name = "任务类型(1生产领料,2移库出库,3合库出库,9其他领料)")
private String taskType; private String taskType;
private String splitFlag;
/** /**
* *
*/ */
@ -209,7 +214,6 @@ public class WmsRawOutstock extends BaseEntity {
private String materialBarcode; private String materialBarcode;
private Long saleOrderId;
/** /**
* *
@ -368,6 +372,14 @@ public class WmsRawOutstock extends BaseEntity {
return taskType; return taskType;
} }
public String getSplitFlag() {
return splitFlag;
}
public void setSplitFlag(String splitFlag) {
this.splitFlag = splitFlag;
}
public void setApplyReason(String applyReason) { public void setApplyReason(String applyReason) {
this.applyReason = applyReason; this.applyReason = applyReason;
} }

@ -70,6 +70,14 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
/** /**
* *
*|||||
* |:---- |:---|:----- |----- |
* | warehouseId | long ID; |
* | saleorderId | string
* | saleorderCode | string
* | productId | long
* | applyQty | bigDecimal |
* | applyReason | string |
* *
* @param wmsProductOutstock * @param wmsProductOutstock
* @return * @return

@ -290,7 +290,6 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
} }
} }
WmsRawInstock wmsRawInstock = new WmsRawInstock(); WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode)); wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode));
wmsRawInstock.setWarehouseId(wmsRawBackVo.getWarehouseId()); wmsRawInstock.setWarehouseId(wmsRawBackVo.getWarehouseId());

@ -500,7 +500,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
String planDetailCode = wmsRawOutstock.getPlanDetailCode(); String planDetailCode = wmsRawOutstock.getPlanDetailCode();
if (StringUtils.isEmpty(planCode) || StringUtils.isEmpty(planDetailCode)) { if (StringUtils.isEmpty(planCode) || StringUtils.isEmpty(planDetailCode)) {
throw new ServiceException("请选择计划明细信息再领料"); throw new ServiceException("请选择派工明细信息再领料");
} }
Long warehouseId = wmsRawOutstock.getWarehouseId(); Long warehouseId = wmsRawOutstock.getWarehouseId();
@ -515,6 +515,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
: wmsRawOutstock.getTaskType(); : wmsRawOutstock.getTaskType();
String warehouseType = baseWarehouse.getWarehouseType(); String warehouseType = baseWarehouse.getWarehouseType();
//TODO 判断质检状态,还是在实际出库时判断质检状态 //TODO 判断质检状态,还是在实际出库时判断质检状态
String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS; String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS;
@ -545,7 +546,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(baseWarehouse, wmsRawOutstock, WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(baseWarehouse, wmsRawOutstock,
rawOutstockDetail.getMaterialId(), taskCode, taskType, rawOutstockDetail.getMaterialId(), taskCode, taskType,
planAmount, currentDate, userName, wmsStockTotal.getStockTotalId()); planAmount, currentDate, userName, wmsStockTotal.getStockTotalId(), wmsStockTotal.getSaleOrderId());
toInsertedRawOutstocks.add(toInsertedRawOutstock); toInsertedRawOutstocks.add(toInsertedRawOutstock);
} else { } else {
@ -577,7 +578,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
*/ */
private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse, WmsRawOutstock wmsRawOutstockParam, private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse, WmsRawOutstock wmsRawOutstockParam,
Long materialId, String taskCode, String taskType, Long materialId, String taskCode, String taskType,
BigDecimal planAmount, Date currentDate, String userName, Long stockTotalId) { BigDecimal planAmount, Date currentDate, String userName, Long stockTotalId, Long saleOrderId) {
//出库要求 0申请出库1申请审核出库2直接出库 //出库要求 0申请出库1申请审核出库2直接出库
String outRequirement = baseWarehouse.getOutRequirement(); String outRequirement = baseWarehouse.getOutRequirement();
String warehouseType = baseWarehouse.getWarehouseType(); String warehouseType = baseWarehouse.getWarehouseType();
@ -586,6 +587,21 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
WmsRawOutstock toInsertedRawOutstock = new WmsRawOutstock(); WmsRawOutstock toInsertedRawOutstock = new WmsRawOutstock();
toInsertedRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); toInsertedRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
//如果是五楼拆分区,一个明细只能领取一个柜体
if (wmsRawOutstockParam.getTaskType().equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_SPLIT)) {
WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setPlanDetailCode(wmsRawOutstockParam.getPlanDetailCode());
queryRawOutstock.setSplitFlag(WmsConstants.WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) {
throw new ServiceException("一个明细信息只能领取一个柜体");
}
toInsertedRawOutstock.setSplitFlag(WmsConstants.WMS_RAW_OUTSTOCK_SPLIT_FLAG_YES);
}
if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)) {//如果是普通仓库,需要校验审核标识 if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)) {//如果是普通仓库,需要校验审核标识
if (outRequirement.equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_APPLY_AUDIT)) { if (outRequirement.equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_APPLY_AUDIT)) {
toInsertedRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); toInsertedRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT);
@ -602,12 +618,18 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
// toInsertedRawOutstock.setLocationCode(wmsRawStock.getLocationCode()); // toInsertedRawOutstock.setLocationCode(wmsRawStock.getLocationCode());
toInsertedRawOutstock.setStationId(wmsRawOutstockParam.getStationId()); toInsertedRawOutstock.setStationId(wmsRawOutstockParam.getStationId());
toInsertedRawOutstock.setStockTotalId(stockTotalId); toInsertedRawOutstock.setStockTotalId(stockTotalId);
toInsertedRawOutstock.setSaleOrderId(saleOrderId);
// toInsertedRawOutstock.setPalletInfoCode(wmsRawStock.getPalletInfoCode()); // toInsertedRawOutstock.setPalletInfoCode(wmsRawStock.getPalletInfoCode());
toInsertedRawOutstock.setOperationType(operationType); toInsertedRawOutstock.setOperationType(operationType);
toInsertedRawOutstock.setApplyBy(userName); toInsertedRawOutstock.setApplyBy(userName);
toInsertedRawOutstock.setApplyReason(wmsRawOutstockParam.getApplyReason()); toInsertedRawOutstock.setApplyReason(wmsRawOutstockParam.getApplyReason());
toInsertedRawOutstock.setApplyDate(currentDate); toInsertedRawOutstock.setApplyDate(currentDate);
if (wmsRawOutstockParam.getTaskType().equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING)) {
toInsertedRawOutstock.setEndStationCode(wmsRawOutstockParam.getEndStationCode()); toInsertedRawOutstock.setEndStationCode(wmsRawOutstockParam.getEndStationCode());
} else if (wmsRawOutstockParam.getTaskType().equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_SPLIT)) {
toInsertedRawOutstock.setEndStationCode((wmsConfig.getFifthSplitStationCode()));
}
toInsertedRawOutstock.setMaterialId(materialId); toInsertedRawOutstock.setMaterialId(materialId);
toInsertedRawOutstock.setOutstockAmount(planAmount); toInsertedRawOutstock.setOutstockAmount(planAmount);
toInsertedRawOutstock.setPlanCode(wmsRawOutstockParam.getPlanCode()); toInsertedRawOutstock.setPlanCode(wmsRawOutstockParam.getPlanCode());
@ -949,6 +971,17 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
if (StringUtils.isEmpty(bindBarcode)) { if (StringUtils.isEmpty(bindBarcode)) {
throw new ServiceException("此柜体还未绑定"); throw new ServiceException("此柜体还未绑定");
} }
//通过绑定的条码找到物料信息和saleorderid
R<MesBaseBarcodeInfo> bindBarcodeInfoR = remoteMesService.getBarcode(bindBarcode, SecurityConstants.INNER);
if (bindBarcodeInfoR == null) {
throw new ServiceException("绑定的柜体条码有误");
}
MesBaseBarcodeInfo bindBarcodeInfo = bindBarcodeInfoR.getData();
if (bindBarcodeInfo == null) {
throw new ServiceException("绑定的柜体条码有误");
}
WmsRawOutstock queryRawOutstock = new WmsRawOutstock(); WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setMaterialBatch(bindBarcode); queryRawOutstock.setMaterialBatch(bindBarcode);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock); List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
@ -973,10 +1006,11 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setOrderId(baseBarcodeInfo.getSaleOrderId()); wmsRawOutstock.setOrderId(baseBarcodeInfo.getSaleOrderId());
wmsRawOutstock.setPlanCode(baseBarcodeInfo.getPlanCode()); wmsRawOutstock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsRawOutstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode()); wmsRawOutstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId()); wmsRawOutstock.setMaterialId(bindBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialBatch(bindBarcode); wmsRawOutstock.setMaterialBatch(bindBarcode);
wmsRawOutstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码 wmsRawOutstock.setPalletInfoCode(bindBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码
wmsRawOutstock.setOutstockAmount(BigDecimal.ONE); wmsRawOutstock.setOutstockAmount(BigDecimal.ONE);
wmsRawOutstock.setSaleOrderId(bindBarcodeInfo.getSaleOrderId());
wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域 wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域
wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO); wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
@ -1213,6 +1247,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
@Override @Override
public WmsRawOutstock getNewestOutstockCabinet(WmsRawOutstock wmsRawOutstock) { public WmsRawOutstock getNewestOutstockCabinet(WmsRawOutstock wmsRawOutstock) {
wmsRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); wmsRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_SPLIT);
return wmsRawOutstockMapper.selectNewestWmsRawOutstock(wmsRawOutstock); return wmsRawOutstockMapper.selectNewestWmsRawOutstock(wmsRawOutstock);
} }
} }

@ -200,11 +200,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> mesBaseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoR == null) { if (mesBaseBarcodeInfoR == null) {
throw new ServiceException("物料码错误"); throw new ServiceException("物料码错误");
} }
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoR.getData(); MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoR.getData();
if (mesBaseBarcodeInfo == null) { if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料码错误"); throw new ServiceException("物料码错误");
} }
@ -227,6 +227,9 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
if (productStock == null) { if (productStock == null) {
throw new ServiceException("无此成品库存"); throw new ServiceException("无此成品库存");
} }
if (!productStock.getLocationCode().equals(wmsTransferDetail.getLocationCode())) {
throw new ServiceException("出库库位编码错误");
}
WmsTransfer wmsTransfer = new WmsTransfer(); WmsTransfer wmsTransfer = new WmsTransfer();
wmsTransfer.setTaskCode(Seq.getId(Seq.wmsTransferSeqType, Seq.wmsTransferSeqCode)); wmsTransfer.setTaskCode(Seq.getId(Seq.wmsTransferSeqType, Seq.wmsTransferSeqCode));
@ -280,11 +283,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> mesBaseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoR == null) { if (mesBaseBarcodeInfoR == null) {
throw new ServiceException("物料码错误"); throw new ServiceException("物料码错误");
} }
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoR.getData(); MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoR.getData();
if (mesBaseBarcodeInfo == null) { if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料码错误"); throw new ServiceException("物料码错误");
} }
WmsBaseLocation targetLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(targetLocationCode); WmsBaseLocation targetLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(targetLocationCode);
@ -302,6 +305,13 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("没有此成品的转库出库记录,不能转库入库"); throw new ServiceException("没有此成品的转库出库记录,不能转库入库");
} }
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setLocationCode(targetLocationCode);
List<WmsProductStock> productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);
if(productStocks!=null && !productStocks.isEmpty()){
throw new ServiceException("此库位已经有库存,不能入库");
}
Long targetWarehouseId = targetLocation.getWarehouseId(); Long targetWarehouseId = targetLocation.getWarehouseId();
WmsBaseWarehouse targetWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetWarehouseId); WmsBaseWarehouse targetWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetWarehouseId);
@ -337,6 +347,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
productStock.setLocationCode(targetLocationCode); productStock.setLocationCode(targetLocationCode);
productStock.setStockType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT); productStock.setStockType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT);
productStock.setProductBatch(materialBarcode); productStock.setProductBatch(materialBarcode);
productStock.setPalletInfoCode(mesBaseBarcodeInfo.getPalletInfoCode());
// productStock.setQualityStatus();//todo: 获取质检状态 // productStock.setQualityStatus();//todo: 获取质检状态
productStock.setWarehouseFloor(targetWarehouse.getWarehouseFloor()); productStock.setWarehouseFloor(targetWarehouse.getWarehouseFloor());
productStock.setProductId(mesBaseBarcodeInfo.getMaterialId()); productStock.setProductId(mesBaseBarcodeInfo.getMaterialId());

@ -11,6 +11,7 @@
<result property="locationCode" column="location_code"/> <result property="locationCode" column="location_code"/>
<result property="stockType" column="stock_type"/> <result property="stockType" column="stock_type"/>
<result property="productBatch" column="product_batch"/> <result property="productBatch" column="product_batch"/>
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="qualityStatus" column="quality_status"/> <result property="qualityStatus" column="quality_status"/>
<result property="productId" column="product_id"/> <result property="productId" column="product_id"/>
<result property="planCode" column="plan_code"/> <result property="planCode" column="plan_code"/>
@ -41,6 +42,7 @@
wps.location_code, wps.location_code,
wps.stock_type, wps.stock_type,
wps.product_batch, wps.product_batch,
wps.pallet_info_code,
wps.quality_status, wps.quality_status,
wps.product_id, wps.product_id,
mbmi.material_code, mbmi.material_code,
@ -101,6 +103,7 @@
<if test="locationCode != null and locationCode != ''">location_code,</if> <if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="stockType != null and stockType != ''">stock_type,</if> <if test="stockType != null and stockType != ''">stock_type,</if>
<if test="productBatch != null">product_batch,</if> <if test="productBatch != null">product_batch,</if>
<if test="palletInfoCode != null">pallet_info_code,</if>
<if test="qualityStatus != null and qualityStatus != ''">quality_status,</if> <if test="qualityStatus != null and qualityStatus != ''">quality_status,</if>
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="planCode != null">plan_code,</if> <if test="planCode != null">plan_code,</if>
@ -122,6 +125,7 @@
<if test="locationCode != null and locationCode != ''">#{locationCode},</if> <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="stockType != null and stockType != ''">#{stockType},</if> <if test="stockType != null and stockType != ''">#{stockType},</if>
<if test="productBatch != null">#{productBatch},</if> <if test="productBatch != null">#{productBatch},</if>
<if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="qualityStatus != null and qualityStatus != ''">#{qualityStatus},</if> <if test="qualityStatus != null and qualityStatus != ''">#{qualityStatus},</if>
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="planCode != null">#{planCode},</if> <if test="planCode != null">#{planCode},</if>
@ -146,6 +150,7 @@
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if> <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="stockType != null and stockType != ''">stock_type = #{stockType},</if> <if test="stockType != null and stockType != ''">stock_type = #{stockType},</if>
<if test="productBatch != null">product_batch = #{productBatch},</if> <if test="productBatch != null">product_batch = #{productBatch},</if>
<if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
<if test="qualityStatus != null and qualityStatus != ''">quality_status = #{qualityStatus},</if> <if test="qualityStatus != null and qualityStatus != ''">quality_status = #{qualityStatus},</if>
<if test="productId != null">product_id = #{productId},</if> <if test="productId != null">product_id = #{productId},</if>
<if test="planCode != null">plan_code = #{planCode},</if> <if test="planCode != null">plan_code = #{planCode},</if>
@ -308,7 +313,7 @@
<if test="updateDate != null ">and wps.update_date = #{updateDate}</if> <if test="updateDate != null ">and wps.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if> <if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and wps.instock_date = #{instockDate}</if> <if test="instockDate != null ">and wps.instock_date = #{instockDate}</if>
and wps.totalAmount>0 and wps.total_amount>0
</where> </where>
</select> </select>

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="locationCode" column="location_code" /> <result property="locationCode" column="location_code" />
<result property="stockTotalId" column="stock_total_id" /> <result property="stockTotalId" column="stock_total_id" />
<result property="orderId" column="order_id" /> <result property="orderId" column="order_id" />
<result property="saleOrderId" column="sale_order_id" />
<result property="planCode" column="plan_code" /> <result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" /> <result property="planDetailCode" column="plan_detail_code" />
<result property="stationId" column="station_id" /> <result property="stationId" column="station_id" />
@ -22,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="endStationCode" column="end_station_code" /> <result property="endStationCode" column="end_station_code" />
<result property="operationType" column="operation_type" /> <result property="operationType" column="operation_type" />
<result property="taskType" column="task_type" /> <result property="taskType" column="task_type" />
<result property="splitFlag" column="split_flag" />
<result property="applyReason" column="apply_reason" /> <result property="applyReason" column="apply_reason" />
<result property="auditReason" column="audit_reason" /> <result property="auditReason" column="audit_reason" />
<result property="auditStatus" column="audit_status" /> <result property="auditStatus" column="audit_status" />
@ -74,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWmsRawOutstockVo"> <sql id="selectWmsRawOutstockVo">
select raw_outstock_id, task_code, warehouse_id, location_code, stock_total_id,order_id, plan_code, plan_detail_code, station_id, material_id, material_batch, pallet_info_code, outstock_amount, real_outstock_amount, end_station_code, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time, erp_status, erp_amount from wms_raw_outstock select raw_outstock_id, task_code, warehouse_id, location_code, stock_total_id,order_id,sale_order_id, plan_code, plan_detail_code, station_id, material_id, material_batch, pallet_info_code, outstock_amount, real_outstock_amount, end_station_code, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time, erp_status, erp_amount from wms_raw_outstock
</sql> </sql>
<select id="selectWmsRawOutstockList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult"> <select id="selectWmsRawOutstockList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialId != null "> and material_id = #{materialId}</if> <if test="materialId != null "> and material_id = #{materialId}</if>
<if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if> <if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if>
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if> <if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
<if test="splitFlag != null and splitFlag != ''"> and split_flag = #{splitFlag}</if>
<if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if> <if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if>
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if> <if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> <if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
@ -119,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationCode != null">location_code,</if> <if test="locationCode != null">location_code,</if>
<if test="stockTotalId != null">stock_total_id,</if> <if test="stockTotalId != null">stock_total_id,</if>
<if test="orderId != null">order_id,</if> <if test="orderId != null">order_id,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="planCode != null">plan_code,</if> <if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if> <if test="planDetailCode != null">plan_detail_code,</if>
<if test="stationId != null">station_id,</if> <if test="stationId != null">station_id,</if>
@ -130,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endStationCode != null">end_station_code,</if> <if test="endStationCode != null">end_station_code,</if>
<if test="operationType != null and operationType != ''">operation_type,</if> <if test="operationType != null and operationType != ''">operation_type,</if>
<if test="taskType != null and taskType != ''">task_type,</if> <if test="taskType != null and taskType != ''">task_type,</if>
<if test="splitFlag != null and splitFlag != ''">split_flag,</if>
<if test="applyReason != null">apply_reason,</if> <if test="applyReason != null">apply_reason,</if>
<if test="auditReason != null">audit_reason,</if> <if test="auditReason != null">audit_reason,</if>
<if test="auditStatus != null and auditStatus != ''">audit_status,</if> <if test="auditStatus != null and auditStatus != ''">audit_status,</if>
@ -151,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationCode != null">#{locationCode},</if> <if test="locationCode != null">#{locationCode},</if>
<if test="stockTotalId != null">#{stockTotalId},</if> <if test="stockTotalId != null">#{stockTotalId},</if>
<if test="orderId != null">#{orderId},</if> <if test="orderId != null">#{orderId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="planCode != null">#{planCode},</if> <if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if> <if test="planDetailCode != null">#{planDetailCode},</if>
<if test="stationId != null">#{stationId},</if> <if test="stationId != null">#{stationId},</if>
@ -162,6 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endStationCode != null">#{endStationCode},</if> <if test="endStationCode != null">#{endStationCode},</if>
<if test="operationType != null and operationType != ''">#{operationType},</if> <if test="operationType != null and operationType != ''">#{operationType},</if>
<if test="taskType != null and taskType != ''">#{taskType},</if> <if test="taskType != null and taskType != ''">#{taskType},</if>
<if test="splitFlag != null and splitFlag != ''">#{splitFlag},</if>
<if test="applyReason != null">#{applyReason},</if> <if test="applyReason != null">#{applyReason},</if>
<if test="auditReason != null">#{auditReason},</if> <if test="auditReason != null">#{auditReason},</if>
<if test="auditStatus != null and auditStatus != ''">#{auditStatus},</if> <if test="auditStatus != null and auditStatus != ''">#{auditStatus},</if>
@ -186,6 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if> <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="locationCode != null">location_code = #{locationCode},</if> <if test="locationCode != null">location_code = #{locationCode},</if>
<if test="orderId != null">order_id = #{orderId},</if> <if test="orderId != null">order_id = #{orderId},</if>
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="planCode != null">plan_code = #{planCode},</if> <if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if> <if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="stationId != null">station_id = #{stationId},</if> <if test="stationId != null">station_id = #{stationId},</if>
@ -197,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endStationCode != null">end_station_code = #{endStationCode},</if> <if test="endStationCode != null">end_station_code = #{endStationCode},</if>
<if test="operationType != null and operationType != ''">operation_type = #{operationType},</if> <if test="operationType != null and operationType != ''">operation_type = #{operationType},</if>
<if test="taskType != null and taskType != ''">task_type = #{taskType},</if> <if test="taskType != null and taskType != ''">task_type = #{taskType},</if>
<if test="splitFlag != null and splitFlag != ''">split_flag = #{splitFlag},</if>
<if test="applyReason != null">apply_reason = #{applyReason},</if> <if test="applyReason != null">apply_reason = #{applyReason},</if>
<if test="auditReason != null">audit_reason = #{auditReason},</if> <if test="auditReason != null">audit_reason = #{auditReason},</if>
<if test="auditStatus != null and auditStatus != ''">audit_status = #{auditStatus},</if> <if test="auditStatus != null and auditStatus != ''">audit_status = #{auditStatus},</if>
@ -298,9 +307,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="batchWmsRawOutstock"> <insert id="batchWmsRawOutstock">
insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,stock_total_id,order_id,plan_code,plan_detail_code,station_id,material_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,audit_status,execute_status,apply_by,apply_date,apply_reason) values insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,stock_total_id,order_id,sale_order_id,plan_code,plan_detail_code,station_id,material_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,split_flag,audit_status,execute_status,apply_by,apply_date,apply_reason) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.rawOutstockId}, #{item.taskCode}, #{item.warehouseId}, #{item.locationCode}, #{item.stockTotalId}, #{item.orderId}, #{item.planCode}, #{item.planDetailCode}, #{item.stationId}, #{item.materialId}, #{item.materialBatch}, #{item.palletInfoCode}, #{item.outstockAmount}, #{item.endStationCode}, #{item.operationType}, #{item.taskType}, #{item.auditStatus}, #{item.executeStatus}, #{item.applyBy}, #{item.applyDate}, #{item.applyReason}) ( #{item.rawOutstockId}, #{item.taskCode}, #{item.warehouseId}, #{item.locationCode}, #{item.stockTotalId}, #{item.orderId},#{item.saleOrderId}, #{item.planCode}, #{item.planDetailCode}, #{item.stationId}, #{item.materialId}, #{item.materialBatch}, #{item.palletInfoCode}, #{item.outstockAmount}, #{item.endStationCode}, #{item.operationType}, #{item.taskType}, #{item.splitFlag},#{item.auditStatus}, #{item.executeStatus}, #{item.applyBy}, #{item.applyDate}, #{item.applyReason})
</foreach> </foreach>
</insert> </insert>
@ -331,7 +340,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNewestWmsRawOutstock" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult"> <select id="selectNewestWmsRawOutstock" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
select wro.raw_outstock_id,wrod.material_barcode as material_batch from wms_raw_outstock wro left join wms_raw_outstock_detail wrod on wro.raw_outstock_id = wrod.raw_outstock_id select wro.raw_outstock_id,wrod.material_barcode as material_batch from wms_raw_outstock wro
left join wms_raw_outstock_detail wrod on wro.raw_outstock_id = wrod.raw_outstock_id
<where> <where>
<if test="planCode != null "> and wro.plan_code = #{planCode}</if> <if test="planCode != null "> and wro.plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and wro.plan_detail_code = #{planDetailCode}</if> <if test="planDetailCode != null "> and wro.plan_detail_code = #{planDetailCode}</if>

@ -32,6 +32,7 @@
wst.warehouse_floor, wst.warehouse_floor,
wst.stock_type, wst.stock_type,
wst.material_id, wst.material_id,
wst.sale_order_id,
mbmi.material_code, mbmi.material_code,
mbmi.material_name, mbmi.material_name,
wst.total_amount, wst.total_amount,

@ -82,17 +82,17 @@ export function uploadFile(data) {
} }
// 获取生产派工图纸List列表 // 获取生产派工图纸List列表
export function getDispatchDrawingList(planId) { export function getDispatchDrawingList(dispatchCode,processId) {
return request({ return request({
url: '/mes/productplan/drawingList/' + planId, url: '/mes/productplan/drawingList/' + dispatchCode+'/'+processId,
method: 'get' method: 'get'
}) })
} }
// 获取生产派工SOP附件List列表 // 获取生产派工SOP附件List列表
export function getDispatchSOPAttachList(planId) { export function getDispatchSOPAttachList(dispatchCode,processId) {
return request({ return request({
url: '/mes/productplan/SOPAttachList/' + planId, url: '/mes/productplan/SOPAttachList/' + dispatchCode+'/'+processId,
method: 'get' method: 'get'
}) })
} }

@ -3,12 +3,15 @@
<div class="headTitle">京源环保生产管理系统</div> <div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1"> <div class="chartBox chartBox1">
<div class="title">生产详细信息</div> <div class="title">生产明细</div>
<div class="chart"> <div class="chart">
<div class="form"> <div class="form">
<el-form :model="form" label-position="right" label-width="80px"> <el-form :model="form" label-position="right" label-width="80px">
<el-form-item label="工单编号"> <el-form-item label="派工单号">
<el-input v-model="form.dispatchCode"></el-input>
</el-form-item>
<el-form-item label="计划编号" v-if="false">
<el-input v-model="form.planCode"></el-input> <el-input v-model="form.planCode"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="明细编号"> <el-form-item label="明细编号">
@ -20,6 +23,9 @@
<el-form-item label="成品编号"> <el-form-item label="成品编号">
<el-input v-model="form.materialCode"></el-input> <el-input v-model="form.materialCode"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规格型号">
<el-input v-model="form.materialSpec"></el-input>
</el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-input v-model="form.planDetailStatus"></el-input> <el-input v-model="form.planDetailStatus"></el-input>
</el-form-item> </el-form-item>
@ -58,7 +64,7 @@
@click="handleBindBarcode">绑定 @click="handleBindBarcode">绑定
</el-button--> </el-button-->
<el-button v-if="($route.query && $route.query.id) !== '2'" type="warning" <el-button v-if="($route.query && $route.query.id) !== '2'" type="warning"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleRawBack">返库 :disabled="!form.planDetailCode" @click="handleRawBack">返库
</el-button> </el-button>
<el-button :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="success" <el-button :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="success"
@click="finish">完成 @click="finish">完成
@ -135,8 +141,14 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="工单编号" label="派工单号"
prop="dispatchCode"
>
</el-table-column>
<el-table-column
label="计划编号"
prop="planCode" prop="planCode"
v-if="false"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -167,8 +179,14 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="交付时间" label="计划开始时间"
prop="planDeliveryDate" prop="planBeginTime"
width="150"
>
</el-table-column>
<el-table-column
label="计划技术时间"
prop="planEndTime"
width="150" width="150"
> >
</el-table-column> </el-table-column>
@ -216,7 +234,7 @@
trigger="click"> trigger="click">
<div> <div>
<div style="margin: 15px 0;"> <div style="margin: 15px 0;">
<el-input placeholder="请扫描或输入背板条码" v-model="input1" class="input-with-select"> <el-input placeholder="请扫描或输入背板/门板条码" v-model="input1" class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button> <el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input> </el-input>
</div> </div>
@ -269,7 +287,10 @@
:title="applyMaterialTitle" :title="applyMaterialTitle"
width="40%"> width="40%">
<el-form ref="form" :model="form1" label-width="100px"> <el-form ref="form" :model="form1" label-width="100px">
<el-form-item label="工单编号"> <el-form-item label="派工单号">
<el-input v-model="form1.dispatchCode" disabled></el-input>
</el-form-item>
<el-form-item label="计划编号" v-if="false">
<el-input v-model="form1.planCode" disabled></el-input> <el-input v-model="form1.planCode" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="明细编号"> <el-form-item label="明细编号">
@ -394,7 +415,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="柜体条码" prop="materialBarcode"> <el-form-item label="柜体条码" prop="materialBarcode">
<el-input v-model="rawBackForm.materialBarcode" suffix-icon="el-icon-full-screen" style="width:380px"></el-input> <el-input v-model="rawBackForm.materialBarcode" suffix-icon="el-icon-full-screen"
style="width:380px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -407,7 +429,7 @@
<el-dialog <el-dialog
:visible.sync="materialConfirmVisible" :visible.sync="materialConfirmVisible"
title="确认物料使用" title="确认物料使用"
width="40%"> width="500px">
<el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px"> <el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px">
<el-form-item label="计划ID" prop="planId" v-if="false"> <el-form-item label="计划ID" prop="planId" v-if="false">
<el-input v-model="materialConfirmForm.planId"></el-input> <el-input v-model="materialConfirmForm.planId"></el-input>
@ -416,10 +438,10 @@
<el-input v-model="materialConfirmForm.planDetailId"></el-input> <el-input v-model="materialConfirmForm.planDetailId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料条码" prop="materialBarcode"> <el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="materialConfirmForm.materialBarcode"></el-input> <el-input v-model="materialConfirmForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="checkAmount"> <el-form-item label="数量" prop="checkAmount">
<el-input v-model="materialConfirmForm.checkAmount"></el-input> <el-input v-model="materialConfirmForm.checkAmount" disabled></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -644,7 +666,7 @@ export default {
materialBarcode: null, materialBarcode: null,
planId: null, planId: null,
planDetailId: null, planDetailId: null,
checkAmount: null checkAmount: 1
}, },
materialConfirmRules: { materialConfirmRules: {
materialBarcode: [ materialBarcode: [
@ -658,6 +680,10 @@ export default {
tableData: [], tableData: [],
nowStation: null, nowStation: null,
loginStationInfo: {}, loginStationInfo: {},
PROCESS_TYPE: {
FIFTH_SPLIT: '1',
FIFTH_ASSEMBLE: '2'
},
stationData: [ stationData: [
{ {
stationName: '五楼装配工位1', stationName: '五楼装配工位1',
@ -959,6 +985,8 @@ export default {
this.form.materialId = val.materialId this.form.materialId = val.materialId
this.form.materialCode = val.materialCode this.form.materialCode = val.materialCode
this.form.materialName = val.materialName this.form.materialName = val.materialName
this.form.materialSpec = val.materialSpec;
this.form.dispatchCode = val.dispatchCode;
this.form.planDetailStatus = setState(data.data.planDetailStatus) this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val) this.getInfo(val)
}, },
@ -967,7 +995,7 @@ export default {
}, },
async startPlan1(val) { async startPlan1(val) {
if (!this.input1 || this.input1 == null || this.input1 == undefined || this.input1 == '') { if (!this.input1 || this.input1 == null || this.input1 == undefined || this.input1 == '') {
this.$modal.msgWarning("请扫描或输入物料条码"); this.$modal.msgWarning("请扫描或输入背板/门板条码");
return; return;
} }
await this.startPlan(val, this.input1); await this.startPlan(val, this.input1);
@ -994,7 +1022,9 @@ export default {
this.form.materialId = val.materialId this.form.materialId = val.materialId
this.form.materialCode = val.materialCode this.form.materialCode = val.materialCode
this.form.materialName = val.materialName this.form.materialName = val.materialName
this.form.materialSpec = val.materialSpec
this.form.saleOrderId = val.saleOrderId this.form.saleOrderId = val.saleOrderId
this.form.dispatchCode = val.dispatchCode;
if (data) { if (data) {
this.form.planDetailStatus = setState(data.planDetailStatus) this.form.planDetailStatus = setState(data.planDetailStatus)
} }
@ -1357,14 +1387,17 @@ export default {
}) })
}, },
async finish() { async finish() {
let processType = this.$route.query && this.$route.query.id && this.$route.query.id === '2'
? this.PROCESS_TYPE.FIFTH_ASSEMBLE : this.PROCESS_TYPE.FIFTH_SPLIT;
this.$confirm('确认计划完成?', '提示', { this.$confirm('确认明细完成?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
const data = await completeProductPlanDetail({ const data = await completeProductPlanDetail({
planDetailId: this.form.planDetailId planDetailId: this.form.planDetailId,
processType: processType
}) })
if (data.code === 200) { if (data.code === 200) {
this.$message({ this.$message({
@ -1378,10 +1411,6 @@ export default {
this.tableClick(e.rows.find(v => v.planCode === this.form.planCode)) this.tableClick(e.rows.find(v => v.planCode === this.form.planCode))
}) })
}).catch(() => { }).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}); });
}, },
@ -1458,19 +1487,17 @@ export default {
receiveMaterial() { receiveMaterial() {
this.form1.taskType = this.taskType; this.form1.taskType = this.taskType;
applyRawOutstock(this.form1).then(e => { applyRawOutstock(this.form1).then(e => {
if (e.code === 200) {
this.dialogVisible = false this.dialogVisible = false
this.$message({ this.$message({
message: '申请领取成功', message: '申请领取成功',
type: 'success' type: 'success'
}); });
}
}) })
}, },
print() { print() {
getNewestOutstockCabinet({planDetailCode: this.form.planDetailCode}).then(response => { getNewestOutstockCabinet({planDetailCode: this.form.planDetailCode}).then(response => {
if(!response.data){ if (!response.data || !response.data.materialBatch || response.data.materialBatch ==='') {
this.$modal.msgWarning("请先领取柜体"); this.$modal.msgWarning("请先领取柜体");
return; return;
} }
@ -1568,7 +1595,7 @@ export default {
materialBarcode: null, materialBarcode: null,
planId: null, planId: null,
planDetailId: null, planDetailId: null,
checkAmount: null checkAmount: 1
}; };
this.resetForm("materialConfirmForm"); this.resetForm("materialConfirmForm");
}, },
@ -1579,7 +1606,7 @@ export default {
materialBarcode: null, materialBarcode: null,
planId: this.form.planId, planId: this.form.planId,
planDetailId: this.form.planDetailId, planDetailId: this.form.planDetailId,
checkAmount: null checkAmount: 1
}; };
this.materialConfirmVisible = true; this.materialConfirmVisible = true;
}, },
@ -1707,7 +1734,9 @@ export default {
}, },
completeCollectMaterials() { completeCollectMaterials() {
completeCollectMaterials({endStationCode:this.loginStationInfo.stationCode}).then(v => { // const loginStationCode = this.loginStationInfo.stationCode;
const loginStationCode = 'ZP_06';//todo
completeCollectMaterials({endStationCode: loginStationCode}).then(v => {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
}) })
}, },

@ -143,12 +143,12 @@ export default {
{ {
floor: 5, floor: 5,
processId: 51, processId: 51,
route: '/board/fifthFloor' route: '/board/fifthFloor'//
}, },
{ {
floor: 5, floor: 5,
processId: 52, processId: 52,
route: '/board/fifthFloor?id=2' route: '/board/fifthFloor?id=2'//
} }
] ]
}; };

@ -279,7 +279,7 @@
<el-input v-model="form.orderCode" placeholder="请输入工单编号" :disabled="true"/> <el-input v-model="form.orderCode" placeholder="请输入工单编号" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="销售类型" prop="saleType"> <el-form-item label="销售类型" prop="saleType">
<el-radio-group v-model="form.saleType" @input="changeSaleType"> <el-radio-group v-model="form.saleType">
<el-radio <el-radio
v-for="dict in dict.type.mes_sale_type" v-for="dict in dict.type.mes_sale_type"
:key="dict.value" :key="dict.value"
@ -346,7 +346,8 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="前置生产工单" prop="preOrderCode"> <el-form-item label="前置生产工单" prop="preOrderCode">
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled" readonly> <el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled"
readonly>
<el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -429,7 +430,8 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="前置生产工单" prop="preOrderCode"> <el-form-item label="前置生产工单" prop="preOrderCode">
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled" readonly> <el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled"
readonly>
<el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -753,10 +755,10 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleSaleOrderAdd() { handleSaleOrderAdd() {
if (this.form.saleType === null || this.form.saleType === undefined || this.form.saleType === '') { // if (this.form.saleType === null || this.form.saleType === undefined || this.form.saleType === '') {
this.$modal.msgWarning("请先选择销售类型!"); // this.$modal.msgWarning("");
return; // return;
} // }
this.saleOrderOpen = true; this.saleOrderOpen = true;
}, },
// //
@ -804,12 +806,12 @@ export default {
this.$modal.msgError("该销售订单销售成品信息不存在!"); this.$modal.msgError("该销售订单销售成品信息不存在!");
return; return;
} }
if (this.form.saleType && this.form.saleType === this.MES_SALE_TYPE.MES_SALE_TYPE_EXTERNAL) {
this.form.materialId = selectedRow.materialId; this.form.materialId = selectedRow.materialId;
this.form.materialCode = selectedRow.materialCode; this.form.materialCode = selectedRow.materialCode;
this.form.materialName = selectedRow.materialName; this.form.materialName = selectedRow.materialName;
this.getMaterialVisionList(); this.getMaterialVisionList();
}
this.saleOrderOpen = false; this.saleOrderOpen = false;
}, },
@ -841,14 +843,7 @@ export default {
this.form.materialBomId = null; this.form.materialBomId = null;
this.form.dispatchId = null; this.form.dispatchId = null;
this.form.saleOrderFlag = '1';// this.form.saleOrderFlag = '1';//
this.saleOrderDisabled = false; this.saleOrderDisabled = false;
if (value == this.MES_SALE_TYPE.MES_SALE_TYPE_EXTERNAL) {
this.materialDisabled = true;
} else {
this.materialDisabled = false;
}
}, },
getMaterialVisionList() { getMaterialVisionList() {
@ -979,10 +974,11 @@ export default {
this.$tab.closeOpenPage(router.currentRoute); this.$tab.closeOpenPage(router.currentRoute);
this.$tab.openPage("工单[" + orderCode + "]排产", '/mes/production-scheduling/index/' + productOrderId, params); this.$tab.openPage("工单[" + orderCode + "]排产", '/mes/production-scheduling/index/' + productOrderId, params);
}, },
/** 提交按钮 */ /** 销售订单新增提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
//
if (this.form.saleOrderFlag === '1' && this.form.saleAmount < this.form.planAmount) { if (this.form.saleOrderFlag === '1' && this.form.saleAmount < this.form.planAmount) {
return this.$modal.msgError("计划数量不能大于销售数量!"); return this.$modal.msgError("计划数量不能大于销售数量!");
} }

@ -115,13 +115,14 @@
<el-table-column align="center" label="派工标准工时(小时)" prop="productionTime" width="180"> <el-table-column align="center" label="派工标准工时(小时)" prop="productionTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number style="width:150px;" :min="0" v-model="scope.row.productionTime" :disabled="scope.row.children != null && scope.row.children !== undefined"/> <el-input-number style="width:150px;" :min="0" v-model="scope.row.productionTime"
:disabled="scope.row.processType === PROCESS_TYPE.MANUAL && scope.row.children != null && scope.row.children !== undefined"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="计划开始时间" prop="planBeginTime" width="230"> <el-table-column align="center" label="计划开始时间" prop="planBeginTime" width="230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.planBeginTime" style="width:200px;" <el-date-picker v-model="scope.row.planBeginTime" style="width:200px;"
:disabled="scope.row.children != null && scope.row.children !== undefined" :disabled="scope.row.processType === PROCESS_TYPE.MANUAL && scope.row.children != null && scope.row.children !== undefined"
clearable clearable
placeholder="请选择计划开始时间" placeholder="请选择计划开始时间"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
@ -131,7 +132,7 @@
<el-table-column align="center" label="计划完成时间" prop="planEndTime" width="230"> <el-table-column align="center" label="计划完成时间" prop="planEndTime" width="230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.planEndTime" style="width:200px;" <el-date-picker v-model="scope.row.planEndTime" style="width:200px;"
:disabled="scope.row.children != null && scope.row.children !== undefined" :disabled="scope.row.processType === PROCESS_TYPE.MANUAL && scope.row.children != null && scope.row.children !== undefined"
clearable clearable
placeholder="请选择计划完成时间" placeholder="请选择计划完成时间"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/> type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
@ -159,7 +160,7 @@
size="mini" size="mini"
type="primary" type="primary"
@click="handleDrawing(scope.row)" @click="handleDrawing(scope.row)"
v-if="scope.row.children != null && scope.row.children !== undefined" v-if="scope.row.processType !== PROCESS_TYPE.AUTO && scope.row.children != null && scope.row.children !== undefined"
>图纸 >图纸
</el-button> </el-button>
<el-button <el-button
@ -167,7 +168,7 @@
size="mini" size="mini"
type="success" type="success"
@click="handleSOP(scope.row)" @click="handleSOP(scope.row)"
v-if="scope.row.children != null && scope.row.children !== undefined" v-if="scope.row.processType !== PROCESS_TYPE.AUTO && scope.row.children != null && scope.row.children !== undefined"
>SOP >SOP
</el-button> </el-button>
@ -185,7 +186,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form> </el-form>
<el-form label-width="100px"> <el-form label-width="100px">
@ -271,7 +271,7 @@
:limit="limit" :limit="limit"
:headers="headers" :headers="headers"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:http-request="httpRequest" :http-request="httpSopRequest"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:file-list="fileList" :file-list="fileList"
> >
@ -455,8 +455,18 @@ export default {
}, },
// //
fileList: [], fileList: [],
// // Sop
uploadList: [], groupSopFile: {},
// Sop
groupSopFileList: [],
//
groupAttachFile: {},
//
groupAttachFileList: [],
//
uploadAttachList: [],
// SOP
uploadSopList: [],
//- //-
addProductPlanObject: {}, addProductPlanObject: {},
headers: { headers: {
@ -542,16 +552,19 @@ export default {
obj.deleteFlag = "1"; obj.deleteFlag = "1";
} }
obj.id = this.id obj.id = this.id
this.id = this.id + 1; this.id = this.id + 1;
let i = 0; let i = 0;
let processType;
productPlansByDispatch.forEach(groupedProductPlan => { productPlansByDispatch.forEach(groupedProductPlan => {
processType = groupedProductPlan.processType;
groupedProductPlan.id = this.id; groupedProductPlan.id = this.id;
groupedProductPlan.productionTime = groupedProductPlan.productionTime/60/60;
this.id = this.id + 1; this.id = this.id + 1;
groupedProductPlan.productionTime = groupedProductPlan.productionTime / 60 / 60;
obj.sopId = groupedProductPlan.sopId;
obj.attachId = groupedProductPlan.attachId;
if (i === 0) { if (i === 0 || groupedProductPlan.processType !== this.PROCESS_TYPE.MANUAL) {
obj.dispatchCode = groupedProductPlan.dispatchCode; obj.dispatchCode = groupedProductPlan.dispatchCode;
obj.dispatchAmount = groupedProductPlan.dispatchAmount; obj.dispatchAmount = groupedProductPlan.dispatchAmount;
obj.processId = groupedProductPlan.processId; obj.processId = groupedProductPlan.processId;
@ -572,16 +585,25 @@ export default {
obj.saleorderCode = this.form.saleorderCode; obj.saleorderCode = this.form.saleorderCode;
// false=true= // false=true=
obj.oldRowFlag = true; obj.oldRowFlag = true;
if (groupedProductPlan.processType !== this.PROCESS_TYPE.MANUAL) {
let cloneObj = deepClone(obj);
cloneObj.id = this.id
cloneObj.planId = groupedProductPlan.planId;
cloneObj.productionTime = groupedProductPlan.productionTime / 60 / 60;
this.id = this.id + 1;
cloneObj.children = [];
this.mesProductPlanList.push(cloneObj);
}
i++; i++;
} }
}); });
if (processType === this.PROCESS_TYPE.MANUAL) {
obj.children = productPlansByDispatch; obj.children = productPlansByDispatch;
this.mesProductPlanList.push(obj); this.mesProductPlanList.push(obj);
} }
}
// console.log(JSON.stringify(this.mesProductPlanList))
this.getId(this.mesProductPlanList); this.getId(this.mesProductPlanList);
@ -633,10 +655,11 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
// let dataList = this.mesProductPlanList.filter(plan => !plan.oldRowFlag); // let dataList = this.mesProductPlanList.filter(plan => !plan.oldRowFlag);
// if (dataList.length === 0) { if (this.mesProductPlanList.length === 0) {
// this.close(); this.$modal.msgError("无派工信息提交");
// return; return;
// } }
let dataList = this.mesProductPlanList; let dataList = this.mesProductPlanList;
let toUpdatedProductPlans = []; let toUpdatedProductPlans = [];
let undispathDesc; let undispathDesc;
@ -645,11 +668,13 @@ export default {
let dispatchFlag = false; let dispatchFlag = false;
undispathDesc = "派工单号为[" + e.dispatchCode + "],工序为[" + e.processName + "],请选择用户派工"; undispathDesc = "派工单号为[" + e.dispatchCode + "],工序为[" + e.processName + "],请选择用户派工";
if (!e.children || e.children.length <= 0) { if (e.processType !== this.PROCESS_TYPE.AUTO) {
if (!e.children || e.children.length <= 0) {//线
this.$modal.msgError(undispathDesc); this.$modal.msgError(undispathDesc);
return; return;
} }
for (let j = 0; j < e.children.length; j++) { for (let j = 0; j < e.children.length; j++) {
let processUser = e.children[j]; let processUser = e.children[j];
let toUpdatedProductPlan = deepClone(e); let toUpdatedProductPlan = deepClone(e);
@ -658,6 +683,8 @@ export default {
toUpdatedProductPlan.planBeginTime = processUser.planBeginTime; toUpdatedProductPlan.planBeginTime = processUser.planBeginTime;
toUpdatedProductPlan.planEndTime = processUser.planEndTime; toUpdatedProductPlan.planEndTime = processUser.planEndTime;
toUpdatedProductPlan.planId = processUser.planId; toUpdatedProductPlan.planId = processUser.planId;
toUpdatedProductPlan.attachId = e.attachId;
toUpdatedProductPlan.sopId = e.sopId;
toUpdatedProductPlan.children = null; toUpdatedProductPlan.children = null;
let productionTimeHour = processUser.productionTime; let productionTimeHour = processUser.productionTime;
@ -671,6 +698,8 @@ export default {
return; return;
} }
} }
} else {
toUpdatedProductPlans.push(e);
} }
if (toUpdatedProductPlans.length <= 0) { if (toUpdatedProductPlans.length <= 0) {
@ -678,6 +707,8 @@ export default {
return; return;
} }
}
// ( + <= ) // ( + <= )
// processIdplanAmountplanAmount // processIdplanAmountplanAmount
let dispatchAmountErrorMsg = ""; let dispatchAmountErrorMsg = "";
@ -728,7 +759,12 @@ export default {
orderAddMesProductPlanList( orderAddMesProductPlanList(
{productOrderId:this.form.productOrderId,dispatchAmount:currentDispatchAmount,mesProductPlanList: toUpdatedProductPlans, toDeletedPlanIds: this.toDeletedPlanIds}) {
productOrderId: this.form.productOrderId,
dispatchAmount: currentDispatchAmount,
mesProductPlanList: toUpdatedProductPlans,
toDeletedPlanIds: this.toDeletedPlanIds
})
.then(res => { .then(res => {
this.$modal.msgSuccess(res.msg); this.$modal.msgSuccess(res.msg);
this.close(); this.close();
@ -762,7 +798,11 @@ export default {
return item.planId; return item.planId;
}); });
deleteProductPlansByDispatchCode({productOrderId:this.form.productOrderId,dispatchCode:dispatchCode,dispatchAmount:dispatchSum}).then(res => { deleteProductPlansByDispatchCode({
productOrderId: this.form.productOrderId,
dispatchCode: dispatchCode,
dispatchAmount: dispatchSum
}).then(res => {
this.mesProductPlanList = this.mesProductPlanList.filter(function (item) { this.mesProductPlanList = this.mesProductPlanList.filter(function (item) {
return dispatchCode !== item.dispatchCode return dispatchCode !== item.dispatchCode
}); });
@ -793,45 +833,7 @@ export default {
const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), queryParams: this.$route.query.queryParams}}; const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), queryParams: this.$route.query.queryParams}};
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
/** 查看图纸 */
handleDrawing(row) {
this.fileList = [];
this.uploadList = [];
if (row.planId != null) {
getDispatchDrawingList(row.planId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadList.push(e.attachId);
})
})
}
this.addProductPlanObject = row;
this.blueprintModel = true;
},
/** 查看SOP附件 */
handleSOP(row) {
this.fileList = [];
this.uploadList = [];
if (row.planId != null) {
getDispatchSOPAttachList(row.planId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadList.push(e.attachId);
})
})
}
this.addProductPlanObject = row;
this.sopViewModel = true;
},
/** 生产计划添加按钮操作 */ /** 生产计划添加按钮操作 */
handleAddMesProductPlan() { handleAddMesProductPlan() {
@ -847,7 +849,7 @@ export default {
res.data.forEach((e, index) => { res.data.forEach((e, index) => {
let obj = {}; let obj = {};
if (i === 0) { if (i === 0) {
obj.deleteFlag = "1"; obj.deleteFlag = "1";//
i++; i++;
} }
obj.id = this.id obj.id = this.id
@ -880,11 +882,16 @@ export default {
// this.id = this.id + 1; // this.id = this.id + 1;
// }); // });
if (e.processType === this.PROCESS_TYPE.AUTO) {
obj.children = [];
} else {
obj.children = [{ obj.children = [{
id: this.id, id: this.id,
processId: obj.processId, processId: obj.processId,
planStatus: this.PLAN_STATUS.DISPATCHED planStatus: this.PLAN_STATUS.DISPATCHED
}] }]
}
this.id += 1; this.id += 1;
@ -921,53 +928,98 @@ export default {
handleDownload(file) { handleDownload(file) {
window.open(file.url); window.open(file.url);
}, },
/** 查看图纸 */
handleDrawing(row) {
this.fileList = [];
this.uploadAttachList = [];
if (row.oldRowFlag) {
getDispatchDrawingList(row.dispatchCode, row.processId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadAttachList.push(e.attachId);
})
})
}
this.groupAttachFileList.forEach(e => {
if (e.dispatchCode === row.dispatchCode && e.processId === row.processId) {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadAttachList.push(e.attachId);
}
})
this.addProductPlanObject = row;
this.blueprintModel = true;
},
/** 查看SOP附件 */
handleSOP(row) {
this.fileList = [];
this.uploadSopList = [];
if (row.oldRowFlag) {
getDispatchSOPAttachList(row.dispatchCode, row.processId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadSopList.push(e.attachId);
})
})
}
this.groupSopFileList.forEach(e => {
if (e.dispatchCode === row.dispatchCode && e.processId === row.processId) {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
this.uploadSopList.push(e.attachId);
}
})
this.addProductPlanObject = row;
this.sopViewModel = true;
},
// //
drawingFileUploadSubmit() { drawingFileUploadSubmit() {
// false=true=
if (this.addProductPlanObject.oldRowFlag) {
updateProductplan({
planId: this.addProductPlanObject.planId,
attachId: this.uploadList.join(","),
}).then(res => {
this.$modal.msgSuccess("上传图纸成功!");
}
)
} else {
for (let i = 0; i < this.mesProductPlanList.length; i++) { for (let i = 0; i < this.mesProductPlanList.length; i++) {
if (this.mesProductPlanList[i].index === this.addProductPlanObject.index) { let mesProductPlan = this.mesProductPlanList[i];
this.mesProductPlanList[i].attachId = this.uploadList.join(",");
if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
this.mesProductPlanList[i].attachId = this.uploadAttachList.join(",");
} }
} }
} this.uploadAttachList = [];
this.uploadList = [];
this.addProductPlanObject = null; this.addProductPlanObject = null;
this.blueprintModel = false; this.blueprintModel = false;
}, },
//SOP //SOP
sopFileUploadSubmit() { sopFileUploadSubmit() {
// false=true=
if (this.addProductPlanObject.oldRowFlag) {
updateProductplan({
planId: this.addProductPlanObject.planId,
sopId: this.uploadList.join(","),
}).then(res => {
this.$modal.msgSuccess("上传SOP附件成功");
}
)
} else {
for (let i = 0; i < this.mesProductPlanList.length; i++) { for (let i = 0; i < this.mesProductPlanList.length; i++) {
if (this.mesProductPlanList[i].index === this.addProductPlanObject.index) { let mesProductPlan = this.mesProductPlanList[i];
this.mesProductPlanList[i].sopId = this.uploadList.join(","); if (mesProductPlan.dispatchCode === this.addProductPlanObject.dispatchCode
&& mesProductPlan.processId === this.addProductPlanObject.processId) {
this.mesProductPlanList[i].sopId = this.uploadSopList.join(",");
} }
} }
}
this.uploadList = []; this.uploadSopList = [];
this.addProductPlanObject = null; this.addProductPlanObject = null;
this.sopViewModel = false; this.sopViewModel = false;
}, },
// //
httpRequest(file) { httpRequest(file) {
// //
const fileData = file.file; const fileData = file.file;
@ -978,13 +1030,48 @@ export default {
uploadFile(formData).then( uploadFile(formData).then(
(res) => { (res) => {
// //
this.uploadList.push(res.attachId); let groupAttachFile = {};
groupAttachFile.dispatchCode = this.addProductPlanObject.dispatchCode;
groupAttachFile.processId = this.addProductPlanObject.processId;
groupAttachFile.attachId = res.attachId;
groupAttachFile.attachPath = res.imgUrl;
groupAttachFile.attachName = res.fileName;
this.groupAttachFileList.push(groupAttachFile);
this.uploadAttachList.push(res.attachId);
}, (err) => { }, (err) => {
this.$refs.drawingUpload.clearFiles(); // this.$refs.drawingUpload.clearFiles(); //
this.$modal.closeLoading(); this.$modal.closeLoading();
} }
); );
}, },
//SOP
httpSopRequest(file) {
//
const fileData = file.file;
const formData = new FormData();
formData.append("file", fileData);
formData.append("processId", this.addProductPlanObject.processId);
formData.append("attachType", "1");
uploadFile(formData).then(
(res) => {
//
let groupSopFile = {};
groupSopFile.dispatchCode = this.addProductPlanObject.dispatchCode;
groupSopFile.processId = this.addProductPlanObject.processId;
groupSopFile.attachId = res.attachId;
groupSopFile.attachPath = res.imgUrl;
groupSopFile.attachName = res.fileName;
this.groupSopFileList.push(groupSopFile);
this.uploadSopList.push(res.attachId);
}, (err) => {
this.$refs.drawingUpload.clearFiles(); //
this.$modal.closeLoading();
}
);
},
// //
uploadedSuccessfully() { uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) { if (this.number > 0 && this.uploadList.length === this.number) {

Loading…
Cancel
Save