现场 wms 字段显示修改

This commit is contained in:
liuhanqing
2026-01-04 11:00:18 +08:00
parent 6b56e5f2ad
commit b80ec1a6b9
46 changed files with 2511 additions and 2732 deletions

View File

@@ -36,6 +36,8 @@ import com.ruoyi.job.mydojob.service.IMydoJobService;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
import com.ruoyi.out.outStockout.service.IOutStockoutService;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.service.PdaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -57,33 +59,11 @@ public class ToWmsServiceImpl implements IToWmsService {
@Autowired
private IMydoJobDetailService mydoJobDetailService;
@Autowired
private IBasContainerService basContainerService;
@Autowired
private IBasTaskNoService basTaskNoService;
@Autowired
private IBasTagService iBasTagService;
@Autowired
private IBasCargoSpaceService basCargoSpaceService;
@Autowired
private IOutStockoutService outStockoutService;
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
@Autowired
private IBasProductService basProductService;
@Autowired
private IBasJobIdService basJobIdService;
@Autowired
private IToErpService toErpService;
@Autowired
private ITransferBillCallbackService transferBillCallbackService;
@Autowired
private IInStockinService inStockinService;
@Autowired
private IInStockinDetailService inStockinDetailService;
@Autowired
private IBasRoadwayService basRoadwayService;
private PdaService pdaService;
@Override
@@ -144,6 +124,10 @@ public class ToWmsServiceImpl implements IToWmsService {
MydoJob outJob = outMydoJobs.get(0);
outJob.setExecutionPhase("2");
mydoJobService.updateMydoJob(outJob);
if (outJob.getInOrOut().equals("23")){
String[] jobIds = new String[]{outJob.getJobId()};
mydoJobService.OuthandFinish(jobIds);
}
break;
default:
@@ -194,7 +178,7 @@ public class ToWmsServiceImpl implements IToWmsService {
}
@Override
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public AjaxResult requestEnterByTrayCodeAndEntranceId(RequestEnter requestEnter) {
HashMap<String, String> result = new HashMap<>();
if (StrUtil.isEmpty(requestEnter.getTrayCode())) {
@@ -215,7 +199,15 @@ public class ToWmsServiceImpl implements IToWmsService {
param.setWarehouseId(requestEnter.getWarehouseId());
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(param);
if (CollUtil.isEmpty(mydoJobs)){
return AjaxResult.error("没有该托盘任务", requestEnter.getTrayCode());
//生成杂料入库任务
TrayCodeMsg trayCodeMsg = new TrayCodeMsg();
trayCodeMsg.setTrayCode(requestEnter.getTrayCode());
trayCodeMsg.setWarehouseId(requestEnter.getWarehouseId());
pdaService.zlin(trayCodeMsg);
mydoJobs = mydoJobService.selectMydoJobListApi(param);
if (CollUtil.isEmpty(mydoJobs)){
return AjaxResult.error("杂料入库任务生成失败", requestEnter.getTrayCode());
}
}
MydoJob mydoJob = mydoJobs.get(0);
if(StrUtil.isEmpty(mydoJob.getCargoSpaceId())){

View File

@@ -182,51 +182,55 @@ public class CheckDifferenceRecordController extends BaseController {
return AjaxResult.error("没有找到该新增数据信息");
}
CheckDifferenceRecordAddInfo checkDifferenceRecordAddInfo = checkDifferenceRecordAddInfos.get(0);
//todo 创建新的库存记录
BasStock newStock = new BasStock();
// 先设置必要字段
newStock.setTrayCode(record.getTrayCode());
newStock.setQuantity(record.getNewQuantity());
newStock.setProductStatus("1");
newStock.setCargoSpaceId(record.getCargoSpaceId());
newStock.setLotNo(record.getLotNo());
newStock.setProductGuid(record.getProductGuid());
newStock.setProductId(record.getProductId());
newStock.setStockStatus("1"); // 设置库存状态为正常
newStock.setWarehouseId(record.getWarehouseId());
newStock.setInType("");
newStock.setOutQuantity("0");
newStock.setInDate(DateUtil.formatDateTime(DateUtil.date()));
//供应商
newStock.setPhase(checkDifferenceRecordAddInfo.getSpare3());
//来源地
newStock.setSpare1(checkDifferenceRecordAddInfo.getSpare4());
//周转
newStock.setVoltage(checkDifferenceRecordAddInfo.getSpare5());
//套账
newStock.setSpare3(checkDifferenceRecordAddInfo.getSpare6());
//用途
newStock.setSpare4(checkDifferenceRecordAddInfo.getSpare7());
//台次
newStock.setSpare5(checkDifferenceRecordAddInfo.getSpare8());
//合同
newStock.setOrderId(checkDifferenceRecordAddInfo.getSpare9());
//件次
newStock.setPower(checkDifferenceRecordAddInfo.getSpare10());
newStock.setLotNo(checkDifferenceRecordAddInfo.getSpare11());
//入库价格
newStock.setSpare6(checkDifferenceRecordAddInfo.getSpare12());
//管理
newStock.setDistribution(checkDifferenceRecordAddInfo.getSpare13());
//质量等级
newStock.setSpare8(checkDifferenceRecordAddInfo.getSpare14());
// 最后设置库存ID
newStock.setStockId(basJobIdService.getJobId("KC"));
newStock.setSpare7("1");
newStock.setStackingId(DateUtil.formatDateTime(DateUtil.date()));
basStockService.insertBasStock(newStock);
BasStock queryStock = new BasStock();
queryStock.setTrayCode(record.getTrayCode());
queryStock.setWarehouseId(record.getWarehouseId());
List<BasStock> stocks = basStockService.selectBasStockList(queryStock);
if (!stocks.isEmpty()){
//todo 创建新的库存记录
BasStock newStock = new BasStock();
// 先设置必要字段
newStock.setTrayCode(record.getTrayCode());
newStock.setQuantity(record.getNewQuantity());
newStock.setProductStatus("1");
newStock.setCargoSpaceId(stocks.get(0).getCargoSpaceId());
newStock.setLotNo(record.getLotNo());
newStock.setProductGuid(record.getProductGuid());
newStock.setProductId(record.getProductId());
newStock.setStockStatus("1"); // 设置库存状态为正常
newStock.setWarehouseId(record.getWarehouseId());
newStock.setInType("");
newStock.setOutQuantity("0");
newStock.setInDate(DateUtil.formatDateTime(DateUtil.date()));
//供应商
newStock.setPhase(checkDifferenceRecordAddInfo.getSpare3());
//来源地
newStock.setSpare1(checkDifferenceRecordAddInfo.getSpare4());
//周转
newStock.setVoltage(checkDifferenceRecordAddInfo.getSpare5());
//套账
newStock.setSpare3(checkDifferenceRecordAddInfo.getSpare6());
//用途
newStock.setSpare4(checkDifferenceRecordAddInfo.getSpare7());
//台次
newStock.setSpare5(checkDifferenceRecordAddInfo.getSpare8());
//合同
newStock.setOrderId(checkDifferenceRecordAddInfo.getSpare9());
//件次
newStock.setPower(checkDifferenceRecordAddInfo.getSpare10());
newStock.setLotNo(checkDifferenceRecordAddInfo.getSpare11());
//入库价格
newStock.setSpare6(checkDifferenceRecordAddInfo.getSpare12());
//管理
newStock.setDistribution(checkDifferenceRecordAddInfo.getSpare13());
//质量等级
newStock.setSpare8(checkDifferenceRecordAddInfo.getSpare14());
// 最后设置库存ID
newStock.setStockId(basJobIdService.getJobId("KC"));
newStock.setSpare7("1");
newStock.setStackingId(DateUtil.formatDateTime(DateUtil.date()));
basStockService.insertBasStock(newStock);
}
} else if ("3".equals(recordType)) {
// 删除数据

View File

@@ -365,9 +365,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
} else {
return AjaxResult.warn("不存在子作业");
}
}else if ("3".equals(mydoJob.getInOrOut())){
}else if ("3".equals(mydoJob.getInOrOut()) || "6".equals(mydoJob.getInOrOut())){
//空托盘入库
//正常入库任务
MydoJobDetail param = new MydoJobDetail();
param.setJobId(jobId);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
@@ -442,6 +441,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
MydoJob job = selectMydoJobByJobId(jobId);
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", job.getTrayCode());
map.put("v_warehouse_id", job.getWarehouseId());
pdaMapper.outMakeSure(map);
String result=map.get("v_result").toString();
if(!"10".equals(result)){

View File

@@ -33,7 +33,7 @@ public class KpiServiceImpl implements KpiService
@Autowired
private BasCargoSpaceMapper basCargoSpaceMapper;
@Autowired
private BasStockMapper basStockMapper;
/**
@@ -469,7 +469,7 @@ public class KpiServiceImpl implements KpiService
info.append("货位名称:").append(space.getCargoSpaceName()).append("<br>");
info.append("是否锁定:").append("Y".equals(space.getLocked()) ? "是" : "否").append("<br>");
info.append("托盘条码:").append(space.getTrayCode() != null ? space.getTrayCode() : "无").append("<br>");
// 根据cargoSpaceId查询BasStock表,获取productId和productName
BasStock stockQuery = new BasStock();
stockQuery.setCargoSpaceId(space.getCargoSpaceId());
@@ -499,13 +499,13 @@ public class KpiServiceImpl implements KpiService
mydoJobParam.setInOut(inOut);
List<DateTime> datesBetween = DateUtil.rangeToList(DateUtil.parseDate(startTime), DateUtil.parseDate(endTime), DateField.DAY_OF_MONTH);
List<MydoJob> list = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJobParam);
// 获取所有巷道ID(1和2)
List<String> roadwayIds = Arrays.asList("1", "2");
List<String> roadwayIds = Arrays.asList("1", "2" ,"3");
List<String> xAxis = new ArrayList<>();
List<Map<String, Object>> series = new ArrayList<>();
// 为每个巷道创建一个系列
for (String roadwayId : roadwayIds) {
Map<String, Object> seriesItem = new HashMap<>();
@@ -515,25 +515,25 @@ public class KpiServiceImpl implements KpiService
seriesItem.put("data", data);
series.add(seriesItem);
}
// 按日期统计每个巷道的数量
for (DateTime dateTime : datesBetween) {
xAxis.add(DateUtil.format(dateTime, "yyyy-MM-dd"));
// 统计每个巷道在当天的数量
for (int i = 0; i < roadwayIds.size(); i++) {
String roadwayId = roadwayIds.get(i);
long count = list.stream()
.filter(mydoJob -> roadwayId.equals(mydoJob.getRoadwayId())
.filter(mydoJob -> roadwayId.equals(mydoJob.getRoadwayId())
&& DateUtil.isIn(mydoJob.getCreateTime(), DateUtil.beginOfDay(dateTime), DateUtil.endOfDay(dateTime)))
.count();
@SuppressWarnings("unchecked")
List<Long> data = (List<Long>) series.get(i).get("data");
data.add(count);
}
}
res.put("xAxis", xAxis);
res.put("series", series);
return AjaxResult.success(res);

View File

@@ -33,4 +33,6 @@ public interface PdaMapper {
void ktpout(HashMap<String,Object> map);
void ktpin(HashMap<String,Object> map);
void zlin(HashMap<String,Object> map);
}

View File

@@ -38,4 +38,6 @@ public interface PdaService {
AjaxResult ktpin(TrayCodeMsg trayCodeMsg);
AjaxResult zlin(TrayCodeMsg trayCodeMsg);
}

View File

@@ -112,6 +112,7 @@ public class PdaServiceImp implements PdaService {
}
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_warehouse_id", trayCodeMakeSure.getWarehouseId());
pdaMapper.outMakeSure(map);
String result = map.get("v_result").toString();
if ("10".equals(result)) {
@@ -259,7 +260,7 @@ public class PdaServiceImp implements PdaService {
public AjaxResult ktpin(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMsg.getTrayCode());
// map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
pdaMapper.ktpin(map);
String result = map.get("v_result").toString();
if ("10".equals(result)){
@@ -268,4 +269,18 @@ public class PdaServiceImp implements PdaService {
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
@Override
public AjaxResult zlin(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMsg.getTrayCode());
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
pdaMapper.zlin(map);
String result = map.get("v_result").toString();
if ("10".equals(result)){
return AjaxResult.success(map.get("v_resultmsg").toString());
}else{
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
}

View File

@@ -135,6 +135,7 @@ public class ViewStockDetail extends BaseEntity
private String productType;
private String outside;
private String spare4;
private String distribution;

View File

@@ -118,6 +118,16 @@ public class ViewStockinHistory extends BaseEntity
/** 状态 */
@Excel(name = "状态",dictType = "turnover_type")
private String spare2;
@Excel(name = "代号")
private String spare9;
public String getSpare9() {
return spare9;
}
public void setSpare9(String spare9) {
this.spare9 = spare9;
}
public void setStockinId(String stockinId)
{

View File

@@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and locked = 'N'
and warehouse_id = #{warehouseId}
and roadway_id = #{roadwayId}
ORDER BY the_platoon, the_floor,the_column
ORDER BY the_floor,the_column,the_platoon
</select>
<select id="selectBasCargoSpaceListByRoadway" parameterType="BasCargoSpace" resultMap="BasCargoSpaceResult">
select bcs.cargo_space_id, bcs.warehouse_id, bw.warehouse_name, bcs.roadway_id, bcs.cargo_area_id, bcs.the_type,

View File

@@ -6,6 +6,7 @@
<select id="outMakeSure" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_out_makesure(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
@@ -131,6 +132,17 @@
<select id="ktpin" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_tp_in(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<select id="zlin" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_zl_in(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}

View File

@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare4" column="spare4" />
<result property="spare1" column="spare1" />
<result property="productType" column="productType" />
<result property="distribution" column="distribution" />
</resultMap>
<sql id="selectViewStockDetailVo">
@@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bs.stock_status, --库存状态
bs.lot_no, --批次号
bs.out_quantity,
bs.distribution, --来源
bs.spare4, --来源
bs.spare1 --用途
from bas_stock bs

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.search.ViewStockinHistory.mapper.ViewStockinHistoryMapper">
<resultMap type="ViewStockinHistory" id="ViewStockinHistoryResult">
<result property="stockinId" column="stockin_id" />
<result property="stockinDetailId" column="stockin_detail_id" />
@@ -32,15 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare1" column="spare1" />
<result property="spare4" column="spare4" />
<result property="spare2" column="spare2" />
<result property="spare9" column="spare9" />
</resultMap>
<sql id="selectViewStockinHistoryVo">
select stockin_id, stockin_detail_id, product_id, product_name, spec, cargo_no, productType, quantity, scan_num, assign_num, unit, price, priceTotal, supplier_no, supplier_name, spare6, spare5, spare7, spare3, create_man_id, create_date, status, spare8, remark, spare1, spare4, spare2 from view_stockin_history
select stockin_id, stockin_detail_id, product_id, product_name, spec, cargo_no, productType, quantity, scan_num, assign_num, unit, price, priceTotal, supplier_no, supplier_name, spare6, spare5, spare7, spare3, create_man_id, create_date, status, spare8, remark, spare1, spare4, spare2,spare9 from view_stockin_history
</sql>
<select id="selectViewStockinHistoryList" parameterType="ViewStockinHistory" resultMap="ViewStockinHistoryResult">
<include refid="selectViewStockinHistoryVo"/>
<where>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id = #{stockinDetailId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
@@ -67,9 +68,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare9 != null and spare9 != ''"> and spare9 = #{spare9}</if>
</where>
</select>
<select id="selectViewStockinHistoryByStockinId" parameterType="String" resultMap="ViewStockinHistoryResult">
<include refid="selectViewStockinHistoryVo"/>
where stockin_id = #{stockinId}
@@ -175,9 +177,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteViewStockinHistoryByStockinIds" parameterType="String">
delete from view_stockin_history where stockin_id in
delete from view_stockin_history where stockin_id in
<foreach item="stockinId" collection="array" open="(" separator="," close=")">
#{stockinId}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="supplierId" column="supplier_no" />
<result property="remark" column="remark" />
<result property="productType" column="productType" />
<result property="netWeight" column="net_weight" />
<!--<association property="extraField" javaType="ExtraField">
<result property="productId" column="product_id" />
</association>-->
@@ -93,7 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bs.lot_no, --批次号
bs.out_quantity,
bs.spare4, --来源
bs.spare1 --用途
bs.spare1, --用途
bs.net_weight --重量
from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id