定时任务:增加物料库存预警、采购订单交货超时预警、销售订单交货超时预警的定时任务
1楼产线电气工序也增加条码的生成
4楼折弯和焊接工序增加条码和申请领料的功能
PDA库存盘点接口完善
master
xs 4 months ago
parent 3cadbe66ae
commit 29db8fdfed

@ -214,6 +214,16 @@ public interface RemoteMesService {
public R<List<MesSaleOrderRelate>> getRelateMaterialsBySaleOrderId(@PathVariable("saleOrderId") Long saleOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); public R<List<MesSaleOrderRelate>> getRelateMaterialsBySaleOrderId(@PathVariable("saleOrderId") Long saleOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@PostMapping("/saleOrder/saleOrderOverTimeAlarm")
public R<?> saleOrderOverTimeAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** /**
* ID * ID
* *
@ -224,6 +234,14 @@ public interface RemoteMesService {
@GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}") @GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}")
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@PostMapping("/purchaseOrder/purchaseOrderOverTimeAlarm")
public R<?> purchaseOrderOverTimeAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** /**
* *
@ -234,4 +252,13 @@ public interface RemoteMesService {
@PostMapping("/productplan/generateProduceStatisticsDetail") @PostMapping("/productplan/generateProduceStatisticsDetail")
public R<?> generateProduceStatisticsDetail(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); public R<?> generateProduceStatisticsDetail(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@PostMapping("/materialinfo/stockAlarm")
public R<?> stockAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} }

@ -117,16 +117,31 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
return R.fail("根据销售订单ID获取关联原材料信息失败:" + throwable.getMessage()); return R.fail("根据销售订单ID获取关联原材料信息失败:" + throwable.getMessage());
} }
@Override
public R<?> saleOrderOverTimeAlarm(String source) {
return R.fail("销售订单交货超时任务失败:" + throwable.getMessage());
}
@Override @Override
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) { public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) {
return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage()); return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage());
} }
@Override
public R<?> purchaseOrderOverTimeAlarm(String source) {
return R.fail("采购订单交货超时任务失败:" + throwable.getMessage());
}
@Override @Override
public R<?> generateProduceStatisticsDetail(String source) { public R<?> generateProduceStatisticsDetail(String source) {
return R.fail("定时生成完成的生产明细失败:" + throwable.getMessage()); return R.fail("定时生成完成的生产明细失败:" + throwable.getMessage());
} }
@Override
public R<?> stockAlarm(String source) {
return R.fail("物料库存预警任务失败:" + throwable.getMessage());
}
}; };
} }
} }

@ -295,7 +295,7 @@ public class MesConstants {
/** /**
* * bom
*/ */
public static final String MES_MATERIAL_ACCESSORIES_FLAG_YES = "1";//是 public static final String MES_MATERIAL_ACCESSORIES_FLAG_YES = "1";//是
public static final String MES_MATERIAL_ACCESSORIES_FLAG_NO = "0";//否 public static final String MES_MATERIAL_ACCESSORIES_FLAG_NO = "0";//否

@ -182,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null">unit_id=#{unitId},</if> <if test="unitId != null">unit_id=#{unitId},</if>
<if test="stockUnitId != null">stock_unit_id=#{stockUnitId},</if> <if test="stockUnitId != null">stock_unit_id=#{stockUnitId},</if>
<if test="priceUnitId != null">price_unit_id=#{priceUnitId},</if> <if test="priceUnitId != null">price_unit_id=#{priceUnitId},</if>
<if test="price != null">price=#{price},</if>
<if test="auxPropId != null">aux_prop_id=#{auxPropId},</if> <if test="auxPropId != null">aux_prop_id=#{auxPropId},</if>
<if test="specificationParameter != null">specification_parameter=#{specificationParameter},</if> <if test="specificationParameter != null">specification_parameter=#{specificationParameter},</if>
<if test="srcBillNo != null">src_bill_no=#{srcBillNo},</if> <if test="srcBillNo != null">src_bill_no=#{srcBillNo},</if>
@ -214,9 +215,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchMesBasePurchaseOrder"> <insert id="batchMesBasePurchaseOrder">
INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, price,aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
(#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime}) (#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.price}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

@ -187,4 +187,26 @@ public class RyTask
public void processActivityEmailNotify(){ public void processActivityEmailNotify(){
remoteSysCommonService.processActivityEmailNotify(SecurityConstants.INNER); remoteSysCommonService.processActivityEmailNotify(SecurityConstants.INNER);
} }
/**
*
*/
public void saleOrderOverTimeAlarm(){
remoteMesService.saleOrderOverTimeAlarm(SecurityConstants.INNER);
}
/**
*
*/
public void purchaseOrderOverTimeAlarm(){
remoteMesService.purchaseOrderOverTimeAlarm(SecurityConstants.INNER);
}
/**
*
*/
public void stockAlarm(){
remoteMesService.stockAlarm(SecurityConstants.INNER);
}
} }

@ -293,7 +293,7 @@ public class MesPurchaseOrderController extends BaseController
/** /**
* *
*/ */
@Log(title = "采购订单", businessType = BusinessType.OVERTIME) // @Log(title = "采购订单", businessType = BusinessType.OVERTIME)
@PostMapping("/purchaseOrderOverTimeAlarm") @PostMapping("/purchaseOrderOverTimeAlarm")
// @InnerAuth // @InnerAuth
public R<?> purchaseOrderOverTimeAlarm() { public R<?> purchaseOrderOverTimeAlarm() {

@ -192,7 +192,7 @@ public class MesSaleOrderController extends BaseController {
/** /**
* *
*/ */
@Log(title = "销售订单", businessType = BusinessType.OVERTIME) // @Log(title = "销售订单", businessType = BusinessType.OVERTIME)
@PostMapping("/saleOrderOverTimeAlarm") @PostMapping("/saleOrderOverTimeAlarm")
// @InnerAuth // @InnerAuth
public R<?> saleOrderOverTimeAlarm() { public R<?> saleOrderOverTimeAlarm() {

@ -217,8 +217,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
Long alarmInfoId = mesAlarmInfo.getAlarmInfoId(); Long alarmInfoId = mesAlarmInfo.getAlarmInfoId();
List<MesStockAlarmDetail> allStockAlarmDetailList = new ArrayList<>(); List<MesStockAlarmDetail> allStockAlarmDetailList = new ArrayList<>();
stockAlarm(allStockAlarmDetailList, alarmInfoId, 1, nickName, currentDate); stockAlarm(allStockAlarmDetailList, alarmInfoId, 1, nickName, currentDate);
if (allStockAlarmDetailList.size() <= 0) { if (allStockAlarmDetailList==null || allStockAlarmDetailList.isEmpty()) {
throw new ServiceException("无报警信息"); return 1;
} else { } else {
List<SysPointRouter> sysPointRouterList = new ArrayList<>(); List<SysPointRouter> sysPointRouterList = new ArrayList<>();
SysPointRouter sysPointRouter = getSysPointRouter(alarmInfoId, nickName, currentDate); SysPointRouter sysPointRouter = getSysPointRouter(alarmInfoId, nickName, currentDate);

@ -183,6 +183,21 @@ public class QmsMobileController extends BaseController {
queryCheckInstanceFile.setTargetType(WfConstants.QMS_FILE_TARGET_TYPE_QUALITY_INSTANCE_ACTIVITY); queryCheckInstanceFile.setTargetType(WfConstants.QMS_FILE_TARGET_TYPE_QUALITY_INSTANCE_ACTIVITY);
queryCheckInstanceFile.setTargetId(firstQualityInstanceActivity.getInstanceActivityId());//第一步工单实例节点ID根据工单实例节点保存图片后续可扩展到每一步可保存图片 queryCheckInstanceFile.setTargetId(firstQualityInstanceActivity.getInstanceActivityId());//第一步工单实例节点ID根据工单实例节点保存图片后续可扩展到每一步可保存图片
List<QmsCheckInstanceFile> qmsCheckInstanceFiles = qmsCheckInstanceFileService.selectQmsCheckInstanceFileList(queryCheckInstanceFile); List<QmsCheckInstanceFile> qmsCheckInstanceFiles = qmsCheckInstanceFileService.selectQmsCheckInstanceFileList(queryCheckInstanceFile);
qmsCheckInstanceFiles.forEach(qcif->{
String filePath = qcif.getFaultFile();
if(!filePath.contains("7309")){
if(filePath.contains("https")){
filePath.replaceFirst("https","http");
}
int index= filePath.indexOf("/statics");
filePath = "http://172.16.12.100:7309"+filePath.substring(index);
qcif.setUrl(filePath);
qcif.setFilePath(filePath);
qcif.setFaultFile(filePath);
}else{
}
});
qmsCheckResultDetailVo.setQmsCheckInstanceFiles(qmsCheckInstanceFiles); qmsCheckResultDetailVo.setQmsCheckInstanceFiles(qmsCheckInstanceFiles);

@ -518,8 +518,7 @@ public class WmsMobileController extends BaseController {
@GetMapping(value = "/getLocations") @GetMapping(value = "/getLocations")
public TableDataInfo getLocations(WmsBaseLocation baseLocation) { public TableDataInfo getLocations(WmsBaseLocation baseLocation) {
startPage(); startPage();
//todo 需要根据正在盘点的生成库位的盘点记录明细过滤 List<WmsBaseLocation> baseLocations = wmsBaseLocationService.selectInventoryCheckBaseLocationList(baseLocation);
List<WmsBaseLocation> baseLocations = wmsBaseLocationService.selectWmsBaseLocationList(baseLocation);
return getDataTable(baseLocations); return getDataTable(baseLocations);
} }

@ -1,7 +1,9 @@
package com.hw.wms.mapper; package com.hw.wms.mapper;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsBaseLocation; import com.hw.wms.domain.WmsBaseLocation;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -9,8 +11,7 @@ import com.hw.wms.domain.WmsBaseLocation;
* @author xs * @author xs
* @date 2023-12-20 * @date 2023-12-20
*/ */
public interface WmsBaseLocationMapper public interface WmsBaseLocationMapper {
{
/** /**
* *
* *
@ -87,6 +88,7 @@ public interface WmsBaseLocationMapper
/** /**
* *
*
* @param wmsBaseLocation * @param wmsBaseLocation
* @return * @return
*/ */
@ -117,4 +119,14 @@ public interface WmsBaseLocationMapper
Integer selectFourthFustockLocation(); Integer selectFourthFustockLocation();
Integer selectFourthNoFustockLocation(); Integer selectFourthNoFustockLocation();
/**
*
*
* @param warehouseId
* @param inventoryCheckId
* @return
*/
public List<WmsBaseLocation> selectInventoryCheckBaseLocationList(@Param("warehouseId") Long warehouseId, @Param("inventoryCheckId") Long inventoryCheckId);
} }

@ -135,4 +135,12 @@ public interface IWmsBaseLocationService
* @return * @return
*/ */
public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation); public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation);
/**
*
* @param baseLocation
* @return
*/
public List<WmsBaseLocation> selectInventoryCheckBaseLocationList(WmsBaseLocation baseLocation);
} }

@ -12,9 +12,11 @@ import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.wms.domain.WmsBaseLocation; import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsInventoryCheck;
import com.hw.wms.domain.WmsLocationBarcode; import com.hw.wms.domain.WmsLocationBarcode;
import com.hw.wms.mapper.WmsBaseLocationMapper; import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsInventoryCheckMapper;
import com.hw.wms.mapper.WmsLocationBarcodeMapper; import com.hw.wms.mapper.WmsLocationBarcodeMapper;
import com.hw.wms.service.IWmsBaseLocationService; import com.hw.wms.service.IWmsBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -42,6 +44,9 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
@Autowired @Autowired
private WmsLocationBarcodeMapper wmsLocationBarcodeMapper; private WmsLocationBarcodeMapper wmsLocationBarcodeMapper;
@Autowired
private WmsInventoryCheckMapper wmsInventoryCheckMapper;
@Autowired @Autowired
private StringRedisTemplate redisTemplate; private StringRedisTemplate redisTemplate;
@ -129,8 +134,6 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
} }
/** /**
* *
* *
@ -159,7 +162,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
return this.lockLocation(baseLocation); return this.lockLocation(baseLocation);
} }
public int lockLocation(WmsBaseLocation baseLocation){ public int lockLocation(WmsBaseLocation baseLocation) {
String locationStatus = baseLocation.getLocationStatus(); String locationStatus = baseLocation.getLocationStatus();
if (locationStatus.equals(WmsLocationStatus.MANUALLOCK.getCode())) { if (locationStatus.equals(WmsLocationStatus.MANUALLOCK.getCode())) {
return 1; return 1;
@ -249,7 +252,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
String hostIp = IpUtils.getIpAddr(); String hostIp = IpUtils.getIpAddr();
String printKey = "print_" + hostIp; String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
redisTemplate.expire(printKey,1, TimeUnit.DAYS); redisTemplate.expire(printKey, 1, TimeUnit.DAYS);
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); // redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage()); throw new ServiceException("打印失败:" + e.getMessage());
@ -265,12 +268,12 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
* *
* *
* @param locationCode * @param locationCode
* @param materialIds ID * @param materialIds ID
* @param barcodeInfos * @param barcodeInfos
*/ */
@Override @Override
public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) { public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) {
if (StringUtils.isNotEmpty(barcodeInfos)){ if (StringUtils.isNotEmpty(barcodeInfos)) {
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
Date currentDate = new Date(); Date currentDate = new Date();
List<WmsLocationBarcode> list = new ArrayList<>(); List<WmsLocationBarcode> list = new ArrayList<>();
@ -289,6 +292,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
/** /**
* *
*
* @param locationBarcodeIds * @param locationBarcodeIds
* @return * @return
*/ */
@ -300,15 +304,16 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
/** /**
* group * group
*
* @param wmsBaseLocation * @param wmsBaseLocation
* @return * @return
*/ */
@Override @Override
public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation){ public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation) {
JSONArray locationCodesByWarehouseJsonArr = new JSONArray(); JSONArray locationCodesByWarehouseJsonArr = new JSONArray();
wmsBaseLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MANUAL_LOCK); wmsBaseLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MANUAL_LOCK);
List<WmsBaseLocation> wmsBaseLocations = wmsBaseLocationMapper.selectWmsBaseLocationJoinList(wmsBaseLocation); List<WmsBaseLocation> wmsBaseLocations = wmsBaseLocationMapper.selectWmsBaseLocationJoinList(wmsBaseLocation);
Map<String,List<String>> locationCodesByWarehouseMap = wmsBaseLocations.stream() Map<String, List<String>> locationCodesByWarehouseMap = wmsBaseLocations.stream()
.collect(Collectors.groupingBy( .collect(Collectors.groupingBy(
WmsBaseLocation::getWarehouseName, WmsBaseLocation::getWarehouseName,
Collectors.mapping(WmsBaseLocation::getLocationCode, Collectors.toList()) Collectors.mapping(WmsBaseLocation::getLocationCode, Collectors.toList())
@ -318,11 +323,34 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
for (String warehouseName : locationCodesByWarehouseMap.keySet()) { for (String warehouseName : locationCodesByWarehouseMap.keySet()) {
locationCodesByWarehouseJson = new JSONObject(); locationCodesByWarehouseJson = new JSONObject();
List<String> locationCodeStrs = locationCodesByWarehouseMap.get(warehouseName); List<String> locationCodeStrs = locationCodesByWarehouseMap.get(warehouseName);
locationCodesByWarehouseJson.put("warehouseName",warehouseName); locationCodesByWarehouseJson.put("warehouseName", warehouseName);
locationCodesByWarehouseJson.put("locationCodes",locationCodeStrs); locationCodesByWarehouseJson.put("locationCodes", locationCodeStrs);
locationCodesByWarehouseJsonArr.add(locationCodesByWarehouseJson); locationCodesByWarehouseJsonArr.add(locationCodesByWarehouseJson);
} }
return locationCodesByWarehouseJsonArr; return locationCodesByWarehouseJsonArr;
} }
/**
*
*
* @param baseLocation
* @return
*/
@Override
public List<WmsBaseLocation> selectInventoryCheckBaseLocationList(WmsBaseLocation baseLocation) {
Long warehouseId = baseLocation.getWarehouseId();
WmsInventoryCheck queryInventoryCheck = new WmsInventoryCheck();
queryInventoryCheck.setWarehouseId(warehouseId);
queryInventoryCheck.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_STATUS_INVENTORYING);
List<WmsInventoryCheck> wmsInventoryChecks = wmsInventoryCheckMapper.selectWmsInventoryCheckList(queryInventoryCheck);
Long inventoryCheckId = null;
if (wmsInventoryChecks != null && !wmsInventoryChecks.isEmpty()) {
WmsInventoryCheck wmsInventoryCheck = wmsInventoryChecks.get(0);
inventoryCheckId = wmsInventoryCheck.getInventoryCheckId();
}
return wmsBaseLocationMapper.selectInventoryCheckBaseLocationList(warehouseId, inventoryCheckId);
}
} }

@ -86,6 +86,18 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
Long warehouseId = wmsInventoryCheckVo.getWarehouseId(); Long warehouseId = wmsInventoryCheckVo.getWarehouseId();
List<String> locationCodes = wmsInventoryCheckVo.getLocationCodes(); List<String> locationCodes = wmsInventoryCheckVo.getLocationCodes();
//在选择库位时已经过滤,此处不加此判断了
// for (String locationCode : locationCodes) {
// WmsInventoryCheckDetail queryInventoryCheckDetail = new WmsInventoryCheckDetail();
// queryInventoryCheckDetail.setInventoryCheckId(inventoryCheckId);
// queryInventoryCheckDetail.setLocationCode(locationCode);
//
// List<WmsInventoryCheckDetail> wmsInventoryCheckDetailList = wmsInventoryCheckDetailMapper.selectWmsInventoryCheckDetailList(queryInventoryCheckDetail);
// if (wmsInventoryCheckDetailList != null && !wmsInventoryCheckDetailList.isEmpty()) {
// throw new ServiceException("库位:" + locationCode + ",已经盘点过");
// }
// }
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
Date currentDate = new Date(); Date currentDate = new Date();
@ -93,11 +105,11 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
String warehouseInstockType = baseWarehouse.getWarehouseInstockType(); String warehouseInstockType = baseWarehouse.getWarehouseInstockType();
String warehouseType = baseWarehouse.getWarehouseType(); String warehouseType = baseWarehouse.getWarehouseType();
String inventoryCheckType = ""; String inventoryCheckType = "";
if(warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)){ if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)) {
inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_MANUAL; inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_MANUAL;
}else if(warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_AGV)){ } else if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_AGV)) {
inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_WCS; inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_WCS;
}else{ } else {
throw new ServiceException("请选择人工仓库或agv仓库盘库"); throw new ServiceException("请选择人工仓库或agv仓库盘库");
} }
@ -129,7 +141,8 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
toSetInventoryCheckId = wmsInventoryCheck.getInventoryCheckId(); toSetInventoryCheckId = wmsInventoryCheck.getInventoryCheckId();
} else { } else {
WmsInventoryCheck toUpdatedInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(inventoryCheckId); WmsInventoryCheck toUpdatedInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(inventoryCheckId);
toUpdatedInventoryCheck.setInventoryingAmount(toUpdatedInventoryCheck.getInventoriedAmount() + (long) locationCodes.size()); toUpdatedInventoryCheck.setInventoryingAmount(toUpdatedInventoryCheck.getInventoryingAmount() == null ? 0 : toUpdatedInventoryCheck.getInventoryingAmount()
+ (long) locationCodes.size());
toUpdatedInventoryCheck.setUpdateDate(currentDate); toUpdatedInventoryCheck.setUpdateDate(currentDate);
toUpdatedInventoryCheck.setUpdateBy(userName); toUpdatedInventoryCheck.setUpdateBy(userName);
wmsInventoryCheckMapper.updateWmsInventoryCheck(toUpdatedInventoryCheck); wmsInventoryCheckMapper.updateWmsInventoryCheck(toUpdatedInventoryCheck);
@ -172,6 +185,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
wmsInventoryCheckDetail.setInventoryTime(0L); wmsInventoryCheckDetail.setInventoryTime(0L);
wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW); wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId()); wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId());
wmsInventoryCheckDetail.setStockAmount(wmsRawStock.getTotalAmount());
wmsInventoryCheckDetail.setLocationCode(locationCode); wmsInventoryCheckDetail.setLocationCode(locationCode);
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING); wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING);
wmsInventoryCheckDetail.setCreateDate(currentDate); wmsInventoryCheckDetail.setCreateDate(currentDate);
@ -361,28 +375,34 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
WmsInventoryCheck wmsInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(existedInventoryCheckDetail.getInventoryCheckId()); WmsInventoryCheck wmsInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(existedInventoryCheckDetail.getInventoryCheckId());
//根据物料id查询库存数量 //根据物料id查询库存数量
if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) { if (StringUtils.isEmpty(stockType)) {
WmsRawStock queryRawStock = new WmsRawStock();
queryRawStock.setMaterialId(existedInventoryCheckDetail.getMaterialId());
queryRawStock.setWarehouseId(wmsInventoryCheck.getWarehouseId());
List<WmsRawStock> wmsRawStockInList = wmsRawStockMapper.selectOnlyWmsRawStockInList(queryRawStock);
//需要区分批次和非批次所以需要通过totalAmount相加得出此物料库存总数量
BigDecimal stockAmount = wmsRawStockInList == null || wmsRawStockInList.isEmpty() ? BigDecimal.ZERO :
wmsRawStockInList.stream()
.map(WmsRawStock::getTotalAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
existedInventoryCheckDetail.setStockAmount(stockAmount);
} else { } else {
WmsProductStock queryProductStock = new WmsProductStock(); if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) {
queryProductStock.setProductId(existedInventoryCheckDetail.getMaterialId()); WmsRawStock queryRawStock = new WmsRawStock();
queryProductStock.setWarehouseId(wmsInventoryCheck.getWarehouseId()); queryRawStock.setMaterialId(existedInventoryCheckDetail.getMaterialId());
List<WmsProductStock> wmsProductStockInList = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock); queryRawStock.setLocationCode(existedInventoryCheckDetail.getLocationCode());
//需要区分批次和非批次所以需要通过totalAmount相加得出此物料库存总数量 queryRawStock.setWarehouseId(wmsInventoryCheck.getWarehouseId());
BigDecimal stockAmount = wmsProductStockInList == null || wmsProductStockInList.isEmpty() ? BigDecimal.ZERO : List<WmsRawStock> wmsRawStockInList = wmsRawStockMapper.selectOnlyWmsRawStockInList(queryRawStock);
wmsProductStockInList.stream() //按库位计算库存数量
.map(WmsProductStock::getTotalAmount) BigDecimal stockAmount = wmsRawStockInList == null || wmsRawStockInList.isEmpty() ? BigDecimal.ZERO :
.reduce(BigDecimal.ZERO, BigDecimal::add); wmsRawStockInList.stream()
existedInventoryCheckDetail.setStockAmount(stockAmount); .map(WmsRawStock::getTotalAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
existedInventoryCheckDetail.setStockAmount(stockAmount);
} else {
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setProductId(existedInventoryCheckDetail.getMaterialId());
queryProductStock.setLocationCode(existedInventoryCheckDetail.getLocationCode());
queryProductStock.setWarehouseId(wmsInventoryCheck.getWarehouseId());
List<WmsProductStock> wmsProductStockInList = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);
//按库位计算库存数量
BigDecimal stockAmount = wmsProductStockInList == null || wmsProductStockInList.isEmpty() ? BigDecimal.ZERO :
wmsProductStockInList.stream()
.map(WmsProductStock::getTotalAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
existedInventoryCheckDetail.setStockAmount(stockAmount);
}
} }
@ -403,7 +423,11 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int completeInventoryCheck(WmsInventoryCheck wmsInventoryCheck) { public int completeInventoryCheck(WmsInventoryCheck wmsInventoryCheck) {
List<WmsInventoryCheckDetail> wmsInventoryCheckDetailList = wmsInventoryCheck.getWmsInventoryCheckDetailList(); // List<WmsInventoryCheckDetail> wmsInventoryCheckDetailList = wmsInventoryCheck.getWmsInventoryCheckDetailList();
WmsInventoryCheckDetail queryInventoryCheckDetail = new WmsInventoryCheckDetail();
queryInventoryCheckDetail.setInventoryCheckId(wmsInventoryCheck.getInventoryCheckId());
List<WmsInventoryCheckDetail> wmsInventoryCheckDetailList = wmsInventoryCheckDetailMapper.selectWmsInventoryCheckDetailList(queryInventoryCheckDetail);
List<WmsInventoryCheckDetail> unconfirmedCheckDetails = wmsInventoryCheckDetailList.stream() List<WmsInventoryCheckDetail> unconfirmedCheckDetails = wmsInventoryCheckDetailList.stream()
.filter(checkDetail -> checkDetail.getInventoryTime() < 1).collect(Collectors.toList()); .filter(checkDetail -> checkDetail.getInventoryTime() < 1).collect(Collectors.toList());
if (unconfirmedCheckDetails != null && !unconfirmedCheckDetails.isEmpty()) { if (unconfirmedCheckDetails != null && !unconfirmedCheckDetails.isEmpty()) {
@ -412,11 +436,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
Map<String, List<WmsInventoryCheckDetail>> inventoryCheckDetailMap = wmsInventoryCheckDetailList.stream() Map<String, List<WmsInventoryCheckDetail>> inventoryCheckDetailMap = wmsInventoryCheckDetailList.stream()
.collect(Collectors.groupingBy(WmsInventoryCheckDetail::getLocationCode)); .collect(Collectors.groupingBy(WmsInventoryCheckDetail::getLocationCode));
long completeLocationAmount = inventoryCheckDetailMap.entrySet().size(); // long completeLocationAmount = inventoryCheckDetailMap.entrySet().size();
// List<Long> inventoryCheckDetailIds = wmsInventoryCheckDetailList.stream().map(WmsInventoryCheckDetail::getInventoryCheckDetailId).collect(Collectors.toList()); // List<Long> inventoryCheckDetailIds = wmsInventoryCheckDetailList.stream().map(WmsInventoryCheckDetail::getInventoryCheckDetailId).collect(Collectors.toList());
Date currentDate = new Date(); Date currentDate = new Date();
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
wmsInventoryCheckDetailList.forEach(wmsInventoryCheckDetail -> { wmsInventoryCheckDetailList.forEach(wmsInventoryCheckDetail -> {
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_FINISH); wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_FINISH);
wmsInventoryCheckDetail.setUpdateDate(currentDate); wmsInventoryCheckDetail.setUpdateDate(currentDate);
@ -425,10 +450,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
}); });
WmsInventoryCheck existedInventoryCheck = wmsInventoryCheckMapper.selectOnlyInventoryCheckByInventoryCheckId(wmsInventoryCheck.getInventoryCheckId()); WmsInventoryCheck existedInventoryCheck = wmsInventoryCheckMapper.selectOnlyInventoryCheckByInventoryCheckId(wmsInventoryCheck.getInventoryCheckId());
Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount(); Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount();//已盘点库位数量
Long locationAmount = existedInventoryCheck.getLocationAmount(); Long inventoryingAmount = existedInventoryCheck.getInventoryingAmount();
Long currentInventoriedAmount = inventoriedAmount + completeLocationAmount; Long locationAmount = existedInventoryCheck.getLocationAmount();//库位总数量
Long currentInventoriedAmount = inventoriedAmount + inventoryingAmount;//当前已盘点库位总数量
wmsInventoryCheck.setInventoriedAmount(currentInventoriedAmount); wmsInventoryCheck.setInventoriedAmount(currentInventoriedAmount);
wmsInventoryCheck.setInventoryingAmount(0L);
wmsInventoryCheck.setUpdateDate(currentDate); wmsInventoryCheck.setUpdateDate(currentDate);
wmsInventoryCheck.setUpdateBy(userName); wmsInventoryCheck.setUpdateBy(userName);
if (currentInventoriedAmount >= locationAmount) { if (currentInventoriedAmount >= locationAmount) {

@ -164,14 +164,15 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsStockTotal.setAccessoriesFlag(null); wmsStockTotal.setAccessoriesFlag(null);
} else { } else {
if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag()) if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag())
|| wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_NO)) { || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) {
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId()); wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
wmsStockTotal.setAccessoriesFlag(null); wmsStockTotal.setAccessoriesFlag(null);
wmsStockTotal.setVirtualFlag("1"); wmsStockTotal.setVirtualFlag("1");
} }
} }
}else{ }else{
if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag()) || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_NO)) { if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag())
|| wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) {
wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId()); wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId());
wmsStockTotal.setAccessoriesFlag(null); wmsStockTotal.setAccessoriesFlag(null);
} }

