feat: add shadow export MCP tooling

This commit is contained in:
zgw
2026-08-28 11:14:26 +08:00
parent 2868cb85fa
commit da5a0a1561
13 changed files with 469 additions and 25 deletions

View File

@@ -127,27 +127,36 @@ public class OutStockoutServiceImpl implements IOutStockoutService
@Override
@Transactional(rollbackFor = Exception.class)
public String saveBill(OutStockoutVo outStockoutVo) {
OutStockout outStockout = outStockoutVo.getOutStockout();
List<OutStockoutDetail> detailList = outStockoutVo.getDetailList();
String stockOutId = basJobIdService.getJobId("CKD");
outStockout.setStockoutId(stockOutId);
outStockout.setStockoutGuid(UUID.randomUUID().toString());
outStockout.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
String username = SecurityContextHolder.getContext().getAuthentication().getName();
outStockout.setCreateManId(username);
outStockout.setStatus("1");
outStockout.setStockoutSource("0");
outStockout.setWarehouseId("01");
for (int i = 0; i < detailList.size(); i++) {
OutStockoutDetail outStockoutDetail = detailList.get(i);
outStockoutDetail.setStockoutDetailId(stockOutId + "-" + (i + 1));
outStockoutDetail.setStockoutGuid(outStockout.getStockoutGuid());
outStockoutDetail.setStockoutId(stockOutId);
outStockoutDetail.setAllotQuantity(BigDecimal.ZERO);
outStockoutDetail.setAssignNum(BigDecimal.ZERO);
outStockoutDetailMapper.insertOutStockoutDetail(outStockoutDetail);
}
outStockoutMapper.insertOutStockout(outStockout);
OutStockout outStockout = outStockoutVo.getOutStockout();
List<OutStockoutDetail> detailList = outStockoutVo.getDetailList();
String stockOutId = basJobIdService.getJobId("CKD");
outStockout.setStockoutId(stockOutId);
outStockout.setStockoutGuid(UUID.randomUUID().toString());
outStockout.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
String username = SecurityContextHolder.getContext().getAuthentication().getName();
outStockout.setCreateManId(username);
outStockout.setStatus("1");
outStockout.setStockoutSource("0");
String warehouseId = outStockout.getWarehouseId();
if ("01".equals(warehouseId) || "1".equals(warehouseId)) {
warehouseId = "1";
} else if ("02".equals(warehouseId) || "2".equals(warehouseId)) {
warehouseId = "2";
} else {
throw new IllegalArgumentException("仓库编号只能是1(立体库)或2(平库)");
}
outStockout.setWarehouseId(warehouseId);
for (int i = 0; i < detailList.size(); i++) {
OutStockoutDetail outStockoutDetail = detailList.get(i);
outStockoutDetail.setStockoutDetailId(stockOutId + "-" + (i + 1));
outStockoutDetail.setStockoutGuid(outStockout.getStockoutGuid());
outStockoutDetail.setStockoutId(stockOutId);
outStockoutDetail.setAllotQuantity(BigDecimal.ZERO);
outStockoutDetail.setAssignNum(BigDecimal.ZERO);
outStockoutDetail.setWarehouseId(warehouseId);
outStockoutDetailMapper.insertOutStockoutDetail(outStockoutDetail);
}
outStockoutMapper.insertOutStockout(outStockout);
return stockOutId;
}
@@ -177,6 +186,9 @@ public class OutStockoutServiceImpl implements IOutStockoutService
if ("1".equals(outStockout.getStatus())){
return AjaxResult.warn("单据未审核,请审核无误后再分配!");
}
if (outStockout.getWarehouseId().equals("2")){
return AjaxResult.warn("平库单据请使用手持机操作!");
}
HashMap<String, String> map = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder();

View File

@@ -42,7 +42,9 @@ public class ViewProductAndStockController extends BaseController
public TableDataInfo list(ViewProductAndStock viewProductAndStock)
{
startPage();
List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock);
List<ViewProductAndStock> list = "2".equals(viewProductAndStock.getWarehouseId())
? viewProductAndStockService.selectFlatProductAndStockList(viewProductAndStock)
: viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock);
return getDataTable(list);
}

View File

