Commit 2a38f679 authored by wanghao's avatar wanghao

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

parent 6d824f6e
......@@ -159,28 +159,39 @@ public class DESEncoder {
// System.out.println(DESEncoder.encrypt(skcs1,"23546324"));
String lpggasdata = "[\n" +
" {\n" +
" \"bottleCode\": \"32323\",\n" +
" \"userOwnId\": \"1\",\n" +
" \"stationName\": \"储备站-接口来的-01\",\n" +
" \"deliveryPerson\": \"配送人-接口来的-01\",\n" +
" \"vehicleCode\": \"车辆代码-接口来的-01\",\n" +
" \"gasUserType\": \"1\",\n" +
" \"deliveryAddress\": \"配送地址-接口来的-01\",\n" +
" \"deliveryDate\": \"2024-12-21 23:12:20\"\n" +
" },\n" +
" {\n" +
" \"bottleCode\": \"222222\",\n" +
" \"userOwnId\": \"89\",\n" +
" \"stationName\": \"储备站-接口来的-01\",\n" +
" \"deliveryPerson\": \"配送人-接口来的-01\",\n" +
" \"vehicleCode\": \"车辆代码-接口来的-01\",\n" +
" \"gasUserType\": \"0\",\n" +
" \"deliveryAddress\": \"配送地址-接口来的-01\",\n" +
" \"deliveryDate\": \"2024-12-21 23:12:21\"\n" +
" }\n" +
"]\n" +
"\n";
"\t{\n" +
"\t\t\"fVillageName\":\"村庄名称-接口来的-01\",\n" +
"\t\t\"fTotalNumHouse\":\"49\",\n" +
"\t\t\"countyCode\":\"130104\",\n" +
"\t\t\"fBottledGasUsers\":\"15\",\n" +
"\t\t\"fPipeGasUsers\":\"14\",\n" +
"\t\t\"longitude\":\"14.56\",\n" +
"\t\t\"latitude\":\"18.96\",\n" +
"\t\t\"remarks\":\"备注-接口来的-01\"\n" +
"\t},\n" +
"\t{\n" +
"\n" +
"\t\t\"fVillageName\":\"村庄名称-接口来的-02\",\n" +
"\t\t\"fTotalNumHouse\":\"49\",\n" +
"\t\t\"countyCode\":\"130105\",\n" +
"\t\t\"fBottledGasUsers\":\"15\",\n" +
"\t\t\"fPipeGasUsers\":\"14\",\n" +
"\t\t\"longitude\":\"14.56\",\n" +
"\t\t\"latitude\":\"18.96\",\n" +
"\t\t\"remarks\":\"备注-接口来的-01\"\n" +
"\t},\n" +
"\t{\n" +
"\n" +
"\t\t\"fVillageName\":\"村庄名称-接口来的-02\",\n" +
"\t\t\"fTotalNumHouse\":\"49\",\n" +
"\t\t\"countyCode\":\"130107\",\n" +
"\t\t\"fBottledGasUsers\":\"15\",\n" +
"\t\t\"fPipeGasUsers\":\"14\",\n" +
"\t\t\"longitude\":\"14.56\",\n" +
"\t\t\"latitude\":\"18.96\",\n" +
"\t\t\"remarks\":\"备注-接口来的-01\"\n" +
"\t}\n" +
"]";
JSONArray objects = JSON.parseArray(lpggasdata);
System.out.println(objects);
......
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Objects;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
......@@ -61,6 +63,11 @@ public class TUserManageVillage extends BaseEntity
/** 备注 */
private String remarks;
/**
* 县(市、区)行政区划编码 第三方接口对接时使用
*/
private String countyCoude;
public void setfVillageId(Long fVillageId)
{
this.fVillageId = fVillageId;
......@@ -167,6 +174,26 @@ public class TUserManageVillage extends BaseEntity
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getCountyCoude() {
return countyCoude;
}
public void setCountyCoude(String countyCoude) {
this.countyCoude = countyCoude;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
TUserManageVillage tUserManageVillage = (TUserManageVillage) obj;
return Objects.equals(fVillageName,tUserManageVillage.getfVillageName());
}
@Override
public int hashCode() {
return Objects.hash(fVillageName);
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......@@ -178,6 +205,7 @@ public class TUserManageVillage extends BaseEntity
.append("fBottledGasUsers", getfBottledGasUsers())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("countyCoude", getCountyCoude())
.append("remarks", getRemarks())
.toString();
}
......
......@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TCountyLevelRegion;
import org.apache.ibatis.annotations.Param;
/**
* 县级行政区Mapper接口
......@@ -27,6 +28,12 @@ public interface TCountyLevelRegionMapper
*/
public List<TCountyLevelRegion> selectTCountyLevelRegionList(TCountyLevelRegion tCountyLevelRegion);
/**
* 根据 countyCodes 集合查询数据
* @param list c
* @return r
*/
public List<TCountyLevelRegion> queryByCountyCodes(@Param("list") List<String> list);
/**
* 根据city_code 查询
* @param fCityId c
......
......@@ -2,6 +2,8 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TUserManageVillage;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
/**
* 基本信息维护-用户管理-居住区(村庄)Mapper接口
......@@ -34,6 +36,12 @@ public interface TUserManageVillageMapper
*/
public List<TUserManageVillage> exportUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 根据 村名称集合 查询 村列表
* @param list v
* @return r
*/
List<TUserManageVillage> queryByVillageNames(@Param("list") List<String> list);
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
......@@ -42,6 +50,12 @@ public interface TUserManageVillageMapper
*/
public int insertTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 批量插入
* @param userManageVillages s
* @return s
*/
int insertBatch(List<TUserManageVillage> userManageVillages);
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
......
......@@ -27,6 +27,13 @@ public interface ITCountyLevelRegionService
*/
public List<TCountyLevelRegion> selectTCountyLevelRegionList(TCountyLevelRegion tCountyLevelRegion);
/**
* 根据县(市、区)行政区划编码 集合查询数据
* @param countyCodes c
* @return r
*/
public List<TCountyLevelRegion> queryByCountyCodes(List<String> countyCodes);
/**
* 新增县级行政区
*
......
......@@ -34,6 +34,13 @@ public interface ITUserManageVillageService
* @return 基本信息维护-用户管理-居住区(村庄)集合
*/
public List<TUserManageVillage> exportTUserManageVillageList(TUserManageVillage tUserManageVillage);
/**
* 根据 名称集合查询 村列表
* @param villageNames v
* @return r
*/
public List<TUserManageVillage> queryByVillageNames(List<String> villageNames);
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
......@@ -42,6 +49,13 @@ public interface ITUserManageVillageService
*/
public int insertTUserManageVillage(TUserManageVillage tUserManageVillage);
/**
* 批量插入
* @param userManageVillages s
* @return r
*/
public int insertBatch(List<TUserManageVillage> userManageVillages);
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
......
......@@ -23,7 +23,7 @@ import javax.annotation.Resource;
@Service
public class TCountyLevelRegionServiceImpl implements ITCountyLevelRegionService
{
@Autowired
@Resource
private TCountyLevelRegionMapper tCountyLevelRegionMapper;
@Resource
......@@ -53,6 +53,16 @@ public class TCountyLevelRegionServiceImpl implements ITCountyLevelRegionService
return tCountyLevelRegionMapper.selectTCountyLevelRegionList(tCountyLevelRegion);
}
/**
* 根据 县(市、区)行政区划编码 查询数据
* @param countyCodes c
* @return r
*/
@Override
public List<TCountyLevelRegion> queryByCountyCodes(List<String> countyCodes) {
return tCountyLevelRegionMapper.queryByCountyCodes(countyCodes);
}
/**
* 新增县级行政区
*
......
......@@ -4,12 +4,13 @@ import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserManageVillageMapper;
import com.zehong.system.domain.TUserManageVillage;
import com.zehong.system.service.ITUserManageVillageService;
import javax.annotation.Resource;
/**
* 基本信息维护-用户管理-居住区(村庄)Service业务层处理
*
......@@ -19,7 +20,7 @@ import com.zehong.system.service.ITUserManageVillageService;
@Service
public class TUserManageVillageServiceImpl implements ITUserManageVillageService
{
@Autowired
@Resource
private TUserManageVillageMapper tUserManageVillageMapper;
/**
......@@ -63,6 +64,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
return tUserManageVillageMapper.exportUserManageVillageList(tUserManageVillage);
}
/**
* 根据 村名称集合 查询 村集合
* @param villageNames v
* @return r
*/
@Override
public List<TUserManageVillage> queryByVillageNames(List<String> villageNames) {
return tUserManageVillageMapper.queryByVillageNames(villageNames);
}
/**
* 新增基本信息维护-用户管理-居住区(村庄)
*
......@@ -75,6 +86,16 @@ public class TUserManageVillageServiceImpl implements ITUserManageVillageService
return tUserManageVillageMapper.insertTUserManageVillage(tUserManageVillage);
}
/**
* 批量插入
* @param userManageVillages s
* @return r
*/
@Override
public int insertBatch(List<TUserManageVillage> userManageVillages) {
return tUserManageVillageMapper.insertBatch(userManageVillages);
}
/**
* 修改基本信息维护-用户管理-居住区(村庄)
*
......
......@@ -26,6 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fIsMajor != null "> and f_is_major = #{fIsMajor}</if>
</where>
</select>
<select id="queryByCountyCodes" resultMap="TCountyLevelRegionResult">
<include refid="selectTCountyLevelRegionVo"></include>
where f_county_code in
<foreach collection="list" index="i" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="queryByCityId" resultMap="TCountyLevelRegionResult">
<include refid="selectTCountyLevelRegionVo"/>
where f_city_id = #{fCityId}
......
......@@ -87,12 +87,31 @@ 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="queryByVillageNames" parameterType="list" resultMap="TUserManageVillageResult">
<include refid="exportTUserManageVillageVo"/>
where f_village_name in
<foreach collection="list" close=")" separator="," open="(" item="item" index="i">
#{item}
</foreach>
</select>
<select id="selectTUserManageVillageById" parameterType="Long" resultMap="TUserManageVillageResult">
<include refid="selectTUserManageVillageVo"/>
where f_village_id = #{fVillageId}
</select>
<insert id="insertBatch" parameterType="list">
insert into t_user_manage_village (f_village_name, f_region,f_total_num_house, f_pipe_gas_users, f_bottled_gas_users,
longitude,latitude,remarks)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.fVillageName,jdbcType=VARCHAR}, #{item.fRegion}, #{item.fTotalNumHouse},
#{item.fPipeGasUsers}, #{item.fBottledGasUsers},#{item.longitude},#{item.latitude},#{item.remarks}
)
</foreach>
</insert>
<insert id="insertTUserManageVillage" parameterType="TUserManageVillage" useGeneratedKeys="true" keyProperty="fVillageId">
insert into t_user_manage_village
<trim prefix="(" suffix=")" suffixOverrides=",">
......
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