Merge remote-tracking branch 'origin/main'

This commit is contained in:
lsymicc
2025-12-08 15:28:32 +08:00
35 changed files with 1678 additions and 1395 deletions

1
.gitignore vendored
View File

@@ -27,3 +27,4 @@ hs_err_pid*
**/target/ **/target/
/log/ /log/
.vscode/

View File

@@ -28,6 +28,7 @@ public interface IToErpService {
String login(); String login();
AjaxResult callErp(ReceiveOutStockConfirm receiveOutStockConfirm); AjaxResult callErp(ReceiveOutStockConfirm receiveOutStockConfirm);
AjaxResult receiveOutStockList(); AjaxResult receiveOutStockList();

View File

@@ -38,6 +38,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@@ -130,10 +131,10 @@ public class ToErpServiceImpl implements IToErpService {
AspResponse responseBean = JSONUtil.toBean(body, AspResponse.class); AspResponse responseBean = JSONUtil.toBean(body, AspResponse.class);
for (List<String> row : responseBean.getBody().getSource().getTable().getRows()) { for (List<String> row : responseBean.getBody().getSource().getTable().getRows()) {
BasProduct product = new BasProduct(); BasProduct product = new BasProduct();
product.setProductGuid(row.get(0)); product.setProductGuid(row.get(2));
product.setProductId(row.get(0)); product.setProductId(row.get(2));
product.setProductName(row.get(1)); product.setProductName(row.get(1));
product.setCargoNo(row.get(2)); product.setCargoNo(row.get(0));
product.setSpec(row.get(3)); product.setSpec(row.get(3));
product.setUnit(row.get(4)); product.setUnit(row.get(4));
product.setSpare1(row.get(5)); product.setSpare1(row.get(5));
@@ -283,9 +284,12 @@ public class ToErpServiceImpl implements IToErpService {
outStockout.setWarehouseId(Convert.toStr(row.get(2))); outStockout.setWarehouseId(Convert.toStr(row.get(2)));
outStockout.setErpStockoutId(Convert.toStr(row.get(0))); outStockout.setErpStockoutId(Convert.toStr(row.get(0)));
outStockout.setStockoutGuid(stockOutId); outStockout.setStockoutGuid(stockOutId);
outStockout.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); outStockout.setCreateDate(Convert.toStr(row.get(3)));
outStockout.setOutType("1"); outStockout.setOutType("1");
outStockout.setStatus("1"); outStockout.setStatus("1");
outStockout.setFID(Convert.toStr(row.get(1)));
outStockout.setStockoutSource("2");
outStockout.setCustomerNo(Convert.toStr(row.get(24)));
ErpOutStock erpOutStock1 = erpOutStockService.selectErpOutStockByStockoutId(erpOutStock.getStockoutId()); ErpOutStock erpOutStock1 = erpOutStockService.selectErpOutStockByStockoutId(erpOutStock.getStockoutId());
OutStockout outStockout1 = outStockoutService.selectOutStockoutByStockoutGuid(outStockout.getStockoutGuid()); OutStockout outStockout1 = outStockoutService.selectOutStockoutByStockoutGuid(outStockout.getStockoutGuid());
if (ObjUtil.isNotNull(erpOutStock1)){ if (ObjUtil.isNotNull(erpOutStock1)){
@@ -346,6 +350,8 @@ public class ToErpServiceImpl implements IToErpService {
outStockoutDetail.setQuantity(detail.getQuantity()); outStockoutDetail.setQuantity(detail.getQuantity());
outStockoutDetail.setProductName(detail.getProductName()); outStockoutDetail.setProductName(detail.getProductName());
outStockoutDetail.setFid(Convert.toStr(detail.getId())); outStockoutDetail.setFid(Convert.toStr(detail.getId()));
outStockoutDetail.setAssignNum(BigDecimal.valueOf(0));
outStockoutDetail.setAllotQuantity(BigDecimal.valueOf(0));
ErpOutStockDetail erpOutStockDetail1 = erpOutStockDetailService.selectErpOutStockDetailById(detail.getId()); ErpOutStockDetail erpOutStockDetail1 = erpOutStockDetailService.selectErpOutStockDetailById(detail.getId());
OutStockoutDetail outStockoutDetail1 = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(outStockoutDetail.getStockoutDetailId()); OutStockoutDetail outStockoutDetail1 = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(outStockoutDetail.getStockoutDetailId());
if (ObjUtil.isNotNull(erpOutStockDetail1)){ if (ObjUtil.isNotNull(erpOutStockDetail1)){

View File

@@ -107,6 +107,18 @@ public class KpiController extends BaseController {
return success(kpiService.getRoadways(warehouseId)); return success(kpiService.getRoadways(warehouseId));
} }
/**
* 获取货位楼层数据
*
* @param warehouseId 仓库ID
* @return 货位楼层数据
*/
@GetMapping("/getFloors")
public AjaxResult getFloors(@RequestParam("warehouseId") String warehouseId){
return success(kpiService.getFloors(warehouseId));
}
/** /**
* 获取货位排数据 * 获取货位排数据
* *
@@ -116,23 +128,22 @@ public class KpiController extends BaseController {
*/ */
@GetMapping("/getPlatoons") @GetMapping("/getPlatoons")
public AjaxResult getPlatoons(@RequestParam("warehouseId") String warehouseId, public AjaxResult getPlatoons(@RequestParam("warehouseId") String warehouseId,
@RequestParam("roadwayId") String roadwayId){ @RequestParam("theFloor") String theFloor){
return success(kpiService.getPlatoons(warehouseId,roadwayId)); return success(kpiService.getPlatoons(warehouseId,theFloor));
} }
/** /**
* 获取库存平面图 * 获取库存平面图
* *
* @param warehouseId 仓库ID * @param warehouseId 仓库ID
* @param roadwayId 巷道ID * @param theFloor 层数
* @param thePlatoon 排
* @return 库存平面图数据 * @return 库存平面图数据
*/ */
@GetMapping("/getChartData") @GetMapping("/getChartData")
public AjaxResult getChartData(@RequestParam("warehouseId") String warehouseId, public AjaxResult getChartData(@RequestParam("warehouseId") String warehouseId,
@RequestParam("roadwayId") String roadwayId, @RequestParam("theFloor") String theFloor
@RequestParam("thePlatoon") String thePlatoon){ ){
return success(kpiService.getChartData(warehouseId,roadwayId,thePlatoon)); return success(kpiService.getChartData(warehouseId,theFloor));
} }
/** /**

View File

@@ -40,7 +40,7 @@ public interface KpiService {
Map<String, Object> getPlatoons(String warehouseId, String roadwayId); Map<String, Object> getPlatoons(String warehouseId, String roadwayId);
Map<String,Object> getChartData(String warehouseId, String roadwayId, String thePlatoon); Map<String,Object> getChartData(String warehouseId, String theFloor);
Map<String,Object> getChartMag(String warehouseId, String theColumn, String theFloor, String thePlatoon); Map<String,Object> getChartMag(String warehouseId, String theColumn, String theFloor, String thePlatoon);
@@ -48,4 +48,6 @@ public interface KpiService {
// 新增:根据仓库和巷道统计各状态货位数量 // 新增:根据仓库和巷道统计各状态货位数量
Map<String, Object> getSpaceStatusCounts(String warehouseId, String roadwayId); Map<String, Object> getSpaceStatusCounts(String warehouseId, String roadwayId);
Map<String, Object> getFloors(String warehouseId);
} }

View File

@@ -53,7 +53,7 @@ public class KpiServiceImpl implements KpiService
Map<String, Integer> roadwayCount = new HashMap<>(); Map<String, Integer> roadwayCount = new HashMap<>();
for (MydoJob job : list) { for (MydoJob job : list) {
// 检查入库作业标识是否小于10 // 检查入库作业标识是否小于20
if (job.getInOrOut() == null || Integer.parseInt(job.getInOrOut()) >= 20) { if (job.getInOrOut() == null || Integer.parseInt(job.getInOrOut()) >= 20) {
continue; continue;
} }
@@ -317,6 +317,36 @@ public class KpiServiceImpl implements KpiService
return res; return res;
} }
@Override
public Map<String, Object> getFloors(String warehouseId) {
Map<String, Object> response = new HashMap<>();
// 查询指定仓库和巷道的排号信息
BasCargoSpace queryParams = new BasCargoSpace();
queryParams.setWarehouseId(warehouseId);
List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(queryParams);
// 使用TreeSet去重并排序排号
Set<Long> platoonSet = new TreeSet<>();
for (BasCargoSpace space : list) {
if (space.getTheFloor() != null) {
platoonSet.add(space.getTheFloor());
}
}
// 转换为前端下拉框所需的格式
List<Map<String, String>> platoons = new ArrayList<>();
for (Long platoon : platoonSet) {
Map<String, String> platoonMap = new HashMap<>();
platoonMap.put("value", platoon.toString());
platoonMap.put("label", platoon + "层");
platoons.add(platoonMap);
}
response.put("data", platoons);
return response;
}
@Override @Override
public Map<String, Object> getRoadways(String warehouseId){ public Map<String, Object> getRoadways(String warehouseId){
Map<String, Object> response = new HashMap<>(); Map<String, Object> response = new HashMap<>();
@@ -348,13 +378,13 @@ public class KpiServiceImpl implements KpiService
} }
@Override @Override
public Map<String,Object> getPlatoons(String warehouseId, String roadwayId){ public Map<String,Object> getPlatoons(String warehouseId, String theFloor){
Map<String, Object> response = new HashMap<>(); Map<String, Object> response = new HashMap<>();
// 查询指定仓库和巷道的排号信息 // 查询指定仓库和巷道的排号信息
BasCargoSpace queryParams = new BasCargoSpace(); BasCargoSpace queryParams = new BasCargoSpace();
queryParams.setWarehouseId(warehouseId); queryParams.setWarehouseId(warehouseId);
queryParams.setRoadwayId(roadwayId); queryParams.setTheFloor(Long.valueOf(theFloor));
List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(queryParams); List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(queryParams);
// 使用TreeSet去重并排序排号 // 使用TreeSet去重并排序排号
@@ -379,14 +409,11 @@ public class KpiServiceImpl implements KpiService
} }
@Override @Override
public Map<String,Object> getChartData(String warehouseId, String roadwayId, String thePlatoon) { public Map<String,Object> getChartData(String warehouseId, String theFloor) {
// 查询指定仓库、巷道和排号的货位信息 // 查询指定仓库、巷道和排号的货位信息
BasCargoSpace queryParams = new BasCargoSpace(); BasCargoSpace queryParams = new BasCargoSpace();
queryParams.setWarehouseId(warehouseId); queryParams.setWarehouseId(warehouseId);
queryParams.setRoadwayId(roadwayId); queryParams.setTheFloor(Long.valueOf(theFloor));
if (thePlatoon != null) {
queryParams.setThePlatoon(Long.parseLong(thePlatoon));
}
List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(queryParams); List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(queryParams);
// 用于存储不同状态的货位坐标 // 用于存储不同状态的货位坐标
@@ -405,11 +432,11 @@ public class KpiServiceImpl implements KpiService
for (BasCargoSpace space : list) { for (BasCargoSpace space : list) {
// 收集列和层信息 // 收集列和层信息
columnSet.add(space.getTheColumn()); columnSet.add(space.getTheColumn());
floorSet.add(space.getTheFloor()); floorSet.add(space.getThePlatoon());
// 根据状态分类处理 // 根据状态分类处理
if (space.getStatus() != null) { if (space.getStatus() != null) {
String coordinate = "[" + space.getTheColumn() + "," + space.getTheFloor() + "," + space.getStatus() + "],"; String coordinate = "[" + space.getTheColumn() + "," + space.getThePlatoon() + "," + space.getStatus() + "],";
switch (Integer.parseInt(space.getStatus())) { switch (Integer.parseInt(space.getStatus())) {
case 1: empty += coordinate; break; case 1: empty += coordinate; break;
case 2: full += coordinate; break; case 2: full += coordinate; break;
@@ -424,15 +451,19 @@ public class KpiServiceImpl implements KpiService
// 构建列和层的标签 // 构建列和层的标签
StringBuilder columnLabels = new StringBuilder(); StringBuilder columnLabels = new StringBuilder();
for (Long col : columnSet) { for (Long col : columnSet) {
columnLabels.append("'").append(col).append(MessageUtils.message("kpi.spacePlan.column")).append("',"); columnLabels.append("'").append(col).append("列").append("',");
} }
String column = "[" + columnLabels.toString() + "]"; String column = "[" + columnLabels + "]";
StringBuilder floorLabels = new StringBuilder(); StringBuilder floorLabels = new StringBuilder();
for (Long floor : floorSet) { for (Long floor : floorSet) {
floorLabels.append("'").append(floor).append(MessageUtils.message("kpi.spacePlan.floor")).append("',"); if (floor==7){
floorLabels.append("'").append(6).append("排").append("',");
} }
String floor = "[" + floorLabels.toString() + "]"; floorLabels.append("'").append(floor).append("排").append("',");
}
//floorLabels.append("6排");
String floor = "[" + floorLabels + "]";
// 返回结果 // 返回结果
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@@ -489,7 +520,7 @@ public class KpiServiceImpl implements KpiService
} }
@Override @Override
public AjaxResult getInAnalysisByData(String warehouseId, String startTime, String endTime,String inOut) { public AjaxResult getInAnalysisByData(String warehouseId, String startTime, String endTime, String inOut) {
Map<String,Object> res = new HashMap<>(); Map<String,Object> res = new HashMap<>();
MydoJob mydoJobParam = new MydoJob(); MydoJob mydoJobParam = new MydoJob();
mydoJobParam.setWarehouseId(warehouseId); mydoJobParam.setWarehouseId(warehouseId);
@@ -497,36 +528,79 @@ public class KpiServiceImpl implements KpiService
mydoJobParam.setCreateLeftTime(startTime); mydoJobParam.setCreateLeftTime(startTime);
mydoJobParam.setCreateRightTime(endTime); mydoJobParam.setCreateRightTime(endTime);
mydoJobParam.setInOut(inOut); mydoJobParam.setInOut(inOut);
List<DateTime> datesBetween = DateUtil.rangeToList(DateUtil.parseDate(startTime), DateUtil.parseDate(endTime), DateField.DAY_OF_MONTH);
List<MydoJob> list = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJobParam); List<MydoJob> list = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJobParam);
// 获取所有巷道ID(1和2) // 收集所有涉及的楼层
List<String> roadwayIds = Arrays.asList("1", "2"); Set<Long> floorSet = new HashSet<>();
Map<String, BasCargoSpace> cargoSpaceCache = new HashMap<>();
// 遍历作业记录,收集涉及的货位ID并查询对应楼层
for (MydoJob job : list) {
if (job.getCargoSpaceId() != null) {
// 检查缓存中是否有该货位信息
if (!cargoSpaceCache.containsKey(job.getCargoSpaceId())) {
// 使用现有的查询方法查询货位信息
BasCargoSpace queryParam = new BasCargoSpace();
queryParam.setCargoSpaceId(job.getCargoSpaceId());
List<BasCargoSpace> cargoSpaces = basCargoSpaceMapper.selectBasCargoSpaceList(queryParam);
if (!cargoSpaces.isEmpty()) {
BasCargoSpace cargoSpace = cargoSpaces.get(0);
cargoSpaceCache.put(job.getCargoSpaceId(), cargoSpace);
if (cargoSpace.getTheFloor() != null) {
floorSet.add(cargoSpace.getTheFloor());
}
}
} else {
BasCargoSpace cachedSpace = cargoSpaceCache.get(job.getCargoSpaceId());
if (cachedSpace.getTheFloor() != null) {
floorSet.add(cachedSpace.getTheFloor());
}
}
}
}
// 将楼层排序
List<Long> floors = new ArrayList<>(floorSet);
Collections.sort(floors);
// 生成日期范围
List<DateTime> datesBetween = DateUtil.rangeToList(DateUtil.parseDate(startTime), DateUtil.parseDate(endTime), DateField.DAY_OF_MONTH);
List<String> xAxis = new ArrayList<>(); List<String> xAxis = new ArrayList<>();
List<Map<String, Object>> series = new ArrayList<>(); List<Map<String, Object>> series = new ArrayList<>();
// 为每个巷道创建一个系列 // 为每个楼层创建一个系列
for (String roadwayId : roadwayIds) { for (Long floor : floors) {
Map<String, Object> seriesItem = new HashMap<>(); Map<String, Object> seriesItem = new HashMap<>();
seriesItem.put("name", roadwayId + "号巷道"); seriesItem.put("name", floor + "层");
seriesItem.put("type", "line"); seriesItem.put("type", "line");
List<Long> data = new ArrayList<>(); List<Long> data = new ArrayList<>();
seriesItem.put("data", data); seriesItem.put("data", data);
series.add(seriesItem); series.add(seriesItem);
} }
// 按日期统计每个巷道的数量 // 按日期统计每个楼层的数量
for (DateTime dateTime : datesBetween) { for (DateTime dateTime : datesBetween) {
xAxis.add(DateUtil.format(dateTime, "yyyy-MM-dd")); xAxis.add(DateUtil.format(dateTime, "yyyy-MM-dd"));
// 统计每个巷道在当天的数量 // 统计每个楼层在当天的数量
for (int i = 0; i < roadwayIds.size(); i++) { for (int i = 0; i < floors.size(); i++) {
String roadwayId = roadwayIds.get(i); Long floor = floors.get(i);
long count = list.stream() long count = 0;
.filter(mydoJob -> roadwayId.equals(mydoJob.getRoadwayId())
&& DateUtil.isIn(mydoJob.getCreateTime(), DateUtil.beginOfDay(dateTime), DateUtil.endOfDay(dateTime))) // 遍历作业记录,统计该楼层在当天的作业数量
.count(); for (MydoJob job : list) {
if (DateUtil.isIn(job.getCreateTime(), DateUtil.beginOfDay(dateTime), DateUtil.endOfDay(dateTime))) {
// 查找该作业对应的货位是否属于当前楼层
if (job.getCargoSpaceId() != null && cargoSpaceCache.containsKey(job.getCargoSpaceId())) {
BasCargoSpace space = cargoSpaceCache.get(job.getCargoSpaceId());
if (space.getTheFloor() != null && space.getTheFloor().equals(floor)) {
count++;
}
}
}
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<Long> data = (List<Long>) series.get(i).get("data"); List<Long> data = (List<Long>) series.get(i).get("data");
@@ -540,4 +614,6 @@ public class KpiServiceImpl implements KpiService
} }
} }

View File

@@ -40,10 +40,10 @@ public class OutStockoutController extends BaseController {
public TableDataInfo list(OutStockout outStockout) { public TableDataInfo list(OutStockout outStockout) {
startPage(); startPage();
List<OutStockout> list = new ArrayList<>(); List<OutStockout> list = new ArrayList<>();
if(Integer.parseInt(outStockout.getStatus())<4){ if (Integer.parseInt(outStockout.getStatus()) < 4) {
list =outStockoutService.selectOutStockoutList(outStockout); list = outStockoutService.selectOutStockoutList(outStockout);
}else{ } else {
list=outStockoutFinishService.selectOutStockoutFinishListByOutStockout(outStockout); list = outStockoutFinishService.selectOutStockoutFinishListByOutStockout(outStockout);
} }
return getDataTable(list); return getDataTable(list);
} }

View File

@@ -94,8 +94,17 @@ public class OutStockout extends BaseEntity
private String remark; private String remark;
private String theme;
private List<String> typeData; private List<String> typeData;
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public String getSupplierName() { public String getSupplierName() {
return supplierName; return supplierName;

View File

@@ -135,7 +135,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
String username = SecurityContextHolder.getContext().getAuthentication().getName(); String username = SecurityContextHolder.getContext().getAuthentication().getName();
outStockout.setCreateManId(username); outStockout.setCreateManId(username);
outStockout.setStatus("1"); outStockout.setStatus("1");
outStockout.setStockoutSource("0"); outStockout.setStockoutSource("1");
// outStockout.setWarehouseId("01"); // outStockout.setWarehouseId("01");
for (int i = 0; i < detailList.size(); i++) { for (int i = 0; i < detailList.size(); i++) {
OutStockoutDetail outStockoutDetail = detailList.get(i); OutStockoutDetail outStockoutDetail = detailList.get(i);
@@ -155,7 +155,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus,String exitId) { public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus,String exitId) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
if (status.equals("4")){ if ("4".equals(status)){
for(String stockoutId:stockoutIds){ for(String stockoutId:stockoutIds){
ReceiveOutStockConfirm receiveOutStockConfirm = new ReceiveOutStockConfirm(); ReceiveOutStockConfirm receiveOutStockConfirm = new ReceiveOutStockConfirm();
OutStockout outStockout = selectOutStockoutByStockoutGuid(stockoutId); OutStockout outStockout = selectOutStockoutByStockoutGuid(stockoutId);

View File

@@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* 库存物资Controller * 库存物资Controller
* *
* @author ruoyi * @author ruoyi
* @date 2025-09-12 * @date 2025-12-08
*/ */
@RestController @RestController
@RequestMapping("/out/productAndStock") @RequestMapping("/out/productAndStock")
@@ -45,17 +45,6 @@ public class ViewProductAndStockController extends BaseController
List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock); List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockList(viewProductAndStock);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询库存物资列表
*/
@PreAuthorize("@ss.hasPermi('out:productAndStock:list')")
@GetMapping("/pd/list")
public TableDataInfo pdList(ViewProductAndStock viewProductAndStock)
{
startPage();
List<ViewProductAndStock> list = viewProductAndStockService.selectViewProductAndStockPdList(viewProductAndStock);
return getDataTable(list);
}
/** /**
* 导出库存物资列表 * 导出库存物资列表

View File

@@ -9,134 +9,28 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 库存物资对象 view_product_and_stock * 库存物资对象 view_product_and_stock
* *
* @author ruoyi * @author ruoyi
* @date 2025-10-21 * @date 2025-12-08
*/ */
public class ViewProductAndStock public class ViewProductAndStock extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 序号 */ /** 唯一id */
@Excel(name = "序号") @Excel(name = "唯一id")
private Long onlyIdentity; private Long onlyIdentity;
/** 物料编码 */ /** 产品编码 */
@Excel(name = "物料编码") @Excel(name = "产品编码")
private String productId; private String productId;
/** 批次 */ /** 产品名称 */
@Excel(name = "批次") @Excel(name = "产品名称")
private String lotNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String productName; private String productName;
/** 库存数量 */ /** 库存数量 */
@Excel(name = "库存数量") @Excel(name = "库存数量")
private String quantity; private String quantity;
/** 仓库 */
@Excel(name = "仓库")
private String warehouseId;
/** 来源 */
@Excel(name = "来源")
private String spare1;
/** 套账 */
@Excel(name = "套账")
private String spare3;
/** 用途 */
@Excel(name = "用途")
private String spare4;
/** 台次 */
@Excel(name = "台次")
private String spare5;
/** 入库单价 */
@Excel(name = "入库单价")
private String spare6;
/** 状态 */
@Excel(name = "状态")
private String voltage;
/** 件次 */
@Excel(name = "件次")
private String power;
/** 供应商 */
// @Excel(name = "供应商")
private String phase;
private String supplierName;
/** 管理号 */
@Excel(name = "管理号")
private String distribution;
/** 合同号 */
@Excel(name = "合同号")
private String orderId;
/** 质量等级 */
@Excel(name = "质量等级")
private String spare8;
/** 单价 */
@Excel(name = "单价")
private String price;
/** 图号 */
@Excel(name = "图号")
private String cargoNo;
/** 物料状态 */
@Excel(name = "物料状态")
private String productStatus;
/** 常用编码 */
@Excel(name = "常用编码")
private String parentId;
/** 启用标识 */
@Excel(name = "启用标识")
private String spare7;
@Excel(name = "创建时间")
private String createTime;
/** 创建用户 */
@Excel(name = "创建用户")
private String createSys;
/** 规格型号 */
@Excel(name = "规格型号")
private String spec;
/** 单位 */
@Excel(name = "单位")
private String unit;
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public void setOnlyIdentity(Long onlyIdentity) public void setOnlyIdentity(Long onlyIdentity)
{ {
this.onlyIdentity = onlyIdentity; this.onlyIdentity = onlyIdentity;
@@ -157,16 +51,6 @@ public class ViewProductAndStock
return productId; return productId;
} }
public void setLotNo(String lotNo)
{
this.lotNo = lotNo;
}
public String getLotNo()
{
return lotNo;
}
public void setProductName(String productName) public void setProductName(String productName)
{ {
this.productName = productName; this.productName = productName;
@@ -187,235 +71,13 @@ public class ViewProductAndStock
return quantity; return quantity;
} }
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
public void setSpare5(String spare5)
{
this.spare5 = spare5;
}
public String getSpare5()
{
return spare5;
}
public void setSpare6(String spare6)
{
this.spare6 = spare6;
}
public String getSpare6()
{
return spare6;
}
public void setVoltage(String voltage)
{
this.voltage = voltage;
}
public String getVoltage()
{
return voltage;
}
public void setPower(String power)
{
this.power = power;
}
public String getPower()
{
return power;
}
public void setPhase(String phase)
{
this.phase = phase;
}
public String getPhase()
{
return phase;
}
public void setDistribution(String distribution)
{
this.distribution = distribution;
}
public String getDistribution()
{
return distribution;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setSpare8(String spare8)
{
this.spare8 = spare8;
}
public String getSpare8()
{
return spare8;
}
public void setPrice(String price)
{
this.price = price;
}
public String getPrice()
{
return price;
}
public void setCargoNo(String cargoNo)
{
this.cargoNo = cargoNo;
}
public String getCargoNo()
{
return cargoNo;
}
public void setProductStatus(String productStatus)
{
this.productStatus = productStatus;
}
public String getProductStatus()
{
return productStatus;
}
public void setParentId(String parentId)
{
this.parentId = parentId;
}
public String getParentId()
{
return parentId;
}
public void setSpare7(String spare7)
{
this.spare7 = spare7;
}
public String getSpare7()
{
return spare7;
}
public void setCreateSys(String createSys)
{
this.createSys = createSys;
}
public String getCreateSys()
{
return createSys;
}
public void setSpec(String spec)
{
this.spec = spec;
}
public String getSpec()
{
return spec;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("onlyIdentity", getOnlyIdentity()) .append("onlyIdentity", getOnlyIdentity())
.append("productId", getProductId()) .append("productId", getProductId())
.append("lotNo", getLotNo())
.append("productName", getProductName()) .append("productName", getProductName())
.append("quantity", getQuantity()) .append("quantity", getQuantity())
.append("warehouseId", getWarehouseId())
.append("spare1", getSpare1())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.append("spare6", getSpare6())
.append("voltage", getVoltage())
.append("power", getPower())
.append("phase", getPhase())
.append("distribution", getDistribution())
.append("orderId", getOrderId())
.append("spare8", getSpare8())
.append("price", getPrice())
.append("cargoNo", getCargoNo())
.append("productStatus", getProductStatus())
.append("parentId", getParentId())
.append("spare7", getSpare7())
.append("createTime", getCreateTime())
.append("createSys", getCreateSys())
.append("spec", getSpec())
.append("unit", getUnit())
.toString(); .toString();
} }
} }

View File

@@ -7,7 +7,7 @@ import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
* 库存物资Mapper接口 * 库存物资Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-09-12 * @date 2025-12-08
*/ */
public interface ViewProductAndStockMapper public interface ViewProductAndStockMapper
{ {
@@ -58,6 +58,4 @@ public interface ViewProductAndStockMapper
* @return 结果 * @return 结果
*/ */
public int deleteViewProductAndStockByOnlyIdentitys(Long[] onlyIdentitys); public int deleteViewProductAndStockByOnlyIdentitys(Long[] onlyIdentitys);
List<ViewProductAndStock> selectViewProductAndStockPdList(ViewProductAndStock viewProductAndStock);
} }

View File

@@ -7,7 +7,7 @@ import com.ruoyi.out.productAndStock.domain.ViewProductAndStock;
* 库存物资Service接口 * 库存物资Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-09-12 * @date 2025-12-08
*/ */
public interface IViewProductAndStockService public interface IViewProductAndStockService
{ {
@@ -58,6 +58,4 @@ public interface IViewProductAndStockService
* @return 结果 * @return 结果
*/ */
public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity); public int deleteViewProductAndStockByOnlyIdentity(Long onlyIdentity);
List<ViewProductAndStock> selectViewProductAndStockPdList(ViewProductAndStock viewProductAndStock);
} }

View File

@@ -11,7 +11,7 @@ import com.ruoyi.out.productAndStock.service.IViewProductAndStockService;
* 库存物资Service业务层处理 * 库存物资Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-09-12 * @date 2025-12-08
*/ */
@Service @Service
public class ViewProductAndStockServiceImpl implements IViewProductAndStockService public class ViewProductAndStockServiceImpl implements IViewProductAndStockService
@@ -90,10 +90,4 @@ public class ViewProductAndStockServiceImpl implements IViewProductAndStockServi
{ {
return viewProductAndStockMapper.deleteViewProductAndStockByOnlyIdentity(onlyIdentity); return viewProductAndStockMapper.deleteViewProductAndStockByOnlyIdentity(onlyIdentity);
} }
@Override
public List<ViewProductAndStock> selectViewProductAndStockPdList(ViewProductAndStock viewProductAndStock) {
return viewProductAndStockMapper.selectViewProductAndStockPdList(viewProductAndStock);
}
} }

View File

@@ -90,6 +90,15 @@ public class BasStockFreezeRecord extends BaseEntity
/** 物料guid */ /** 物料guid */
// @Excel(name = "${stock.Freeze.productGuid}") // @Excel(name = "${stock.Freeze.productGuid}")
private String productGuid; private String productGuid;
/** 单位名称 */
@Excel(name = "单位名称")
private String unitName;
/** 产品型号 */
@Excel(name = "产品型号")
private String productModel;
// 创建时间 // 创建时间
@Excel(name = "操作时间", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30) @Excel(name = "操作时间", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -101,6 +101,14 @@ public class BasStockMaintainRecord extends BaseEntity
// @Excel(name = "${stock.Maintain.barCodeQuantity}") // @Excel(name = "${stock.Maintain.barCodeQuantity}")
private String barCodeQuantity; private String barCodeQuantity;
/** 单位名称 */
@Excel(name = "单位名称")
private String unitName;
/** 产品型号 */
@Excel(name = "产品型号")
private String productModel;
/** 物料guid */ /** 物料guid */
// @Excel(name = "${stock.Maintain.productGuid}") // @Excel(name = "${stock.Maintain.productGuid}")
private String productGuid; private String productGuid;

View File

@@ -81,8 +81,7 @@ public class BasStock extends BaseEntity {
private String spare8; private String spare8;
private String voltage; private String voltage;
@Excel(name = "件次",sort=18)
private String power;
private String phase; private String phase;
private String netWeight; private String netWeight;
private String grossWeight; private String grossWeight;
@@ -217,4 +216,112 @@ public class BasStock extends BaseEntity {
private String cargoNo; private String cargoNo;
@Excel(name = "备注",sort=31) @Excel(name = "备注",sort=31)
private String remark; private String remark;
private String power;
/** 产品型号 */
@Excel(name = "产品型号")
private String productModel;
// ---------- 产品明细 pd_ 字段 (来自产品明细 JSON) ----------
/** 入库明细ID */
private String pdDetailId;
/** 产品名称(明细) */
private String pdProductName;
/** 型号(明细) */
private String pdModel;
/** 单位(明细) */
private String pdUnit;
/** 单价(明细) */
private String pdUnitPrice;
/** 辅助单位(明细) */
private String pdAuxUnit;
/** 产品属性1(明细) */
private String pdAttr1;
/** 产品属性2(明细) */
private String pdAttr2;
/** 数量(明细) */
private String pdQuantity;
/** 入库数(明细) */
private String pdInQty;
/** 辅助数量(明细) */
private String pdAuxQuantity;
/** 总价(明细) */
private String pdTotalPrice;
/** 成本单价(明细) */
private String pdCostUnitPrice;
/** 总价2(明细) */
private String pdTotalPrice2;
/** 核算成本总价(明细) */
private String pdAccountCostTotal;
/** 核算数量(明细) */
private String pdAccountQuantity;
/** 核算状态(明细) */
private String pdAccountStatus;
/** 批号(明细) */
private String pdBatchNo;
/** 序列号(明细) */
private String pdSerialNo;
/** 生产日期(明细) */
private String pdProdDate;
/** 有效日期(明细) */
private String pdValidDate;
/** 到货日期(明细) */
private String pdArrivalDate;
/** 备注(明细) */
private String pdRemark;
/** 自定义字段1(明细) */
private String pdCustom1;
/** 自定义字段2(明细) */
private String pdCustom2;
/** 自定义字段3(明细) */
private String pdCustom3;
/** 自定义字段4(明细) */
private String pdCustom4;
/** 自定义字段5(明细) */
private String pdCustom5;
/** 自定义字段6(明细) */
private String pdCustom6;
/** 装卸工(明细) */
private String pdLoader;
// ---------- SQL 脚本中新增的其他字段 ----------
/** 集合数据(JSON/序列化) */
private String Rows;
/** 入库主题 */
private String Title;
/** 入库id */
private String Kuin;
/** 入库状态 */
private String Complete1;
/** 申请人 */
private String Cateid;
/** 申请日期 */
private String Date3;
/** 确认日期 */
private String Date5;
/** 审批人 */
private String Catein;
/** 审批意见 */
private String Intro2;
/** 入库备注 */
private String Intro;
/** 关联其他单据id */
private String Caigou;
/** 添加时间 */
private String Date7;
/** 库管id */
private String Kg;
/** 入库类别 */
private String Sort1;
/** 入库编号 */
private String Rkbh;
/** 审批状态 */
private String Status;
/** 产品明细(JSON/集合) */
private String KuinList;
/** 客户名称 */
private String sysIcusIInheritIdIidI413;
/** 磅单编号 */
private String sysIcusIInheritIdIidI414;
/** 入库车号 */
private String sysIcusIInheritIdIidI415;
} }

View File

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="customerName" column="customer_name" /> <result property="customerName" column="customer_name" />
<result property="supplierName" column="supplier_name" /> <result property="supplierName" column="supplier_name" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="theme" column="theme" />
</resultMap> </resultMap>
<sql id="selectOutStockoutVo"> <sql id="selectOutStockoutVo">
@@ -34,12 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult"> <select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult">
select distinct o.stockout_guid, o.stockout_id, o.out_type, o.create_date, o.department_no, o.customer_no, o.create_man_id, o.status, o.stockout_source, select distinct o.stockout_guid, o.stockout_id, o.out_type, o.create_date, o.department_no, o.customer_no, o.create_man_id, o.status, o.stockout_source,
o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,o.remark from out_stockout o o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,eos.outbound_remarks as remark
,eos.customer_name
from out_stockout o
left join out_stockout_detail d on d.stockout_id = o.stockout_id left join out_stockout_detail d on d.stockout_id = o.stockout_id
left join bas_customer bc on bc.customer_no = d.out_id left join bas_customer bc on bc.customer_no = d.out_id
left join bas_warehouse bw on bw.warehouse_id = d.warehouse_id left join bas_warehouse bw on bw.warehouse_id = d.warehouse_id
left join bas_supplier bs on bs.supplier_no = d.supplier_id left join bas_supplier bs on bs.supplier_no = d.supplier_id
left join bas_product bp on bp.product_id = d.product_id left join bas_product bp on bp.product_id = d.product_id
left join erp_out_stock eos on eos.stockout_id = o.erp_stockout_id
<where> <where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if> <if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>

View File

@@ -7,35 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ViewProductAndStock" id="ViewProductAndStockResult"> <resultMap type="ViewProductAndStock" id="ViewProductAndStockResult">
<result property="onlyIdentity" column="only_identity" /> <result property="onlyIdentity" column="only_identity" />
<result property="productId" column="product_id" /> <result property="productId" column="product_id" />
<result property="lotNo" column="lot_no" />
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
<result property="quantity" column="quantity" /> <result property="quantity" column="quantity" />
<result property="warehouseId" column="warehouse_id" />
<result property="spare1" column="spare1" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="voltage" column="voltage" />
<result property="power" column="power" />
<result property="phase" column="phase" />
<result property="distribution" column="distribution" />
<result property="orderId" column="order_id" />
<result property="spare8" column="spare8" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="productStatus" column="product_status" />
<result property="parentId" column="parent_id" />
<result property="spare7" column="spare7" />
<result property="createTime" column="create_time" />
<result property="createSys" column="create_sys" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="supplierName" column="supplier_name" />
</resultMap> </resultMap>
<sql id="selectViewProductAndStockVo"> <sql id="selectViewProductAndStockVo">
select only_identity, product_id, lot_no, product_name, quantity, warehouse_id, spare1, spare3, spare4, spare5, spare6, voltage, power, phase, distribution, order_id, spare8, price, cargo_no, product_status, parent_id, spare7, create_time, create_sys, spec, unit,supplier_name from view_product_and_stock select only_identity, product_id, product_name, quantity from view_product_and_stock
</sql> </sql>
<select id="selectViewProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult"> <select id="selectViewProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult">
@@ -43,30 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if> <if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if> <if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if> <if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if>
<if test="power != null and power != ''"> and power = #{power}</if>
<if test="phase != null and phase != ''"> and phase = #{phase}</if>
<if test="distribution != null and distribution != ''"> and distribution like concat('%', #{distribution}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
<if test="productStatus != null and productStatus != ''"> and product_status = #{productStatus}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="createSys != null and createSys != ''"> and create_sys like concat('%', #{createSys}, '%')</if>
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
</where> </where>
</select> </select>
@@ -80,60 +35,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="onlyIdentity != null">only_identity,</if> <if test="onlyIdentity != null">only_identity,</if>
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="productName != null">product_name,</if> <if test="productName != null">product_name,</if>
<if test="quantity != null">quantity,</if> <if test="quantity != null">quantity,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="voltage != null">voltage,</if>
<if test="power != null">power,</if>
<if test="phase != null">phase,</if>
<if test="distribution != null">distribution,</if>
<if test="orderId != null">order_id,</if>
<if test="spare8 != null">spare8,</if>
<if test="price != null">price,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="productStatus != null">product_status,</if>
<if test="parentId != null">parent_id,</if>
<if test="spare7 != null">spare7,</if>
<if test="createTime != null">create_time,</if>
<if test="createSys != null">create_sys,</if>
<if test="spec != null">spec,</if>
<if test="unit != null">unit,</if>
<if test="supplierName != null">supplier_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="onlyIdentity != null">#{onlyIdentity},</if> <if test="onlyIdentity != null">#{onlyIdentity},</if>
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="productName != null">#{productName},</if> <if test="productName != null">#{productName},</if>
<if test="quantity != null">#{quantity},</if> <if test="quantity != null">#{quantity},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="voltage != null">#{voltage},</if>
<if test="power != null">#{power},</if>
<if test="phase != null">#{phase},</if>
<if test="distribution != null">#{distribution},</if>
<if test="orderId != null">#{orderId},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="price != null">#{price},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="productStatus != null">#{productStatus},</if>
<if test="parentId != null">#{parentId},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createSys != null">#{createSys},</if>
<if test="spec != null">#{spec},</if>
<if test="unit != null">#{unit},</if>
<if test="supplierName != null">#{supplierName},</if>
</trim> </trim>
</insert> </insert>
@@ -141,31 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update view_product_and_stock update view_product_and_stock
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="productId != null">product_id = #{productId},</if> <if test="productId != null">product_id = #{productId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="productName != null">product_name = #{productName},</if> <if test="productName != null">product_name = #{productName},</if>
<if test="quantity != null">quantity = #{quantity},</if> <if test="quantity != null">quantity = #{quantity},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="voltage != null">voltage = #{voltage},</if>
<if test="power != null">power = #{power},</if>
<if test="phase != null">phase = #{phase},</if>
<if test="distribution != null">distribution = #{distribution},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="price != null">price = #{price},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="productStatus != null">product_status = #{productStatus},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createSys != null">create_sys = #{createSys},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
</trim> </trim>
where only_identity = #{onlyIdentity} where only_identity = #{onlyIdentity}
</update> </update>

View File

@@ -5,81 +5,115 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.search.ViewStockDetail.mapper.ViewStockDetailMapper"> <mapper namespace="com.ruoyi.search.ViewStockDetail.mapper.ViewStockDetailMapper">
<resultMap type="ViewStockDetail" id="ViewStockDetailResult"> <resultMap type="ViewStockDetail" id="ViewStockDetailResult">
<result property="spare3" column="spare3" />
<result property="cargoSpaceId" column="cargo_space_id" /> <result property="cargoSpaceId" column="cargo_space_id" />
<result property="trayCode" column="tray_code" /> <result property="trayCode" column="tray_code" />
<result property="productId" column="product_id" /> <result property="productId" column="product_id" />
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
<result property="spec" column="spec" /> <!-- 与 BasStock 不符的字段已注释 -->
<!-- <result property="spec" column="spec" /> -->
<result property="quantity" column="quantity" /> <result property="quantity" column="quantity" />
<result property="spare6" column="spare6" /> <!-- <result property="price" column="price" /> -->
<result property="price" column="price" /> <!-- <result property="unit" column="unit" /> -->
<result property="spare1" column="spare1" /> <!-- <result property="cargoNo" column="cargo_no" /> -->
<result property="unit" column="unit" />
<result property="cargoNo" column="cargo_no" />
<result property="orderId" column="order_id" /> <result property="orderId" column="order_id" />
<result property="spare5" column="spare5" /> <!-- bs.power 字段与 BasStock 不一致,已注释 -->
<result property="power" column="power" /> <!-- <result property="power" column="power_col" /> -->
<result property="spare8" column="spare8" /> <!-- <result property="parentId" column="parent_id" /> -->
<result property="parentId" column="parent_id" />
<result property="stockinId" column="stockin_id" /> <result property="stockinId" column="stockin_id" />
<result property="supplierName" column="supplier_name" /> <!-- 供应商相关字段与 BasStock 不符,已注释 -->
<result property="supplierNo" column="supplier_no" /> <!-- <result property="supplierName" column="supplier_name" /> -->
<!-- <result property="supplierNo" column="supplier_no" /> -->
<result property="warehouseId" column="warehouse_id" /> <result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
<result property="inDate" column="in_date" /> <result property="inDate" column="in_date" />
<result property="stackingId" column="stacking_id" /> <!-- stackingId 非 BasStock 字段,已注释 -->
<result property="spare7" column="spare7" /> <!-- <result property="stackingId" column="stacking_id" /> -->
<result property="backDate" column="back_date" /> <result property="backDate" column="back_date" />
<result property="remark" column="remark" /> <!-- 备注字段使用 pd_remark(明细)或保留在 BasStock 中,基于适配需求先注释 remark -->
<!-- <result property="remark" column="remark" /> -->
<result property="stockId" column="stock_id" /> <result property="stockId" column="stock_id" />
<result property="stockStatus" column="stock_status" /> <result property="stockStatus" column="stock_status" />
<result property="lotNo" column="lot_no" /> <result property="lotNo" column="lot_no" />
<result property="outQuantity" column="out_quantity" /> <result property="outQuantity" column="out_quantity" />
<result property="spare4" column="spare4" />
<result property="spare1" column="spare1" /> <!-- productType 来自 bas_product(bp),BasStock 未将其作为主表字段,已注释 -->
<result property="productType" column="productType" /> <!-- <result property="productType" column="productType" /> -->
<!-- 添加 BasStock 的 pd_ 明细映射 -->
<result property="pdDetailId" column="pd_detail_id" />
<result property="pdProductName" column="pd_product_name" />
<result property="pdModel" column="pd_model" />
<result property="pdUnit" column="pd_unit" />
<result property="pdUnitPrice" column="pd_unit_price" />
<result property="pdAuxUnit" column="pd_aux_unit" />
<result property="pdAttr1" column="pd_attr1" />
<result property="pdAttr2" column="pd_attr2" />
<result property="pdQuantity" column="pd_quantity" />
<result property="pdInQty" column="pd_in_qty" />
<result property="pdAuxQuantity" column="pd_aux_quantity" />
<result property="pdTotalPrice" column="pd_total_price" />
<result property="pdCostUnitPrice" column="pd_cost_unit_price" />
<result property="pdTotalPrice2" column="pd_total_price_2" />
<result property="pdAccountCostTotal" column="pd_account_cost_total" />
<result property="pdAccountQuantity" column="pd_account_quantity" />
<result property="pdAccountStatus" column="pd_account_status" />
<result property="pdBatchNo" column="pd_batch_no" />
<result property="pdSerialNo" column="pd_serial_no" />
<result property="pdProdDate" column="pd_prod_date" />
<result property="pdValidDate" column="pd_valid_date" />
<result property="pdArrivalDate" column="pd_arrival_date" />
<result property="pdRemark" column="pd_remark" />
<result property="pdCustom1" column="pd_custom1" />
<result property="pdCustom2" column="pd_custom2" />
<result property="pdCustom3" column="pd_custom3" />
<result property="pdCustom4" column="pd_custom4" />
<result property="pdCustom5" column="pd_custom5" />
<result property="pdCustom6" column="pd_custom6" />
<result property="pdLoader" column="pd_loader" />
</resultMap> </resultMap>
<sql id="selectViewStockDetailVo"> <sql id="selectViewStockDetailVo">
select bs.spare3, --账套 select bs.cargo_space_id, --库位编码
bs.cargo_space_id, --库位编码
bs.tray_code, --托盘 bs.tray_code, --托盘
bs.product_id, --产品编码 bs.product_id, --产品编码
bs.product_name,--产品名称 bs.product_name,--产品名称
bp.spec, -- 规格
bs.quantity, -- 数量 bs.quantity, -- 数量
bs.spare6, -- 金额
bp.price, --单价
bp.spare1 as productType, --产品状态
bp.unit, -- 单位
bp.cargo_no, --图号
bs.order_id, --合同号 bs.order_id, --合同号
bs.spare5, --台次
bs.power, --件次
bs.spare8, --质量
bp.parent_id, --常用编码
bs.stockin_id, --入库单号 bs.stockin_id, --入库单号
bs2.supplier_name, --供应商名称
bs2.supplier_no, --供应商编号
bw.warehouse_id, --仓库编码 bw.warehouse_id, --仓库编码
bw.warehouse_name, --仓库名称 bw.warehouse_name, --仓库名称
bs.in_date, --入库时间 bs.in_date, --入库时间
bs.stacking_id, --出库时间
bs.spare7, --盘点标识
bs.back_date, --盘点时间 bs.back_date, --盘点时间
bp.remark, --备注
-- bas_stock 的 pd_ 明细字段
bs.pd_product_name, -- 明细产品名称
bs.pd_batch_no, -- 明细批次号
bs.pd_serial_no, -- 明细序列号
bs.pd_model, -- 明细型号
bs.pd_unit, -- 明细单位
bs.pd_unit_price, -- 明细单价
bs.pd_quantity, -- 明细数量
bs.pd_total_price, -- 明细金额
bs.pd_cost_unit_price,
bs.pd_prod_date, -- 明细生产日期
bs.pd_valid_date, -- 明细有效日期
bs.pd_arrival_date, -- 明细到货日期
bs.pd_remark, -- 明细备注
bs.stock_id, --库存编码 bs.stock_id, --库存编码
bs.stock_status, --库存状态 bs.stock_status, --库存状态
bs.lot_no, --批次号 bs.lot_no, --批次号
bs.out_quantity, bs.out_quantity
bs.spare4, --来源
bs.spare1 --用途
from bas_stock bs from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id
left join bas_supplier bs2 on bs.phase = bs2.supplier_no
</sql> </sql>
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult"> <select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
@@ -98,11 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockinId != null and stockinId != ''"> and bs.stockin_id = #{stockinId}</if> <if test="stockinId != null and stockinId != ''"> and bs.stockin_id = #{stockinId}</if>
<if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if>
<if test="stackingId != null and stackingId != ''"> and bs.stacking_id = #{stackingId}</if> <if test="stackingId != null and stackingId != ''"> and bs.stacking_id = #{stackingId}</if>
<if test="spare1 != null and spare1 != ''"> and bs.spare1 = #{spare1}</if>
<if test="spare3 != null and spare3 != ''"> and bs.spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and bs.spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and bs.spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and bs.spare6 = #{spare6}</if>
<if test="voltage != null and voltage != ''"> and bs.voltage = #{voltage}</if> <if test="voltage != null and voltage != ''"> and bs.voltage = #{voltage}</if>
<if test="power != null and power != ''"> and bs.power = #{power}</if> <if test="power != null and power != ''"> and bs.power = #{power}</if>
<if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if>
@@ -113,8 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if> <if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if>
<if test="spec != null and spec != ''"> and bp.spec = #{spec}</if> <if test="spec != null and spec != ''"> and bp.spec = #{spec}</if>
<if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if> <if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if>
<if test="supplierId != null and supplierId != ''"> and bs2.supplier_no = #{supplierId}</if>
<if test="supplierName != null and supplierName != ''"> and bs2.supplier_name = #{supplierName}</if>
<if test="price != null and price != ''"> and bp.price = #{price}</if> <if test="price != null and price != ''"> and bp.price = #{price}</if>
<if test="inDateStart != null and inDateStart != ''"> and bs.in_date &gt;= #{inDateStart}</if> <if test="inDateStart != null and inDateStart != ''"> and bs.in_date &gt;= #{inDateStart}</if>
<if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date &lt;= #{inDateEnd}</if> <if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date &lt;= #{inDateEnd}</if>

View File

@@ -25,22 +25,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productGuid" column="product_guid" /> <result property="productGuid" column="product_guid" />
<result property="cargoSpaceName" column="cargo_space_name" /> <result property="cargoSpaceName" column="cargo_space_name" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
</resultMap> </resultMap>
<sql id="selectBasStockFreezeRecordVo"> <sql id="selectBasStockFreezeRecordVo">
select wh_guid, stock_id, bsfr.cargo_space_id,bw.warehouse_name, bcs.cargo_space_name, bsfr.tray_code, product_id, product_name, print_date, lot_no, old_status, curr_status, method, bsfr.warehouse_id, create_time, stock_detail_id, operating_target, bar_code_old_quantity, bar_code_quantity, product_guid select bsfr.wh_guid, bsfr.stock_id, bsfr.cargo_space_id, bw.warehouse_name, bcs.cargo_space_name, bsfr.tray_code,
bsfr.product_id, bsfr.product_name, bsfr.print_date, bsfr.lot_no, bsfr.old_status, bsfr.curr_status, bsfr.method,
bsfr.warehouse_id, bsfr.create_time, bsfr.stock_detail_id, bsfr.operating_target, bsfr.bar_code_old_quantity,
bsfr.bar_code_quantity, bsfr.product_guid
from bas_stock_freeze_record bsfr from bas_stock_freeze_record bsfr
left join bas_cargo_space bcs on bsfr.cargo_space_id=bcs.cargo_space_id left join bas_cargo_space bcs on bsfr.cargo_space_id = bcs.cargo_space_id
left join bas_warehouse bw on bsfr.warehouse_id=bw.warehouse_id left join bas_warehouse bw on bsfr.warehouse_id = bw.warehouse_id
left join bas_stock bs on bsfr.stock_id = bs.stock_id
</sql> </sql>
<select id="selectBasStockFreezeRecordList" parameterType="BasStockFreezeRecord" resultMap="BasStockFreezeRecordResult"> <select id="selectBasStockFreezeRecordList" parameterType="BasStockFreezeRecord" resultMap="BasStockFreezeRecordResult">
<include refid="selectBasStockFreezeRecordVo"/> <include refid="selectBasStockFreezeRecordVo"/>
<where> <where>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if> <if test="stockId != null and stockId != ''"> and bsfr.stock_id = #{stockId}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bsfr.cargo_space_id = #{cargoSpaceId}</if> <if test="cargoSpaceId != null and cargoSpaceId != ''"> and bsfr.cargo_space_id = #{cargoSpaceId}</if>
<if test="trayCode != null and trayCode != ''"> and bsfr.tray_code = #{trayCode}</if> <if test="trayCode != null and trayCode != ''"> and bsfr.tray_code = #{trayCode}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if> <if test="productId != null and productId != ''"> and bsfr.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if> <if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if> <if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>

View File

@@ -25,22 +25,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productGuid" column="product_guid" /> <result property="productGuid" column="product_guid" />
<result property="cargoSpaceName" column="cargo_space_name" /> <result property="cargoSpaceName" column="cargo_space_name" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
</resultMap> </resultMap>
<sql id="selectBasStockMaintainRecordVo"> <sql id="selectBasStockMaintainRecordVo">
select wh_guid, stock_id, bsmr.cargo_space_id,bw.warehouse_name, bcs.cargo_space_name, bsmr.tray_code, product_id, product_name, print_date, lot_no, old_quantity, quantity, method, bsmr.warehouse_id, create_time, stock_detail_id, operating_target, bar_code_old_quantity, bar_code_quantity, product_guid select bsmr.wh_guid, bsmr.stock_id, bsmr.cargo_space_id, bw.warehouse_name, bcs.cargo_space_name, bsmr.tray_code,
bsmr.product_id, bsmr.product_name, bsmr.print_date, bsmr.lot_no, bsmr.old_quantity, bsmr.quantity, bsmr.method,
bsmr.warehouse_id, bsmr.create_time, bsmr.stock_detail_id, bsmr.operating_target, bsmr.bar_code_old_quantity,
bsmr.bar_code_quantity, bsmr.product_guid
from bas_stock_maintain_record bsmr from bas_stock_maintain_record bsmr
left join bas_cargo_space bcs on bsmr.cargo_space_id=bcs.cargo_space_id left join bas_cargo_space bcs on bsmr.cargo_space_id = bcs.cargo_space_id
left join bas_warehouse bw on bsmr.warehouse_id=bw.warehouse_id left join bas_warehouse bw on bsmr.warehouse_id = bw.warehouse_id
left join bas_stock bs on bsmr.stock_id = bs.stock_id
</sql> </sql>
<select id="selectBasStockMaintainRecordList" parameterType="BasStockMaintainRecord" resultMap="BasStockMaintainRecordResult"> <select id="selectBasStockMaintainRecordList" parameterType="BasStockMaintainRecord" resultMap="BasStockMaintainRecordResult">
<include refid="selectBasStockMaintainRecordVo"/> <include refid="selectBasStockMaintainRecordVo"/>
<where> <where>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if> <if test="stockId != null and stockId != ''"> and bsmr.stock_id = #{stockId}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bsmr.cargo_space_id = #{cargoSpaceId}</if> <if test="cargoSpaceId != null and cargoSpaceId != ''"> and bsmr.cargo_space_id = #{cargoSpaceId}</if>
<if test="trayCode != null and trayCode != ''"> and bsmr.tray_code = #{trayCode}</if> <if test="trayCode != null and trayCode != ''"> and bsmr.tray_code = #{trayCode}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if> <if test="productId != null and productId != ''"> and bsmr.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if> <if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if> <if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>

View File

@@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.stock.stock.mapper.BasStockMapper"> <mapper namespace="com.ruoyi.stock.stock.mapper.BasStockMapper">
<resultMap type="BasStock" id="BasStockResult"> <resultMap type="BasStock" id="BasStockResult">
<!-- 基于 stock.sql 的 bas_stock 表字段映射,非表字段已注释保留 -->
<result property="stockId" column="stock_id" /> <result property="stockId" column="stock_id" />
<result property="cargoSpaceId" column="cargo_space_id" /> <result property="cargoSpaceId" column="cargo_space_id" />
<result property="stockStatus" column="stock_status" /> <result property="stockStatus" column="stock_status" />
@@ -22,83 +23,144 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inType" column="in_type" /> <result property="inType" column="in_type" />
<result property="inClassId" column="in_class_id" /> <result property="inClassId" column="in_class_id" />
<result property="warehouseId" column="warehouse_id" /> <result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="stackingId" column="stacking_id" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="spare7" column="spare7" />
<result property="spare8" column="spare8" />
<result property="voltage" column="voltage" />
<result property="power" column="power" />
<result property="phase" column="phase" />
<result property="netWeight" column="net_weight" />
<result property="grossWeight" column="gross_weight" />
<result property="distribution" column="distribution" />
<result property="model" column="model" />
<result property="orderId" column="order_id" />
<result property="cargoSpaceStatus" column="locked" />
<result property="cargoSpaceStockStatus" column="cargoSpaceStockStatus" />
<result property="warehouseName" column="warehouse_name" />
<result property="cargoSpaceName" column="cargo_space_name" />
<result property="productId" column="product_id" /> <result property="productId" column="product_id" />
<result property="productName" column="product_name" /> <result property="productName" column="product_name" />
<result property="orderId" column="order_id" />
<!-- 以下为 bas_stock 表中存在的扩展字段(来自 stock.sql) -->
<result property="Rows" column="Rows" />
<result property="Title" column="Title" />
<result property="Kuin" column="Kuin" />
<result property="Complete1" column="Complete1" />
<result property="Cateid" column="Cateid" />
<result property="Date3" column="Date3" />
<result property="Date5" column="Date5" />
<result property="Catein" column="Catein" />
<result property="Intro2" column="Intro2" />
<result property="Intro" column="Intro" />
<result property="Caigou" column="Caigou" />
<result property="Date7" column="Date7" />
<result property="Kg" column="Kg" />
<result property="Sort1" column="Sort1" />
<result property="Rkbh" column="Rkbh" />
<result property="Status" column="Status" />
<result property="KuinList" column="KuinList" />
<result property="sysIcusIInheritIdIidI413" column="sysIcusIInheritIdIidI413" />
<result property="sysIcusIInheritIdIidI414" column="sysIcusIInheritIdIidI414" />
<result property="sysIcusIInheritIdIidI415" column="sysIcusIInheritIdIidI415" />
<!-- 产品明细 pd_ 映射(表中存在) -->
<result property="pdDetailId" column="pd_detail_id" />
<result property="pdProductName" column="pd_product_name" />
<result property="pdModel" column="pd_model" />
<result property="pdUnit" column="pd_unit" />
<result property="pdUnitPrice" column="pd_unit_price" />
<result property="pdAuxUnit" column="pd_aux_unit" />
<result property="pdAttr1" column="pd_attr1" />
<result property="pdAttr2" column="pd_attr2" />
<result property="pdQuantity" column="pd_quantity" />
<result property="pdInQty" column="pd_in_qty" />
<result property="pdAuxQuantity" column="pd_aux_quantity" />
<result property="pdTotalPrice" column="pd_total_price" />
<result property="pdCostUnitPrice" column="pd_cost_unit_price" />
<result property="pdTotalPrice2" column="pd_total_price_2" />
<result property="pdAccountCostTotal" column="pd_account_cost_total" />
<result property="pdAccountQuantity" column="pd_account_quantity" />
<result property="pdAccountStatus" column="pd_account_status" />
<result property="pdBatchNo" column="pd_batch_no" />
<result property="pdSerialNo" column="pd_serial_no" />
<result property="pdProdDate" column="pd_prod_date" />
<result property="pdValidDate" column="pd_valid_date" />
<result property="pdArrivalDate" column="pd_arrival_date" />
<result property="pdRemark" column="pd_remark" />
<result property="pdCustom1" column="pd_custom1" />
<result property="pdCustom2" column="pd_custom2" />
<result property="pdCustom3" column="pd_custom3" />
<result property="pdCustom4" column="pd_custom4" />
<result property="pdCustom5" column="pd_custom5" />
<result property="pdCustom6" column="pd_custom6" />
<result property="pdLoader" column="pd_loader" />
<!-- 以下为非 bas_stock 表字段(保留注释,按要求不删除) -->
<!--
<result property="warehouseName" column="warehouse_name" />
<result property="cargoSpaceStatus" column="locked" />
<result property="cargoSpaceStockStatus" column="cargoSpaceStockStatus" />
<result property="cargoSpaceName" column="cargo_space_name" />
<result property="spec" column="spec" /> <result property="spec" column="spec" />
<result property="price" column="price" /> <result property="price" column="price" />
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="cargoNo" column="cargo_no" /> <result property="cargoNo" column="cargo_no" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="supplierName" column="supplier_name" />
<result property="supplierId" column="supplier_no" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="productModel" column="productModel" />
<result property="productType" column="productType" /> <result property="productType" column="productType" />
<!--<association property="extraField" javaType="ExtraField"> -->
<result property="productId" column="product_id" />
</association>-->
</resultMap> </resultMap>
<sql id="selectBasStockVo"> <sql id="selectBasStockVo">
select bs.spare3, --账套 select bs.cargo_space_id, --库位编码(bas_stock)
bs.cargo_space_id, --库位编码 bs.tray_code, --托盘(bas_stock)
bs.tray_code, --托盘 bs.product_id, --产品编码(bas_stock)
bs.product_id, --产品编码 bs.product_name, --产品名称(bas_stock)
bp.product_name,--产品名称 -- bp.spec, -- 规格(非 bas_stock,已注释保留)
bp.spec, -- 规格 bs.quantity, -- 数量(bas_stock)
bs.quantity, -- 数量
bs.spare6, -- 金额 -- bp.price, -- 单价(非 bas_stock,已注释保留)
bp.price, --单价 -- bp.spare1 as productType, -- 产品状态(非 bas_stock,已注释保留)
bp.spare1 as productType, --产品状态 -- bp.cargo_no, -- 图号(非 bas_stock,已注释保留)
bp.unit, -- 单位 bs.order_id, -- 合同号(bas_stock)
bp.cargo_no, --图号 -- bs.power (已移除,旧字段)
bs.order_id, --合同号
bs.spare5, --台次 -- bp.parent_id, -- 常用编码(非 bas_stock,已注释保留)
bs.power, --件次 bs.stockin_id, -- 入库单号(bas_stock)
bs.spare8, --质量 bs.warehouse_id, -- 仓库编码(bas_stock)
bp.parent_id, --常用编码 -- bw.warehouse_name, -- 仓库名称(非 bas_stock,已注释保留)
bs.stockin_id, --入库单号 bs.in_date, -- 入库时间(bas_stock)
bs2.supplier_name, --供应商名称 <!-- bs.stacking_id 已移除(不在新表中) -->
bs2.supplier_no, --供应商编号
bw.warehouse_id, --仓库编码 bs.back_date, -- 盘点时间(bas_stock)
bw.warehouse_name, --仓库名称 -- bp.remark, -- 备注(非 bas_stock,已注释保留)
bs.in_date, --入库时间 bs.Rows, -- 集合数据(bas_stock)
bs.stacking_id, --出库时间 bs.Title, -- 入库主题(bas_stock)
bs.spare7, --盘点标识 bs.Kuin, -- 入库id(bas_stock)
bs.back_date, --盘点时间 bs.Complete1, -- 入库状态(bas_stock)
bp.remark, --备注 bs.Cateid, -- 申请人(bas_stock)
bs.stock_id, --库存编码 bs.Date3, -- 申请日期(bas_stock)
bs.stock_status, --库存状态 bs.Date5, -- 确认日期(bas_stock)
bs.lot_no, --批次号 bs.Catein, -- 审批人(bas_stock)
bs.out_quantity, bs.Intro2, -- 审批意见(bas_stock)
bs.spare4, --来源 bs.Intro, -- 入库备注(bas_stock)
bs.spare1 --用途 bs.Caigou, -- 关联单据id(bas_stock)
bs.Date7, -- 添加时间(bas_stock)
bs.Kg, -- 库管id(bas_stock)
bs.Sort1, -- 入库类别(bas_stock)
bs.Rkbh, -- 入库编号(bas_stock)
bs.Status, -- 审批状态(bas_stock)
bs.KuinList, -- 产品明细集合(bas_stock)
bs.sysIcusIInheritIdIidI413, -- 客户名称(bas_stock)
bs.sysIcusIInheritIdIidI414, -- 磅单编号(bas_stock)
bs.sysIcusIInheritIdIidI415, -- 入库车号(bas_stock)
bs.pd_product_name, -- 明细产品名称(bas_stock)
bs.pd_batch_no, -- 明细批次号(bas_stock)
bs.pd_serial_no, -- 明细序列号(bas_stock)
bs.pd_prod_date, -- 明细生产日期(bas_stock)
bs.pd_valid_date, -- 明细有效日期(bas_stock)
bs.pd_arrival_date, -- 明细到货日期(bas_stock)
bs.stock_id, -- 库存编码(bas_stock)
bs.stock_status, -- 库存状态(bas_stock)
bs.lot_no, -- 批次号(bas_stock)
bs.out_quantity
-- bp.unit, -- 单位(非 bas_stock,已注释保留)
-- bp.model as productModel, -- 非 bas_stock,已注释保留
-- bcs.locked as locked, -- 非 bas_stock,已注释保留
-- bcs.status as cargoSpaceStockStatus, -- 非 bas_stock,已注释保留
-- bcs.cargo_space_name as cargo_space_name -- 非 bas_stock,已注释保留
from bas_stock bs from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id
left join bas_supplier bs2 on bs.phase = bs2.supplier_no
</sql> </sql>
<select id="selectBasStockList" parameterType="BasStock" resultMap="BasStockResult"> <select id="selectBasStockList" parameterType="BasStock" resultMap="BasStockResult">
@@ -123,20 +185,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inType != null and inType != ''"> and bs.in_type = #{inType}</if> <if test="inType != null and inType != ''"> and bs.in_type = #{inType}</if>
<if test="inClassId != null and inClassId != ''"> and bs.in_class_id = #{inClassId}</if> <if test="inClassId != null and inClassId != ''"> and bs.in_class_id = #{inClassId}</if>
<if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if>
<if test="stackingId != null and stackingId != ''"> and bs.stacking_id = #{stackingId}</if> <!-- 已移除查询条件:stackingId(stacking_id 不在新表) -->
<if test="spare1 != null and spare1 != ''"> and bs.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and bs.spare2 = #{spare2}</if> <!-- 已移除查询条件:voltage, net_weight, gross_weight, distribution, model (不在新表中) -->
<if test="spare3 != null and spare3 != ''"> and bs.spare3 = #{spare3}</if> <if test="unit != null and unit != ''"> and bp.unit like concat('%', #{unit}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and bs.spare4 = #{spare4}</if> <if test="productModel != null and productModel != ''"> and bp.model like concat('%', #{productModel}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and bs.spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and bs.spare6 = #{spare6}</if>
<if test="voltage != null and voltage != ''"> and bs.voltage = #{voltage}</if>
<if test="power != null and power != ''"> and bs.power = #{power}</if>
<if test="phase != null and phase != ''"> and bs.phase = #{phase}</if>
<if test="netWeight != null and netWeight != ''"> and bs.net_weight = #{netWeight}</if>
<if test="grossWeight != null and grossWeight != ''"> and bs.gross_weight = #{grossWeight}</if>
<if test="distribution != null and distribution != ''"> and bs.distribution = #{distribution}</if>
<if test="model != null and model != ''"> and bs.model = #{model}</if>
<if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if>
<if test="productId != null and productId != ''"> and bs.product_id = #{productId}</if> <if test="productId != null and productId != ''"> and bs.product_id = #{productId}</if>
<if test="cargoSpaceStockStatus != null and cargoSpaceStockStatus != ''"> and bcs.status = #{cargoSpaceStockStatus}</if> <if test="cargoSpaceStockStatus != null and cargoSpaceStockStatus != ''"> and bcs.status = #{cargoSpaceStockStatus}</if>
@@ -147,13 +200,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if> <if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if>
<if test="spec != null and spec != ''"> and bp.spec = #{spec}</if> <if test="spec != null and spec != ''"> and bp.spec = #{spec}</if>
<if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if> <if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if>
<if test="supplierId != null and supplierId != ''"> and bs2.supplier_no = #{supplierId}</if>
<if test="supplierName != null and supplierName != ''"> and bs2.supplier_name = #{supplierName}</if>
<if test="price != null and price != ''"> and bp.price = #{price}</if> <if test="price != null and price != ''"> and bp.price = #{price}</if>
<if test="inDateStart != null and inDateStart != ''"> and bs.in_date &gt;= #{inDateStart}</if> <if test="inDateStart != null and inDateStart != ''"> and bs.in_date &gt;= #{inDateStart}</if>
<if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date &lt;= #{inDateEnd}</if> <if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date &lt;= #{inDateEnd}</if>
<if test="productType != null and productType != ''"> and bp.spare1 = #{productType}</if> <if test="productType != null and productType != ''"> and bp.spare1 = #{productType}</if>
<!-- 产品明细 搜索条件 -->
<if test="pdProductName != null and pdProductName != ''"> and bs.pd_product_name like concat('%', #{pdProductName}, '%')</if>
<if test="pdBatchNo != null and pdBatchNo != ''"> and bs.pd_batch_no = #{pdBatchNo}</if>
<if test="pdSerialNo != null and pdSerialNo != ''"> and bs.pd_serial_no = #{pdSerialNo}</if>
</where> </where>
</select> </select>
@@ -166,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertBasStock" parameterType="BasStock"> <insert id="insertBasStock" parameterType="BasStock">
insert into bas_stock insert into bas_stock
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<!-- bas_stock 表字段 -->
<if test="stockId != null">stock_id,</if> <if test="stockId != null">stock_id,</if>
<if test="cargoSpaceId != null">cargo_space_id,</if> <if test="cargoSpaceId != null">cargo_space_id,</if>
<if test="stockStatus != null">stock_status,</if> <if test="stockStatus != null">stock_status,</if>
@@ -183,27 +241,73 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inType != null">in_type,</if> <if test="inType != null">in_type,</if>
<if test="inClassId != null">in_class_id,</if> <if test="inClassId != null">in_class_id,</if>
<if test="warehouseId != null">warehouse_id,</if> <if test="warehouseId != null">warehouse_id,</if>
<if test="stackingId != null">stacking_id,</if>
<if test="spare1 != null">spare1,</if> <!-- SQL 添加字段(bas_stock 中存在) -->
<if test="spare2 != null">spare2,</if> <if test="Rows != null">Rows,</if>
<if test="spare3 != null">spare3,</if> <if test="Title != null">Title,</if>
<if test="spare4 != null">spare4,</if> <if test="Kuin != null">Kuin,</if>
<if test="spare5 != null">spare5,</if> <if test="Complete1 != null">Complete1,</if>
<if test="spare6 != null">spare6,</if> <if test="Cateid != null">Cateid,</if>
<if test="Date3 != null">Date3,</if>
<if test="Date5 != null">Date5,</if>
<if test="Catein != null">Catein,</if>
<if test="Intro2 != null">Intro2,</if>
<if test="Intro != null">Intro,</if>
<if test="Caigou != null">Caigou,</if>
<if test="Date7 != null">Date7,</if>
<if test="Kg != null">Kg,</if>
<if test="Sort1 != null">Sort1,</if>
<if test="Rkbh != null">Rkbh,</if>
<if test="Status != null">Status,</if>
<if test="KuinList != null">KuinList,</if>
<if test="sysIcusIInheritIdIidI413 != null">sysIcusIInheritIdIidI413,</if>
<if test="sysIcusIInheritIdIidI414 != null">sysIcusIInheritIdIidI414,</if>
<if test="sysIcusIInheritIdIidI415 != null">sysIcusIInheritIdIidI415,</if>
<!-- pd_ 明细字段(bas_stock 中存在) -->
<if test="pdDetailId != null">pd_detail_id,</if>
<if test="pdProductName != null">pd_product_name,</if>
<if test="pdModel != null">pd_model,</if>
<if test="pdUnit != null">pd_unit,</if>
<if test="pdUnitPrice != null">pd_unit_price,</if>
<if test="pdAuxUnit != null">pd_aux_unit,</if>
<if test="pdAttr1 != null">pd_attr1,</if>
<if test="pdAttr2 != null">pd_attr2,</if>
<if test="pdQuantity != null">pd_quantity,</if>
<if test="pdInQty != null">pd_in_qty,</if>
<if test="pdAuxQuantity != null">pd_aux_quantity,</if>
<if test="pdTotalPrice != null">pd_total_price,</if>
<if test="pdCostUnitPrice != null">pd_cost_unit_price,</if>
<if test="pdTotalPrice2 != null">pd_total_price_2,</if>
<if test="pdAccountCostTotal != null">pd_account_cost_total,</if>
<if test="pdAccountQuantity != null">pd_account_quantity,</if>
<if test="pdAccountStatus != null">pd_account_status,</if>
<if test="pdBatchNo != null">pd_batch_no,</if>
<if test="pdSerialNo != null">pd_serial_no,</if>
<if test="pdProdDate != null">pd_prod_date,</if>
<if test="pdValidDate != null">pd_valid_date,</if>
<if test="pdArrivalDate != null">pd_arrival_date,</if>
<if test="pdRemark != null">pd_remark,</if>
<if test="pdCustom1 != null">pd_custom1,</if>
<if test="pdCustom2 != null">pd_custom2,</if>
<if test="pdCustom3 != null">pd_custom3,</if>
<if test="pdCustom4 != null">pd_custom4,</if>
<if test="pdCustom5 != null">pd_custom5,</if>
<if test="pdCustom6 != null">pd_custom6,</if>
<if test="pdLoader != null">pd_loader,</if>
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if> <if test="productName != null">product_name,</if>
<if test="voltage != null">voltage,</if> <!-- 以下为非 bas_stock 字段,注释保留 -->
<if test="power != null">power,</if> <!-- <if test="voltage != null">voltage,</if> -->
<if test="phase != null">phase,</if> <!-- power 字段已移除 -->
<if test="netWeight != null">net_weight,</if> <!-- <if test="netWeight != null">net_weight,</if> -->
<if test="grossWeight != null">gross_weight,</if> <!-- <if test="grossWeight != null">gross_weight,</if> -->
<if test="distribution != null">distribution,</if> <!-- <if test="distribution != null">distribution,</if> -->
<if test="model != null">model,</if> <!-- model 字段已从 bas_stock 表移除,写入引用已删除 -->
<if test="orderId != null">order_id,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare8 != null">spare8,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<!-- bas_stock 字段 values -->
<if test="stockId != null">#{stockId},</if> <if test="stockId != null">#{stockId},</if>
<if test="cargoSpaceId != null">#{cargoSpaceId},</if> <if test="cargoSpaceId != null">#{cargoSpaceId},</if>
<if test="stockStatus != null">#{stockStatus},</if> <if test="stockStatus != null">#{stockStatus},</if>
@@ -221,25 +325,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inType != null">#{inType},</if> <if test="inType != null">#{inType},</if>
<if test="inClassId != null">#{inClassId},</if> <if test="inClassId != null">#{inClassId},</if>
<if test="warehouseId != null">#{warehouseId},</if> <if test="warehouseId != null">#{warehouseId},</if>
<if test="stackingId != null">#{stackingId},</if>
<if test="spare1 != null">#{spare1},</if> <!-- SQL 添加字段 values(bas_stock 中存在) -->
<if test="spare2 != null">#{spare2},</if> <if test="Rows != null">#{Rows},</if>
<if test="spare3 != null">#{spare3},</if> <if test="Title != null">#{Title},</if>
<if test="spare4 != null">#{spare4},</if> <if test="Kuin != null">#{Kuin},</if>
<if test="spare5 != null">#{spare5},</if> <if test="Complete1 != null">#{Complete1},</if>
<if test="spare6 != null">#{spare6},</if> <if test="Cateid != null">#{Cateid},</if>
<if test="Date3 != null">#{Date3},</if>
<if test="Date5 != null">#{Date5},</if>
<if test="Catein != null">#{Catein},</if>
<if test="Intro2 != null">#{Intro2},</if>
<if test="Intro != null">#{Intro},</if>
<if test="Caigou != null">#{Caigou},</if>
<if test="Date7 != null">#{Date7},</if>
<if test="Kg != null">#{Kg},</if>
<if test="Sort1 != null">#{Sort1},</if>
<if test="Rkbh != null">#{Rkbh},</if>
<if test="Status != null">#{Status},</if>
<if test="KuinList != null">#{KuinList},</if>
<if test="sysIcusIInheritIdIidI413 != null">#{sysIcusIInheritIdIidI413},</if>
<if test="sysIcusIInheritIdIidI414 != null">#{sysIcusIInheritIdIidI414},</if>
<if test="sysIcusIInheritIdIidI415 != null">#{sysIcusIInheritIdIidI415},</if>
<!-- pd_ 明细字段 values -->
<if test="pdDetailId != null">#{pdDetailId},</if>
<if test="pdProductName != null">#{pdProductName},</if>
<if test="pdModel != null">#{pdModel},</if>
<if test="pdUnit != null">#{pdUnit},</if>
<if test="pdUnitPrice != null">#{pdUnitPrice},</if>
<if test="pdAuxUnit != null">#{pdAuxUnit},</if>
<if test="pdAttr1 != null">#{pdAttr1},</if>
<if test="pdAttr2 != null">#{pdAttr2},</if>
<if test="pdQuantity != null">#{pdQuantity},</if>
<if test="pdInQty != null">#{pdInQty},</if>
<if test="pdAuxQuantity != null">#{pdAuxQuantity},</if>
<if test="pdTotalPrice != null">#{pdTotalPrice},</if>
<if test="pdCostUnitPrice != null">#{pdCostUnitPrice},</if>
<if test="pdTotalPrice2 != null">#{pdTotalPrice2},</if>
<if test="pdAccountCostTotal != null">#{pdAccountCostTotal},</if>
<if test="pdAccountQuantity != null">#{pdAccountQuantity},</if>
<if test="pdAccountStatus != null">#{pdAccountStatus},</if>
<if test="pdBatchNo != null">#{pdBatchNo},</if>
<if test="pdSerialNo != null">#{pdSerialNo},</if>
<if test="pdProdDate != null">#{pdProdDate},</if>
<if test="pdValidDate != null">#{pdValidDate},</if>
<if test="pdArrivalDate != null">#{pdArrivalDate},</if>
<if test="pdRemark != null">#{pdRemark},</if>
<if test="pdCustom1 != null">#{pdCustom1},</if>
<if test="pdCustom2 != null">#{pdCustom2},</if>
<if test="pdCustom3 != null">#{pdCustom3},</if>
<if test="pdCustom4 != null">#{pdCustom4},</if>
<if test="pdCustom5 != null">#{pdCustom5},</if>
<if test="pdCustom6 != null">#{pdCustom6},</if>
<if test="pdLoader != null">#{pdLoader},</if>
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if> <if test="productName != null">#{productName},</if>
<if test="voltage != null">#{voltage},</if> <!-- 非 bas_stock 值占位注释保留 -->
<if test="power != null">#{power},</if> <!-- <if test="voltage != null">#{voltage},</if> -->
<if test="phase != null">#{phase},</if> <!-- <if test="netWeight != null">#{netWeight},</if> -->
<if test="netWeight != null">#{netWeight},</if> <!-- <if test="grossWeight != null">#{grossWeight},</if> -->
<if test="grossWeight != null">#{grossWeight},</if> <!-- <if test="distribution != null">#{distribution},</if> -->
<if test="distribution != null">#{distribution},</if>
<if test="model != null">#{model},</if>
<if test="orderId != null">#{orderId},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare8 != null">#{spare8},</if>
</trim> </trim>
</insert> </insert>
@@ -262,35 +409,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inType != null">in_type = #{inType},</if> <if test="inType != null">in_type = #{inType},</if>
<if test="inClassId != null">in_class_id = #{inClassId},</if> <if test="inClassId != null">in_class_id = #{inClassId},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if> <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="stackingId != null">stacking_id = #{stackingId},</if> <!-- 已移除 update set for stacking_id -->
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="productId != null">product_id = #{productId},</if> <if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if> <!-- 以下为非 bas_stock 字段,注释保留 -->
<if test="voltage != null">voltage = #{voltage},</if> <!-- <if test="productName != null">product_name = #{productName},</if> -->
<if test="power != null">power = #{power},</if> <!-- <if test="voltage != null">voltage = #{voltage},</if> -->
<if test="phase != null">phase = #{phase},</if> <!-- power 字段已移除 -->
<if test="netWeight != null">net_weight = #{netWeight},</if> <!-- <if test="netWeight != null">net_weight = #{netWeight},</if> -->
<if test="grossWeight != null">gross_weight = #{grossWeight},</if> <!-- <if test="grossWeight != null">gross_weight = #{grossWeight},</if> -->
<if test="distribution != null">distribution = #{distribution},</if> <!-- <if test="distribution != null">distribution = #{distribution},</if> -->
<if test="model != null">model = #{model},</if> <!-- model 更新已移除 -->
<if test="orderId != null">order_id = #{orderId},</if> <if test="orderId != null">order_id = #{orderId},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare8 != null">spare8 = #{spare8},</if> <!-- SQL 脚本新增字段 set (bas_stock 中存在) -->
<if test="Rows != null">Rows = #{Rows},</if>
<if test="Title != null">Title = #{Title},</if>
<if test="Kuin != null">Kuin = #{Kuin},</if>
<if test="Complete1 != null">Complete1 = #{Complete1},</if>
<if test="Cateid != null">Cateid = #{Cateid},</if>
<if test="Date3 != null">Date3 = #{Date3},</if>
<if test="Date5 != null">Date5 = #{Date5},</if>
<if test="Catein != null">Catein = #{Catein},</if>
<if test="Intro2 != null">Intro2 = #{Intro2},</if>
<if test="Intro != null">Intro = #{Intro},</if>
<if test="Caigou != null">Caigou = #{Caigou},</if>
<if test="Date7 != null">Date7 = #{Date7},</if>
<if test="Kg != null">Kg = #{Kg},</if>
<if test="Sort1 != null">Sort1 = #{Sort1},</if>
<if test="Rkbh != null">Rkbh = #{Rkbh},</if>
<if test="Status != null">Status = #{Status},</if>
<if test="KuinList != null">KuinList = #{KuinList},</if>
<if test="sysIcusIInheritIdIidI413 != null">sysIcusIInheritIdIidI413 = #{sysIcusIInheritIdIidI413},</if>
<if test="sysIcusIInheritIdIidI414 != null">sysIcusIInheritIdIidI414 = #{sysIcusIInheritIdIidI414},</if>
<if test="sysIcusIInheritIdIidI415 != null">sysIcusIInheritIdIidI415 = #{sysIcusIInheritIdIidI415},</if>
<!-- pd_ 明细字段 set -->
<if test="pdDetailId != null">pd_detail_id = #{pdDetailId},</if>
<if test="pdProductName != null">pd_product_name = #{pdProductName},</if>
<if test="pdModel != null">pd_model = #{pdModel},</if>
<if test="pdUnit != null">pd_unit = #{pdUnit},</if>
<if test="pdUnitPrice != null">pd_unit_price = #{pdUnitPrice},</if>
<if test="pdAuxUnit != null">pd_aux_unit = #{pdAuxUnit},</if>
<if test="pdAttr1 != null">pd_attr1 = #{pdAttr1},</if>
<if test="pdAttr2 != null">pd_attr2 = #{pdAttr2},</if>
<if test="pdQuantity != null">pd_quantity = #{pdQuantity},</if>
<if test="pdInQty != null">pd_in_qty = #{pdInQty},</if>
<if test="pdAuxQuantity != null">pd_aux_quantity = #{pdAuxQuantity},</if>
<if test="pdTotalPrice != null">pd_total_price = #{pdTotalPrice},</if>
<if test="pdCostUnitPrice != null">pd_cost_unit_price = #{pdCostUnitPrice},</if>
<if test="pdTotalPrice2 != null">pd_total_price_2 = #{pdTotalPrice2},</if>
<if test="pdAccountCostTotal != null">pd_account_cost_total = #{pdAccountCostTotal},</if>
<if test="pdAccountQuantity != null">pd_account_quantity = #{pdAccountQuantity},</if>
<if test="pdAccountStatus != null">pd_account_status = #{pdAccountStatus},</if>
<if test="pdBatchNo != null">pd_batch_no = #{pdBatchNo},</if>
<if test="pdSerialNo != null">pd_serial_no = #{pdSerialNo},</if>
<if test="pdProdDate != null">pd_prod_date = #{pdProdDate},</if>
<if test="pdValidDate != null">pd_valid_date = #{pdValidDate},</if>
<if test="pdArrivalDate != null">pd_arrival_date = #{pdArrivalDate},</if>
<if test="pdRemark != null">pd_remark = #{pdRemark},</if>
<if test="pdCustom1 != null">pd_custom1 = #{pdCustom1},</if>
<if test="pdCustom2 != null">pd_custom2 = #{pdCustom2},</if>
<if test="pdCustom3 != null">pd_custom3 = #{pdCustom3},</if>
<if test="pdCustom4 != null">pd_custom4 = #{pdCustom4},</if>
<if test="pdCustom5 != null">pd_custom5 = #{pdCustom5},</if>
<if test="pdCustom6 != null">pd_custom6 = #{pdCustom6},</if>
<if test="pdLoader != null">pd_loader = #{pdLoader},</if>
</trim> </trim>
where stock_id = #{stockId} where stock_id = #{stockId}
</update> </update>
<insert id="insertBasStockList"> <insert id="insertBasStockList">
INSERT INTO bas_stock INSERT INTO bas_stock
(stock_id,cargo_space_id,stock_status,product_status,lot_no,in_date,back_date,product_guid,quantity,job_id,tray_code,out_quantity,stockin_detail_id,stockin_id,in_type,in_class_id,warehouse_id,stacking_id,spare1,spare2,spare3,spare4,spare5,spare6,product_id,product_name,voltage,power,phase,net_weight,gross_weight,distribution,model,order_id,spare7,spare8) (stock_id,cargo_space_id,stock_status,product_status,lot_no,in_date,back_date,product_guid,quantity,job_id,tray_code,out_quantity,stockin_detail_id,stockin_id,in_type,in_class_id,warehouse_id,product_id,product_name,/*voltage,net_weight,gross_weight,distribution,*/order_id,
pd_detail_id,pd_product_name,pd_model,pd_unit,pd_unit_price,pd_aux_unit,pd_attr1,pd_attr2,pd_quantity,pd_in_qty,pd_aux_quantity,pd_total_price,pd_cost_unit_price,pd_total_price_2,pd_account_cost_total,pd_account_quantity,pd_account_status,pd_batch_no,pd_serial_no,pd_prod_date,pd_valid_date,pd_arrival_date,pd_remark,pd_custom1,pd_custom2,pd_custom3,pd_custom4,pd_custom5,pd_custom6,pd_loader)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.stockId},#{item.cargoSpaceId},#{item.stockStatus},#{item.productStatus},#{item.lotNo},#{item.inDate},#{item.backDate},#{item.productGuid},#{item.quantity},#{item.jobId},#{item.trayCode},#{item.outQuantity},#{item.stockinDetailId},#{item.stockinId},#{item.inType},#{item.inClassId},#{item.warehouseId},#{item.stackingId},#{item.spare1},#{item.spare2},#{item.spare3},#{item.spare4},#{item.spare5},#{item.spare6},#{item.productId} (#{item.stockId},#{item.cargoSpaceId},#{item.stockStatus},#{item.productStatus},#{item.lotNo},#{item.inDate},#{item.backDate},#{item.productGuid},#{item.quantity},#{item.jobId},#{item.trayCode},#{item.outQuantity},#{item.stockinDetailId},#{item.stockinId},#{item.inType},#{item.inClassId},#{item.warehouseId},#{item.productId}
,#{item.productName},#{item.voltage},#{item.power},#{item.phase},#{item.netWeight},#{item.grossWeight},#{item.distribution},#{item.model},#{item.orderId},#{item.spare7},#{item.spare8}) ,#{item.productName},/*#{item.voltage},#{item.netWeight},#{item.grossWeight},#{item.distribution},*/#{item.orderId},
#{item.pdDetailId},#{item.pdProductName},#{item.pdModel},#{item.pdUnit},#{item.pdUnitPrice},#{item.pdAuxUnit},#{item.pdAttr1},#{item.pdAttr2},#{item.pdQuantity},#{item.pdInQty},#{item.pdAuxQuantity},#{item.pdTotalPrice},#{item.pdCostUnitPrice},#{item.pdTotalPrice2},#{item.pdAccountCostTotal},#{item.pdAccountQuantity},#{item.pdAccountStatus},#{item.pdBatchNo},#{item.pdSerialNo},#{item.pdProdDate},#{item.pdValidDate},#{item.pdArrivalDate},#{item.pdRemark},#{item.pdCustom1},#{item.pdCustom2},#{item.pdCustom3},#{item.pdCustom4},#{item.pdCustom5},#{item.pdCustom6},#{item.pdLoader})
</foreach> </foreach>
</insert> </insert>
@@ -298,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update bas_stock set stock_status = #{stockStatus} where tray_code = #{trayCode} update bas_stock set stock_status = #{stockStatus} where tray_code = #{trayCode}
</update> </update>
<update id="resetPdRecord"> <update id="resetPdRecord">
update bas_stock set spare7 = '0' update bas_stock set pd_account_status = '0'
</update> </update>
<delete id="deleteBasStockByStockId" parameterType="String"> <delete id="deleteBasStockByStockId" parameterType="String">

View File

@@ -9,6 +9,13 @@ export function getRoadways(query) {
params: query params: query
}) })
} }
export function getFloors(query) {
return request({
url: '/kpi/getFloors',
method: 'get',
params: query
})
}
//获取排列表 //获取排列表
export function getPlatoons(query) { export function getPlatoons(query) {
return request({ return request({

View File

@@ -98,7 +98,7 @@
<!-- <el-table-column type="selection" width="55" align="center" />--> <!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- 主键列注释保留 --> <!-- 主键列注释保留 -->
<!-- <el-table-column label="主键" align="center" prop="productGuid" /> --> <!-- <el-table-column label="主键" align="center" prop="productGuid" /> -->
<el-table-column label="物料编码" align="center" prop="productId" /> <el-table-column label="物料编码" align="center" prop="productId" width="260" />
<el-table-column label="产品编码" align="center" prop="cargoNo" width="160"/> <el-table-column label="产品编码" align="center" prop="cargoNo" width="160"/>
<!-- 物料名称列:修改为自定义模板,用v-html渲染HTML样式 --> <!-- 物料名称列:修改为自定义模板,用v-html渲染HTML样式 -->
<el-table-column label="物料名称" align="center" width="260"> <el-table-column label="物料名称" align="center" width="260">

View File

@@ -13,7 +13,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 巷道 --> <!-- 巷道 -->
<el-form-item label="巷道" prop="roadwayId"> <!-- <el-form-item label="巷道" prop="roadwayId">
<el-select v-model="queryParams.roadwayId" placeholder="请选择巷道" clearable @change="handleQuery"> <el-select v-model="queryParams.roadwayId" placeholder="请选择巷道" clearable @change="handleQuery">
<el-option <el-option
v-for="item in roadwayOptions" v-for="item in roadwayOptions"
@@ -22,7 +22,7 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>-->
<el-form-item> <el-form-item>
<!-- 【搜索】按钮 --> <!-- 【搜索】按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>

View File

@@ -13,18 +13,18 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 巷道 --> <!-- 层数 -->
<el-form-item label="巷道"> <el-form-item label="层数">
<el-select v-model="queryParams.roadwayId" style="width: 150px" @change="handleRoadwayChange"> <el-select v-model="queryParams.theFloor" style="width: 150px" @change="handleFloorChange">
<el-option v-for="item in roadwayOptions" :key="item.value" :label="item.label" :value="item.value"/> <el-option v-for="item in floorOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 排 --> <!-- 排 -->
<el-form-item label="排"> <!-- <el-form-item label="排">
<el-select v-model="queryParams.thePlatoon" style="width: 150px" @change="handlePlatoonChange"> <el-select v-model="queryParams.thePlatoon" style="width: 150px" @change="handlePlatoonChange">
<el-option v-for="item in platoonOptions" :key="item.value" :label="item.label" :value="item.value"/> <el-option v-for="item in platoonOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>-->
</el-form> </el-form>
</div> </div>
@@ -36,7 +36,7 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import {getRoadways, getPlatoons, getChartData, getChartMag} from "@/api/kpi/spacePlan" import {getRoadways, getPlatoons, getChartData, getChartMag, getFloors} from "@/api/kpi/spacePlan"
import {listWarehouse} from "@/api/bas/warehouse"; import {listWarehouse} from "@/api/bas/warehouse";
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
@@ -46,9 +46,10 @@ export default {
return { return {
// 查询参数 // 查询参数
queryParams: { queryParams: {
warehouseId: '01', warehouseId: '1',
roadwayId: '1', roadwayId: '1',
thePlatoon: '', thePlatoon: '',
theFloor: '1',
platoon: '1', platoon: '1',
specifications: '', specifications: '',
quantity_x: '', quantity_x: '',
@@ -65,6 +66,7 @@ export default {
warehouseOptions: [], warehouseOptions: [],
// 巷道选项 // 巷道选项
roadwayOptions: [], roadwayOptions: [],
floorOptions: [],
// 排号选项 // 排号选项
platoonOptions: [], platoonOptions: [],
// 图表实例 // 图表实例
@@ -116,34 +118,28 @@ this.getWarehouseList()
// 重置巷道和排号 // 重置巷道和排号
this.queryParams.roadwayId = '' this.queryParams.roadwayId = ''
this.queryParams.thePlatoon = '' this.queryParams.thePlatoon = ''
this.roadwayOptions = [] this.floorOptions = []
this.platoonOptions = [] this.platoonOptions = []
// 获取巷道列表 // 获取层数列表
getRoadways(this.queryParams).then(response => { getFloors({ warehouseId: this.queryParams.warehouseId }).then(response => {
const roadways = response.data.data const floors = response.data.data || []
if (roadways && roadways.length > 0) { if (floors && floors.length > 0) {
this.roadwayOptions = roadways this.floorOptions = floors.map(f => {
this.queryParams.roadwayId = roadways[0].value const lbl = f.label != null ? f.label : (f.name != null ? f.name : (f.title != null ? f.title : (f.value != null ? (String(f.value) + '排') : '')))
this.handleRoadwayChange() const val = f.value != null ? String(f.value) : String((lbl || '').replace(/[^\d]/g, ''))
return { label: lbl, value: val }
})
this.queryParams.theFloor = this.floorOptions[0].value
this.loadChartData()
} else {
this.floorOptions = []
this.queryParams.theFloor = null
} }
}) })
}, },
// 巷道变化处理 // 巷道变化处理
handleRoadwayChange() { handleFloorChange() {
// 重置排号 console.log( this.queryParams.theFloor)
this.queryParams.thePlatoon = ''
this.platoonOptions = []
// 获取排号列表
getPlatoons(this.queryParams).then(response => {
const platoons = response.data.data
if (platoons && platoons.length > 0) {
this.platoonOptions = platoons
this.queryParams.thePlatoon = platoons[0].value
this.loadChartData()
}
})
},
handlePlatoonChange() {
this.loadChartData() this.loadChartData()
}, },
// 加载普通仓库图表数据 // 加载普通仓库图表数据
@@ -178,10 +174,11 @@ this.getWarehouseList()
} }
}, },
title: { title: {
// 标题:库位分布平面图
text: '库位分布平面图', text: '库位分布平面图',
// 子标题:排 subtext: (() => {
subtext: this.queryParams.thePlatoon + '排' const sel = this.floorOptions.find(o => String(o.value) === String(this.queryParams.theFloor))
return sel && sel.label ? sel.label : ''
})()
}, },
grid: { grid: {
width: '90%', width: '90%',
@@ -327,35 +324,39 @@ this.getWarehouseList()
if (params.seriesName !== '满位') { if (params.seriesName !== '满位') {
// 排 // 排
if (this.$i18n.locale ==='zh-cn') { if (this.$i18n.locale ==='zh-cn') {
return params.seriesName + '<br>排' + this.queryParams.thePlatoon + '列' + (params.data[0] + 1) + '层' + (params.data[1] + 1); return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
} }
else{ else{
return params.seriesName + '<br>' + this.queryParams.thePlatoon + '排 ' + (params.data[0] + 1) + '列 ' + (params.data[1] + 1) + '层'; return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
} }
} }
const returnData = { const returnData = {
"thePlatoon": this.queryParams.thePlatoon, "thePlatoon": params.data[1] + 1,
"theColumn": params.data[0] + 1, "theColumn": params.data[0] + 1,
"theFloor": params.data[1] + 1, "theFloor": this.queryParams.theFloor,
"warehouseId": this.queryParams.warehouseId "warehouseId": this.queryParams.warehouseId
}; };
// 生成唯一标识 // 生成唯一标识
const key = `${params.seriesName}-${params.data[0]}-${params.data[1]}`; const key = `${params.seriesName}-${params.data[0]}-${params.data[1]}`;
// 如果已经在加载中,返回基本信息 // 如果已经在加载中,返回基本信息
if (this.loadingKeys && this.loadingKeys[key]) { if (this.loadingKeys && this.loadingKeys[key]) {
if (this.$i18n.locale === 'zh-cn') { if (this.$i18n.locale === 'zh-cn') {
return `${params.seriesName}<br>${this.queryParams.thePlatoon}排${params.data[0] + 1}列${params.data[1] + 1}层<br>加载中...`; return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor + '层';
} else { } else {
return `${params.seriesName}<br>${this.queryParams.thePlatoon}排 ${params.data[0] + 1}列 ${params.data[1] + 1}层<br>加载中...`; return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
} }
} }
// 返回基本信息 // 返回基本信息
const baseStr = `${params.seriesName}<br>${this.queryParams.thePlatoon}排${params.data[0] + 1}列${params.data[1] + 1}层`; const baseStr = `${params.seriesName}<br>${(params.data[1] + 1)}排${params.data[0] + 1}列${this.queryParams.theFloor}层`;
// 设置加载状态 // 设置加载状态
if (!this.loadingKeys) this.loadingKeys = {}; if (!this.loadingKeys) this.loadingKeys = {};
@@ -417,4 +418,3 @@ this.getWarehouseList()
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
} }
</style> </style>

View File

@@ -2,16 +2,16 @@
<div class="app-container"> <div class="app-container">
<!-- 主表信息录入 --> <!-- 主表信息录入 -->
<el-form :model="formData" ref="formRef" size="small" :inline="true" label-width="68px" :rules="rules"> <el-form :model="formData" ref="formRef" size="small" :inline="true" label-width="68px" :rules="rules">
<!-- <el-form-item :label="'仓库'" prop="warehouseId" required>&lt;!&ndash;仓库&ndash;&gt;-->
<!-- <el-select v-model="formData.warehouseId" :placeholder="'请选择仓库'" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in warehouseOptions"--> <el-form-item :label="'单据主题'" prop="remark"><!--客户-->
<!-- :key="dict.warehouseId"--> <el-input
<!-- :label="dict.warehouseName"--> v-model="formData.fid"
<!-- :value="dict.warehouseId"--> :placeholder="'请输入单据主题'"
<!-- />--> clearable
<!-- </el-select>--> />
<!-- </el-form-item>--> </el-form-item>
<el-form-item :label="'单据类型'" prop="outType" required><!--单据类型--> <el-form-item :label="'单据类型'" prop="outType" required><!--单据类型-->
<el-select v-model="formData.outType" :placeholder="'请选择单据类型'" clearable> <el-select v-model="formData.outType" :placeholder="'请选择单据类型'" clearable>
<el-option <el-option
@@ -21,6 +21,13 @@
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item>
<el-form-item :label="'客户名称'" prop="customerNo"><!--客户-->
<el-input
v-model="formData.customerNo"
:placeholder="'请输入客户名称'"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item :label="'备注'" prop="remark"><!--客户--> <el-form-item :label="'备注'" prop="remark"><!--客户-->
<el-input <el-input
@@ -45,76 +52,11 @@
<el-table v-loading="loading" :data="materialList"> <el-table v-loading="loading" :data="materialList">
<el-table-column label="物料编码" align="center" prop="productId" /><!--物资编号--> <el-table-column label="物料编码" align="center" prop="productId" /><!--物资编号-->
<el-table-column label="物料名称" align="center" prop="productName" /><!--物资名称--> <el-table-column label="物料名称" align="center" prop="productName" /><!--物资名称-->
<el-table-column label="批次" align="center" prop="lotNo" />
<el-table-column label="规格型号" align="center" prop="productSpec" />
<el-table-column label="管理号" align="center" prop="fid" />
<el-table-column label="供应商" align="center" prop="supplierName" />
<!-- <el-table-column label="客户编码" align="center" prop="outId" />-->
<el-table-column label="客户名称" align="center" prop="customerName" width="230">
<template slot-scope="scope">
<el-input
v-model="scope.row.customerName"
placeholder="点击选择客户"
readonly
size="mini"
@focus="openRowCustomerSelector(scope.row)"
/>
</template>
</el-table-column>
<el-table-column :label="'数量'" align="center" prop="quantity" width="150"><!--数量--> <el-table-column :label="'数量'" align="center" prop="quantity" width="150"><!--数量-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" /> <el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="spec">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spec"/>
</template>
</el-table-column>
<el-table-column label="来源" align="center" prop="unit" >
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="合同号" align="center" prop="cargoNo" />
<el-table-column label="入库单价" align="center" prop="price" />
<el-table-column label="产品质量" align="center" prop="voltage" >
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="power" />
<el-table-column label="件次" align="center" prop="phase" />
<el-table-column label="用途" align="center" prop="model" >
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="entryid" >
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.entryid"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="productUnit" />
<el-table-column label="图号" align="center" prop="productDrawNo" />
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" prop="productStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="是否启用" align="center" prop="isUsed" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isUsed"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建用户" align="center" prop="createSys" />
<el-table-column :label="'操作'" align="center" class-name="small-padding fixed-width"><!--操作--> <el-table-column :label="'操作'" align="center" class-name="small-padding fixed-width"><!--操作-->
<template slot-scope="scope"> <template slot-scope="scope">
@@ -143,55 +85,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="批次" prop="lotNo">
<el-input
v-model="queryParams.lotNo"
placeholder="请输入批次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="供应商" prop="supplierName">
<el-input
v-model="queryParams.supplierName"
placeholder="点击选择供应商"
readonly
size="small"
@focus="openSupplierSelector"
/>
</el-form-item>
<el-form-item label="管理号" prop="distribution">
<el-input
v-model="queryParams.distribution"
placeholder="请输入管理号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="合同号" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入合同号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="spec">
<el-input
v-model="queryParams.spec"
placeholder="请输入规格型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图号" prop="cargoNo">
<el-input
v-model="queryParams.cargoNo"
placeholder="请输入图号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}<!--搜索--></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}<!--搜索--></el-button>
@@ -203,63 +96,8 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="onlyIdentity" /> <el-table-column label="序号" align="center" prop="onlyIdentity" />
<el-table-column label="物料编码" align="center" prop="productId" /> <el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="批次" align="center" prop="lotNo" />
<el-table-column label="物料名称" align="center" prop="productName" /> <el-table-column label="物料名称" align="center" prop="productName" />
<el-table-column label="规格型号" align="center" prop="spec" />
<el-table-column label="图号" align="center" prop="cargoNo" />
<el-table-column label="库存数量" align="center" prop="quantity" /> <el-table-column label="库存数量" align="center" prop="quantity" />
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="来源" align="center" prop="spare1">
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="spare3">
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
</template>
</el-table-column>
<el-table-column label="用途" align="center" prop="spare4">
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare4"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="spare5" />
<el-table-column label="入库单价" align="center" prop="spare6" />
<el-table-column label="状态" align="center" prop="voltage">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="件次" align="center" prop="power" />
<!-- <el-table-column label="供应商" align="center" prop="phase" />-->
<el-table-column label="供应商" align="center" prop="supplierName" />
<el-table-column label="管理号" align="center" prop="distribution" />
<el-table-column label="合同号" align="center" prop="orderId" />
<el-table-column label="质量等级" align="center" prop="spare8">
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
</template>
</el-table-column>
<el-table-column label="单价" align="center" prop="price" />
<el-table-column label="物料状态" align="center" prop="productStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="启用标识" align="center" prop="spare7">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.spare7"/>
</template>
</el-table-column>
<el-table-column label="创建用户" align="center" prop="createSys" />
<el-table-column label="单位" align="center" prop="unit" />
</el-table> </el-table>
<pagination <pagination
@@ -417,7 +255,9 @@ export default {
customerNo: null, customerNo: null,
customerName: null, // 添加客户名称字段,用于显示 customerName: null, // 添加客户名称字段,用于显示
outType: null, outType: null,
remark:null remark:null,
fid:null,
}, },
// 仓库选项 // 仓库选项
warehouseOptions: [], warehouseOptions: [],

View File

@@ -30,14 +30,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="'客户名称'" prop="customerName">
<el-input
v-model="queryParams.customerName"
:placeholder="'请输入客户名称'"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="'物料名称'" prop="productName"> <el-form-item :label="'物料名称'" prop="productName">
<el-input <el-input
v-model="queryParams.productName" v-model="queryParams.productName"
@@ -46,24 +39,8 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="'供应商名称'" prop="supplierName">
<el-input
v-model="queryParams.supplierName"
:placeholder="'请输入供应商名称'"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="'仓库名称'" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="'请选择仓库'">
<el-option
v-for="dict in dict.type.warehouse"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="'创建时间'" prop="dateRange"> <el-form-item :label="'创建时间'" prop="dateRange">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
@@ -75,21 +52,6 @@
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item :label="'仓库'" prop="warehouseId">&lt;!&ndash;仓库&ndash;&gt;-->
<!-- <el-select-->
<!-- v-model="queryParams.warehouseId"-->
<!-- :placeholder="'请选择仓库'"-->
<!-- clearable-->
<!-- @change="handleQuery"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in warehouseOptions"-->
<!-- :key="item.warehouseId"-->
<!-- :label="item.warehouseName"-->
<!-- :value="item.warehouseId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}</el-button> <!-- 搜索 --> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}</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> <!-- 重置 -->
@@ -154,6 +116,7 @@
<el-table v-loading="loading" :data="outStockoutList" @selection-change="handleSelectionChange" @row-click="handleRowClick" max-height="400"> <el-table v-loading="loading" :data="outStockoutList" @selection-change="handleSelectionChange" @row-click="handleRowClick" max-height="400">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="'出库单编号'" align="left" prop="stockoutId" /> <!-- 出库单编号 --> <el-table-column :label="'出库单编号'" align="left" prop="stockoutId" /> <!-- 出库单编号 -->
<el-table-column :label="'出库单主题'" align="left" prop="fid" width="260" /> <!-- 出库单主题 -->
<el-table-column :label="'出库类型'" align="left" prop="outType"> <!-- 出库类型 --> <el-table-column :label="'出库类型'" align="left" prop="outType"> <!-- 出库类型 -->
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.out_bill_type" :value="scope.row.outType"/> <dict-tag :options="dict.type.out_bill_type" :value="scope.row.outType"/>
@@ -164,15 +127,17 @@
<dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/> <dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column :label="'出口'" align="left" prop="exitId" />-->
<!-- <el-table-column :label="'客户编码'" align="left" prop="customerNo" />&lt;!&ndash; 客户编码 &ndash;&gt;--> <el-table-column :label="'单据来源'" align="center" prop="stockoutSource" > <!-- 单据来源 -->
<!-- <el-table-column :label="'客户名称'" align="left" prop="customerName" />--> <template slot-scope="scope">
<el-table-column :label="'建单人'" align="left" prop="createManId" /> <!-- 建单人 --> <dict-tag :options="dict.type.bill_resource" :value="scope.row.stockoutSource"/>
<el-table-column :label="'备注'" align="center" prop="remark" /> <!-- 备注 --> </template>
</el-table-column>
<el-table-column :label="'ERP出库单编号'" align="center" prop="erpStockoutId" /> <!-- ERP出库单编号 -->
<el-table-column :label="'客户名称'" align="center" prop="customerNo" /> <!-- 客户名称 -->
<el-table-column :label="'创建时间'" align="left" prop="createDate" /><!-- 创建时间 --> <el-table-column :label="'创建时间'" align="left" prop="createDate" /><!-- 创建时间 -->
<el-table-column :label="'开始时间'" align="left" prop="startDate" /><!-- 开始时间 --> <el-table-column :label="'开始时间'" align="left" prop="startDate" /><!-- 开始时间 -->
<el-table-column :label="'确认时间'" align="left" prop="finishDate" /> <!-- 确认时间 --> <el-table-column :label="'确认时间'" align="left" prop="finishDate" /> <!-- 确认时间 -->
<!-- <el-table-column :label="'仓库名称'" align="left" prop="warehouseName" />&lt;!&ndash; 仓库名称 &ndash;&gt;-->
</el-table> </el-table>
<pagination <pagination
@@ -189,64 +154,14 @@
<el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" width="160" /> <!-- 出库子单编号 --> <el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" width="160" /> <!-- 出库子单编号 -->
<el-table-column :label="'物料编码'" align="center" prop="productId" /> <!-- 物资编码 --> <el-table-column :label="'物料编码'" align="center" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="'物料名称'" align="center" prop="productName" /> <el-table-column :label="'物料名称'" align="center" prop="productName" />
<el-table-column :label="'批次'" align="center" prop="lotNo"/><!--英文描述-->
<el-table-column label="规格型号" align="center" prop="productSpec" />
<el-table-column label="供应商" align="center" prop="supplierName" />
<el-table-column label="客户" align="center" prop="customerName" />
<el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 --> <el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 -->
<el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 --> <el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 -->
<el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 --> <el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 -->
<el-table-column :label="'入库单价'" align="center" prop="price"/><!--箱号--> <!-- <el-table-column :label="'来源'" align="center" prop="unit">
<el-table-column :label="'来源'" align="center" prop="unit">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/> <dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column :label="'状态'" align="center" prop="spec">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spec"/>
</template>
</el-table-column>
<el-table-column :label="'合同号'" align="center" prop="cargoNo" /> <!--型号-->
<el-table-column label="产品质量" align="center" prop="voltage" >
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="power" />
<el-table-column label="件次" align="center" prop="phase" />
<!-- <el-table-column label="分销" align="center" prop="distribution" />-->
<el-table-column label="用途" align="center" prop="model" >
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="entryid" >
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.entryid"/>
</template>
</el-table-column>
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="productUnit" />
<el-table-column label="图号" align="center" prop="productDrawNo" />
<el-table-column label="物料状态" align="center" prop="productStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="是否启用" align="center" prop="isUsed" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isUsed"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建用户" align="center" prop="createSys" />
</el-table> </el-table>
@@ -404,7 +319,7 @@ import {listWarehouse} from "@/api/bas/warehouse";
export default { export default {
name: "OutStockWithDetail", name: "OutStockWithDetail",
dicts: ['out_bill_type', 'out_bill_status', 'product_type', 'quality_type', 'turnover_type', 'sys_yes_no','account_type','origin_type','purpose_type','warehouse'], dicts: ['bill_resource','out_bill_type', 'out_bill_status', 'product_type', 'quality_type', 'turnover_type', 'sys_yes_no','account_type','origin_type','purpose_type','warehouse'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层

View File

@@ -422,6 +422,49 @@
<el-form-item label="价格" prop="price"> <el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" /> <el-input v-model="form.price" placeholder="请输入价格" />
</el-form-item> </el-form-item>
<!-- 新增 pd_ 明细字段显示 -->
<el-form-item label="明细ID" prop="pdDetailId">
<el-input v-model="form.pdDetailId" placeholder="请输入明细ID" />
</el-form-item>
<el-form-item label="明细产品名" prop="pdProductName">
<el-input v-model="form.pdProductName" placeholder="请输入明细产品名称" />
</el-form-item>
<el-form-item label="明细型号" prop="pdModel">
<el-input v-model="form.pdModel" placeholder="请输入明细型号" />
</el-form-item>
<el-form-item label="明细单位" prop="pdUnit">
<el-input v-model="form.pdUnit" placeholder="请输入明细单位" />
</el-form-item>
<el-form-item label="明细单价" prop="pdUnitPrice">
<el-input v-model="form.pdUnitPrice" placeholder="请输入明细单价" />
</el-form-item>
<el-form-item label="明细数量" prop="pdQuantity">
<el-input v-model="form.pdQuantity" placeholder="请输入明细数量" />
</el-form-item>
<el-form-item label="明细总价" prop="pdTotalPrice">
<el-input v-model="form.pdTotalPrice" placeholder="请输入明细总价" />
</el-form-item>
<el-form-item label="明细批号" prop="pdBatchNo">
<el-input v-model="form.pdBatchNo" placeholder="请输入明细批号" />
</el-form-item>
<el-form-item label="明细序列号" prop="pdSerialNo">
<el-input v-model="form.pdSerialNo" placeholder="请输入明细序列号" />
</el-form-item>
<el-form-item label="生产日期" prop="pdProdDate">
<el-date-picker v-model="form.pdProdDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择生产日期" />
</el-form-item>
<el-form-item label="有效日期" prop="pdValidDate">
<el-date-picker v-model="form.pdValidDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择有效日期" />
</el-form-item>
<el-form-item label="到货日期" prop="pdArrivalDate">
<el-date-picker v-model="form.pdArrivalDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择到货日期" />
</el-form-item>
<el-form-item label="明细备注" prop="pdRemark">
<el-input v-model="form.pdRemark" placeholder="请输入明细备注" />
</el-form-item>
<el-form-item label="装卸工" prop="pdLoader">
<el-input v-model="form.pdLoader" placeholder="请输入装卸工" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确定</el-button> <el-button type="primary" @click="submitForm">确定</el-button>
@@ -529,6 +572,22 @@ export default {
spec: null, spec: null,
unit: null, unit: null,
price: null price: null
,
// pd_ 明细字段
pdDetailId: null,
pdProductName: null,
pdModel: null,
pdUnit: null,
pdUnitPrice: null,
pdQuantity: null,
pdTotalPrice: null,
pdBatchNo: null,
pdSerialNo: null,
pdProdDate: null,
pdValidDate: null,
pdArrivalDate: null,
pdRemark: null,
pdLoader: null
} }
this.resetForm("form") this.resetForm("form")
}, },

View File

@@ -60,6 +60,8 @@
<!-- <el-table-column label="库存编码" align="center" prop="stockId" /> &lt;!&ndash; 库存编码 &ndash;&gt;--> <!-- <el-table-column label="库存编码" align="center" prop="stockId" /> &lt;!&ndash; 库存编码 &ndash;&gt;-->
<el-table-column label="货位编码" align="left" prop="cargoSpaceId" /> <!-- 货位编码 --> <el-table-column label="货位编码" align="left" prop="cargoSpaceId" /> <!-- 货位编码 -->
<el-table-column label="货位名称" align="left" prop="cargoSpaceName" /> <!-- 货位名称 --> <el-table-column label="货位名称" align="left" prop="cargoSpaceName" /> <!-- 货位名称 -->
<!-- <el-table-column label="单位名称" align="left" prop="unitName" />
<el-table-column label="产品型号" align="left" prop="productModel" /> -->
<!-- <el-table-column label="托盘条码" align="left" prop="trayCode" /> &lt;!&ndash; 托盘条码 &ndash;&gt;--> <!-- <el-table-column label="托盘条码" align="left" prop="trayCode" /> &lt;!&ndash; 托盘条码 &ndash;&gt;-->
<el-table-column label="原库位状态" align="left" prop="oldStatus" > <el-table-column label="原库位状态" align="left" prop="oldStatus" >
<template slot-scope="scope"> <template slot-scope="scope">

View File

@@ -1,54 +1,16 @@
<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="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库" prop="warehouseId"><!--仓库-->
<el-select <el-form-item label="库存编码" prop="stockId">
v-model="queryParams.warehouseId" <el-input
placeholder="请选择仓库" v-model="queryParams.stockId"
placeholder="请输入库存编码"
clearable clearable
@change="handleQuery" @keyup.enter.native="handleQuery"
>
<el-option
v-for="item in warehouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="巷道" prop="roadwayId">
<el-input
v-model="queryParams.roadwayId"
placeholder="请输入巷道"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="层" prop="theFloor">
<el-input
v-model="queryParams.theFloor"
placeholder="请输入层"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="排" prop="thePlatoon">
<el-input
v-model="queryParams.thePlatoon"
placeholder="请输入排"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="列" prop="theColumn">
<el-input
v-model="queryParams.theColumn"
placeholder="请输入列"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="productId"> <el-form-item label="物料编码" prop="productId">
<el-input <el-input
v-model="queryParams.productId" v-model="queryParams.productId"
@@ -57,38 +19,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="规格型号" prop="spec">
<el-input
v-model="queryParams.spec"
placeholder="请输入规格型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="常用编码" prop="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入常用编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="供应代号" prop="supplierId">
<el-input
v-model="queryParams.supplierId"
placeholder="请输入供应商代号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="供应名称" prop="supplierName">
<el-input
v-model="queryParams.supplierName"
placeholder="请输入供应商名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="productName"> <el-form-item label="物料名称" prop="productName">
<el-input <el-input
v-model="queryParams.productName" v-model="queryParams.productName"
@@ -97,22 +28,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="入库单号" prop="stockinId">
<el-input
v-model="queryParams.stockinId"
placeholder="请输入入库单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单价" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入单价"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="托盘号" prop="trayCode"> <el-form-item label="托盘号" prop="trayCode">
<el-input <el-input
@@ -122,105 +37,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="合同号" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入合同号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用途" prop="spare4">
<el-select v-model="queryParams.spare4" placeholder="请选择用途" clearable>
<el-option
v-for="dict in dict.type.purpose_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="起始时间" prop="inDateStart">
<el-date-picker clearable
v-model="queryParams.inDateStart"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择起始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="截止日期" prop="inDateEnd">
<el-date-picker clearable
v-model="queryParams.inDateEnd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择截止时间">
</el-date-picker>
</el-form-item>
<el-form-item label="周转类型" prop="voltage">
<el-select v-model="queryParams.voltage" placeholder="请选择周转类型" clearable>
<el-option
v-for="dict in dict.type.turnover_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="来源" prop="spare1">
<el-select v-model="queryParams.spare1" placeholder="请选择来源" clearable>
<el-option
v-for="dict in dict.type.origin_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="套账" prop="spare3">
<el-select v-model="queryParams.spare3" placeholder="请选择套账" clearable>
<el-option
v-for="dict in dict.type.account_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="形态类型" prop="productType">
<el-select v-model="queryParams.productType" placeholder="请选择形态类型" clearable>
<el-option
v-for="dict in dict.type.product_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="台次" prop="spare5">
<el-input
v-model="queryParams.spare5"
placeholder="请输入台次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="件次" prop="power">
<el-input
v-model="queryParams.power"
placeholder="请输入件次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库外" prop="outside">
<el-input
v-model="queryParams.outside"
placeholder="请输入库外"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><!-- 搜索 --> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><!-- 搜索 -->
@@ -272,77 +88,13 @@
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/> <dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="套账" align="center" prop="spare3">
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
</template>
</el-table-column>
<el-table-column label="库位编码" align="center" prop="cargoSpaceId" width="160"/> <el-table-column label="库位编码" align="center" prop="cargoSpaceId" width="160"/>
<el-table-column label="托盘" align="center" prop="trayCode"/> <el-table-column label="托盘" align="center" prop="trayCode"/>
<el-table-column label="产品编码" align="center" prop="productId"/> <el-table-column label="产品编码" align="center" prop="productId"/>
<el-table-column label="产品名称" align="center" prop="productName" width="160" /> <el-table-column label="产品名称" align="center" prop="productName" width="160" />
<el-table-column label="规格" align="center" prop="spec" width="160"/> <el-table-column label="库存数量" align="center" prop="quantity" width="160" />
<el-table-column label="数量" align="center" prop="quantity"/> <el-table-column label="入库时间" align="center" prop="inDate" width="160" />
<el-table-column label="单价" align="center" prop="price"/>
<el-table-column label="金额" align="center" prop="spare6"/>
<el-table-column label="产品状态" align="center" prop="productType">
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productType"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="图号" align="center" prop="cargoNo"/>
<el-table-column label="合同号" align="center" prop="orderId"/>
<el-table-column label="台次" align="center" prop="spare5"/>
<el-table-column label="件次" align="center" prop="power"/>
<el-table-column label="质量" align="center" prop="spare8">
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId"/>
<el-table-column label="入库单号" align="center" prop="stockinId" width="160"/>
<el-table-column label="供应商编码" align="center" prop="supplierId" width="160"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" width="160"/>
<el-table-column label="仓库编码" align="center" prop="warehouseId"/>
<el-table-column label="仓库名称" align="center" prop="warehouseName"/>
<el-table-column label="首次入库时间" align="center" prop="inDate" width="160"/>
<el-table-column label="最后出库时间" align="center" prop="stackingId" width="160"/>
<el-table-column label="盘点标识" align="center" prop="spare7">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_flag" :value="scope.row.spare7"/>
</template>
</el-table-column>
<el-table-column label="盘点时间" align="center" prop="backDate" width="160"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="来源" align="center" prop="spare4">
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare4"/>
</template>
</el-table-column>
<el-table-column label="用途" align="center" prop="spare1">
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare1"/>
</template>
</el-table-column>
<el-table-column width=120 label="操作" align="center" class-name="small-padding fixed-width"> <!-- 操作 -->
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['stock:management:edit']"
>修改 <!-- 修改 --></el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['stock:management:remove']"
>删除 <!-- 删除 --></el-button>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
@@ -406,6 +158,8 @@
<el-input v-model="form.quantity" placeholder="请输入库存数量" /> <el-input v-model="form.quantity" placeholder="请输入库存数量" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确定 <!-- 确定 --></el-button> <el-button type="primary" @click="submitForm">确定 <!-- 确定 --></el-button>
@@ -579,6 +333,12 @@ export default {
inDate: null, inDate: null,
backDate: null, backDate: null,
productGuid: null, productGuid: null,
pdModel: null,
pdUnit: null,
pdUnitPrice: null,
pdQuantity: null,
pdTotalPrice: null,
pdProdDate: null,
quantity: null, quantity: null,
jobId: null, jobId: null,
trayCode: null, trayCode: null,
@@ -596,7 +356,12 @@ export default {
spare5: null, spare5: null,
spare6: null, spare6: null,
theFloor: null, theFloor: null,
cargoSpaceStockStatus:2 pdProductName: null,
pdBatchNo: null,
pdSerialNo: null,
cargoSpaceStockStatus:2,
productId:null,
productName:null
}, },
queryWarehouse: { queryWarehouse: {
pageNum:1, pageNum:1,
@@ -691,10 +456,63 @@ export default {
spare3: null, spare3: null,
spare4: null, spare4: null,
spare5: null, spare5: null,
spare6: null spare6: null,
// SQL 新增字段
Rows: null,
Title: null,
Kuin: null,
Complete1: null,
Cateid: null,
Date3: null,
Date5: null,
Catein: null,
Intro2: null,
Intro: null,
Caigou: null,
Date7: null,
Kg: null,
Sort1: null,
Rkbh: null,
Status: null,
KuinList: null,
sysIcusIInheritIdIidI413: null,
sysIcusIInheritIdIidI414: null,
sysIcusIInheritIdIidI415: null,
// pd_ 明细字段
pdDetailId: null,
pdProductName: null,
pdModel: null,
pdUnit: null,
pdUnitPrice: null,
pdAuxUnit: null,
pdAttr1: null,
pdAttr2: null,
pdQuantity: null,
pdInQty: null,
pdAuxQuantity: null,
pdTotalPrice: null,
pdCostUnitPrice: null,
pdTotalPrice2: null,
pdAccountCostTotal: null,
pdAccountQuantity: null,
pdAccountStatus: null,
pdBatchNo: null,
pdSerialNo: null,
pdProdDate: null,
pdValidDate: null,
pdArrivalDate: null,
pdRemark: null,
pdCustom1: null,
pdCustom2: null,
pdCustom3: null,
pdCustom4: null,
pdCustom5: null,
pdCustom6: null,
pdLoader: null
} }
this.resetForm("form") this.resetForm("form")
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1

View File

@@ -92,6 +92,8 @@
<el-table-column label="初始物品名称" align="left" prop="productGuid" /> <!-- 托盘条码 --> <el-table-column label="初始物品名称" align="left" prop="productGuid" /> <!-- 托盘条码 -->
<el-table-column label="操作后物品编码" align="left" prop="productId" /> <!-- 物品编码 --> <el-table-column label="操作后物品编码" align="left" prop="productId" /> <!-- 物品编码 -->
<el-table-column label="操作后物品名称" align="left" prop="productName" /> <!-- 物品名称 --> <el-table-column label="操作后物品名称" align="left" prop="productName" /> <!-- 物品名称 -->
<el-table-column label="单位名称" align="left" prop="unitName" />
<el-table-column label="产品型号" align="left" prop="productModel" />
<el-table-column label="初始数量" align="right" prop="oldQuantity" /> <!-- 初始数量 --> <el-table-column label="初始数量" align="right" prop="oldQuantity" /> <!-- 初始数量 -->
<el-table-column label="操作后数量" align="right" prop="quantity" /> <!-- 操作后数量 --> <el-table-column label="操作后数量" align="right" prop="quantity" /> <!-- 操作后数量 -->
<el-table-column label="操作" align="left" prop="method"> <!-- 操作 --> <el-table-column label="操作" align="left" prop="method"> <!-- 操作 -->

View File

@@ -0,0 +1,523 @@
/*
T-SQL 脚本:在 dbo.bas_stock 表中添加用户要求的字段(保留字段名,不修改名称)
说明:每个列在添加前会检查是否已存在,避免重复添加导致错误。
请在 SQL Server 管理工具(如 SSMS)中对目标数据库运行本脚本。
*/
-- 确认表存在
IF OBJECT_ID('dbo.bas_stock','U') IS NULL
BEGIN
RAISERROR('Table dbo.bas_stock does not exist in current database.',16,1)
RETURN
END
GO
-- 1) Rows: 集合数据(存 JSON 或序列化内容)
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Rows')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Rows] NVARCHAR(MAX) NULL;
END
GO
-- 2) Title: 入库主题
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Title')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Title] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 3) Kuin: 入库id
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Kuin')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Kuin] VARCHAR(80) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 4) Complete1: 入库状态
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Complete1')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Complete1] VARCHAR(50) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 5) Cateid: 申请人
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Cateid')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Cateid] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 6) Date3: 申请日期
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Date3')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Date3] DATETIME2(7) NULL;
END
GO
-- 7) Date5: 确认日期
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Date5')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Date5] DATETIME2(7) NULL;
END
GO
-- 8) Catein: 审批人
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Catein')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Catein] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 9) Intro2: 审批意见(较长文本)
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Intro2')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Intro2] NVARCHAR(MAX) NULL;
END
GO
-- 10) Intro: 入库备注(较长文本)
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Intro')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Intro] NVARCHAR(MAX) NULL;
END
GO
-- 11) Caigou: 关联其他单据id
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Caigou')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Caigou] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 12) Date7: 添加时间
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Date7')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Date7] DATETIME2(7) NULL;
END
GO
-- 13) Kg: 库管id
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Kg')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Kg] VARCHAR(80) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 14) Sort1: 入库类别
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Sort1')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Sort1] VARCHAR(100) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 15) Rkbh: 入库编号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Rkbh')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Rkbh] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 16) Status: 审批状态
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'Status')
BEGIN
ALTER TABLE dbo.bas_stock ADD [Status] VARCHAR(50) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 17) KuinList: 产品明细(集合/JSON)
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'KuinList')
BEGIN
ALTER TABLE dbo.bas_stock ADD [KuinList] NVARCHAR(MAX) NULL;
END
GO
-- 18) sysIcusIInheritIdIidI413: 客户名称
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'sysIcusIInheritIdIidI413')
BEGIN
ALTER TABLE dbo.bas_stock ADD [sysIcusIInheritIdIidI413] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 19) sysIcusIInheritIdIidI414: 磅单编号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'sysIcusIInheritIdIidI414')
BEGIN
ALTER TABLE dbo.bas_stock ADD [sysIcusIInheritIdIidI414] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 20) sysIcusIInheritIdIidI415: 入库车号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'sysIcusIInheritIdIidI415')
BEGIN
ALTER TABLE dbo.bas_stock ADD [sysIcusIInheritIdIidI415] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 为新字段添加列注释(extended properties)
-- 仅在列存在时添加,避免重复报错
IF COL_LENGTH('dbo.bas_stock','Rows') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'集合数据(JSON/序列化)', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Rows';
IF COL_LENGTH('dbo.bas_stock','Title') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库主题', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Title';
IF COL_LENGTH('dbo.bas_stock','Kuin') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库id', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Kuin';
IF COL_LENGTH('dbo.bas_stock','Complete1') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库状态', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Complete1';
IF COL_LENGTH('dbo.bas_stock','Cateid') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'申请人', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Cateid';
IF COL_LENGTH('dbo.bas_stock','Date3') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'申请日期', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Date3';
IF COL_LENGTH('dbo.bas_stock','Date5') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'确认日期', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Date5';
IF COL_LENGTH('dbo.bas_stock','Catein') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'审批人', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Catein';
IF COL_LENGTH('dbo.bas_stock','Intro2') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'审批意见', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Intro2';
IF COL_LENGTH('dbo.bas_stock','Intro') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库备注', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Intro';
IF COL_LENGTH('dbo.bas_stock','Caigou') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'关联其他单据id', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Caigou';
IF COL_LENGTH('dbo.bas_stock','Date7') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Date7';
IF COL_LENGTH('dbo.bas_stock','Kg') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'库管id', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Kg';
IF COL_LENGTH('dbo.bas_stock','Sort1') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库类别', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Sort1';
IF COL_LENGTH('dbo.bas_stock','Rkbh') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库编号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Rkbh';
IF COL_LENGTH('dbo.bas_stock','Status') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'审批状态', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'Status';
IF COL_LENGTH('dbo.bas_stock','KuinList') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'产品明细(JSON/集合)', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'KuinList';
IF COL_LENGTH('dbo.bas_stock','sysIcusIInheritIdIidI413') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'客户名称', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'sysIcusIInheritIdIidI413';
IF COL_LENGTH('dbo.bas_stock','sysIcusIInheritIdIidI414') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'磅单编号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'sysIcusIInheritIdIidI414';
IF COL_LENGTH('dbo.bas_stock','sysIcusIInheritIdIidI415') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库车号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'sysIcusIInheritIdIidI415';
-- 完成
PRINT 'Columns processed and extended properties added. Review messages above for any errors.'
GO
-- ==================================================
-- 追加:从产品明细 JSON 中筛选的字段,添加到 bas_stock 表
-- 列名前缀使用 pd_ (product detail),保留中文注释为 extended property
-- ==================================================
-- pd_detail_id: 入库明细ID
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_detail_id')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_detail_id] BIGINT NULL;
END
GO
-- pd_product_name: 产品名称
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_product_name')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_product_name] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_model: 型号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_model')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_model] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_unit: 单位
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_unit')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_unit] VARCHAR(50) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_unit_price: 单价
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_unit_price')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_unit_price] NUMERIC(18,6) NULL;
END
GO
-- pd_aux_unit: 辅助单位
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_aux_unit')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_aux_unit] VARCHAR(50) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_attr1: 产品属性1
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_attr1')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_attr1] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_attr2: 产品属性2
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_attr2')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_attr2] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_quantity: 数量
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_quantity')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_quantity] NUMERIC(18,6) NULL;
END
GO
-- pd_in_qty: 入库数
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_in_qty')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_in_qty] NUMERIC(18,6) NULL;
END
GO
-- pd_aux_quantity: 辅助数量
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_aux_quantity')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_aux_quantity] NUMERIC(18,6) NULL;
END
GO
-- pd_total_price: 总价
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_total_price')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_total_price] NUMERIC(18,6) NULL;
END
GO
-- pd_cost_unit_price: 成本单价
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_cost_unit_price')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_cost_unit_price] NUMERIC(18,6) NULL;
END
GO
-- pd_total_price_2: 总价(重复字段,保留第二项)
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_total_price_2')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_total_price_2] NUMERIC(18,6) NULL;
END
GO
-- pd_account_cost_total: 核算成本总价
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_account_cost_total')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_account_cost_total] NUMERIC(18,6) NULL;
END
GO
-- pd_account_quantity: 核算数量
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_account_quantity')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_account_quantity] NUMERIC(18,6) NULL;
END
GO
-- pd_account_status: 核算状态
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_account_status')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_account_status] VARCHAR(50) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_batch_no: 批号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_batch_no')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_batch_no] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_serial_no: 序列号
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_serial_no')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_serial_no] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_prod_date: 生产日期
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_prod_date')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_prod_date] DATETIME2(7) NULL;
END
GO
-- pd_valid_date: 有效日期
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_valid_date')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_valid_date] DATETIME2(7) NULL;
END
GO
-- pd_arrival_date: 到货日期
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_arrival_date')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_arrival_date] DATETIME2(7) NULL;
END
GO
-- pd_remark: 备注
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_remark')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_remark] NVARCHAR(MAX) NULL;
END
GO
-- pd_custom1..pd_custom6: 自定义1..6
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom1')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom1] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom2')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom2] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom3')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom3] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom4')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom4] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom5')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom5] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_custom6')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_custom6] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- pd_loader: 装卸工
IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE [object_id] = OBJECT_ID('dbo.bas_stock') AND name = 'pd_loader')
BEGIN
ALTER TABLE dbo.bas_stock ADD [pd_loader] VARCHAR(255) COLLATE Chinese_PRC_CI_AS NULL;
END
GO
-- 为上述 pd_ 字段添加 extended properties 注释
IF COL_LENGTH('dbo.bas_stock','pd_detail_id') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库明细ID', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_detail_id';
IF COL_LENGTH('dbo.bas_stock','pd_product_name') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'产品名称', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_product_name';
IF COL_LENGTH('dbo.bas_stock','pd_model') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'型号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_model';
IF COL_LENGTH('dbo.bas_stock','pd_unit') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'单位', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_unit';
IF COL_LENGTH('dbo.bas_stock','pd_unit_price') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'单价', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_unit_price';
IF COL_LENGTH('dbo.bas_stock','pd_aux_unit') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'辅助单位', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_aux_unit';
IF COL_LENGTH('dbo.bas_stock','pd_attr1') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'产品属性1', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_attr1';
IF COL_LENGTH('dbo.bas_stock','pd_attr2') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'产品属性2', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_attr2';
IF COL_LENGTH('dbo.bas_stock','pd_quantity') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'数量', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_quantity';
IF COL_LENGTH('dbo.bas_stock','pd_in_qty') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'入库数', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_in_qty';
IF COL_LENGTH('dbo.bas_stock','pd_aux_quantity') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'辅助数量', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_aux_quantity';
IF COL_LENGTH('dbo.bas_stock','pd_total_price') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'总价', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_total_price';
IF COL_LENGTH('dbo.bas_stock','pd_cost_unit_price') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'成本单价', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_cost_unit_price';
IF COL_LENGTH('dbo.bas_stock','pd_total_price_2') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'总价(重复项)', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_total_price_2';
IF COL_LENGTH('dbo.bas_stock','pd_account_cost_total') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'核算成本总价', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_account_cost_total';
IF COL_LENGTH('dbo.bas_stock','pd_account_quantity') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'核算数量', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_account_quantity';
IF COL_LENGTH('dbo.bas_stock','pd_account_status') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'核算状态', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_account_status';
IF COL_LENGTH('dbo.bas_stock','pd_batch_no') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'批号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_batch_no';
IF COL_LENGTH('dbo.bas_stock','pd_serial_no') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'序列号', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_serial_no';
IF COL_LENGTH('dbo.bas_stock','pd_prod_date') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'生产日期', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_prod_date';
IF COL_LENGTH('dbo.bas_stock','pd_valid_date') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'有效日期', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_valid_date';
IF COL_LENGTH('dbo.bas_stock','pd_arrival_date') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'到货日期', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_arrival_date';
IF COL_LENGTH('dbo.bas_stock','pd_remark') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_remark';
IF COL_LENGTH('dbo.bas_stock','pd_custom1') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义1', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom1';
IF COL_LENGTH('dbo.bas_stock','pd_custom2') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义2', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom2';
IF COL_LENGTH('dbo.bas_stock','pd_custom3') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义3', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom3';
IF COL_LENGTH('dbo.bas_stock','pd_custom4') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义4', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom4';
IF COL_LENGTH('dbo.bas_stock','pd_custom5') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义5', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom5';
IF COL_LENGTH('dbo.bas_stock','pd_custom6') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'自定义6', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_custom6';
IF COL_LENGTH('dbo.bas_stock','pd_loader') IS NOT NULL
EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'装卸工', @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bas_stock', @level2type=N'COLUMN',@level2name=N'pd_loader';
PRINT 'Product-detail columns appended and comments added.'
GO

