RFID手持接口:
master
xs 1 week ago
parent 75f30e13d3
commit ef7fd0dfb5

@ -295,6 +295,8 @@ public class MesPurchaseOrder extends BaseEntity {
private String projectNo;
private Long materialBomId;
public Long getSerialNumber() {
return serialNumber;
@ -760,6 +762,14 @@ public class MesPurchaseOrder extends BaseEntity {
this.projectNo = projectNo;
}
public Long getMaterialBomId() {
return materialBomId;
}
public void setMaterialBomId(Long materialBomId) {
this.materialBomId = materialBomId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -29,6 +29,10 @@ public class PrintContentVo {
public static final String PRINT_TEMPLATE_RAW = "raw";
public static final String PRINT_TEMPLATE_PRODUCT = "product";
public static final String PRINT_TEMPLATE_BIND = "bind";
public static final String PRINT_TEMPLATE_SMALL = "small";
public static final String SMALL_LABEL_KEY_TEXT = "text";
public static final String SMALL_LABEL_KEY_QRCODE = "qrcode";
private String key;

@ -210,6 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
</where>
order by dbfi.repair_instance_id desc
</select>

@ -295,4 +295,21 @@ public class MesProductPlanController extends BaseController {
}
}
/**
*
*/
@Log(title = "生产明细统计", businessType = BusinessType.START)
@PostMapping("/generateProduceStatisticsDetail")
// @InnerAuth
public R<?> generateProduceStatisticsDetail() {
try {
mesProductPlanDetailService.generateProduceStatisticsDetail("");
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}
}

@ -5,7 +5,10 @@ import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.domain.R;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.mes.api.domain.MesOrderBind;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.service.IMesMaterialBomService;
import com.hw.mes.service.IMesOrderBindService;
import com.hw.mes.service.IMesSaleOrderService;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +46,9 @@ public class MesPurchaseOrderController extends BaseController
@Autowired
private IMesSaleOrderService mesSaleOrderService;
@Autowired
private IMesMaterialBomService mesMaterialBomService;
@Autowired
private IMesOrderBindService mesOrderBindService;
@ -78,7 +84,7 @@ public class MesPurchaseOrderController extends BaseController
@GetMapping(value = "/{purchaseOrderId}")
public AjaxResult getInfo(@PathVariable("purchaseOrderId") Long purchaseOrderId)
{
return success(mesPurchaseOrderService.selectMesPurchaseOrderByPurchaseOrderId(purchaseOrderId));
return success(mesPurchaseOrderService.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId));
}
/**
@ -235,6 +241,18 @@ public class MesPurchaseOrderController extends BaseController
}
/**
* bom
* @param mesMaterialBom
* @return
*/
@GetMapping("/getMaterialBoms")
public AjaxResult getMaterialBoms(MesMaterialBom mesMaterialBom)
{
List<MesMaterialBom> list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom);
return success(list);
}
/**
* raw_instock(group by)
@ -247,6 +265,17 @@ public class MesPurchaseOrderController extends BaseController
}
/**
*
*/
@GetMapping("/getOrderBinds")
public AjaxResult getOrderBinds(MesOrderBind mesOrderBind)
{
List<MesOrderBind> list = mesOrderBindService.selectMesOrderBindJoinProductList(mesOrderBind);
return success(list);
}
/**
*

@ -0,0 +1,339 @@
package com.hw.mes.domain;
import java.util.List;
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;
/**
* mes_produce_statistics_detail
*
* @author xins
* @date 2024-11-07
*/
public class MesProduceStatisticsDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statisticsDetailId;
/** 生产工单ID */
@Excel(name = "生产工单ID")
private Long productOrderId;
/** 销售订单ID */
@Excel(name = "销售订单ID")
private Long saleOrderId;
/** 销售订单号 */
@Excel(name = "销售订单号")
private String saleorderCode;
/** 生产计划ID */
@Excel(name = "生产计划ID")
private Long planId;
/** 计划编号,关联mes_product_plan_info的plan_code */
@Excel(name = "计划编号,关联mes_product_plan_info的plan_code")
private String planCode;
/** 生产计划明细ID */
@Excel(name = "生产计划明细ID")
private Long planDetailId;
/** 生产计划明细编号 */
@Excel(name = "生产计划明细编号")
private String planDetailCode;
/** 生产成品ID */
@Excel(name = "生产成品ID")
private Long productId;
/** 生产成名编码 */
@Excel(name = "生产成名编码")
private String productCode;
/** 生产成品名称 */
@Excel(name = "生产成品名称")
private String productName;
/** 生产成品规格 */
@Excel(name = "生产成品规格")
private String productSpec;
/** 操作人员ID关联sys_user的user_id */
@Excel(name = "操作人员ID关联sys_user的user_id")
private Long userId;
/** 操作人员名称关联sys_user的nick_name */
@Excel(name = "操作人员名称关联sys_user的nick_name")
private String nickName;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planBeginTime;
/** 计划结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime;
/** 生产用时(单位S) */
@Excel(name = "生产用时(单位S)")
private Long produceTime;
/** 生产统计明细使用物料情况;车间生产派工信息 */
private List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList;
public void setStatisticsDetailId(Long statisticsDetailId)
{
this.statisticsDetailId = statisticsDetailId;
}
public Long getStatisticsDetailId()
{
return statisticsDetailId;
}
public void setProductOrderId(Long productOrderId)
{
this.productOrderId = productOrderId;
}
public Long getProductOrderId()
{
return productOrderId;
}
public void setSaleOrderId(Long saleOrderId)
{
this.saleOrderId = saleOrderId;
}
public Long getSaleOrderId()
{
return saleOrderId;
}
public void setSaleorderCode(String saleorderCode)
{
this.saleorderCode = saleorderCode;
}
public String getSaleorderCode()
{
return saleorderCode;
}
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 setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
}
public Long getPlanDetailId()
{
return planDetailId;
}
public void setPlanDetailCode(String planDetailCode)
{
this.planDetailCode = planDetailCode;
}
public String getPlanDetailCode()
{
return planDetailCode;
}
public void setProductId(Long productId)
{
this.productId = productId;
}
public Long getProductId()
{
return productId;
}
public void setProductCode(String productCode)
{
this.productCode = productCode;
}
public String getProductCode()
{
return productCode;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setProductSpec(String productSpec)
{
this.productSpec = productSpec;
}
public String getProductSpec()
{
return productSpec;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setProcessName(String processName)
{
this.processName = processName;
}
public String getProcessName()
{
return processName;
}
public void setPlanBeginTime(Date planBeginTime)
{
this.planBeginTime = planBeginTime;
}
public Date getPlanBeginTime()
{
return planBeginTime;
}
public void setPlanEndTime(Date planEndTime)
{
this.planEndTime = planEndTime;
}
public Date getPlanEndTime()
{
return planEndTime;
}
public void setRealBeginTime(Date realBeginTime)
{
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime()
{
return realBeginTime;
}
public void setRealEndTime(Date realEndTime)
{
this.realEndTime = realEndTime;
}
public Date getRealEndTime()
{
return realEndTime;
}
public void setProduceTime(Long produceTime)
{
this.produceTime = produceTime;
}
public Long getProduceTime()
{
return produceTime;
}
public List<MesProduceStatisticsDetailMaterial> getMesProduceStatisticsDetailMaterialList()
{
return mesProduceStatisticsDetailMaterialList;
}
public void setMesProduceStatisticsDetailMaterialList(List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList)
{
this.mesProduceStatisticsDetailMaterialList = mesProduceStatisticsDetailMaterialList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statisticsDetailId", getStatisticsDetailId())
.append("productOrderId", getProductOrderId())
.append("saleOrderId", getSaleOrderId())
.append("saleorderCode", getSaleorderCode())
.append("planId", getPlanId())
.append("planCode", getPlanCode())
.append("planDetailId", getPlanDetailId())
.append("planDetailCode", getPlanDetailCode())
.append("productId", getProductId())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("productSpec", getProductSpec())
.append("userId", getUserId())
.append("nickName", getNickName())
.append("processId", getProcessId())
.append("processName", getProcessName())
.append("planBeginTime", getPlanBeginTime())
.append("planEndTime", getPlanEndTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("produceTime", getProduceTime())
.append("createTime", getCreateTime())
.append("mesProduceStatisticsDetailMaterialList", getMesProduceStatisticsDetailMaterialList())
.toString();
}
}

@ -0,0 +1,122 @@
package com.hw.mes.domain;
import java.math.BigDecimal;
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;
/**
* 使; mes_produce_statistics_detail_material
*
* @author xins
* @date 2024-11-07
*/
public class MesProduceStatisticsDetailMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statisticsDetailMaterialId;
/** 生产统计明细ID */
@Excel(name = "生产统计明细ID")
private Long statisticsDetailId;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料规格 */
@Excel(name = "物料规格")
private String materialSpec;
/** 使用数量 */
@Excel(name = "使用数量")
private BigDecimal usedAmount;
public void setStatisticsDetailMaterialId(Long statisticsDetailMaterialId)
{
this.statisticsDetailMaterialId = statisticsDetailMaterialId;
}
public Long getStatisticsDetailMaterialId()
{
return statisticsDetailMaterialId;
}
public void setStatisticsDetailId(Long statisticsDetailId)
{
this.statisticsDetailId = statisticsDetailId;
}
public Long getStatisticsDetailId()
{
return statisticsDetailId;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialSpec(String materialSpec)
{
this.materialSpec = materialSpec;
}
public String getMaterialSpec()
{
return materialSpec;
}
public void setUsedAmount(BigDecimal usedAmount)
{
this.usedAmount = usedAmount;
}
public BigDecimal getUsedAmount()
{
return usedAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statisticsDetailMaterialId", getStatisticsDetailMaterialId())
.append("statisticsDetailId", getStatisticsDetailId())
.append("materialId", getMaterialId())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialSpec", getMaterialSpec())
.append("usedAmount", getUsedAmount())
.toString();
}
}

@ -71,6 +71,11 @@ public class MesProductPlanDetail extends BaseEntity
private String rawMaterialBarcode;
private String statisticsFlag;//统计标识,用来查询判断条件使用
private String nickName;
public void setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
@ -211,6 +216,22 @@ public class MesProductPlanDetail extends BaseEntity
this.rawMaterialBarcode = rawMaterialBarcode;
}
public String getStatisticsFlag() {
return statisticsFlag;
}
public void setStatisticsFlag(String statisticsFlag) {
this.statisticsFlag = statisticsFlag;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -199,6 +199,8 @@ public class MesSaleOrder extends BaseEntity {
private Long virtualSaleOrderId;
private String parentIds;
public String getMaterialModel() {
return materialModel;
@ -464,6 +466,14 @@ public class MesSaleOrder extends BaseEntity {
this.virtualSaleOrderId = virtualSaleOrderId;
}
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,145 @@
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;
/**
* mes_status_change_info
*
* @author xins
* @date 2024-11-07
*/
public class MesStatusChangeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long statusChangeInfoId;
/** 变化类型1mes_product_order */
@Excel(name = "变化类型", readConverterExp = "1=mes_product_order")
private String changeType;
/** 变化ID */
@Excel(name = "变化ID")
private Long changeId;
/** 老状态 */
@Excel(name = "老状态")
private String oldStatus;
/** 新状态 */
@Excel(name = "新状态")
private String newStatus;
/** 创建人 */
@Excel(name = "创建人")
private String changeBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date changeTime;
private Long productOrderId;
private Long planDetailId;
public void setStatusChangeInfoId(Long statusChangeInfoId)
{
this.statusChangeInfoId = statusChangeInfoId;
}
public Long getStatusChangeInfoId()
{
return statusChangeInfoId;
}
public void setChangeType(String changeType)
{
this.changeType = changeType;
}
public String getChangeType()
{
return changeType;
}
public void setChangeId(Long changeId)
{
this.changeId = changeId;
}
public Long getChangeId()
{
return changeId;
}
public void setOldStatus(String oldStatus)
{
this.oldStatus = oldStatus;
}
public String getOldStatus()
{
return oldStatus;
}
public void setNewStatus(String newStatus)
{
this.newStatus = newStatus;
}
public String getNewStatus()
{
return newStatus;
}
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 Long getProductOrderId() {
return productOrderId;
}
public void setProductOrderId(Long productOrderId) {
this.productOrderId = productOrderId;
}
public Long getPlanDetailId() {
return planDetailId;
}
public void setPlanDetailId(Long planDetailId) {
this.planDetailId = planDetailId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("statusChangeInfoId", getStatusChangeInfoId())
.append("changeType", getChangeType())
.append("changeId", getChangeId())
.append("oldStatus", getOldStatus())
.append("newStatus", getNewStatus())
.append("changeBy", getChangeBy())
.append("changeTime", getChangeTime())
.toString();
}
}

@ -60,11 +60,20 @@ public interface MesOrderBindMapper
public int deleteMesOrderBindByOrderBindIds(Long[] orderBindIds);
/**
* ,Join material
* ,Join material and product and saleorder
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinList(MesOrderBind mesOrderBind);
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind);
}

@ -0,0 +1,87 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.domain.MesProduceStatisticsDetailMaterial;
/**
* Mapper
*
* @author xins
* @date 2024-11-07
*/
public interface MesProduceStatisticsDetailMapper
{
/**
*
*
* @param statisticsDetailId
* @return
*/
public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param statisticsDetailId
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
/**
*
*
* @param statisticsDetailIds
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds);
/**
* 使;
*
* @param statisticsDetailIds
* @return
*/
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds(Long[] statisticsDetailIds);
/**
* 使;
*
* @param mesProduceStatisticsDetailMaterialList 使;
* @return
*/
public int batchMesProduceStatisticsDetailMaterial(List<MesProduceStatisticsDetailMaterial> mesProduceStatisticsDetailMaterialList);
/**
* 使;
*
* @param statisticsDetailId ID
* @return
*/
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId(Long statisticsDetailId);
}

@ -94,4 +94,12 @@ public interface MesProductPlanDetailMapper
public MesProductPlanDetail selectMesProductPlanDetailByMaterialBarcode(String materialBarcode);
/**
* ,使
*
* @param mesProductPlanDetail
* @return
*/
public List<MesProductPlanDetail> selectMesProductPlanDetailList4Statistics(MesProductPlanDetail mesProductPlanDetail);
}

@ -145,4 +145,13 @@ public interface MesProductPlanMapper
public List<MesProductPlan> selectOnlyConflictMesProductPlans(MesProductPlan mesProductPlan);
/**
*
*
* @param planId ID
* @return
*/
public MesProductPlan selectOnlyMesProductPlanByPlanId(Long planId);
}

@ -151,5 +151,14 @@ public interface MesPurchaseOrderMapper
*/
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId);
/**
* ,Join material
*
* @param purchaseOrderId
* @return
*/
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId);
}

