2024-10-24 朱宝民 微信小程序中使用的物理卡开关阀记录、虚拟卡开关阀记录
| | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoExpend; |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenCloseValve; |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenClostWechat; |
| | | import com.dy.pipIrrGlobal.voSt.VoClient; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount; |
| | |
| | | * @return |
| | | */ |
| | | List<VoExpend> getExpends(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取物理卡开关阀记录数量,微信小程序使用 |
| | | * @return |
| | | */ |
| | | Long getCardOpenCloseCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取物理卡开关阀记录,微信小程序使用 |
| | | * @return |
| | | */ |
| | | List<VoOpenClostWechat> getCardOpenClose(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取虚拟卡开关阀记录数量,微信小程序使用 |
| | | * @return |
| | | */ |
| | | Long getVcCardOpenCloseCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取虚拟卡开关阀记录,微信小程序使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoOpenClostWechat> getVcCardOpenClose(Map<String, Object> params); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-24 15:36 |
| | | * @LastEditTime 2024-10-24 15:36 |
| | | * @Description 开关阀视图对象_微信小程序使用 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"expense", "cardNum", "intakeNum", "openTime", "closeTime", "duration", "amount", "openType"}) |
| | | public class VoOpenClostWechat implements BaseEntity { |
| | | private static final long serialVersionUID = 202410241538001L; |
| | | |
| | | /** |
| | | * 消费金额 |
| | | */ |
| | | private Double expense; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | */ |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 开阀时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date openTime; |
| | | |
| | | /** |
| | | * 关阀时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date closeTime; |
| | | |
| | | /** |
| | | * 用水时长 |
| | | */ |
| | | private Integer duration; |
| | | |
| | | /** |
| | | * 用水量 |
| | | */ |
| | | private Double amount; |
| | | |
| | | /** |
| | | * 开阀类型 |
| | | */ |
| | | private String openType; |
| | | } |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取物理卡开关阀记录数量,微信小程序使用--> |
| | | <select id="getCardOpenCloseCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM rm_open_close_valve_history his |
| | | LEFT JOIN pr_intake inta ON inta.id = his.intake_id |
| | | WHERE op_type = 1 |
| | | </select> |
| | | |
| | | <!--获取物理卡开关阀记录,微信小程序使用--> |
| | | <select id="getCardOpenClose" resultType="com.dy.pipIrrGlobal.voRm.VoOpenClostWechat"> |
| | | SELECT |
| | | cl_this_money AS expense, |
| | | op_ic_card_no AS cardNum, |
| | | inta.name AS intakeNum, |
| | | open_dt AS openTime, |
| | | close_dt AS closeTime, |
| | | cl_this_time AS duration, |
| | | cl_this_amount AS amount, |
| | | '刷卡开阀' AS openType |
| | | FROM rm_open_close_valve_history his |
| | | LEFT JOIN pr_intake inta ON inta.id = his.intake_id |
| | | WHERE op_type = 1 |
| | | ORDER BY open_dt DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取虚拟卡开关阀记录数量,微信小程序使用--> |
| | | <select id="getVcCardOpenCloseCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM rm_open_close_valve_history his |
| | | LEFT JOIN pr_intake inta ON inta.id = his.intake_id |
| | | WHERE op_type = 8 |
| | | </select> |
| | | |
| | | <!--获取虚拟卡开关阀记录,微信小程序使用--> |
| | | <select id="getVcCardOpenClose" resultType="com.dy.pipIrrGlobal.voRm.VoOpenClostWechat"> |
| | | SELECT |
| | | cl_this_money AS expense, |
| | | op_ic_card_no AS cardNum, |
| | | inta.name AS intakeNum, |
| | | open_dt AS openTime, |
| | | close_dt AS closeTime, |
| | | cl_this_time AS duration, |
| | | cl_this_amount AS amount, |
| | | CASE |
| | | WHEN cl_type = 13 THEN '定时关阀式开阀' |
| | | WHEN cl_type = 14 THEN '定量关阀式开阀' |
| | | ELSE '远程开阀' |
| | | END AS openType |
| | | FROM rm_open_close_valve_history his |
| | | LEFT JOIN pr_intake inta ON inta.id = his.intake_id |
| | | WHERE op_type = 8 |
| | | ORDER BY open_dt DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenClostWechat; |
| | | import com.dy.pipIrrWechat.intake.qo.OnLineIntakesQO; |
| | | import com.dy.pipIrrWechat.intake.qo.QoOpenClose; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取物理卡开关阀记录,微信小程序使用 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getCardOpenClose") |
| | | public BaseResponse<QueryResultVo<List<VoOpenClostWechat>>> getCardOpenClose(QoOpenClose qo) { |
| | | try { |
| | | QueryResultVo<List<VoOpenClostWechat>> res = intakeSv.getCardOpenClose(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取水卡开关阀记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取虚拟卡开关阀记录,微信小程序使用 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getVcCardOpenClose") |
| | | public BaseResponse<QueryResultVo<List<VoOpenClostWechat>>> getVcCardOpenClose(QoOpenClose qo) { |
| | | try { |
| | | QueryResultVo<List<VoOpenClostWechat>> res = intakeSv.getVcCardOpenClose(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取虚拟卡开关阀记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper; |
| | | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; |
| | | import com.dy.pipIrrGlobal.voRm.VoOpenClostWechat; |
| | | import com.dy.pipIrrWechat.intake.qo.OnLineIntakesQO; |
| | | import com.dy.pipIrrWechat.intake.qo.QoOpenClose; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; |
| | | |
| | | //protected static String mwUrlSendCom = "http://127.0.0.1:8070/rtuMw/com/send" ; |
| | | protected String comSendUrl; |
| | |
| | | } |
| | | return response.getBody(); |
| | | } |
| | | |
| | | /** |
| | | * 获取物理卡开关阀记录,微信小程序使用 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoOpenClostWechat>> getCardOpenClose(QoOpenClose queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getCardOpenCloseCount(params); |
| | | |
| | | QueryResultVo<List<VoOpenClostWechat>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOpenCloseValveHistoryMapper.getCardOpenClose(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 获取虚拟卡开关阀记录,微信小程序使用 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoOpenClostWechat>> getVcCardOpenClose(QoOpenClose queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getVcCardOpenCloseCount(params); |
| | | |
| | | QueryResultVo<List<VoOpenClostWechat>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOpenCloseValveHistoryMapper.getVcCardOpenClose(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.intake.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-10-24 16:07 |
| | | * @LastEditTime 2024-10-24 16:07 |
| | | * @Description 开关阀查询对象,微信小程序使用 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class QoOpenClose extends QueryConditionVo { |
| | | |
| | | } |