获取地图的货位相关信息,获取库存明细信息接口

main
judy 1 year ago
parent 8a5de4d84a
commit 2b5cd3f13d
  1. 81
      shkj-wms/src/main/java/com/shkj/wms/bo/SysStockNumQueryBo.java
  2. 11
      shkj-wms/src/main/java/com/shkj/wms/controller/base/BaseLocationController.java
  3. 13
      shkj-wms/src/main/java/com/shkj/wms/controller/business/SysStockController.java
  4. 3
      shkj-wms/src/main/java/com/shkj/wms/mapper/BaseLocationMapper.java
  5. 8
      shkj-wms/src/main/java/com/shkj/wms/mapper/SysStockMapper.java
  6. 4
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  7. 3
      shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java
  8. 6
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  9. 5
      shkj-wms/src/main/java/com/shkj/wms/service/impl/SysStockServiceImpl.java
  10. 116
      shkj-wms/src/main/java/com/shkj/wms/vo/SysStockNumDetailVo.java
  11. 38
      shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml
  12. 42
      shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml

@ -0,0 +1,81 @@
package com.shkj.wms.bo;
import com.shkj.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 堆垛机任务异常记录分页查询对象 ecs_stacker_exception
*
* @author luochenghang
* @date 2022-07-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SysStockNumQueryBo extends BaseEntity {
/** 分页大小 */
private Integer pageSize;
/** 当前页数 */
private Integer pageNum;
/** 排序列 */
private String orderByColumn;
/** 排序的方向desc或者asc */
private String isAsc;
private String ptPart;
private String startDate;
private String endDate;
/**
* 带时分秒的查询时间(操作入库时间)
*/
private String startTime;
private String endTime;
/**
* 机种即车型
*/
private String ptBreakCat;
/**
* 楼层
*/
private String layer;
/**
* 货位
*/
private String location;
/**
* 台车编号
*/
private String containerCode;
/**
* 库龄
*/
private Integer storageAge;
/**
* 批次
*/
private String batchNo;
/**
* 期初开始时间
*/
private String invTimeStart;
/**
* 货位名称
*/
private String locationCode;
}

@ -95,4 +95,15 @@ public class BaseLocationController extends BaseController {
public Result<Boolean> switchStatus(@Valid @RequestBody SwitchStatusEntity switchStatusEntity) { public Result<Boolean> switchStatus(@Valid @RequestBody SwitchStatusEntity switchStatusEntity) {
return iBaseLocationService.switchStatus(switchStatusEntity.getId(), switchStatusEntity.getIsuse()); return iBaseLocationService.switchStatus(switchStatusEntity.getId(), switchStatusEntity.getIsuse());
} }
/**
* 查询货位--map
*/
@GetMapping("/getBaseLocationForMap")
public TableDataInfo<BaseLocationVo> getBaseLocationForMap(BaseLocationQueryPageBo bo) {
startPage();
List<BaseLocationVo> list = iBaseLocationService.getBaseLocationForMap(bo);
return getDataTable(list);
}
} }

@ -2,7 +2,9 @@ package com.shkj.wms.controller.business;
import java.util.List; import java.util.List;
import com.shkj.wms.bo.SysStockNumQueryBo;
import com.shkj.wms.config.ValidList; import com.shkj.wms.config.ValidList;
import com.shkj.wms.vo.SysStockNumDetailVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -97,5 +99,16 @@ public class SysStockController extends BaseController {
return iSysStockService.deleteWithValidById(ids, true); return iSysStockService.deleteWithValidById(ids, true);
} }
/**
* 库存明细
* @param bo
* @return
*/
@GetMapping("/queryStockDetailList")
public TableDataInfo<List<SysStockNumDetailVo>> queryStockDetailList(SysStockNumQueryBo bo) {
startPage();
List<SysStockNumDetailVo> list = iSysStockService.queryStockDetailList(bo);
return getDataTable(list);
}
} }

@ -95,5 +95,8 @@ public interface BaseLocationMapper extends BaseMapper<BaseLocation> {
List<BaseLocationVo> queryBaseLocationListByGoods( BaseLocationQueryListBo bo); List<BaseLocationVo> queryBaseLocationListByGoods( BaseLocationQueryListBo bo);
List<BaseLocationVo> getBaseLocationForMap(BaseLocationQueryPageBo bo);
} }

@ -1,13 +1,11 @@
package com.shkj.wms.mapper; package com.shkj.wms.mapper;
import com.shkj.wms.bo.SysReportStockQueryBo; import com.shkj.wms.bo.SysReportStockQueryBo;
import com.shkj.wms.bo.SysStockNumQueryBo;
import com.shkj.wms.bo.SysStockReduceBo; import com.shkj.wms.bo.SysStockReduceBo;
import com.shkj.wms.domain.SysStock; import com.shkj.wms.domain.SysStock;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shkj.wms.vo.SysStockNumVo; import com.shkj.wms.vo.*;
import com.shkj.wms.vo.SysStockVCLocationVo;
import com.shkj.wms.vo.SysStockVehicheColorVo;
import com.shkj.wms.vo.SysStockVehicheVo;
import java.util.List; import java.util.List;
@ -30,6 +28,8 @@ public interface SysStockMapper extends BaseMapper<SysStock> {
List<SysStockVehicheVo> getVehicheStockList(); List<SysStockVehicheVo> getVehicheStockList();
List<SysStockNumDetailVo> queryStockDetailList(SysStockNumQueryBo bo);
} }

