出库部分

This commit is contained in:
张怡蓉
2025-06-06 11:29:34 +08:00
parent 85d08f8a32
commit 8eecfa8aac
19 changed files with 433 additions and 49 deletions

View File

@@ -96,4 +96,15 @@ public class BasWarehouseController extends BaseController
{
return toAjax(basWarehouseService.deleteBasWarehouseByWarehouseIds(warehouseIds));
}
/**
* 获取除了CTU以外的库
*/
@RequestMapping("/getWarehouseByType")
@ResponseBody
public AjaxResult getWarehouseByType()
{
List<BasWarehouse> list = basWarehouseService.selectBasWarehouseListByType();
return AjaxResult.success(list);
}
}

View File

@@ -59,4 +59,10 @@ public interface BasWarehouseMapper
* @return 结果
*/
public int deleteBasWarehouseByWarehouseIds(String[] warehouseIds);
/**
*
*/
public List<BasWarehouse> selectBasWarehouseListByType();
}

View File

@@ -59,4 +59,9 @@ public interface IBasWarehouseService
* @return 结果
*/
public int deleteBasWarehouseByWarehouseId(String warehouseId);
/**
*
*/
public List<BasWarehouse> selectBasWarehouseListByType();
}

View File

@@ -6,6 +6,7 @@ import com.ruoyi.bas.warehouse.service.IBasWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
@@ -91,4 +92,12 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
{
return basWarehouseMapper.deleteBasWarehouseByWarehouseId(warehouseId);
}
/**
*
*/
@Override
public List<BasWarehouse> selectBasWarehouseListByType() {
return basWarehouseMapper.selectBasWarehouseListByType();
}
}

View File

