Browse Source

fix--抚慰屏幕地图数据

master
buaixuexideshitongxue 3 weeks ago
parent
commit
2bc17a00f5
  1. 41
      src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java
  2. 65
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  3. 8
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

41
src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java

@ -31,6 +31,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@ -239,24 +240,14 @@ public class DataVRightsComfortController {
}
for (ComfortMapIconVo re : res) {
String departId = re.getDepartId();
List<String> allNodeIds = supDepartService.getAllNodeIds(departId);
List<RpcApply> list = rpcApplyService.list(new LambdaQueryWrapper<RpcApply>()
.between(RpcApply::getCrtTime, beginTime, finalEndTime)
.in(RpcApply::getDepartId,allNodeIds)
// .eq(RpcApply::getVerified,"0")
.eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()));
Set<String> caseNumbers = list.stream()
.filter(one->StrUtil.isNotBlank(one.getDepartId()))
.map(RpcApply::getCaseNumber)
.collect(Collectors.toSet());
// 维权案件总数
re.setRightsNumber(caseNumbers.size());
// 受侵害人数
re.setVictimNumber(rpcApplyMapper.selectVictimNumberByOrg(beginTime,finalEndTime,departId));
// 打击处理人数
List<String> tortNames = rpcInfringerResultMapper.selectNamesByOrgTime(beginTime, finalEndTime,departId);
Integer rightsNumber = rpcApplyMapper.selectMapRightsNumber(beginTime, finalEndTime, departId);
Integer victimNumber = rpcApplyMapper.selectMapVictimNumber(beginTime, finalEndTime, departId);
Long comfortPersonNumber = rpcApplyMapper.selectMapComfortPersonNumber(beginTime, finalEndTime, departId);
List<String> tortNames = rpcApplyMapper.selectMaptHitPersonNumber(beginTime, finalEndTime, departId);
BigDecimal comfortMoney = rpcApplyMapper.selectMapComfortMoney(beginTime, finalEndTime, departId);
re.setRightsNumber(rightsNumber);
re.setVictimNumber(victimNumber);
re.setComfortPersonNumber(comfortPersonNumber);
long initialListSize = tortNames.size();
long hitPersonNumber = tortNames.stream()
.filter(s -> s.contains(",")).toList().size();
@ -270,20 +261,8 @@ public class DataVRightsComfortController {
}else{
re.setHitPersonNumber(initialListSize + nums - hitPersonNumber);
}
//抚慰金额
re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBar(beginTime, finalEndTime, departId));
// CompletableFutureUtil.runSyncObject(() -> {
//
// re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, departId));
// }).join();
CompletableFutureUtil.runSyncObject(() -> {
// 抚慰人数
re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), departId));
}).join();
re.setComfortMoney(comfortMoney);
}
JSONObject data = new JSONObject().fluentPut("comfortMapVoList", res);
return Result.success(data);
}

65
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -346,4 +346,69 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
" AND (d.id = #{id} OR d.pid = #{id} OR d_parent.pid = #{id} )")
List<RpcApply> selectRightsList(String id, Date beginTime, Date endTime);
@Select("SELECT count(*) " +
"FROM rpc_apply b " +
"LEFT JOIN sup_depart sd on b.depart_id = sd.id\n" +
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id\n" +
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id\n" +
"WHERE b.rpc_id is not null \n" +
"AND b.type =1 " +
"AND b.verified = 0\n" +
"AND b.crt_time >= #{beginTime} and b.crt_time <= #{finalEndTime} " +
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
Integer selectMapRightsNumber(Date beginTime, Date finalEndTime, String departId);
@Select("SELECT count(*) " +
"FROM rpc_apply_person a \n" +
"LEFT JOIN rpc_apply b on a.rpc_id = b.rpc_id \n" +
"LEFT JOIN sup_depart sd on b.depart_id = sd.id\n" +
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id\n" +
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id\n" +
"WHERE b.rpc_id is not null \n" +
"AND b.type =1\n" +
"AND b.verified = 0\n" +
"AND b.crt_time >= #{beginTime} and b.crt_time <= #{finalEndTime} " +
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
Integer selectMapVictimNumber(Date beginTime, Date finalEndTime, String departId);
// 抚慰人数
@Select("SELECT count(*) \n" +
"FROM rpc_apply rpa\n" +
"LEFT JOIN sup_depart sd on rpa.depart_id = sd.id\n" +
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id\n" +
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id\n" +
"WHERE rpa.apply_date >= #{beginTime} and rpa.apply_date <= #{finalEndTime} " +
"AND rpa.type=2 \n" +
"and rpa.rpc_status = 'completed' \n" +
"AND rpa.verified=0\n" +
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
Long selectMapComfortPersonNumber(Date beginTime, Date finalEndTime, String departId);
// -- 打击处理人数
@Select("SELECT rir.tort_name " +
"FROM rpc_infringer_result rir \n" +
"LEFT JOIN rpc_apply as rpa on rir.rpc_id = rpa.rpc_id\n" +
"LEFT JOIN sup_depart sd on rpa.depart_id = sd.id\n" +
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id\n" +
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id\n" +
"WHERE rpa.crt_time >= #{beginTime} and rpa.crt_time <= #{finalEndTime} " +
"AND rpa.type=1 \n" +
"AND rpa.verified=0\n" +
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
List<String> selectMaptHitPersonNumber(Date beginTime, Date finalEndTime, String departId);
// 抚慰金额
@Select("SELECT round(sum(p.provide_relief)/10000, 2) " +
"FROM rpc_apply r \n" +
"LEFT JOIN rpc_apply_person p on r.rpc_id = p.rpc_id \n" +
"LEFT JOIN sup_depart sd on r.depart_id = sd.id\n" +
"LEFT JOIN sup_depart sdd on sd.pid = sdd.id\n" +
"LEFT JOIN sup_depart sddd on sdd.pid = sddd.id\n" +
" where r.type = 2 \n" +
"and r.rpc_status = 'completed' \n" +
"AND r.apply_date >= #{beginTime} and r.apply_date <= #{finalEndTime} " +
"AND (sd.id =#{departId} OR sdd.id=#{departId} or sddd.id=#{departId})")
BigDecimal selectMapComfortMoney(Date beginTime, Date finalEndTime, String departId);
//
}

8
src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

@ -587,16 +587,8 @@ public class DatavServiceImpl implements DatavService {
@Override
public Result<JSONObject> getComfortMoneyBarList(DataVRequest request) {
// 找到rpcId
// List<String> rpcIds = rpcComfortPacksMapper.selectRpcIds(request.getBeginTime(), request.getEndTime());
// 找人找单位
// LambdaQueryWrapper<RpcApplyPerson> rpcApplyPersonLambdaQueryWrapper = new LambdaQueryWrapper<>();
// rpcApplyPersonLambdaQueryWrapper.in(RpcApplyPerson::getRpcId, rpcIds);
// rpcApplyPersonLambdaQueryWrapper.between(RpcApplyPerson::getCreatTime, request.getBeginTime(), request.getEndTime());
// List<RpcApplyPerson> rpcApplyPersonList = rpcApplyPersonService.list(rpcApplyPersonLambdaQueryWrapper);
List<BarItem> countyComfortMoneyBarList = rpcComfortPacksMapper.getComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), 3);
List<BarItem> bureauComfortMoneyBarList = rpcComfortPacksMapper.getComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), 4);
JSONObject object = new JSONObject();
object.fluentPut("countyComfortMoneyBarList", countyComfortMoneyBarList);
object.fluentPut("bureauComfortMoneyBarList", bureauComfortMoneyBarList);

Loading…
Cancel
Save