Merge remote-tracking branch 'origin/master'

master
夜笙歌 12 months ago
commit 239aa3c1a2

@ -63,7 +63,7 @@ public class MesBaseBarcodeInfo extends BaseEntity
private Long materialId;
/** 物料名称 */
@Excel(name = "物料ID")
@Excel(name = "物料名称")
private String materialName;
/** 供应商ID */

@ -89,4 +89,7 @@ public class MesConstants {
public static final String MES_ASSIGN_TASK_RESULT_KEY = "fifth_floor_assign_task_result";//五楼分配柜体任务到具体工位返库key
/**生产派工开始类型*/
public static final String MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE = "1";//五楼装配工位
}

@ -1,5 +1,6 @@
package com.hw.mes.controller;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo;
@ -142,7 +143,20 @@ public class MesApiController extends BaseController {
@Log(title = "生产计划明细", businessType = BusinessType.START)
@PostMapping(("/startNextProductPlanDetail"))
public AjaxResult startNextProductPlanDetail(@RequestBody MesProductPlanDetail mesProductPlanDetail) {
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail));
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,""));
}
/**
*
* planId
*/
@Log(title = "生产计划明细", businessType = BusinessType.START)
@PostMapping(("/scan2StartNextProductPlanDetail"))
public AjaxResult scan2StartNextProductPlanDetail(@Validated @RequestBody MesMaterialBarcodeScan2StartVo mesMaterialBarcodeScan2StartVo) {
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setPlanId(mesMaterialBarcodeScan2StartVo.getPlanId());
mesProductPlanDetail.setMaterialBarcode(mesMaterialBarcodeScan2StartVo.getMaterialBarcode());
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, MesConstants.MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE));
}
/**
@ -155,7 +169,7 @@ public class MesApiController extends BaseController {
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId());
mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId());
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail));
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,""));
}
/**

@ -0,0 +1,36 @@
package com.hw.mes.controller;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.mes.domain.vo.*;
import com.hw.mes.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* MESController
*
* @author xins
* @date 2024-04-15
*/
@RestController
@RequestMapping("/mobile")
public class MesMobileController extends BaseController {
@Autowired
private IMesBasePalletInfoService mesBasePalletInfoService;
/**
*
*/
@Log(title = "托盘信息", businessType = BusinessType.BIND)
@PostMapping(("/bindPalletInfo"))
public AjaxResult bindPalletInfo(@Validated @RequestBody MesPalletInfoBindVo mesPalletInfoBindVo) {
return success(mesBasePalletInfoService.bindPalletInfo(mesPalletInfoBindVo));
}
}

@ -1,5 +1,6 @@
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;
@ -7,9 +8,9 @@ import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_base_pallet_info
*
*
* @author Yinq
* @date 2024-01-26
* @date 2024-04-15
*/
public class MesBasePalletInfo extends BaseEntity
{
@ -18,39 +19,109 @@ public class MesBasePalletInfo extends BaseEntity
/** 托盘ID */
private Long palletInfoId;
/** RFID编码 */
@Excel(name = "RFID编码")
/** 托盘信息RFID编码,不能修改 */
@Excel(name = "托盘信息RFID编码,不能修改")
private String palletInfoCode;
public void setPalletInfoId(Long palletInfoId)
/** 物料ID关联物料信息主键 */
@Excel(name = "物料ID关联物料信息主键")
private Long materialId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料条码 */
@Excel(name = "物料条码")
private String materialBarcode;
/** 绑定数量 */
@Excel(name = "绑定数量")
private BigDecimal bindAmount;
public void setPalletInfoId(Long palletInfoId)
{
this.palletInfoId = palletInfoId;
}
public Long getPalletInfoId()
public Long getPalletInfoId()
{
return palletInfoId;
}
public void setPalletInfoCode(String palletInfoCode)
public void setPalletInfoCode(String palletInfoCode)
{
this.palletInfoCode = palletInfoCode;
}
public String getPalletInfoCode()
public String getPalletInfoCode()
{
return palletInfoCode;
}
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 setMaterialBarcode(String materialBarcode)
{
this.materialBarcode = materialBarcode;
}
public String getMaterialBarcode()
{
return materialBarcode;
}
public void setBindAmount(BigDecimal bindAmount)
{
this.bindAmount = bindAmount;
}
public BigDecimal getBindAmount()
{
return bindAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("palletInfoId", getPalletInfoId())
.append("palletInfoCode", getPalletInfoCode())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
.append("palletInfoId", getPalletInfoId())
.append("palletInfoCode", getPalletInfoCode())
.append("materialId", getMaterialId())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialBarcode", getMaterialBarcode())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("bindAmount", getBindAmount())
.toString();
}
}

