车间生产:
1楼装配工序,4楼各工序,5楼各工序可暂停和继续
master
xs 3 months ago
parent 21732d35a9
commit 826e4e5cdb

@ -97,8 +97,22 @@ public class MesConstants {
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START = "1";//未开始
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED = "2";//已开始
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH = "3";//已完成
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE = "4";//暂停
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH = "9";// 异常完成(校验物料信息不完整)
public static final Map<String, String> PLAN_DETAIL_STATUS_PROMPT_MAP = new HashMap<>();
static {
PLAN_DETAIL_STATUS_PROMPT_MAP.put(MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START, "未开始");
PLAN_DETAIL_STATUS_PROMPT_MAP.put(MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED, "已开始");
PLAN_DETAIL_STATUS_PROMPT_MAP.put(MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH, "已完成");
PLAN_DETAIL_STATUS_PROMPT_MAP.put(MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE, "已暂停");
PLAN_DETAIL_STATUS_PROMPT_MAP.put(MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH, "异常完成");
// 初始化其他映射...
}
/*生产计划状态*/
public static final String MES_PRODUCT_PLAN_STATUS_TO_DISPATCH = "0";//未派工
public static final String MES_PRODUCT_PLAN_STATUS_DISPATCHED = "1";//已派工

@ -356,4 +356,24 @@ public class MesApiController extends BaseController {
}
/**
*
*/
@Log(title = "生产计划明细", businessType = BusinessType.PAUSE)
@PostMapping(("/productPlanDetailPause"))
public AjaxResult productPlanDetailPause(@Validated @RequestBody MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
return success(productPlanDetailService.productPlanDetailPause(mesProductPlanDetailPauseVo));
}
/**
*
*/
@Log(title = "生产计划明细", businessType = BusinessType.CONTINUE)
@PostMapping(("/productPlanDetailContinue"))
public AjaxResult productPlanDetailContinue(@Validated @RequestBody MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
return success(productPlanDetailService.productPlanDetailContinue(mesProductPlanDetailPauseVo));
}
}

@ -0,0 +1,21 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
* @ClassName: MesProductPlanDetailPauseVo
* @Author : xins
* @Date :2024-10-18 14:43
* @Version :1.0
*/
@Data
public class MesProductPlanDetailPauseVo {
//生产计划明细ID
@NotNull(message = "生产计划明细ID必须输入")
private Long planDetailId;
}

@ -6,6 +6,7 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesProductPlanDetailPauseVo;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import org.springframework.transaction.annotation.Transactional;
@ -116,4 +117,19 @@ public interface IMesProductPlanDetailService {
public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail,String startType);
/**
*
*
* @param mesProductPlanDetailPauseVo VO
* @return
*/
public int productPlanDetailPause(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo);
/**
*
*
* @param mesProductPlanDetailPauseVo VO
* @return
*/
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo);
}

@ -10,6 +10,7 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesProductPlanDetailPauseVo;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.mapper.*;
import com.hw.mes.service.IMesProductPlanDetailService;
@ -753,4 +754,57 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
/**
*
*
* @param mesProductPlanDetailPauseVo VO
* @return
*/
@Override
public int productPlanDetailPause(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
// 明细状态1-未开始2-已开始3-已完成4-暂停9-异常完成(校验物料信息不完整)
//已开始的可以改为暂停
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED)){
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
throw new ServiceException(String.format("此生产计划明细已经%s,不能暂停!", planDetailStatusPrompt));
}
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE);
mesProductPlanDetail.setUpdateTime(new Date());
mesProductPlanDetail.setUpdateBy(SecurityUtils.getUsername());
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
/**
*
*
* @param mesProductPlanDetailPauseVo VO
* @return
*/
@Override
public int productPlanDetailContinue(MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) {
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetailPauseVo.getPlanDetailId()) ;
String planDetailStatus = mesProductPlanDetail.getPlanDetailStatus();
// 明细状态1-未开始2-已开始3-已完成4-暂停9-异常完成(校验物料信息不完整)
//已开始的可以改为暂停
if(!planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_PAUSE)){
String planDetailStatusPrompt = MesConstants.PLAN_DETAIL_STATUS_PROMPT_MAP.get(planDetailStatus);
throw new ServiceException(String.format("此生产计划明细已经%s,不能继续!", planDetailStatusPrompt));
}
mesProductPlanDetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED);
mesProductPlanDetail.setUpdateTime(new Date());
mesProductPlanDetail.setUpdateBy(SecurityUtils.getUsername());
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
}

@ -368,3 +368,20 @@ export function getMaterialInfoList(query) {
})
}
// 暂停生产计划明细
export function productPlanDetailPause(data) {
return request({
url: '/mes/api/productPlanDetailPause',
method: 'post',
data: data
})
}
// 继续生产计划明细
export function productPlanDetailContinue(data) {
return request({
url: '/mes/api/productPlanDetailContinue',
method: 'post',
data: data
})
}

