1、bom图纸修改:
图纸改为激光切割图纸,只为激光切割工序使用;对于已派工的不能随意修改,修改有留痕。
 SOP改为图纸&SOP,给所有工序下载和查看使用;对于未完成的可以随意修改,修改有留痕
 2、四楼板材入库,不需要再绑定库位才能入库,操作人员自行选择,入库时扫描库位码和固定条码再输入数量等信息入库。
 3、申请领料时,根据bom申请的,领料数量默认为bom的标准数量减去已申请的数量,并且申请数量不能大于标准数量;在非bom中申请bom中的物料必须输入领料原因
 4、五楼装配工序领料不需要开始就可以开始。
master
xs 5 months ago
parent d24fa22df2
commit 106a314a38

@ -91,6 +91,9 @@ public class MesSaleOrderRelate extends BaseEntity {
*/
private BigDecimal orderAmount;
private Long erpProductId;//erp的物料ID
public void setSaleOrderRelateId(Long saleOrderRelateId) {
this.saleOrderRelateId = saleOrderRelateId;
}
@ -263,6 +266,14 @@ public class MesSaleOrderRelate extends BaseEntity {
return virtualMaterialId + "-" + materialId;
}
public Long getErpProductId() {
return erpProductId;
}
public void setErpProductId(Long erpProductId) {
this.erpProductId = erpProductId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -3,7 +3,10 @@ package com.hw.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesBaseRoute;
import com.hw.mes.domain.MesBomAttachChange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -135,4 +138,18 @@ public class MesMaterialBomController extends BaseController
return success(mesMaterialBomService.getBomAttachInfo(attachType, materialBomIds));
}
/**
* BOMSOP,join mes_base_attach_info
* @param mesBomAttachChange
* @return
*/
@GetMapping("selectMesBomAttachChangeJoinList")
public TableDataInfo selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange)
{
startPage();
List<MesBomAttachChange> list = mesMaterialBomService.selectMesBomAttachChangeJoinList(mesBomAttachChange);
return getDataTable(list);
}
}

@ -325,7 +325,7 @@ public class MesProductPlanController extends BaseController {
}
/**
* List
* List(使)
* @param attachType
* @param dispatchCode
* @param processId
@ -338,6 +338,19 @@ public class MesProductPlanController extends BaseController {
return success(mesProductPlanService.getAttachInfoList(dispatchCode, processId, userId, attachType));
}
/**
* List(SOP/使)
* @param materialBomId
* @return List<MesBaseAttachInfo>
*/
@GetMapping(value = "/sopInfoList/{materialBomId}")
public AjaxResult getSopInfoList(@PathVariable("materialBomId") Long materialBomId) {
return success(mesProductPlanService.getSopInfoList(materialBomId));
}
/**
*
* @param attachType

@ -0,0 +1,200 @@
package com.hw.mes.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* BOMSOP mes_bom_attach_change
*
* @author xins
* @date 2025-08-22
*/
public class MesBomAttachChange extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long attachChangeId;
/** 关联mes_material_bom */
@Excel(name = "关联mes_material_bom")
private Long materialBomId;
/** 类型1激光切割图纸2图纸&SOP */
@Excel(name = "类型1激光切割图纸2图纸&SOP")
private String attachType;
/** 旧图纸ID关联mes_base_attach_info */
@Excel(name = "旧图纸ID关联mes_base_attach_info")
private Long oldAttachId;
/** 新图纸ID关联mes_base_attach_info */
@Excel(name = "新图纸ID关联mes_base_attach_info")
private Long newAttachId;
/** 变更类型(1删除2新增3修改) */
@Excel(name = "变更类型(1删除2新增3修改)")
private String changeType;
/** 计划ID */
@Excel(name = "计划ID")
private Long planId;
/** 计划派工单号 */
@Excel(name = "计划派工单号")
private String planCode;
/** 更新用户ID */
@Excel(name = "更新用户ID")
private Long changeUserId;
/** 更新人 */
@Excel(name = "更新人")
private String changeBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date changeTime;
private String attachName;
private String attachPath;
public void setAttachChangeId(Long attachChangeId)
{
this.attachChangeId = attachChangeId;
}
public Long getAttachChangeId()
{
return attachChangeId;
}
public void setMaterialBomId(Long materialBomId)
{
this.materialBomId = materialBomId;
}
public Long getMaterialBomId()
{
return materialBomId;
}
public String getAttachType() {
return attachType;
}
public void setAttachType(String attachType) {
this.attachType = attachType;
}
public void setOldAttachId(Long oldAttachId)
{
this.oldAttachId = oldAttachId;
}
public Long getOldAttachId()
{
return oldAttachId;
}
public void setNewAttachId(Long newAttachId)
{
this.newAttachId = newAttachId;
}
public Long getNewAttachId()
{
return newAttachId;
}
public void setChangeType(String changeType)
{
this.changeType = changeType;
}
public String getChangeType()
{
return changeType;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setPlanCode(String planCode)
{
this.planCode = planCode;
}
public String getPlanCode()
{
return planCode;
}
public void setChangeUserId(Long changeUserId)
{
this.changeUserId = changeUserId;
}
public Long getChangeUserId()
{
return changeUserId;
}
public void setChangeBy(String changeBy)
{
this.changeBy = changeBy;
}
public String getChangeBy()
{
return changeBy;
}
public void setChangeTime(Date changeTime)
{
this.changeTime = changeTime;
}
public Date getChangeTime()
{
return changeTime;
}
public String getAttachName() {
return attachName;
}
public void setAttachName(String attachName) {
this.attachName = attachName;
}
public String getAttachPath() {
return attachPath;
}
public void setAttachPath(String attachPath) {
this.attachPath = attachPath;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("attachChangeId", getAttachChangeId())
.append("materialBomId", getMaterialBomId())
.append("oldAttachId", getOldAttachId())
.append("newAttachId", getNewAttachId())
.append("changeType", getChangeType())
.append("planId", getPlanId())
.append("planCode", getPlanCode())
.append("changeUserId", getChangeUserId())
.append("changeBy", getChangeBy())
.append("changeTime", getChangeTime())
.toString();
}
}

@ -88,6 +88,16 @@ public class MesMaterialBom extends TreeEntity {
@Excel(name = "物料编码")
private String materialCode;
/**
* 01
*/
public String attachChangeFlag;
/**
* SOP01
*/
private String sopChangeFlag;
/**
* &
*/
@ -277,6 +287,32 @@ public class MesMaterialBom extends TreeEntity {
this.materialCode = materialCode;
}
public String getAttachChangeFlag() {
return attachChangeFlag;
}
public void setAttachChangeFlag(String attachChangeFlag) {
this.attachChangeFlag = attachChangeFlag;
}
public String getSopChangeFlag() {
return sopChangeFlag;
}
public void setSopChangeFlag(String sopChangeFlag) {
this.sopChangeFlag = sopChangeFlag;
}
@Override
public String getAncestors() {
return ancestors;
}
@Override
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getMaterialSpec() {
return materialSpec;
}

@ -0,0 +1,78 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesBomAttachChange;
/**
* BOMSOPMapper
*
* @author xins
* @date 2025-08-22
*/
public interface MesBomAttachChangeMapper
{
/**
* BOMSOP
*
* @param attachChangeId BOMSOP
* @return BOMSOP
*/
public MesBomAttachChange selectMesBomAttachChangeByAttachChangeId(Long attachChangeId);
/**
* BOMSOP
*
* @param mesBomAttachChange BOMSOP
* @return BOMSOP
*/
public List<MesBomAttachChange> selectMesBomAttachChangeList(MesBomAttachChange mesBomAttachChange);
/**
* BOMSOP
*
* @param mesBomAttachChange BOMSOP
* @return
*/
public int insertMesBomAttachChange(MesBomAttachChange mesBomAttachChange);
/**
* BOMSOP
*
* @param mesBomAttachChange BOMSOP
* @return
*/
public int updateMesBomAttachChange(MesBomAttachChange mesBomAttachChange);
/**
* BOMSOP
*
* @param attachChangeId BOMSOP
* @return
*/
public int deleteMesBomAttachChangeByAttachChangeId(Long attachChangeId);
/**
* BOMSOP
*
* @param attachChangeIds
* @return
*/
public int deleteMesBomAttachChangeByAttachChangeIds(Long[] attachChangeIds);
/**
* BOMSOP
*
* @param mesBomAttachChangeList BOMSOP
* @return
*/
public int batchMesBomAttachChange(List<MesBomAttachChange> mesBomAttachChangeList);
/**
* BOMSOP,join mes_base_attach_info
*
* @param mesBomAttachChange BOMSOP
* @return BOMSOP
*/
public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange);
}

@ -74,4 +74,22 @@ public interface MesMaterialBomMapper
* @return
*/
public int batchMesMaterialBom(List<MesMaterialBom> mesMaterialBomList);
/**
* BOM,ID
*
* @param mesMaterialBom BOM
* @return BOM
*/
public List<MesMaterialBom> selectParentMesMaterialBomList(MesMaterialBom mesMaterialBom);
/**
* bomIDbom,sopIDsop
*
* @param materialBomId BOMID
* @return BOM
*/
public List<MesMaterialBom> selectMesMaterialBomWithChildSopList(Long materialBomId);
}

@ -3,6 +3,7 @@ package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesBaseAttachInfo;
import com.hw.mes.domain.MesBomAttachChange;
import com.hw.mes.domain.MesMaterialBom;
/**
@ -99,4 +100,12 @@ public interface IMesMaterialBomService
* @return
*/
public List<MesBaseAttachInfo> getBomAttachInfo(String attachType, Long[] materialBomIds);
/**
* BOMSOP,join mes_base_attach_info
* @param mesBomAttachChange
* @return
*/
public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange);
}