@ -64,6 +64,8 @@ public class MesProductPlanDetail extends BaseEntity
private String attachName;
private String materialBarcode;
public void setPlanDetailId(Long planDetailId)
{
this.planDetailId = planDetailId;
@ -180,6 +182,14 @@ public class MesProductPlanDetail extends BaseEntity
this.attachName = attachName;
}
public String getMaterialBarcode() {
return materialBarcode;
}
public void setMaterialBarcode(String materialBarcode) {
this.materialBarcode = materialBarcode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,26 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
* @ClassName: MesMaterialBarcodeScan2StartVo
* @Author : xins
* @Date :2024-04-15 10:10
* @Version :1.0
*/
@Data
public class MesMaterialBarcodeScan2StartVo {
//生产计划ID
@NotNull(message = "planId必须输入")
private Long planId;
//物料条码
@NotBlank(message = "物料条码必须输入")
private String materialBarcode;
}

@ -0,0 +1,25 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
* @ClassName: MesPalletInfoBindVo
* @Author : xins
* @Date :2024-04-15 13:42
* @Version :1.0
*/
@Data
public class MesPalletInfoBindVo {
//物料条码
@NotBlank(message = "物料条码必须输入")
private String materialBarcode;
//托盘码
@NotBlank(message = "托盘码必须输入")
private String palletInfoCode;
}

@ -5,15 +5,15 @@ import com.hw.mes.domain.MesBasePalletInfo;
/**
* Mapper
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface MesBasePalletInfoMapper
public interface MesBasePalletInfoMapper
{
/**
*
*
*
* @param palletInfoId
* @return
*/
@ -21,7 +21,7 @@ public interface MesBasePalletInfoMapper
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -29,7 +29,7 @@ public interface MesBasePalletInfoMapper
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -37,7 +37,7 @@ public interface MesBasePalletInfoMapper
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -45,7 +45,7 @@ public interface MesBasePalletInfoMapper
/**
*
*
*
* @param palletInfoId
* @return
*/
@ -53,9 +53,19 @@ public interface MesBasePalletInfoMapper
/**
*
*
*
* @param palletInfoIds
* @return
*/
public int deleteMesBasePalletInfoByPalletInfoIds(Long[] palletInfoIds);
/**
*
*
* @param palletInfoCode
* @return
*/
public MesBasePalletInfo selectMesBasePalletInfoByPalletInfoCode(String palletInfoCode);
}

@ -2,18 +2,20 @@ package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesBasePalletInfo;
import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface IMesBasePalletInfoService
public interface IMesBasePalletInfoService
{
/**
*
*
*
* @param palletInfoId
* @return
*/
@ -21,7 +23,7 @@ public interface IMesBasePalletInfoService
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -29,7 +31,7 @@ public interface IMesBasePalletInfoService
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -37,7 +39,7 @@ public interface IMesBasePalletInfoService
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@ -45,7 +47,7 @@ public interface IMesBasePalletInfoService
/**
*
*
*
* @param palletInfoIds
* @return
*/
@ -53,9 +55,17 @@ public interface IMesBasePalletInfoService
/**
*
*
*
* @param palletInfoId
* @return
*/
public int deleteMesBasePalletInfoByPalletInfoId(Long palletInfoId);
/**
*
* @param mesPalletInfoBindVo
* @return
*/
public int bindPalletInfo(MesPalletInfoBindVo mesPalletInfoBindVo);
}

@ -6,6 +6,7 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -108,7 +109,8 @@ public interface IMesProductPlanDetailService {
*
*
* @param mesProductPlanDetail
* @param startType (01:)
* @return MesProductPlanDetail
*/
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail,String startType);
}

