pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrDivide.java
@@ -61,7 +61,7 @@ */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "所在村不能为空") // @NotNull(message = "所在村不能为空") private Long villageid; /** @@ -84,7 +84,7 @@ * 覆盖村 */ @Schema(description = "覆盖村", requiredMode = Schema.RequiredMode.REQUIRED) @Length(message = "覆盖村不大于{max}字,不小于{min}字", min = 1, max = 100) @Length(message = "覆盖村不大于{max}字", max = 100) private String villages; /** @@ -104,7 +104,7 @@ */ @Schema(description = "联系电话", requiredMode = Schema.RequiredMode.REQUIRED) //@NotBlank(message = "联系电话不能为空") @Length(message = "农联系电话必须{max}位数据", min = 11, max = 11) @Length(message = "农联系电话必须{max}位数据", max = 11) private String phone; /** @@ -125,7 +125,7 @@ * 备注信息 */ @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @Length(message = "备注不大于{max}字,不小于{min}字", min = 1, max = 200) @Length(message = "备注不大于{max}字", max = 200) private String remarks; /** pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
@@ -239,9 +239,9 @@ COUNT(*) AS recordCount FROM pr_divide divi INNER JOIN ba_block blo ON divi.blockId = blo.id INNER JOIN ba_district country ON divi.countyId = country.id INNER JOIN ba_district town ON divi.townId = town.id INNER JOIN ba_district village ON divi.villageid = village.id Left JOIN ba_district country ON divi.countyId = country.id Left JOIN ba_district town ON divi.townId = town.id Left JOIN ba_district village ON divi.villageid = village.id , (SELECT @i:=0) AS itable <where> divi. deleted = 0 @@ -275,16 +275,15 @@ divi.operateDt FROM pr_divide divi INNER JOIN ba_block blo ON divi.blockId = blo.id INNER JOIN ba_district country ON divi.countyId = country.id INNER JOIN ba_district town ON divi.townId = town.id INNER JOIN ba_district village ON divi.villageid = village.id Left JOIN ba_district country ON divi.countyId = country.id Left JOIN ba_district town ON divi.townId = town.id Left JOIN ba_district village ON divi.villageid = village.id , (SELECT @i:=0) AS itable <where> divi. deleted = 0 <if test = "divideName != null and divideName !=''"> AND divi.name LIKE CONCAT('%',#{divideName},'%') </if> <if test = "blockId != null and blockId !=''"> AND divi.blockId = #{blockId} pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -227,11 +227,11 @@ AND ge.name LIKE CONCAT('%', #{intakeName}, '%') </if> <if test = "divideId != null"> <if test = "divideId != null and divideId !=''"> AND divi.id = #{divideId} </if> <if test = "blockId != null"> <if test = "blockId != null and blockId !=''"> AND blo.id = #{blockId} </if> @@ -283,11 +283,11 @@ AND ge.name LIKE CONCAT('%', #{intakeName}, '%') </if> <if test = "divideId != null"> <if test = "divideId != null and divideId !=''"> AND divi.id = #{divideId} </if> <if test = "blockId != null"> <if test = "blockId != null and blockId !=''"> AND blo.id = #{blockId} </if> pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java
@@ -134,20 +134,21 @@ // 接收村编号(主键) Long villageId = po.getVillageId(); /** * 获取5级行政区划信息 */ Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); if(map_districts.size() <= 0) { return BaseResponseUtils.buildFail("区划信息有误"); } PrDivide prDivide = DtoToDividePojo.INSTANCT.po2vo(po); Long countryId = Long.parseLong(map_districts.get("countryId").toString()); Long townId = Long.parseLong(map_districts.get("townId").toString()); prDivide.setCountyid(countryId); prDivide.setTownid(townId); if (villageId!=null){ /** * 获取5级行政区划信息 */ Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); if(map_districts.size() <= 0) { return BaseResponseUtils.buildFail("区划信息有误"); } Long countryId = Long.parseLong(map_districts.get("countryId").toString()); Long townId = Long.parseLong(map_districts.get("townId").toString()); prDivide.setCountyid(countryId); prDivide.setTownid(townId); } Date operateTime = new Date(); prDivide.setOperatedt(operateTime); @@ -220,19 +221,19 @@ // 接收村编号(主键) Long villageId = po.getVillageid(); /** * 获取5级行政区划信息 */ Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); if(map_districts.size() <= 0) { return BaseResponseUtils.buildFail("区划信息有误"); if (villageId!=null){ /** * 获取5级行政区划信息 */ Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); if(map_districts.size() <= 0) { return BaseResponseUtils.buildFail("区划信息有误"); } Long countryId = Long.parseLong(map_districts.get("countryId").toString()); Long townId = Long.parseLong(map_districts.get("townId").toString()); po.setCountyid(countryId); po.setTownid(townId); } Long countryId = Long.parseLong(map_districts.get("countryId").toString()); Long townId = Long.parseLong(map_districts.get("townId").toString()); po.setCountyid(countryId); po.setTownid(townId); Date operateTime = new Date(); po.setOperatedt(operateTime); pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DtoDivide.java
@@ -22,7 +22,7 @@ * 所在村 */ @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "所在村不能为空") // @NotNull(message = "所在村不能为空") private Long villageId; /**