View File

@@ -0,0 +1,120 @@
/*
* 脚本说明:
* 1. 创建新表 bas_stock_product_inventory (产品维度汇总) 和 bas_stock_inventory_detail (明细维度,解析 JSON 或映射原表)。
* 2. 创建视图 v_bas_stock_mapping,将 bas_stock 原表字段映射到新业务语义。
* 3. 提供 ETL 存储过程,用于从 bas_stock 同步数据到新表(示例逻辑)。
*
* 修改说明:
* - 修正 model 映射为 product_model (原逻辑误映射为 unit_name)
* - 修正 unit_name 映射为 bas_product.unit (原逻辑误映射为 model)
*/
-- =============================================
-- 1. 创建新表:库存明细表 (对应接口 rows / cklist 解析后的结构)
-- =============================================
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[bas_stock_inventory_detail]') AND type in (N'U'))
DROP TABLE [dbo].[bas_stock_inventory_detail];
GO
CREATE TABLE [dbo].[bas_stock_inventory_detail](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[stock_id] [varchar](32) NULL, -- 关联原表 bas_stock.stock_id
[product_code] [varchar](255) NULL, -- 对应 bas_stock.product_id / 接口 order1
[product_name] [varchar](255) NULL, -- 对应 bas_stock.product_name / 接口 title
[product_model] [varchar](255) NULL, -- 对应 bas_stock.model / 接口 type1
[warehouse_name] [varchar](200) NULL, -- 需关联 bas_warehouse 或从 JSON 解析
[location_name] [varchar](200) NULL, -- 需关联 bas_cargo_space 或从 JSON 解析
[unit_name] [varchar](50) NULL, -- 接口 unitname
[quantity] [numeric](18, 3) DEFAULT 0, -- 对应 bas_stock.quantity
[ratio] [numeric](18, 6) DEFAULT 1.0, -- 换算比例
[detail_json] [nvarchar](max) NULL, -- 原始 JSON 数据 (cklist)
[sync_time] [datetime2](7) DEFAULT SYSUTCDATETIME(),
CONSTRAINT [PK_bas_stock_inventory_detail] PRIMARY KEY CLUSTERED ([id] ASC)
);
GO
-- =============================================
-- 2. 创建新表:产品库存汇总表 (对应接口外层列表)
-- =============================================
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[bas_stock_product_inventory]') AND type in (N'U'))
DROP TABLE [dbo].[bas_stock_product_inventory];
GO
CREATE TABLE [dbo].[bas_stock_product_inventory](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[product_ord] [int] NULL, -- 接口 ord
[product_code] [varchar](255) NULL, -- product_id
[product_name] [varchar](255) NULL, -- product_name
[product_model] [varchar](255) NULL, -- model
[total_quantity] [numeric](18, 3) DEFAULT 0,
[unit_name] [varchar](50) NULL,
[warehouse_stock_json] [nvarchar](max) NULL, -- 存储 cklist JSON 字符串
[updated_time] [datetime2](7) DEFAULT SYSUTCDATETIME(),
CONSTRAINT [PK_bas_stock_product_inventory] PRIMARY KEY CLUSTERED ([id] ASC)
);
GO
-- =============================================
-- 3. 创建视图:映射 bas_stock 到新语义 (含关联)
-- =============================================
IF OBJECT_ID('dbo.v_bas_stock_mapping', 'V') IS NOT NULL
DROP VIEW dbo.v_bas_stock_mapping;
GO
CREATE VIEW [dbo].[v_bas_stock_mapping] AS
SELECT
s.stock_id,
s.product_id AS product_code,
s.product_name,
-- 修正:unit_name 取自 bas_product.unit
ISNULL(p.unit, '个') AS unit_name,
-- 修正:model 映射为 product_model
ISNULL(s.model, '') AS product_model,
s.quantity,
s.warehouse_id,
ISNULL(w.warehouse_name, '未知仓库') AS warehouse_name,
s.cargo_space_id,
ISNULL(c.cargo_space_name, '未知库位') AS location_name,
s.lot_no,
s.in_date
FROM dbo.bas_stock s
LEFT JOIN dbo.bas_warehouse w ON s.warehouse_id = w.warehouse_id
LEFT JOIN dbo.bas_cargo_space c ON s.cargo_space_id = c.cargo_space_id
LEFT JOIN dbo.bas_product p ON s.product_id = p.product_id;
GO
-- =============================================
-- 4. ETL 脚本:从 bas_stock 全量刷新到明细表
-- =============================================
-- 清空明细表
TRUNCATE TABLE dbo.bas_stock_inventory_detail;
-- 插入数据
INSERT INTO dbo.bas_stock_inventory_detail
(stock_id, product_code, product_name, product_model, unit_name, quantity, warehouse_name, location_name)
SELECT
stock_id,
product_code,
product_name,
product_model,
unit_name,
quantity,
warehouse_name,
location_name
FROM dbo.v_bas_stock_mapping;
-- =============================================
-- 5. ETL 脚本:生成汇总表数据 (简单聚合示例)
-- =============================================
TRUNCATE TABLE dbo.bas_stock_product_inventory;
INSERT INTO dbo.bas_stock_product_inventory
(product_code, product_name, product_model, unit_name, total_quantity)
SELECT
product_code,
MAX(product_name),
MAX(product_model),
MAX(unit_name),
SUM(quantity)
FROM dbo.bas_stock_inventory_detail
GROUP BY product_code;