@ -1,59 +1,65 @@
package com.hw.mes.service.impl;
import java.util.Date;
import java.util.List;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBasePalletInfoMapper;
import com.hw.mes.domain.MesBasePalletInfo;
import com.hw.mes.service.IMesBasePalletInfoService;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
@Service
public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService
{
public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
@Autowired
private MesBasePalletInfoMapper mesBasePalletInfoMapper;
@Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
/**
*
*
*
* @param palletInfoId
* @return
*/
@Override
public MesBasePalletInfo selectMesBasePalletInfoByPalletInfoId(Long palletInfoId)
{
public MesBasePalletInfo selectMesBasePalletInfoByPalletInfoId(Long palletInfoId) {
return mesBasePalletInfoMapper.selectMesBasePalletInfoByPalletInfoId(palletInfoId);
}
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@Override
public List<MesBasePalletInfo> selectMesBasePalletInfoList(MesBasePalletInfo mesBasePalletInfo)
{
public List<MesBasePalletInfo> selectMesBasePalletInfoList(MesBasePalletInfo mesBasePalletInfo) {
return mesBasePalletInfoMapper.selectMesBasePalletInfoList(mesBasePalletInfo);
}
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@Override
public int insertMesBasePalletInfo(MesBasePalletInfo mesBasePalletInfo)
{
public int insertMesBasePalletInfo(MesBasePalletInfo mesBasePalletInfo) {
mesBasePalletInfo.setCreateTime(DateUtils.getNowDate());
mesBasePalletInfo.setCreateBy(SecurityUtils.getUsername());
return mesBasePalletInfoMapper.insertMesBasePalletInfo(mesBasePalletInfo);
@ -61,13 +67,12 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService
/**
*
*
*
* @param mesBasePalletInfo
* @return
*/
@Override
public int updateMesBasePalletInfo(MesBasePalletInfo mesBasePalletInfo)
{
public int updateMesBasePalletInfo(MesBasePalletInfo mesBasePalletInfo) {
mesBasePalletInfo.setUpdateTime(DateUtils.getNowDate());
mesBasePalletInfo.setUpdateBy(SecurityUtils.getUsername());
return mesBasePalletInfoMapper.updateMesBasePalletInfo(mesBasePalletInfo);
@ -75,25 +80,62 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService
/**
*
*
*
* @param palletInfoIds
* @return
*/
@Override
public int deleteMesBasePalletInfoByPalletInfoIds(Long[] palletInfoIds)
{
public int deleteMesBasePalletInfoByPalletInfoIds(Long[] palletInfoIds) {
return mesBasePalletInfoMapper.deleteMesBasePalletInfoByPalletInfoIds(palletInfoIds);
}
/**
*
*
*
* @param palletInfoId
* @return
*/
@Override
public int deleteMesBasePalletInfoByPalletInfoId(Long palletInfoId)
{
public int deleteMesBasePalletInfoByPalletInfoId(Long palletInfoId) {
return mesBasePalletInfoMapper.deleteMesBasePalletInfoByPalletInfoId(palletInfoId);
}
/**
*
* @param mesPalletInfoBindVo
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int bindPalletInfo(MesPalletInfoBindVo mesPalletInfoBindVo) {
String palletInfoCode = mesPalletInfoBindVo.getPalletInfoCode();
String materialBarcode = mesPalletInfoBindVo.getMaterialBarcode();
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
MesBasePalletInfo mesBasePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByPalletInfoCode(palletInfoCode);
if (mesBasePalletInfo == null) {
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.setMaterialName(mesBaseBarcodeInfo.getMaterialName());
mesBasePalletInfo.setUpdateBy(userName);
mesBasePalletInfo.setUpdateTime(currentDate);
return mesBasePalletInfoMapper.updateMesBasePalletInfo(mesBasePalletInfo);
}
}

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

@ -388,10 +388,10 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
String materialBarcode = mesAssignTaskVo.getMaterialBarcode();
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("成品条码有误");
throw new ServiceException("物料条码有误");
}
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getBindBarcode())) {
throw new ServiceException("此成品条码未绑定柜体,不能下发");
throw new ServiceException("此物料条码未绑定柜体,不能下发");
}
MesMaterialAssignInfo queryMesMaterialAssignInfo = new MesMaterialAssignInfo();

@ -5,18 +5,22 @@
<mapper namespace="com.hw.mes.mapper.MesBasePalletInfoMapper">
<resultMap type="MesBasePalletInfo" id="MesBasePalletInfoResult">
<result property="palletInfoId" column="pallet_info_id"/>
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="palletInfoId" column="pallet_info_id" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="materialId" column="material_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialBarcode" column="material_barcode" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="bindAmount" column="bind_amount" />
</resultMap>
<sql id="selectMesBasePalletInfoVo">
select pallet_info_id, pallet_info_code, remark, create_by, create_time, update_by, update_time
from mes_base_pallet_info
select pallet_info_id, pallet_info_code, material_id, material_code, material_name, material_barcode, remark, create_by, create_time, update_by, update_time, bind_amount from mes_base_pallet_info
</sql>
<select id="selectMesBasePalletInfoList" parameterType="MesBasePalletInfo" resultMap="MesBasePalletInfoResult">
@ -31,24 +35,33 @@
where pallet_info_id = #{palletInfoId}
</select>
<insert id="insertMesBasePalletInfo" parameterType="MesBasePalletInfo" useGeneratedKeys="true"
keyProperty="palletInfoId">
<insert id="insertMesBasePalletInfo" parameterType="MesBasePalletInfo" useGeneratedKeys="true" keyProperty="palletInfoId">
insert into mes_base_pallet_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="palletInfoCode != null and palletInfoCode != ''">pallet_info_code,</if>
<if test="materialId != null">material_id,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialBarcode != null">material_barcode,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="bindAmount != null">bind_amount,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="palletInfoCode != null and palletInfoCode != ''">#{palletInfoCode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialBarcode != null">#{materialBarcode},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="bindAmount != null">#{bindAmount},</if>
</trim>
</insert>
@ -56,11 +69,16 @@
update mes_base_pallet_info
<trim prefix="SET" suffixOverrides=",">
<if test="palletInfoCode != null and palletInfoCode != ''">pallet_info_code = #{palletInfoCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialBarcode != null">material_barcode = #{materialBarcode},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="bindAmount != null">bind_amount = #{bindAmount},</if>
</trim>
where pallet_info_id = #{palletInfoId}
</update>
@ -77,4 +95,13 @@
#{palletInfoId}
</foreach>
</delete>
</mapper>
<select id="selectMesBasePalletInfoByPalletInfoCode" parameterType="String" resultMap="MesBasePalletInfoResult">
<include refid="selectMesBasePalletInfoVo"/>
where pallet_info_code = #{palletInfoCode}
</select>
</mapper>

@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="stationId != null "> and station_id = #{stationId}</if>
</where>
order by material_assign_info_id desc
</select>
<select id="selectMesMaterialAssignInfoByMaterialAssignInfoId" parameterType="Long" resultMap="MesMaterialAssignInfoResult">

@ -130,6 +130,16 @@ export function startNextProductPlanDetail(query) {
})
}
// 开始/继续生产派工计划,适用于五楼装配工位
export function scan2StartNextProductPlanDetail(query) {
return request({
url: '/mes/api/scan2StartNextProductPlanDetail',
method: 'post',
data: query
})
}
/**
* 4楼激光
* */

@ -27,6 +27,10 @@
<div style="text-align: center">
<el-button type="success" v-if="(!$route.query || $route.query.id!=='2')" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('0')">
</el-button>
<el-button type="warning" v-if="(!$route.query || $route.query.id!=='2')" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleMaterialConfirmForm()">
</el-button>
<el-button type="danger" v-if="(!$route.query || $route.query.id!=='2')" :disabled="!form.planDetailCode">退
</el-button>
<el-button type="primary" v-if="($route.query && $route.query.id) === '2'" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('1')">
领柜体
</el-button>
@ -182,14 +186,13 @@
<el-popover
placement="top"
title="标题"
width="400"
ref="popoverRef"
v-if="($route.query && $route.query.id) !== '2'"
trigger="click">
<div>
<div style="margin: 15px 0;">
<el-input placeholder="请输入物料条码" v-model="input1" class="input-with-select">
<el-input placeholder="请扫描或输入物料条码" v-model="input1" class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input>
</div>
@ -370,6 +373,30 @@
</el-dialog>
<el-dialog
:visible.sync="materialConfirmVisible"
title="确认物料使用"
width="40%">
<el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px">
<el-form-item label="计划ID" prop="planId" v-if="false">
<el-input v-model="materialConfirmForm.planId"></el-input>
</el-form-item>
<el-form-item label="明细ID" prop="planDetailId" v-if="false">
<el-input v-model="materialConfirmForm.planDetailId"></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="materialConfirmForm.materialBarcode"></el-input>
</el-form-item>
<el-form-item label="数量" prop="checkAmount">
<el-input v-model="materialConfirmForm.checkAmount"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialConfirm"> </el-button>
<el-button @click="cancelMaterialConfirm"> </el-button>
</div>
</el-dialog>
<!-- <el-dialog :visible.sync="assignModel" title="工位选择" width="80%">-->
<!-- <el-table :data="stationData" highlight-current-row-->
@ -414,12 +441,13 @@ import {
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail,
scan2StartNextProductPlanDetail,
applyRawOutstock,
getStockTotal,
getWarehouses,
bindBarcode,
applyRawBack,
assignTask
assignTask, scanMaterial2Confirm
} from "@/api/board";
const setState = (e) => {
@ -470,6 +498,22 @@ export default {
},
submitAssignLoading: false,
materialConfirmVisible: false,
materialConfirmForm: {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
},
materialConfirmRules: {
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
],
checkAmount: [
{ required: true, message: "数量不能为空", trigger: "blur" }
],
},
tableData: [],
nowStation: null,
stationData: [
@ -728,9 +772,14 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5)
})
},
async startPlan(val) {
async startPlan(val,materialBarcode) {
let data;
if(materialBarcode && materialBarcode!=null && materialBarcode!=undefined && materialBarcode!=''){
data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode})
}else{
data = await startNextProductPlanDetail({planId: val.planId})
}
const data = await startNextProductPlanDetail({planId: val.planId})
if (data.code === 200) {
this.$message({
message: '已开始',
@ -748,8 +797,11 @@ export default {
document.body.click()
},
async startPlan1(val) {
console.log(this.input1)
console.log(val)
if(!this.input1 || this.input1==null || this.input1==undefined || this.input1==''){
this.$modal.msgWarning("请扫描或输入物料条码");
return;
}
this.startPlan(val,this.input1);
document.body.click()
// const data = await startNextProductPlanDetail({planId: val.planId})
@ -773,7 +825,10 @@ export default {
this.form.materialId = val.materialId
this.form.materialCode = val.materialCode
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.planDetailStatus)
if(data){
this.form.planDetailStatus = setState(data.planDetailStatus)
}
this.getInfo(val)
},
stationChange(val) {
@ -1239,7 +1294,7 @@ export default {
if (e.code === 200) {
this.dialogVisible = false
this.$message({
message: '申请领柜体成功',
message: '申请领成功',
type: 'success'
});
}
@ -1331,6 +1386,47 @@ export default {
this.resetRawBack();
},
//
resetMaterialConfirm() {
this.materialConfirmForm = {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
};
this.resetForm("materialConfirmForm");
},
/** 扫描物料确认使用按钮操作 */
handleMaterialConfirmForm() {
this.materialConfirmForm = {
materialBarcode: null,
planId: this.form.planId,
planDetailId:this.form.planDetailId,
checkAmount:null
};
this.materialConfirmVisible = true;
},
submitMaterialConfirm(){
this.$refs["materialConfirmForm"].validate(valid => {
if (valid) {
scanMaterial2Confirm(this.materialConfirmForm).then(response => {
this.$modal.msgSuccess("确认成功");
this.cancelMaterialConfirm();
});
}
});
},
cancelMaterialConfirm(){
this.materialConfirmVisible = false;
this.resetMaterialConfirm();
}
}
}
</script>

@ -399,7 +399,6 @@ export default {
})
},
async startPlan(val) {
alert(JSON.stringify(val))
const data = await startNextProductPlanDetail({planId: val.planId})
if (data.code === 200) {
this.$message({

Loading…
Cancel
Save