-车间一楼装配、四楼装配、五楼拆分和五楼装配申请物料逻辑完善:标准物料按照bom申请,辅料可单独申请
-车间增加五楼自检工序
master
xins 4 months ago
parent 9fa5a228f1
commit 851832812b

@ -267,4 +267,11 @@ public class MesConstants {
*/
public static final long MES_MATERIAL_BOM_TOP_FLAG_YES = 1;//是
public static final long MES_MATERIAL_BOM_TOP_FLAG_NO = 0;//否
/**
*
*/
public static final String MES_MATERIAL_ACCESSORIES_FLAG_YES = "1";//是
public static final String MES_MATERIAL_ACCESSORIES_FLAG_NO = "0";//否
}

@ -47,6 +47,9 @@ public class MesApiController extends BaseController {
@Autowired
private IMesBaseBarcodeInfoService mesBaseBarcodeInfoService;
@Autowired
private IMesBaseMaterialInfoService mesBaseMaterialInfoService;
/**
*
@ -321,5 +324,13 @@ public class MesApiController extends BaseController {
return success(mesBaseBarcodeInfoService.check4thFloorProduceOutstock(materialBarcode));
}
/**
* ID
*/
@GetMapping(value = "/getMaterialInfoByMaterialId/{materialId}")
public AjaxResult getMaterialInfoByMaterialId(@PathVariable("materialId") Long materialId) {
return success(mesBaseMaterialInfoService.selectMesBaseMaterialInfoByMaterialId(materialId));
}
}

@ -257,9 +257,17 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("此生产派工已结束");
}
//如果是五楼拆分,校验是否有配对条码
if (StringUtils.isNotEmpty(mesProductPlanDetail.getProcessType())
&& mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) {
//
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setPlanDetailCode(dbProductPlanDetail.getPlanDetailCode());
queryBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW);
@ -268,6 +276,11 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("还未生成原材料条码,不能完成");
}
MesBaseBarcodeInfo mesBaseBarcodeInfo = rawBarcodeInfos.get(0);
String bindBarcode;
@ -285,22 +298,22 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
queryBaseBarcodeInfo.setBindBarcode(bindBarcode);
List<MesBaseBarcodeInfo> bindBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
if (bindBaseBarcodeInfos == null || bindBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("请配对条码执行返库后再完成");
throw new ServiceException("请生成配对条码执行返库后再完成");
}
}
//校验生产计划明细物料使用情况校验信息(如果是多个工序只校验最后一个工序,一楼是一个工序,暂时不校验最后一个工序)
List<MesMaterialCheckResult> checkResults =
mesMaterialCheckResultMapper.selectMesMaterialCheckResult(planId, planDetailId, "0," + dbProductPlan.getMaterialBomId());
List<MesMaterialCheckResult> filterCheckResults = checkResults.stream().filter(
materialCheckResult -> (materialCheckResult.getCheckAmount() == null ||
!materialCheckResult.getCheckAmount().equals(materialCheckResult.getStandardAmount()))
&& materialCheckResult.getCheckType().equals(MesConstants.MES_MATERIAL_BOM_CHECK_TYPE_MANUAL))
.collect(Collectors.toList());
//(取消校验,现场不扫码校验了)校验生产计划明细物料使用情况校验信息(如果是多个工序只校验最后一个工序,一楼是一个工序,暂时不校验最后一个工序)
// List<MesMaterialCheckResult> checkResults =
// mesMaterialCheckResultMapper.selectMesMaterialCheckResult(planId, planDetailId, "0," + dbProductPlan.getMaterialBomId());
// List<MesMaterialCheckResult> filterCheckResults = checkResults.stream().filter(
// materialCheckResult -> (materialCheckResult.getCheckAmount() == null ||
// !materialCheckResult.getCheckAmount().equals(materialCheckResult.getStandardAmount()))
// && materialCheckResult.getCheckType().equals(MesConstants.MES_MATERIAL_BOM_CHECK_TYPE_MANUAL))
// .collect(Collectors.toList());
String updatePlanDetailStatus = MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH;
if (filterCheckResults != null && !filterCheckResults.isEmpty()) {
updatePlanDetailStatus = MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH;
}
// if (filterCheckResults != null && !filterCheckResults.isEmpty()) {
// updatePlanDetailStatus = MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH;
// }
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();