@ -0,0 +1,70 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesStatusChangeInfo;
/**
* Mapper
*
* @author xins
* @date 2024-11-07
*/
public interface MesStatusChangeInfoMapper
{
/**
*
*
* @param statusChangeInfoId
* @return
*/
public MesStatusChangeInfo selectMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public List<MesStatusChangeInfo> selectMesStatusChangeInfoList(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public int insertMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param mesStatusChangeInfo
* @return
*/
public int updateMesStatusChangeInfo(MesStatusChangeInfo mesStatusChangeInfo);
/**
*
*
* @param statusChangeInfoId
* @return
*/
public int deleteMesStatusChangeInfoByStatusChangeInfoId(Long statusChangeInfoId);
/**
*
*
* @param statusChangeInfoIds
* @return
*/
public int deleteMesStatusChangeInfoByStatusChangeInfoIds(Long[] statusChangeInfoIds);
/**
* ,productOrderIdplanDetailId
*
* @param mesStatusChangeInfo
* @return
*/
public List<MesStatusChangeInfo> selectMesStatusChangeInfoListByProduce(MesStatusChangeInfo mesStatusChangeInfo);
}

@ -67,4 +67,12 @@ public interface IMesOrderBindService
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinList(MesOrderBind mesOrderBind);
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind);
}

@ -132,4 +132,10 @@ public interface IMesProductPlanDetailService {
* @return
*/
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo);
/**
*
* @param time
*/
public void generateProduceStatisticsDetail(String time);
}

@ -158,4 +158,12 @@ public interface IMesPurchaseOrderService
* @return
*/
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId);
/**
* ,join material
*
* @param purchaseOrderId
* @return
*/
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId);
}

