Commit 9c355849 authored by chenzhao's avatar chenzhao

Merge branch 'developer' into wofkflow0620

parents 15873be6 e8303824
...@@ -253,4 +253,8 @@ public class HouseholdContract extends BaseEntity { ...@@ -253,4 +253,8 @@ public class HouseholdContract extends BaseEntity {
//合同填充字段值 //合同填充字段值
@TableField(exist = false) @TableField(exist = false)
List<ContractFillData> contractFillData; List<ContractFillData> contractFillData;
//查询一个农户拥有的合同是否全是已废弃
@TableField(exist = false)
private Boolean isAllDisuse;
} }
...@@ -4,38 +4,45 @@ ...@@ -4,38 +4,45 @@
<select id="selectPage" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract"> <select id="selectPage" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract">
select select
* *,
from hygf_household_contract (SELECT CASE WHEN SUM( CASE WHEN hhc.`status` = '已作废' THEN 1 ELSE 0 END ) = COUNT(*) THEN 'true' ELSE 'false'
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id <where> END FROM hygf_household_contract AS hhc
<if test="dto.name != null and dto.name !='' "> WHERE
and hygf_household_contract.name like concat('%',#{dto.name},'%') hhc.peasant_household_id = hygf_household_contract.peasant_household_id
</if> ) AS isAllDisuse
<if test="dto.contractNumber != null and dto.contractNumber !=''">
and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%') from hygf_household_contract
</if> LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<if test="dto.initiateStatus != null and dto.initiateStatus !='' "> <where>
and hygf_household_contract.initiate_status = #{dto.initiateStatus} <if test="dto.name != null and dto.name !='' ">
</if> and hygf_household_contract.name like concat('%',#{dto.name},'%')
<if test="dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''"> </if>
and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId} <if test="dto.contractNumber != null and dto.contractNumber !=''">
</if> and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%')
<if test="dto.dealerId != null and dto.dealerId !=''"> </if>
and hygf_household_contract.dealer_id = #{dto.dealerId} <if test="dto.initiateStatus != null and dto.initiateStatus !='' ">
</if> and hygf_household_contract.initiate_status = #{dto.initiateStatus}
<if test="dto.surveyStatus != null and dto.surveyStatus !=''"> </if>
and hygf_household_contract.survey_status = #{dto.surveyStatus} <if test="dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''">
</if> and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId}
<if test="dto.signStatus != null and dto.signStatus !=''"> </if>
and hygf_household_contract.sign_status = #{dto.signStatus} <if test="dto.dealerId != null and dto.dealerId !=''">
</if> and hygf_household_contract.dealer_id = #{dto.dealerId}
<if test="dto.userId != null and dto.userId !=''"> </if>
and hygf_household_contract.project_user_id = #{dto.userId} <if test="dto.surveyStatus != null and dto.surveyStatus !=''">
</if> and hygf_household_contract.survey_status = #{dto.surveyStatus}
<if test="dto.partyA != null and dto.partyA !=''"> </if>
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%') <if test="dto.signStatus != null and dto.signStatus !=''">
</if> and hygf_household_contract.sign_status = #{dto.signStatus}
</where> </if>
<if test="dto.userId != null and dto.userId !=''">
and hygf_household_contract.project_user_id = #{dto.userId}
</if>
<if test="dto.partyA != null and dto.partyA !=''">
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%')
</if>
</where>
<if test="dto.orderBy == null "> <if test="dto.orderBy == null ">
ORDER BY hygf_household_contract.rec_date DESC ORDER BY hygf_household_contract.rec_date DESC
</if> </if>
......
...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "运维数据 ") @ApiOperation(value = "运维数据 ")
@GetMapping("/operationData") @GetMapping("/operationData")
public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode,
@RequestParam(value = "stationId", required = false) String stationId) {
// List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto(); // List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto();
...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController {
// result.setRecords(mapList); // result.setRecords(mapList);
// result.setCurrent(1); // result.setCurrent(1);
// result.setTotal(mapList.size()); // result.setTotal(mapList.size());
return ResponseHelper.buildResponse(monitorService.operationData(areaCode)); return ResponseHelper.buildResponse(monitorService.operationData(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "全国新能源接入情况 ") @ApiOperation(value = "全国新能源接入情况 ")
@GetMapping("/getAccessSituation") @GetMapping("/getAccessSituation")
public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode,
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode)); @RequestParam(value = "stationId", required = false) String stationId) {
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -15,10 +15,11 @@ import java.util.Map; ...@@ -15,10 +15,11 @@ import java.util.Map;
public interface MonitorService { public interface MonitorService {
/** /**
* @param areaCode 区域编码 * @param areaCode 区域编码
* @param stationId 场站id
* @return 全国运维数据 * @return 全国运维数据
* @Description 根据区域编码动态运维数据 * @Description 根据区域编码动态运维数据
*/ */
IPage<Map<String, Object>> operationData(String areaCode); IPage<Map<String, Object>> operationData(String areaCode,String stationId);
/** /**
* @return Map<String, Object> * @return Map<String, Object>
...@@ -122,7 +123,8 @@ public interface MonitorService { ...@@ -122,7 +123,8 @@ public interface MonitorService {
/** /**
* 获取接入情况 * 获取接入情况
* @param areaCode * @param areaCode
* @param stationId
* @return * @return
*/ */
Map<String, Object> getAccessSituation(String areaCode); Map<String, Object> getAccessSituation(String areaCode,String stationId);
} }
...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import java.io.IOException; import java.io.IOException;
...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService {
private Resource overviewGF; private Resource overviewGF;
@Override @Override
public IPage<Map<String, Object>> operationData(String areaCode) { public IPage<Map<String, Object>> operationData(String areaCode,String stationId) {
List<StationCacheInfoDto> list = getListStationCacheInfoDto(); List<StationCacheInfoDto> list = getListStationCacheInfoDto();
if (null != areaCode) { if (null != areaCode) {
list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList()); list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
} }
if (!StringUtils.isEmpty(stationId)) {
list = list.stream().filter(e -> e.getStationId().toUpperCase(Locale.ROOT).equals(stationId.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
}
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList())); Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList()));
for (StationType value : StationType.values()) { for (StationType value : StationType.values()) {
...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService {
} }
@Override @Override
public Map<String, Object> getAccessSituation(String areaCode) { public Map<String, Object> getAccessSituation(String areaCode, String stationId) {
IPage<Map<String, Object>> page = operationData(areaCode); IPage<Map<String, Object>> page = operationData(areaCode,stationId);
List<Map<String, Object>> records = page.getRecords(); List<Map<String, Object>> records = page.getRecords();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (!CollectionUtils.isEmpty(records)) { if (!CollectionUtils.isEmpty(records)) {
......
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