@ -356,6 +356,22 @@
</select> </select>
<select id="selectInventoryCheckBaseLocationList" parameterType="WmsBaseLocation" resultMap="WmsBaseLocationResult">
select location_id, warehouse_id, location_code,container_code from wms_base_location wbl
<where>
<if test="inventoryCheckId != null "> and not exists (select 1 from wms_inventory_check_detail wicd where wbl.location_code=wicd.location_code and wicd.inventory_check_id= #{inventoryCheckId})
</if>
<if test="warehouseId != null "> and wbl.warehouse_id = #{warehouseId}</if>
</where>
</select>
</mapper> </mapper>

@ -196,7 +196,7 @@
#{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%') #{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%')
or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%')) or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%'))
</if> </if>
<if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='1'</if> <if test="accessoriesFlag != null and accessoriesFlag != ''">and mbmi.accessories_flag='0'</if>
<if test="ancestors != null and ancestors != ''">and exists (select 1 from mes_material_bom mmb where <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> mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if>
</where> </where>

@ -30,19 +30,20 @@
@keyup.enter.native="searchMaterial"/> @keyup.enter.native="searchMaterial"/>
</el-form-item> </el-form-item>
<el-form-item label="辅料标识" prop="accessoriesFlag"> <!-- <el-form-item label="辅料标识" prop="accessoriesFlag">-->
<el-radio-group v-model="queryParams.accessoriesFlag"> <!-- <el-radio-group v-model="queryParams.accessoriesFlag">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.mes_material_accessories_flag" <!-- v-for="dict in dict.type.mes_material_accessories_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{ dict.label }} <!-- >{{ dict.label }}-->
</el-radio> <!-- </el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchMaterial"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="searchMaterial('1')">BOM</el-button>
<el-button type="warning" icon="el-icon-search" size="mini" @click="searchMaterial('0')">BOM</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -201,7 +202,7 @@ export default {
deletedFlag: null, deletedFlag: null,
approveDate: null, approveDate: null,
erpModifyDate: null, erpModifyDate: null,
accessoriesFlag:'0' accessoriesFlag:'1' //bom
}, },
// //
form: {}, form: {},
@ -280,7 +281,7 @@ export default {
}, },
// //
searchMaterial() { searchMaterial(bomFlag) {
this.loading = true; this.loading = true;
if (this.form.warehouseId === null || this.form.warehouseId === undefined if (this.form.warehouseId === null || this.form.warehouseId === undefined
|| this.form.warehouseId === "") { || this.form.warehouseId === "") {
@ -292,6 +293,7 @@ export default {
this.queryParams.planDetailCode = this.form.planDetailCode; this.queryParams.planDetailCode = this.form.planDetailCode;
this.queryParams.productId = this.form.productId; this.queryParams.productId = this.form.productId;
this.queryParams.materialBomId = this.form.materialBomId; this.queryParams.materialBomId = this.form.materialBomId;
this.queryParams.accessoriesFlag = bomFlag;
getStockTotal(this.queryParams).then(e => { getStockTotal(this.queryParams).then(e => {
this.total = e.total; this.total = e.total;
// e.rows.forEach(ee =>{ // e.rows.forEach(ee =>{

@ -255,13 +255,13 @@
> >
领料 领料
</el-button> </el-button>
<el-button <!-- <el-button-->
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED" <!-- v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"-->
type="text" <!-- type="text"-->
@click="handleMaterialConfirmForm(scope)" <!-- @click="handleMaterialConfirmForm(scope)"-->
> <!-- >-->
扫描 <!-- 扫描-->
</el-button> <!-- </el-button>-->
<el-button <el-button
type="text" type="text"
@click="handleApplyRawReturn(scope.row)" @click="handleApplyRawReturn(scope.row)"
@ -272,7 +272,6 @@
<el-button <el-button
type="text" type="text"
@click="print(scope.row)" @click="print(scope.row)"
v-if="finalProcessFlag ==='1'"
> >
条码 条码
</el-button> </el-button>
@ -359,8 +358,8 @@
<div class="bottom"> <div class="bottom">
<el-row> <el-row>
<el-button type="success" v-if="finalProcessFlag ==='1'" @click="handleProductInstock"></el-button> <el-button type="success" @click="handleProductInstock"></el-button>
<el-button type="warning" v-if="finalProcessFlag ==='1'" @click="handleProductOutstock"></el-button> <el-button type="warning" @click="handleProductOutstock"></el-button>
<el-button type="danger" @click="logout">退</el-button> <el-button type="danger" @click="logout">退</el-button>
</el-row> </el-row>
</div> </div>

@ -1046,7 +1046,7 @@ export default {
this.PrintData = val this.PrintData = val
this.PrintData.barcodeType = '4';// this.PrintData.barcodeType = '4';//
this.PrintData.productId = val.materialId; this.PrintData.productId = val.materialId;
if (this.saleType === this.SALE_TYPE.INTERNAL) { if (this.saleType === this.SALE_TYPE.INTERNAL) {//
this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL; this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.PrintData.productId = this.finalProductId; this.PrintData.productId = this.finalProductId;
} else { } else {

@ -24,6 +24,14 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: center"> <div style="text-align: center">
<el-button v-if="form.planDetailStatus === ''" type="warning" :loading="submitLoading"
@click="getMaterials()">申请领料
</el-button>
<el-button type="danger" @click="print()">
</el-button>
<el-button v-if="form.planDetailStatus === ''" type="primary" :loading="submitLoading" <el-button v-if="form.planDetailStatus === ''" type="primary" :loading="submitLoading"
@click="finish()">完成 @click="finish()">完成
</el-button> </el-button>
@ -189,6 +197,8 @@
type="text">开始 type="text">开始
</el-button> </el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -335,6 +345,22 @@
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile> <ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</div> </div>
<!-- 申请领料信息对话框 -->
<el-dialog :title="applyMaterialTitle" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData"
v-if="dialogVisible"></apply-raw-outstock>
</el-dialog>
<!-- 条码打印 -->
<el-dialog :visible.sync="printModel" title="条码打印" width="80%" class="dialog">
<div>
<PrintPage :defineData="PrintData" v-if="printModel"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="printModel = false">关闭</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -352,6 +378,8 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice" import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue"; import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan"; import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import PrintPage from "@/views/board/barcode/workshopBarcode.vue";
const setState = (e) => { const setState = (e) => {
if (e === '1') { if (e === '1') {
@ -371,7 +399,14 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) /
export default { export default {
name: 'Board1', name: 'Board1',
dicts: ['wms_audit_status'], dicts: ['wms_audit_status'],
provide() {
return {
closeDialog: this.closeDialog,
}
},
components: { components: {
PrintPage,
'apply-raw-outstock': applyRawOutstock,
Chart, Chart,
WorkshopNotice, WorkshopNotice,
ViewFile ViewFile
@ -396,7 +431,20 @@ export default {
// //
fileListData: [], fileListData: [],
rawOutstockData: [], rawOutstockData: [],
purchaseOrderData: [] purchaseOrderData: [],
dialogVisible: false,
productPlanData: {},
applyMaterialTitle: '',
PrintData: {},
printModel: false,
SALE_TYPE: {
INTERNAL: '2',//
},
SINGLE_FLAG: {
NOT_SINGLE: "0",//
INTERNAL: '2'//
},
} }
}, },
mounted() { mounted() {
@ -613,9 +661,11 @@ export default {
}); });
} }
this.form = data.data || {} this.form = data.data || {}
this.form.productId = val.productId//5ID
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.saleType = val.saleType
this.form.planDetailStatus = setState(data.data.planDetailStatus) this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val) this.getInfo(val)
this.selectBindPurchaseOrders(); this.selectBindPurchaseOrders();
@ -625,10 +675,12 @@ export default {
if (!val) return if (!val) return
const {data} = await getNewestProductPlanDetail({planId: val.planId}) const {data} = await getNewestProductPlanDetail({planId: val.planId})
this.form = data || {} this.form = data || {}
this.form.materialId = val.materialId this.form.productId = val.productId//5ID
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.saleOrderId = val.saleOrderId this.form.saleOrderId = val.saleOrderId
this.form.saleType = val.saleType
this.form.planDetailStatus = setState(data?.planDetailStatus) this.form.planDetailStatus = setState(data?.planDetailStatus)
this.getInfo(val) this.getInfo(val)
this.selectBindPurchaseOrders(); this.selectBindPurchaseOrders();
@ -1060,7 +1112,57 @@ export default {
// this.loading = false; // this.loading = false;
}); });
} }
} },
//
getMaterials() {
this.applyMaterialTitle = "领料";
this.maxPlanAmount = 1000000000;
this.taskType = '1';//
this.dialogVisible = true
this.productPlanData = {
warehouseId: '',
planId: this.form?.planId,
planCode: this.form?.planCode,
dispatchCode: this.form?.dispatchCode,
planDetailCode: this.form?.planDetailCode,
saleOrderId: this.form?.saleOrderId,
productId: this.form?.materialId,
materialBomId: this.form?.materialBomId,
maxPlanAmount: 100000000,
returnFlag: "0",
applyReason: '',
taskType: "1",
warehouseFloor: 4,
mesAreaType: 3,
wmsRawOutstockDetailList: []
}
},
closeDialog() {
this.dialogVisible = false;
},
print() {
this.PrintData = this.form
this.PrintData.barcodeType = '4';//
this.PrintData.productId = this.form.materialId;
if (this.form.saleType === this.SALE_TYPE.INTERNAL) {
this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.PrintData.productId = this.form.productId;
} else {
this.PrintData.singleFlag = this.SINGLE_FLAG.NOT_SINGLE;
}
this.printModel = true
},
} }
} }
</script> </script>
@ -1222,4 +1324,13 @@ export default {
/deep/ .current-row td .cell { /deep/ .current-row td .cell {
color: #000 !important; color: #000 !important;
} }
/deep/ .dialog .app-container {
background: none !important;
position: static;
}
/deep/ .dialog .el-dialog__body {
padding: 0 !important;
}
</style> </style>

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="116px">
<el-form-item label="类型" prop="materialClassfication"> <el-form-item label="类型" prop="materialClassfication">
<el-select v-model="queryParams.materialClassfication" placeholder="请选择类型" clearable> <el-select v-model="queryParams.materialClassfication" placeholder="请选择类型" clearable>
<el-option <el-option
@ -69,8 +69,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="料标识" prop="accessoriesFlag"> <el-form-item label="bom内物料标识" prop="accessoriesFlag">
<el-select v-model="queryParams.accessoriesFlag" placeholder="请选择料标识" clearable> <el-select v-model="queryParams.accessoriesFlag" placeholder="请选择bom内物料标识" clearable>
<el-option <el-option
v-for="dict in dict.type.mes_material_accessories_flag" v-for="dict in dict.type.mes_material_accessories_flag"
:key="dict.value" :key="dict.value"
@ -201,7 +201,7 @@
<dict-tag :options="dict.type.mes_material_auto_outstock_flag" :value="scope.row.autoOutstockFlag"/> <dict-tag :options="dict.type.mes_material_auto_outstock_flag" :value="scope.row.autoOutstockFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="料标识" align="center" prop="accessoriesFlag"> <el-table-column label="bom内物料标识" align="center" prop="accessoriesFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_accessories_flag" :value="scope.row.accessoriesFlag"/> <dict-tag :options="dict.type.mes_material_accessories_flag" :value="scope.row.accessoriesFlag"/>
</template> </template>
@ -328,7 +328,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item placeholder="请选择辅料标识" label="辅料标识" prop="accessoriesFlag"> <el-form-item placeholder="请选择bom内物料标识" label="bom内物料标识" prop="accessoriesFlag">
<el-radio-group v-model="form.accessoriesFlag"> <el-radio-group v-model="form.accessoriesFlag">
<el-radio <el-radio
v-for="dict in dict.type.mes_material_accessories_flag" v-for="dict in dict.type.mes_material_accessories_flag"

Loading…
Cancel
Save