@ -195,6 +195,14 @@ public interface IMesProductPlanService
*/
public List<MesBaseAttachInfo> getAttachInfoList(String dispatchCode, Long processId, Long userId, String attachType);
/**
* List(SOP/)
*
* @param materialBomId
* @return List<MesBaseAttachInfo>
*/
public List<MesBaseAttachInfo> getSopInfoList(Long materialBomId);
/**
*
* @param attachType

@ -277,7 +277,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public int generateNoPurchaseRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
BigDecimal barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount();
List<MesBaseBarcodeInfo> toInsertedBarcodeInfos = new ArrayList<>();
@ -305,7 +305,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public int generateRegularRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPurchaseOrderId(mesBaseBarcodeInfo.getPurchaseOrderId());
queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
@ -337,7 +337,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
Date currentDate = new Date();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
String planCode = mesBaseBarcodeInfo.getPlanCode();
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
@ -523,7 +523,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
int barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount().intValue();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
for (int i = 0; i < barcodeAmount; i++) {
@ -603,7 +603,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (StringUtils.isNotEmpty(dbBaseBarcodeInfo.getPrintFlag()) && dbBaseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_YES)) {
throw new ServiceException("此条码已经打印,不能修改");
}
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
@ -620,7 +620,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
MesBaseBarcodeInfo dbBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBarcodeInfo());
if (StringUtils.isEmpty(dbBaseBarcodeInfo.getPlanCode())) {
mesBaseBarcodeInfo.setBarcodeId(dbBaseBarcodeInfo.getBarcodeId());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
} else {
@ -700,7 +700,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
try {
String hostIp = IpUtils.getIpAddr();
if(hostIp.equals("192.168.2.10")){
if (hostIp.equals("192.168.2.10")) {
hostIp = "192.168.2.26";
}
String printKey = "print_" + hostIp;
@ -727,9 +727,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setPrintTime(DateUtils.getNowDate());
mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_YES);
mesBaseBarcodeInfo.setPrintNumber(mesBaseBarcodeInfo.getPrintNumber() == null ? 1L : mesBaseBarcodeInfo.getPrintNumber() + 1);
mesBaseBarcodeInfo.setAcceptedDate(currentDate);
@ -835,7 +835,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
productBarcodeInfo.setBindBarcode(materialBarcode);
productBarcodeInfo.setBindBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
productBarcodeInfo.setBindBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
productBarcodeInfo.setBindTime(new Date());
productBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
productBarcodeInfo.setPlanDetailCode(planDetailCode);
@ -932,7 +932,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
boolean palletInfoCodeRepeat = false;
String palletInfoCode = "";
String barcodeInfo = "";
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
Date currentDate = DateUtils.getNowDate();
if (productBarcodesArr != null) {
StringBuilder materialNameBuilder = new StringBuilder();
@ -1258,7 +1258,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(errorMsg);
}
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
MesBaseAbandonBarcode mesBaseAbandonBarcode = new MesBaseAbandonBarcode();
mesBaseAbandonBarcode.setBarcodeId(mesBaseBarcodeInfo.getBarcodeId());
@ -1427,7 +1427,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
return false;
}
mesBaseBarcodeInfo.setBarcodeId(dbMesBaseBarcodeInfo.getBarcodeId());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
updateSize += mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
@ -1445,7 +1445,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Transactional(rollbackFor = Exception.class)
public int generateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
List<MesSaleOrderRelate> mesSaleOrderRelateList = mesBaseBarcodeInfo.getMesSaleOrderRelateList();
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
@ -1454,85 +1454,43 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
int materialNameLength = 4;
String splitCharacter = "|";
StringBuilder materialNameBuilder = new StringBuilder();//将多个物料的名称拼接(取前几个字符(materialNameLength)拼接,目前是前4个字符
//MESSALEORDERRELATE:原先是跟销售订单关联(前提是先需要销售订单跟采购订单绑定),目前取消绑定,直接选择销售订单
for (MesSaleOrderRelate mesSaleOrderRelate : mesSaleOrderRelateList) {
if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) {
throw new ServiceException("请选择采购数量为1的采购订单信息");
}
Long orderBindId = mesSaleOrderRelate.getOrderBindId();
MesOrderBind dbOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId);
if (dbOrderBind.getBindAmount().compareTo(BigDecimal.ONE) != 0) {
errorMsgBuilder.append(String.format("序号%s订单绑定数量需要为1", mesSaleOrderRelate.getIndex()));
}
if (dbOrderBind.getBarcodeAmount().compareTo(BigDecimal.ONE) >= 0) {
errorMsgBuilder.append(String.format("序号%s已经生成条码不能再次选择", mesSaleOrderRelate.getIndex()));
}
Long relateSaleOrderId = mesSaleOrderRelate.getRelateSaleOrderId();
Long purchaseOrderId = mesSaleOrderRelate.getPurchaseOrderId();
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
querySaleOrderRelate.setRelateSaleOrderId(relateSaleOrderId);
querySaleOrderRelate.setPurchaseOrderId(purchaseOrderId);
List<MesSaleOrderRelate> mesSaleOrderRelates = mesSaleOrderRelateMapper.selectMesSaleOrderRelateList(querySaleOrderRelate);
if (mesSaleOrderRelates != null && !mesSaleOrderRelates.isEmpty()) {
errorMsgBuilder.append(String.format("序号%s销售订单已经合并关联过;", mesSaleOrderRelate.getIndex()));
errorMsgBuilder.append(String.format("序号%s采购订单已经合并关联过", mesSaleOrderRelate.getIndex()));
}
MesSaleOrder saleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(relateSaleOrderId);
BigDecimal saleOrderAmount = saleOrder.getOrderAmount();
BigDecimal availableAmount = mesSaleOrderRelate.getRelateSaleOrderAmount();
if (availableAmount.compareTo(BigDecimal.ONE) != 0) {
errorMsgBuilder.append(String.format("序号%s需要选择可用数量为1的信息", mesSaleOrderRelate.getIndex()));
}
if (!saleOrder.getIsRelease().equals(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH)) {
errorMsgBuilder.append(String.format("序号%s销售订单已经发布生产任务不能合并", mesSaleOrderRelate.getIndex()));
}
if (saleOrderAmount.compareTo(availableAmount) != 0) {
errorMsgBuilder.append(String.format("序号%s需要选择销售订单数量为1的信息", mesSaleOrderRelate.getIndex()));
}
//purchaseorder可以不用判断主要看生成条码的数量
//找到销售订单物料的顶级bom信息
Long erpMaterialId = saleOrder.getMaterialId();
//找到物料的父级bom信息目前只有一级bom父级就是顶级
Long materialId = mesSaleOrderRelate.getMaterialId();
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setErpMaterialId(erpMaterialId);
queryMaterialBom.setMaterialId(materialId);
queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL);
queryMaterialBom.setParentId(0L);
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectParentMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms == null || mesMaterialBoms.isEmpty()) {
errorMsgBuilder.append("序号").append(mesSaleOrderRelate.getIndex()).append("销售订单成品没有配置bom信息[成品编号:")
.append(mesSaleOrderRelate.getProductCode()).append("成品名称:").append(mesSaleOrderRelate.getProductName())
.append("成品规格").append(mesSaleOrderRelate.getProductSpec()).append("; ");
errorMsgBuilder.append("序号").append(mesSaleOrderRelate.getIndex()).append("物料没有配置bom信息");
} else if (mesMaterialBoms.size() > 1) {
errorMsgBuilder.append("序号").append(mesSaleOrderRelate.getIndex()).append("销售订单成品配置bom信息多余一条[成品编号:")
.append(mesSaleOrderRelate.getProductCode()).append("成品名称:").append(mesSaleOrderRelate.getProductName())
.append("成品规格").append(mesSaleOrderRelate.getProductSpec()).append("; ");
errorMsgBuilder.append("序号").append(mesSaleOrderRelate.getIndex()).append("物料配置bom信息多于一条");
} else {
//修改
MesMaterialBom mesMaterialBom = mesMaterialBoms.get(0);
//判断所选物料是否在销售订单的成品bom中在绑定时判断
// MesMaterialBom queryChildBom = new MesMaterialBom();
// queryChildBom.setAncestors();
// queryChildBom.setMaterialId(mesSaleOrderRelate.getMaterialId());
// List<MesMaterialBom> childBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryChildBom);
// if(childBoms==null || childBoms.isEmpty()){
// throw new ServiceException("选择的物料信息");
// }
mesSaleOrderRelate.setProductId(mesMaterialBom.getMaterialId());
mesSaleOrderRelate.setErpProductId(mesMaterialBom.getErpMaterialId());
toUpdatedMaterialBoms.add(mesMaterialBom);
}
//更新采购订单和销售订单绑定信息的条码数量
dbOrderBind.setBarcodeAmount(dbOrderBind.getBarcodeAmount().add(availableAmount));
dbOrderBind.setUpdateTime(currentDate);
dbOrderBind.setUpdateBy(userName);
mesOrderBindMapper.updateMesOrderBind(dbOrderBind);
String materialName = mesSaleOrderRelate.getMaterialName();
materialName = materialName.substring(0, materialNameLength);
materialName = materialName.length() > 4 ? materialName.substring(0, materialNameLength) : materialName;
materialNameBuilder.append(splitCharacter).append(materialName);
// materialCodes.add(mesPurchaseOrderVo.getMaterialCode());
}
@ -1551,6 +1509,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
//创建虚拟销售订单,保存对应的销售订单列表
MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate);
//创建虚拟bom并合并销售订单的bom信息
this.insertVirtualMaterialBom(materialId, barcodeInfo, toUpdatedMaterialBoms, userName, currentDate);
@ -1562,9 +1521,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
MesBaseBarcodeInfo toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, barcodeInfo, batchCode, userName, currentDate);
toInsertedBarcodeInfo.setPurchaseOrderId(-1L);
toInsertedBarcodeInfo.setMaterialId(materialId);
toInsertedBarcodeInfo.setSaleOrderId(virtualSaleOrder.getSaleOrderId());
toInsertedBarcodeInfo.setSaleOrderId(0L);
toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode());
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE);
toInsertedBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size()));
// toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString());
@ -1609,33 +1568,45 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public MesSaleOrder insertNewVirtualSaleOrder(Long materialId, String barcodeInfo, String saleOrderCode,
List<MesSaleOrderRelate> mesSaleOrderRelates, String userName, Date currentDate) {
saleOrderCode = StringUtils.isEmpty(saleOrderCode)?Seq.getNewId(Seq.mesSaleOrderSeqType, Seq.mesSaleOrderSeqCode):saleOrderCode;
MesSaleOrder virtualMesSaleOrder = new MesSaleOrder();
virtualMesSaleOrder.setMaterialId(materialId);
virtualMesSaleOrder.setMaterialCode(barcodeInfo);
virtualMesSaleOrder.setMaterialName(barcodeInfo);
virtualMesSaleOrder.setOrderAmount(BigDecimal.ONE);
virtualMesSaleOrder.setSaleorderCode(saleOrderCode);
virtualMesSaleOrder.setIsRelease(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH);
// mesSaleOrder.setPlanDeliveryDate();
virtualMesSaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_VIRTUAL);
virtualMesSaleOrder.setCreateBy(userName);
virtualMesSaleOrder.setCreateTime(currentDate);
mesSaleOrderMapper.insertMesSaleOrder(virtualMesSaleOrder);
// Optional<MesSaleOrderRelate> minMesSaleOrderRelate = mesSaleOrderRelates.stream()
// .filter(msor -> msor.getPlanDeliveryDate() != null)
// .min((obj1, obj2) -> obj1.getPlanDeliveryDate().compareTo(obj2.getPlanDeliveryDate()));
for (MesSaleOrderRelate msor : mesSaleOrderRelates) {
MesSaleOrder querySaleOrder = new MesSaleOrder();
querySaleOrder.setMaterialId(msor.getErpProductId());
List<MesSaleOrder> mesSaleOrders = mesSaleOrderMapper.selectMesSaleOrderList(querySaleOrder);
if (mesSaleOrders == null || mesSaleOrders.size() == 0) {
throw new RuntimeException("序号" + msor.getIndex() + ":没有对应的销售订单");
} else if (mesSaleOrders.size() > 1) {
throw new RuntimeException("序号" + msor.getIndex() + "对应的销售订单数量多于1条");
} else {
MesSaleOrder mesSaleOrder = mesSaleOrders.get(0);
msor.setRelateSaleOrderId(mesSaleOrder.getSaleOrderId());
}
MesSaleOrder mesSaleOrder = new MesSaleOrder();
mesSaleOrder.setMaterialId(materialId);
mesSaleOrder.setMaterialCode(barcodeInfo);
mesSaleOrder.setMaterialName(barcodeInfo);
mesSaleOrder.setOrderAmount(BigDecimal.ONE);
mesSaleOrder.setSaleorderCode(saleOrderCode);
mesSaleOrder.setIsRelease(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH);
// mesSaleOrder.setPlanDeliveryDate();
mesSaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_VIRTUAL);
mesSaleOrder.setCreateBy(userName);
mesSaleOrder.setCreateTime(currentDate);
mesSaleOrderMapper.insertMesSaleOrder(mesSaleOrder);
mesSaleOrderRelates.forEach(msor -> {
msor.setSaleOrderId(mesSaleOrder.getSaleOrderId());
msor.setSaleOrderId(virtualMesSaleOrder.getSaleOrderId());
msor.setBarcodeInfo(barcodeInfo);
msor.setVirtualMaterialId(materialId);
});
}
mesSaleOrderRelateMapper.batchMesSaleOrderRelate(mesSaleOrderRelates);
return mesSaleOrder;
return virtualMesSaleOrder;
}
@ -1760,7 +1731,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Transactional(rollbackFor = Exception.class)
public int updateMergeRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
String barcodeInfo = mesBaseBarcodeInfo.getBarcodeInfo();
//修改后的合并信息
@ -2018,11 +1989,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
*
* @param mesBaseBarcodeInfoList
* @return
*/
@Override
@Transactional(rollbackFor=Exception.class)
@Transactional(rollbackFor = Exception.class)
public int batchAddMesBaseBarcodeInfo(List<MesBaseBarcodeInfo> mesBaseBarcodeInfoList) {
for (MesBaseBarcodeInfo mesBaseBarcodeInfo : mesBaseBarcodeInfoList) {
// 生成原材料条码

@ -2,6 +2,7 @@ package com.hw.mes.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -15,7 +16,10 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.MailUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.redis.service.RedisService;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesBaseAttachInfo;
import com.hw.mes.domain.MesBomAttachChange;
import com.hw.mes.mapper.MesBomAttachChangeMapper;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.service.IMesBaseAttachInfoService;
import com.hw.system.api.RemoteUserService;
@ -39,6 +43,9 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
@Autowired
private MesMaterialBomMapper mesMaterialBomMapper;
@Autowired
private MesBomAttachChangeMapper mesBomAttachChangeMapper;
@Autowired
private RemoteUserService remoteUserService;
@ -243,6 +250,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
/**
*
*
* @param mesMaterialBom
* @return
*/
@ -252,41 +260,130 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
List<SysUser> sysUserList = new ArrayList<>();
StringBuilder sendMsg = new StringBuilder();
sendMsg.append("BOM名称:").append(mesMaterialBom.getMaterialName());
if (mesMaterialBom.getUserNameList().size() == 0){
if (mesMaterialBom.getUserNameList().size() == 0) {
throw new ServiceException("请选择通知用户!");
}
for (String userName : mesMaterialBom.getUserNameList()) {
R<LoginUser> userInfo = remoteUserService.getUserInfo(userName, SecurityConstants.INNER);
SysUser sysUser = userInfo.getData().getSysUser();
if (StringUtils.isEmpty(sysUser.getEmail())){
throw new ServiceException(sysUser.getNickName() + "用户未维护邮箱!");
if (StringUtils.isEmpty(sysUser.getEmail())) {
// throw new ServiceException(sysUser.getNickName() + "用户未维护邮箱!");
}
sysUserList.add(sysUser);
}
if (mesMaterialBom.getAttachType().equals("1")){
sendMsg.append(",图纸已维护成功!");
MesMaterialBom dbMaterialBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(mesMaterialBom.getMaterialBomId());
if (mesMaterialBom.getAttachType().equals("1")) {
sendMsg.append(",激光切割图纸已维护成功!");
String dbAttachIdStr = dbMaterialBom.getAttachId();
String attachIdStr = mesMaterialBom.getAttachId();
boolean isAttachChange = insertBomAttachChange(mesMaterialBom.getMaterialBomId(), "1", attachIdStr, dbAttachIdStr);
if (isAttachChange) {
mesMaterialBom.setAttachChangeFlag("1");
}
} else {
sendMsg.append("SOP已维护成功");
sendMsg.append(",图纸&SOP已维护成功");
String dbSopIdStr = dbMaterialBom.getSopId();
String sopIdStr = mesMaterialBom.getSopId();
boolean isSopChange = insertBomAttachChange(mesMaterialBom.getMaterialBomId(), "2", sopIdStr, dbSopIdStr);
if (isSopChange) {
mesMaterialBom.setSopChangeFlag("1");
}
}
String emailAccountInfo = redisService.getCacheObject(CacheConstants.SYS_EAMIL_ACCOUNT_INFO);
String emailAccount = "";
String emailPassword = "";
if(StringUtils.isNotEmpty(emailAccountInfo)){
if (StringUtils.isNotEmpty(emailAccountInfo)) {
int splitIndex = emailAccountInfo.indexOf(",");
emailAccount = emailAccountInfo.substring(0,splitIndex);
emailPassword = emailAccountInfo.substring(splitIndex+1);
emailAccount = emailAccountInfo.substring(0, splitIndex);
emailPassword = emailAccountInfo.substring(splitIndex + 1);
}
for (SysUser sysUser : sysUserList) {
String email = sysUser.getEmail();
MailUtils.processSendEmail(emailAccount,emailPassword,email, "上传图纸通知", sendMsg.toString());
// MailUtils.processSendEmail(emailAccount,emailPassword,email, "上传图纸通知", sendMsg.toString());
}
mesMaterialBom.setUpdateTime(DateUtils.getNowDate());
return mesMaterialBomMapper.updateMesMaterialBom(mesMaterialBom);
}
private boolean insertBomAttachChange(Long materialBomId, String attachType, String attachIdStr, String dbAttachIdStr) {
List<Long> dbAttachList = new ArrayList<>();
if (StringUtils.isNotEmpty(dbAttachIdStr)) {
String[] dbSplit = dbAttachIdStr.split(",");
dbAttachList = Arrays.stream(dbSplit)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
}
List<Long> attachList = new ArrayList<>();
if (StringUtils.isNotEmpty(attachIdStr)) {
String[] split = attachIdStr.split(",");
attachList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
.collect(Collectors.toList());
}
List<Long> delAttachList = new ArrayList<>();
if (!dbAttachList.isEmpty()) {
for (Long dbAttachId : dbAttachList) {
if (!attachList.contains(dbAttachId)) {
delAttachList.add(dbAttachId);
}
}
}
List<Long> newAttachList = new ArrayList<>();
if (!attachList.isEmpty()) {
for (Long attachId : attachList) {
if (!dbAttachList.contains(attachId)) {
newAttachList.add(attachId);
}
}
}
List<MesBomAttachChange> mesBomAttachChangeList = new ArrayList<>();
for (Long delAttachId : delAttachList) {
mesBomAttachChangeList.add(getMaterialBomChange(materialBomId, attachType, delAttachId, "1"));
}
for (Long newAttachId : newAttachList) {
mesBomAttachChangeList.add(getMaterialBomChange(materialBomId, attachType, newAttachId, "2"));
}
if (!mesBomAttachChangeList.isEmpty()) {
mesBomAttachChangeMapper.batchMesBomAttachChange(mesBomAttachChangeList);
}
return !delAttachList.isEmpty();
}
public MesBomAttachChange getMaterialBomChange(Long materialBomId, String attachType, Long attachId, String changeType) {
MesBomAttachChange mesBomAttachChange = new MesBomAttachChange();
mesBomAttachChange.setMaterialBomId(materialBomId);
mesBomAttachChange.setAttachType(attachType);
mesBomAttachChange.setChangeType(changeType);
mesBomAttachChange.setChangeUserId(SecurityUtils.getUserId());
mesBomAttachChange.setChangeBy(SecurityUtils.getLoginUser() == null ?
SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesBomAttachChange.setChangeTime(new Date());
mesBomAttachChange.setNewAttachId(attachId);
return mesBomAttachChange;
}
/**
* BOM
*
* @param attachType
* @param materialBomIds
* @return
@ -299,8 +396,8 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
mesMaterialBom.setAncestors(materialBomId.toString());
List<MesMaterialBom> materialBomList = mesMaterialBomMapper.selectMesMaterialBomList(mesMaterialBom);
for (MesMaterialBom materialBom : materialBomList) {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)){
if (StringUtils.isNotEmpty(materialBom.getAttachId())){
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isNotEmpty(materialBom.getAttachId())) {
String[] split = materialBom.getAttachId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
@ -308,7 +405,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
attachIdList.addAll(longList);
}
} else {
if (StringUtils.isNotEmpty(materialBom.getSopId())){
if (StringUtils.isNotEmpty(materialBom.getSopId())) {
String[] split = materialBom.getSopId().split(",");
List<Long> longList = Arrays.stream(split)
.map(Long::valueOf) // 转换每个字符串为 Long
@ -318,11 +415,20 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
}
}
}
if (attachIdList.size() > 0){
if (attachIdList.size() > 0) {
Long[] attachIds = attachIdList.toArray(new Long[0]);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
}
return null;
}
/**
* BOMSOP,join mes_base_attach_info
* @param mesBomAttachChange
* @return
*/
@Override
public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange){
return mesBomAttachChangeMapper.selectMesBomAttachChangeJoinList(mesBomAttachChange);
}
}

@ -67,6 +67,9 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesMaterialBomMapper mesMaterialBomMapper;
@Autowired
private MesConfig mesConfig;
@ -334,7 +337,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
}
} else {
mesProductPlan.setPlanAmount(mesProductPlan.getDispatchAmount());
mesProductPlan.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesProductPlan.setCreateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
if (mesProductPlan.getSaleOrderId() == null) {
@ -592,7 +595,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
throw new ServiceException("此条码为非原材料条码");
}
String userName = SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname();
String userName = SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname();
Date currentDate = new Date();
MesMaterialCheckResult mesMaterialCheckResult = mesMaterialCheckResultMapper.
selectMesMaterialCheckResultByUI(planId, planDetailId, materialId);
@ -676,7 +679,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
MesMaterialAssignInfo mesMaterialAssignInfo = new MesMaterialAssignInfo();
mesMaterialAssignInfo.setMaterialBarcode(materialBarcode);
mesMaterialAssignInfo.setStationId(stationId);
mesMaterialAssignInfo.setCreateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesMaterialAssignInfo.setCreateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesMaterialAssignInfo.setCreateTime(currentDate);
mesMaterialAssignInfoMapper.insertMesMaterialAssignInfo(mesMaterialAssignInfo);
@ -754,14 +757,13 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
MesProductOrder mesProductOrder = mesProductOrderService.selectMesProductOrderByProductOrderId(mesProductPlanDeleteVo.getProductOrderId());
BigDecimal dispatchedAmount = mesProductOrder.getDispatchAmount();
mesProductOrder.setDispatchAmount(dispatchedAmount.subtract(dispatchAmount));
mesProductOrder.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
mesProductOrder.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
mesProductOrder.setUpdateTime(new Date());
return mesProductOrderMapper.updateMesProductOrder(mesProductOrder);
}
/**
* Join user,material,process,productorder
*
@ -775,6 +777,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
/**
* List
*
* @param attachType
* @param dispatchCode
* @param processId
@ -819,8 +822,41 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
return new ArrayList<>();
}
/**
* List(SOP/)
*
* @param materialBomId
* @return List<MesBaseAttachInfo>
*/
@Override
public List<MesBaseAttachInfo> getSopInfoList(Long materialBomId) {
List<MesMaterialBom> mesMaterialBomList = mesMaterialBomMapper.selectMesMaterialBomWithChildSopList(materialBomId);
if (mesMaterialBomList == null || mesMaterialBomList.isEmpty()) {
return new ArrayList<>();
}
List<Long> allSopIds = new ArrayList<>();
for (MesMaterialBom mesMaterialBom : mesMaterialBomList) {
if (mesMaterialBom.getSopId() != null) {
Long[] sopIds = Arrays.stream(mesMaterialBom.getSopId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
// 将 sopIds 添加到大的集合中
Collections.addAll(allSopIds, sopIds);
}
}
// 转换为 Long[] 数组
Long[] sopIdsArray = allSopIds.toArray(new Long[0]);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIdsArray);
}
/**
*
*
* @param attachType
* @param attachId
* @return
@ -836,12 +872,12 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
mesProductPlan.setAttachId(attachId);
productPlanList = mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
buffer.append("图纸!");
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)){
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
mesProductPlan.setSopId(attachId);
productPlanList = mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
buffer.append("SOP");
}
if (productPlanList.size() > 0){
if (productPlanList.size() > 0) {
result = buffer.toString();
}
//未绑定
@ -850,6 +886,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
/**
* planIdSOPList
*
* @param attachType
* @param planId
* @return

@ -81,12 +81,6 @@
<groupId>com.hw</groupId>
<artifactId>hw-api-mes</artifactId>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-printer</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hw</groupId>

@ -62,13 +62,24 @@ public interface WmsStockTotalMapper {
/**
* (plancodeplandetailcode)
* (bomplancode)
*
* @param wmsStockTotal
* @return
*/
public List<WmsStockTotal> selectWmsStockTotalJoinListBySaleOrder(WmsStockTotal wmsStockTotal);
/**
* (bombomplancode)
*
* @param wmsStockTotal
* @return
*/
public List<WmsStockTotal> selectNoneBomWmsStockTotalJoinListBySaleOrder(WmsStockTotal wmsStockTotal);
/**
* ()
*

@ -176,6 +176,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
}
BigDecimal instockAmount = wmsRawInstockVo.getInstockAmount();
//判断是否批次非批次数量只能等于1
if (baseBarcodeInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
if (instockAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("入库数量需大于等于1");
@ -184,16 +185,23 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
if (instockAmount.compareTo(BigDecimal.ONE) > 0) {
throw new ServiceException("入库数量需等于1");
}
}
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
//非批次的一个条码只能入一次库
WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode());
if (existedRawInstock != null) {
throw new ServiceException("此物料已经入库,不需重复入库");
}
}
//按收料通知单收料的数量限制入库
// if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
// WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode());
// if (existedRawInstock != null) {
// throw new ServiceException("此物料已经入库,不需重复入库");
// }
// }
//按收料通知单收料的数量限制入库(此收料通知单已入库数量和此次入库数量之和不能大于收料通知单入库总数量)
WmsRawInstock checkRawInstock = wmsRawInstockMapper.selectPurchaseReceiveBillByBarcode(materialBarcode);
if (StringUtils.isNotNull(checkRawInstock) && StringUtils.isNotNull(checkRawInstock.getReceiveBillId())){
wmsRawInstock.setReceiveBillId(checkRawInstock.getReceiveBillId());

@ -534,9 +534,9 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
@Override
public int applyRawOutstock(WmsRawOutstock wmsRawOutstock) {
String planCode = wmsRawOutstock.getPlanCode();
String planDetailCode = wmsRawOutstock.getPlanDetailCode();
// String planDetailCode = wmsRawOutstock.getPlanDetailCode();
if (StringUtils.isEmpty(planCode) || StringUtils.isEmpty(planDetailCode)) {
if (StringUtils.isEmpty(planCode)) {
throw new ServiceException("请选择派工信息再领料");
}

@ -153,28 +153,46 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
String materialClassfication = wmsStockTotal.getMaterialClassfication();
Long warehouseId = wmsStockTotal.getWarehouseId();
if(StringUtils.isNotEmpty(materialClassfication) && materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)){
//虚拟物料需要找到虚拟物料下真正的物料以及对应bom的物料
if (StringUtils.isNotEmpty(materialClassfication) && materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)) {
//五楼原料周转区仓库ID
if (warehouseId.equals(wmsConfig.getFifthCabinetWarehouseId())) {
wmsStockTotal.setMaterialId(wmsStockTotal.getProductId());
wmsStockTotal.setAccessoriesFlag(null);
} else {
//找出与生产的虚拟物料相同的物料原材料入库也是按此物料入库入库后在wms_raw_stock有trigger拆分写入wms_raw_instock记录来同步erp使用库存只保留合并的虚拟物料的库存信息
List<WmsStockTotal> wmsStockTotalList = wmsStockTotalMapper.selectNoneBomWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
if (!wmsStockTotalList.isEmpty()) {
wmsStockTotalList.forEach(e -> {
e.setStandardAmount(BigDecimal.ONE);
});
}
return wmsStockTotalList;
} else {//辅料库
//是否是从bom内搜索物料
if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag())
|| wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) {
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
wmsStockTotal.setAccessoriesFlag(null);
wmsStockTotal.setVirtualFlag("1");
return wmsStockTotalMapper.selectWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
} else {
return wmsStockTotalMapper.selectNoneBomWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
}
}
}else{
} else {
//是否是从bom内搜索物料
if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag())
|| wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) {
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
wmsStockTotal.setAccessoriesFlag(null);
return wmsStockTotalMapper.selectWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
} else {
//获取所有原材料包括bom内和非bom内的bom内的可以显示bom非bom内的不显示bom标准数量
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
return wmsStockTotalMapper.selectNoneBomWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
}
}
return wmsStockTotalMapper.selectWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
}
/**
@ -248,7 +266,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
productSpecs.append("|").append(mesSaleOrderRelate.getProductSpec());
}
productCodes.replace(0,1,"");
productCodes.replace(0, 1, "");
productNames.replace(0, 1, "");
productSpecs.replace(0, 1, "");
@ -340,7 +358,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsRawStock.setSaleOrderId(saleOrderId);
wmsRawStock.setSaleorderCode(saleorderCode);
wmsRawStock.setUpdateDate(new Date());
wmsRawStock.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
wmsRawStock.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
return mesBaseBarcodeInfo;
@ -488,7 +506,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsProductStock.setSaleOrderId(saleOrderId);
wmsProductStock.setSaleorderCode(saleorderCode == null ? "" : saleorderCode);
wmsProductStock.setUpdateDate(new Date());
wmsProductStock.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
wmsProductStock.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
wmsProductStockMapper.updateWmsProductStock(wmsProductStock);
}
@ -514,7 +532,6 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
}
/**
* 4
*
@ -528,6 +545,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
/**
*
*
* @param wmsStockTotalTransferVo
* @return
*/
@ -559,7 +577,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsProductStock.setSaleOrderId(saleOrderId);
wmsProductStock.setSaleorderCode(saleorderCode == null ? "" : saleorderCode);
wmsProductStock.setUpdateDate(new Date());
wmsProductStock.setUpdateBy(SecurityUtils.getLoginUser()==null ? SecurityUtils.getUsername() :SecurityUtils.getLoginUser().getNickname());
wmsProductStock.setUpdateBy(SecurityUtils.getLoginUser() == null ? SecurityUtils.getUsername() : SecurityUtils.getLoginUser().getNickname());
wmsProductStockMapper.updateWmsProductStock(wmsProductStock);
MesSaleOrderTransferVo mesSaleOrderTransferVo = new MesSaleOrderTransferVo();

@ -96,6 +96,7 @@
and wps.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
order by wps.instock_date desc
</select>
<select id="selectWmsProductStockByProductStockId" parameterType="Long" resultMap="WmsProductStockResult">

@ -205,14 +205,12 @@
from wms_raw_outstock wro
where wro.stock_total_id = wst.stock_total_id
and wro.plan_code=#{planCode}
and wro.plan_detail_code=#{planDetailCode}
and wro.audit_status != '2'
and wro.execute_status != '2') outstock_amount,
(select sum(wro.real_outstock_amount)
from wms_raw_outstock wro
where wro.stock_total_id = wst.stock_total_id
and wro.plan_code=#{planCode}
and wro.plan_detail_code=#{planDetailCode}
and wro.audit_status != '2') real_outstock_amount,
mmb.standard_amount
from mes_material_bom mmb
@ -242,6 +240,51 @@
</select>
<select id="selectNoneBomWmsStockTotalJoinListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,wst.sale_order_id,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,
(select sum(wro.outstock_amount) from wms_raw_outstock wro where wro.stock_total_id=wst.stock_total_id and
wro.plan_code=#{planCode} and wro.audit_status!='2' and wro.execute_status!='2') outstock_amount,
(select sum(wro.real_outstock_amount)
from wms_raw_outstock wro
where wro.stock_total_id = wst.stock_total_id
and wro.plan_code=#{planCode}
and wro.audit_status != '2') real_outstock_amount,
(select mmb.standard_amount
from mes_material_bom mmb where mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%') limit 1) as standard_amount
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
and wst.total_amount>0
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%',
#{materialName},
'%')
</if>
<if test="saleOrderId != null and virtualFlag==null and virtualFlag==''">and (wst.sale_order_id = #{saleOrderId} or wst.safe_flag='1')</if>
<if test="saleOrderId != null and virtualFlag!=null and virtualFlag!=''">and (exists (select 1 from mes_sale_order_relate msor where wst.sale_order_id=msor.relate_sale_order_id and msor.sale_order_id=#{saleOrderId}) or wst.safe_flag='1')</if>
<if test="saleOrderId == null ">and wst.safe_flag='1'</if>
<if test="materialCodeNameSpec != null and materialCodeNameSpec != ''">and (mbmi.material_code like concat('%',
#{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%')
or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%'))
</if>
<!-- <if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='0'</if>-->
<!-- <if test="ancestors != null and ancestors != ''">and exists (select 1 from mes_material_bom mmb where-->
<!-- mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if>-->
</where>
</select>
<select id="selectWmsStockTotalJoinRealListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,wst.sale_order_id,

@ -19,7 +19,6 @@
<module>hw-wms</module>
<module>hw-mes</module>
<module>hw-qms</module>
<module>hw-printer</module>
<module>hw-dms</module>
</modules>

@ -82,3 +82,13 @@ export function getBomAttachInfo(attachType, materialBomIds) {
method: 'get'
})
}
// 查询物料BOM信息图纸和SOP变更记录
export function selectMesBomAttachChangeJoinList(query) {
return request({
url: '/mes/materialBom/selectMesBomAttachChangeJoinList',
method: 'get',
params: query
})
}

@ -155,7 +155,7 @@ export function getUserList(query) {
})
}
// 获取生产派工附件List列表
// 获取生产派工附件List列表(激光切割图纸使用)
export function getAttachInfoList(attachType, dispatchCode, processId, userId) {
return request({
url: '/mes/productplan/attachInfoList/' + attachType + '/' + dispatchCode + '/' + processId + '/' + userId,
@ -163,6 +163,15 @@ export function getAttachInfoList(attachType, dispatchCode, processId, userId) {
})
}
// 获取生产派工附件List列表(SOP/图纸使用)
export function getSopInfoList(materialBomId) {
return request({
url: '/mes/productplan/sopInfoList/' + materialBomId,
method: 'get'
})
}
// 校验生产派工是否已绑定附件
export function checkMesProductPlanAttachInfo(attachType, attachIds) {
return request({

@ -21,13 +21,13 @@
<el-divider content-position="center">物料信息</el-divider>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" @submit.native.prevent label-width="130px">
<el-form-item label="编码、名称或规格" prop="materialCodeNameSpec">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="请输入编码、名称或规格"
clearable
@keyup.enter.native="searchMaterial"/>
clearable/>
</el-form-item>
<!-- <el-form-item label="辅料标识" prop="accessoriesFlag">-->
@ -43,8 +43,8 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchBomMaterial">BOM</el-button>
<el-button type="warning" icon="el-icon-search" size="mini" @click="searchNoneBomMaterial()">BOM</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="warning" icon="el-icon-search" size="mini" @click="searchNoneBomMaterial()" v-if="form.taskType === '1'">BOM</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>-->
</el-form-item>
</el-form>
<el-table
@ -116,6 +116,7 @@
v-model="scope.row.planAmount"
controls-position="right"
:max="maxPlanAmount"
:min="0"
style="width: 100%"
>
</el-input-number>
@ -152,6 +153,7 @@
<script>
import {getWarehouses, getMaterialInfoByMaterialId,getStockTotal, applyRawOutstock} from "@/api/board";
import { Decimal } from 'decimal.js'
export default {
name: "Materialinfo",
@ -324,6 +326,16 @@ export default {
// });
this.wmsRawOutstockDetailList = e.rows.map(r => {
let availableAmount = parseFloat(new Decimal(r.totalAmount).minus(new Decimal(r.occupyAmount)).minus(new Decimal(r.frozenAmount))).toFixed(2);//
let outstockAmount = parseFloat(r.outstockAmount ? r.outstockAmount : 0).toFixed(2);//
let realOutstockAmount = parseFloat(r.realOutstockAmount ? r.realOutstockAmount : 0).toFixed(2);//
let bomStandardAmount =parseFloat(r.standardAmount ? r.standardAmount : 0).toFixed(2);
let planAmount;
if(bomStandardAmount - outstockAmount > 0){
planAmount = parseFloat( new Decimal(bomStandardAmount).minus(new Decimal(outstockAmount)));
}
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
@ -331,12 +343,12 @@ export default {
materialName: r.materialName,
materialSpec: r.materialSpec,
safeFlag: r.safeFlag,
availableAmount: parseFloat(r.totalAmount - r.occupyAmount - r.frozenAmount).toFixed(2),
availableAmount: availableAmount,
unavailableAmount: parseFloat(r.occupyAmount + r.frozenAmount).toFixed(2),
outstockAmount: parseFloat(r.outstockAmount ? r.outstockAmount : 0).toFixed(2),
standardAmount: parseFloat(r.standardAmount ? r.standardAmount : 0).toFixed(2),
realOutstockAmount: parseFloat(r.realOutstockAmount ? r.realOutstockAmount : 0).toFixed(2),
planAmount: this.planAmount
outstockAmount: outstockAmount,
standardAmount: bomStandardAmount,
realOutstockAmount: realOutstockAmount,
planAmount: planAmount
}
})
this.loading = false;
@ -391,11 +403,28 @@ export default {
this.$modal.msgWarning("请输入领取数量");
return;
}
let checkDetailList = this.wmsRawOutstockDetailList.filter(detail => detail.planAmount > detail.standardAmount);
if (checkDetailList.length > 0) {
this.$modal.msgWarning("申请数量需要小于等于BOM标准数量");
return;
//bom
if(!this.bomFlag || this.bomFlag==='1'){
let checkDetailList = realOutstockDetailList.filter(detail =>
new Decimal(detail.planAmount ).plus(new Decimal(detail.outstockAmount)) > detail.standardAmount);
if (checkDetailList.length > 0) {
this.$modal.msgWarning("此次领取数量与已申请数量之和需要小于等于BOM标准数量");
return;
}
}else{//bombom
let bomDetailList = realOutstockDetailList.filter(detail => detail.standardAmount > 0 );
if (bomDetailList.length > 0) {
if (this.form.applyReason === null || this.form.applyReason === undefined || this.form.applyReason === "") {
this.$modal.msgWarning("在非bom内物料中申请bom中的物料需要输入领取原因");
return;
}
}
}
this.submitloading = true;
this.form.wmsRawOutstockDetailList = realOutstockDetailList;
applyRawOutstock(this.form).then(e => {

@ -4,7 +4,7 @@
<div class="chartBox chartBox1">
<div class="title">生产明细</div>
<div class="chart">
<div class="chart" v-loading="loading">
<div class="form">
<el-form :model="form" label-position="right" label-width="80px" size="mini">
@ -34,11 +34,11 @@
</div>
<div style="text-align: center;position: absolute;width: 70%;top: 81%">
<el-button size="mini" type="success" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
:disabled="form.planDetailStatus === '已完成'"
@click="getMaterials('0')">领料
</el-button>
<el-button size="mini" type="info" :loading="submitLoading" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
:disabled="form.planDetailStatus === '已完成'"
@click="completeCollectMaterials()">完成领料
</el-button>
<!-- <el-button size="mini" type="warning" v-if="(!$route.query || $route.query.id==='2')"-->
@ -47,11 +47,11 @@
<!-- </el-button>-->
<el-button size="mini" type="danger" @click="handleApplyRawReturn()"
v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">退料
>退料
</el-button>
<el-button size="mini" type="info" :loading="submitLoading" @click="completeReturnMaterials()"
v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">完成退料
>完成退料
</el-button>
<el-button size="mini" type="primary" v-if="($route.query && $route.query.id) === '1'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode || form.cabinetChannel === CABINET_CHANNEL.INTERNAL "
@ -416,9 +416,9 @@
<!-- 申请领料信息对话框 -->
<el-dialog :title="applyMaterialTitle" :visible.sync="dialogVisible" append-to-body>
<el-dialog :title="applyMaterialTitle" :visible.sync="dialogVisible" width="90%" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData"
v-if="dialogVisible"></apply-raw-outstock>
v-if="dialogVisible" style="width:100%"></apply-raw-outstock>
</el-dialog>
@ -557,7 +557,7 @@
<!-- 申请退库信息对话框 -->
<el-dialog :title="applyRawReturnTitle" :visible.sync="applyRawReturnVisible" append-to-body>
<el-dialog :title="applyRawReturnTitle" :visible.sync="applyRawReturnVisible" append-to-body>
<apply-raw-return ref="applyRawReturnRef" :defineData="productPlanData"
v-if="applyRawReturnVisible"></apply-raw-return>
</el-dialog>
@ -642,6 +642,9 @@ import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
import {monitorSerialData} from "@/utils/serial";
import saleOrderRelates from "@/views/board/common/saleOrderRelates.vue";
import {
getSopInfoList
} from "@//api/mes/productplan";
const setState = (e) => {
@ -706,6 +709,7 @@ export default {
form: {},
form1: {},
submitLoading: false,
loading: false,
applyRawReturnTitle: '',
applyRawReturnVisible: false,
@ -889,6 +893,7 @@ export default {
methods: {
getProductPlans() {
this.loading = true
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
@ -1113,6 +1118,7 @@ export default {
this.form.saleorderCode = val.saleorderCode
this.form.dispatchCode = val.dispatchCode;
this.form.cabinetChannel = val.cabinetChannel;
this.form.planCode = val.planCode;
this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val)
this.selectBindPurchaseOrders();
@ -1146,6 +1152,7 @@ export default {
},
async tableClick(val) {
if (!val) return
this.loading = true
const {data} = await getNewestProductPlanDetail({planId: val.planId})
this.form = data || {}
this.form.materialId = val.materialId
@ -1158,6 +1165,7 @@ export default {
this.form.saleorderCode = val.saleorderCode
this.form.dispatchCode = val.dispatchCode;
this.form.cabinetChannel = val.cabinetChannel;
this.form.planCode = val.planCode
if (data) {
this.form.planDetailStatus = setState(data.planDetailStatus)
}
@ -1165,6 +1173,7 @@ export default {
this.getInfo(val);
this.selectBindPurchaseOrders();
this.selectRawOutstocks();
this.loading = false;
},
stationChange(val) {
this.nowStation = val
@ -1855,7 +1864,7 @@ export default {
/** SOP预览*/
handleViewSOP(e) {
this.fileListData = [];
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
getSopInfoList(e.materialBomId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {
@ -1874,6 +1883,28 @@ export default {
})
},
// handleViewSOP(e) {
// this.fileListData = [];
// getDispatchAttachByPlanIdList("2", e.planId).then(res => {
// let attachList = res.data;
// let thisFileList = [];
// attachList.forEach(e => {
// let previewFile = {};
// previewFile.url = e.attachPath;
// previewFile.name = e.attachName;
// thisFileList.push(previewFile);
// })
// console.log("thisFileList", thisFileList)
// if (thisFileList.length > 0) {
// this.fileListData = thisFileList;
// this.showFileDialog = true;
// } else {
// this.$modal.msgWarning("SOP");
// }
// })
// },
completeCollectMaterials() {
const loginStationCode = this.loginStationInfo.stationCode;
//const loginStationCode = 'ZP_06';

@ -320,17 +320,25 @@
suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-select v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" placeholder="请扫描或输入物料条码"
style="width:360px">
<el-option v-for="item in locationBarcodeList" :key="item.barcodeInfo"
:label="`${item.materialName}(${item.materialSpec},${item.poNo})`"
:value="item.barcodeInfo"></el-option>
</el-select>
<el-input v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" autocomplete="off"
placeholder="请扫描或输入物料条码" style="width:360px"
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur"
suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
<!-- <el-form-item label="物料条码" prop="materialBarcode">-->
<!-- <el-select v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" placeholder="请扫描或输入物料条码"-->
<!-- style="width:360px">-->
<!-- <el-option v-for="item in locationBarcodeList" :key="item.barcodeInfo"-->
<!-- :label="`${item.materialName}(${item.materialSpec},${item.poNo})`"-->
<!-- :value="item.barcodeInfo"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="数量" prop="instockAmount">
<el-input-number v-model="wmsForm.instockAmount" ref="instockAmountRef" :min="1" :max="1000"
placeholder="请输入数量" style="width:360px"></el-input-number>
@ -1287,11 +1295,11 @@ export default {
handleLocationCodeBlur() {
this.loacationCodeFocused = false;
if (this.wmsForm.locationCode && this.wmsForm.locationCode !== '') {
get4thFloorRegularBarcode(this.wmsForm).then(response => {
this.locationBarcodeList = response.data;
});
}
// if (this.wmsForm.locationCode && this.wmsForm.locationCode !== '') {
// get4thFloorRegularBarcode(this.wmsForm).then(response => {
// this.locationBarcodeList = response.data;
// });
// }
},
handleMaterialBarcodeFocus() {

@ -656,11 +656,11 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售订单" prop="saleorderCode">
<el-input v-model="materialRelateForm.saleorderCode" disabled/>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="销售订单" prop="saleorderCode">-->
<!-- <el-input v-model="materialRelateForm.saleorderCode" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
@ -1300,10 +1300,10 @@ export default {
return;
}
if (firstRowSaleOrderCode !== this.materialRelateForm.saleorderCode) {
this.$modal.msgError("已选择销售订单号为:" + firstRowSaleOrderCode + ",本次选择销售订单号与此不同");
return;
}
// if (firstRowSaleOrderCode !== this.materialRelateForm.saleorderCode) {
// this.$modal.msgError(":" + firstRowSaleOrderCode + ",");
// return;
// }
}
@ -1312,7 +1312,7 @@ export default {
});
if (differentPoNoSelectedRow != null && differentPoNoSelectedRow !== '') {
this.$modal.msgError("本次选择信息采购订单号或销售订单号不一致");
this.$modal.msgError("本次选择信息采购订单号不一致");
return;
}
@ -1326,22 +1326,22 @@ export default {
}
//saleorderid
let sameSaleOrderIdsData = this.findAllDuplicates(selectedRows, "saleOrderId");
if (sameSaleOrderIdsData != null && sameSaleOrderIdsData.length > 0) {
let errorMsg = "";
let index = 1;
for (let sameDataGroup of sameSaleOrderIdsData) {
errorMsg += index + ".";
for (let ssoid of sameDataGroup) {
errorMsg += "销售订单号:" + ssoid.saleOrderCode + ",成品编码:" + ssoid.productCode + ",成品名称:" + ssoid.productName + ",成品规格:" + ssoid.productSpec + ";";
}
index++;
}
this.$modal.msgError("选择的销售订单明细不能相同" + errorMsg);
return;
}
// let sameSaleOrderIdsData = this.findAllDuplicates(selectedRows, "saleOrderId");
// if (sameSaleOrderIdsData != null && sameSaleOrderIdsData.length > 0) {
// let errorMsg = "";
// let index = 1;
// for (let sameDataGroup of sameSaleOrderIdsData) {
// errorMsg += index + ".";
// for (let ssoid of sameDataGroup) {
// errorMsg += ":" + ssoid.saleOrderCode + "," + ssoid.productCode + "," + ssoid.productName + ",:" + ssoid.productSpec + ";";
// }
//
// index++;
// }
//
// this.$modal.msgError("" + errorMsg);
// return;
// }
let wmsWarehouseMaterialCheckVos = [];
@ -1360,24 +1360,33 @@ export default {
checkWarehouseMaterials(wmsWarehouseMaterialCheckVos).then(response => {
selectedRows.forEach(item => {
//
// this.materialRelateForm.mesSaleOrderRelateList.forEach(fitem =>{
// console.log(item.purchaseOrderId+"---"+fitem.purchaseOrderId);
// });
const filterMaterialRelateList = this.materialRelateForm.mesSaleOrderRelateList.filter(formItem => {
return formItem.orderBindId === item.orderBindId;
return formItem.purchaseOrderId === item.purchaseOrderId;
});
// this.materialRelateForm.mesSaleOrderRelateList.forEach(formItem => {
// console.log("re:"+formItem.relateSaleOrderId+",o:"+item.saleOrderId)
// })
//
const filterSaleOrderIdMaterialRelateList = this.materialRelateForm.mesSaleOrderRelateList.filter(formItem => {
return formItem.relateSaleOrderId === item.saleOrderId;
});
// const filterSaleOrderIdMaterialRelateList = this.materialRelateForm.mesSaleOrderRelateList.filter(formItem => {
// return ((!formItem.relateSaleOrderId && form.relateSaleOrderId!==null && form.relateSaleOrderId!=='' && form.relateSaleOrderId!==0)
// && (!item.saleOrderId || item.saleOrderId===null || item.saleOrderid==='' || item.saleOrderId===0 )) || formItem.relateSaleOrderId === item.saleOrderId;
// });
if (filterSaleOrderIdMaterialRelateList != null && filterSaleOrderIdMaterialRelateList.length > 0) {
let errorMsg = "选择的信息跟已经选择的销售订单号明细相同.";
for (let ssoid of filterSaleOrderIdMaterialRelateList) {
errorMsg += "销售订单号:" + ssoid.relateSaleOrderCode + ",成品编码:" + ssoid.productCode + ",成品名称:" + ssoid.productName + ",成品规格:" + ssoid.productSpec + ";";
}
this.$modal.msgError(errorMsg);
return;
}
// if (filterSaleOrderIdMaterialRelateList != null && filterSaleOrderIdMaterialRelateList.length > 0) {
// let errorMsg = ".";
// for (let ssoid of filterSaleOrderIdMaterialRelateList) {
// errorMsg += ":" + ssoid.relateSaleOrderCode + "," + ssoid.productCode + "," + ssoid.productName + ",:" + ssoid.productSpec + ";";
// }
//
// this.$modal.msgError(errorMsg);
// return;
// }
if (filterMaterialRelateList.length <= 0) {
@ -1397,7 +1406,7 @@ export default {
materialSpec: item.materialSpec,
specificationParameter: item.specificationParameter,
relateSaleOrderAmount: item.relateSaleOrderAmount,
orderAmount: item.orderAmount
orderAmount: item.relateSaleOrderAmount
};
this.materialRelateForm.mesSaleOrderRelateList.push(mesSaleOrderRelate);

@ -0,0 +1,194 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="文件类型" prop="attachType">
<el-radio-group v-model="queryParams.attachType" clearable @keyup.enter.native="handleQuery">
<el-radio
v-for="dict in dict.type.mes_attach_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="变更类型" prop="changeType">
<el-select v-model="queryParams.changeType" placeholder="请选择变更类型" clearable @keyup.enter.native="handleQuery">
<el-option
v-for="dict in dict.type.mes_attach_change_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="更新人" prop="changeBy">
<el-input
v-model="queryParams.changeBy"
placeholder="请输入更新人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="attachChangeList" @selection-change="handleSelectionChange">
<el-table-column label="文件类型" align="center" prop="attachType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_attach_type" :value="scope.row.attachType"/>
</template>
</el-table-column>
<el-table-column label="变更类型" align="center" prop="changeType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_attach_change_type" :value="scope.row.changeType"/>
</template>
</el-table-column>
<el-table-column label="文件名称" align="center" prop="attachName" />
<el-table-column label="更新人" align="center" prop="changeBy" />
<el-table-column label="更新时间" align="center" prop="changeTime" width="180">
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
type="text"
icon="el-icon-download"
@click="handleDownload(scope.row)"
>下载</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {selectMesBomAttachChangeJoinList} from "@/api/mes/materialBom";
export default {
name: "AttachChange",
dicts: ['mes_attach_type', 'mes_attach_change_type'],
props: {
defineData: {
type: Object,
default: {}
}
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOMSOP
attachChangeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
materialBomId: null,
oldAttachId: null,
newAttachId: null,
changeType: null,
planId: null,
planCode: null,
changeUserId: null,
changeBy: null,
changeTime: null
},
};
},
created() {
this.getData();
},
methods: {
getData() {
if (this.defineData.materialBomId) {
this.queryParams.materialBomId = this.defineData.materialBomId;
this.getList();
}
},
/** 查询物料BOM信息图纸和SOP变更记录列表 */
getList() {
this.loading = true;
selectMesBomAttachChangeJoinList(this.queryParams).then(response => {
this.attachChangeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
attachChangeId: null,
materialBomId: null,
oldAttachId: null,
newAttachId: null,
changeType: null,
planId: null,
planCode: null,
changeUserId: null,
changeBy: null,
changeTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 下载文件操作 */
handleDownload(row) {
if (row.attachPath) {
//
window.open(row.attachPath, '_blank');
} else {
this.$message.error('文件路径不存在,无法下载');
}
},
}
};
</script>

@ -146,15 +146,22 @@
size="mini"
type="primary"
@click="handleDrawing(scope.row)"
>图纸
>激光切割图纸
</el-button>
<el-button
icon="el-icon-upload2"
size="mini"
type="success"
@click="handleSop(scope.row)"
>SOP
>SOP/图纸
</el-button>
<el-button
size="mini"
type="warning"
@click="handleBomAttachChangeInfo(scope.row)"
>文件变更记录
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
@ -453,6 +460,14 @@
/>
</el-dialog>
<!-- bom图纸/sop变更记录对话框 -->
<el-dialog title="BOM文件变更记录" :visible.sync="bomAttachChangeDialogVisible" width="80%" append-to-body>
<bom-attach-change ref="bomAttachChangeRef" :defineData="bomAttachChangeData"
v-if="bomAttachChangeDialogVisible" style="width:100%"></bom-attach-change>
<el-button @click="bomAttachChangeDialogVisible = false"> </el-button>
</el-dialog>
</div>
</template>
@ -468,6 +483,7 @@ import {
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
import bomAttachChange from './bomAttachChange.vue';
import {verifyBOMIsProduction} from "@//api/mes/productOrder";
import {getToken} from "@/utils/auth";
import {
@ -483,8 +499,10 @@ export default {
dicts: ['active_flag', 'check_type'],
components: {
Treeselect,
'select-material': selectMaterial
'select-material': selectMaterial,
'bom-attach-change': bomAttachChange
},
props: {
value: [String, Object, Array, Number],
// sop
@ -564,6 +582,7 @@ export default {
{required: true, message: "激活标识不能为空", trigger: "change"}
],
},
upload: {
//
open: false,
@ -632,6 +651,11 @@ export default {
userList: [],
//List
userNoticeList: [],
// bom/sop
bomAttachChangeDialogVisible: false,
bomAttachChangeDialogTitle: 'BOM文件变更记录',
bomAttachChangeData: {},
};
},
watch: {
@ -1117,7 +1141,7 @@ export default {
let arrPic = this.$refs.drawingUpload.uploadFiles;
let index = arrPic.indexOf(file);
let flag = false;
let attachId = this.uploadAttachList[this.addProductPlanObject.materialBomId][index];
let attachId = this.uploadSopList[this.addProductPlanObject.materialBomId][index];
await checkMesProductPlanAttachInfo("2", attachId).then(res => {
if (res.msg != null){
this.$modal.msgWarning(res.msg);
@ -1186,6 +1210,14 @@ export default {
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
},
handleBomAttachChangeInfo(row){
this.bomAttachChangeData = {
materialBomId : row.materialBomId
}
this.bomAttachChangeDialogTitle = 'BOM文件变更记录['+row.materialBomDesc+']';
this.bomAttachChangeDialogVisible = true;
}
}
};
</script>

@ -186,8 +186,8 @@
size="mini"
type="primary"
@click="handleDrawing(scope.row)"
v-if=" scope.row.userId != null"
>图纸
v-if=" scope.row.userId != null && scope.row.processId === 41"
>激光切割图纸
</el-button>
<el-button
icon="el-icon-search"
@ -195,7 +195,7 @@
type="success"
@click="handleSop(scope.row)"
v-if=" scope.row.userId != null"
>SOP
>SOP/图纸
</el-button>
<el-button
@ -415,7 +415,7 @@ import {
orderAddMesProductPlanList,
getBaseRouteProcesses,
getProcessUsers,
uploadFile, getAttachInfoList
uploadFile, getAttachInfoList,getSopInfoList
} from "@//api/mes/productplan";
import {getConfigKey} from "@//api/system/config"
import {deepClone} from "@//utils/index";
@ -1168,7 +1168,7 @@ export default {
},
/** 查看图纸 */
/** 查看激光切割图纸 */
handleDrawing(row) {
this.fileList = [];
if (row.planId != null && (!this.previewDrawingFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
@ -1209,6 +1209,10 @@ export default {
}
}
this.blueprintModel = true;
//
this.addProductPlanObject = row;
this.materialBomAttachIdList = [];
getBomAttachInfo(this.ATTACH_TYPE.DRAWING, this.addProductPlanObject.materialBomId).then(response => {
@ -1295,13 +1299,11 @@ export default {
},
/** 查看sop */
/** 查看sop/图纸 */
handleSop(row) {
this.fileList = [];
if (row.planId != null && (!this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
|| this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
getAttachInfoList(this.ATTACH_TYPE.SOP, row.dispatchCode, row.processId, row.userId).then(res => {
if (this.fileList.length===0) {
getSopInfoList(row.materialBomId).then(res => {
let attachList = res.data;
attachList.forEach(e => {
let previewFile = {};
@ -1325,31 +1327,75 @@ export default {
})
})
} else {
if (this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
let previewFile = {};
previewFile.url = e.attachPath;
previewFile.name = e.attachName;
this.fileList.push(previewFile);
})
}
}
this.addProductPlanObject = row;
this.materialBomAttachIdList = [];
getBomAttachInfo(this.ATTACH_TYPE.SOP, this.addProductPlanObject.materialBomId).then(response => {
this.attachInfoList = response.data;
for (let e of this.fileList) {
let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
if (attachInfo != null){
this.materialBomAttachIdList.push(attachInfo.attachId);
}
}
this.sopViewModel = true;
});
this.sopViewModel = true;
},
// handleSop(row) {
// this.fileList = [];
// if ( (!this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId]
// || this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] !== "1")) {
// this.previewSopFlag[row.dispatchCode + "-" + row.processId + "-" + row.userId] = "1";
// getSopInfoList(row.materialBomId).then(res => {
// let attachList = res.data;
// attachList.forEach(e => {
// let previewFile = {};
// previewFile.url = e.attachPath;
// previewFile.name = e.attachName;
// this.fileList.push(previewFile);
//
// let groupSopFile = {};
// groupSopFile.dispatchCode = row.dispatchCode;
// groupSopFile.processId = row.processId;
// groupSopFile.attachId = e.attachId;
// groupSopFile.attachPath = e.attachPath;
// groupSopFile.attachName = e.attachName;
// let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
// this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
// this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(groupSopFile);
//
// let uploadSopList = this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId];
// this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] = uploadSopList ? this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId] : [];
// this.uploadSopList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId + "-" + this.addProductPlanObject.userId].push(e.attachId);
//
// })
// })
// }
//
// else {
// if (this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId]) {
// this.groupSopFileList[row.dispatchCode + "-" + row.processId + "-" + row.userId].forEach(e => {
// let previewFile = {};
// previewFile.url = e.attachPath;
// previewFile.name = e.attachName;
// this.fileList.push(previewFile);
// })
// }
// }
//
//
// //SOP
// this.addProductPlanObject = row;
// this.materialBomAttachIdList = [];
// getBomAttachInfo(this.ATTACH_TYPE.SOP, this.addProductPlanObject.materialBomId).then(response => {
// this.attachInfoList = response.data;
// for (let e of this.fileList) {
// let attachInfo = this.attachInfoList.find(item => item.attachPath === e.url);
// if (attachInfo != null){
// this.materialBomAttachIdList.push(attachInfo.attachId);
// }
// }
// this.sopViewModel = true;
// });
// },
//sop
sopFileUploadSubmit() {
for (let i = 0; i < this.mesProductPlanList.length; i++) {

@ -2,75 +2,64 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-row>
<el-form-item label="收料通知单号" prop="billNo">
<el-input v-model="queryParams.billNo" placeholder="请点击右侧检索收料通知单" style="width:400px;" disabled>
<el-button slot="append" icon="el-icon-search" @click="handlePurchaseReceiveBill"></el-button>
</el-input>
<el-form-item label="收料单号" prop="billNo">
<el-input
v-model="queryParams.billNo"
placeholder="收料单号"
clearable
@keyup.enter.native="handleQuery"
/>
<!-- <el-input v-model="queryParams.billNo" placeholder="请点击右侧检索收料通知单" style="width:400px;" disabled>-->
<!-- <el-button slot="append" icon="el-icon-search" @click="handlePurchaseReceiveBill"></el-button>-->
<!-- </el-input>-->
</el-form-item>
</el-row>
<el-form-item label="采购订单编号" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单编号"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
disabled
/>
</el-form-item>
<!-- <el-form-item label="物料编码" prop="materialCode">-->
<!-- <el-input-->
<!-- v-model="queryParams.materialCode"-->
<!-- placeholder="请输入物料编码"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input-->
<!-- v-model="queryParams.materialName"-->
<!-- placeholder="请输入物料名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料规格" prop="materialSpec">-->
<!-- <el-input-->
<!-- v-model="queryParams.materialSpec"-->
<!-- placeholder="请输入物料规格"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="规格参数" prop="specificationParameter">-->
<!-- <el-input-->
<!-- v-model="queryParams.specificationParameter"-->
<!-- placeholder="请输入规格参数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="常备物料" v-if="queryParams.mergeFlag===null" clearable prop="alwaysFlag">-->
<!-- <el-select v-model="queryParams.alwaysFlag" placeholder="请选择常备物料标识" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.mes_material_bind_flag"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="可用标识" v-if="queryParams.mergeFlag!==null" prop="mergeFlag">
<el-radio-group v-model="queryParams.mergeFlag">
<el-radio label="1" value="1" >
</el-radio>
<el-radio label="" value="" >
</el-radio>
</el-radio-group>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="可用标识" v-if="queryParams.mergeFlag!==null" prop="mergeFlag">-->
<!-- <el-radio-group v-model="queryParams.mergeFlag">-->
<!-- <el-radio label="1" value="1" >-->
<!-- -->
<!-- </el-radio>-->
<!-- <el-radio label="" value="" >-->
<!-- -->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="可用标识" v-if="queryParams.mergeFlag===null" prop="singleFlag" >-->
<!-- <el-radio-group v-model="queryParams.singleFlag">-->
@ -114,7 +103,8 @@
:reserve-selection="true"
v-if="!isSingleSelect"
></el-table-column>
<el-table-column label="采购订单ID" align="center" prop="purchaseOrderId" width="90"/>
<!-- <el-table-column label="采购订单ID" align="center" prop="purchaseOrderId" width="90"/>-->
<el-table-column label="收料单号" align="center" prop="billNo" />
<el-table-column label="采购订单" align="center" prop="poNo" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
@ -163,6 +153,9 @@ import {
} from "@//api/mes/purchaseOrder";
import selectPurchaseReceiveBill from '@//views/mes/purchaseReceiveBill/selectPurchaseReceiveBill.vue';
import { listPurchaseReceiveBill } from "@/api/mes/purchaseReceiveBill";
export default {
name: "OrderBind",
dicts: ['active_flag', 'order_status', 'document_status','mes_material_bind_flag'],
@ -275,6 +268,7 @@ export default {
},
created() {
this.getData();
this.getList();
},
methods: {
getData() {
@ -294,12 +288,13 @@ export default {
/** 查询采购订单信息列表 */
getList() {
if(this.queryParams.billNo==null ||this.queryParams.billNo==='') {
this.$modal.msgWarning("请先选择收料通知单");
return;
}
// if(this.queryParams.billNo==null ||this.queryParams.billNo==='') {
// this.$modal.msgWarning("");
// return;
// }
this.loading = true;
getPurchaseOrdersWithBind(this.queryParams).then(response => {
listPurchaseReceiveBill(this.queryParams).then(response => {
console.log(response)
response.rows.forEach(e => {
// if(e.orderBindId){
// e.relateSaleOrderAmount = e.bindAmount - e.barcodeAmount;

@ -135,7 +135,7 @@
</el-form>
<el-table height="500" max-height="500" v-loading="loading" :data="rawoutstockList"
<el-table v-loading="loading" :data="rawoutstockList"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="任务编号" align="center" prop="taskCode"/>

Loading…
Cancel
Save