From 7a2fa8d7481a3eb0a39dc9e434776b7ae05013b0 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 03 七月 2024 08:44:16 +0800
Subject: [PATCH] 2024-07-03 朱宝民 获取充值记录兼容10位水卡编号
---
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java | 123 +++++++++++------------------------------
1 files changed, 33 insertions(+), 90 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
index 82e3354..d707242 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
@@ -10,15 +10,15 @@
import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper;
+import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
+import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voPr.VoOnLineIntake;
import com.dy.pipIrrGlobal.voRm.VoUnclosedValve;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
-import com.dy.pipIrrWechat.command.qo.OnLineIntakesQO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@@ -42,6 +42,7 @@
private final PrIntakeMapper prIntakeMapper;
private final PrWaterPriceMapper prWaterPriceMapper;
private final PrIntakeVcMapper prIntakeVcMapper;
+ private final SeClientCardMapper seClientCardMapper;
/**
* 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄
@@ -58,94 +59,6 @@
*/
public Double getPrice() {
return prWaterPriceMapper.getPrice();
- }
-
- /**
- * 娣诲姞鍛戒护鏃ュ織
- * @param po 鍛戒护鏃ュ織瀵硅薄
- * @return 瀛楃涓茬被鍨嬬殑涓婚敭
- */
- public Long insert(RmCommandHistory po) {
- rmCommandHistoryMapper.insert(po);
- return po.getId();
- }
-
- /**
- * 淇敼鍛戒护鏃ュ織淇℃伅
- * @param po 鍛戒护鏃ュ織瀵硅薄
- * @return 褰卞搷璁板綍鏁伴噺
- */
- public Integer update(RmCommandHistory po) {
- return rmCommandHistoryMapper.updateByPrimaryKeySelective(po);
- }
-
- /**
- * 鑾峰彇鍙栨按鍙e垪琛�
- * @return
- */
- public QueryResultVo<List<VoOnLineIntake>> selectOnLineIntakes(OnLineIntakesQO qo) {
- Command com = new Command() ;
- com.id = Command.defaultId;
- com.code = "LCD0001";
- com.type = "innerCommand";
-
- JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com));
-
- if(response != null && response.getString("code").equals("0001")) {
- JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap");
- HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class);
-
- JSONArray jsonArray = new JSONArray();
- for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("rtuAddr", entry.getKey());
- jsonObject.put("isOnLine", entry.getValue());
- jsonArray.add(jsonObject);
- }
-
- qo.setOnLineMap(jsonArray.toJSONString());
- Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
- Long itemTotal = prIntakeMapper.getOnLineIntakesCount(params);
-
- QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>() ;
- rsVo.pageSize = qo.pageSize ;
- rsVo.pageCurr = qo.pageCurr ;
- rsVo.calculateAndSet(itemTotal, params);
- rsVo.obj = prIntakeMapper.getOnLineIntakes(params);
- return rsVo;
- } else {
- QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>();
- return rsVo;
- }
- }
-
- /**
- * 鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛
- * @param operator
- * @return
- */
- public List<VoOnLineIntake> getUsedIntakes(Long operator) {
- Command com = new Command() ;
- com.id = Command.defaultId;
- com.code = "LCD0001";
- com.type = "innerCommand";
- JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com));
-
- if(response != null && response.getString("code").equals("0001")) {
- JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap");
- HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class);
-
- JSONArray jsonArray = new JSONArray();
- for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("rtuAddr", entry.getKey());
- jsonObject.put("isOnLine", entry.getValue());
- jsonArray.add(jsonObject);
- }
- return prIntakeMapper.getUsedIntakes(jsonArray.toJSONString(), operator);
- } else {
- return new ArrayList<>();
- }
}
/**
@@ -194,4 +107,34 @@
public Long getVcIdByIntakeId(Long intakeId) {
return prIntakeVcMapper.getVcIdByIntakeId(intakeId);
}
+
+ /**
+ * 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱瀵硅薄锛岃繙绋嬪厖鍊间娇鐢�
+ * @param cardId
+ * @return
+ */
+ public SeClientCard geClientCardByCardId(Long cardId) {
+ return seClientCardMapper.selectByPrimaryKey(cardId);
+ }
+
+ /**
+ * 娣诲姞鍛戒护鏃ュ織
+ * @param po 鍛戒护鏃ュ織瀵硅薄
+ * @return 瀛楃涓茬被鍨嬬殑涓婚敭
+ */
+ public Long insert(RmCommandHistory po) {
+ rmCommandHistoryMapper.insert(po);
+ return po.getId();
+ }
+
+ /**
+ * 淇敼鍛戒护鏃ュ織淇℃伅
+ * @param po 鍛戒护鏃ュ織瀵硅薄
+ * @return 褰卞搷璁板綍鏁伴噺
+ */
+ public Integer update(RmCommandHistory po) {
+ return rmCommandHistoryMapper.updateByPrimaryKeySelective(po);
+ }
+
+
}
--
Gitblit v1.8.0