excel批量导入、bug修改 --renpc

This commit is contained in:
Renpc-kilig 2023-11-16 18:21:55 +08:00
parent 01d006b60c
commit 11f80c4e6d
9 changed files with 46 additions and 1 deletions

View File

@ -203,11 +203,17 @@ public class ResidentialController extends AbstractController {
params.put("streetName", data.getStreet());
params.put("communityName", data.getCommunity());
params.put("name", data.getResidential());
// 获取社区ID
String communityId = residentialService.getCommunityId(data.getCommunity());
String streetId = residentialService.getStreetId(data.getStreet());
List<ResidentialDTO> residentialDTOList = residentialService.list(params);
if(CollectionUtils.isEmpty(residentialDTOList)) {
ResidentialVO residentialVO = new ResidentialVO();
residentialVO.setStreetName(data.getStreet());
residentialVO.setCommunityName(data.getCommunity());
residentialVO.setCommunity(communityId);
residentialVO.setStreet(streetId);
residentialVO.setName(data.getResidential());
residentialService.save(residentialVO);
}
@ -220,6 +226,8 @@ public class ResidentialController extends AbstractController {
buildingVO.setCommunityName(data.getCommunity());
buildingVO.setResidentialId(residentialDTOList1.get(0).getResidentialId());
buildingVO.setResidentialName(residentialDTOList1.get(0).getName());
buildingVO.setCommunity(communityId);
buildingVO.setStreet(streetId);
buildingVO.setName(data.getName());
buildingVO.setBuildNum(data.getBuildingNum());
buildingVO.setUnitNum(data.getUnit());

View File

@ -117,4 +117,7 @@ public interface IResidentialDao {
*/
Integer count(Map<String, Object> params) throws SearchException;
String getCommunityId(String community);
String getStreetId(String street);
}

View File

@ -100,6 +100,8 @@ public class BatchHouseDTO {
private String houseId;
@ApiModelProperty(name = "name", value = "房屋编号")
private String name;
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
private String gmtCreate;
public String getHouseId() {
return houseId;
@ -116,6 +118,14 @@ public class BatchHouseDTO {
public void setName(String name) {
this.name = name;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
}
}

View File

@ -293,6 +293,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
if (j == houseDTO.getAffiliationUnit()) {
house.setHouseId(houseDTO.getHouseId());
house.setName(houseDTO.getHouseNum().toString());
house.setGmtCreate(houseDTO.getGmtCreate());
houseList.add(house);
}
}

View File

@ -79,6 +79,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
setSaveInfo(token, params);
}
params.put("bindTime", params.get("gmtCreate"));
params.put("outHouse", 0);
populationDao.save(params);
return populationId;
}

View File

@ -185,4 +185,7 @@ public interface IResidentialService {
*/
Integer count(Map<String, Object> params);
String getCommunityId(String community);
String getStreetId(String street);
}

View File

@ -184,4 +184,14 @@ public class ResidentialServiceImpl extends AbstractService implements IResident
return count == null ? 0 : count;
}
@Override
public String getCommunityId(String community) {
return residentialDao.getCommunityId(community);
}
@Override
public String getStreetId(String street) {
return residentialDao.getStreetId(street);
}
}

View File

@ -248,7 +248,8 @@
t1.house_id = hh.house_id
WHERE
t1.is_delete = 0
AND t1.out_house = 0 OR t1.out_house IS NULL
AND (t1.out_house = 0
OR t1.out_house IS NULL)
AND
hh.is_delete = 0
<if test="keywords != null and keywords != ''">

View File

@ -429,4 +429,12 @@
t1.is_delete = 0
</select>
<select id="getStreetId" parameterType="String" resultType="String">
SELECT dict_id FROM d_dict WHERE dict_name = #{street} and is_delete = 0
</select>
<select id="getCommunityId" parameterType="String" resultType="String">
SELECT community_id FROM d_community WHERE community_name = #{community} and is_delete = 0
</select>
</mapper>