平库盘点页面

This commit is contained in:
liuhanqing
2025-06-30 15:38:57 +08:00
parent 81c04bd90d
commit ace9f89b3f
7 changed files with 283 additions and 226 deletions

View File

@@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.stock.domain.BasStock;
@@ -27,6 +29,8 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
private CheckDifferenceRecordMapper checkDifferenceRecordMapper;
@Autowired
private IBasStockService basStockService;
@Autowired
private IBasCargoSpaceService basCargoSpaceService;
/**
@@ -72,6 +76,21 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
basStockService.updateBasStock(basStock);
checkDifferenceRecord.setOldQuantity(basStock.getQuantity());
}else if (checkDifferenceRecord.getRecordType()==2){
//判断该物料是否已经存在
BasStock queryStock = new BasStock();
queryStock.setProductId(checkDifferenceRecord.getProductId());
queryStock.setWarehouseId(checkDifferenceRecord.getWarehouseId());
List<BasStock> stocks = basStockService.selectBasStockList(queryStock);
if (!stocks.isEmpty()) {
return AjaxResult.error("该物料已存在");
}
BasCargoSpace queryCargoSpace = new BasCargoSpace();
queryCargoSpace.setWarehouseId(checkDifferenceRecord.getWarehouseId());
List<BasCargoSpace> cargoSpaces = basCargoSpaceService.selectBasCargoSpaceList(queryCargoSpace);
if (cargoSpaces.isEmpty()){
return AjaxResult.error("没有货位");
}
checkDifferenceRecord.setCargoSpaceId(cargoSpaces.get(0).getCargoSpaceId());
checkDifferenceRecord.setOldQuantity("0");
}else if (checkDifferenceRecord.getRecordType()==3){
BasStock basStock = basStockService.selectBasStockByStockId(checkDifferenceRecord.getStockId());

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.search.ViewStockWarning.mapper.ViewStockWarningMapper">
<resultMap type="ViewStockWarning" id="ViewStockWarningResult">
<result property="stockId" column="stock_id" />
<result property="cargoSpaceId" column="cargo_space_id" />
@@ -61,12 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectViewStockWarningVo">
select 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, spare5, spare6, product_id, warehouse_name, address, c_desc, warehouse_kind, warehouse_type, is_current, product_name, spec, unit, price, remark, cargo_space_name, roadway_id, cargo_area_id, the_type, the_type_name, the_platoon, the_column, the_floor, cargo_status, locked, cargo_hight, iss_double, group_coding_no, group_coding, cargo_space_logo, this_cargo_area,spare7,spare8, remark from view_stock_warning
select 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, spare5, spare6, product_id, warehouse_name, address, c_desc, warehouse_kind, warehouse_type, is_current, product_name, spec, unit, price, remark, cargo_space_name, roadway_id, cargo_area_id, the_type, the_type_name, the_platoon, the_column, the_floor, cargo_status, locked, cargo_hight, iss_double, group_coding_no, group_coding, cargo_space_logo, this_cargo_area,spare7,spare8 from view_stock_warning
</sql>
<select id="selectViewStockWarningList" parameterType="ViewStockWarning" resultMap="ViewStockWarningResult">
<include refid="selectViewStockWarningVo"/>
<where>
<where>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status like concat('%', #{stockStatus}, '%')</if>
@@ -123,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
<select id="selectViewStockWarningByStockId" parameterType="String" resultMap="ViewStockWarningResult">
<include refid="selectViewStockWarningVo"/>
where stock_id = #{stockId}
@@ -307,9 +307,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteViewStockWarningByStockIds" parameterType="String">
delete from view_stock_warning where stock_id in
delete from view_stock_warning where stock_id in
<foreach item="stockId" collection="array" open="(" separator="," close=")">
#{stockId}
</foreach>
</delete>
</mapper>
</mapper>