库位修改以及批量导入
This commit is contained in:
@@ -126,11 +126,11 @@ public class PcdeDetailController extends BaseController
|
||||
/**
|
||||
* 删除库位明细
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('information:pcdedetail:remove')")
|
||||
// @Log(title = "库位明细", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(pcdeDetailService.deletePcdeDetailByIds(ids));
|
||||
// }
|
||||
@PreAuthorize("@ss.hasPermi('information:pcdedetail:remove')")
|
||||
@Log(title = "库位明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(pcdeDetailService.deletePcdeDetailByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface IPcdeDetailService
|
||||
* @param ids 需要删除的库位明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
// public int deletePcdeDetailByIds(Long[] ids);
|
||||
public int deletePcdeDetailByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除库位明细信息
|
||||
|
||||
@@ -95,29 +95,29 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
* @param ids 需要删除的库位明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
// @Override
|
||||
// public int deletePcdeDetailByIds(Long[] ids)
|
||||
// {
|
||||
// for (Long id : ids) {
|
||||
// // 获取库位信息
|
||||
// PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
// if (pcdeDetail == null) {
|
||||
// throw new ServiceException("ID为 " + id + " 的库位不存在,无法删除");
|
||||
// }
|
||||
//
|
||||
// // 获取库位编号
|
||||
// String locationCode = pcdeDetail.getPcode();
|
||||
//
|
||||
// // 检查该库位是否仍有关联货物
|
||||
// int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
// if (count > 0) {
|
||||
// throw new ServiceException("库位 [" + locationCode + "] 上还有货物,无法批量删除");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 全部校验通过后再执行删除
|
||||
// return pcdeDetailMapper.deletePcdeDetailByIds(ids);
|
||||
// }
|
||||
@Override
|
||||
public int deletePcdeDetailByIds(Long[] ids)
|
||||
{
|
||||
for (Long id : ids) {
|
||||
// 获取库位信息
|
||||
PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
if (pcdeDetail == null) {
|
||||
throw new ServiceException("ID为 " + id + " 的库位不存在,无法删除");
|
||||
}
|
||||
|
||||
// 获取库位编号
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 检查该库位是否仍有关联货物
|
||||
int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("库位 [" + locationCode + "] 上还有货物,无法批量删除");
|
||||
}
|
||||
}
|
||||
|
||||
// 全部校验通过后再执行删除
|
||||
return pcdeDetailMapper.deletePcdeDetailByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库位明细信息
|
||||
|
||||
@@ -192,4 +192,7 @@ public interface RkInfoMapper
|
||||
);
|
||||
|
||||
int updateInfoByBillNo(RkInfo rkInfo);
|
||||
|
||||
|
||||
public int countRkInfoByLocationCode(String locationCode);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,6 @@
|
||||
INSERT IGNORE INTO pcde_detail
|
||||
(pcode,
|
||||
scene,
|
||||
scene_name,
|
||||
parent_warehouse_code,
|
||||
parent_warehouse_name,
|
||||
warehouse_code,
|
||||
@@ -353,7 +352,6 @@
|
||||
(
|
||||
#{item.pcode},
|
||||
#{item.scene},
|
||||
#{item.sceneName},
|
||||
#{item.parentWarehouseCode},
|
||||
#{item.parentWarehouseName},
|
||||
#{item.warehouseCode},
|
||||
|
||||
@@ -721,4 +721,14 @@
|
||||
</set>
|
||||
WHERE bill_no = #{billNo}
|
||||
</update>
|
||||
|
||||
<select id="countRkInfoByLocationCode" parameterType="String" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM rk_info
|
||||
WHERE pcode = #{locationCode}
|
||||
AND (is_delete = '0' OR is_delete IS NULL)
|
||||
AND exec_status = 1
|
||||
AND is_chuku = 0
|
||||
AND IFNULL(real_qty, 0) > 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user