车间生产:五楼装配页面扫码开始生产派工
master
xins 1 year ago
parent 921050e177
commit 0a91a2028e

@ -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_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; 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.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo; import com.hw.common.core.web.page.TableDataInfo;
@ -142,7 +143,20 @@ public class MesApiController extends BaseController {
@Log(title = "生产计划明细", businessType = BusinessType.START) @Log(title = "生产计划明细", businessType = BusinessType.START)
@PostMapping(("/startNextProductPlanDetail")) @PostMapping(("/startNextProductPlanDetail"))
public AjaxResult startNextProductPlanDetail(@RequestBody MesProductPlanDetail mesProductPlanDetail) { 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 mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId()); mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId());
mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId()); mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId());
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail)); return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,""));
} }
/** /**

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

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

@ -6,14 +6,13 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.MesMaterialAssignInfo;
import com.hw.mes.domain.MesMaterialCheckResult; import com.hw.mes.domain.MesMaterialCheckResult;
import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail; import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesProductPlanDetailVo; import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.mapper.MesMaterialBomMapper; import com.hw.mes.mapper.*;
import com.hw.mes.mapper.MesMaterialCheckResultMapper;
import com.hw.mes.mapper.MesProductPlanDetailMapper;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.service.IMesProductPlanDetailService; import com.hw.mes.service.IMesProductPlanDetailService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -42,6 +41,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Autowired @Autowired
private MesMaterialCheckResultMapper mesMaterialCheckResultMapper; private MesMaterialCheckResultMapper mesMaterialCheckResultMapper;
@Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@Autowired
private MesMaterialAssignInfoMapper mesMaterialAssignInfoMapper;
/** /**
* *
* *
@ -61,7 +66,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
*/ */
@Override @Override
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail) { public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail) {
if(mesProductPlanDetail.getPlanId()==null){ if (mesProductPlanDetail.getPlanId() == null) {
return new ArrayList<MesProductPlanDetail>(); return new ArrayList<MesProductPlanDetail>();
} }
return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail); return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail);
@ -304,11 +309,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
* *
* *
* @param mesProductPlanDetail * @param mesProductPlanDetail
* @param startType (01:)
* @return MesProductPlanDetail * @return MesProductPlanDetail
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) { public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) {
//根据planId获取最新一条的生产计划明细 //根据planId获取最新一条的生产计划明细
MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail); MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail);
//todo:在开始生产计划时,更新生产工单状态、开始时间; //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()); MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//判断生产计划的状态 //判断生产计划的状态
String planStatus = mesProductPlan.getPlanStatus(); String planStatus = mesProductPlan.getPlanStatus();

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

@ -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="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="stationId != null "> and station_id = #{stationId}</if> <if test="stationId != null "> and station_id = #{stationId}</if>
</where> </where>
order by material_assign_info_id desc
</select> </select>
<select id="selectMesMaterialAssignInfoByMaterialAssignInfoId" parameterType="Long" resultMap="MesMaterialAssignInfoResult"> <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楼激光 * 4楼激光
* */ * */

@ -182,14 +182,13 @@
<el-popover <el-popover
placement="top" placement="top"
title="标题"
width="400" width="400"
ref="popoverRef" ref="popoverRef"
v-if="($route.query && $route.query.id) !== '2'" v-if="($route.query && $route.query.id) !== '2'"
trigger="click"> trigger="click">
<div> <div>
<div style="margin: 15px 0;"> <div style="margin: 15px 0;">
<el-input placeholder="请输入物料条码" v-model="input1" class="input-with-select"> <el-input placeholder="请扫描或输入物料条码" v-model="input1" class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button> <el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input> </el-input>
</div> </div>
@ -413,6 +412,7 @@ import {
getNewestProductPlanDetail, getNewestProductPlanDetail,
getProductPlans, getProductPlans,
startNextProductPlanDetail, startNextProductPlanDetail,
scan2StartNextProductPlanDetail,
applyRawOutstock, applyRawOutstock,
getStockTotal, getStockTotal,
getWarehouses, getWarehouses,
@ -727,9 +727,14 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5) 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) { if (data.code === 200) {
this.$message({ this.$message({
message: '已开始', message: '已开始',
@ -747,8 +752,11 @@ export default {
document.body.click() document.body.click()
}, },
async startPlan1(val) { async startPlan1(val) {
console.log(this.input1) if(!this.input1 || this.input1==null || this.input1==undefined || this.input1==''){
console.log(val) this.$modal.msgWarning("请扫描或输入物料条码");
return;
}
this.startPlan(val,this.input1);
document.body.click() document.body.click()
this.input1 = null this.input1 = null
@ -773,7 +781,10 @@ export default {
this.form.materialId = val.materialId this.form.materialId = val.materialId
this.form.materialCode = val.materialCode this.form.materialCode = val.materialCode
this.form.materialName = val.materialName this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.planDetailStatus) if(data){
this.form.planDetailStatus = setState(data.planDetailStatus)
}
this.getInfo(val) this.getInfo(val)
}, },
stationChange(val) { stationChange(val) {

Loading…
Cancel
Save