Commit 7cc5be28 authored by wanghao's avatar wanghao

1 基础信息维护-居住区(村庄)查询-外部对接接口开发

parent 2a38f679
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.zehong.common.core.domain.AjaxResult; import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
...@@ -12,10 +13,8 @@ import com.zehong.system.mapper.TEnterpriseInfoMapper; ...@@ -12,10 +13,8 @@ import com.zehong.system.mapper.TEnterpriseInfoMapper;
import com.zehong.system.service.*; import com.zehong.system.service.*;
import com.zehong.web.controller.tool.DESEncoder; import com.zehong.web.controller.tool.DESEncoder;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
...@@ -86,7 +85,6 @@ public class lpgGasController { ...@@ -86,7 +85,6 @@ public class lpgGasController {
@Resource @Resource
private ITUserManageVillageService itUserManageVillageService; private ITUserManageVillageService itUserManageVillageService;
@Resource @Resource
DecryptService decryptService; DecryptService decryptService;
...@@ -2150,6 +2148,38 @@ public class lpgGasController { ...@@ -2150,6 +2148,38 @@ public class lpgGasController {
} }
/**
* 查询基本信息维护-用户管理-居住区(村庄)列表
*/
@GetMapping("/queryUserManageVillage")
public AjaxResult queryUserManageVillage(Integer pageNum,Integer pageSize,String qybm)
{
if (pageNum == null || pageSize == null || StringUtils.isBlank(qybm)) {
return AjaxResult.error("分页参数会企业编码不许不为空!!!");
}
if (pageSize > 1000) {
return AjaxResult.error("分页参数不能超过1000");
}
keyInformation selectkey = decryptService.selectkey(qybm);
if (selectkey == null) {
return AjaxResult.error("企业编码不存在!!!");
}
TEnterpriseInfo tEnterpriseInfo = tEnterpriseInfoMapper.selectTEnterpriseInfoById(selectkey.getEnterpriseId());
if (tEnterpriseInfo == null) {
return AjaxResult.error("监管平台配置企业信息不存在!!!");
}
return AjaxResult.success(itUserManageVillageService.queryUserManageVillageForThirdParty(pageNum,pageSize));
}
/** /**
* 创建 居住区(村庄)接口 * 创建 居住区(村庄)接口
* @return r * @return r
...@@ -2333,7 +2363,7 @@ public class lpgGasController { ...@@ -2333,7 +2363,7 @@ public class lpgGasController {
} }
userManageVillage.setfVillageName(fVillageName); userManageVillage.setfVillageName(fVillageName);
userManageVillage.setCountyCoude(countyCode); userManageVillage.setCountyCode(countyCode);
userManageVillage.setfTotalNumHouse(fTotalNumHousel); userManageVillage.setfTotalNumHouse(fTotalNumHousel);
userManageVillage.setfPipeGasUsers(fPipeGasUsersl); userManageVillage.setfPipeGasUsers(fPipeGasUsersl);
userManageVillage.setfBottledGasUsers(fBottledGasUsersl); userManageVillage.setfBottledGasUsers(fBottledGasUsersl);
...@@ -2349,16 +2379,16 @@ public class lpgGasController { ...@@ -2349,16 +2379,16 @@ public class lpgGasController {
if (userManageVillages.size() > 0) { if (userManageVillages.size() > 0) {
//1 查看 录入的行政区是否符合要求 //1 查看 录入的行政区是否符合要求
List<String> collect = userManageVillages.stream().filter(item -> StringUtils.isNotBlank(item.getCountyCoude())) List<String> collect = userManageVillages.stream().filter(item -> StringUtils.isNotBlank(item.getCountyCode()))
.map(TUserManageVillage::getCountyCoude).collect(Collectors.toList()); .map(TUserManageVillage::getCountyCode).collect(Collectors.toList());
List<TCountyLevelRegion> tCountyLevelRegions = countyLevelRegionService.queryByCountyCodes(collect); List<TCountyLevelRegion> tCountyLevelRegions = countyLevelRegionService.queryByCountyCodes(collect);
Map<String, List<TCountyLevelRegion>> collect1 = tCountyLevelRegions.stream().collect(Collectors.groupingBy(TCountyLevelRegion::getfCountyCode)); Map<String, List<TCountyLevelRegion>> collect1 = tCountyLevelRegions.stream().collect(Collectors.groupingBy(TCountyLevelRegion::getfCountyCode));
Iterator<TUserManageVillage> iterator = userManageVillages.iterator(); Iterator<TUserManageVillage> iterator = userManageVillages.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
TUserManageVillage next = iterator.next(); TUserManageVillage next = iterator.next();
if (StringUtils.isNotBlank(next.getCountyCoude())) { if (StringUtils.isNotBlank(next.getCountyCode())) {
List<TCountyLevelRegion> tCountyLevelRegions1 = collect1.get(next.getCountyCoude()); List<TCountyLevelRegion> tCountyLevelRegions1 = collect1.get(next.getCountyCode());
if (tCountyLevelRegions1 == null || tCountyLevelRegions1.size() == 0) { if (tCountyLevelRegions1 == null || tCountyLevelRegions1.size() == 0) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createUserManageVillage", next.toString(), lpgThirdPartyDockingInterfaceRecord = errorRecord("createUserManageVillage", next.toString(),
"县(市、区)行政区划编码 不符合要求!!!", encryption.getQybm()); "县(市、区)行政区划编码 不符合要求!!!", encryption.getQybm());
......
...@@ -66,7 +66,7 @@ public class TUserManageVillage extends BaseEntity ...@@ -66,7 +66,7 @@ public class TUserManageVillage extends BaseEntity
/** /**
* 县(市、区)行政区划编码 第三方接口对接时使用 * 县(市、区)行政区划编码 第三方接口对接时使用
*/ */
private String countyCoude; private String countyCode;
public void setfVillageId(Long fVillageId) public void setfVillageId(Long fVillageId)
{ {
...@@ -174,12 +174,12 @@ public class TUserManageVillage extends BaseEntity ...@@ -174,12 +174,12 @@ public class TUserManageVillage extends BaseEntity
this.beyondEnterpriseName = beyondEnterpriseName; this.beyondEnterpriseName = beyondEnterpriseName;
} }
public String getCountyCoude() { public String getCountyCode() {
return countyCoude; return countyCode;
} }
public void setCountyCoude(String countyCoude) { public void setCountyCode(String countyCode) {
this.countyCoude = countyCoude; this.countyCode = countyCode;
} }
@Override @Override
...@@ -205,7 +205,7 @@ public class TUserManageVillage extends BaseEntity ...@@ -205,7 +205,7 @@ public class TUserManageVillage extends BaseEntity
.append("fBottledGasUsers", getfBottledGasUsers()) .append("fBottledGasUsers", getfBottledGasUsers())
.append("longitude", getLongitude()) .append("longitude", getLongitude())
.append("latitude", getLatitude()) .append("latitude", getLatitude())
.append("countyCoude", getCountyCoude()) .append("countyCoude", getCountyCode())
.append("remarks", getRemarks()) .append("remarks", getRemarks())
.toString(); .toString();
} }
......
package com.zehong.system.domain.vo;
import java.math.BigDecimal;
public class TUserManageVillageThirdPartyVo {
/**
* 名称
*/
private String fVillageName;
/**
* 县级行政区名称
*/
private String fRegionName;
/**
* 县级行政区编码
*/
private String countyCode;
/**
* 居民总户数
*/
private Long fTotalNumHouse;
/**
* 管道燃气用户数
*/
private Long fPipeGasUsers;
/**
* 瓶装燃气用户数
*/
private Long fBottledGasUsers;
/** 经度 */
private BigDecimal longitude;
/** 纬度 */
private BigDecimal latitude;
/** 备注 */
private String remarks;
public String getfVillageName() {
return fVillageName;
}
public void setfVillageName(String fVillageName) {
this.fVillageName = fVillageName;
}
public String getfRegionName() {
return fRegionName;
}
public void setfRegionName(String fRegionName) {
this.fRegionName = fRegionName;
}
public String getCountyCode() {
return countyCode;
}
public void setCountyCode(String countyCode) {
this.countyCode = countyCode;
}
public Long getfTotalNumHouse() {
return fTotalNumHouse;
}
public void setfTotalNumHouse(Long fTotalNumHouse) {
this.fTotalNumHouse = fTotalNumHouse;
}
public Long getfPipeGasUsers() {
return fPipeGasUsers;
}
public void setfPipeGasUsers(Long fPipeGasUsers) {
this.fPipeGasUsers = fPipeGasUsers;
}
public Long getfBottledGasUsers() {
return fBottledGasUsers;
}
public void setfBottledGasUsers(Long fBottledGasUsers) {
this.fBottledGasUsers = fBottledGasUsers;
}
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
...@@ -29,6 +29,12 @@ public interface TUserManageVillageMapper ...@@ -29,6 +29,12 @@ public interface TUserManageVillageMapper
*/ */
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage); public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 提供给第三方使用的查询接口
* @return r
*/
public List<TUserManageVillage> queryUserManageVillageForThirdParty();
/** /**
* 导出用 * 导出用
* @param tUserManageVillage tUserManageVillage * @param tUserManageVillage tUserManageVillage
......
...@@ -27,6 +27,14 @@ public interface ITUserManageVillageService ...@@ -27,6 +27,14 @@ public interface ITUserManageVillageService
*/ */
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage); public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 提供给第三方使用的 分页查询
* @param pageNum p
* @param pageSize p
* @return r
*/
public List<TUserManageVillage> queryUserManageVillageForThirdParty(Integer pageNum,Integer pageSize);
/** /**
* 查询基本信息维护-用户管理-居住区(村庄)列表 * 查询基本信息维护-用户管理-居住区(村庄)列表
* *
......
...@@ -2,8 +2,11 @@ package com.zehong.system.service.impl; ...@@ -2,8 +2,11 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils; import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserManageVillageMapper; import com.zehong.system.mapper.TUserManageVillageMapper;
import com.zehong.system.domain.TUserManageVillage; import com.zehong.system.domain.TUserManageVillage;
...@@ -50,6 +53,21 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService ...@@ -50,6 +53,21 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
return tUserManageVillageMapper.selectTUserManageVillageList(tUserManageVillage); return tUserManageVillageMapper.selectTUserManageVillageList(tUserManageVillage);
} }
/**
* 提供给第三方使用的 分页查询
* @param pageNum p
* @param pageSize p
* @return
*/
@Override
public List<TUserManageVillage> queryUserManageVillageForThirdParty(Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum,pageSize);
List<TUserManageVillage> userManageVillages = tUserManageVillageMapper.queryUserManageVillageForThirdParty();
PageInfo<TUserManageVillage> pageInfo = new PageInfo<>(userManageVillages);
return pageInfo.getList();
}
/** /**
* 查询基本信息维护-用户管理-居住区(村庄)导出 * 查询基本信息维护-用户管理-居住区(村庄)导出
* *
......
...@@ -18,6 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,6 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="beyondEnterpriseName" column="enterprise_name" /> <result property="beyondEnterpriseName" column="enterprise_name" />
</resultMap> </resultMap>
<resultMap type="TUserManageVillageThirdPartyVo" id="TUserManageVillageThirdPartyVoResult">
<result property="fVillageName" column="f_village_name" />
<result property="fRegionName" column="fRegionName" />
<result property="countyCode" column="countyCode" />
<result property="fTotalNumHouse" column="f_total_num_house" />
<result property="fPipeGasUsers" column="f_pipe_gas_users" />
<result property="fBottledGasUsers" column="f_bottled_gas_users" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTUserManageVillageVo"> <sql id="selectTUserManageVillageVo">
select village.f_village_id, select village.f_village_id,
village.f_village_name, village.f_village_name,
...@@ -79,6 +91,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -79,6 +91,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"> and f_beyond_enterprise_id = #{beyondEnterpriseId} </if> <if test="beyondEnterpriseId != null and beyondEnterpriseId != '-2' and beyondEnterpriseId != ''"> and f_beyond_enterprise_id = #{beyondEnterpriseId} </if>
</where> </where>
</select> </select>
<select id="queryUserManageVillageForThirdParty" resultMap="TUserManageVillageThirdPartyVoResult">
select village.f_village_id,
village.f_village_name,
region.f_name as fRegionName,
region.f_county_code as countyCode,
village.f_total_num_house,
village.f_pipe_gas_users,
village.f_bottled_gas_users,
village.longitude,
village.latitude,
village.remarks
from t_user_manage_village village
left join t_county_level_region region on village.f_region = region.f_id
</select>
<select id="exportUserManageVillageList" parameterType="TUserManageVillage" resultMap="exportTUserManageVillageResult"> <select id="exportUserManageVillageList" parameterType="TUserManageVillage" resultMap="exportTUserManageVillageResult">
<include refid="exportTUserManageVillageVo"/> <include refid="exportTUserManageVillageVo"/>
......
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