@ -91,6 +91,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Resource
private RemoteWmsService remoteWmsService;
public final String splitCharacter = "/";
public final int materialNameLength = 4;
/**
*
*
@ -294,11 +297,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPurchaseOrderId(mesBaseBarcodeInfo.getPurchaseOrderId());
queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
queryBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR);
List<MesBaseBarcodeInfo> baseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
if (baseBarcodeInfos != null && !baseBarcodeInfos.isEmpty()) {
throw new ServiceException("已经有此物料固定条码,无需重复生成");
throw new ServiceException("已经有此采购订单物料固定条码,无需重复生成");
}
String barcodeInfo = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
@ -896,16 +900,32 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String userName = SecurityUtils.getUsername();
Date currentDate = DateUtils.getNowDate();
if (productBarcodesArr != null) {
for (String productBarcode : productBarcodesArr) {
StringBuilder materialNameBuilder = new StringBuilder();
for (String oriProductBarcode : productBarcodesArr) {
//先根据之前的成品条码信息获取托盘信息
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcode);
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcode);
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode);
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品条码").append(productBarcode).append("不存在;");
} else {
allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;");
}
if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode());
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;");
}
}
productBarcodeInfoList.add(productBarcodeInfo);
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
querySaleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo());
List<MesSaleOrderRelate> mesSaleOrderRelates = mesSaleOrderRelateMapper.selectMesSaleOrderRelateList(querySaleOrderRelate);
if(mesSaleOrderRelates!=null && !mesSaleOrderRelates.isEmpty()){
allErrorMsgBuilder.append("此条码[").append(oriProductBarcode).append("]已经生成过原材料条码;");
}
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodeInfo.getBarcodeInfo());
//多个成品条码绑定的条码必须相同
if (basePalletInfo != null) {
if (StringUtils.isEmpty(palletInfoCode)) {
@ -921,14 +941,20 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
basePalletInfoList.add(basePalletInfo);
}
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcode, productBarcodeInfo, mesBaseBarcodeInfo));
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcodeInfo.getBarcodeInfo(), productBarcodeInfo, mesBaseBarcodeInfo));
String materialName = productBarcodeInfo.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
}
barcodeInfo = Seq.getId(Seq.mesInternalVirtualBarcodeSeqType, Seq.mesInternalVirtualBarcodeCode);
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
//新建虚拟物料
materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate);
} else {
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodes);
@ -1042,6 +1068,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// if (bindBarcodeRelate != null) {
// allErrorMsgBuilder.append("成品条码:").append(productBarcodeInfo.getBarcodeInfo()).append("已经生成过原材料条码;");
// }
//四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓
MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate();
saleOrderRelate.setBarcodeInfo(barcodeInfo);
@ -1320,6 +1350,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
StringBuilder errorMsgBuilder = new StringBuilder();
int materialNameLength = 4;
String splitCharacter = "|";
StringBuilder materialNameBuilder = new StringBuilder();//将多个物料的名称拼接(取前几个字符(materialNameLength)拼接,目前是前4个字符
for (MesSaleOrderRelate mesSaleOrderRelate : mesSaleOrderRelateList) {
if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) {
throw new ServiceException("请选择采购数量为1的采购订单信息");
@ -1396,6 +1429,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
dbOrderBind.setUpdateBy(userName);
mesOrderBindMapper.updateMesOrderBind(dbOrderBind);
String materialName = mesSaleOrderRelate.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
// materialCodes.add(mesPurchaseOrderVo.getMaterialCode());
}
@ -1403,11 +1440,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(errorMsgBuilder.toString());
}
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
String barcodeInfo = Seq.getId(Seq.mesPurchaseVirtualBarcodeSeqType, Seq.mesPurchaseVirtualBarcodeCode);
//新建虚拟物料
Long materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
Long materialId = this.insertNewVirtualMaterial(barcodeInfo, mergeMaterialName,userName, currentDate);
//创建虚拟销售订单,保存对应的销售订单列表
MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate);
@ -1427,6 +1465,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode());
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE);
toInsertedBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size()));
// toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString());
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
@ -1447,11 +1486,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
public long insertNewVirtualMaterial(String barcodeInfo, String userName, Date currentDate) {
public long insertNewVirtualMaterial(String barcodeInfo, String materialName,String userName, Date currentDate) {
//虚拟成品和虚拟原材料用一个物料
MesBaseMaterialInfo mesBaseMaterialInfo = new MesBaseMaterialInfo();
mesBaseMaterialInfo.setMaterialCode(barcodeInfo);
mesBaseMaterialInfo.setMaterialName(barcodeInfo);
mesBaseMaterialInfo.setMaterialName(materialName);
mesBaseMaterialInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
// mesBaseMaterialInfo.setMaterialCategories(MesConstants.MES_MATERIAL_CATEGORIES_RAW);
mesBaseMaterialInfo.setActiveFlag(MesConstants.MES_MATERIAL_ALWAYS_FLAG_NO);
@ -1627,6 +1666,17 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
//修改后的合并信息
List<MesSaleOrderRelate> mesSaleOrderRelateList = mesBaseBarcodeInfo.getMesSaleOrderRelateList();
StringBuilder materialNameBuilder = new StringBuilder();
for(MesSaleOrderRelate mesSaleOrderRelate:mesSaleOrderRelateList){
String materialName = mesSaleOrderRelate.getMaterialName();
materialName = materialName.substring(0,materialNameLength);
materialNameBuilder.append(splitCharacter).append(materialName);
}
String mergeMaterialName = materialNameBuilder.toString().replaceFirst(splitCharacter,"");
mesBaseBarcodeInfo.setAmount(new BigDecimal(mesSaleOrderRelateList.size()));
//数据库中的合并信息
MesSaleOrderRelate querySaleOrderRelateByBarcodeInfo = new MesSaleOrderRelate();
querySaleOrderRelateByBarcodeInfo.setBarcodeInfo(barcodeInfo);
@ -1697,7 +1747,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
MesBaseMaterialInfo virtualMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesBaseBarcodeInfo.getMaterialId());
virtualMaterialInfo.setMaterialName(mergeMaterialName);
mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(virtualMaterialInfo);
//生成条码
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
@ -1752,6 +1808,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public StringBuilder handleInsertSaleOrderRelates(List<MesSaleOrderRelate> toInsertedSaleOrderRelateList, MesBaseBarcodeInfo baseBarcodeInfo,
MesMaterialBom virtualMaterialBom, String userName, Date currentDate) {
StringBuilder errorMsgBuilder = new StringBuilder();
if(toInsertedSaleOrderRelateList==null || toInsertedSaleOrderRelateList.isEmpty()){
return errorMsgBuilder;
}
List<MesMaterialBom> toUpdatedMaterialBoms = new ArrayList<>();
for (MesSaleOrderRelate mesSaleOrderRelate : toInsertedSaleOrderRelateList) {
if (mesSaleOrderRelate.getOrderAmount() == null || mesSaleOrderRelate.getOrderAmount().compareTo(BigDecimal.ONE) != 0) {
@ -2290,4 +2350,5 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// }
//
// }
}

@ -155,7 +155,40 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
throw new ServiceException("此物料条码还未打印");
}
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getPalletInfoCode()) && mesBaseBarcodeInfo.getPalletInfoCode().equals(palletInfoCode)) {
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial();
wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId());
R<Boolean> isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER);
if (!isExistWarehouseMaterial.getData()) {
throw new ServiceException("此物料还没有配置仓库信息");
}
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
String oriPalletInfoCode="";
if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBindBarcode());
oriPalletInfoCode = productBarcodeInfo.getPalletInfoCode();
materialBarcode = productBarcodeInfo.getBarcodeInfo();
productBarcodeInfo.setPalletInfoCode(palletInfoCode);
productBarcodeInfo.setUpdateBy(userName);
productBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo);
} else {
oriPalletInfoCode = mesBaseBarcodeInfo.getPalletInfoCode();
mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
if (StringUtils.isNotEmpty(oriPalletInfoCode) && oriPalletInfoCode.equals(palletInfoCode)) {
throw new ServiceException("已经绑定过");
}
@ -174,26 +207,10 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
throw new ServiceException("此物料条码存在原材料库存,不能绑定");
}
if(mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)){
WmsWarehouseMaterial wmsWarehouseMaterial = new WmsWarehouseMaterial();
wmsWarehouseMaterial.setStorageId(mesBaseBarcodeInfo.getMaterialId());
R<Boolean> isExistWarehouseMaterial = remoteWmsService.isExistWarehouseMaterial(wmsWarehouseMaterial, SecurityConstants.INNER);
if (!isExistWarehouseMaterial.getData()) {
throw new ServiceException("此物料还没有配置仓库信息");
}
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
mesBasePalletInfo.setMaterialBarcode(materialBarcode);
mesBasePalletInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
mesBasePalletInfo.setMaterialCode(mesBasePalletInfo.getMaterialCode());
mesBasePalletInfo.setMaterialCode(mesBaseBarcodeInfo.getMaterialCode());
mesBasePalletInfo.setMaterialName(mesBaseBarcodeInfo.getMaterialName());
mesBasePalletInfo.setUpdateBy(userName);
mesBasePalletInfo.setUpdateTime(currentDate);

@ -101,7 +101,6 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
*/
@Override
public MesBaseStationInfo getLoginStationInfo() {
//TODO:正式时需要修改回来
String ipAddress = SecurityUtils.getLoginUser().getIpaddr();
// ipAddress = "192.168.2.25";

@ -386,7 +386,7 @@ public class MesImportImpl implements IMesImportService {
}
Cell amountCell = rowC.getCell(5);
Cell brandCell = rowC.getCell(6);
if (StringUtils.isNotEmpty(materialCode)) {
if (StringUtils.isNotEmpty(materialCode) && !materialCode.equals("物料编码")) {
MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode);
if (StringUtils.isNotNull(materialInfo)) {
MesRaiseCapitalBom materialBom = new MesRaiseCapitalBom();

@ -104,4 +104,17 @@ public class MesOrderBindServiceImpl implements IMesOrderBindService {
? mesOrderBind.getSpecificationParameter().replaceAll("\\s+", "") : "");
return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind);
}
/**
* ,Join product
*
* @param mesOrderBind
* @return
*/
@Override
public List<MesOrderBind> selectMesOrderBindJoinProductList(MesOrderBind mesOrderBind) {
return mesOrderBindMapper.selectMesOrderBindJoinList(mesOrderBind);
}
}

@ -22,6 +22,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
@ -52,6 +53,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesStatusChangeInfoMapper mesStatusChangeInfoMapper;
@Autowired
private MesProduceStatisticsDetailMapper mesProduceStatisticsDetailMapper;
@Autowired
private MesConfig mesConfig;
@ -365,7 +372,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
//如果是五楼拆分,校验是否有配对条码
if (StringUtils.isNotEmpty(mesProductPlanDetail.getProcessType())
&& mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) {
@ -528,7 +534,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Override
@Transactional(rollbackFor = Exception.class)
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) {
//根据planId获取最新一条的生产计划明细
//根据planId和userId获取最新一条的生产计划明细
mesProductPlanDetail.setUserId(SecurityUtils.getUserId());
MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail);
//如果此计划有最新的计划明细
@ -665,9 +672,9 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) {
throw new ServiceException("此条码已经扫描使用过,不能再次使用");
}
// if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) {
// throw new ServiceException("此条码已经扫描使用过,不能再次使用");
// }
MesProductPlan barcodeProductPlan;
@ -693,8 +700,16 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
if (!barcodeProductPlan.getDispatchCode().equals(dispatchCode)) {
throw new ServiceException("此条码的派工单号为:" + barcodeProductPlan.getDispatchCode() + ",与此派工单号不符");
}
MesProductPlanDetail queryProductPlanDetail = new MesProductPlanDetail();
queryProductPlanDetail.setMaterialBarcode(materialBarcode);
queryProductPlanDetail.setUserId(SecurityUtils.getUserId());
List<MesProductPlanDetail> mesProductPlanDetails = mesProductPlanDetailMapper.selectMesProductPlanDetailList(queryProductPlanDetail);
if(mesProductPlanDetails!=null && !mesProductPlanDetails.isEmpty()){
throw new ServiceException("您已经扫描此条码开始过,请勿重复扫描");
}
}
bindBarcodeInfo.setTransferredPlanDetailCode(planDetailCode);
@ -754,7 +769,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
/**
*
*
@ -781,7 +795,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
/**
*
*
@ -807,4 +820,86 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
/**
*
* @param time
*/
@Override
public void generateProduceStatisticsDetail(String time) {
MesProductPlanDetail queryProductPlandetail = new MesProductPlanDetail();
queryProductPlandetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH);
queryProductPlandetail.setStatisticsFlag("1");
List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlanDetailMapper.selectMesProductPlanDetailList4Statistics(queryProductPlandetail);
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//易耗品标识,分摊到各个生产计划明细中
//计算工时
Date realBeginTime = mesProductPlanDetail.getRealBeginTime();
Date realEndTime = mesProductPlanDetail.getRealEndTime();
Long produceTime = realEndTime.getTime()-realBeginTime.getTime();
MesStatusChangeInfo queryStatusChangeInfo = new MesStatusChangeInfo();
queryStatusChangeInfo.setProductOrderId(mesProductPlan.getProductOrderId());
queryStatusChangeInfo.setPlanDetailId(mesProductPlanDetail.getPlanDetailId());
List<MesStatusChangeInfo> mesStatusChangeInfoList = mesStatusChangeInfoMapper.selectMesStatusChangeInfoListByProduce(queryStatusChangeInfo);
// Optional<MesStatusChangeInfo> result = mesStatusChangeInfoList.stream()
// .filter(msci -> (StringUtils.isEmpty(msci.getOldStatus()) && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
// || StringUtils.isNotEmpty(msci.getOldStatus()) && msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)
// && msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
// .findFirst();
// if(result.isPresent()){
// MesStatusChangeInfo startStatus = result.get();
// }
List<MesStatusChangeInfo> pause2StartOrFinishChangeInfoList = mesStatusChangeInfoList.stream()
.filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && ((msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED))
|| (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)))).collect(Collectors.toList());
List<MesStatusChangeInfo> start2PauseChangeInfoList = mesStatusChangeInfoList.stream()
.filter(msci -> StringUtils.isNotEmpty(msci.getOldStatus()) && (msci.getOldStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)
&& msci.getNewStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE))).collect(Collectors.toList());
if (pause2StartOrFinishChangeInfoList.size() == start2PauseChangeInfoList.size()) {
for (int i = 0; i < pause2StartOrFinishChangeInfoList.size(); i++) {
MesStatusChangeInfo pause2StartOrFinishChangeInfo = pause2StartOrFinishChangeInfoList.get(i);
MesStatusChangeInfo start2PauseChangeInfo = start2PauseChangeInfoList.get(i);
Long startOrFinshChangeTimeL = pause2StartOrFinishChangeInfo.getChangeTime().getTime();
Long pauseChangeTimeL = start2PauseChangeInfo.getChangeTime().getTime();
produceTime = produceTime -(startOrFinshChangeTimeL-pauseChangeTimeL);
}
}
MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail();
mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId());
mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId());
mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode());
mesProduceStatisticsDetail.setPlanId(mesProductPlanDetail.getPlanId());
mesProduceStatisticsDetail.setPlanCode(mesProductPlan.getPlanCode());
mesProduceStatisticsDetail.setPlanDetailId(mesProductPlanDetail.getPlanDetailId());
mesProduceStatisticsDetail.setPlanDetailCode(mesProductPlanDetail.getPlanDetailCode());
mesProduceStatisticsDetail.setProductId(mesProductPlan.getMaterialId());
mesProduceStatisticsDetail.setUserId(mesProductPlanDetail.getUserId());
mesProduceStatisticsDetail.setNickName(mesProductPlanDetail.getNickName());
mesProduceStatisticsDetail.setProcessId(mesProductPlan.getProcessId());
mesProduceStatisticsDetail.setProcessName(mesProductPlan.getProcessName());
mesProduceStatisticsDetail.setPlanBeginTime(mesProductPlan.getPlanBeginTime());
mesProduceStatisticsDetail.setPlanEndTime(mesProductPlan.getRealEndTime());
mesProduceStatisticsDetail.setRealBeginTime(realBeginTime);
mesProduceStatisticsDetail.setRealEndTime(realEndTime);
mesProduceStatisticsDetail.setProduceTime(produceTime);
mesProduceStatisticsDetail.setCreateTime(new Date());
mesProduceStatisticsDetailMapper.insertMesProduceStatisticsDetail(mesProduceStatisticsDetail);
}
}
}

