初次提交
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.hivekion.baseData.entity.Fightpowerstaff;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -12,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
* @since 2025-08-07
|
* @since 2025-08-07
|
||||||
*/
|
*/
|
||||||
public interface FightpowerstaffMapper extends BaseMapper<Fightpowerstaff> {
|
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> {
|
public interface FightpowerstaffService extends IService<Fightpowerstaff> {
|
||||||
List<Fightpowerstaff> queryListByOrgId(Integer orgId);
|
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.entity.Fightpowerstaff;
|
||||||
import com.hivekion.baseData.mapper.FightpowerstaffMapper;
|
import com.hivekion.baseData.mapper.FightpowerstaffMapper;
|
||||||
import com.hivekion.baseData.service.FightpowerstaffService;
|
import com.hivekion.baseData.service.FightpowerstaffService;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -27,4 +28,9 @@ public class FightpowerstaffServiceImpl extends
|
||||||
queryWrapper.eq("parent_id", orgId);
|
queryWrapper.eq("parent_id", orgId);
|
||||||
return this.list(queryWrapper);
|
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;
|
package com.hivekion.statistic.service.impl;
|
||||||
|
|
||||||
|
import com.hivekion.baseData.entity.Fightpowerstaff;
|
||||||
import com.hivekion.baseData.entity.OrgSupplier;
|
import com.hivekion.baseData.entity.OrgSupplier;
|
||||||
|
import com.hivekion.baseData.service.FightpowerstaffService;
|
||||||
import com.hivekion.baseData.service.OrgSupplierService;
|
import com.hivekion.baseData.service.OrgSupplierService;
|
||||||
import com.hivekion.scenario.entity.ScenarioOrgPost;
|
import com.hivekion.scenario.entity.ScenarioOrgPost;
|
||||||
import com.hivekion.scenario.entity.ScenarioResource;
|
import com.hivekion.scenario.entity.ScenarioResource;
|
||||||
|
|
@ -38,6 +40,8 @@ public class StatisticServiceImpl implements StatisticService {
|
||||||
private SuppliesDictService suppliesDictService;
|
private SuppliesDictService suppliesDictService;
|
||||||
@Resource
|
@Resource
|
||||||
private IScenarioOrgPostService scenarioOrgPostService;
|
private IScenarioOrgPostService scenarioOrgPostService;
|
||||||
|
@Resource
|
||||||
|
private FightpowerstaffService fightpowerstaffService;
|
||||||
@Override
|
@Override
|
||||||
public StatisticBean statistic(String resourceId) {
|
public StatisticBean statistic(String resourceId) {
|
||||||
StatisticBean statisticBean = new StatisticBean();
|
StatisticBean statisticBean = new StatisticBean();
|
||||||
|
|
@ -58,16 +62,21 @@ public class StatisticServiceImpl implements StatisticService {
|
||||||
List<Integer> orgList = orgPostList.stream().map(ScenarioOrgPost::getOrgId)
|
List<Integer> orgList = orgPostList.stream().map(ScenarioOrgPost::getOrgId)
|
||||||
.collect(Collectors.toList());
|
.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);
|
List<OrgSupplier> suppliers = orgSupplierService.selectByOrgIds(orgList);
|
||||||
log.info("suppliers size::{}",suppliers.size());
|
|
||||||
Map<String, SuppliesDict> supplierMap = suppliesDictService.supplierDictMap();
|
Map<String, SuppliesDict> supplierMap = suppliesDictService.supplierDictMap();
|
||||||
log.info("supplierMap::{}",supplierMap);
|
|
||||||
suppliers.forEach(supplier -> {
|
suppliers.forEach(supplier -> {
|
||||||
log.info("supplier:{},{}",supplier,supplier.getId());
|
|
||||||
SuppliesDict dict = supplierMap.get(supplier.getSupplierId());
|
SuppliesDict dict = supplierMap.get(supplier.getSupplierId());
|
||||||
log.info("dict:{}",dict);
|
|
||||||
if (dict != null) {
|
if (dict != null) {
|
||||||
switch (dict.getCode()) {
|
switch (dict.getCode()) {
|
||||||
case "FOOD":
|
case "FOOD":
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,9 @@ public class WsServer {
|
||||||
|
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
session.getBasicRemote().sendText(testWeatherJson());
|
session.getBasicRemote().sendText(testWeatherJson("start_rain"));
|
||||||
|
Thread.sleep(10000);
|
||||||
|
session.getBasicRemote().sendText(testWeatherJson("start_snow"));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("error::",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 responseCmdInfo = new ResponseCmdInfo();
|
||||||
responseCmdInfo.setCmdType("66-raining");
|
responseCmdInfo.setCmdType(tag);
|
||||||
responseCmdInfo.setRoom("123");
|
responseCmdInfo.setRoom("123");
|
||||||
responseCmdInfo.setScenarioId(2746);
|
responseCmdInfo.setScenarioId(2746);
|
||||||
Map<String,Object> data = new HashMap<>();
|
Map<String,Object> data = new HashMap<>();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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">
|
<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>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user