@ -177,7 +177,7 @@ public class ScheduledTasks {
// @PostConstruct // @PostConstruct
// @Scheduled(cron = "0/3 * * * * ? ") // @Scheduled(cron = "0/3 * * * * ? ")
@Scheduled(fixedRate = 200) // @Scheduled(fixedRate = 200)
public void task() { public void task() {
log.info("开始获取需要执行的任务"); log.info("开始获取需要执行的任务");
//获取待下发任务数据 //获取待下发任务数据
@ -1739,7 +1739,7 @@ public class ScheduledTasks {
/** /**
* 空治具出库流程 * 空治具出库流程
*/ */
@Scheduled(cron = "0/5 * * * * ? ") // @Scheduled(cron = "0/5 * * * * ? ")
public void exeEmptyContainerFromWare() { public void exeEmptyContainerFromWare() {
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.out_empty_type))) { if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.out_empty_type))) {
log.info("暂未设置空治具出库"); log.info("暂未设置空治具出库");

@ -167,4 +167,7 @@ public interface IBaseLocationService extends IService<BaseLocation> {
*/ */
Result<Boolean> changeLocationStatus(Long id, String status); Result<Boolean> changeLocationStatus(Long id, String status);
List<BaseLocationVo> getBaseLocationForMap(BaseLocationQueryPageBo bo);
} }

@ -901,4 +901,10 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
@Override
@DataScopeConsignor(branchAlias = "bl")
public List<BaseLocationVo> getBaseLocationForMap(BaseLocationQueryPageBo bo) {
List<BaseLocationVo> list = this.getBaseMapper().getBaseLocationForMap(bo);
return list;
}
} }

@ -229,4 +229,9 @@ public class SysStockServiceImpl extends ServiceImpl<SysStockMapper, SysStock> i
} }
@Override
public List<SysStockNumDetailVo> queryStockDetailList(SysStockNumQueryBo bo){
return sysStockMapper.queryStockDetailList(bo);
}
} }

@ -0,0 +1,116 @@
package com.shkj.wms.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 库存详情对象
*
* @author zjx
* @date 2022-12-15
*/
@Data
public class SysStockNumDetailVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 仓库名称
*/
private String branchName;
/**
* 所在楼层
*/
private String layer;
/**
* 库位
*/
private String locationCode;
/**
* 台车编号
*/
private String containerCode;
/**
* 物料编号
*/
private String ptPart;
/**
* 物料名称
*/
private String ptName;
/**
* 规格
*/
private String ptDesc;
/**
* 机种即车型
*/
private String ptBreakCat;
/**
* 在库数量
*/
private Integer qty;
/**
* 待入库数量
*/
private Integer inQty;
/**
* 待出库数量
*/
private Integer outQty;
/**
* 缴库时间
*/
private String inTime;
/**
* 库龄
*/
private Integer storageAge;
/**
* 批次
*/
private String rerpDate;
/**
* 作业时间
*/
private String createTime;
/**
* 作业类型
*/
private String type ;
/**
* 批次
*/
private String batch;
/**
* 开始时间之前的所有入库
*/
private Integer invInqty;
/**
* 开始时间之前的所有出库
*/
private Integer invOutqty;
/**
* 可用数量
*/
private Integer useQty;
}

@ -515,4 +515,42 @@
ORDER BY bl.route asc,is_deep desc ORDER BY bl.route asc,is_deep desc
</select> </select>
<select id="getBaseLocationForMap" resultMap="BaseLocationResult"
parameterType="com.shkj.wms.bo.BaseLocationQueryPageBo">
select
bl.*,
ba.storage_id as storage_id,
bs.storage_name as bs_storage_name,
bs.storage_code as storage_code,
ba.area_code as ba_area_code,
bb.branch_code,
bb.branch_name
from base_location bl
join base_area ba
on bl.area_id = ba.id
join base_storage bs
on ba.storage_id = bs.id
join base_branch bb
on bl.branch_id = bb.id
where
1=1
<if test="locationMsg != null and locationMsg != ''">
and (bl.location_code like concat('%', #{locationMsg}, '%')
or bl.location_name like concat('%', #{locationMsg}, '%'))
</if>
<if test="storageId != null">
and ba.storage_id = #{storageId}
</if>
<if test="areaId != null">
and bl.id = #{areaId}
</if>
<if test="branchId != null">
and bl.branch_id = #{branchId}
</if>
<if test="isActivity != null">
and bl.is_activity = #{isActivity}
</if>
${branchParams.dataScopeBranch}
</select>
</mapper> </mapper>

@ -161,4 +161,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="queryStockDetailList" resultType="com.shkj.wms.vo.SysStockNumDetailVo" parameterType="com.shkj.wms.bo.SysStockNumQueryBo">
SELECT
item.goods_no,
stock.qr_code,
stock.qty,
IFNULL( qty, 0 )+ IFNULL( in_qty, 0 )- IFNULL( out_qty, 0 ) AS useQty,
IFNULL( in_qty, 0 ) AS in_qty,
IFNULL( out_qty, 0 ) AS out_qty,
DATEDIFF( curtime(), stock.batch ) AS storageAge,
branch.branch_name,
loc.layer,
loc.location_code,
con.container_code,
stock.batch
FROM
sys_stock_detail stock
LEFT JOIN base_goods_data item ON stock.goods_no = item.goods_no
LEFT JOIN base_location loc ON loc.id = stock.location_id
LEFT JOIN base_container con ON stock.container_code = con.id
LEFT JOIN base_branch branch ON branch.id = stock.branch_id
<where>
<if test="layer != null and layer != ''">
and loc.layer= #{layer}
</if>
<if test="location != null and location != ''">
and loc.location_code= #{location}
</if>
<if test="locationCode != null and locationCode != ''">
and loc.location_name= #{locationCode}
</if>
<if test="containerCode != null and containerCode != ''">
and con.container_code= #{containerCode}
</if>
</where>
order by loc.location_name
</select>
</mapper> </mapper>

Loading…
Cancel
Save