@ -585,4 +585,16 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId) {
return mesPurchaseOrderMapper.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId);
}
/**
* ,join material
*
* @param purchaseOrderId
* @return
*/
@Override
public MesPurchaseOrder selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(Long purchaseOrderId) {
return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinMaterialByPurchaseOrderId(purchaseOrderId);
}
}

@ -1,6 +1,7 @@
package com.hw.mes.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -11,7 +12,9 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.mes.mapper.MesMaterialBomMapper;
import com.hw.mes.mapper.MesSaleOrderRelateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -37,6 +40,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
@Autowired
private MesSaleOrderRelateMapper mesSaleOrderRelateMapper;
@Autowired
private MesMaterialBomMapper mesMaterialBomMapper;
/**
*
*
@ -116,7 +122,36 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
public List<MesSaleOrder> selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder) {
mesSaleOrder.setMaterialSpec(StringUtils.isNotEmpty(mesSaleOrder.getMaterialSpec())
? mesSaleOrder.getMaterialSpec().replaceAll("\\s+", "") : "");
if (mesSaleOrder.getMaterialId() != null) {
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setMaterialId(mesSaleOrder.getMaterialId());
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms != null && !mesMaterialBoms.isEmpty()) {
StringBuilder parentIdsBuilder = new StringBuilder();
for (MesMaterialBom mesMaterialBom : mesMaterialBoms) {
String ancestors = mesMaterialBom.getAncestors();
int commaIndex = ancestors.indexOf(",");
if (commaIndex >= 0) {
String ancestorPostfix = ancestors.substring(commaIndex + 1);
commaIndex = ancestorPostfix.indexOf(",");
if (commaIndex >= 0) {
ancestorPostfix = ancestorPostfix.substring(commaIndex + 1);
}
parentIdsBuilder.append(",").append(ancestorPostfix);
}
}
String parentIds = parentIdsBuilder.toString().replaceFirst(",", "");
mesSaleOrder.setParentIds(parentIds);
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
} else {
return new ArrayList<>();
}
} else {
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
}
}
@ -173,6 +208,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
/**
* relatesaleorderId
*
* @param saleOrderId
* @return
*/
@ -185,6 +221,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
/**
* relatesaleorderId
*
* @param saleOrderId
* @return
*/
@ -196,5 +233,4 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
}
}

@ -103,6 +103,7 @@
<include refid="selectMesBaseBarcodeInfoVo"/>
<where>
<if test="printTime != null ">and bbi.print_time = #{printTime}</if>
<if test="purchaseOrderId != null ">and bbi.purchase_order_id = #{purchaseOrderId}</if>
<if test="printPerson != null and printPerson != ''">and bbi.print_person = #{printPerson}</if>
<if test="printFlag != null and printFlag != ''">and bbi.print_flag = #{printFlag}</if>
<if test="batchFlag != null and batchFlag != ''">and bbi.batch_flag = #{batchFlag}</if>

@ -169,4 +169,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by mob.order_bind_id desc
</select>
<select id="selectMesOrderBindJoinProductList" parameterType="MesOrderBind" resultMap="MesOrderBindResult">
select mob.order_bind_id, mob.safe_flag, mob.sale_order_id, mob.sale_order_code,
mob.purchase_order_id, mob.po_no, mob.bind_amount, mob.barcode_amount,
mob.product_id,pbmi.material_code as product_code,pbmi.material_name as product_name,pbmi.material_spec as product_spec,
mob.material_id,mbmi.material_code,mbmi.material_name,mbmi.material_spec
from mes_order_bind mob left join mes_base_material_info pbmi on mob.product_id=pbmi.material_id
<where>
<if test="mergeFlag != null and mergeFlag != ''"> and mob.bind_amount=1 and mob.barcode_amount=0 and mso.order_amount=1</if>
<if test="singleFlag != null and singleFlag != ''"> and mob.bind_amount &gt; mob.barcode_amount</if>
<if test="safeFlag != null and safeFlag != ''"> and mob.safe_flag = #{safeFlag}</if>
<if test="saleOrderId != null"> and mob.sale_order_id = #{saleOrderId}</if>
<if test="purchaseOrderId != null"> and mob.purchase_order_id = #{purchaseOrderId}</if>
<if test="saleOrderCode != null and saleOrderCode != ''"> and mob.sale_order_code like concat('%', #{saleOrderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and pbmi.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and pbmi.product_name like concat('%', #{productName}, '%')</if>
</where>
order by mob.order_bind_id desc
</select>
</mapper>

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.MesProduceStatisticsDetailMapper">
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
<result property="statisticsDetailId" column="statistics_detail_id" />
<result property="productOrderId" column="product_order_id" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="planId" column="plan_id" />
<result property="planCode" column="plan_code" />
<result property="planDetailId" column="plan_detail_id" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="productSpec" column="product_spec" />
<result property="userId" column="user_id" />
<result property="nickName" column="nick_name" />
<result property="processId" column="process_id" />
<result property="processName" column="process_name" />
<result property="planBeginTime" column="plan_begin_time" />
<result property="planEndTime" column="plan_end_time" />
<result property="realBeginTime" column="real_begin_time" />
<result property="realEndTime" column="real_end_time" />
<result property="produceTime" column="produce_time" />
<result property="createTime" column="create_time" />
</resultMap>
<resultMap id="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult" type="MesProduceStatisticsDetail" extends="MesProduceStatisticsDetailResult">
<collection property="mesProduceStatisticsDetailMaterialList" notNullColumn="sub_statistics_detail_material_id" javaType="java.util.List" resultMap="MesProduceStatisticsDetailMaterialResult" />
</resultMap>
<resultMap type="MesProduceStatisticsDetailMaterial" id="MesProduceStatisticsDetailMaterialResult">
<result property="statisticsDetailMaterialId" column="sub_statistics_detail_material_id" />
<result property="statisticsDetailId" column="sub_statistics_detail_id" />
<result property="materialId" column="sub_material_id" />
<result property="materialCode" column="sub_material_code" />
<result property="materialName" column="sub_material_name" />
<result property="materialSpec" column="sub_material_spec" />
<result property="usedAmount" column="sub_used_amount" />
</resultMap>
<sql id="selectMesProduceStatisticsDetailVo">
select statistics_detail_id, product_order_id, sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail
</sql>
<select id="selectMesProduceStatisticsDetailList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult">
<include refid="selectMesProduceStatisticsDetailVo"/>
<where>
<if test="productOrderId != null "> and product_order_id = #{productOrderId}</if>
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productSpec != null and productSpec != ''"> and product_spec = #{productSpec}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="processId != null "> and process_id = #{processId}</if>
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
<if test="planBeginTime != null "> and plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null "> and plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
<if test="produceTime != null "> and produce_time = #{produceTime}</if>
</where>
</select>
<select id="selectMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long" resultMap="MesProduceStatisticsDetailMesProduceStatisticsDetailMaterialResult">
select a.statistics_detail_id, a.product_order_id, a.sale_order_id, a.saleorder_code, a.plan_id, a.plan_code, a.plan_detail_id, a.plan_detail_code, a.product_id, a.product_code, a.product_name, a.product_spec, a.user_id, a.nick_name, a.process_id, a.process_name, a.plan_begin_time, a.plan_end_time, a.real_begin_time, a.real_end_time, a.produce_time, a.create_time,
b.statistics_detail_material_id as sub_statistics_detail_material_id, b.statistics_detail_id as sub_statistics_detail_id, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.material_spec as sub_material_spec, b.used_amount as sub_used_amount
from mes_produce_statistics_detail a
left join mes_produce_statistics_detail_material b on b.statistics_detail_id = a.statistics_detail_id
where a.statistics_detail_id = #{statisticsDetailId}
</select>
<insert id="insertMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail" useGeneratedKeys="true" keyProperty="statisticsDetailId">
insert into mes_produce_statistics_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="planId != null">plan_id,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="planDetailId != null">plan_detail_id,</if>
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code,</if>
<if test="productId != null">product_id,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="productSpec != null">product_spec,</if>
<if test="userId != null">user_id,</if>
<if test="nickName != null">nick_name,</if>
<if test="processId != null">process_id,</if>
<if test="processName != null">process_name,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="produceTime != null">produce_time,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="planId != null">#{planId},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="planDetailId != null">#{planDetailId},</if>
<if test="planDetailCode != null and planDetailCode != ''">#{planDetailCode},</if>
<if test="productId != null">#{productId},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="productSpec != null">#{productSpec},</if>
<if test="userId != null">#{userId},</if>
<if test="nickName != null">#{nickName},</if>
<if test="processId != null">#{processId},</if>
<if test="processName != null">#{processName},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="produceTime != null">#{produceTime},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMesProduceStatisticsDetail" parameterType="MesProduceStatisticsDetail">
update mes_produce_statistics_detail
<trim prefix="SET" suffixOverrides=",">
<if test="productOrderId != null">product_order_id = #{productOrderId},</if>
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code = #{planDetailCode},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productSpec != null">product_spec = #{productSpec},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="processName != null">process_name = #{processName},</if>
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="produceTime != null">produce_time = #{produceTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where statistics_detail_id = #{statisticsDetailId}
</update>
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailId" parameterType="Long">
delete from mes_produce_statistics_detail where statistics_detail_id = #{statisticsDetailId}
</delete>
<delete id="deleteMesProduceStatisticsDetailByStatisticsDetailIds" parameterType="String">
delete from mes_produce_statistics_detail where statistics_detail_id in
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
#{statisticsDetailId}
</foreach>
</delete>
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailIds" parameterType="String">
delete from mes_produce_statistics_detail_material where statistics_detail_id in
<foreach item="statisticsDetailId" collection="array" open="(" separator="," close=")">
#{statisticsDetailId}
</foreach>
</delete>
<delete id="deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId" parameterType="Long">
delete from mes_produce_statistics_detail_material where statistics_detail_id = #{statisticsDetailId}
</delete>
<insert id="batchMesProduceStatisticsDetailMaterial">
insert into mes_produce_statistics_detail_material( statistics_detail_material_id, statistics_detail_id, material_id, material_code, material_name, material_spec, used_amount) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount})
</foreach>
</insert>
</mapper>

