From 0980124ec2e8deab58b072a83ebed43390d8024f Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 26 六月 2024 21:07:57 +0800
Subject: [PATCH] 2024-06-26 朱宝民 添加字典、字典项管理
---
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
index 0aed5d4..f0abe8f 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
@@ -15,6 +15,7 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
@@ -34,10 +35,11 @@
@Slf4j
@Tag(name = "鍐滄埛绠$悊", description = "鍐滄埛鎿嶄綔")
@RestController
-@RequestMapping(path="client")
+@RequestMapping(path = "client")
@RequiredArgsConstructor
public class ClientCtrl {
private final ClientSv clientSv;
+ //private final RedisUtils redisUtils;
/**
* 鑾峰彇鍐滄埛鍒楄〃
@@ -324,4 +326,53 @@
}
return BaseResponseUtils.buildSuccess(map_WaterTypes);
}
+
+ /**
+ * 鏍规嵁鏉慖D鑾峰彇12浣嶈鏀垮尯鍒�
+ * @param villageId
+ * @return
+ */
+ @Operation(summary = "鏍规嵁鏉慖D鑾峰彇12浣嶈鏀垮尯鍒�", description = "鏍规嵁鏉慖D鑾峰彇12浣嶈鏀垮尯鍒�")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = Boolean.class))}
+ )
+ })
+ @GetMapping(path = "district")
+ @SsoAop()
+ public BaseResponse<Boolean> getDistrictNum(@RequestParam("villageId") @NotNull(message = "鏉戠紪鍙蜂笉鑳戒负绌�") Long villageId){
+ /**
+ * 鑾峰彇5绾ц鏀垮尯鍒掍俊鎭�
+ */
+ Map map_districts = Optional.ofNullable(clientSv.getDistrictsByVillageId(villageId)).orElse(new HashMap());
+ if(map_districts.size() <= 0) {
+ return BaseResponseUtils.buildFail("鍖哄垝淇℃伅鏈夎");
+ }
+
+ String provinceNum = map_districts.get("provinceNum").toString();
+ String cityNum = map_districts.get("cityNum").toString();
+ String countyNum = map_districts.get("countyNum").toString();
+ String townNum = map_districts.get("townNum").toString();
+ String villageNum = map_districts.get("villageNum").toString();
+
+ // 鐢熸垚12浣�5绾ц鏀垮尯鍒掔紪鐮佷覆鍙婂悕绉颁覆
+ Long districtNum = Long.parseLong(provinceNum + cityNum + countyNum + townNum + villageNum);
+ //鑾峰彇椤圭洰缂栫爜
+ String projectNo = clientSv.getItemValue("projectNo");
+ //杞负int
+ Integer projectNo1 = Integer.valueOf(projectNo);
+ //杞负16杩涘埗
+// String projectNo2 = Integer.toHexString(projectNo1);
+// log.info(projectNo2);
+ String projectNo3 = String.format("%02x", projectNo1);
+ log.info(projectNo3);
+
+ Map map = new HashMap();
+ map.put("districtNum", districtNum);
+ map.put("projectNo",projectNo3);
+ return BaseResponseUtils.buildSuccess(map);
+ }
}
--
Gitblit v1.8.0