Commit 7cc5be28 authored by wanghao's avatar wanghao

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

parent 2a38f679
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
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.StringUtils;
import com.zehong.system.domain.*;
......@@ -12,10 +13,8 @@ import com.zehong.system.mapper.TEnterpriseInfoMapper;
import com.zehong.system.service.*;
import com.zehong.web.controller.tool.DESEncoder;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
......@@ -86,7 +85,6 @@ public class lpgGasController {
@Resource
private ITUserManageVillageService itUserManageVillageService;
@Resource
DecryptService decryptService;
......@@ -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
......@@ -2333,7 +2363,7 @@ public class lpgGasController {
}
userManageVillage.setfVillageName(fVillageName);
userManageVillage.setCountyCoude(countyCode);
userManageVillage.setCountyCode(countyCode);
userManageVillage.setfTotalNumHouse(fTotalNumHousel);
userManageVillage.setfPipeGasUsers(fPipeGasUsersl);
userManageVillage.setfBottledGasUsers(fBottledGasUsersl);
......@@ -2349,16 +2379,16 @@ public class lpgGasController {
if (userManageVillages.size() > 0) {
//1 查看 录入的行政区是否符合要求
List<String> collect = userManageVillages.stream().filter(item -> StringUtils.isNotBlank(item.getCountyCoude()))
.map(TUserManageVillage::getCountyCoude).collect(Collectors.toList());
List<String> collect = userManageVillages.stream().filter(item -> StringUtils.isNotBlank(item.getCountyCode()))
.map(TUserManageVillage::getCountyCode).collect(Collectors.toList());
List<TCountyLevelRegion> tCountyLevelRegions = countyLevelRegionService.queryByCountyCodes(collect);
Map<String, List<TCountyLevelRegion>> collect1 = tCountyLevelRegions.stream().collect(Collectors.groupingBy(TCountyLevelRegion::getfCountyCode));
Iterator<TUserManageVillage> iterator = userManageVillages.iterator();
while (iterator.hasNext()) {
TUserManageVillage next = iterator.next();
if (StringUtils.isNotBlank(next.getCountyCoude())) {
List<TCountyLevelRegion> tCountyLevelRegions1 = collect1.get(next.getCountyCoude());
if (StringUtils.isNotBlank(next.getCountyCode())) {
List<TCountyLevelRegion> tCountyLevelRegions1 = collect1.get(next.getCountyCode());
if (tCountyLevelRegions1 == null || tCountyLevelRegions1.size() == 0) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createUserManageVillage", next.toString(),
"县(市、区)行政区划编码 不符合要求!!!", encryption.getQybm());
......
......@@ -66,7 +66,7 @@ public class TUserManageVillage extends BaseEntity
/**
* 县(市、区)行政区划编码 第三方接口对接时使用
*/
private String countyCoude;
private String countyCode;
public void setfVillageId(Long fVillageId)
{
......@@ -174,12 +174,12 @@ public class TUserManageVillage extends BaseEntity
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getCountyCoude() {
return countyCoude;
public String getCountyCode() {
return countyCode;
}
public void setCountyCoude(String countyCoude) {
this.countyCoude = countyCoude;
public void setCountyCode(String countyCode) {
this.countyCode = countyCode;
}
@Override
......@@ -205,7 +205,7 @@ public class TUserManageVillage extends BaseEntity
.append("fBottledGasUsers", getfBottledGasUsers())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("countyCoude", getCountyCoude())
.append("countyCoude", getCountyCode())
.append("remarks", getRemarks())
.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
*/
public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 提供给第三方使用的查询接口
* @return r
*/
public List<TUserManageVillage> queryUserManageVillageForThirdParty();
/**
* 导出用
* @param tUserManageVillage tUserManageVillage
......
......@@ -27,6 +27,14 @@ public interface ITUserManageVillageService
*/
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;
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.utils.SecurityUtils;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserManageVillageMapper;
import com.zehong.system.domain.TUserManageVillage;
......@@ -50,6 +53,21 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
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"
<result property="beyondEnterpriseName" column="enterprise_name" />
</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">
select village.f_village_id,
village.f_village_name,
......@@ -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>
</where>
</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">
<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