@@ -60,4 +60,6 @@ public interface ViewProductAndStockMapper
public int deleteViewProductAndStockByOnlyIdentitys(Long[] onlyIdentitys);
List<ViewProductAndStock> selectViewProductAndStockPdList(ViewProductAndStock viewProductAndStock);
List<ViewProductAndStock> selectFlatProductAndStockList(ViewProductAndStock viewProductAndStock);
}

View File

@@ -67,4 +67,5 @@ public interface IViewProductAndStockService
*/
public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity);
List<ViewProductAndStock> selectFlatProductAndStockList(ViewProductAndStock viewProductAndStock);
}

View File

@@ -102,4 +102,9 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
{
return viewProductAndStockMapper.deleteViewProductAndStockByOnlyIdentity(onlyIdentity);
}
@Override
public List<ViewProductAndStock> selectFlatProductAndStockList(ViewProductAndStock viewProductAndStock) {
return viewProductAndStockMapper.selectFlatProductAndStockList(viewProductAndStock);
}
}

View File

@@ -132,7 +132,7 @@ public class PdaServiceImp implements PdaService {
pdaMapper.bindTray(map);
if (!"10".equals(map.get("v_result").toString())) {
errorbulider.append(mydoJobDetail.getStockinDetailId() + map.get("v_resultmsg").toString());
throw new RuntimeException(map.get("v_result").toString());
throw new RuntimeException(map.get("v_resultmsg").toString());
}
}
HashMap<String, Object> map = new HashMap<>();
@@ -140,7 +140,7 @@ public class PdaServiceImp implements PdaService {
map.put("v_is_full", trayCodeMakeSure.getIsFull());
pdaMapper.addInJob(map);
if (!"10".equals(map.get("v_result").toString())) {
throw new RuntimeException(map.get("v_result").toString());
throw new RuntimeException(map.get("v_resultmsg").toString());
}
return AjaxResult.success();
}

View File

@@ -81,6 +81,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectFlatProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult">
select row_number() over (order by bs.product_id, bs.stock_id) as only_identity,
bs.product_id,
bs.lot_no,
bs.product_name,
isnull(bs.quantity, 0) - isnull(bs.out_quantity, 0) as quantity,
bs.warehouse_id,
bs.stacking_id,
bs.spare1,
bs.spare2,
bs.spare3,
bs.spare4,
bs.spare5,
bs.spare6,
bs.voltage,
bs.power,
bs.phase
from bas_stock_hc bs
<where>
<!-- try_convert(int, bs.warehouse_id) = 2-->
<!-- and isnull(bs.quantity, 0) - isnull(bs.out_quantity, 0) > 0-->
bs.quantity>0
and bs.out_quantity =0
<if test="productId != null and productId != ''">and bs.product_id like concat('%', #{productId}, '%')</if>
<if test="lotNo != null and lotNo != ''">and bs.lot_no like concat('%', #{lotNo}, '%')</if>
<if test="productName != null and productName != ''">and bs.product_name like concat('%', #{productName}, '%')</if>
<if test="spare1 != null and spare1 != ''">and bs.spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''">and bs.spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''">and bs.spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''">
and (bs.spare4 like concat('%', #{spare4}, '%')
or bs.order_id like concat('%', #{spare4}, '%')
or bs.job_id like concat('%', #{spare4}, '%'))
</if>
<if test="spare5 != null and spare5 != ''">and bs.spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''">and bs.spare6 like concat('%', #{spare6}, '%')</if>
<if test="voltage != null and voltage != ''">and bs.voltage like concat('%', #{voltage}, '%')</if>
<if test="power != null and power != ''">and bs.power like concat('%', #{power}, '%')</if>
<if test="phase != null and phase != ''">and bs.phase like concat('%', #{phase}, '%')</if>
</where>
</select>
<insert id="insertViewProductAndStock" parameterType="ViewProductAndStock">
insert into view_product_and_stock
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@@ -507,7 +507,6 @@
<include refid="selectBasStockHcVo"/>
<where>
<if test="out.lotNo != null and out.lotNo != ''">and bs.lot_no like concat('%', #{out.lotNo}, '%')</if>
<if test="trayCode != null and trayCode != ''">and bs.tray_code like concat('%', #{trayCode}, '%')</if>