@ -85,10 +85,18 @@
成品条码
</el-button>
<el-button size="mini" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="success"
<el-button size="mini" :disabled="form.planDetailStatus !== '已开始' || !form.planDetailCode" type="success"
@click="finish">完成
</el-button>
<el-button size="mini" v-if="form.planDetailStatus === '' && form.planDetailCode" type="primary"
@click="submitProductPlanDetailPause">暂停
</el-button>
<el-button size="mini" v-if="form.planDetailStatus === '' && form.planDetailCode" type="primary"
@click="submitProductPlanDetailContinue">继续
</el-button>
<el-popover
v-if="($route.query && $route.query.id) === '1'"
v-model="assignModel"
@ -506,7 +514,9 @@ import {
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm,
getNewestOutstockCabinet, updateBarcodePlan, completeCollectMaterials, completeReturnMaterials, continueRawInstock
getNewestOutstockCabinet, updateBarcodePlan, completeCollectMaterials, completeReturnMaterials, continueRawInstock,
productPlanDetailPause,productPlanDetailContinue
} from "@/api/board";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
@ -525,6 +535,9 @@ const setState = (e) => {
if (e === '3' || e === '9') {
return '已完成'
}
if (e === '4') {
return '暂停'
}
}
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -1744,6 +1757,31 @@ export default {
},
/** 提交暂停按钮 */
submitProductPlanDetailPause() {
let pauseForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要暂停么?').then(function () {
return productPlanDetailPause(pauseForm);
}).then(() => {
this.$modal.msgSuccess("暂停成功");
this.form.planDetailStatus = setState("4");
}).catch(() => {
});
},
/** 提交继续按钮 */
submitProductPlanDetailContinue() {
let continueForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要继续么?').then(function () {
return productPlanDetailContinue(continueForm);
}).then(() => {
this.form.planDetailStatus = setState("2");
this.$modal.msgSuccess("继续成功");
}).catch(() => {
});
},
}
}
</script>

@ -218,6 +218,25 @@
>
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
</el-button>
<el-button
size="small"
type="text"
@click="submitProductPlanDetailPause(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
>
暂停
</el-button>
<el-button
size="small"
type="text"
@click="submitProductPlanDetailContinue(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.PAUSE"
>
继续
</el-button>
<el-button
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED" size="small"
type="text"
@ -453,7 +472,8 @@ import {
completeProductPlanDetail,
firstFloorProduceInstock,
scanMaterial2Confirm,
selectMaterialInstallationCircumstance
selectMaterialInstallationCircumstance,
productPlanDetailPause,productPlanDetailContinue
} from '@/api/board'
import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
@ -560,6 +580,7 @@ export default {
TO_START: '1',
STARTED: '2',
FINISHED: '3',
PAUSE:'4',
ABNORMAL_FINISHED: '9'
},
@ -1073,6 +1094,32 @@ export default {
this.applyRawReturnVisible = false;
},
/** 提交暂停按钮 */
submitProductPlanDetailPause(row) {
let pauseForm = {planDetailId:row.planDetailId};
this.$modal.confirm('确认要暂停么?').then(function () {
return productPlanDetailPause(pauseForm);
}).then(() => {
this.$modal.msgSuccess("暂停成功");
row.planDetailStatus = this.PLAN_DETAIL_STATUS.PAUSE;
}).catch(() => {
});
},
/** 提交继续按钮 */
submitProductPlanDetailContinue(row) {
let continueForm = {planDetailId:row.planDetailId};
this.$modal.confirm('确认要继续么?').then(function () {
return productPlanDetailContinue(continueForm);
}).then(() => {
row.planDetailStatus = this.PLAN_DETAIL_STATUS.STARTED;
this.$modal.msgSuccess("继续成功");
}).catch(() => {
});
},
}
}
</script>

@ -166,6 +166,25 @@
>
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
</el-button>
<el-button
size="small"
type="text"
@click="submitProductPlanDetailPause(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
>
暂停
</el-button>
<el-button
size="small"
type="text"
@click="submitProductPlanDetailContinue(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.PAUSE"
>
继续
</el-button>
<el-button
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
size="small"
@ -190,6 +209,8 @@
>
退库
</el-button>
<el-button
size="small"
type="text"
@ -355,13 +376,14 @@ import * as echarts from 'echarts'
import {
completeProductPlanDetail,
getProductPlanDetails,
getProductPlans, getStockTotal,
getProductPlans,
insertProductPlanDetails,
startProductPlanDetail,
fourthFloorProduceInstock,
check4thFloorProduceOutstock,
fourthFloorProduceOutstock,
scanMaterial2Confirm,
productPlanDetailPause,productPlanDetailContinue
} from "@/api/board";
import {monitorSerialData} from "@/utils/serial";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
@ -468,6 +490,7 @@ export default {
TO_START: '1',
STARTED: '2',
FINISHED: '3',
PAUSE:"4",
ABNORMAL_FINISHED: '9'
},
@ -1193,6 +1216,32 @@ export default {
this.applyRawReturnVisible = false;
},
/** 提交暂停按钮 */
submitProductPlanDetailPause(row) {
let pauseForm = {planDetailId:row.planDetailId};
this.$modal.confirm('确认要暂停么?').then(function () {
return productPlanDetailPause(pauseForm);
}).then(() => {
this.$modal.msgSuccess("暂停成功");
row.planDetailStatus = this.PLAN_DETAIL_STATUS.PAUSE;
}).catch(() => {
});
},
/** 提交继续按钮 */
submitProductPlanDetailContinue(row) {
let continueForm = {planDetailId:row.planDetailId};
this.$modal.confirm('确认要继续么?').then(function () {
return productPlanDetailContinue(continueForm);
}).then(() => {
row.planDetailStatus = this.PLAN_DETAIL_STATUS.STARTED;
this.$modal.msgSuccess("继续成功");
}).catch(() => {
});
},
}
}
</script>

