Commit 6d15a950 authored by Allen Chen's avatar Allen Chen

commit

parent 2b0d791c
......@@ -340,9 +340,9 @@ public class PddLocalController {
for(AreaEntity lists : list){
// 根据code 计算占用
//获取所有入库数量
int num = storageImpl.findAllCount();
int num = storageImpl.findAllCount(lists.getCode());
//获取所有应入库但未入库数量
Integer reNum = storageImpl.findReNumCount();
Integer reNum = storageImpl.findReNumCount(lists.getCode());
reNum = (reNum == null) ? 0 : reNum;
// 区域总可用数量
int blank = lists.getTotal() - lists.getReserved();
......
......@@ -26,11 +26,11 @@ public interface StorageMapper extends BaseMapper<StorageEntity> {
@Update("UPDATE `storage` SET `num` = `num` + 1 WHERE `logisticsOrderCode` = #{logisticsOrderCode}")
void updateNumByLogisticsOrderCode(String logisticsOrderCode);
@Select("SELECT COUNT(`uid`) FROM `storage`")
int findAllCount();
@Select("SELECT COUNT(`uid`) FROM `storage` WHERE `code` = #{code}")
int findAllCount(@Param("code") String code);
@Select("SELECT SUM(IFNULL(`total`, 0) - IFNULL(`num`, 0)) FROM `storage` WHERE `num` <> `total` ")
Integer findReNumCount();
@Select("SELECT SUM(IFNULL(`total`, 0) - IFNULL(`num`, 0)) FROM `storage` WHERE `num` <> `total` AND `code` = #{code}")
Integer findReNumCount(@Param("code") String code);
@Select("SELECT `code` FROM `storage` WHERE `mailNo` = #{mailNo}")
StorageResponse storageSelect(@Param("mailNo") String mailNo);
......
......@@ -54,7 +54,7 @@ public class AreaImpl extends ServiceImpl<AreaMapper, AreaEntity> implements Are
}else {
if(areaEntity.getUid().equals(ae2.getUid())){
//同一条可以修改
baseMapper.updateById(ae);
baseMapper.updateById(areaEntity);
}else {
//code 重复
return JsonResponse.generateLocalCommonFailedResponse("-1", "区域名称已存在");
......
......@@ -34,12 +34,12 @@ public class StorageImpl extends ServiceImpl<StorageMapper, StorageEntity> imple
baseMapper.updateNumByLogisticsOrderCode(logisticsOrderCode);
}
public int findAllCount() {
return baseMapper.findAllCount();
public int findAllCount(String code) {
return baseMapper.findAllCount(code);
}
public Integer findReNumCount() {
return baseMapper.findReNumCount();
public Integer findReNumCount(String code) {
return baseMapper.findReNumCount(code);
}
public StorageResponse storageSelect(String mailNo) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment