现场运行调整
This commit is contained in:
@@ -153,6 +153,7 @@ public class ApiErpService implements IApiErpService {
|
||||
.build()
|
||||
);
|
||||
|
||||
log.info("【ERP入库单明细】{}", JSONUtil.toJsonStr(detail));
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功,下发erp入库单据号:" + docNo);
|
||||
@@ -243,6 +244,7 @@ public class ApiErpService implements IApiErpService {
|
||||
.build()
|
||||
);
|
||||
|
||||
log.info("【ERP出库单明细】{}", JSONUtil.toJsonStr(detail));
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功,下发erp出库单据号:" + docNo);
|
||||
|
||||
@@ -481,27 +481,27 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
|
||||
//--------------------处理库存信息--------------------
|
||||
//移除指定辊号的库存信息
|
||||
for (MydoJobDetail detail : details){
|
||||
|
||||
//移除指定辊号的库存明细
|
||||
basStockService.deleteBasStockByRollerNumber(detail.getRollerNumber());
|
||||
//如果条码没有库存明细,则移除主表信息
|
||||
if (basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode()).size() == 0){
|
||||
basStockInfoService.deleteBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
}
|
||||
|
||||
//更新出库子单物料实际出库数量
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByRollerNumber(detail.getRollerNumber());
|
||||
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
outStockoutDetail.setAssignNum(detail.getOutQuantity());
|
||||
outStockoutDetail.setStatus(1);
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
|
||||
log.info("【账务处理】移除库存信息,更新单据出库分配数量,作业号:{},库存编号:{},辊号:{}", jobId, detail.getStockinDetailId(), detail.getRollerNumber());
|
||||
}
|
||||
|
||||
}
|
||||
// for (MydoJobDetail detail : details){
|
||||
//
|
||||
// //移除指定辊号的库存明细
|
||||
// basStockService.deleteBasStockByRollerNumber(detail.getRollerNumber());
|
||||
// //如果条码没有库存明细,则移除主表信息
|
||||
// if (basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode()).size() == 0){
|
||||
// basStockInfoService.deleteBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
// }
|
||||
//
|
||||
// //更新出库子单物料实际出库数量
|
||||
// OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByRollerNumber(detail.getRollerNumber());
|
||||
//
|
||||
// if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
// outStockoutDetail.setAssignNum(detail.getOutQuantity());
|
||||
// outStockoutDetail.setStatus(1);
|
||||
// outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
//
|
||||
// log.info("【账务处理】移除库存信息,更新单据出库分配数量,作业号:{},库存编号:{},辊号:{}", jobId, detail.getStockinDetailId(), detail.getRollerNumber());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
//--------------------更新货位状态--------------------
|
||||
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
@@ -704,7 +704,7 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
|
||||
//3.移除当前托盘的绑定信息
|
||||
inTrayMsgService.deleteInTrayMsgByTrayCode(mydoJob.getTrayCode());
|
||||
log.info("【账务处理-载货容器出库】移除任务数据,生成历史记录,作业号:{},托盘号:{}", jobId, mydoJob.getTrayCode());
|
||||
log.info("【账务处理-空托盘出库】移除任务数据,生成历史记录,作业号:{},托盘号:{}", jobId, mydoJob.getTrayCode());
|
||||
|
||||
return AjaxResult.success();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
* @return 入库单据主信息
|
||||
*/
|
||||
@Override
|
||||
@WarehouseScope
|
||||
// @WarehouseScope
|
||||
public List<InStockin> selectInStockinList(InStockin inStockin)
|
||||
{
|
||||
return inStockinMapper.selectInStockinList(inStockin);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class InStockinDetail extends BaseEntity
|
||||
private BigDecimal assignNum;
|
||||
|
||||
/** 分配状态 0-未完成 1-入库完成等待回传 2-回传成功 */
|
||||
private int status;
|
||||
private Integer status;
|
||||
|
||||
// /** 键槽规格 */
|
||||
// String keyGrooveSpec;
|
||||
|
||||
@@ -221,9 +221,9 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
List<OutStockoutDetail> details = outStockoutDetailService.selectOutStockoutDetailList(
|
||||
new OutStockoutDetail().builder().stockoutId(stockoutId).allotNum(BigDecimal.valueOf(0)).build()
|
||||
);
|
||||
if (details.size() == 0){
|
||||
log.warn("【出库单据分配】操作已中止,未找到该单据号的子单明细或者没有可分配的物料,单据号:{}", stockoutId);
|
||||
return AjaxResult.error("操作异常,未找到该单据号的子单明细或者没有可分配的物料");
|
||||
if (details.isEmpty()){
|
||||
log.warn("【出库单据分配】分配失败,该单据号的子单明细没有可分配的物料,请检查单据状态,单据号:{}", stockoutId);
|
||||
return AjaxResult.error("操作异常,该单据号的子单明细没有可分配的物料,请检查单据状态");
|
||||
}
|
||||
|
||||
int num = 1;
|
||||
@@ -350,7 +350,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
|
||||
//生成托盘主作业
|
||||
mydoJobService.insertMydoJob(mydoJob);
|
||||
|
||||
num = 1;
|
||||
log.info("【出库分配】生成出库作业,作业号:{},托盘号:{}", mydoJob.getJobId(), stock.getTrayCode());
|
||||
//
|
||||
// //>>>>>>>>>>>>>>>>>>>>>> 推送出库 <<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
@@ -71,7 +71,7 @@ public class OutStockoutDetail extends BaseEntity
|
||||
String color;
|
||||
|
||||
/** 状态 0-未完成分配 1-出库完成等待回传 2-回传成功 */
|
||||
private int status;
|
||||
private Integer status;
|
||||
|
||||
/** 版长 */
|
||||
@Excel(name = "版长")
|
||||
|
||||
@@ -14,6 +14,14 @@ public interface IOutStockoutDetailService
|
||||
/**
|
||||
* 查询出库单据子信息
|
||||
*
|
||||
* @param stockoutId 出库单据主键
|
||||
* @return 出库单据子信息
|
||||
*/
|
||||
public List<OutStockoutDetail> selectOutStockoutDetailByStockoutId(String stockoutId);
|
||||
|
||||
/**
|
||||
* 查询出库单据子信息
|
||||
*
|
||||
* @param stockoutDetailId 出库单据子信息主键
|
||||
* @return 出库单据子信息
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,20 @@ public class OutStockoutDetailServiceImpl implements IOutStockoutDetailService
|
||||
@Autowired
|
||||
private OutStockoutDetailMapper outStockoutDetailMapper;
|
||||
|
||||
/**
|
||||
* 根据出库单据id查询出库单据子信息列表
|
||||
* @param stockoutId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OutStockoutDetail> selectOutStockoutDetailByStockoutId(String stockoutId)
|
||||
{
|
||||
return outStockoutDetailMapper.selectOutStockoutDetailListByStockoutId(stockoutId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单据子信息
|
||||
*
|
||||
*
|
||||
* @param stockoutDetailId 出库单据子信息主键
|
||||
* @return 出库单据子信息
|
||||
*/
|
||||
|
||||
@@ -624,6 +624,11 @@ public class PdaServiceImpl implements IPdaService {
|
||||
String rollerNumber = (String) params.get("barcode");
|
||||
BigDecimal quantity = Convert.toBigDecimal(params.get("outQuantity"));
|
||||
|
||||
if (DecimalUtil.eq(quantity, BigDecimal.ZERO)){
|
||||
log.warn("【操作失败】未选择出库数量,无法执行出库确认操作,辊号:{}", rollerNumber);
|
||||
return AjaxResult.error("未选择出库数量,无法执行出库确认操作");
|
||||
}
|
||||
|
||||
MydoJobDetail detail = mydoJobDetailService.selectMydoJobDetailByRollerNumber(rollerNumber);
|
||||
if (ObjUtil.isNull(detail)){
|
||||
log.warn("【操作失败】找不到当前版辊的出库明细,无法执行出库确认操作,请检查任务明细状态,辊号:{}", rollerNumber);
|
||||
@@ -690,6 +695,10 @@ public class PdaServiceImpl implements IPdaService {
|
||||
|
||||
//移除库存信息
|
||||
basStockService.deleteBasStockByRollerNumber(rollerNumber);
|
||||
//如果条码没有库存明细,则移除主表信息
|
||||
if (basStockService.selectBasStockListByTrayCode(job.getTrayCode()).isEmpty()){
|
||||
basStockInfoService.deleteBasStockInfoByTrayCode(job.getTrayCode());
|
||||
}
|
||||
log.info("【出库确认】移除版辊库存信息,辊号:{}", rollerNumber);
|
||||
|
||||
//更新分配数量、实际数量、明细状态
|
||||
@@ -938,6 +947,9 @@ public class PdaServiceImpl implements IPdaService {
|
||||
|
||||
//移除库存信息
|
||||
basStockService.deleteBasStockByRollerNumber(rollerNumber);
|
||||
if (basStockService.selectBasStockListByTrayCode(job.getTrayCode()).isEmpty()){
|
||||
basStockInfoService.deleteBasStockInfoByTrayCode(job.getTrayCode());
|
||||
}
|
||||
log.info("【出库确认】移除版辊库存信息,辊号:{}", rollerNumber);
|
||||
|
||||
//更新分配数量、实际数量、明细状态
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.scheduleTask;
|
||||
|
||||
import com.ruoyi.common.StockStatusEnum;
|
||||
import com.ruoyi.common.Utils.DecimalUtil;
|
||||
import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
@@ -9,12 +10,15 @@ import com.ruoyi.out.stockout.domain.OutStockout;
|
||||
import com.ruoyi.out.stockout.service.IOutStockoutService;
|
||||
import com.ruoyi.out.stockoutdetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.out.stockoutdetail.service.IOutStockoutDetailService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StockHandler {
|
||||
|
||||
@@ -53,6 +57,33 @@ public class StockHandler {
|
||||
}
|
||||
|
||||
|
||||
/** 自动结束已完成入库单 */
|
||||
@Scheduled(fixedDelay = 300000)
|
||||
public void inStockinAutoComplete(){
|
||||
List<InStockin> stockinList = inStockinService.selectInStockinList(
|
||||
new InStockin().builder().status(StockStatusEnum.RUNNING.getCode()).build()
|
||||
);
|
||||
|
||||
if(stockinList.isEmpty()) return;
|
||||
|
||||
for(InStockin stockin : stockinList){
|
||||
|
||||
List<InStockinDetail> details = inStockinDetailService.selectInStockinDetailByStockinId(stockin.getStockinId());
|
||||
|
||||
if(details.isEmpty()) continue;
|
||||
|
||||
//所有明细全部执行完成 - 自动完成单据
|
||||
if (!details.stream().anyMatch(s -> s.getStatus() == 0)){
|
||||
//自动完成单据
|
||||
inStockinService.finishStockin(stockin.getStockinId());
|
||||
log.info("【完成单据】入库单据已经自动完成,单据号:{}", stockin.getStockinId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 出库单据版辊信息上报 */
|
||||
// @Scheduled(fixedDelay = 3000)
|
||||
public void outStockoutCallBack(){
|
||||
@@ -81,4 +112,30 @@ public class StockHandler {
|
||||
}
|
||||
|
||||
|
||||
/** 自动结束已完成出库单 */
|
||||
@Scheduled(fixedDelay = 300000)
|
||||
public void outStockoutAutoComplete(){
|
||||
List<OutStockout> stockoutList = outStockoutService.selectOutStockoutList(
|
||||
new OutStockout().builder().status(StockStatusEnum.RUNNING.getCode()).build()
|
||||
);
|
||||
|
||||
if(stockoutList.isEmpty()) return;
|
||||
|
||||
for(OutStockout stockout : stockoutList){
|
||||
|
||||
List<OutStockoutDetail> details = outStockoutDetailService.selectOutStockoutDetailByStockoutId(stockout.getStockoutId());
|
||||
|
||||
if(details.isEmpty()) continue;
|
||||
|
||||
//所有明细全部执行完成 - 自动完成单据
|
||||
if (!details.stream().anyMatch(s -> s.getStatus() == 0)){
|
||||
//自动完成单据
|
||||
outStockoutService.finishOutStockout(stockout.getStockoutId());
|
||||
log.info("【完成单据】出库单据已经自动完成,单据号:{}", stockout.getStockoutId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectOutStockoutDetailVo"/>
|
||||
<where>
|
||||
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
|
||||
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id = #{stockoutDetailId}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
@@ -62,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectOutStockoutDetailListByStockoutId" parameterType="String" resultMap="OutStockoutDetailResult">
|
||||
<include refid="selectOutStockoutDetailVo"/>
|
||||
where stockout_id = #{stockoutDetailId}
|
||||
where stockout_id = #{stockoutId}
|
||||
</select>
|
||||
|
||||
<select id="outboundTaskList" resultMap="OutStockoutDetailResult">
|
||||
|
||||
Reference in New Issue
Block a user