@ -42,6 +42,15 @@
<el-button type="primary" @click="accomplishPlan"
v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">完成
</el-button>
<el-button v-if="form.planDetailStatus === '' && form.planDetailCode" type="info"
@click="submitProductPlanDetailPause">暂停
</el-button>
<el-button v-if="form.planDetailStatus === '' && form.planDetailCode" type="info"
@click="submitProductPlanDetailContinue">继续
</el-button>
</div>
</div>
@ -255,10 +264,10 @@ import {
startNextProductPlanDetailAttach,
getPlanDrawings,
addRawInstock,
checkSuitableSaleOrderMaterial,
directRawOutstock,
directRawReturn,
get4thFloorRegularBarcode
get4thFloorRegularBarcode,
productPlanDetailPause,productPlanDetailContinue
} from "@/api/board";
import {monitorSerialData} from "@/utils/serial"
@ -278,6 +287,9 @@ const setState = (e) => {
if (e === '3' || e === '9') {
return '已完成'
}
if (e === '4') {
return '暂停'
}
}
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -331,6 +343,7 @@ export default {
NOT_STARTED: "1",
STARTED: "2",
COMPLETED: "3",
PAUSE: "4",
ABNORMAL_COMPLETED: "9"
},
@ -338,6 +351,7 @@ export default {
"1": "未开始",
"2": "已开始",
"3": "已完成",
"4": "暂停",
"9": "异常完成"
},
@ -1231,7 +1245,35 @@ export default {
this.$modal.msgWarning("此派工派工单号无SOP附件");
}
})
}
},
/** 提交暂停按钮 */
submitProductPlanDetailPause() {
let pauseForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要暂停么?').then(function () {
return productPlanDetailPause(pauseForm);
}).then(() => {
this.$modal.msgSuccess("暂停成功");
this.form.planDetailStatus = setState("4");
}).catch(() => {
});
},
/** 提交继续按钮 */
submitProductPlanDetailContinue() {
let continueForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要继续么?').then(function () {
return productPlanDetailContinue(continueForm);
}).then(() => {
this.form.planDetailStatus = setState("2");
this.$modal.msgSuccess("继续成功");
}).catch(() => {
});
},
},
}

@ -25,6 +25,15 @@
</el-form>
<div style="text-align: center">
<el-button v-if="form.planDetailStatus === '已开始'" type="primary" @click="finish()"></el-button>
<el-button v-if="form.planDetailStatus === '' && form.planDetailCode" type="info"
@click="submitProductPlanDetailPause">暂停
</el-button>
<el-button v-if="form.planDetailStatus === '' && form.planDetailCode" type="info"
@click="submitProductPlanDetailContinue">继续
</el-button>
</div>
</div>
@ -239,11 +248,11 @@ import {
completeProductPlanDetail,
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail
startNextProductPlanDetail,
productPlanDetailPause,productPlanDetailContinue
} from '@/api/board'
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import {monitorSerialData} from "@/utils/serial";
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
@ -257,6 +266,9 @@ const setState = (e) => {
if (e === '3' || e === '9') {
return '已完成'
}
if (e === '4') {
return '暂停'
}
}
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -884,6 +896,32 @@ export default {
}
})
},
/** 提交暂停按钮 */
submitProductPlanDetailPause() {
let pauseForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要暂停么?').then(function () {
return productPlanDetailPause(pauseForm);
}).then(() => {
this.$modal.msgSuccess("暂停成功");
this.form.planDetailStatus = setState("4");
}).catch(() => {
});
},
/** 提交继续按钮 */
submitProductPlanDetailContinue() {
let continueForm = {planDetailId:this.form.planDetailId};
this.$modal.confirm('确认要继续么?').then(function () {
return productPlanDetailContinue(continueForm);
}).then(() => {
this.form.planDetailStatus = setState("2");
this.$modal.msgSuccess("继续成功");
}).catch(() => {
});
},
}
}
</script>

Loading…
Cancel
Save