@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="stationId" column="station_id" />
<result property="attachName" column="attach_name" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectMesProductPlanDetailVo">
@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
<if test="planDetailStatus != null and planDetailStatus != ''"> and plan_detail_status = #{planDetailStatus}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
</where>
order by plan_detail_status asc,plan_detail_id desc
</select>
@ -138,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
real_begin_time, real_end_time, plan_detail_status
from mes_product_plan_detail mppd
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="planId == null "> and exists (select 1 from mes_product_plan mpp where mppd.plan_id=mpp.plan_id and mpp.station_id=#{stationId})</if>
</where>
@ -166,4 +169,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesProductPlanDetailVo"/>
where material_barcode = #{materialBarcode}
</select>
<select id="selectMesProductPlanDetailList4Statistics" parameterType="MesProductPlanDetail" resultMap="MesProductPlanDetailResult">
select mppd.plan_detail_id, mppd.plan_detail_code, mppd.plan_id, mppd.plan_code, mppd.user_id, mppd.user_name,mppd.real_begin_time,
mppd.real_end_time,mppd.plan_detail_status,su.nick_name from mes_product_plan_detail mppd left join sys_user su on mppd.user_id=su.user_id
<where>
<if test="planDetailStatus != null and planDetailStatus != ''"> and mppd.plan_detail_status = #{planDetailStatus}</if>
<if test="statisticsFlag != null and statisticsFlag != ''"> and not exists (select 1 from mes_produce_statistics_detail mpsd where mppd.plan_detail_id=mpsd.plan_detail_id)</if>
</where>
order by plan_detail_code
</select>
</mapper>

@ -546,4 +546,42 @@
</select>
<select id="selectOnlyMesProductPlanByPlanId" parameterType="Long" 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.final_process_flag,
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,
a.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.sale_order_id,
b.saleorder_code
from mes_product_plan a left join mes_product_order b on a.product_order_id = b.product_order_id
where a.plan_id = #{planId}
</select>
</mapper>

@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
<if test="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
<if test="materialBomId != null"> and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mpo.material_id and mmb.ancestors like concat('0,', #{materialBomId}, '%') )</if>
</where>
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select>
@ -474,7 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productSpec != null and productSpec != ''">and replace(pbmi.material_spec,' ','') like concat('%', #{productSpec},
'%')</if>
</where>
order by mpo.po_no
order by mpo.create_time desc
</select>
@ -498,4 +498,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.purchase_order_id = #{purchaseOrderId}
</select>
<select id="selectMesPurchaseOrderJoinMaterialByPurchaseOrderId" parameterType="Long" resultMap="MesPurchaseOrderResult">
select a.purchase_order_id, a.po_no, a.document_status, a.material_id as erp_material_id,
a.material_code, a.material_name, a.order_amount, a.complete_amount, a.approve_date,a.specification_parameter,
a.erp_modify_date, a.plan_delivery_date, a.order_status, a.complete_date,
a.is_flag, a.src_bill_no,
a.purchase_org_id, a.tond_base, a.supplier_id,a.create_by, a.create_time, a.update_by, a.update_time,
mbmi1.material_id,mbmi1.material_code,mbmi1.material_name,mbmi1.material_spec
from mes_purchase_order a
left join mes_base_material_info mbmi1 on a.material_id = mbmi1.erp_id
where a.purchase_order_id = #{purchaseOrderId}
</select>
</mapper>

@ -270,7 +270,7 @@
<if test="saleOrderClassfication != null and saleOrderClassfication != ''">and mso.sale_order_classfication = #{saleOrderClassfication}</if>
<if test="relateFlag != null and relateFlag != ''">and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId})</if>
<if test="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<if test="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
</where>
order by mso.erp_modify_date desc
</select>

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesSaleOrderRelateVo"/>
<where>
<if test="barcodeInfo != null and barcodeInfo != '' "> and barcode_info = #{barcodeInfo}</if>
<if test="bindBarcode != null and bindBarcode != '' "> and bind_barcode = #{bindBarcode}</if>
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
<if test="relateSaleOrderId != null "> and relate_sale_order_id = #{relateSaleOrderId}</if>
<if test="purchaseOrderId != null "> and purchase_order_id = #{purchaseOrderId}</if>

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.MesStatusChangeInfoMapper">
<resultMap type="MesStatusChangeInfo" id="MesStatusChangeInfoResult">
<result property="statusChangeInfoId" column="status_change_info_id" />
<result property="changeType" column="change_type" />
<result property="changeId" column="change_id" />
<result property="oldStatus" column="old_status" />
<result property="newStatus" column="new_status" />
<result property="changeBy" column="change_by" />
<result property="changeTime" column="change_time" />
</resultMap>
<sql id="selectMesStatusChangeInfoVo">
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
</sql>
<select id="selectMesStatusChangeInfoList" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
<include refid="selectMesStatusChangeInfoVo"/>
<where>
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
<if test="changeId != null "> and change_id = #{changeId}</if>
<if test="oldStatus != null and oldStatus != ''"> and old_status = #{oldStatus}</if>
<if test="newStatus != null and newStatus != ''"> and new_status = #{newStatus}</if>
<if test="changeBy != null and changeBy != ''"> and change_by = #{changeBy}</if>
<if test="changeTime != null "> and change_time = #{changeTime}</if>
</where>
</select>
<select id="selectMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long" resultMap="MesStatusChangeInfoResult">
<include refid="selectMesStatusChangeInfoVo"/>
where status_change_info_id = #{statusChangeInfoId}
</select>
<insert id="insertMesStatusChangeInfo" parameterType="MesStatusChangeInfo" useGeneratedKeys="true" keyProperty="statusChangeInfoId">
insert into mes_status_change_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="changeType != null and changeType != ''">change_type,</if>
<if test="changeId != null">change_id,</if>
<if test="oldStatus != null">old_status,</if>
<if test="newStatus != null and newStatus != ''">new_status,</if>
<if test="changeBy != null">change_by,</if>
<if test="changeTime != null">change_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="changeType != null and changeType != ''">#{changeType},</if>
<if test="changeId != null">#{changeId},</if>
<if test="oldStatus != null">#{oldStatus},</if>
<if test="newStatus != null and newStatus != ''">#{newStatus},</if>
<if test="changeBy != null">#{changeBy},</if>
<if test="changeTime != null">#{changeTime},</if>
</trim>
</insert>
<update id="updateMesStatusChangeInfo" parameterType="MesStatusChangeInfo">
update mes_status_change_info
<trim prefix="SET" suffixOverrides=",">
<if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
<if test="changeId != null">change_id = #{changeId},</if>
<if test="oldStatus != null">old_status = #{oldStatus},</if>
<if test="newStatus != null and newStatus != ''">new_status = #{newStatus},</if>
<if test="changeBy != null">change_by = #{changeBy},</if>
<if test="changeTime != null">change_time = #{changeTime},</if>
</trim>
where status_change_info_id = #{statusChangeInfoId}
</update>
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoId" parameterType="Long">
delete from mes_status_change_info where status_change_info_id = #{statusChangeInfoId}
</delete>
<delete id="deleteMesStatusChangeInfoByStatusChangeInfoIds" parameterType="String">
delete from mes_status_change_info where status_change_info_id in
<foreach item="statusChangeInfoId" collection="array" open="(" separator="," close=")">
#{statusChangeInfoId}
</foreach>
</delete>
<select id="selectMesStatusChangeInfoListByProduce" parameterType="MesStatusChangeInfo" resultMap="MesStatusChangeInfoResult">
select status_change_info_id, change_type, change_id, old_status, new_status, change_by, change_time from mes_status_change_info
where (change_type='1' and change_id=#{productOrderId}) or (change_type='2' and change_id=#{planDetailId})
order by change_time
</select>
</mapper>

@ -139,6 +139,9 @@ public class WmsRawReturn extends BaseEntity
private String productName;
private String executeStatusStr;
/** 原材料退库记录明细信息 */
private List<WmsRawReturnDetail> wmsRawReturnDetailList;
@ -437,6 +440,14 @@ public class WmsRawReturn extends BaseEntity
this.productName = productName;
}
public String getExecuteStatusStr() {
return executeStatusStr;
}
public void setExecuteStatusStr(String executeStatusStr) {
this.executeStatusStr = executeStatusStr;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -417,14 +417,32 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
* @return
*/
public int produceInstock(MesBaseBarcodeInfo baseBarcodeInfo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) {
//半成品入库按原材料入库的柜体原料码进行入库
if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) {
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
throw new ServiceException("请按原材料柜体条码入库");
}
} else {//其他按成品条码入库
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {//其他按成品条码入库(四楼对内生产的可以按配对码入库)
String barcodeType = baseBarcodeInfo.getBarcodeType();
//判断条码信息如果是配对码,则需要通过配对码找成品条码入库
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
String productBarcode = baseBarcodeInfo.getBindBarcode();
R<MesBaseBarcodeInfo> productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
if (productBarcodeInfoR == null) {
throw new ServiceException("没找到成品条码");
}
MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData();
if (productBarcodeInfo == null) {
throw new ServiceException("没找到成品条码!");
}
baseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo());
baseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode());
baseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode());
baseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode());
} else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {
throw new ServiceException("请按成品条码入库");
}
}
@ -433,19 +451,19 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("此条码还未打印");
}
//如果执行状态不是已完成是agv入库则需要判断是否有入库记录避免重复提交如果执行状态是已完成人工入库则判断是否有此成品条码库存即可
if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
//判断是否已经入过库,不能重复入库
// if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
WmsProductInstock queryProductInstock = new WmsProductInstock();
queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引查出来再过滤性能更快
List<WmsProductInstock> wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock);
if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) {
List<WmsProductInstock> incompleteProductInstocks = wmsProductInstocks.stream().filter(
wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList());
if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) {
// List<WmsProductInstock> incompleteProductInstocks = wmsProductInstocks.stream().filter(
// wmsProductInstock -> !wmsProductInstock.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)).collect(Collectors.toList());
// if (incompleteProductInstocks != null && !incompleteProductInstocks.isEmpty()) {
throw new ServiceException("已经有此成品入库记录");
// }
}
}
}
// }
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
@ -477,7 +495,6 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
/**
* ;,join material
*

@ -317,13 +317,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
Long warehouseId = wmsProduceInstockVo.getWarehouseId();
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量
if (availableAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("没有库存信息");
}
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoData = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoData == null) {
throw new ServiceException("物料条码有误");
@ -332,6 +325,37 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误!");
}
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
//判断条码信息如果是配对码,则需要通过配对码找成品条码入库
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
String productBarcode = mesBaseBarcodeInfo.getBindBarcode();
R<MesBaseBarcodeInfo> productBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
if (productBarcodeInfoR == null) {
throw new ServiceException("没找到成品条码");
}
MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData();
if (productBarcodeInfo == null) {
throw new ServiceException("没找到成品条码!");
}
mesBaseBarcodeInfo.setBarcodeInfo(productBarcodeInfo.getBarcodeInfo());
mesBaseBarcodeInfo.setBatchCode(productBarcodeInfo.getBatchCode());
mesBaseBarcodeInfo.setPlanCode(productBarcodeInfo.getPlanCode());
mesBaseBarcodeInfo.setPlanDetailCode(productBarcodeInfo.getPlanDetailCode());
} else if (barcodeType.equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
} else {
throw new ServiceException("请按成品条码入库");
}
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(mesBaseBarcodeInfo.getBarcodeInfo());
BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量
if (availableAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("没有库存信息");
}
Long materialId = mesBaseBarcodeInfo.getMaterialId();
Long saleOrderId = mesBaseBarcodeInfo.getSaleOrderId();
String saleorderCode = mesBaseBarcodeInfo.getSaleorderCode();
@ -410,7 +434,6 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
//更新出库记录
if (applyQty.compareTo(currentOutstockQty) == 0) {
productOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
@ -425,6 +448,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
productOutstock.setUpdateDate(currentDate);
productOutstock.setUpdateBy(userName);
productOutstock.setProductBatch(materialBarcode);
wmsProductOutstockMapper.updateWmsProductOutstock(productOutstock);
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());

@ -488,6 +488,16 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
String taskCode = Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode);
for (WmsRawReturn rawReturn : wmsRawReturns) {
if (baseWarehouse.getWarehouseFloor().equals(5L)) {
WmsRawReturn queryRawReturn = new WmsRawReturn();
queryRawReturn.setEndStationCode(rawReturn.getEndStationCode());
queryRawReturn.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);
List<WmsRawReturn> wmsRawReturnList = wmsRawReturnMapper.selectWmsRawReturnList(queryRawReturn);
if (wmsRawReturnList != null && !wmsRawReturnList.isEmpty()) {
throw new ServiceException("此工位还有未完成的退库物料");
}
}
BigDecimal planAmount = rawReturn.getPlanAmount();
if (planAmount.compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("数量需大于0");
@ -508,7 +518,6 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
}
// /**
// * 申请退库
// *
@ -656,6 +665,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
/**
* 退
*
*
* @param taskCode 退
* @return 退VO
*/

