盘点测试优化

main
judy 1 year ago
parent d27251d429
commit 936b3dac14
  1. 3
      shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java
  2. 20
      shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinStockInvController.java
  3. 35
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java
  4. 3
      shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml
  5. 7
      shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml

@ -66,6 +66,9 @@ public class BusinStockInvQueryBo extends BaseEntity {
*/ */
private String invStatus; private String invStatus;
private List<String> invStatusList;
/** /**
* 货位ID * 货位ID
*/ */

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -53,7 +54,10 @@ public class BusinStockInvController extends BaseController {
public TableDataInfo<BusinStockInvVo> list(BusinStockInvQueryBo bo) { public TableDataInfo<BusinStockInvVo> list(BusinStockInvQueryBo bo) {
startPage(); startPage();
if (StringUtils.isEmpty(bo.getInvStatus())) { if (StringUtils.isEmpty(bo.getInvStatus())) {
bo.setInvStatus(InvStatusEnum.init.getValue()); List invStatusList= new ArrayList();
invStatusList.add(InvStatusEnum.init.getValue());
invStatusList.add(InvStatusEnum.exec.getValue());
bo.setInvStatusList(invStatusList);
} }
List<BusinStockInvVo> list = iBusinStockInvService.queryList(bo); List<BusinStockInvVo> list = iBusinStockInvService.queryList(bo);
return getDataTable(list); return getDataTable(list);
@ -74,9 +78,9 @@ public class BusinStockInvController extends BaseController {
* 设置为空货位 * 设置为空货位
*/ */
@PostMapping("/setEmptyLocation") @PostMapping("/setEmptyLocation")
public Result<Boolean> setEmptyLocation(Long locationId) { public Result<Boolean> setEmptyLocation(Long invId) {
startPage(); startPage();
Result<Boolean> booleanResult = iBusinStockInvService.setEmptyLocation(locationId); Result<Boolean> booleanResult = iBusinStockInvService.setEmptyLocation(invId);
return booleanResult; return booleanResult;
} }
@ -84,9 +88,9 @@ public class BusinStockInvController extends BaseController {
* 设置为空空托 * 设置为空空托
*/ */
@PostMapping("/setEmptyContainer") @PostMapping("/setEmptyContainer")
public Result<Boolean> setEmptyContainer(Long locationId) { public Result<Boolean> setEmptyContainer(Long invId) {
startPage(); startPage();
Result<Boolean> booleanResult = iBusinStockInvService.setEmptyContainer(locationId); Result<Boolean> booleanResult = iBusinStockInvService.setEmptyContainer(invId);
return booleanResult; return booleanResult;
} }
@ -94,9 +98,9 @@ public class BusinStockInvController extends BaseController {
* 标记差异 * 标记差异
*/ */
@PostMapping("/flagAsDiff") @PostMapping("/flagAsDiff")
public Result<Boolean> flagAsDiff(Long locationId) { public Result<Boolean> flagAsDiff(Long invId) {
startPage(); startPage();
Result<Boolean> booleanResult = iBusinStockInvService.flagAsDiff(locationId); Result<Boolean> booleanResult = iBusinStockInvService.flagAsDiff(invId);
return booleanResult; return booleanResult;
} }
@ -114,7 +118,7 @@ public class BusinStockInvController extends BaseController {
* 盘点完成 * 盘点完成
*/ */
@PostMapping("/invFinish") @PostMapping("/invFinish")
public Result<Boolean> invFinish(Long invId) { public Result<Boolean> invFinish( Long invId) {
startPage(); startPage();
Result<Boolean> booleanResult = iBusinStockInvService.invFinish(invId); Result<Boolean> booleanResult = iBusinStockInvService.invFinish(invId);
return booleanResult; return booleanResult;

@ -67,13 +67,11 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
@Override @Override
@DataScopeConsignor(consignorAlias = "si")
public List<BusinStockInvVo> queryList(BusinStockInvQueryBo bo) { public List<BusinStockInvVo> queryList(BusinStockInvQueryBo bo) {
return this.baseMapper.queryList(bo); return this.baseMapper.queryList(bo);
} }
@Override @Override
@DataScopeConsignor(consignorAlias = "si")
public List<BusinStockInvVo> queryListByGoodsGroup(BusinStockInvQueryBo bo) { public List<BusinStockInvVo> queryListByGoodsGroup(BusinStockInvQueryBo bo) {
return this.baseMapper.queryListByGoodsGroup(bo); return this.baseMapper.queryListByGoodsGroup(bo);
} }
@ -139,22 +137,26 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
/** /**
* 设置为空货位 * 设置为空货位
* *
* @param locationId * @param invId
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result<Boolean> setEmptyLocation(Long locationId) { public Result<Boolean> setEmptyLocation(Long invId) {
/** /**
* 1.系统有保险杠或空托时实际系统货位是空时可清除 * 1.系统有保险杠或空托时实际系统货位是空时可清除
*/ */
try { try {
List<SysStockDetail> sysStockDetails = sysStockDetailService.queryStrockByLocation(locationId); BusinStockInv businStockInv = this.getById(invId);
businStockInv.setInvStatus(InvStatusEnum.end.getValue());
this.updateById(businStockInv);
List<SysStockDetail> sysStockDetails = sysStockDetailService.queryStrockByLocation(businStockInv.getLocationId());
if (sysStockDetails !=null && sysStockDetails.size()>0){ if (sysStockDetails !=null && sysStockDetails.size()>0){
sysStockDetails.removeAll(sysStockDetails); sysStockDetails.removeAll(sysStockDetails);
} }
BaseLocation baseLocation = iBaseLocationService.getById(locationId); BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId());
baseLocation.setLocationStatus(LocationStatusEnum.empty.getValue()); baseLocation.setLocationStatus(LocationStatusEnum.empty.getValue());
iBaseLocationService.updateById(baseLocation); iBaseLocationService.updateById(baseLocation);
@ -169,23 +171,27 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
/** /**
* 设置为空托 * 设置为空托
* *
* @param locationId * @param invId
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result<Boolean> setEmptyContainer(Long locationId) { public Result<Boolean> setEmptyContainer(Long invId) {
/** /**
* 1.系统有保险杠或空托时实际系统货位是空时可清除 * 1.系统有保险杠或空托时实际系统货位是空时可清除
*/ */
try { try {
BusinStockInv businStockInv = this.getById(invId);
businStockInv.setInvStatus(InvStatusEnum.end.getValue());
this.updateById(businStockInv);
//更新货位状态为:空托 //更新货位状态为:空托
BaseLocation baseLocation = iBaseLocationService.getById(locationId); BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId());
baseLocation.setLocationStatus(LocationStatusEnum.empty_container.getValue()); baseLocation.setLocationStatus(LocationStatusEnum.empty_container.getValue());
iBaseLocationService.updateById(baseLocation); iBaseLocationService.updateById(baseLocation);
//删除库存明细表中的数据 //删除库存明细表中的数据
List<SysStockDetail> sysStockDetails = sysStockDetailService.queryStrockByLocation(locationId); List<SysStockDetail> sysStockDetails = sysStockDetailService.queryStrockByLocation(businStockInv.getLocationId());
if (sysStockDetails !=null && sysStockDetails.size()>0){ if (sysStockDetails !=null && sysStockDetails.size()>0){
sysStockDetails.removeAll(sysStockDetails); sysStockDetails.removeAll(sysStockDetails);
} }
@ -210,16 +216,19 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
/** /**
* 标记差异 * 标记差异
* @param locationId * @param invId
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result<Boolean> flagAsDiff(Long locationId) { public Result<Boolean> flagAsDiff(Long invId) {
/** /**
* 1.实际是有杠但是系统无或是颜色车型不一样时进行标记标记后指定出库地图上一键出库 * 1.实际是有杠但是系统无或是颜色车型不一样时进行标记标记后指定出库地图上一键出库
*/ */
BaseLocation baseLocation = iBaseLocationService.getById(locationId); BusinStockInv businStockInv = this.getById(invId);
businStockInv.setInvStatus(InvStatusEnum.end.getValue());
this.updateById(businStockInv);
BaseLocation baseLocation = iBaseLocationService.getById(businStockInv.getLocationId());
baseLocation.setLocationStatus(LocationStatusEnum.flag_diff.getValue()); baseLocation.setLocationStatus(LocationStatusEnum.flag_diff.getValue());
return iBaseLocationService.updateById(baseLocation)?Result.ok().msg("标记差异成功"):Result.err().msg("标记差异失败"); return iBaseLocationService.updateById(baseLocation)?Result.ok().msg("标记差异成功"):Result.err().msg("标记差异失败");
} }

@ -374,8 +374,7 @@
LEFT JOIN base_area ba ON bl.area_id = ba.id LEFT JOIN base_area ba ON bl.area_id = ba.id
LEFT JOIN base_storage bs ON ba.storage_id = bs.id LEFT JOIN base_storage bs ON ba.storage_id = bs.id
WHERE WHERE
bl.is_del = '0' ba.is_del = '0'
AND ba.is_del = '0'
AND bs.is_del = '0' AND bs.is_del = '0'
<if test="areaId != null"> <if test="areaId != null">
and bl.area_id = #{areaId} and bl.area_id = #{areaId}

@ -45,9 +45,15 @@
JOIN base_location loc ON si.location_id = loc.id JOIN base_location loc ON si.location_id = loc.id
left join sys_stock_detail stock on stock.location_id=loc.id left join sys_stock_detail stock on stock.location_id=loc.id
left join base_goods_data goods ON stock.goods_no =goods.goods_no left join base_goods_data goods ON stock.goods_no =goods.goods_no
where si.inv_status in
<foreach collection="invStatusList" item="invStatus" open="(" separator="," close=")">
#{invStatus}
</foreach>
<if test="invStatus != null and invStatus != ''"> <if test="invStatus != null and invStatus != ''">
and si.inv_status = #{invStatus} and si.inv_status = #{invStatus}
</if> </if>
<if test="tunnel != null and tunnel != ''"> <if test="tunnel != null and tunnel != ''">
AND loc.tunnel = #{tunnel} AND loc.tunnel = #{tunnel}
</if> </if>
@ -63,6 +69,7 @@
<if test="locationId !=null and locationId !='' "> <if test="locationId !=null and locationId !='' ">
and loc.id=#{locationId} and loc.id=#{locationId}
</if> </if>
group by si.id,loc.id,loc.location_code,goods.vehiche_model,goods.color,loc.location_status,inv_order_no group by si.id,loc.id,loc.location_code,goods.vehiche_model,goods.color,loc.location_status,inv_order_no
ORDER BY loc.route ORDER BY loc.route
</select> </select>

Loading…
Cancel
Save