liurunyu
2024-07-05 06c1e69816f028c3108ce4e1e01db4251e481b06
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

 Conflicts:
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealCloseValveReport.java
25个文件已修改
5个文件已添加
800 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrIntakeMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandHistoryMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoCommand.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealCloseValveReport.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/resources/log4j2.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandCtrl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/Card.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/Usability.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/qo/QoCommand.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoRecharge.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/DtoBase.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/ValveOpen.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/result/WechatResultCode.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java
@@ -256,6 +256,7 @@
            // 创建命令日志对象并添加到数据库中
            RmCommandHistory rmCommandHistory = getComHistory(comId, commandCode, commandName, intakeId, rtuAddr, protocol, param, operator);
            rmCommandHistoryMapper.insert(rmCommandHistory);
            comId = rmCommandHistory.getId();
            // 回调异常
            if(!response_CallBack.getCode().equals("0001")) {
@@ -289,12 +290,24 @@
            System.out.println(job_subData);
            Boolean dealResult = job_subData.getBoolean("success");
            if(!dealResult) {
                /**
                 * 执行失败
                 * 更新执行结果、返回结果时间、结果内容
                 */
                rmCommandHistory = new RmCommandHistory();
                rmCommandHistory.setId(comId);
                rmCommandHistory.setResult((byte)0);
                rmCommandHistory.setResultTime(new Date());
                rmCommandHistory.setResultText((JSONObject)JSON.toJSON(response_CallBack.getContent()));
                rmCommandHistoryMapper.updateByPrimaryKeySelective(rmCommandHistory);
                return BaseResponseUtils.buildErrorMsg(response_CallBack.getContent().toString());
            }
            /**
             * 执行成功,返回回调内容
             * 执行成功
             * 如果是开关阀:更改虚拟卡状态:是否使用中、最后操作、最后操作时间
             * 更新执行结果、返回结果时间、结果内容
             * 返回回调内容
             */
            if(comType != null) {
                SeVirtualCard virtualCard = new SeVirtualCard();
@@ -311,6 +324,15 @@
            // 回调返回的内容
            Data myData = (Data)response_CallBack.getContent();
            // 更新命令日志:执行结果、返回结果时间、结果内容
            rmCommandHistory = new RmCommandHistory();
            rmCommandHistory.setId(comId);
            rmCommandHistory.setResult((byte)1);
            rmCommandHistory.setResultTime(new Date());
            rmCommandHistory.setResultText((JSONObject)JSON.toJSON(myData));
            rmCommandHistoryMapper.updateByPrimaryKeySelective(rmCommandHistory);
            return BaseResponseUtils.buildSuccess(myData) ;
        } else {
            // 请求失败
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.pojoPr.PrController;
import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,8 @@
@Mapper
public interface BaUserMapper extends BaseMapper<BaUser> {
    BaUser selectByPrimaryKey(Long id);
    /**
     * 用户登录
@@ -130,5 +133,4 @@
     */
    List<Map<String, Object>> getRoleNamesByUserId(@Param("userId") Long userId);
    BaUser selectById(Long id);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrIntakeMapper.java
@@ -132,4 +132,11 @@
     * @return
     */
    List<VoOnLineIntake> getUsedIntakes(@Param("onLineMap") String onLineMap, @Param("operator") Long operator);
    /**
     * 取水口名称换取水口ID,扫码开阀使用
     * @param intakeName
     * @return
     */
    Long getIntakeIdByName(String intakeName);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandHistoryMapper.java
@@ -4,10 +4,12 @@
import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
import com.dy.pipIrrGlobal.voRm.VoUnclosedValve;
import com.dy.pipIrrGlobal.voRm.VoCommand;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
@@ -43,6 +45,19 @@
     * @param intakeId
     * @return
     */
    //VoUnclosedParam getUncloseParam(Long intakeId);
    VoUnclosedParam getUncloseParam(@Param("onLineMap") String onLineMap, @Param("intakeId")Long intakeId);
    /**
     * 根据指定条件获取命令日志历史记录总数
     * @param params
     * @return
     */
    Long getCommandHistoriesCount(Map<?, ?> params);
    /**
     * 根据指定条件获取命令日志历史记录
     * @param params
     * @return
     */
    List<VoCommand> getCommandHistories(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java
@@ -21,7 +21,7 @@
    private static final long serialVersionUID = 202401241704002L;
    @Schema(title = "用户ID")
    private String userId;
    private String id;
    @Schema(title = "用户姓名")
    private String userName;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoCommand.java
New file
@@ -0,0 +1,41 @@
package com.dy.pipIrrGlobal.voRm;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-07-02 16:22
 * @LastEditTime 2024-07-02 16:22
 * @Description 命令日志视图
 */
@Data
public class VoCommand {
    private static final long serialVersionUID = 1L;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long id;
    private String commandName;
    private String intakeName;
    private String rtuAddr;
    private String protocol;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date resultTime;
    private String result;
    private String userName;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
@@ -1,5 +1,7 @@
package com.dy.pipIrrGlobal.voSe;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -20,17 +22,36 @@
public class VoRecharge implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "ID")
    private String id;
    //@Schema(title = "ID")
    //private String id;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long opeId;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long cardId;
    @Schema(title = "农户姓名")
    private String clientName;
    private String phone;
    private String idCard;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "水卡编号")
    private String cardNum;
    private String address;
    /**
     * 水卡余额
     */
    private Float money;
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long cardNum;
    private Integer cardCost;
    @Schema(title = "充值金额")
    private Float amount;
@@ -48,7 +69,9 @@
    private Float price;
    @Schema(title = "操作人")
    private String operator;
    private String opr;
    private String operateType;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -291,7 +291,7 @@
    <!--根据指定条件获取用户列表-->
    <select id="getUsers" resultType="com.dy.pipIrrGlobal.voBa.VoUserInfo">
        SELECT
            CAST(id AS char) AS userId,
            CAST(id AS char) AS id,
            phone,
            name AS userName,
            disabled AS stateId,
@@ -343,4 +343,12 @@
        WHERE userId = ${userId}
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        <!--@mbg.generated-->
        select
        <include refid="Base_Column_List" />
        from ba_user
        where id = #{id,jdbcType=BIGINT}
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -437,4 +437,9 @@
      </if>
    </where>
  </select>
  <!--取水口名称换取水口ID,扫码开阀使用-->
  <select id="getIntakeIdByName" resultType="java.lang.Long">
    SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName}
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml
@@ -246,4 +246,65 @@
      LIMIT 0,1
  </select>
  <!--根据指定条件获取命令日志历史记录总数-->
  <select id="getCommandHistoriesCount" resultType="java.lang.Long">
    SELECT
      COUNT(*) AS recordCount
    FROM rm_command_history his
      INNER JOIN pr_intake inta ON inta.id = his.intake_id
      LEFT JOIN se_client cli ON cli.id = his.operator
      LEFT JOIN ba_user  user ON user.id = his.operator
    <where>
      <if test = "commandName != null and commandName !=''">
        AND his.command_name LIKE CONCAT('%',#{commandName},'%')
      </if>
      <if test = "result != null">
        AND his.result = #{result}
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND his.send_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取命令日志历史记录-->
  <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand">
    SELECT
      his.id,
      his.command_name AS commandName,
      inta.name AS intakeName,
      his.rtu_addr AS rtuAddr,
      his.protocol,
      his.send_time AS sendTime,
      his.result_time AS resultTime,
      (CASE
         WHEN his.result = 1 THEN "成功"
         ELSE "失败"
        END) AS result,
      his.result_text,
      IFNULL(cli.name, user.name) AS userName
    FROM rm_command_history his
     INNER JOIN pr_intake inta ON inta.id = his.intake_id
     LEFT JOIN se_client cli ON cli.id = his.operator
     LEFT JOIN ba_user  user ON user.id = his.operator
    <where>
      <if test = "commandName != null and commandName !=''">
        AND his.command_name LIKE CONCAT('%',#{commandName},'%')
      </if>
      <if test = "result != null">
        AND his.result = #{result}
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND his.send_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY his.send_time 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>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
@@ -235,10 +235,10 @@
    select
        COUNT(*) AS recordCount
    FROM se_card_operate ope
        INNER JOIN se_client_card card ON ope.card_id = card.id
        INNER JOIN se_client cli ON ope.client_id = cli.id
        INNER JOIN ba_user us ON ope.operator = us.id
        Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    INNER JOIN se_client_card card ON ope.card_id = card.id
    INNER JOIN se_client cli ON ope.client_id = cli.id
    INNER JOIN ba_user us ON ope.operator = us.id
    Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    <where>
      AND ope.operate_type in(2, 5)
      <if test = "clientName != null and clientName !=''">
@@ -253,38 +253,51 @@
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "paymentId != null and paymentId > 0">
        AND ope.payment_id = ${paymentId}
      </if>
      <!--      <if test = "paymentId != null and paymentId > 0">-->
      <!--        AND ope.payment_id = ${paymentId}-->
      <!--      </if>-->
      <if test = "rechargeTimeStart != null and rechargeTimeStop != null">
        AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop}
      </if>
      <!--      <if test = "rechargeTimeStart != null and rechargeTimeStop != null">-->
      <!--        AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop}-->
      <!--      </if>-->
    </where>
  </select>
  <!--根据指定条件获取充值记录-->
  <select id="getRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoRecharge">
    SELECT
        CAST(ope.id AS char) AS id,
        cli.name AS clientName,
        cli.clientNum,
        CAST(card.cardNum AS char) AS cardNum,
        IFNULL(ope.trade_amount, 0) AS amount,
        IFNULL(ope.refund_amount, 0) AS refundAmount,
        (IFNULL(ope.money, 0) + IFNULL(ope.trade_amount, 0)) AS afterRecharge,
        --     ope.payment_id AS paymentId,
        pay.name AS paymentName,
        ope.price,
        us.name AS operator,
        ope.operate_dt
      ope.id AS opeId,
      card.id AS cardId,
      cli.name AS clientName,
      cli.phone,
      cli.idCard,
      cli.clientNum,
      cli.address,
      card.money,
      CASE
        WHEN card.cardNum LIKE '10%' THEN CONCAT(SUBSTRING(card.cardNum, 7, 6),SUBSTRING(card.cardNum, 14, 4))
        ELSE card.cardNum
      END AS cardNum,
      IFNULL(ope.card_cost,0) AS cardCost,
      IFNULL(ope.trade_amount, 0) AS amount,
      IFNULL(ope.refund_amount, 0) AS refundAmount,
      (IFNULL(ope.money, 0) + IFNULL(ope.trade_amount, 0)) AS afterRecharge,
      pay.name AS paymentName,
      ope.price,
      us.name AS opr,
      (CASE
        WHEN ope.operate_type = 1 THEN "开卡"
        WHEN ope.operate_type = 2 THEN "充值"
        WHEN ope.operate_type = 5 THEN "返还"
      END) AS operateType,
      ope.operate_dt
    FROM se_card_operate ope
    INNER JOIN se_client_card card ON ope.card_id = card.id
        INNER JOIN se_client cli ON ope.client_id = cli.id
        INNER JOIN ba_user us ON ope.operator = us.id
        Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    INNER JOIN se_client cli ON ope.client_id = cli.id
    INNER JOIN ba_user us ON ope.operator = us.id
    Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    <where>
      AND ope.operate_type in(2, 5)
      AND ope.operate_type in(1, 2, 5)
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
@@ -297,13 +310,13 @@
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "paymentId != null and paymentId > 0">
        AND ope.payment_id = ${paymentId}
      </if>
<!--      <if test = "paymentId != null and paymentId > 0">-->
<!--        AND ope.payment_id = ${paymentId}-->
<!--      </if>-->
      <if test = "rechargeTimeStart != null and rechargeTimeStop != null">
        AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop}
      </if>
<!--      <if test = "rechargeTimeStart != null and rechargeTimeStop != null">-->
<!--        AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop}-->
<!--      </if>-->
    </where>
    ORDER BY ope.operate_dt DESC
    <trim prefix="limit " >
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealCloseValveReport.java
@@ -58,7 +58,7 @@
     * @param dataCd83CloseVo 关阀上报数据对象
     */
    private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCd83CloseVo dataCd83CloseVo) throws Exception {
        RmOpenCloseValveLast poLast = sv.getRmOpenCloseValveLast(controller.getIntakeId()) ;
        RmOpenCloseValveLast poLast = sv.getRmOpenCloseValveLast(rtuAddr) ;
        if(poLast == null){
            //数据库中不存在该控制器的开关阀数据
            //首先生成最新数据及历史数据,并先保存
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -43,7 +43,7 @@
    @Value("${user.defaultTrueRandomFalsePassword:true}")
    private Boolean defaultTrueRandomFalsePassword;
    @Value("${user.defaultPassword:ABC123}")
    @Value("${user.defaultPassword:abc_123}")
    private String defaultPassword;
    @Autowired
@@ -207,7 +207,8 @@
            po.supperAdmin = null;//设置为null,不做更新
            po.deleted = null;//设置为null,不做更新
            po.orgTag = null;//设置为null,不做更新
            po.password =  MD5.encrypt(po.password);//进行加密
//            修改用户信息不进行密码修改
//            po.password =  MD5.encrypt(po.password);//进行加密
            count = this.sv.update(po);
            this.sv.setRoles(po.id, po.roleIds);
        } catch (Exception e) {
@@ -284,7 +285,7 @@
    /**
     * 重置密码
     * @param vo form表单对象
     * @param
     * @return 是否成功
     */
    @Operation(summary = "重置密码", description = "提交数据(form表单json数据),进行密码重置")
@@ -296,21 +297,21 @@
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(path = "resetPassword")
    @SsoAop()
    public BaseResponse<Boolean> resetPassword(@RequestBody  ResetPasswordVo vo) throws Exception {
        if (vo.id == null) {
    public BaseResponse<Boolean> resetPassword(String id) throws Exception {
        if (id == null || id == "") {
            return BaseResponseUtils.buildFail("id不能为空");
        }
        String password = MD5.encrypt(vo.password);//进行加密码
        Long idLg = Long.parseLong(vo.id);
        Long idLg = Long.parseLong(id);
        int count;
        try {
            BaUser po = this.sv.selectById(idLg);
            if (Objects.isNull(po)) {
                return BaseResponseUtils.buildFail("未得到用户,请求失败");
            } else {
                count = this.sv.changePassword(idLg, password);
            }else {
                String defaultPassword1 = MD5.encrypt(defaultPassword);//进行加密码
                count = this.sv.changePassword(idLg, defaultPassword1);
            }
        } catch (Exception e) {
            log.error("保存用户异常", e);
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
@@ -50,7 +50,7 @@
     * @return 用户实体
     */
    public BaUser selectById(Long id) {
        return this.dao.selectById(id);
        return this.dao.selectByPrimaryKey(id);
    }
    /**
@@ -76,7 +76,7 @@
        if(list_users.size() > 0) {
            for(int i = 0; i < list_users.size(); i++) {
                VoUserInfo voUserInfo = list_users.get(i);
                String userId = voUserInfo.getUserId();
                String userId = voUserInfo.getId();
                JSONArray array_roleIds = new JSONArray();
                List<Map<String, Object>> list_roleIds = Optional.ofNullable(this.dao.getRoleIdsByUserId(Long.parseLong(userId))).orElse(new ArrayList<>());
@@ -221,7 +221,7 @@
        if(map.size() == 0) {
            return null;
        }
        voUserInfo.setUserId(String.valueOf(userId));
        voUserInfo.setId(String.valueOf(userId));
        voUserInfo.setUserName(map.get("userName").toString());
        voUserInfo.setPhone(map.get("phone").toString());
        voUserInfo.setBlockId(map.get("blockId").toString());
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml
@@ -3,7 +3,7 @@
        include: global, database, database-ym, database-pj
user:
    defaultTrueRandomFalsePassword: true #true:采用默认密码,false:系统产生随机密码
    defaultPassword: "ABC123"
    defaultPassword: "abc_123"
#actutor的web端口
management:
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/resources/log4j2.yml
@@ -65,7 +65,7 @@
    # 为包配置特殊的Log级别,方便调试,
    # 不受Loggers.Root.level限制
    Logger:
      - name: com.dy.pipIrrGlobal.daoSe
      - name: com.dy.pipIrrGlobal.daoPr
        additivity: false #去除重复的log
        level: debug #输出日志级别
        AppenderRef:
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandCtrl.java
New file
@@ -0,0 +1,43 @@
package com.dy.pipIrrRemote.common;
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.voRm.VoCommand;
import com.dy.pipIrrRemote.common.qo.QoCommand;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author ZhuBaoMin
 * @date 2024-07-03 9:48
 * @LastEditTime 2024-07-03 9:48
 * @Description
 */
@Slf4j
@RestController
@RequestMapping(path="get")
@RequiredArgsConstructor
public class CommandCtrl {
    private final CommandSv commandSv;
    @GetMapping(path = "/command_history")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCommand>>> get(QoCommand vo){
        try {
            QueryResultVo<List<VoCommand>> res = commandSv.getCommandHistories(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取充值记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
@@ -15,13 +15,17 @@
import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voPr.VoOnLineIntake;
import com.dy.pipIrrGlobal.voRm.VoCommand;
import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
import com.dy.pipIrrGlobal.voRm.VoUnclosedValve;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.common.qo.QoCommand;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.stereotype.Service;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -179,4 +183,36 @@
    public SeClientCard geClientCardByCardId(Long cardId) {
        return seClientCardMapper.selectByPrimaryKey(cardId);
    }
    /**
     * 根据指定条件获取命令日志历史记录
     * @param query
     * @return
     */
    public QueryResultVo<List<VoCommand>> getCommandHistories(QoCommand query) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        // 完善查询起止时间
        String timeStart = query.getTimeStart();
        String timeStop = query.getTimeStop();
        if(timeStart != null) {
            timeStart = timeStart + " 00:00:00";
            query.setTimeStart(timeStart);
        }
        if(timeStop != null) {
            timeStop = timeStop + " 23:59:59";
            query.setTimeStop(timeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(query);
        Long itemTotal = rmCommandHistoryMapper.getCommandHistoriesCount(params);
        QueryResultVo<List<VoCommand>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = query.pageSize ;
        rsVo.pageCurr = query.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmCommandHistoryMapper.getCommandHistories(params);
        return rsVo ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/Card.java
New file
@@ -0,0 +1,27 @@
package com.dy.pipIrrRemote.common.dto;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-06-29 11:01
 * @LastEditTime 2024-06-29 11:01
 * @Description 物理水卡
 */
@Data
public class Card extends DtoBase {
    public static final long serialVersionUID = 202406291102001L;
    /**
     * 水卡地址
     */
    @NotBlank(message = "水卡地址不能为空")
    private String cardAddr;
    /**
     * 水卡编号
     */
    private Long cardNum;
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/Usability.java
New file
@@ -0,0 +1,22 @@
package com.dy.pipIrrRemote.common.dto;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-07-02 11:00
 * @LastEditTime 2024-07-02 11:00
 * @Description 终端用水有效性对象
 */
@Data
public class Usability extends DtoBase {
    public static final long serialVersionUID = 202407021101001L;
    /**
     * 终端用水有效性
     */
    @NotNull(message = "终端用水有效性不能为空")
    private Boolean valid;
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/qo/QoCommand.java
New file
@@ -0,0 +1,40 @@
package com.dy.pipIrrRemote.common.qo;
import com.dy.common.webUtil.QueryConditionVo;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2024-07-03 9:25
 * @LastEditTime 2024-07-03 9:25
 * @Description 命令日志历史记录查询视图
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class QoCommand extends QueryConditionVo {
    /**
     * 命令名称
     */
    private String commandName;
    /**
     * 命令结果,0-失败,1-成功
     */
    private Integer result;
    /**
     * 查询起始时间
     */
    private String timeStart;
    /**
     * 查询截止时间
     */
    private String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java
@@ -6,9 +6,7 @@
import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com97Vo;
import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com98Vo;
import com.dy.common.mw.protocol.p206V202404.CodeV202404;
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo;
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo;
import com.dy.common.mw.protocol.p206V202404.downVos.ComCd93_A3Vo;
import com.dy.common.mw.protocol.p206V202404.downVos.*;
import com.dy.common.util.IDLongGenerator;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
@@ -20,9 +18,7 @@
import com.dy.pipIrrGlobal.voRm.VoUnclosedValve;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.common.CommandSv;
import com.dy.pipIrrRemote.common.dto.DtoBase;
import com.dy.pipIrrRemote.common.dto.Recharge;
import com.dy.pipIrrRemote.common.dto.ValveOpen;
import com.dy.pipIrrRemote.common.dto.*;
import com.dy.pipIrrRemote.result.RemoteResultCode;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
@@ -393,4 +389,164 @@
            return BaseResponseUtils.buildFail("系统暂不支持该协议");
        }
    }
    /**
     * 强制关阀
     * @param card
     * @param bindingResult
     * @return
     */
    @PostMapping(path = "forced_close", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> forcedClose(@RequestBody @Valid Card card, BindingResult bindingResult) {
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        Long intakeId = card.getIntakeId();
        String cardAddr = card.getCardAddr();
        Long operator = card.getOperator();
        Long comId = idLongGenerator.generate();
        // 获取系统参数
        if(!setuped) {
            setUp();
        }
        // 取水口ID换阀控器地址及通讯协议
        JSONObject job_rtu = getRtu(intakeId, null);
        if(job_rtu == null) {
            return BaseResponseUtils.buildErrorMsg(RemoteResultCode.RTU_NOT_EXIST.getMessage());
        }
        String rtuAddr = job_rtu.getString("rtuAddr");
        String protocol = job_rtu.getString("protocol");
        String commandCode = null;
        if(protocol.equals("p206V202404")) {
            // 获取功能码
            commandCode = CodeV202404.cd_9C;
            // 创建视图
            ComCd9CVo param = new ComCd9CVo();
            param.controllerType = controllerType;
            param.projectNo = projectNo;
            param.icCardAddr = cardAddr;
            /**
             * 构造命令、发送命令并处理请求结果及执行结果
             * 1 准备参数
             * 2 调用公共方法
             */
            Param myParam = new Param();
            myParam.setComId(comId);
            myParam.setCommandCode(commandCode);
            myParam.setCommandName(CodeV202404.getCodeName(commandCode));
            myParam.setIntakeId(intakeId);
            myParam.setRtuAddr(rtuAddr);
            myParam.setProtocol(protocol);
            myParam.setParam(param);
            myParam.setRtuResultSendWebUrl(rtuCallbackUrl_rm);
            myParam.setOperator(operator);
            return dealWithCommandResult(myParam);
        } else if(protocol.equals("p206V1_0_1")) {
            return BaseResponseUtils.buildErrorMsg(RemoteResultCode.THE_DEVICE_DOES_NOT_HAVE_THIS_FUNCTION.getMessage());
        } else {
            return BaseResponseUtils.buildErrorMsg("系统暂不支持该协议");
        }
    }
    /**
     * 设备终端用水控制
     * @param usability
     * @param bindingResult
     * @return
     */
    @PostMapping(path = "usability", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> usability(@RequestBody @Valid Usability usability, BindingResult bindingResult) {
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        Long intakeId = usability.getIntakeId();
        Boolean valid = usability.getValid();
        Long operator = usability.getOperator();
        Long comId = idLongGenerator.generate();
        // 获取系统参数
        if(!setuped) {
            setUp();
        }
        // 取水口ID换阀控器地址及通讯协议
        JSONObject job_rtu = getRtu(intakeId, null);
        if(job_rtu == null) {
            return BaseResponseUtils.buildErrorMsg(RemoteResultCode.RTU_NOT_EXIST.getMessage());
        }
        String rtuAddr = job_rtu.getString("rtuAddr");
        String protocol = job_rtu.getString("protocol");
        String commandCode = null;
        if(protocol.equals("p206V202404")) {
            if(valid) {
                // 获取功能码
                commandCode = CodeV202404.cd_30;
                // 创建视图
                ComCd31Vo param = new ComCd31Vo();
                param.controllerType = controllerType;
                param.projectNo = projectNo;
                param.valid = true;
                /**
                 * 构造命令、发送命令并处理请求结果及执行结果
                 * 1 准备参数
                 * 2 调用公共方法
                 */
                Param myParam = new Param();
                myParam.setComId(comId);
                myParam.setCommandCode(commandCode);
                myParam.setCommandName(CodeV202404.getCodeName(commandCode));
                myParam.setIntakeId(intakeId);
                myParam.setRtuAddr(rtuAddr);
                myParam.setProtocol(protocol);
                myParam.setParam(param);
                myParam.setRtuResultSendWebUrl(rtuCallbackUrl_rm);
                myParam.setOperator(operator);
                return dealWithCommandResult(myParam);
            }else {
                // 获取功能码
                commandCode = CodeV202404.cd_31;
                // 创建视图
                ComCd31Vo param = new ComCd31Vo();
                param.controllerType = controllerType;
                param.projectNo = projectNo;
                param.valid = false;
                /**
                 * 构造命令、发送命令并处理请求结果及执行结果
                 * 1 准备参数
                 * 2 调用公共方法
                 */
                Param myParam = new Param();
                myParam.setComId(comId);
                myParam.setCommandCode(commandCode);
                myParam.setCommandName(CodeV202404.getCodeName(commandCode));
                myParam.setIntakeId(intakeId);
                myParam.setRtuAddr(rtuAddr);
                myParam.setProtocol(protocol);
                myParam.setParam(param);
                myParam.setRtuResultSendWebUrl(rtuCallbackUrl_rm);
                myParam.setOperator(operator);
                return dealWithCommandResult(myParam);
            }
        } else if(protocol.equals("p206V1_0_1")) {
            return BaseResponseUtils.buildErrorMsg(RemoteResultCode.THE_DEVICE_DOES_NOT_HAVE_THIS_FUNCTION.getMessage());
        } else {
            return BaseResponseUtils.buildErrorMsg("系统暂不支持该协议");
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java
@@ -798,11 +798,17 @@
    @GetMapping(path = "/getRecharges")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){
        // 如果传入的是10位的水卡编号,升为17位水卡编号
        if(vo != null && vo.getCardNum() != null) {
            String cardNumS = String.valueOf(vo.getCardNum()).trim();
            if(cardNumS.length() == 10) {
                cardNumS = "100000" + cardNumS.substring(0,6) + "0" + cardNumS.substring(6);
                vo.setCardNum(Long.parseLong(cardNumS));
            }
        }
        try {
            QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(vo);
            //if(res.itemTotal == 0) {
            //    return BaseResponseUtils.buildFail(SellResultCode.No_RECHARGES.getMessage());
            //}
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取充值记录异常", e);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java
@@ -210,7 +210,19 @@
            return BaseResponseUtils.buildErrorMsg(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
        //return BaseResponseUtils.buildSuccess(true) ;
        cardNumS = String.valueOf(cardNum).trim();
        if(cardNumS.substring(0,2).equals("10")) {
            cardNumS = cardNumS.substring(6,12) + cardNumS.substring(13);
        }
        cardNum = Long.parseLong(cardNumS);
        Map map_response = new HashMap();
        map_response.put("projectNo", String.format("%02x", Integer.parseInt(getProjectNo())));
        map_response.put("orderNumber", rec);
        map_response.put("cardNum", cardNum);
        return BaseResponseUtils.buildSuccess(map_response) ;
    }
    /**
@@ -220,16 +232,16 @@
     */
    public QueryResultVo<List<VoRecharge>> getRecharges(QoRecharge queryVo) {
        //完善查询充值记录的起止时间
        String rechargeTimeStart = queryVo.rechargeTimeStart;
        String rechargeTimeStop = queryVo.rechargeTimeStop;
        if(rechargeTimeStart != null) {
            rechargeTimeStart = rechargeTimeStart + " 00:00:00";
            queryVo.setRechargeTimeStart(rechargeTimeStart);
        }
        if(rechargeTimeStop != null) {
            rechargeTimeStop = rechargeTimeStop + " 23:59:59";
            queryVo.setRechargeTimeStop(rechargeTimeStop);
        }
        //String rechargeTimeStart = queryVo.rechargeTimeStart;
        //String rechargeTimeStop = queryVo.rechargeTimeStop;
        //if(rechargeTimeStart != null) {
        //    rechargeTimeStart = rechargeTimeStart + " 00:00:00";
        //    queryVo.setRechargeTimeStart(rechargeTimeStart);
        //}
        //if(rechargeTimeStop != null) {
        //    rechargeTimeStop = rechargeTimeStop + " 23:59:59";
        //    queryVo.setRechargeTimeStop(rechargeTimeStop);
        //}
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoRecharge.java
@@ -20,17 +20,20 @@
@Schema(name = "IC卡充值记录查询条件")
public class QoRecharge extends QueryConditionVo {
    @Schema(description = "农户姓名")
    public String clientName;
    private String clientName;
    @Schema(description = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(description = "IC卡号")
    public String cardAddr;
    private Long cardNum;
    @Schema(description = "付款方式")
    public Integer paymentId;
    //@Schema(description = "农户编号")
    //private Long clientId;
    //@Schema(description = "IC卡号")
    //public String cardAddr;
    //@Schema(description = "付款方式")
    //public Integer paymentId;
    //@Schema(description = "充值时间_开始")
    //public LocalDateTime rechargeTimeStart;
@@ -38,9 +41,7 @@
    //@Schema(description = "充值时间_结束")
    //public LocalDateTime rechargeTimeStop;
    @Schema(description = "充值时间_开始")
    public String rechargeTimeStart;
    //public String rechargeTimeStart;
    @Schema(description = "充值时间_结束")
    public String rechargeTimeStop;
    //public String rechargeTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
@@ -62,25 +62,6 @@
    }
    /**
     * 添加命令日志
     * @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);
    }
    /**
     * 根据操作员ID获取未关阀记录(包含在线情况)
     * @param operator
     * @return
@@ -135,4 +116,33 @@
    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);
    }
    /**
     * 取水口名称换取水口ID,扫码开阀使用
     * @param intakeName
     * @return
     */
    public Long getIntakeIdByName(String intakeName) {
        return prIntakeMapper.getIntakeIdByName(intakeName);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
@@ -70,10 +70,23 @@
        }
        Long intakeId = valve.getIntakeId();
        String intakeName = valve.getIntakeName();
        Long vcId = valve.getVcId();
        Long operator = valve.getOperator();
        Long comId = idLongGenerator.generate();
        if(intakeId == null && intakeName == null) {
            return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
        }
        // intakeName换intakeId
        if(intakeId == null) {
            intakeId = commandSv.getIntakeIdByName(intakeName);
            if(intakeId == null) {
                return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
            }
        }
        /**
         * 如果农户选择了虚拟卡,则使用该虚拟卡
         * 如果农户未选择虚拟卡,则根据取水口ID获取与之绑定的虚拟卡
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/DtoBase.java
@@ -17,10 +17,14 @@
    /**
     * 取水口ID
     */
    @NotNull(message = "取水口不能为空")
    private Long intakeId;
    /**
     * 取水口名称
     */
    private String intakeName;
    /**
     * 操作人
     */
    @NotNull(message = "操作人不能为空")
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/ValveOpen.java
@@ -20,9 +20,4 @@
     */
    private Long vcId;
    /**
     * 用户类型 1-平台,2-APP
     */
    //@NotNull(message = "操作类型不能为空")
    //private Integer userType;
}
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/result/WechatResultCode.java
@@ -19,9 +19,10 @@
     */
    GET_RESULT_IN_ONE_MINUTE(10001,"1分钟后去查看结果"),
    GET_RESULT_ERROR(10002, "获取结果异常"),
    PLEASE_SELECT_A_VC(10002, "请选择一张虚拟卡"),
    IN_USE_VC_CANNOT_OPEN_VALVE(10002, "使用中虚拟卡不能用来开阀"),
    THE_DEVICE_DOES_NOT_HAVE_THIS_FUNCTION(10003, "该设备无此同能"),
    PLEASE_SELECT_A_VC(10003, "请选择一张虚拟卡"),
    PLEASE_SELECT_A_INTAKE(10004, "请选择一个取水口"),
    IN_USE_VC_CANNOT_OPEN_VALVE(10005, "使用中虚拟卡不能用来开阀"),
    THE_DEVICE_DOES_NOT_HAVE_THIS_FUNCTION(10006, "该设备无此同能"),
    /**
     * RTU