@ -130,6 +130,13 @@ public class WmsStockTotal extends BaseEntity {
private Long productId;
private String materialClassfication;
private String ancestors;//物料bom的祖级列表
private String accessoriesFlag;//辅料标识
private Long materialBomId;
public String getWarehouseName() {
return warehouseName;
@ -348,6 +355,38 @@ public class WmsStockTotal extends BaseEntity {
this.productId = productId;
}
public String getMaterialClassfication() {
return materialClassfication;
}
public void setMaterialClassfication(String materialClassfication) {
this.materialClassfication = materialClassfication;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getAccessoriesFlag() {
return accessoriesFlag;
}
public void setAccessoriesFlag(String accessoriesFlag) {
this.accessoriesFlag = accessoriesFlag;
}
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)

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.domain.R;
@ -13,6 +14,8 @@ import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsProductStock;
@ -144,6 +147,16 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
*/
@Override
public List<WmsStockTotal> selectWmsStockTotalJoinListBySaleOrder(WmsStockTotal wmsStockTotal) {
String materialClassfication = wmsStockTotal.getMaterialClassfication();
if (materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)) {
wmsStockTotal.setMaterialId(wmsStockTotal.getProductId());
wmsStockTotal.setAccessoriesFlag(null);
} else {
if (wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_NO)) {
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
wmsStockTotal.setAccessoriesFlag(null);
}
}
return wmsStockTotalMapper.selectWmsStockTotalJoinListBySaleOrder(wmsStockTotal);
}

@ -170,11 +170,11 @@
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,wst.sale_order_id,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,
(select sum(wro.outstock_amount) from wms_raw_outstock wro where wro.stock_total_id=wst.stock_total_id and
wro.plan_code=#{planCode} and wro.plan_detail_code=#{planDetailCode}) outstock_amount
wro.plan_code=#{planCode} and wro.plan_detail_code=#{planDetailCode} and wro.audit_status!='2') outstock_amount
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
and wst.total_amount>=0
and wst.total_amount>0
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
@ -189,6 +189,9 @@
#{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%')
or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%'))
</if>
<if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='1'</if>
<if test="ancestors != null and ancestors != ''">and exists (select 1 from mes_material_bom mmb where
mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if>
</where>
</select>

@ -348,3 +348,12 @@ export function continueRawInstock(data) {
data: data
})
}
// 获取物料信息
export function getMaterialInfoByMaterialId(materialId) {
return request({
url: '/mes/api/getMaterialInfoByMaterialId/'+materialId,
method: 'get',
})
}

