MES
物料信息bug修复
采购订单绑定销售订单去掉常备物料的校验
master
xs 2 weeks ago
parent b2e791a777
commit 76da01f1ee

@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.mes.domain.MesBaseMaterialType;
import com.hw.mes.service.IMesBaseMaterialTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -37,6 +39,9 @@ public class MesBaseMaterialInfoController extends BaseController
{
@Autowired
private IMesBaseMaterialInfoService mesBaseMaterialInfoService;
@Autowired
private IMesBaseMaterialTypeService mesBaseMaterialTypeService;
/**
*
@ -157,4 +162,15 @@ public class MesBaseMaterialInfoController extends BaseController
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:materialinfo:list")
@GetMapping("/getMaterialTypes")
public AjaxResult getMaterialTypes(MesBaseMaterialType mesBaseMaterialType)
{
List<MesBaseMaterialType> list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType);
return success(list);
}
}

@ -170,10 +170,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (mesBaseMaterialInfo == null) {
throw new ServiceException("物料信息不存在");
}
if (mesBaseMaterialInfo.getAlwaysFlag() == null) {
throw new ServiceException("请先设置此物料信息[物料编码:" + mesBaseBarcodeInfo.getMaterialCode()
+ ",物料名称:" + mesBaseBarcodeInfo.getMaterialName() + "]的常备物料标识");
}
// if (mesBaseMaterialInfo.getAlwaysFlag() == null) {
// throw new ServiceException("请先设置此物料信息[物料编码:" + mesBaseBarcodeInfo.getMaterialCode()
// + ",物料名称:" + mesBaseBarcodeInfo.getMaterialName() + "]的常备物料标识");
// }
//判断选择的采购订单信息,是否已经合并过
MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate();
@ -184,11 +184,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
//如果物料信息为非常备物料,则判断是否有绑定的信息
//不管物料是否常备物料,都判断是否有绑定的信息
BigDecimal barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount();//要生成的条码数量
String poNo = StringUtils.isEmpty(mesBaseBarcodeInfo.getPoNo()) ? "0" : mesBaseBarcodeInfo.getPoNo();
String batchCode = this.getRawBatchCode(poNo);
if (!mesBaseMaterialInfo.getAlwaysFlag().equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) {
// if (!mesBaseMaterialInfo.getAlwaysFlag().equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) {
Long orderBindId = mesBaseBarcodeInfo.getOrderBindId();
if (orderBindId == null) {
throw new ServiceException("请选择绑定销售订单信息的采购订单");
@ -221,16 +221,16 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesOrderBindMapper.updateMesOrderBind(mesOrderBind);
} else {
MesBaseBarcodeInfo toInsertedBarcodeInfo;
for (long i = 0; i < barcodeAmount.intValue(); i++) {
// 生成条码数量的不同条码内容
toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate);
toInsertedBarcodeInfo.setSaleOrderId(0L);
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
}
}
// } else {
// MesBaseBarcodeInfo toInsertedBarcodeInfo;
// for (long i = 0; i < barcodeAmount.intValue(); i++) {
// // 生成条码数量的不同条码内容
// toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate);
// toInsertedBarcodeInfo.setSaleOrderId(0L);
// toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
// mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
// }
// }
}

@ -153,14 +153,14 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
if (mesBaseMaterialInfo == null) {
throw new ServiceException("物料信息不存在");
}
String alwaysFlag = mesBaseMaterialInfo.getAlwaysFlag();
if (alwaysFlag == null) {
throw new ServiceException("请先设置物料信息是否为常备物料");
}
if (alwaysFlag.equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) {
throw new ServiceException("此物料为常备物料,不需要绑定");
}
// String alwaysFlag = mesBaseMaterialInfo.getAlwaysFlag();
// if (alwaysFlag == null) {
// throw new ServiceException("请先设置物料信息是否为常备物料");
// }
//
// if (alwaysFlag.equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) {
// throw new ServiceException("此物料为常备物料,不需要绑定");
// }
Long purchaseOrderId = mesPurchaseOrder.getPurchaseOrderId();

@ -130,6 +130,7 @@
<if test="autoOutstockFlag != null and autoOutstockFlag != ''">and bmi.auto_outstock_flag = #{autoOutstockFlag}</if>
<if test="accessoriesFlag != null and accessoriesFlag != ''">and bmi.accessories_flag = #{accessoriesFlag}</if>
<if test="lowValueConsumableFlag != null and lowValueConsumableFlag != ''">and bmi.low_value_consumable_flag = #{lowValueConsumableFlag}</if>
<if test="alwaysFlag != null and alwaysFlag != ''">and bmi.always_flag = #{alwaysFlag}</if>
<if test="selectType != null and selectType !=''">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if>

@ -42,3 +42,13 @@ export function delMaterialinfo(materialId) {
method: 'delete'
})
}
// 查询物料类型列表
export function getMaterialTypes(query) {
return request({
url: '/mes/materialinfo/getMaterialTypes',
method: 'get',
params: query
})
}

@ -47,14 +47,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="物料类型" prop="materialTypeId">
<el-input
v-model="queryParams.materialTypeId"
placeholder="请输入物料类型"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="常备物料标识" prop="alwaysFlag">
<el-select v-model="queryParams.alwaysFlag" placeholder="请选择常备物料标识" clearable>
<el-option
v-for="dict in dict.type.mes_material_bind_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="自动出库标识" prop="autoOutstockFlag">
<el-select v-model="queryParams.autoOutstockFlag" placeholder="请选择自动出库标识" clearable>
<el-option
@ -218,6 +222,7 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:materialinfo:edit']"
v-if="scope.row.materialClassfication === MATERIAL_CLASSFICATION.ERP"
>修改
</el-button>
<!-- <el-button-->
@ -410,7 +415,8 @@ import {
getMaterialinfo,
delMaterialinfo,
addMaterialinfo,
updateMaterialinfo
updateMaterialinfo,
getMaterialTypes
} from "@/api/mes/materialinfo";
import {listBaseMaterialType} from "@//api/mes/baseMaterialType";
import Treeselect from "@riophae/vue-treeselect";
@ -493,6 +499,10 @@ export default {
// ],
},
currentStatus: '',
MATERIAL_CLASSFICATION:{
ERP:'1',
VIRTUAL:'2'
}
};
},
created() {

@ -134,7 +134,7 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:purchaseOrder:bind']"
v-if="scope.row.alwaysFlag === ALWAYS_FLAG.NO && (scope.row.orderStatus === ORDER_STATUS.TO_PURCHASE || scope.row.orderStatus === ORDER_STATUS.PURCHASEING)"
v-if="scope.row.orderStatus === ORDER_STATUS.TO_PURCHASE || scope.row.orderStatus === ORDER_STATUS.PURCHASEING"
>绑定
</el-button>
</template>

Loading…
Cancel
Save