定时任务:增加物料库存预警、采购订单交货超时预警、销售订单交货超时预警的定时任务
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);
/**
*
*
* @param source
* @return
*/
@PostMapping("/saleOrder/saleOrderOverTimeAlarm")
public R<?> saleOrderOverTimeAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* ID
*
@ -224,6 +234,14 @@ public interface RemoteMesService {
@GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}")
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")
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());
}
@Override
public R<?> saleOrderOverTimeAlarm(String source) {
return R.fail("销售订单交货超时任务失败:" + throwable.getMessage());
}
@Override
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) {
return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage());
}
@Override
public R<?> purchaseOrderOverTimeAlarm(String source) {
return R.fail("采购订单交货超时任务失败:" + throwable.getMessage());
}
@Override
public R<?> generateProduceStatisticsDetail(String source) {
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_NO = "0";//否

@ -182,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null">unit_id=#{unitId},</if>
<if test="stockUnitId != null">stock_unit_id=#{stockUnitId},</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="specificationParameter != null">specification_parameter=#{specificationParameter},</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 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=",">
(#{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>
</insert>
</mapper>

@ -187,4 +187,26 @@ public class RyTask
public void processActivityEmailNotify(){
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")
// @InnerAuth
public R<?> purchaseOrderOverTimeAlarm() {

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

@ -217,8 +217,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
Long alarmInfoId = mesAlarmInfo.getAlarmInfoId();
List<MesStockAlarmDetail> allStockAlarmDetailList = new ArrayList<>();
stockAlarm(allStockAlarmDetailList, alarmInfoId, 1, nickName, currentDate);
if (allStockAlarmDetailList.size() <= 0) {
throw new ServiceException("无报警信息");
if (allStockAlarmDetailList==null || allStockAlarmDetailList.isEmpty()) {
return 1;
} else {
List<SysPointRouter> sysPointRouterList = new ArrayList<>();
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.setTargetId(firstQualityInstanceActivity.getInstanceActivityId());//第一步工单实例节点ID根据工单实例节点保存图片后续可扩展到每一步可保存图片
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);

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

@ -1,7 +1,9 @@
package com.hw.wms.mapper;
import java.util.List;
import com.hw.wms.domain.WmsBaseLocation;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -9,8 +11,7 @@ import com.hw.wms.domain.WmsBaseLocation;
* @author xs
* @date 2023-12-20
*/
public interface WmsBaseLocationMapper
{
public interface WmsBaseLocationMapper {
/**
*
*
@ -87,6 +88,7 @@ public interface WmsBaseLocationMapper
/**
*
*
* @param wmsBaseLocation
* @return
*/
@ -117,4 +119,14 @@ public interface WmsBaseLocationMapper
Integer selectFourthFustockLocation();
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
*/
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.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsInventoryCheck;
import com.hw.wms.domain.WmsLocationBarcode;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsInventoryCheckMapper;
import com.hw.wms.mapper.WmsLocationBarcodeMapper;
import com.hw.wms.service.IWmsBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,6 +44,9 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
@Autowired
private WmsLocationBarcodeMapper wmsLocationBarcodeMapper;
@Autowired
private WmsInventoryCheckMapper wmsInventoryCheckMapper;
@Autowired
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);
}
public int lockLocation(WmsBaseLocation baseLocation){
public int lockLocation(WmsBaseLocation baseLocation) {
String locationStatus = baseLocation.getLocationStatus();
if (locationStatus.equals(WmsLocationStatus.MANUALLOCK.getCode())) {
return 1;
@ -249,7 +252,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
String hostIp = IpUtils.getIpAddr();
String printKey = "print_" + hostIp;
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());
} catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage());
@ -265,12 +268,12 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
*
*
* @param locationCode
* @param materialIds ID
* @param materialIds ID
* @param barcodeInfos
*/
@Override
public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) {
if (StringUtils.isNotEmpty(barcodeInfos)){
if (StringUtils.isNotEmpty(barcodeInfos)) {
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
List<WmsLocationBarcode> list = new ArrayList<>();
@ -289,6 +292,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
/**
*
*
* @param locationBarcodeIds
* @return
*/
@ -300,15 +304,16 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
/**
* group
*
* @param wmsBaseLocation
* @return
*/
@Override
public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation){
public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation) {
JSONArray locationCodesByWarehouseJsonArr = new JSONArray();
wmsBaseLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MANUAL_LOCK);
List<WmsBaseLocation> wmsBaseLocations = wmsBaseLocationMapper.selectWmsBaseLocationJoinList(wmsBaseLocation);
Map<String,List<String>> locationCodesByWarehouseMap = wmsBaseLocations.stream()
Map<String, List<String>> locationCodesByWarehouseMap = wmsBaseLocations.stream()
.collect(Collectors.groupingBy(
WmsBaseLocation::getWarehouseName,
Collectors.mapping(WmsBaseLocation::getLocationCode, Collectors.toList())
@ -318,11 +323,34 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService {
for (String warehouseName : locationCodesByWarehouseMap.keySet()) {
locationCodesByWarehouseJson = new JSONObject();
List<String> locationCodeStrs = locationCodesByWarehouseMap.get(warehouseName);
locationCodesByWarehouseJson.put("warehouseName",warehouseName);
locationCodesByWarehouseJson.put("locationCodes",locationCodeStrs);
locationCodesByWarehouseJson.put("warehouseName", warehouseName);
locationCodesByWarehouseJson.put("locationCodes", locationCodeStrs);
locationCodesByWarehouseJsonArr.add(locationCodesByWarehouseJson);
}
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();
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();
Date currentDate = new Date();
@ -93,11 +105,11 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
String warehouseInstockType = baseWarehouse.getWarehouseInstockType();
String warehouseType = baseWarehouse.getWarehouseType();
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;
}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;
}else{
} else {
throw new ServiceException("请选择人工仓库或agv仓库盘库");
}
@ -129,7 +141,8 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
toSetInventoryCheckId = wmsInventoryCheck.getInventoryCheckId();
} else {
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.setUpdateBy(userName);
wmsInventoryCheckMapper.updateWmsInventoryCheck(toUpdatedInventoryCheck);
@ -172,6 +185,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
wmsInventoryCheckDetail.setInventoryTime(0L);
wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId());
wmsInventoryCheckDetail.setStockAmount(wmsRawStock.getTotalAmount());
wmsInventoryCheckDetail.setLocationCode(locationCode);
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING);
wmsInventoryCheckDetail.setCreateDate(currentDate);
@ -361,28 +375,34 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
WmsInventoryCheck wmsInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(existedInventoryCheckDetail.getInventoryCheckId());
//根据物料id查询库存数量
if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) {
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);
if (StringUtils.isEmpty(stockType)) {
} else {
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setProductId(existedInventoryCheckDetail.getMaterialId());
queryProductStock.setWarehouseId(wmsInventoryCheck.getWarehouseId());
List<WmsProductStock> wmsProductStockInList = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);
//需要区分批次和非批次所以需要通过totalAmount相加得出此物料库存总数量
BigDecimal stockAmount = wmsProductStockInList == null || wmsProductStockInList.isEmpty() ? BigDecimal.ZERO :
wmsProductStockInList.stream()
.map(WmsProductStock::getTotalAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
existedInventoryCheckDetail.setStockAmount(stockAmount);
if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) {
WmsRawStock queryRawStock = new WmsRawStock();
queryRawStock.setMaterialId(existedInventoryCheckDetail.getMaterialId());
queryRawStock.setLocationCode(existedInventoryCheckDetail.getLocationCode());
queryRawStock.setWarehouseId(wmsInventoryCheck.getWarehouseId());
List<WmsRawStock> wmsRawStockInList = wmsRawStockMapper.selectOnlyWmsRawStockInList(queryRawStock);
//按库位计算库存数量
BigDecimal stockAmount = wmsRawStockInList == null || wmsRawStockInList.isEmpty() ? BigDecimal.ZERO :
wmsRawStockInList.stream()
.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
@Transactional(rollbackFor = Exception.class)
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()
.filter(checkDetail -> checkDetail.getInventoryTime() < 1).collect(Collectors.toList());
if (unconfirmedCheckDetails != null && !unconfirmedCheckDetails.isEmpty()) {
@ -412,11 +436,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
Map<String, List<WmsInventoryCheckDetail>> inventoryCheckDetailMap = wmsInventoryCheckDetailList.stream()
.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());
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
wmsInventoryCheckDetailList.forEach(wmsInventoryCheckDetail -> {
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_FINISH);
wmsInventoryCheckDetail.setUpdateDate(currentDate);
@ -425,10 +450,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
});
WmsInventoryCheck existedInventoryCheck = wmsInventoryCheckMapper.selectOnlyInventoryCheckByInventoryCheckId(wmsInventoryCheck.getInventoryCheckId());
Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount();
Long locationAmount = existedInventoryCheck.getLocationAmount();
Long currentInventoriedAmount = inventoriedAmount + completeLocationAmount;
Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount();//已盘点库位数量
Long inventoryingAmount = existedInventoryCheck.getInventoryingAmount();
Long locationAmount = existedInventoryCheck.getLocationAmount();//库位总数量
Long currentInventoriedAmount = inventoriedAmount + inventoryingAmount;//当前已盘点库位总数量
wmsInventoryCheck.setInventoriedAmount(currentInventoriedAmount);
wmsInventoryCheck.setInventoryingAmount(0L);
wmsInventoryCheck.setUpdateDate(currentDate);
wmsInventoryCheck.setUpdateBy(userName);
if (currentInventoriedAmount >= locationAmount) {

@ -164,14 +164,15 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
wmsStockTotal.setAccessoriesFlag(null);
} else {
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.setAccessoriesFlag(null);
wmsStockTotal.setVirtualFlag("1");
}
}
}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.setAccessoriesFlag(null);
}

@ -356,6 +356,22 @@
</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>

@ -196,7 +196,7 @@
#{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="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
mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%'))</if>
</where>

@ -30,19 +30,20 @@
@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 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 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-form-item>
</el-form>
@ -201,7 +202,7 @@ export default {
deletedFlag: null,
approveDate: null,
erpModifyDate: null,
accessoriesFlag:'0'
accessoriesFlag:'1' //bom
},
//
form: {},
@ -280,7 +281,7 @@ export default {
},
//
searchMaterial() {
searchMaterial(bomFlag) {
this.loading = true;
if (this.form.warehouseId === null || this.form.warehouseId === undefined
|| this.form.warehouseId === "") {
@ -292,6 +293,7 @@ export default {
this.queryParams.planDetailCode = this.form.planDetailCode;
this.queryParams.productId = this.form.productId;
this.queryParams.materialBomId = this.form.materialBomId;
this.queryParams.accessoriesFlag = bomFlag;
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
// e.rows.forEach(ee =>{

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

@ -1046,7 +1046,7 @@ export default {
this.PrintData = val
this.PrintData.barcodeType = '4';//
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.productId = this.finalProductId;
} else {

@ -24,6 +24,14 @@
</el-form-item>
</el-form>
<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"
@click="finish()">完成
</el-button>
@ -189,6 +197,8 @@
type="text">开始
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
@ -335,6 +345,22 @@
<ViewFile :showFileDialog.sync="showFileDialog" :fileListData="fileListData" :thisTitle="thisTitle"></ViewFile>
</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>
</template>
@ -352,6 +378,8 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
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) => {
if (e === '1') {
@ -371,7 +399,14 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) /
export default {
name: 'Board1',
dicts: ['wms_audit_status'],
provide() {
return {
closeDialog: this.closeDialog,
}
},
components: {
PrintPage,
'apply-raw-outstock': applyRawOutstock,
Chart,
WorkshopNotice,
ViewFile
@ -396,7 +431,20 @@ export default {
//
fileListData: [],
rawOutstockData: [],
purchaseOrderData: []
purchaseOrderData: [],
dialogVisible: false,
productPlanData: {},
applyMaterialTitle: '',
PrintData: {},
printModel: false,
SALE_TYPE: {
INTERNAL: '2',//
},
SINGLE_FLAG: {
NOT_SINGLE: "0",//
INTERNAL: '2'//
},
}
},
mounted() {
@ -613,9 +661,11 @@ export default {
});
}
this.form = data.data || {}
this.form.productId = val.productId//5ID
this.form.materialId = val.materialId
this.form.materialCode = val.materialCode
this.form.materialName = val.materialName
this.form.saleType = val.saleType
this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val)
this.selectBindPurchaseOrders();
@ -625,10 +675,12 @@ export default {
if (!val) return
const {data} = await getNewestProductPlanDetail({planId: val.planId})
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.materialName = val.materialName
this.form.saleOrderId = val.saleOrderId
this.form.saleType = val.saleType
this.form.planDetailStatus = setState(data?.planDetailStatus)
this.getInfo(val)
this.selectBindPurchaseOrders();
@ -1060,7 +1112,57 @@ export default {
// 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>
@ -1222,4 +1324,13 @@ export default {
/deep/ .current-row td .cell {
color: #000 !important;
}
/deep/ .dialog .app-container {
background: none !important;
position: static;
}
/deep/ .dialog .el-dialog__body {
padding: 0 !important;
}
</style>

@ -1,6 +1,6 @@
<template>
<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-select v-model="queryParams.materialClassfication" placeholder="请选择类型" clearable>
<el-option
@ -69,8 +69,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="料标识" prop="accessoriesFlag">
<el-select v-model="queryParams.accessoriesFlag" placeholder="请选择料标识" clearable>
<el-form-item label="bom内物料标识" prop="accessoriesFlag">
<el-select v-model="queryParams.accessoriesFlag" placeholder="请选择bom内物料标识" clearable>
<el-option
v-for="dict in dict.type.mes_material_accessories_flag"
:key="dict.value"
@ -201,7 +201,7 @@
<dict-tag :options="dict.type.mes_material_auto_outstock_flag" :value="scope.row.autoOutstockFlag"/>
</template>
</el-table-column>
<el-table-column label="料标识" align="center" prop="accessoriesFlag">
<el-table-column label="bom内物料标识" align="center" prop="accessoriesFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_accessories_flag" :value="scope.row.accessoriesFlag"/>
</template>
@ -328,7 +328,7 @@
<el-row>
<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
v-for="dict in dict.type.mes_material_accessories_flag"

Loading…
Cancel
Save