@ -147,6 +147,12 @@
</el-input-number>
</el-form-item>
<el-form-item label="原材料条码" prop="productBarcode">
<el-input v-model="form.productBarcode" placeholder="请扫描或输入原材料条码" suffix-icon="el-icon-full-screen">
</el-input>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker v-model="form.productionDate"
clearable
@ -227,6 +233,7 @@
</el-dialog>
</div>
</template>
@ -435,6 +442,7 @@ export default {
// this.queryParams.bindOrFlag = "1";
}
alert(JSON.stringify(this.queryParams));
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
@ -447,7 +455,7 @@ export default {
amount: 1,
}
} else if (this.defineData.singleFlag && this.defineData.singleFlag === this.SINGLE_FLAG.INTERNAL) {
} else if (this.defineData.singleFlag && this.defineData.singleFlag === this.SINGLE_FLAG.INTERNAL) {//
//45plancodeplandetailcode
this.internalForm = {
planId: this.defineData.planId,

@ -17,6 +17,35 @@
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-divider content-position="center">物料信息</el-divider>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item label="编码、名称或规格" prop="materialCodeNameSpec">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="请输入编码、名称或规格"
clearable
@keyup.enter.native="searchMaterial"/>
</el-form-item>
<el-form-item label="辅料标识" prop="accessoriesFlag">
<el-radio-group v-model="queryParams.accessoriesFlag">
<el-radio
v-for="dict in dict.type.mes_material_accessories_flag"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchMaterial"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="wmsRawOutstockDetailList"
@ -81,14 +110,12 @@
</el-table-column>
<el-table-column
label="操作"
width="160"
width="180"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="编码、名称或规格搜索"
size="mini"
@change="searchMaterial"/>
<br/>
</template>
</el-table-column>
</el-table>
@ -111,7 +138,7 @@
</template>
<script>
import {getWarehouses, getStockTotal, applyRawOutstock} from "@/api/board";
import {getWarehouses, getMaterialInfoByMaterialId,getStockTotal, applyRawOutstock} from "@/api/board";
export default {
name: "Materialinfo",
@ -121,7 +148,7 @@ export default {
default: {}
}
},
dicts: ['mes_safe_flag'],
dicts: ['mes_safe_flag','mes_material_accessories_flag'],
inject: ['closeDialog'],
data() {
return {
@ -173,7 +200,8 @@ export default {
activeFlag: null,
deletedFlag: null,
approveDate: null,
erpModifyDate: null
erpModifyDate: null,
accessoriesFlag:'0'
},
//
form: {},
@ -185,7 +213,7 @@ export default {
},
created() {
this.getData();
this.getWarehouses();
this.getMaterialInfoByMaterialId();
},
methods: {
getData() {
@ -197,6 +225,8 @@ export default {
dispatchCode: this.defineData?.dispatchCode,
planDetailCode: this.defineData?.planDetailCode,
saleOrderId: this.defineData?.saleOrderId,
productId: this.defineData?.productId,
materialBomId: this.defineData?.materialBomId,
applyReason: '',
taskType: this.defineData?.taskType,
stationId: this.defineData?.stationId,
@ -216,6 +246,14 @@ export default {
}
},
getMaterialInfoByMaterialId(){
getMaterialInfoByMaterialId(this.defineData.productId).then(e =>{
this.queryParams.materialClassfication = e.data.materialClassfication;
this.getWarehouses();
});
},
getWarehouses() {
//
getWarehouses({
@ -235,6 +273,11 @@ export default {
this.searchMaterial();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.searchMaterial();
},
//
searchMaterial() {
@ -247,6 +290,8 @@ export default {
this.queryParams.saleOrderId = this.form.saleOrderId;
this.queryParams.planCode = this.form.planCode;
this.queryParams.planDetailCode = this.form.planDetailCode;
this.queryParams.productId = this.form.productId;
this.queryParams.materialBomId = this.form.materialBomId;
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
// e.rows.forEach(ee =>{

@ -51,18 +51,18 @@
<el-button size="mini" type="info" @click="completeReturnMaterials()" v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">完成退料
</el-button>
<el-button size="mini" type="primary" v-if="($route.query && $route.query.id) !== '2'"
<el-button size="mini" type="primary" v-if="($route.query && $route.query.id) === '1'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="getMaterials('1')">
领柜体
</el-button>
<el-button size="mini" type="danger" v-if="($route.query && $route.query.id) !== '2'"
<el-button size="mini" type="danger" v-if="($route.query && $route.query.id) === '1'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="print()">
条码
</el-button>
<el-button size="mini" type="info" v-if="($route.query && $route.query.id) !== '2'"
<el-button size="mini" type="info" v-if="($route.query && $route.query.id) === '1'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="printInternalBarcode()">
对内条码
@ -72,14 +72,24 @@
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleBindBarcode">绑定
</el-button-->
<el-button size="mini" v-if="($route.query && $route.query.id) !== '2'" type="warning"
<el-button size="mini" v-if="($route.query && $route.query.id) === '1'" type="warning"
:disabled="!form.planDetailCode" @click="handleRawBack">返库
</el-button>
<el-button size="mini" type="info" v-if="($route.query && $route.query.id) === '3'"
:disabled=" !form.planDetailCode"
@click="printProductBarcode()">
成品条码
</el-button>
<el-button size="mini" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="success"
@click="finish">完成
</el-button>
<el-popover
v-if="($route.query && $route.query.id) !== '2'"
v-if="($route.query && $route.query.id) === '1'"
v-model="assignModel"
placement="top"
style="margin-left: 10px"
@ -282,8 +292,7 @@
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success" @click="continueRawInstock"></el-button>
<el-button type="success" @click="continueRawInstock" v-if="($route.query && $route.query.id) === '1'"></el-button>
<el-button type="danger" @click="logout">退</el-button>
</el-row>
</div>
@ -579,7 +588,8 @@ export default {
loginStationInfo: {},
PROCESS_TYPE: {
FIFTH_SPLIT: '1',
FIFTH_ASSEMBLE: '2'
FIFTH_ASSEMBLE: '2',
SELF_CHECK:'3',
},
stationData: [
{
@ -668,6 +678,11 @@ export default {
thisTitle: "查看SOP附件",
//
fileListData: [],
BARCODE_TYPE: {
RAW: '1',//
PRODUCT: '3',//
BIND_BARCODE: '4',//
},
}
},
async mounted() {
@ -912,6 +927,7 @@ export default {
}
this.form = data.data || {}
this.form.materialId = val.materialId
this.form.materialBomId = val.materialBomId
this.form.materialCode = val.materialCode
this.form.materialName = val.materialName
this.form.materialSpec = val.materialSpec;
@ -949,6 +965,7 @@ export default {
const {data} = await getNewestProductPlanDetail({planId: val.planId})
this.form = data || {}
this.form.materialId = val.materialId
this.form.materialBomId = val.materialBomId
this.form.materialCode = val.materialCode
this.form.materialName = val.materialName
this.form.materialSpec = val.materialSpec
@ -1316,8 +1333,7 @@ export default {
})
},
async finish() {
let processType = this.$route.query && this.$route.query.id && this.$route.query.id === '2'
? this.PROCESS_TYPE.FIFTH_ASSEMBLE : this.PROCESS_TYPE.FIFTH_SPLIT;
let processType = this.$route.query.id;
this.$confirm('确认明细完成?', '提示', {
confirmButtonText: '确定',
@ -1364,6 +1380,8 @@ export default {
dispatchCode: this.form?.dispatchCode,
planDetailCode: this.form?.planDetailCode,
saleOrderId: this.form?.saleOrderId,
productId: this.form?.materialId,
materialBomId: this.form?.materialBomId,
maxPlanAmount: this.maxPlanAmount,
returnFlag: returnFlag,
applyReason: '',
@ -1407,6 +1425,11 @@ export default {
this.printModel = true
},
printProductBarcode(){
this.PrintData = this.form;
this.PrintData.barcodeType = this.BARCODE_TYPE.PRODUCT
this.printModel = true
},
//
resetBindBarcode() {

@ -491,6 +491,7 @@ export default {
totalNum3: 0,
nowNum4: 1,
totalNum4: 0,
productId:null,
materialBomId: null,
planId: null,
nowMaterial: null,
@ -660,6 +661,7 @@ export default {
this.nowNum4 += 1
selectMaterialInstallationCircumstance({
installType: 2,
productId:this.productId,
materialBomId: this.materialBomId,
planDetailId: this.info.planDetailId,
pageNum: this.nowNum4,
@ -673,6 +675,7 @@ export default {
this.nowNum4 -= 1
selectMaterialInstallationCircumstance({
installType: 2,
productId:this.productId,
materialBomId: this.materialBomId,
planDetailId: this.info.planDetailId,
pageNum: this.nowNum4,
@ -738,6 +741,7 @@ export default {
}
this.reloadFlag = "0";
this.planId = row.planId
this.productId = row.materialId;
this.materialBomId = row.materialBomId
this.nowMaterial = row.materialName
this.saleOrderId = row.saleOrderId
@ -800,6 +804,8 @@ export default {
dispatchCode: val.dispatchCode,
planDetailCode: val.planDetailCode,
saleOrderId: val.saleOrderId,
productId: this.productId,
materialBomId: this.materialBomId,
maxPlanAmount: 100000000,
returnFlag: "0",
applyReason: '',

@ -400,6 +400,7 @@ export default {
totalNum2: 0,
planId: null,
materialBomId: null,
productId:null,
finalProcessFlag: null,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '',
@ -847,6 +848,7 @@ export default {
}
this.reloadFlag = "0";
this.planId = row.planId
this.productId = row.materialId;
this.materialBomId = row.materialBomId
this.nowMaterial = row.materialName
this.saleOrderId = row.saleOrderId
@ -882,6 +884,8 @@ export default {
dispatchCode: val.dispatchCode,
planDetailCode: val.planDetailCode,
saleOrderId: val.saleOrderId,
productId: this.productId,
materialBomId: this.materialBomId,
maxPlanAmount: 100000000,
returnFlag: "0",
applyReason: '',

@ -144,12 +144,17 @@ export default {
{
floor: 5,
processId: 51,
route: '/board/fifthFloor'//
route: '/board/fifthFloor?id=1'//
},
{
floor: 5,
processId: 52,
route: '/board/fifthFloor?id=2'//
},
{
floor: 5,
processId: 54,
route: '/board/fifthFloor?id=3'//
}
]
};

@ -168,7 +168,11 @@
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[11].visible"/>
<el-table-column label="已派工数量" align="center" prop="dispatchAmount" v-if="columns[12].visible" width="100"/>
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/>
<el-table-column label="任务状态" align="center" prop="orderStatus" v-if="columns[19].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.plan_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="前置任务" align="center" prop="preOrderCode"/>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180" v-if="columns[15].visible">
@ -184,11 +188,7 @@
<el-table-column label="任务状态" align="center" prop="orderStatus" v-if="columns[19].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.plan_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="发布时间" align="center" prop="releaseTime" width="180" v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>

Loading…
Cancel
Save