初次提交
This commit is contained in:
parent
2f40a8556c
commit
01007c1279
|
@ -2,6 +2,7 @@ package com.hivekion.baseData.mapper;
|
|||
|
||||
import com.hivekion.baseData.entity.Fightpowerstaff;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -12,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* @since 2025-08-07
|
||||
*/
|
||||
public interface FightpowerstaffMapper extends BaseMapper<Fightpowerstaff> {
|
||||
|
||||
List<Fightpowerstaff> queryByOrgIds(List<Integer> ids);
|
||||
}
|
||||
|
|
|
@ -14,4 +14,5 @@ import java.util.List;
|
|||
*/
|
||||
public interface FightpowerstaffService extends IService<Fightpowerstaff> {
|
||||
List<Fightpowerstaff> queryListByOrgId(Integer orgId);
|
||||
List<Fightpowerstaff> queryByOrgIds(List<Integer> ids);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.hivekion.baseData.entity.Fightpowerstaff;
|
||||
import com.hivekion.baseData.mapper.FightpowerstaffMapper;
|
||||
import com.hivekion.baseData.service.FightpowerstaffService;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -27,4 +28,9 @@ public class FightpowerstaffServiceImpl extends
|
|||
queryWrapper.eq("parent_id", orgId);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Fightpowerstaff> queryByOrgIds(List<Integer> ids) {
|
||||
return this.baseMapper.queryByOrgIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.hivekion.statistic.service.impl;
|
||||
|
||||
import com.hivekion.baseData.entity.Fightpowerstaff;
|
||||
import com.hivekion.baseData.entity.OrgSupplier;
|
||||
import com.hivekion.baseData.service.FightpowerstaffService;
|
||||
import com.hivekion.baseData.service.OrgSupplierService;
|
||||
import com.hivekion.scenario.entity.ScenarioOrgPost;
|
||||
import com.hivekion.scenario.entity.ScenarioResource;
|
||||
|
@ -38,6 +40,8 @@ public class StatisticServiceImpl implements StatisticService {
|
|||
private SuppliesDictService suppliesDictService;
|
||||
@Resource
|
||||
private IScenarioOrgPostService scenarioOrgPostService;
|
||||
@Resource
|
||||
private FightpowerstaffService fightpowerstaffService;
|
||||
@Override
|
||||
public StatisticBean statistic(String resourceId) {
|
||||
StatisticBean statisticBean = new StatisticBean();
|
||||
|
@ -58,16 +62,21 @@ public class StatisticServiceImpl implements StatisticService {
|
|||
List<Integer> orgList = orgPostList.stream().map(ScenarioOrgPost::getOrgId)
|
||||
.collect(Collectors.toList());
|
||||
//获取人员信息
|
||||
|
||||
List<Fightpowerstaff> staffList = fightpowerstaffService.queryByOrgIds(orgList);
|
||||
int sum = staffList.stream()
|
||||
.mapToInt(Fightpowerstaff::getNumber)
|
||||
.sum();
|
||||
statisticBean.getPerson().setCurrent(sum);
|
||||
statisticBean.getPerson().setTotal(sum);
|
||||
//获取物资信息
|
||||
List<OrgSupplier> suppliers = orgSupplierService.selectByOrgIds(orgList);
|
||||
log.info("suppliers size::{}",suppliers.size());
|
||||
|
||||
Map<String, SuppliesDict> supplierMap = suppliesDictService.supplierDictMap();
|
||||
log.info("supplierMap::{}",supplierMap);
|
||||
|
||||
suppliers.forEach(supplier -> {
|
||||
log.info("supplier:{},{}",supplier,supplier.getId());
|
||||
|
||||
SuppliesDict dict = supplierMap.get(supplier.getSupplierId());
|
||||
log.info("dict:{}",dict);
|
||||
|
||||
if (dict != null) {
|
||||
switch (dict.getCode()) {
|
||||
case "FOOD":
|
||||
|
|
|
@ -61,7 +61,9 @@ public class WsServer {
|
|||
|
||||
}
|
||||
try{
|
||||
session.getBasicRemote().sendText(testWeatherJson());
|
||||
session.getBasicRemote().sendText(testWeatherJson("start_rain"));
|
||||
Thread.sleep(10000);
|
||||
session.getBasicRemote().sendText(testWeatherJson("start_snow"));
|
||||
}catch (Exception e){
|
||||
log.error("error::",e);
|
||||
}
|
||||
|
@ -130,9 +132,9 @@ public class WsServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
private String testWeatherJson(){
|
||||
private String testWeatherJson(String tag){
|
||||
ResponseCmdInfo responseCmdInfo = new ResponseCmdInfo();
|
||||
responseCmdInfo.setCmdType("66-raining");
|
||||
responseCmdInfo.setCmdType(tag);
|
||||
responseCmdInfo.setRoom("123");
|
||||
responseCmdInfo.setScenarioId(2746);
|
||||
Map<String,Object> data = new HashMap<>();
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hivekion.baseData.mapper.FightpowerstaffMapper">
|
||||
|
||||
<select id="queryByOrgIds" resultType="com.hivekion.baseData.entity.Fightpowerstaff">
|
||||
select * from tbl_fightpowerstaff where parent_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue
Block a user