@@ -81,6 +81,45 @@ public class OutStockout extends BaseEntity
@Excel(name = "确认时间")
private String finishDate;
private String customerName;
private String warehouseName;
private String productId;
private String productName;
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getStartDate() {
return startDate;

View File

@@ -83,6 +83,27 @@ public class OutStockoutFinish extends BaseEntity
@Excel(name = "完成时间")
private String finishDate;
private String customerName;
private String warehouseName;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public void setStockoutGuid(String stockoutGuid)
{
this.stockoutGuid = stockoutGuid;

View File

@@ -0,0 +1,59 @@
package com.ruoyi.pda.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.in.stockin.domain.InStockin;
import com.ruoyi.in.stockin.service.IInStockinService;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.service.PdaService;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import static com.ruoyi.common.utils.PageUtils.startPage;
@Controller
@RequestMapping("/pda")
public class PdaController extends BaseController {
@Autowired
private PdaService pdaService;
@Autowired
private IInStockinService inStockinService;
/**
* 空托盘入库
* @param trayCodeMsg
* @return
*/
@RequestMapping("/emptyTrayIn")
@ResponseBody
public AjaxResult emptyTrayIn(@RequestBody TrayCodeMsg trayCodeMsg) {
AjaxResult ajaxResult = pdaService.emptyTrayIn(trayCodeMsg);
return ajaxResult;
}
/**
* 空料箱入库
*/
@RequestMapping("/emptyBoxIn")
@ResponseBody
public AjaxResult emptyBoxIn(@RequestBody TrayCodeMsg trayCodeMsg) {
AjaxResult ajaxResult = pdaService.emptyBoxIn(trayCodeMsg);
return ajaxResult;
}
@RequestMapping("/inorder/list")
@ResponseBody
public TableDataInfo inoderList(InStockin stockin) {
startPage();
List<InStockin> stockins = inStockinService.selectInStockinList(stockin);
return getDataTable(stockins);
}
}

View File

@@ -0,0 +1,44 @@
package com.ruoyi.pda.domain;
public class TrayCodeMsg {
private String trayCode;
private String warehouseId;
private String quantity;
private String entranceId;
public String getEntranceId() {
return entranceId;
}
public void setEntranceId(String entranceId) {
this.entranceId = entranceId;
}
public String getTrayCode() {
return trayCode;
}
public void setTrayCode(String trayCode) {
this.trayCode = trayCode;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
}

View File

@@ -0,0 +1,10 @@
package com.ruoyi.pda.mapper;
import java.util.HashMap;
public interface PdaMapper {
void emptyTrayIn(HashMap<String, Object> map);
void emptyBoxIn(HashMap<String, Object> map);
}

View File

@@ -0,0 +1,11 @@
package com.ruoyi.pda.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.pda.domain.TrayCodeMsg;
public interface PdaService {
public AjaxResult emptyTrayIn(TrayCodeMsg trayCodeMsg);
public AjaxResult emptyBoxIn(TrayCodeMsg trayCodeMsg);
}

View File

@@ -0,0 +1,67 @@
package com.ruoyi.pda.service;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.mapper.PdaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
public class PdaServiceImp implements PdaService{
@Autowired
PdaMapper pdaMapper;
@Autowired
IBasCargoSpaceService basCargoSpaceService;
/**
* 空托盘入库
* @param trayCodeMsg
* @return
*/
@Override
public AjaxResult emptyTrayIn(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMsg.getTrayCode());
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
map.put("v_quantity", "1");
pdaMapper.emptyTrayIn(map);
String result = (String) map.get("v_result");
String cargoSpaceId = map.get("v_cargo_space_id").toString();
if(StrUtil.isNotEmpty(cargoSpaceId)){
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(cargoSpaceId);
map.put("v_cargo_space_id", basCargoSpace.getCargoSpaceName());
}
if("10".equals(result)){
return AjaxResult.success(map);
}else{
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
/**
* 空料箱入库
* @param trayCodeMsg
* @return
*/
@Override
public AjaxResult emptyBoxIn(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMsg.getTrayCode());
map.put("v_entrance_id", trayCodeMsg.getEntranceId());
pdaMapper.emptyBoxIn(map);
String result = (String) map.get("v_result");
if("10".equals(result)){
return AjaxResult.success(map.get("v_resultmsg").toString());
}else{
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
}

View File

@@ -253,4 +253,6 @@ public class SysUserController extends BaseController
{
return success(deptService.selectDeptTreeList(dept));
}
}

View File

@@ -91,4 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{warehouseId}
</foreach>
</delete>
<select id="selectBasWarehouseListByType" resultMap="BasWarehouseResult">
<include refid="selectBasWarehouseVo"/>
where warehouse_type in (1,3)
</select>
</mapper>

View File

@@ -206,7 +206,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectOutStockoutDetailFinishListByStockoutGuid" parameterType="string" resultMap="OutStockoutDetailFinishResult">
<include refid="selectOutStockoutDetailFinishVo"/>
select d.stockout_detail_id, d.stockout_guid, d.stockout_id, d.lot_no, d.product_guid, d.product_id, d.quantity, d.quantity_x,
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, p.product_name, d.supplier_id, d.cargo_no, d.create_time, d.print_date from out_stockout_detail_finish d
left join bas_product p on d.product_id = p.product_id
where stockout_guid = #{stockoutGuid}
</select>
</mapper>

View File

@@ -206,7 +206,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectOutStockoutDetailByStockoutGuid" parameterType="string" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
where stockout_guid = #{stockoutGuid}
select d.stockout_detail_id, d.stockout_guid, d.stockout_id, d.lot_no, d.product_guid, d.product_id, d.quantity, d.quantity_x,
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, p.product_name, d.supplier_id, d.cargo_no, d.create_time, d.print_date from out_stockout_detail d
left join bas_product p on d.product_id = p.product_id
where d.stockout_guid = #{stockoutGuid}
</select>
</mapper>

View File

@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpStockoutId" column="erp_stockout_id" />
<result property="startDate" column="start_date" />
<result property="finishDate" column="finish_date" />
<result property="warehouseName" column="warehouse_name" />
<result property="customerName" column="customer_name" />
</resultMap>
<sql id="selectOutStockoutFinishVo">
@@ -133,25 +135,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectOutStockoutFinishListByOutStockout" parameterType="OutStockout" resultMap="OutStockoutFinishResult">
<include refid="selectOutStockoutFinishVo"/>
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.warehouse_id, o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,bw.warehouse_name,bc.customer_name from out_stockout_finish o
left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id
left join bas_customer bc on bc.customer_no = o.customer_no
left join out_stockout_detail_finish d on d.stockout_id = o.stockout_id
left join bas_product bp on bp.product_id = d.product_id
<where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
<if test="carNumber != null and carNumber != ''"> and car_number = #{carNumber}</if>
<if test="FID != null and FID != ''"> and FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and erp_stockout_id = #{erpStockoutId}</if>
<if test="startDate != null and startDate != ''"> and start_date = #{startDate}</if>
<if test="finishDate != null and finishDate != ''"> and finish_date = #{finishDate}</if>
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and o.stockout_id = #{stockoutId}</if>
<if test="outType != null and outType != ''"> and o.out_type = #{outType}</if>
<if test="departmentNo != null and departmentNo != ''"> and o.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and o.customer_no = #{customerNo}</if>
<if test="createManId != null and createManId != ''"> and o.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and o.stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and o.warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and o.class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and o.exit_id = #{exitId}</if>
<if test="carNumber != null and carNumber != ''"> and o.car_number = #{carNumber}</if>
<if test="FID != null and FID != ''"> and o.FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if>
<if test="startDate != null and startDate != ''"> and o.create_date &gt;= #{startDate}</if>
<if test="finishDate != null and finishDate != ''"> and o.create_date &lt;= #{finishDate}</if>
<if test="productId != null and productId != ''"> and d.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and bp.product_name like concat('%', #{productName}, '%')</if>
<if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if>
</where>
</select>
</mapper>

View File

@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpStockoutId" column="erp_stockout_id" />
<result property="startDate" column="start_date" />
<result property="finishDate" column="finish_date" />
<result property="warehouseName" column="warehouse_name" />
<result property="customerName" column="customer_name" />
</resultMap>
<sql id="selectOutStockoutVo">
@@ -29,23 +31,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult">
<include refid="selectOutStockoutVo"/>
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.warehouse_id, o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,bw.warehouse_name,bc.customer_name from out_stockout o
left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id
left join bas_customer bc on bc.customer_no = o.customer_no
left join out_stockout_detail d on d.stockout_id = o.stockout_id
left join bas_product bp on bp.product_id = d.product_id
<where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
<if test="carNumber != null and carNumber != ''"> and car_number = #{carNumber}</if>
<if test="FID != null and FID != ''"> and FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and erp_stockout_id = #{erpStockoutId}</if>
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and o.stockout_id = #{stockoutId}</if>
<if test="outType != null and outType != ''"> and o.out_type = #{outType}</if>
<if test="startDate != null and startDate != ''"> and o.create_date &gt;= #{startDate}</if>
<if test="finishDate != null and finishDate != ''"> and o.create_date &lt;= #{finishDate}</if>
<if test="departmentNo != null and departmentNo != ''"> and o.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and o.customer_no = #{customerNo}</if>
<if test="createManId != null and createManId != ''"> and o.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and o.stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and o.warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and o.class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and o.exit_id = #{exitId}</if>
<if test="carNumber != null and carNumber != ''"> and o.car_number = #{carNumber}</if>
<if test="FID != null and FID != ''"> and o.FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if>
<if test="productId != null and productId != ''"> and d.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and bp.product_name like concat('%', #{productName}, '%')</if>
<if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if>
</where>
</select>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.pda.mapper.PdaMapper">
<select id="emptyTrayIn" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_tray_in(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
#{v_quantity,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<select id="emptyBoxIn" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_box_in(
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_entrance_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
</mapper>