Browse Source

feat(all): 仓库管理

1 增加定时维护仓库库位信息的功能
dev
zhaoqiaobo 4 days ago
parent
commit
d72f80a66b
  1. 33
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/job/WarehouseJob.java
  2. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java
  3. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml
  4. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  5. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

33
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/job/WarehouseJob.java

@ -0,0 +1,33 @@
package com.logpm.basicdata.job;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
/**
* @author zhaoqiaobo
* @create 2024-04-02
*/
@AllArgsConstructor
@Component
public class WarehouseJob {
private final IBasicdataWarehouseService warehouseService;
/**
* 定时维护仓库库位
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("initWarehouseSeating")
public ReturnT<String> initWarehouseSeating(String param) throws Exception {
warehouseService.initWarehouseSeating(param);
return ReturnT.SUCCESS;
}
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java

@ -101,4 +101,5 @@ public interface BasicdataWarehouseMapper extends BaseMapper<BasicdataWarehouseE
List<String> findBusunessLineList();
void initWarehouseSeating(@Param("warehouseId") String warehouseId);
}

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml

@ -188,4 +188,19 @@
group by business_line
</select>
<update id="initWarehouseSeating">
update logpm_warehouse_warehouse tt
join(
select warehouse_id,count(*) total
from logpm_warehouse_goods_allocation
where is_deleted = 0
and enable_status = 1
<if test="warehouseId != '' and warehouseId != null">
and warehouse_id = #{warehouseId}
</if>
group by warehouse_id
) ttt on tt.id = ttt.warehouse_id
set tt.seating = ttt.total,
tt.single_storage_location_area = case when tt.acreage = null then 0 else case when tt.acreage = 0 or ttt.total = 0 then 0 else tt.acreage/ttt.total end end
</update>
</mapper>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java

@ -137,4 +137,6 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
Map<Long, String> findNamesMapByIds(List<Long> warehouseIds);
R findBusunessLineList();
void initWarehouseSeating(String param);
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -425,4 +425,9 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
return R.data(busunessLineList);
}
@Override
public void initWarehouseSeating(String param) {
baseMapper.initWarehouseSeating(param);
}
}

Loading…
Cancel
Save