@ -226,6 +226,12 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("库位不存在");
}
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(oriLocation.getWarehouseId());
if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_SEMI)){
throw new ServiceException("请从半成品库出库");
}
//删除成品库存
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
if (productStock == null) {
@ -307,6 +313,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("库位不存在");
}
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetLocation.getWarehouseId());
if(!baseWarehouse.getWarehouseInstockType().equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT)){
throw new ServiceException("请入成品库");
}
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setLocationCode(targetLocationCode);
List<WmsProductStock> productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);

@ -74,7 +74,7 @@
<if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if>
<if test="stockTypeStr != null and stockTypeStr != ''">and wps.stock_type in ('2','3')</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch like concat('%', #{productBatch}, '%')</if>
<if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
<if test="planCode != null ">and wps.plan_code = #{planCode}</if>

@ -88,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if>
<if test="executeStatusStr != null and executeStatusStr != ''"> and execute_status in (${executeStatusStr})</if>
<if test="endStationCode != null and endStationCode != ''"> and end_station_code = #{endStationCode}</if>
<if test="applyBy != null and applyBy != ''"> and apply_by = #{applyBy}</if>
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
<if test="auditBy != null and auditBy != ''"> and audit_by = #{auditBy}</if>

@ -334,7 +334,8 @@
'%')</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode}, '%')</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch like concat('%', #{instockBatch},
'%')</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wrs.quality_status = #{qualityStatus}</if>

@ -138,3 +138,23 @@ export function getPurchaseOrdersWithBind(query) {
params: query
})
}
// 获取生产bom List
export function getMaterialBoms(query) {
return request({
url: '/mes/purchaseOrder/getMaterialBoms',
method: 'get',
params: query
})
}
// 查询采购订单信息列表
export function getOrderBinds(query) {
return request({
url: '/mes/purchaseOrder/getOrderBinds',
method: 'get',
params: query
})
}

@ -125,7 +125,6 @@
</el-button>
<el-popover
placement="top"
width="260"
@ -225,8 +224,8 @@
<!-- 添加或修改对内生产的原材料条码信息对话框 -->
<el-dialog :title="internalTitle" :visible.sync="internalOpen" width="500px" append-to-body>
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="100px">
<el-form-item label="成品码" prop="productBarcode">
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="120px">
<el-form-item label="成品或配对码" prop="productBarcode">
<el-input type="textarea" v-model="internalForm.productBarcode" placeholder="请输入或扫描成品条码,多个以,隔开"
class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
@ -290,10 +289,13 @@ import {
checkSemiOutstock,
reprintBarcodes
} from "@/api/board/barcode";
import {monitorSerialData} from "@/utils/serial"
import {noticeData} from "@/utils/notice";
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'],
mixins: [monitorSerialData],
data() {
return {
//
@ -535,6 +537,26 @@ export default {
this.queryParams.planDetailCode = this.defineData.planDetailCode;
this.queryParams.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.queryParams.barcodeType = this.BARCODE_TYPE.RAW;
// if (!this.checkSerialConnected()) {
// this.$confirm('', '', {
// confirmButtonText: '',
// showClose: true,
// // beforeClose:async(action,instance,done)=>{
// // if(action==='confirm'){
// // }else{
// // this.connectSerialPort();
// // }
// //
// // },
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.connectSerial(this.setSerialData);
// }).catch(() => {
// });
// }
}
},
@ -917,6 +939,19 @@ export default {
},
setSerialData() {
if (this.internalForm.productBarcode && this.internalForm.productBarcode !== '') {
this.internalForm.productBarcode = "," + this.serialData;
} else {
this.internalForm.productBarcode = this.serialData;
}
// console.log(this.serialData)
},
}
};
</script>

@ -27,9 +27,10 @@
</el-form>
<el-divider content-position="center">物料信息</el-divider>
<el-divider v-if="materialVisible" 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-if="materialVisible"
label-width="130px">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSelectMaterial"></el-button>
</el-form-item>
@ -40,6 +41,7 @@
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%;"
v-if="materialVisible"
>
<el-table-column
label="物料编号"
@ -138,6 +140,7 @@ export default {
multiple: true,
//
showSearch: true,
materialVisible: false,
//
total: 0,
//
@ -221,6 +224,9 @@ export default {
wmsRawReturnList: []
}
if (this.form.warehouseFloor === 5) {
this.materialVisible = false;
}
}
if (this.defineData.maxPlanAmount) {
this.maxPlanAmount = this.defineData.maxPlanAmount
@ -327,6 +333,10 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.warehouseFloor === 5) {
this.form.planAmount = 1;
this.wmsRawReturnList.push(this.form);
} else {
if (this.wmsRawReturnList.length <= 0) {
this.$modal.msgWarning("请选择要退库的物料");
return;
@ -340,6 +350,7 @@ export default {
wmsRawReturn.applyReason = this.form.applyReason;
wmsRawReturn.taskType = this.form.taskType;
}
}
this.submitloading = true;
applyRawReturn(this.wmsRawReturnList).then(e => {
@ -358,7 +369,6 @@ export default {
},
}
};
</script>

@ -41,10 +41,10 @@
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="completeCollectMaterials()">完成领料
</el-button>
<el-button size="mini" type="warning" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleMaterialConfirmForm()">扫描
</el-button>
<!-- <el-button size="mini" type="warning" v-if="(!$route.query || $route.query.id==='2')"-->
<!-- :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"-->
<!-- @click="handleMaterialConfirmForm()">扫描-->
<!-- </el-button>-->
<el-button size="mini" type="danger" @click="handleApplyRawReturn()"
v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">退料
@ -524,6 +524,7 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {monitorSerialData} from "@/utils/serial";
const setState = (e) => {
if (e === '1') {
@ -557,7 +558,7 @@ export default {
closeRawReturnDialog:this.closeRawReturnDialog
}
},
mixins: [noticeData],
mixins: [monitorSerialData, noticeData],
data() {
return {
fileList: [],
@ -736,6 +737,7 @@ export default {
}
},
async mounted() {
this.firstConnectSerial();
// setInterval(() => {
// this.$notify.info({
// title: '',
@ -1562,6 +1564,26 @@ export default {
}
this.rawBackVisible = true;
if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
// beforeClose:async(action,instance,done)=>{
// if(action==='confirm'){
// }else{
// this.connectSerialPort();
// }
//
// },
showCancelButton: true,
type: 'warning'
}).then(() => {
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
},
@ -1800,6 +1822,32 @@ export default {
});
},
firstConnectSerial() {
if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
showCancelButton: true,
type: 'warning'
}).then(() => {
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
},
setSerialData() {
if (this.rawBackVisible) {
this.rawBackForm.materialBarcode = this.serialData;
} else {
this.input1 = this.serialData;
}
// console.log(this.serialData)
},
}
}
</script>

@ -275,9 +275,9 @@
:visible.sync="productInstockVisible"
:title="productInstockTitle"
width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="98px">
<el-form-item label="成品/配对码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" placeholder="请扫描成品码或配对码" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -459,7 +459,7 @@ export default {
},
productInstockRules: {
materialBarcode: [
{required: true, message: "成品码不能为空", trigger: "blur"}
{required: true, message: "成品/配对码不能为空", trigger: "blur"}
],
},
submitLoading:false,

@ -57,7 +57,7 @@
<el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
v-for="dict in dict.type.active_flag"
v-for="dict in dict.type.mes_material_batch_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -168,14 +168,15 @@
<el-table-column label="条码内容" align="center" prop="barcodeInfo" v-if="columns[5].visible" width="100"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[31].visible" width="100"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[8].visible" width="100"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="规格参数" align="center" prop="barcodeSpec" v-if="columns[33].visible" width="150"/>
<el-table-column label="批次标识" align="center" prop="batchFlag" v-if="columns[3].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
<dict-tag :options="dict.type.mes_material_batch_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="供应商ID" align="center" prop="manufacturerId" v-if="columns[9].visible"/>
<el-table-column label="批次数量" align="center" prop="amount" v-if="columns[10].visible"/>
<el-table-column label="批次/柜体数量" align="center" prop="amount" v-if="columns[10].visible"/>
<el-table-column label="打印标识" align="center" prop="printFlag" v-if="columns[12].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_print_flag" :value="scope.row.printFlag"/>
@ -234,6 +235,17 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-info"
@click="handleView(scope.row)"
v-if="scope.row.barcodeType === BARCODE_TYPE.RAW &&
scope.row.purchaseOrderId && scope.row.purchaseOrderId!==null"
v-hasPermi="['mes:barcode:info']"
>查看
</el-button>
<el-button
size="mini"
type="text"
@ -331,7 +343,7 @@
</el-tooltip>
批次数量
</span>
<el-input v-model="form.amount" placeholder="请在物料信息中维护"/>
<el-input v-model="form.amount" placeholder="请在物料信息中维护" :disabled="editFlag!=='1'"/>
</el-form-item>
<el-form-item prop="barcodeAmount" v-if="!form.barcodeId || form.barcodeId===''">
@ -350,6 +362,7 @@
v-model="form.productionDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="editFlag!=='1'"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
@ -366,11 +379,12 @@
v-model="form.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="editFlag!=='1'"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
<el-input v-model="form.remark" type="textarea" :disabled="editFlag!=='1'" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="绑定状态" prop="bindStatus">-->
<!-- <el-radio-group v-model="form.bindStatus">-->
@ -394,7 +408,7 @@
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="submitLoading" @click="submitForm"> </el-button>
<el-button type="primary" :loading="submitLoading" @click="submitForm" v-if="editFlag==='1'"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -483,7 +497,7 @@
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="noPurchaseForm.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
v-for="dict in dict.type.mes_material_batch_flag"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
@ -560,7 +574,8 @@
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="regularForm.materialCode" suffix-icon="el-icon-search" readonly
@click.native="handleSelectMaterial" :disabled="regularForm.purchaseOrderId!==null && regularForm.purchaseOrderId!==''"/>
@click.native="handleSelectMaterial"
:disabled="regularForm.purchaseOrderId!==null && regularForm.purchaseOrderId!==''"/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="regularForm.materialName" readonly/>
@ -614,8 +629,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="采购订单" prop="poNo">
<el-input v-model="materialRelateForm.poNo" placeholder="请点击右侧检索采购订单" readonly>
<el-button slot="append" icon="el-icon-search" @click="handlePurchaseOrderBatchAdd"></el-button>
<el-input v-model="materialRelateForm.poNo" placeholder="请点击右侧检索采购订单" disabled>
<el-button slot="append" icon="el-icon-search" @click="handlePurchaseOrderBatchAdd" v-if="editFlag==='1'"></el-button>
</el-input>
</el-form-item>
</el-col>
@ -643,6 +658,7 @@
size="mini"
type="text"
icon="el-icon-delete"
v-if="editFlag==='1'"
@click="handleDeletePurchaseOrder(scope.row)"
>删除
</el-button>
@ -661,6 +677,7 @@
v-model="materialRelateForm.productionDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="editFlag!=='1'"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
@ -669,27 +686,25 @@
v-model="materialRelateForm.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="editFlag!=='1'"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="materialRelateForm.remark" type="textarea" placeholder="请输入内容"/>
<el-input v-model="materialRelateForm.remark" type="textarea" :disabled="editFlag!=='1'" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="submitLoading" @click="submitRelateForm"> </el-button>
<el-button type="primary" :loading="submitLoading" @click="submitRelateForm" v-if="editFlag==='1'"> </el-button>
<el-button @click="cancelRelate"> </el-button>
</div>
</el-dialog>
<!-- 添加采购订单对话框 -->
<el-dialog title="选择采购订单信息" :visible.sync="onlyPurchaseOrderOpen" append-to-body>
<select-purchaseOrder ref="purchaseOrderRef" v-if="onlyPurchaseOrderOpen" :defineData="barcodeData"></select-purchaseOrder>
<select-purchaseOrder ref="purchaseOrderRef" v-if="onlyPurchaseOrderOpen"
:defineData="barcodeData"></select-purchaseOrder>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitOnlyPurchaseOrderForm"> </el-button>
<el-button @click="onlyPurchaseOrderOpen = false"> </el-button>
@ -915,6 +930,7 @@ export default {
checkedMesBaseMaterialRelate: [],
// ;
editFlag:'1',
barcodeData: {},
materialRelateTitle: '',
@ -1237,7 +1253,16 @@ export default {
this.form.materialSpec = selectedRow.materialSpec;
this.form.projectNo = selectedRow.projectNo;
this.form.purchaseOrderId = selectedRow.purchaseOrderId;
if (selectedRow.specificationParameter && selectedRow.specificationParameter !== null && selectedRow.specificationParameter !== '') {
alert(1)
this.form.barcodeSpec = selectedRow.specificationParameter;
} else {
alert(2)
this.form.barcodeSpec = selectedRow.materialSpec;
}
alert(this.form.barcodeSpec);
//
this.form.availableBindAmount = parseInt(selectedRow.relateSaleOrderAmount);
this.form.orderBindId = selectedRow.orderBindId;
@ -1252,11 +1277,6 @@ export default {
},
handleDeletePurchaseOrder(row) {
const mesSaleOrderRelateList = this.materialRelateForm.mesSaleOrderRelateList;
@ -1284,6 +1304,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.editFlag = "1";
this.open = true;
this.title = "添加原材料条码信息";
},
@ -1351,9 +1372,20 @@ export default {
});
},
handleView(row) {
this.editFlag = "0";
this.handleGetInfo(row,"查看");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.editFlag = "1";
this.handleGetInfo(row,"修改");
},
handleGetInfo(row,tipPrefix){
const barcodeId = row.barcodeId;
if (row.singleFlag === this.SINGLE_FLAG.MERGE) {
this.resetRelate();
@ -1367,7 +1399,7 @@ export default {
this.materialRelateForm.barcodeAmount = 1;
this.materialRelateOpen = true;
this.materialRelateTitle = "修改合并原材料条码信息";
this.materialRelateTitle = tipPrefix+"合并原材料条码信息";
});
} else {
@ -1376,16 +1408,15 @@ export default {
getBarcode(barcodeId).then(response => {
this.form = response.data
this.open = true;
this.title = "修改原材料条码信息";
this.title = tipPrefix+"原材料条码信息";
});
} else {//
}
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
@ -1571,6 +1602,7 @@ export default {
/** 无采购订单新增按钮操作 */
handleNoPurchaseAdd() {
this.editFlag = "1";
this.resetNoPurchase();
this.noPurchaseOpen = true;
this.title = "添加原材料条码信息";
@ -1699,6 +1731,7 @@ export default {
/** 固定条码新增按钮操作 */
handleRegularAdd() {
this.editFlag = "1";
this.resetRegular();
this.regularOpen = true;
this.title = "添加原材料条码信息";
@ -1800,6 +1833,7 @@ export default {
/** 新增按钮操作 */
handleRelateAdd() {
this.editFlag = "1";
this.resetRelate();
this.materialRelateOpen = true;
this.materialRelateTitle = "添加合并原材料条码信息";

@ -30,14 +30,17 @@
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" :data="basePalletInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="托盘ID" align="center" prop="palletInfoId" v-if="columns[0].visible"/>
<el-table-column label="RFID编码" align="center" prop="palletInfoCode" v-if="columns[1].visible"/>
<el-table-column label="托盘RFID编码" align="center" prop="palletInfoCode" v-if="columns[1].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料条码" align="center" prop="materialBarcode"/>
<el-table-column label="绑定时间" align="center" prop="updateTime"/>
</el-table>
<pagination

@ -35,16 +35,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="校验类型" prop="checkType">
<el-select v-model="queryParams.checkType" placeholder="请选择校验类型" clearable>
<el-option
v-for="dict in dict.type.check_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="校验类型" prop="checkType">-->
<!-- <el-select v-model="queryParams.checkType" placeholder="请选择校验类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.check_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="激活标识" prop="activeFlag">-->
<!-- <el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable>-->
@ -103,21 +103,21 @@
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="BOM说明" align="center" prop="materialBomDesc" v-if="columns[15].visible"/>
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
<el-table-column label="安装时长" align="center" prop="assembleTime" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ formatDayHourMinutes(scope.row.assembleTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="安装时长" align="center" prop="assembleTime" v-if="columns[16].visible">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ formatDayHourMinutes(scope.row.assembleTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="顶级标识" align="center" prop="topFlag" v-if="columns[6].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.topFlag"/>
</template>
</el-table-column>
<el-table-column label="校验类型" align="center" prop="checkType" v-if="columns[7].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_type" :value="scope.row.checkType"/>
</template>
</el-table-column>
<!-- <el-table-column label="校验类型" align="center" prop="checkType" v-if="columns[7].visible">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.check_type" :value="scope.row.checkType"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[8].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[9].visible">
<template slot-scope="scope">
@ -132,38 +132,39 @@
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
v-if="scope.row.topFlag===1"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:materialBom:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['mes:materialBom:add']"
>新增子BOM
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:materialBom:remove']"
>删除
</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['mes:materialBom:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-plus"-->
<!-- @click="handleAdd(scope.row)"-->
<!-- v-hasPermi="['mes:materialBom:add']"-->
<!-- >新增子BOM-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['mes:materialBom:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- 添加或修改物料BOM信息对话框 -->
@ -666,9 +667,9 @@ export default {
});
},
//
//
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.activeFlag === "1" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.materialName + '"bom吗').then(function() {
return changeBomStatus(row.materialBomId, row.activeFlag);
}).then(() => {

@ -98,7 +98,7 @@
size="mini"
@click="handleAdd"
v-hasPermi="['mes:productOrder:add']"
>销售订单新增
>销售订单新增
</el-button>
</el-col>
<el-col :span="1.5">
@ -109,7 +109,7 @@
size="mini"
@click="handleNoOrderAdd"
v-hasPermi="['mes:productOrder:add']"
>订单新增
>销售订单新增
</el-button>
</el-col>
<el-col :span="1.5">

@ -436,7 +436,7 @@ export default {
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "BOM导入";
this.upload.title = "提资单导入";
this.upload.open = true;
this.submitLoading = false;
},

@ -110,9 +110,9 @@
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="销售订单" prop="saleOrderCode">
<el-table-column label="销售订单" prop="saleOrderCode" width="230">
<template slot-scope="scope">
<el-input v-model="scope.row.saleOrderCode" placeholder="请点击右侧选择销售订单" readonly>
<el-input v-model="scope.row.saleOrderCode" placeholder="请点击右侧选择销售订单" readonly style="width:200px">
<el-button slot="append" icon="el-icon-search"
v-if="!scope.row.orderBindId && scope.row.safeFlag=== SAFE_FLAG.NO"
@click="handleSaleOrderAdd(scope.row)"></el-button>
@ -143,7 +143,7 @@
<!-- 添加物料信息对话框 -->
<el-dialog title="选择销售订单" :visible.sync="saleOrderOpen" append-to-body>
<select-saleOrder ref="saleOrderRef"></select-saleOrder>
<select-saleOrder ref="saleOrderRef" :defineData="purchaseOrderData"></select-saleOrder>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitSaleOrderForm"> </el-button>
<el-button @click="saleOrderOpen = false"> </el-button>
@ -160,7 +160,7 @@
</template>
<script>
import {getPurchaseOrder, bindOrder, deleteOrderBind} from "@/api/mes/purchaseOrder";
import {getPurchaseOrder, bindOrder, deleteOrderBind,getOrderBinds} from "@/api/mes/purchaseOrder";
import selectSaleOrder from '@//views/mes/purchaseOrder/selectSaleOrder.vue';
import orderBinds from "@/views/mes/saleOrder/orderBinds.vue";
@ -244,6 +244,7 @@ export default {
},
saleOrderOpen: false,
purchaseOrderData: {},
SAFE_FLAG: {
YES: '1',
NO: '0'
@ -265,7 +266,15 @@ export default {
getPurchaseOrder(purchaseOrderId).then(response => {
this.form = response.data;
this.form.materialSpec = materialSpec;
this.mesOrderBindList = response.data.mesOrderBindList;
this.getOrderBinds();
});
},
getOrderBinds(){
getOrderBinds({purchaseOrderId: this.form.purchaseOrderId}).then(response => {
this.mesOrderBindList = response.data;
});
},
@ -380,6 +389,10 @@ export default {
handleSaleOrderAdd(row) {
this.editedRow = row;
this.purchaseOrderData = {
materialId: row.materialId,
}
this.saleOrderOpen = true;
},

@ -95,7 +95,7 @@
>
<el-table-column label="选择" width="50" v-if="isSingleSelect">
<template slot-scope="scope">
<el-radio v-model="selectedRowId" :label="scope.row.orderBindId" @change="handleSelect(scope.row)">
<el-radio v-model="selectedRowId" :label="scope.row.purchaseOrderId+'-'+scope.row.orderBindId" @change="handleSelect(scope.row)">
{{scope.row.i}}
</el-radio>
</template>
@ -333,12 +333,12 @@ export default {
//
handleRowClick(row) {
this.selectedRow = row
this.selectedRowId = row.purchaseOrderId;
this.selectedRowId = row.purchaseOrderId+"-"+row.orderBindId;
//alert(this.selectedRowId);
},
handleSelect(row){
this.selectedRow = row;
this.selectedRowId = row.orderBindId;
this.selectedRowId = row.purchaseOrderId+"-"+row.orderBindId;
//
this.$nextTick(() => {
this.$refs.purchaseOrderRef.setCurrentRow(row);

@ -80,6 +80,12 @@ import {getSaleOrders} from "@/api/mes/purchaseOrder";
export default {
name: "SaleOrder",
props: {
defineData: {
type: Object,
default: {}
}
},
dicts: ['document_status', 'is_release'],
data() {
return {
@ -173,9 +179,16 @@ export default {
};
},
created() {
this.getList();
this.getData();
},
methods: {
getData() {
this.queryParams.materialId = this.defineData.materialId;
this.getList();
},
/** 查询销售订单信息列表 */
getList() {
this.loading = true;

@ -102,6 +102,13 @@
<h4 class="form-header h4">可选采购订单</h4>
<el-form :model="purchaseOrderQueryParams" ref="materialQueryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="bom">
<el-select v-model="purchaseOrderQueryParams.materialBomId" placeholder="请选择bom">
<el-option v-for="item in materialBomList" :key="item.materialBomId" :label="item.materialBomDesc"
:value="item.materialBomId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="订单编号" prop="poNo">
<el-input
v-model="purchaseOrderQueryParams.poNo"
@ -240,7 +247,8 @@ import {
removeSalesBindPurchase,
saleBindPurchaseOrderList,
saveSalesBindPurchase,
unbindPurchaseOrderList
unbindPurchaseOrderList,
getMaterialBoms
} from "@/api/mes/purchaseOrder";
import orderBinds from '@//views/mes/saleOrder/orderBinds.vue';
@ -290,6 +298,7 @@ export default {
allocatePoNos: [],
//
saleOrderForm: {},
materialBomList: [],
allocateBarCodeBtnDisable: true,
//
allocatePurchaseOrderQueryParams: {
@ -318,6 +327,7 @@ export default {
},
created() {
this.getUnbindList();
},
methods: {
getUnbindList() {
@ -332,8 +342,10 @@ export default {
this.saleOrderForm.materialCode = this.$route.query && this.$route.query.materialCode;
this.saleOrderForm.materialName = this.$route.query && this.$route.query.materialName;
this.saleOrderForm.materialModel = this.$route.query && this.$route.query.materialModel;
this.getMaterialBoms();
// this.getAllocatePurchaseOrderList();
this.getUnbindPurchaseOrderList();
},
/** 查询已选采购订单信息列表 */
@ -474,10 +486,6 @@ export default {
},
//
handleOrderBinds() {
this.dialogVisible = true
@ -492,6 +500,24 @@ export default {
this.dialogVisible = false;
},
/** 查询生产bom列表 */
getMaterialBoms() {
if (this.saleOrderForm.materialId && this.saleOrderForm.materialId !== '') {
getMaterialBoms({materialId: this.saleOrderForm.materialId}).then(response => {
this.materialBomList = response.data;
this.purchaseOrderQueryParams.materialBomId = this.materialBomList[0]?.materialBomId;
if (this.purchaseOrderQueryParams.materialBomId && this.purchaseOrderQueryParams.materialBomId !== '') {
this.getUnbindPurchaseOrderList();
}else{
this.selectableLoading = false;
}
});
}else{
this.selectableLoading = false;
}
},
}
};
</script>

@ -99,18 +99,18 @@
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['qms:checkrule:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['qms:checkrule:export']"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" :data="checkruleList" @selection-change="handleSelectionChange">

@ -33,19 +33,21 @@
</el-form>
<el-table v-loading="loading" :data="ualityinstanceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="状态" align="center" prop="wfInstanceStatus" />
<el-table-column label="质检结果ID,关联qms_check_result主键" align="center" prop="checkResultId" />
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="质检描述" align="center" prop="qualityDescription" />
<el-table-column label="处理开始时间" align="center" prop="startTime" width="180">
<el-table-column label="状态" align="center" prop="wfInstanceStatus" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
<dict-tag :options="dict.type.qms_quality_instance_status" :value="scope.row.wfInstanceStatus"/>
</template>
</el-table-column>
<!-- <el-table-column label="质检结果ID,关联qms_check_result主键" align="center" prop="checkResultId" />-->
<el-table-column label="处理开始时间" align="center" prop="startTime" width="180">
</el-table-column>
<el-table-column label="处理结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -149,6 +151,7 @@ import { listWfprocessactivity } from '@/api/system/common/wfprocessactivity'
export default {
name: "Ualityinstance",
dicts: ['qms_quality_instance_status'],
data() {
return {
//

@ -51,7 +51,9 @@
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="状态" prop="checkStatus">
<el-input v-model="form.checkStatus" disabled/>
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_inventory_check_status" :value="form.checkStatus"/>
</template>
</el-form-item>
</el-col>
</el-row>

@ -141,7 +141,7 @@
icon="el-icon-info"
@click="handleDetail(scope.row)"
v-hasPermi="['wms:rawoutstock:edit']"
>查看</el-button>
>详情</el-button>
</template>
</el-table-column>
</el-table>

@ -103,7 +103,7 @@
icon="el-icon-info"
@click="handleDetail(scope.row)"
v-hasPermi="['wms:rawreturn:audit:query']"
>查看
>详情
</el-button>
</template>
</el-table-column>

@ -56,6 +56,15 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input
v-model="queryParams.materialBarcode"
placeholder="请输入物料条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
@ -394,7 +403,8 @@ export default {
occupyAmount: null,
createDate: null,
updateDate: null,
activeFlag: null
activeFlag: null,
materialBarcode:null,
},
queryTwoParams: {
pageNum: 1,
@ -530,6 +540,7 @@ export default {
// }
if (this.type === this.STOCK_TYPE.RAW) {
this.queryTwoParams.instockBatch = this.queryParams.materialBarcode;
listRawstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows;
this.twoPTotal = response.total;
@ -537,6 +548,7 @@ export default {
});
}
if (this.type === this.STOCK_TYPE.PRODUCT) {
this.queryTwoParams.productBatch = this.queryParams.materialBarcode;
listProductstock(this.queryTwoParams).then(response => {
this.rawstockList = response.rows;
this.twoPTotal = response.total;

Loading…
Cancel
Save