From 72f332b3795caf918b0b5cd9d6a53c58a9994d47 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Mon, 26 Aug 2024 16:38:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bocloud/sms/service/IndexServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java index 53b4b26..2558b30 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java @@ -34,8 +34,8 @@ public class IndexServiceImpl implements IndexService { String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); log.info("result"); - JSONArray dataArray = JSONArray.parseArray(result); - return new GeneralResult(true, dataArray,"查询成功"); + JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class); + return new GeneralResult(true, jsonObject,"查询成功"); } catch (Exception e) { log.info("查询失败",e); return new GeneralResult(false, "查询失败"); From b3f4c0b185de738de0b620ac2a056bf9422afe96 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Mon, 26 Aug 2024 16:49:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BB=A3=E5=8A=9E?= =?UTF-8?q?=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IndexDataController.java | 8 ++- .../bocloud/sms/interfaces/IndexService.java | 2 + .../bocloud/sms/service/IndexServiceImpl.java | 55 ++++++++++++++++--- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java b/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java index a3ce543..95997aa 100644 --- a/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java +++ b/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java @@ -30,7 +30,13 @@ public class IndexDataController { @GetMapping("/doneWorkOrder") @Operation(summary = "待办工单列表") - public GeneralResult list(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext requestContext) { + public GeneralResult doneWorkOrder(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext requestContext) { return indexService.doneWorkOrder(pager, requestContext); } + + @GetMapping("/workOrder/stattic") + @Operation(summary = "待办工单列表") + public GeneralResult workOrderStatic(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext requestContext) { + return indexService.workOrderStatic(requestContext); + } } diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java index a767c98..6dc7302 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java @@ -9,4 +9,6 @@ import java.util.List; public interface IndexService { GeneralResult doneWorkOrder(Pager pager, RequestContext requestContext); + + GeneralResult workOrderStatic(RequestContext requestContext); } diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java index 2558b30..6fb7bc7 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java @@ -14,6 +14,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + @Service("IndexService") @Slf4j public class IndexServiceImpl implements IndexService { @@ -28,16 +32,53 @@ public class IndexServiceImpl implements IndexService { try { JSONObject param = new JSONObject(); User user = userRepository.query(requestContext.getTarget()); - param.put("userId","1111"); - param.put("page",pager.getPage()); - param.put("limit",pager.getRows()); + param.put("userId", "1111"); + param.put("page", pager.getPage()); + param.put("limit", pager.getRows()); String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); - - log.info("result"); + log.info("result:" + result); JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class); - return new GeneralResult(true, jsonObject,"查询成功"); + return new GeneralResult(true, jsonObject, "查询成功"); } catch (Exception e) { - log.info("查询失败",e); + log.info("查询失败", e); + return new GeneralResult(false, "查询失败"); + } + } + + @Override + public GeneralResult workOrderStatic(RequestContext requestContext) { + try { + + JSONObject param = new JSONObject(); + User user = userRepository.query(requestContext.getTarget()); + param.put("userId", "1111"); + param.put("page",1); + param.put("limit", Integer.MAX_VALUE); + String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); + log.info("result:" + result); + JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class); + Integer total = jsonObject.getInteger("total"); + + Map resultMap = new HashMap<>(); + resultMap.put("orderTotal",total); + + List data = JSONObject.parseObject(jsonObject.getString("data"), List.class); + Integer waitDoneTotal = 0; + Integer doneTotal = 0; + for (JSONObject obj : data) { + if("0".equals(obj.getString("approve_status"))){ + waitDoneTotal++; + }else { + doneTotal++; + } + } + + resultMap.put("waitDoneTotal",waitDoneTotal); + resultMap.put("doneTotal",doneTotal); + + return new GeneralResult(true, "查询成功"); + } catch (Exception e) { + log.info("查询失败", e); return new GeneralResult(false, "查询失败"); } } From 6bacdb06bc02156bc8770f7717b465779e865b5b Mon Sep 17 00:00:00 2001 From: guyuliang Date: Mon, 26 Aug 2024 16:51:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BB=A3=E5=8A=9E?= =?UTF-8?q?=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bocloud/sms/service/IndexServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java index 6fb7bc7..b522552 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java @@ -36,7 +36,6 @@ public class IndexServiceImpl implements IndexService { param.put("page", pager.getPage()); param.put("limit", pager.getRows()); String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); - log.info("result:" + result); JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class); return new GeneralResult(true, jsonObject, "查询成功"); } catch (Exception e) { @@ -55,7 +54,6 @@ public class IndexServiceImpl implements IndexService { param.put("page",1); param.put("limit", Integer.MAX_VALUE); String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); - log.info("result:" + result); JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class); Integer total = jsonObject.getInteger("total"); @@ -76,7 +74,7 @@ public class IndexServiceImpl implements IndexService { resultMap.put("waitDoneTotal",waitDoneTotal); resultMap.put("doneTotal",doneTotal); - return new GeneralResult(true, "查询成功"); + return new GeneralResult(true, resultMap,"查询成功"); } catch (Exception e) { log.info("查询失败", e); return new GeneralResult(false, "查询失败");