Merge remote-tracking branch 'origin/master'
已添加73个文件
已修改48个文件
已删除3个文件
已重命名2个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.bo; |
| | | |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class C3ChargingBo { |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | private Long c3Id; |
| | | |
| | | /** |
| | | * mcu udid |
| | | */ |
| | | private String mcuUdid; |
| | | |
| | | /** |
| | | * c3åç§° |
| | | */ |
| | | private String c3Name; |
| | | |
| | | /** |
| | | * c3ç©çå°å(id hex) |
| | | */ |
| | | private String c3Mac; |
| | | |
| | | /** |
| | | * 1空é²/2.å
çµä¸/3.å
çµä¸æï¼çå¾
æå¡å¨ç¡®è®¤/4.å
çµç»æï¼çå¾
æå¡å¨ç¡®è®¤/5.ææ
é/6.ä¸å
çµæ¡©å¯¹æ¥ä¸ |
| | | */ |
| | | private Integer statusBit; |
| | | |
| | | /** |
| | | * è®¾å¤æ¸©åº¦ |
| | | */ |
| | | private String deviceTemperature; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String poleDevicesCode; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç¯æç¼å· |
| | | */ |
| | | private Long poleCode; |
| | | |
| | | /** |
| | | * ç¯æåç§° |
| | | */ |
| | | private String poleName; |
| | | |
| | | } |
| | |
| | | |
| | | private List<String> fileNames; |
| | | |
| | | // private List files; |
| | | // |
| | | // private List IpVolumes; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * @TableName alipay_config |
| | | */ |
| | | @TableName(value ="alipay_config") |
| | | @Data |
| | | public class AliConfigEntity implements Serializable { |
| | | /** |
| | | * ç´¢å¼id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer configId; |
| | | |
| | | /** |
| | | * åºç¨APPID |
| | | */ |
| | | private String appId; |
| | | |
| | | /** |
| | | * åæ·ç§é¥/PKCS8æ ¼å¼RSA2ç§é¥ |
| | | */ |
| | | private String privateKey; |
| | | |
| | | /** |
| | | * æ¯ä»å®å
¬é¥/æ¥çå°åï¼https://openhome.alipay.com/platform/keyManage.htm 对åºAPPIDä¸çæ¯ä»å®å
¬é¥ |
| | | */ |
| | | private String publicKey; |
| | | |
| | | /** |
| | | * åä½ä¼ä¼´èº«ä»½ï¼PIDï¼ |
| | | */ |
| | | private String pid; |
| | | |
| | | /** |
| | | * 客æ·id |
| | | */ |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * å建é
ç½®çç¨æ·id |
| | | */ |
| | | private Long createUserId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | /** |
| | | * |
| | | */ |
| | | private String poleDevicesCode; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField(exist = false) |
| | | private static final Double DEFAULT_CHARGE = 8.8; |
| | | |
| | | public C3mChargingCharge(){} |
| | | |
| | | public C3mChargingCharge(Integer c3Id,Integer hour,Integer min, Double charge,Long timestamp){ |
| | | this.c3Id = c3Id; |
| | | this.hour = hour; |
| | | this.min = min; |
| | | this.charge = charge; |
| | | this.timestamp = timestamp; |
| | | } |
| | | |
| | | |
| | | public static C3mChargingCharge getInitInstance(Integer c3Id) { |
| | | return new C3mChargingCharge(c3Id,0,0, DEFAULT_CHARGE, new Date().getTime()); |
| | | } |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.math.BigInteger; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | |
| | | /** |
| | | * æä»¶url |
| | | */ |
| | | @JsonIgnore |
| | | private String missionFileUrl; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer missionVolume; |
| | | |
| | | /*@TableField |
| | | private List<IpVolumeFile> files;*/ |
| | | // @TableField(exist = false) |
| | | // private List<IpVolumeFile> files=new ArrayList<>(); |
| | | // |
| | | // @TableField(exist = false) |
| | | // private List<BroadcastTerminalV2Entity> BroadcastTerminal=new ArrayList<>(); |
| | | |
| | | @TableField(exist = false) |
| | | private List<Integer> fileIds=new ArrayList<>(); |
| | | |
| | | @TableField(exist = false) |
| | | private List<Integer> TerminalIds=new ArrayList<>(); |
| | | |
| | | /*@TableField |
| | | private List<String> fileNames;*/ |
| | |
| | | private Long createTimestamp; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private Long poleId; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String poleName; |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableField(exist = false) |
| | | private Long streetlightId; |
| | |
| | | package com.sandu.ximon.dao.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | /** |
| | | * ç¯æå¾ä¾§ |
| | | * å¾ä¾§åè¦è¡¨ |
| | | * @TableName light_pole_heeling |
| | | */ |
| | | @TableName(value ="light_pole_heeling") |
| | | @Data |
| | | public class LightPoleHeeling implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | //æå±äºº |
| | | private Long userId; |
| | | //åè¦å· |
| | | private String warningNumber; |
| | | //ç¯æID |
| | | private Long lightPoleId; |
| | | //ç¯æåç§° |
| | | private String lightPoleName; |
| | | //åè¦ç级 |
| | | private String warningLevel; |
| | | //Xè½´ |
| | | private int theXAxis; |
| | | //Yè½´ |
| | | private int theYAxis; |
| | | //Zè½´ |
| | | private int theZAxis; |
| | | //å¤çç¶æ |
| | | // 1:å·²å¤çï¼0ï¼æªå¤ç |
| | | private int processingState; |
| | | //åè¦æ¶é´ |
| | | private Long warningNumber; |
| | | |
| | | /** |
| | | * 设å¤MACå°å |
| | | */ |
| | | private String mac; |
| | | |
| | | /** |
| | | * è¦åç级 |
| | | */ |
| | | private Integer warningLevel; |
| | | |
| | | /** |
| | | * Xè½´ |
| | | */ |
| | | private Double theXAxis; |
| | | |
| | | /** |
| | | * Yè½´ |
| | | */ |
| | | private Double theYAxis; |
| | | |
| | | /** |
| | | * Zè½´ |
| | | */ |
| | | private Double theZAxis; |
| | | |
| | | /** |
| | | * å¤çç¶æ |
| | | */ |
| | | private Integer processingState; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| | | /** |
| | | * ç¯æç¼å· |
| | | */ |
| | | private Long poleCode; |
| | | |
| | | /** |
| | | * ç¯æåç§° |
| | | */ |
| | | private String poleName; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * @TableName light_pole_heeling_processing |
| | | */ |
| | | @TableName(value ="light_pole_heeling_processing") |
| | | @Data |
| | | public class LightPoleHeelingProcessing implements Serializable { |
| | | /** |
| | | * å¤çå· |
| | | */ |
| | | @TableId |
| | | private Long processingNumber; |
| | | |
| | | /** |
| | | * è¦åå· |
| | | */ |
| | | private Long warningNumber; |
| | | |
| | | /** |
| | | * å¤çåç¶æ |
| | | */ |
| | | private Integer processingState; |
| | | |
| | | /** |
| | | * å¤çæè§ |
| | | */ |
| | | private String processingOpinion; |
| | | |
| | | /** |
| | | * å¤ç人 |
| | | */ |
| | | private String processingPerson; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * å¤çåXè½´ |
| | | */ |
| | | private Double theXAxis; |
| | | |
| | | /** |
| | | * å¤çåYè½´ |
| | | */ |
| | | private Double theYAxis; |
| | | |
| | | /** |
| | | * å¤çåZè½´ |
| | | */ |
| | | private Double theZAxis; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | private Integer deviceType; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 客æ·id |
| | | */ |
| | | private Long clientId; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.domain; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @TableName wx_config |
| | | */ |
| | | @TableName(value = "wx_config") |
| | | @Data |
| | | public class WxConfigEntity implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long configId; |
| | | |
| | | /** |
| | | * appid |
| | | */ |
| | | private String appid; |
| | | |
| | | /** |
| | | * app端appid |
| | | */ |
| | | private String appappid; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String mchId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String privateKey; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Long createUserId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.enums; |
| | | |
| | | public enum C3mRedisConstant { |
| | | |
| | | // å
çµæ¡©å¿è·³å
åå¨(mac-list(å
çµæ¡©å£ç¶æ)) |
| | | C3_STATUS("m_c3_port_status:"), |
| | | // å
çµæ¡©è®¢å |
| | | C3_NO_PAY_ORDER("m_c3_no_pay_order:"), |
| | | // å
çµæ¡©è¿è¡ä¸è®¢å |
| | | C3_CHARGING_ORDER("m_c3_charging_order:"), |
| | | // å
çµæ¡©æ
éç |
| | | C3_ERROR("m_c3_error:"), |
| | | ; |
| | | |
| | | |
| | | private String code; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | C3mRedisConstant(String code) { |
| | | this.code = code; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.enums; |
| | | |
| | | public enum OrderStatus { |
| | | // æªæ¯ä» |
| | | NO_PAY(0), |
| | | // å·²æ¯ä» |
| | | PAYED(1), |
| | | // 已鿬¾ |
| | | REFUND(2), |
| | | // 鿬¾ä¸ |
| | | REFUNDING(3), |
| | | // 鿬¾å¤±è´¥ |
| | | REFUND_FAILED(4), |
| | | // 已宿 |
| | | COMPLETE(5), |
| | | |
| | | ; |
| | | |
| | | private Integer status; |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | OrderStatus (Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.enums; |
| | | |
| | | /** |
| | | * 订åç±»å |
| | | */ |
| | | public enum OrderType { |
| | | |
| | | ALIPAY("alipay"), |
| | | |
| | | WXPAY("wxpay"), |
| | | |
| | | ERROR("error"); |
| | | |
| | | private String code; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public static OrderType getOrderType(String type){ |
| | | if(type.equals(OrderType.ALIPAY.getCode())) { |
| | | return OrderType.ALIPAY; |
| | | }else if(type.equals(OrderType.WXPAY.getCode())) { |
| | | return OrderType.WXPAY; |
| | | }else { |
| | | return OrderType.ERROR; |
| | | } |
| | | } |
| | | |
| | | OrderType(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | } |
| | |
| | | public interface C3mChargingChargeMapper extends BaseMapper<C3mChargingCharge> { |
| | | |
| | | @Delete("delete from c3_charging_charge where c3_id = #{id}") |
| | | void deleteCharge(@Param("id") Integer c3Id); |
| | | boolean deleteCharge(@Param("id") Integer c3Id); |
| | | |
| | | @Select("select * from c3_charging_charge where c3_id = #{c3Id} limit 5") |
| | | List<C3mChargingCharge> getChargeByC3Id(@Param("c3Id") Integer c3Id); |
| | |
| | | package com.sandu.ximon.dao.mapper; |
| | | |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Entity com.sandu.ximon.dao.domain.C3mCharging |
| | |
| | | @Mapper |
| | | public interface C3mChargingMapper extends BaseMapper<C3mCharging> { |
| | | |
| | | C3mCharging getAllByC3Mac(String c3Mac); |
| | | |
| | | |
| | | List<C3ChargingBo> listC3mChargingDto(String keyword); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | List<IpVolumeMissionBo> listAllByUserId(Long userId);// todo ä»»å¡å½å± |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.sandu.ximon.dao.mapper; |
| | | |
| | | import com.sandu.common.domain.BaseMapper; |
| | | import com.sandu.ximon.dao.domain.LightPoleHeeling; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface LightPoleHeelingMapper extends BaseMapper<LightPoleHeeling> { |
| | | List<LightPoleHeeling> listLightPoleHeeling(String keyword, Integer processingState); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.mapper; |
| | | |
| | | import com.sandu.ximon.dao.domain.LightPoleHeelingProcessing; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Entity com.sandu.ximon.dao.domain.LightPoleHeelingProcessing |
| | | */ |
| | | @Mapper |
| | | public interface LightPoleHeelingProcessingMapper extends BaseMapper<LightPoleHeelingProcessing> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.mapper; |
| | | |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Entity com.sandu.ximon.dao.domain.UsrAlipayConfig |
| | | */ |
| | | @Mapper |
| | | public interface UsrAlipayConfigMapper extends BaseMapper<AliConfigEntity> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Entity com.sandu.ximon.dao.domain.WxConfigEntity |
| | | */ |
| | | @Mapper |
| | | public interface UsrWxPayConfigMapper extends BaseMapper<WxConfigEntity> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/> |
| | | <result property="statusBit" column="status_bit" jdbcType="INTEGER"/> |
| | | <result property="deviceTemperature" column="device_temperature" jdbcType="VARCHAR"/> |
| | | <result property="poleDevicesCode" column="pole_devices_code" jdbcType="VARCHAR"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | c3_id,mcu_udid,c3_name, |
| | | c3_mac,status_bit,device_temperature, |
| | | update_time |
| | | pole_devices_code,update_time |
| | | </sql> |
| | | |
| | | <select id="getAllByC3Mac" resultType="com.sandu.ximon.dao.domain.C3mCharging"> |
| | | select * |
| | | from c3m_charging |
| | | where c3_mac = #{c3Mac} |
| | | </select> |
| | | <select id="listC3mChargingDto" resultType="com.sandu.ximon.dao.bo.C3ChargingBo"> |
| | | SELECT t1.*, t3.pole_code, |
| | | t3.pole_name |
| | | FROM c3m_charging t1 |
| | | LEFT JOIN pole_binding t2 ON t1.mcu_udid = t2.device_code |
| | | AND t2.device_type = 8 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND (t1.c3_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR (t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%'))) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.LightPoleHeelingMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightPoleHeeling"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="warningNumber" column="warning_number" jdbcType="VARCHAR"/> |
| | | <result property="lightPoleId" column="light_pole_id" jdbcType="BIGINT"/> |
| | | <result property="lightPoleName" column="light_pole_name" jdbcType="VARCHAR"/> |
| | | <result property="warningLevel" column="warning_level" jdbcType="VARCHAR"/> |
| | | <result property="theXAxis" column="the_x_axis" jdbcType="INTEGER"/> |
| | | <result property="theYAxis" column="the_y_axis" jdbcType="INTEGER"/> |
| | | <result property="theZAxis" column="the_z_axis" jdbcType="INTEGER"/> |
| | | <id property="warningNumber" column="warning_number" jdbcType="BIGINT"/> |
| | | <result property="mac" column="mac" jdbcType="VARCHAR"/> |
| | | <result property="warningLevel" column="warning_level" jdbcType="INTEGER"/> |
| | | <result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/> |
| | | <result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/> |
| | | <result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/> |
| | | <result property="processingState" column="processing_state" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | </mapper> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | warning_number,mac,warning_level, |
| | | the_x_axis,the_y_axis,the_z_axis, |
| | | processing_state,create_time |
| | | </sql> |
| | | |
| | | <select id="listLightPoleHeeling" resultType="com.sandu.ximon.dao.domain.LightPoleHeeling"> |
| | | SELECT t1.*, t3.pole_code, |
| | | t3.pole_name |
| | | FROM light_pole_heeling t1 |
| | | LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code |
| | | AND t2.device_type = 8 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | (t1.warning_level = 1 OR t1.warning_level = 2) |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND (t1.warning_number LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR (t3.pole_name LIKE |
| | | CONCAT(CONCAT('%', #{keyword}), '%'))OR (t3.pole_code LIKE CONCAT(CONCAT('%', #{keyword}), '%'))) |
| | | </if> |
| | | <if test="processingState != null and processingState != 2"> |
| | | AND t1.processing_state = #{processingState} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.LightPoleHeelingProcessingMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightPoleHeelingProcessing"> |
| | | <id property="processingNumber" column="processing_number" jdbcType="BIGINT"/> |
| | | <result property="warningNumber" column="warning_number" jdbcType="BIGINT"/> |
| | | <result property="processingState" column="processing_state" jdbcType="INTEGER"/> |
| | | <result property="processingOpinion" column="processing_opinion" jdbcType="VARCHAR"/> |
| | | <result property="processingPerson" column="processing_person" jdbcType="VARCHAR"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/> |
| | | <result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/> |
| | | <result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | processing_number,warning_number,processing_state, |
| | | processing_opinion,processing_person,create_time, |
| | | the_x_axis,the_y_axis,the_z_axis |
| | | </sql> |
| | | </mapper> |
| | |
| | | light_report_data t1 |
| | | LEFT JOIN pole t2 USING ( device_code ) |
| | | <where> |
| | | 1 = 1 |
| | | |
| | | <if test="deviceCode != null and deviceCode != ''"> |
| | | AND t1.device_code = #{deviceCode} |
| | | </if> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | | t1.device_code LIKE CONCAT('%', #{keyword},'%') |
| | | OR t2.pole_name LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | <if test="deviceCode != null and keyword != ''"> |
| | | AND t1.device_code = #{deviceCode} |
| | | </if> |
| | | |
| | | </where> |
| | | ORDER BY t1.light_report_data_id DESC |
| | | </select> |
| | |
| | | <result property="poleCode" column="pole_code" jdbcType="BIGINT"/> |
| | | <result property="poleName" column="pole_name" jdbcType="VARCHAR"/> |
| | | <result property="deviceType" column="device_type" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="province" column="province" jdbcType="VARCHAR"/> |
| | | <result property="city" column="city" jdbcType="VARCHAR"/> |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,pole_code,pole_name, |
| | | device_type,client_id,province, |
| | | city,region,address, |
| | | lon,lat,device_code, |
| | | on_line_state,binding_count,create_time, |
| | | update_time |
| | | device_type,user_id,client_id, |
| | | province,city,region, |
| | | address,lon,lat, |
| | | device_code,on_line_state,binding_count, |
| | | create_time,update_time |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.UsrAlipayConfigMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AliConfigEntity"> |
| | | <id property="configId" column="config_id" jdbcType="INTEGER"/> |
| | | <result property="appId" column="app_id" jdbcType="VARCHAR"/> |
| | | <result property="privateKey" column="private_key" jdbcType="VARCHAR"/> |
| | | <result property="publicKey" column="public_key" jdbcType="VARCHAR"/> |
| | | <result property="pid" column="pid" jdbcType="VARCHAR"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="createUserId" column="create_user_id" jdbcType="BIGINT"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | config_id,app_id,private_key, |
| | | public_key,pid,client_id, |
| | | create_user_id |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.UsrWxPayConfigMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AliConfigEntity"> |
| | | <id property="configId" column="config_id" jdbcType="BIGINT"/> |
| | | <result property="appid" column="appid" jdbcType="VARCHAR"/> |
| | | <result property="appappid" column="appappid" jdbcType="VARCHAR"/> |
| | | <result property="mchId" column="mch_id" jdbcType="VARCHAR"/> |
| | | <result property="privateKey" column="private_key" jdbcType="VARCHAR"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="createUserId" column="create_user_id" jdbcType="BIGINT"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | config_id,appid,appappid, |
| | | mch_id,private_key,client_id, |
| | | create_user_id |
| | | </sql> |
| | | </mapper> |
| | |
| | | <artifactId>aliyun-java-sdk-iot</artifactId> |
| | | <version>7.29.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.dreampie</groupId> |
| | | <artifactId>jfinal-utils</artifactId> |
| | | <version>0.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | <artifactId>alipay-sdk-java</artifactId> |
| | | <version>4.17.9.ALL</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.dreampie</groupId> |
| | | <artifactId>jfinal-utils</artifactId> |
| | | <version>0.2</version> |
| | | </dependency> |
| | | <!--é¿éäºç©èç½ --> |
| | | </dependencies> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.config; |
| | | |
| | | /* * |
| | | *ç±»åï¼AlipayConfig |
| | | *åè½ï¼åºç¡é
置类 |
| | | *详ç»ï¼è®¾ç½®å¸æ·æå
³ä¿¡æ¯åè¿åè·¯å¾ |
| | | *ä¿®æ¹æ¥æï¼2017-04-05 |
| | | *说æï¼ |
| | | *以ä¸ä»£ç åªæ¯ä¸ºäºæ¹ä¾¿åæ·æµè¯èæä¾çæ ·ä¾ä»£ç ï¼åæ·å¯ä»¥æ ¹æ®èªå·±ç½ç«çéè¦ï¼æç
§ææ¯ææ¡£ç¼å,å¹¶éä¸å®è¦ä½¿ç¨è¯¥ä»£ç ã |
| | | *该代ç ä»
ä¾å¦ä¹ åç ç©¶æ¯ä»å®æ¥å£ä½¿ç¨ï¼åªæ¯æä¾ä¸ä¸ªåèã |
| | | */ |
| | | public class AlipayConfig { |
| | | //ââââââââââ请å¨è¿éé
ç½®æ¨çåºæ¬ä¿¡æ¯âââââââââââââââ |
| | | |
| | | // åºç¨ID,æ¨çAPPIDï¼æ¶æ¬¾è´¦å·æ¢æ¯æ¨çAPPIDå¯¹åºæ¯ä»å®è´¦å· |
| | | // public String app_id = "2019070665741774"; |
| | | |
| | | // åæ·ç§é¥ï¼æ¨çPKCS8æ ¼å¼RSA2ç§é¥ |
| | | // public String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCume3EzEBKw8T2Xs0dBEDwTi8g7AR/c7Gy0sE9XciSVPoKpeHaaqShH7L+ws6pYE7SnXYNKM3diZ6S0vKxt5XhuOpg9y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PBxuCIjfaDRlG/LUOBEY8v8JAW2HCMzOM782H4GVxlwutLJ1zyCESeW0CgYAWNrDsBOWNekj1K3M2oxrRaEt0LtGbATJNgVax1orCVJrP03tXyRU/MHVy6EZwfRRwhPe1S/bSzeoWAIKEO/iKhHgmRe+vRRm3+KvHpHroHmyD7ccB6cVSx3OWx3Nds8QCXZFc4Et6vpVIKEWJDuzH58WsW+yM5awi2Du0kWTOuQKBgCt7QqYDD0k8ahkKL/q2atMkNdJAYlLVWukHTRf8EQ8Uq5xEnLONGtrnYC0gjJCIdbIO4jkP10hOqDufyQqk4DUsk7m1waCmMjGPDTrv8gyVK+48gS6+Jmroi51GDOQTb/T35a3HJt2bflFbaEJzYnHHvkensAUX6DeEMIowE4Qg"; |
| | | |
| | | // æ¯ä»å®å
¬é¥,æ¥çå°åï¼https://openhome.alipay.com/platform/keyManage.htm 对åºAPPIDä¸çæ¯ä»å®å
¬é¥ã |
| | | // public String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhnER1VMBe7yuHI5P5NtsM0Nitaq8cHnobB7KwYDw/V9t/DCiBAbJnuBbOHyS4zkffiZ905dsQycIqu9PRk4J9j6nE9YZVLMPIHXIAOn4J6ZAGmznpuQ9es+fblw+nr/v00X9ZQpR0zYpULEEHaU9lXE8JMoKElawNYRpibArwrnWcizOFbFiwmq8Jq3m07Ri/L7/gogOZshE3WE9UuBIR/czputhq0py0F+yddASy08F0jt3/wm4Cgx/qUpMH/4KwIRwxSKp+Kk7rCRrKmnOm3iMt9QmQ1yX2ht9To5ph3gPBtfR5VyhA8Dasnls9XYEUzsrnWOd1v9javYPgE4vdQIDAQAB"; |
| | | |
| | | // æå¡å¨å¼æ¥éç¥é¡µé¢è·¯å¾ éhttp://æ ¼å¼ç宿´è·¯å¾ï¼ä¸è½å ?id=123è¿ç±»èªå®ä¹åæ°ï¼å¿
é¡»å¤ç½å¯ä»¥æ£å¸¸è®¿é® |
| | | // public static String notify_url = "http://192.168.0.199:8080/machine-fast/serv/c2charging/alipayNotifyReturn"; |
| | | public static String notify_url = "http://"+ServerConfig.getServerIP()+":8888/machine-fast/serv/c2charging/alipayNotifyReturn"; |
| | | |
| | | // 页é¢è·³è½¬åæ¥éç¥é¡µé¢è·¯å¾ éhttp://æ ¼å¼ç宿´è·¯å¾ï¼ä¸è½å ?id=123è¿ç±»èªå®ä¹åæ°ï¼å¿
é¡»å¤ç½å¯ä»¥æ£å¸¸è®¿é® |
| | | // public static String return_url = "http://192.168.0.199:8080/machine-fast/serv/c2charging/alipayReturn"; |
| | | public static String return_url = "http://"+ServerConfig.getServerIP()+":8888/machine-fast/serv/c2charging/alipayReturn"; |
| | | // è¿åæ ¼å¼ |
| | | public static String format = "json"; |
| | | // ç¾åæ¹å¼ |
| | | public static String sign_type = "RSA2"; |
| | | |
| | | // å符ç¼ç æ ¼å¼ |
| | | public static String charset = "utf-8"; |
| | | |
| | | // public String pid = "2088531531858351"; |
| | | |
| | | public static String target_id = ""; |
| | | |
| | | // æ¯ä»å®ç½å
³ |
| | | public static String gatewayUrl = "https://openapi.alipay.com/gateway.do"; |
| | | // public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do"; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.config; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Version 1.0 |
| | | */ |
| | | public class C3mRedisConfig { |
| | | |
| | | // C3å
çµæ¡©æé¿ç¦»çº¿æ¶é´(s) |
| | | public static Long OUTLINE_TIME = 60 * 3L; |
| | | // 设置C3å¿è·³å
æ¶é´ |
| | | public static Long HEART_BEAT_TIME = 60L; |
| | | // C3订åè¶
æ¶æ¶é´ |
| | | public static Long ORDER_MAX_TIME = 60 * 5L; |
| | | // C3è®¢åæ«æé´éæ¶é´ |
| | | public static Long ORDER_QUERY_TIME = 20L; |
| | | // C3å
çµæå¤§æ¶é¿ |
| | | public static Long CHARGING_MAX_TIME = 60 * 60 * 24L * 2; |
| | | // C3æ
éç è¶
æ¶æ¶é´ |
| | | public static Long ERROR_REPORT_MAX_TIME = 60 * 60 * 24 * 7L; |
| | | |
| | | public static void reFlushTime(int onlineCount) { |
| | | if(onlineCount > 60) { |
| | | HEART_BEAT_TIME = Long.parseLong(onlineCount+""); |
| | | OUTLINE_TIME = 3 * HEART_BEAT_TIME; |
| | | }else if(onlineCount < 60){ |
| | | HEART_BEAT_TIME = 60L; |
| | | OUTLINE_TIME = 3 * HEART_BEAT_TIME; |
| | | } |
| | | } |
| | | public static Integer parseInt(Long l){ |
| | | return Integer.parseInt(l+""); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.config; |
| | | |
| | | import com.sandu.ximon.admin.utils.LogUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | @Component |
| | | public class ServerConfig { |
| | | |
| | | @Value("${server-conf.ip}") |
| | | public String SIP; |
| | | @Value("${nginx.port}") |
| | | public String nginxPort; |
| | | @Value("${nginx.cameraSaveUrl}") |
| | | public String saveUrl; |
| | | // @Value("${broadcast.file-save-url}") |
| | | // private String fileSaveUrl; |
| | | |
| | | |
| | | private static String ServerIP; |
| | | private static String NginxPort; |
| | | private static String CameraSaveUrl; |
| | | private static String BroadcastFileSaveUrl; |
| | | private static boolean O2OServer; |
| | | |
| | | public static String getNginxCameraSaveUrl() { |
| | | return CameraSaveUrl; |
| | | } |
| | | |
| | | @PostConstruct |
| | | private void loadIP(){ |
| | | ServerIP = SIP; |
| | | NginxPort = nginxPort; |
| | | CameraSaveUrl = saveUrl; |
| | | // BroadcastFileSaveUrl = fileSaveUrl; |
| | | LogUtils.print("Server IP ï¼" +SIP); |
| | | LogUtils.print("NignX Port ï¼" +nginxPort); |
| | | LogUtils.print("Camera Save Url ï¼" +CameraSaveUrl); |
| | | LogUtils.print("Broadcast File Save Url ï¼" +BroadcastFileSaveUrl); |
| | | } |
| | | |
| | | public static String getServerIP(){ |
| | | return ServerIP; |
| | | } |
| | | public static String getNignxPort(){ |
| | | return NginxPort; |
| | | } |
| | | public static String getBroadcastFileSaveUrl(){ |
| | | return BroadcastFileSaveUrl; |
| | | } |
| | | } |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.map.MapBuilder; |
| | | import cn.hutool.core.map.MapUtil; |
| | |
| | | import com.sandu.common.security.token.TokenProvider; |
| | | import com.sandu.common.util.IpUtil; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.dto.AdminDto; |
| | | import com.sandu.ximon.admin.dto.ClientDto; |
| | | import com.sandu.ximon.admin.param.AdminLoginParam; |
| | | import com.sandu.ximon.admin.param.AdminParam; |
| | | import com.sandu.ximon.admin.param.PwdParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.AdminService; |
| | | import com.sandu.ximon.admin.service.ClientService; |
| | | import com.sandu.ximon.admin.service.MenuService; |
| | | import com.sandu.ximon.admin.service.RoleService; |
| | | import com.sandu.ximon.dao.domain.Admin; |
| | | import com.sandu.ximon.dao.domain.Client; |
| | | import com.sandu.ximon.dao.domain.Menu; |
| | | import com.sandu.ximon.dao.domain.Role; |
| | | import com.sandu.ximon.admin.service.*; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final ClientService clientService; |
| | | private final RoleService roleService; |
| | | private final TokenProvider tokenProvider; |
| | | private final AdminRoleRelationService adminRoleRelationService; |
| | | |
| | | @Log("åå°ç¨æ·ç»å½") |
| | | @AnonymousAccess |
| | |
| | | }); |
| | | } |
| | | List<Admin> list = adminService.list(wrapper); |
| | | return ResponseUtil.successPage(list); |
| | | |
| | | List<AdminDto> adminDtoList = new ArrayList<>(); |
| | | for (Admin demo : list) { |
| | | AdminDto adminDto = new AdminDto(); |
| | | BeanUtil.copyProperties(demo, adminDto); |
| | | AdminRoleRelation one = adminRoleRelationService.getOne(Wrappers.lambdaQuery(AdminRoleRelation.class) |
| | | .eq(AdminRoleRelation::getAdminId, demo.getId())); |
| | | |
| | | if (one != null) { |
| | | adminDto.setRoleId(one.getRoleId()); |
| | | } |
| | | adminDtoList.add(adminDto); |
| | | |
| | | } |
| | | return ResponseUtil.successPage(adminDtoList); |
| | | } |
| | | |
| | | @PostMapping("/register") |
| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.C3ChargingAddParam; |
| | | import com.sandu.ximon.admin.param.C3ChargingParam; |
| | | import com.sandu.ximon.admin.service.C3ChargingService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | private C3ChargingService c3ChargingService; |
| | | |
| | | |
| | | @GetMapping("/C3ChargingList") |
| | | public ResponseVO<Object> C3ChargingList(BaseConditionVO baseConditionVO) { |
| | | return ResponseUtil.successPage(c3ChargingService.getC3ChargingList(baseConditionVO)); |
| | | @PostMapping("/C3ChargingList") |
| | | public ResponseVO<Object> C3ChargingList(BaseConditionVO baseConditionVO, @RequestBody(required = false) C3ChargingParam c3ChargingParam) { |
| | | return ResponseUtil.successPage(c3ChargingService.getC3ChargingListByKeyword(baseConditionVO, c3ChargingParam)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç»æ |
| | | */ |
| | | @PostMapping("/EndOfTheSynchronization") |
| | | public ResponseVO<Object> EndOfTheSynchronization(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.EndOfTheSynchronization(c3ChargingParam.getC3Mac()); |
| | | |
| | | if ("æä½æå".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | | } else { |
| | | return ResponseUtil.fail(result); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢çæ¬ |
| | | */ |
| | | @PostMapping("/QueryVersion") |
| | | public ResponseVO<Object> QueryVersion(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryVersion(c3ChargingParam.getC3Mac()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | */ |
| | | @PostMapping("/QueryIntervalTime") |
| | | public ResponseVO<Object> QueryIntervalTime(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryIntervalTime(c3ChargingParam.getC3Mac()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢çµå/çµæµå¸¸æ° |
| | | */ |
| | | @PostMapping("/QueryConstant") |
| | | public ResponseVO<Object> QueryConstant(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryConstant(c3ChargingParam.getC3Mac()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å°å |
| | | */ |
| | | @PostMapping("/QueryAddress") |
| | | public ResponseVO<Object> QueryAddress(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryAddress(c3ChargingParam.getC3Mac()); |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ
éç |
| | | */ |
| | | @PostMapping("/QueryFaultCode") |
| | | public ResponseVO<Object> QueryFaultCode(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryFaultCode(c3ChargingParam.getC3Mac()); |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 读å¿è·³å
|
| | | */ |
| | | @PostMapping("/ReadTheHeartbeatPackage") |
| | | public ResponseVO<Object> ReadTheHeartbeatPackage(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | return ResponseUtil.success(c3ChargingService.ReadTheHeartbeatPackage(c3ChargingParam.getC3Mac())); |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´(ç§ï¼-å
çµç¶ææ¶ |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTimeCharging") |
| | | public ResponseVO<Object> SetHeartbeatPacketTimeCharging(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetHeartbeatPacketTimeCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getTime(), true)); |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´(ç§ï¼-éå
çµç¶ææ¶ |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTimeNotCharging") |
| | | public ResponseVO<Object> SetHeartbeatPacketTimeNotCharging(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetHeartbeatPacketTimeCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getTime(), false)); |
| | | } |
| | | |
| | | /** |
| | | * 设置çµå/çµæµå¸¸æ°(åä¸åè)(é»è®¤å¼0xBC64) |
| | | */ |
| | | @PostMapping("/SetConstant") |
| | | public ResponseVO<Object> SetConstant(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetConstant(c3ChargingParam.getC3Mac(), c3ChargingParam.getConstant())); |
| | | } |
| | | |
| | | /** |
| | | * 设置å°å |
| | | */ |
| | | @PostMapping("/SetAddress") |
| | | public ResponseVO<Object> SetAddress(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetAddress(c3ChargingParam.getC3Mac(), c3ChargingParam.getAddress())); |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¥åï¼åå¿è·³å
ä¸ç6åèæ¥ææ¶é´ï¼ |
| | | */ |
| | | @PostMapping("/SetCalendar") |
| | | public ResponseVO<Object> SetCalendar(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetCalendar(c3ChargingParam.getC3Mac() |
| | | , c3ChargingParam.getYear(), c3ChargingParam.getMonth(), c3ChargingParam.getDay(), c3ChargingParam.getHour(), c3ChargingParam.getMin(), c3ChargingParam.getSec())); |
| | | } |
| | | |
| | | /** |
| | | * æ
éç 䏿¥æ¸
é¤ |
| | | */ |
| | | @PostMapping("/ClearedFaultCode") |
| | | public ResponseVO<Object> ClearedFaultCode(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.ClearedFaultCode(c3ChargingParam.getC3Mac())); |
| | | } |
| | | |
| | | /** |
| | | * æ¢å¤åºåå¼ |
| | | */ |
| | | @PostMapping("/RestoreFactoryValue") |
| | | public ResponseVO<Object> RestoreFactoryValue(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.RestoreFactoryValue(c3ChargingParam.getC3Mac())); |
| | | } |
| | | |
| | | /** |
| | | * 软éå¯ |
| | |
| | | return ResponseUtil.fail(result); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å å
çµæ¡©ç¡¬ä»¶è®¾å¤ |
| | | * |
| | | * @param c3ChargingAddParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/addC3Charging") |
| | | public ResponseVO<Object> addC3Charging(@RequestBody C3ChargingAddParam c3ChargingAddParam) { |
| | | boolean flag = c3ChargingService.addC3Charging(c3ChargingAddParam); |
| | | if (flag) { |
| | | return ResponseUtil.success("æ·»å å
çµæ¡©ç¡¬ä»¶è®¾å¤æåï¼"); |
| | | } else { |
| | | return ResponseUtil.fail("æ·»å å
çµæ¡©ç¡¬ä»¶è®¾å¤å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å
çµæ¡©ç¡¬ä»¶è®¾å¤åç§° |
| | | * @param c3ChargingAddParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateC3ChargingName") |
| | | public ResponseVO<Object> updateC3ChargingName(@RequestBody C3ChargingAddParam c3ChargingAddParam) { |
| | | boolean flag = c3ChargingService.updateC3ChargingName(c3ChargingAddParam); |
| | | if (flag) { |
| | | return ResponseUtil.success("ä¿®æ¹å
çµæ¡©ç¡¬ä»¶è®¾å¤åç§°æåï¼"); |
| | | } else { |
| | | return ResponseUtil.fail("ä¿®æ¹å
çµæ¡©ç¡¬ä»¶è®¾å¤å称失败ï¼"); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.C3mChargingChargeParam; |
| | | import com.sandu.ximon.admin.service.C3mChargingChargeService; |
| | | import com.sandu.ximon.dao.domain.C3mChargingCharge; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/18 15:58 |
| | | * @Version 1.0 |
| | | * å
çµæ¡©è´¹çç¸å
³ |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/c3mChargingCharge") |
| | | public class C3mChargingChargeController { |
| | | |
| | | private final C3mChargingChargeService chargeService; |
| | | |
| | | |
| | | /** |
| | | * æ·»å è´¹ç |
| | | * |
| | | * @param charge |
| | | * @return |
| | | */ |
| | | // @PostMapping("/addC3mCharging") |
| | | public ResponseVO<Object> addC3mCharging(@RequestBody C3mChargingChargeParam charge) { |
| | | // chargeService.save(charge); |
| | | // chargeService.initCharge(charge); |
| | | return ResponseUtil.success(chargeService.initCharge(charge)); |
| | | } |
| | | |
| | | @PostMapping("/updateC3mCharging") |
| | | public ResponseVO<Object> updateC3mCharging(@RequestBody List<C3mChargingCharge> chargeEntities) { |
| | | if (chargeEntities.size() > 5) { |
| | | throw new BusinessException("å½åæé«ä»
æ¯æ4ç»è´¹ç"); |
| | | } |
| | | if (chargeEntities.size() == 0) { |
| | | throw new BusinessException("æå°éè¦ä¸æ¡è´¹ç"); |
| | | } |
| | | return ResponseUtil.success(chargeService.updateCharge(chargeEntities)); |
| | | } |
| | | |
| | | // @PostMapping("/deleteC3mCharging") |
| | | public ResponseVO<Object> deleteC3mCharging(@RequestBody C3mChargingChargeParam charge) { |
| | | boolean remove = chargeService.remove(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, charge.getC3Id()) |
| | | .eq(C3mChargingCharge::getHour, charge.getCharge()).eq(C3mChargingCharge::getHour, charge.getHour()) |
| | | .eq(C3mChargingCharge::getCharge, charge.getCharge()).eq(C3mChargingCharge::getCharge, charge.getTimestamp())); |
| | | return ResponseUtil.success(remove); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getChargeByC3Id/{c3mId}") //æªåæ¥ææ¡£ |
| | | public ResponseVO<Object> getChargeByC3Id(@PathVariable Integer c3mId) { |
| | | return ResponseUtil.success(chargeService.getChargeByC3Id(c3mId)); |
| | | } |
| | | |
| | | @GetMapping("/getChargeByPoleId/{PoleId}") //为æªåæ¥ææ¡£ |
| | | public ResponseVO<Object> getChargeByPoleId(@PathVariable Long PoleId) { |
| | | return ResponseUtil.success(chargeService.getChargeByPoleId(PoleId)); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.AlipayTradeWapPayModel; |
| | | import com.alipay.api.request.AlipayTradeWapPayRequest; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.config.AlipayConfig; |
| | | import com.sandu.ximon.admin.param.PayParam; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrAlipayConfigService; |
| | | import com.sandu.ximon.admin.pay.wx.WxFastPayService; |
| | | import com.sandu.ximon.admin.service.C3ChargingService; |
| | | import com.sandu.ximon.admin.service.C3mOrderService; |
| | | import com.sandu.ximon.admin.utils.AliPayUtils; |
| | | import com.sandu.ximon.admin.utils.ConfigCheckUtils; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import com.sandu.ximon.dao.enums.OrderType; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.SortedMap; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Version 1.0 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/c3mOrder") |
| | | public class C3mOrderController { |
| | | |
| | | private final C3mOrderService c3mOrderService; |
| | | private final C3ChargingService c3mService; |
| | | private final UsrAlipayConfigService alipayConfigService; |
| | | private final WxFastPayService wxPayService; |
| | | |
| | | |
| | | /** |
| | | * 鿬¾ |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/refond") |
| | | public ResponseVO<Object> refond(@RequestBody Map params) { |
| | | // c3mOrderService.orderRefund( (String)params.get("outTradeNo"), |
| | | // (Double)params.get("refundAmount")); |
| | | return ResponseUtil.success(c3mOrderService.orderRefund((String) params.get("outTradeNo"), |
| | | (Double) params.get("refundAmount"))); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * é¢ä»æ¬¾ï¼çæè®¢å(æç´æ¥ä»redisä¸è·åå½åæªè¿æç订å) |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/advancePay") |
| | | public ResponseVO<Object> advancePayOrder(@RequestBody PayParam param) { |
| | | if (param.getTotalAmount() == 0d) { |
| | | throw new BusinessException("éé¢ä¸è½ä¸º0"); |
| | | } |
| | | // C3å
çµæ¡©å®ä½ |
| | | C3mCharging c3m = c3mService.getC3mByPoleId(param.getPoleId()); |
| | | if (null == c3m) { |
| | | throw new BusinessException("æªæ¾å°å½åå
çµæ¡©"); |
| | | } |
| | | C3mOrder c3mOrderEntity = c3mOrderService.advancePayOrder(param.getPoleId(), c3m, param.getOrderType() |
| | | , param.getTotalAmount(), param.getSubscribeChargingCapacity()); |
| | | if (null == c3mOrderEntity) { |
| | | throw new BusinessException("该å
çµæ¡©æ£è¢«ä½¿ç¨!"); |
| | | } |
| | | // return R.ok().put("outTradeNo",c3mOrderEntity.getOutTradeNo()) |
| | | // .put("totalAmount",totalAmount); |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("outTradeNo", c3mOrderEntity.getOutTradeNo()); |
| | | map.put("totalAmount", param.getTotalAmount()); |
| | | return ResponseUtil.success(map); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/aliPay") |
| | | public ResponseVO<Object> c3AliPay(@RequestBody PayParam param, HttpServletResponse response) { |
| | | // åæ·è®¢åå·ï¼åæ·ç½ç«è®¢åç³»ç»ä¸å¯ä¸è®¢åå·ï¼å¿
å¡« |
| | | String out_trade_no = param.getOutTradeNo(); |
| | | System.out.println("订åå·:" + out_trade_no); |
| | | // 订ååç§°ï¼å¿
å¡« |
| | | String subject = "æ«ç å
çµæ¯ä»(C3å
çµæ¡©)"; |
| | | // 仿¬¾éé¢ï¼å¿
å¡«ï¼åä½ä¸ºå
ï¼ç²¾ç¡®å°å°æ°ç¹å两ä½ï¼åå¼èå´[0.01,100000000] |
| | | String total_amount = param.getTotalAmount().toString(); |
| | | // ååæè¿°ï¼å¯ç©º |
| | | String body = "请å¿ä»æ¬¾ï¼æµè¯ç¨"; |
| | | // è¶
æ¶æ¶é´ å¯ç©º |
| | | String timeout_express = "5m"; |
| | | // éå®äº§åç å¿
å¡« |
| | | String product_code = "QUICK_WAP_WAY"; |
| | | /**********************/ |
| | | AliConfigEntity alipayConfigEntity = alipayConfigService.getConfigByPoleId(param.getPoleId()); |
| | | String checkStr = ConfigCheckUtils.checkAlipayConfig(alipayConfigEntity); |
| | | if (checkStr != null) { |
| | | try { |
| | | response.getWriter().write(checkStr); |
| | | return ResponseUtil.fail("æ¯ä»å®æå¤±è´¥"); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | //è°ç¨RSAç¾åæ¹å¼ |
| | | AlipayClient client = new DefaultAlipayClient(AlipayConfig.gatewayUrl, alipayConfigEntity.getAppId(), alipayConfigEntity.getPrivateKey(), AlipayConfig.format, AlipayConfig.charset, alipayConfigEntity.getPublicKey(), AlipayConfig.sign_type); |
| | | AlipayTradeWapPayRequest alipay_request = new AlipayTradeWapPayRequest(); |
| | | |
| | | // å°è£
è¯·æ±æ¯ä»ä¿¡æ¯ |
| | | AlipayTradeWapPayModel model = new AlipayTradeWapPayModel(); |
| | | model.setOutTradeNo(out_trade_no); |
| | | model.setSubject(subject); |
| | | model.setTotalAmount(total_amount); |
| | | model.setBody(body); |
| | | model.setTimeoutExpress(timeout_express); |
| | | model.setProductCode(product_code); |
| | | model.setQuitUrl(C3mOrder.REQUEST_URL + param.getPoleId() + "/" + new Date().getTime()); |
| | | alipay_request.setBizModel(model); |
| | | // è®¾ç½®å¼æ¥éç¥å°å |
| | | alipay_request.setNotifyUrl(C3mOrder.REQUEST_URL + param.getPoleId() + "/" + new Date().getTime()); |
| | | // è®¾ç½®åæ¥å°å |
| | | alipay_request.setReturnUrl(C3mOrder.REQUEST_URL + param.getPoleId() + "/" + new Date().getTime()); |
| | | |
| | | // form表åç产 |
| | | String form = ""; |
| | | try { |
| | | // è°ç¨SDKçæè¡¨å |
| | | form = client.pageExecute(alipay_request).getBody(); |
| | | response.setContentType("text/html;charset=" + AlipayConfig.charset); |
| | | response.getWriter().write(form);//ç´æ¥å°å®æ´ç表åhtmlè¾åºå°é¡µé¢ |
| | | response.getWriter().flush(); |
| | | response.getWriter().close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ResponseUtil.success("æ¯ä»å®æ"); |
| | | } |
| | | |
| | | @RequestMapping("/wxpay") |
| | | public ResponseVO<Object> c3Wxpay(@RequestBody PayParam param) { |
| | | |
| | | //String result = wxPayService.miniAppPay(outTradeNo, totalAmount, streetlightId); |
| | | SortedMap<Object, Object> result = wxPayService.appPay("æ«ç å
çµæ¯ä»(C3å
çµæ¡©)", param.getOutTradeNo(), param.getWxPayTotalAmount(), param.getPoleId()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | public ResponseVO<Object> queryPayStates(@RequestBody PayParam param) { |
| | | |
| | | // //String result = wxPayService.miniAppPay(outTradeNo, totalAmount, streetlightId); |
| | | ////æ¯ä»å®äº¤æå· |
| | | // String trade_no = WIDtrade_no.Text.Trim(); |
| | | ////æ¯ä»å®äº¤æå·ä¸åæ·ç½ç«è®¢åå·ä¸è½åæ¶ä¸ºç©º |
| | | ////åæ·è®¢åå· |
| | | // String out_trade_no = WIDout_trade_no.Text.Trim(); |
| | | ////æè¯·æ±åæ°æå
ææ°ç» |
| | | // |
| | | // SortedDictionary<string, string> sParaTemp = new SortedDictionary<string, string>(); |
| | | // sParaTemp.Add("partner", Config.Partner); |
| | | // sParaTemp.Add("_input_charset", Config.Input_charset.ToLower()); |
| | | // sParaTemp.Add("service", "single_trade_query"); |
| | | // sParaTemp.Add("trade_no", trade_no); |
| | | // sParaTemp.Add("out_trade_no", out_trade_no); |
| | | ////建ç«è¯·æ± |
| | | // string sHtmlText = Submit.BuildRequest(sParaTemp); |
| | | // |
| | | ////请å¨è¿éå ä¸åæ·çä¸å¡é»è¾ç¨åºä»£ç |
| | | // |
| | | ////ââè¯·æ ¹æ®æ¨çä¸å¡é»è¾æ¥ç¼åç¨åºï¼ä»¥ä¸ä»£ç ä»
ä½åèï¼ââ |
| | | // |
| | | // XmlDocument xmlDoc = new XmlDocument(); |
| | | // try |
| | | // { |
| | | // xmlDoc.LoadXml(sHtmlText); |
| | | // string strXmlResponse = xmlDoc.SelectSingleNode("/alipay").InnerText; |
| | | // Response.Write(strXmlResponse); |
| | | // } |
| | | // catch (Exception exp) |
| | | // { |
| | | // Response.Write(sHtmlText); |
| | | // } |
| | | |
| | | return ResponseUtil.success(null); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/queryOrder") |
| | | public ResponseVO<Object> queryOrder(@RequestBody PayParam param) { |
| | | if (param.getOrderId() == null) { |
| | | throw new BusinessException("请è¾å
¥æ£ç¡®ç订åid"); |
| | | } |
| | | C3mOrder order = c3mOrderService.getById(param.getOrderId()); |
| | | if((OrderType.ALIPAY.getCode()).equals(order.getOrderType())){ |
| | | return ResponseUtil.success(AliPayUtils.alipayQuery(order.getOutTradeNo(),param.getPoleId())); |
| | | }else if((OrderType.WXPAY.getCode()).equals(order.getOrderType())){ |
| | | |
| | | |
| | | } |
| | | |
| | | return ResponseUtil.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | import com.sandu.common.security.token.TokenProvider; |
| | | import com.sandu.common.util.IpUtil; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.dto.ClientDto; |
| | | import com.sandu.ximon.admin.param.AddClientPrarm; |
| | | import com.sandu.ximon.admin.param.AdminLoginParam; |
| | | import com.sandu.ximon.admin.param.ResetClientPasswordPrarm; |
| | | import com.sandu.ximon.admin.param.UpdateClientPrarm; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.ClientRoleRelationService; |
| | | import com.sandu.ximon.admin.service.ClientService; |
| | | import com.sandu.ximon.admin.service.RoleService; |
| | | import com.sandu.ximon.dao.domain.Client; |
| | | import com.sandu.ximon.dao.domain.ClientRoleRelation; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final ClientService clientService; |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final RoleService roleService; |
| | | private final ClientRoleRelationService clientRoleRelationService; |
| | | private final TokenProvider tokenProvider; |
| | | |
| | | @PostMapping("/add") |
| | |
| | | return ResponseUtil.success("æ´æ°æå"); |
| | | } else { |
| | | return ResponseUtil.fail("æ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/resetClientPassword") |
| | | public ResponseVO<Object> resetClientPassword(@RequestBody @Validated ResetClientPasswordPrarm resetClientPasswordPrarm) { |
| | | boolean b = clientService.resetPassword(resetClientPasswordPrarm); |
| | | if (b) { |
| | | return ResponseUtil.success("ä¿®æ¹æå"); |
| | | } else { |
| | | return ResponseUtil.fail("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | |
| | | .or(clientLambdaQueryWrapper -> clientLambdaQueryWrapper.like(Client::getMobile, keyword)) |
| | | .or(clientLambdaQueryWrapper -> clientLambdaQueryWrapper.like(Client::getLinkMan, keyword)); |
| | | } |
| | | return ResponseUtil.successPage(clientService.list(wrapper)); |
| | | List<Client> clientList = clientService.list(wrapper); |
| | | List<ClientDto> clientDtoList = new ArrayList<>(); |
| | | |
| | | for (Client demo : clientList) { |
| | | ClientDto clientDto = new ClientDto(); |
| | | BeanUtil.copyProperties(demo, clientDto); |
| | | ClientRoleRelation one = clientRoleRelationService.getOne(Wrappers.lambdaQuery(ClientRoleRelation.class) |
| | | .eq(ClientRoleRelation::getClientId, demo.getId())); |
| | | |
| | | if (one != null) { |
| | | clientDto.setRoleId(one.getRoleId()); |
| | | } |
| | | clientDtoList.add(clientDto); |
| | | |
| | | } |
| | | return ResponseUtil.successPage(clientDtoList); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | } |
| | | FileOperationRecord fileOperationRecord = new FileOperationRecord(); |
| | | if("mp4".equals(fileUploadDto.getFileType())){ |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | } |
| | | // if("mp4".equals(fileUploadDto.getFileType())){ |
| | | // fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | // } |
| | | BeanUtils.copyProperties(fileUploadDto, fileOperationRecord); |
| | | fileOperationRecord.setDataType(dateType); |
| | | fileOperationRecordService.save(fileOperationRecord); |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.C3ChargingParam; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingListParam; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingParam; |
| | | import com.sandu.ximon.admin.service.LightPoleHeelingService; |
| | | import com.sandu.ximon.dao.domain.LightPoleHeeling; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¯æå¾æ |
| | | * ç¯æå¾æè¦åå表 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | public class LightPoleHeelingController { |
| | | private final LightPoleHeelingService lightPoleHeelingService; |
| | | |
| | | @GetMapping |
| | | public ResponseVO<Object> listLightPoleHeeling() { |
| | | List<LightPoleHeeling> list = lightPoleHeelingService.listLightPoleHeeling(); |
| | | return ResponseUtil.successPage(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¨¡ç³æ¥è¯¢ |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/listLightPoleHeelingByKeyword/{keyword}") |
| | | public ResponseVO<Object> listLightPoleHeelingByKeyword(@PathVariable String keyword) { |
| | | List<LightPoleHeeling> list = lightPoleHeelingService.listLightPoleHeelingByKeyword(keyword); |
| | | @PostMapping("/listLightPoleHeelingByKeyword") |
| | | public ResponseVO<Object> listLightPoleHeelingByKeyword(BaseConditionVO baseConditionVO |
| | | , @RequestBody(required = false) LightPoleHeelingListParam lightPoleHeelingListParam) { |
| | | List<LightPoleHeeling> list = lightPoleHeelingService.listLightPoleHeelingByKeyword(baseConditionVO, lightPoleHeelingListParam); |
| | | return ResponseUtil.successPage(list); |
| | | } |
| | | |
| | | /** |
| | | * ç¯æå¾æå¿è·³å
|
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/LightPoleHeelingHeartbeatPackage") |
| | | public ResponseVO<Object> LightPoleHeelingHeartbeatPackage(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | return ResponseUtil.success(lightPoleHeelingService.LightPoleHeelingHeartbeatPackage(lightPoleHeelingParam.getDeviceName())); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/QueryIntervalTime") |
| | | public ResponseVO<Object> QueryIntervalTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | return ResponseUtil.success(lightPoleHeelingService.QueryIntervalTime(lightPoleHeelingParam.getDeviceName())); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ç¯æå¾æè½¯éå¯ |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/RestartLightPoleHeeling") |
| | | public ResponseVO<Object> RestartLightPoleHeeling(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | String result = lightPoleHeelingService.RestartLightPoleHeeling(lightPoleHeelingParam.getDeviceName()); |
| | | if ("æä½æå".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | | } else { |
| | | return ResponseUtil.fail(result); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´(ç§ï¼ |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTime") |
| | | public ResponseVO<Object> SetHeartbeatPacketTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | String result = lightPoleHeelingService.SetHeartbeatPacketTime(lightPoleHeelingParam.getDeviceName(), lightPoleHeelingParam.getTime()); |
| | | if ("æä½æå".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | | } else { |
| | | return ResponseUtil.fail(result); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ä¼ æå¨ä¸ºåå§ç¶æ |
| | | */ |
| | | @PostMapping("/SetSensorState") |
| | | public ResponseVO<Object> SetSensorState(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | String result = lightPoleHeelingService.SetSensorState(lightPoleHeelingParam.getDeviceName()); |
| | | if ("æä½æå".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | | } else { |
| | | return ResponseUtil.fail(result); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/25 11:45 |
| | | */ |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingProcessingParam; |
| | | import com.sandu.ximon.admin.service.LightPoleHeelingProcessingServices; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * ç¯æå¾æè¦åå¤çå表 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/admin/LightPoleHeelingProcessing") |
| | | public class LightPoleHeelingProcessingController { |
| | | private LightPoleHeelingProcessingServices lightPoleHeelingProcessingServices; |
| | | |
| | | /** |
| | | * ç¯æå¾æè¦åå¤ç |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/Processing") |
| | | public ResponseVO<Object> ProcessingLightPoleHeeling(@RequestBody @Validated LightPoleHeelingProcessingParam param) { |
| | | return ResponseUtil.success(lightPoleHeelingProcessingServices.ProcessingLightPoleHeeling(param)); |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/addYSYMonitor") |
| | | public ResponseVO<Object> addYSYMonitor(@RequestBody MonitorParam monitorParam) { |
| | | // YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial(), monitorParam.getValidateCode()); |
| | | YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial(), monitorParam.getValidateCode()); |
| | | // YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | | if ("200".equals(addMonitorDto.getCode())) { |
| | | return ResponseUtil.success(addMonitorDto); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥æ¾èªå·±æ¥æçç¯æ |
| | | */ |
| | | @PostMapping("/getOwnerPole/{cilentId}") |
| | | public ResponseVO<Object> getOwnerPole(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword |
| | | ,@PathVariable Long cilentId) { |
| | | List<Pole> results = poleService.getOwnerPole(baseConditionVO, keyword, cilentId); |
| | | // CommonPage commonPage = CommonPage.restPage(results); |
| | | // int size = results.size(); |
| | | // commonPage.setTotal((long) size); |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1); |
| | | // if (size % baseConditionVO.getPageSize() == 0) { |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | // } |
| | | // return ResponseUtil.success(commonPage); |
| | | return ResponseUtil.success(results); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.AlipayConfigParam; |
| | | import com.sandu.ximon.admin.param.WxpayConfigParam; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrAlipayConfigService; |
| | | import com.sandu.ximon.admin.pay.wxpay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/16 10:32 |
| | | * @Version 1.0 |
| | | * ç¨æ·æ¯ä»åæ°é
ç½®ç¸å
³ |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/payconfig") |
| | | public class UsrPayConfigController { |
| | | |
| | | private final UsrAlipayConfigService alipayConfigService; |
| | | private final UsrWxPayConfigService wxPayConfigService; |
| | | |
| | | |
| | | /** |
| | | * æ¯ä»å®é
置添å |
| | | * |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAliPayConfig") |
| | | public ResponseVO<Object> addAliPayConfig(@RequestBody AlipayConfigParam configParam) { |
| | | return ResponseUtil.success(alipayConfigService.addAliPayConfig(configParam)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯ä»å®é
ç½®æ´æ¹ |
| | | * |
| | | * @param configId |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateAliPayConfig/{configId}") |
| | | public ResponseVO<Object> updateAliPayConfig(@PathVariable Integer configId, @RequestBody AlipayConfigParam configParam) { |
| | | return ResponseUtil.success(alipayConfigService.updateAliPayConfig(configId, configParam)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯ä»å®é
ç½®å é¤ |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteAliPayConfig/{configId}") |
| | | public ResponseVO<Object> deleteAliPayConfig(@PathVariable Integer configId) { |
| | | return ResponseUtil.success(alipayConfigService.deleteAliPayConfig(configId)); |
| | | } |
| | | |
| | | /** |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAliPayConfigByPoleId/{poleId}") |
| | | public ResponseVO<Object> getAliPayConfigByPoleId(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(alipayConfigService.getConfigByPoleId(poleId)); |
| | | } |
| | | |
| | | /** |
| | | * é
置详æ
|
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAliPayConfigById/{configId}") |
| | | public ResponseVO<Object> getAliPayConfigById(@PathVariable Integer configId) { |
| | | if (configId == null) { |
| | | throw new BusinessException("idè½ä¸ºç©º"); |
| | | } |
| | | AliConfigEntity byId = alipayConfigService.getById(configId); |
| | | if (byId == null) { |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | return ResponseUtil.success(byId); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/aliConfigList") |
| | | public ResponseVO<Object> aliConfigList(BaseConditionVO baseConditionVO |
| | | , @RequestParam(value = "keyword", required = false) String keyword) { |
| | | return ResponseUtil.success(alipayConfigService.configList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * wxé
置添å |
| | | * |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/addWxPayConfig") |
| | | public ResponseVO<Object> addAliPayConfig(@RequestBody WxpayConfigParam configParam) { |
| | | return ResponseUtil.success(wxPayConfigService.addWxPayConfig(configParam)); |
| | | } |
| | | |
| | | /** |
| | | * wxé
ç½®æ´æ¹ |
| | | * |
| | | * @param configId |
| | | * @param configParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateWxPayConfig/{configId}") |
| | | public ResponseVO<Object> updateAliPayConfig(@PathVariable Long configId, @RequestBody WxpayConfigParam configParam) { |
| | | return ResponseUtil.success(wxPayConfigService.updateWxPayConfig(configId, configParam)); |
| | | } |
| | | |
| | | /** |
| | | * wxé
ç½®å é¤ |
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteWxPayConfig/{configId}") |
| | | public ResponseVO<Object> deleteWxPayConfig(@PathVariable Long configId) { |
| | | return ResponseUtil.success(wxPayConfigService.deleteWxPayConfig(configId)); |
| | | } |
| | | |
| | | /** |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWxPayConfigByPoleId/{poleId}") |
| | | public ResponseVO<Object> getWxPayConfigByPoleId(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(wxPayConfigService.getConfigByPoleId(poleId)); |
| | | } |
| | | |
| | | /** |
| | | * é
置详æ
|
| | | * |
| | | * @param configId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWxPayConfigById/{configId}") |
| | | public ResponseVO<Object> getWxPayConfigById(@PathVariable Integer configId) { |
| | | if (configId == null) { |
| | | throw new BusinessException("idè½ä¸ºç©º"); |
| | | } |
| | | WxConfigEntity byId = wxPayConfigService.getById(configId); |
| | | if (byId == null) { |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | return ResponseUtil.success(byId); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/WxConfigList") |
| | | public ResponseVO<Object> WxConfigList(BaseConditionVO baseConditionVO |
| | | , @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.success(wxPayConfigService.configList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.admin.service.VnnoxService; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | @Autowired |
| | | private VnnoxAPIUtil vnnoxAPIUtil; |
| | | @Autowired |
| | | private PoleBindingService bindingService; |
| | | @Autowired |
| | | private PoleService poleService; |
| | | |
| | | /** |
| | | * æªå± |
| | |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LedPlayerEntity> wrapper = Wrappers.lambdaQuery(LedPlayerEntity.class); |
| | | |
| | | if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | //wrapper.eq(LedPlayerEntity::get) |
| | | return ResponseUtil.success(""); // todo |
| | |
| | | ); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | entities.forEach( |
| | | led->{ |
| | | PoleBinding binding = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class) |
| | | .eq(PoleBinding::getDeviceType, 1).eq(PoleBinding::getDeviceCode, led.getSn())); |
| | | if(binding!=null){ |
| | | led.setPoleId(poleService.getById(binding.getPoleId()).getId()); |
| | | led.setPoleName(poleService.getById(binding.getPoleId()).getPoleName()); |
| | | } |
| | | } |
| | | ); |
| | | return ResponseUtil.success(entities); |
| | | } |
| | | } |
| | |
| | | * @param lightemitIds |
| | | * @return |
| | | */ |
| | | @GetMapping("/pushToXixun/{pid}") |
| | | public ResponseVO<Object> getByPid(@PathVariable Long pid, @RequestBody List<Long> lightemitIds) { |
| | | @PostMapping("/pushToXixun/{pid}") |
| | | public ResponseVO<Object> pushByPid(@PathVariable Long pid, @RequestBody List<Long> lightemitIds) { |
| | | xiXunPlayerService.videoXixunPlayer(pid, lightemitIds); |
| | | return ResponseUtil.success("æ¨éæå"); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto; |
| | | |
| | | import com.sandu.ximon.dao.domain.Admin; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/31 9:48 |
| | | */ |
| | | @Data |
| | | public class AdminDto extends Admin { |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | private Long roleId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto; |
| | | |
| | | import com.sandu.ximon.dao.domain.Client; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ClientDto extends Client { |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | private Long roleId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class WxOrderDto { |
| | | |
| | | private amount amount;//订åéé¢ |
| | | |
| | | private String appid; |
| | | |
| | | private String macid; |
| | | |
| | | private String out_trade_no;//åæ·è®¢åå· |
| | | |
| | | private String transaction_id;//微信æ¯ä»è®¢åå· |
| | | |
| | | private String trade_type;//交æç±»å |
| | | |
| | | /** |
| | | * 交æç¶æï¼æä¸¾å¼ï¼ |
| | | * SUCCESSï¼æ¯ä»æå |
| | | * REFUNDï¼è½¬å
¥é款 |
| | | * NOTPAYï¼æªæ¯ä» |
| | | * CLOSEDï¼å·²å
³é |
| | | * REVOKEDï¼å·²æ¤éï¼ä»
仿¬¾ç æ¯ä»ä¼è¿åï¼ |
| | | * USERPAYINGï¼ç¨æ·æ¯ä»ä¸ï¼ä»
仿¬¾ç æ¯ä»ä¼è¿åï¼ |
| | | * PAYERRORï¼æ¯ä»å¤±è´¥ï¼ä»
仿¬¾ç æ¯ä»ä¼è¿åï¼ |
| | | * 示ä¾å¼ï¼SUCCESS |
| | | */ |
| | | private String trade_state;//交æç¶æ |
| | | |
| | | private String trade_state_desc;//交æç¶ææè¿° |
| | | |
| | | private String bank_type;//仿¬¾é¶è¡ |
| | | |
| | | private String attach;//éå æ°æ® |
| | | |
| | | private String success_time; |
| | | |
| | | private payer payer;//æ¯ä»è
|
| | | |
| | | private List<promotion_detail> promotion_detail; //+伿 åè½ |
| | | |
| | | private scene_info scene_info;//-åºæ¯ä¿¡æ¯ |
| | | |
| | | private goods_detail goods_detail;//ååå表 |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class amount { |
| | | //æ»éé¢ |
| | | private Integer total; |
| | | //ç¨æ·æ¯ä»éé¢ |
| | | private Integer payer_total; |
| | | //è´§å¸ç±»å |
| | | private String currency; |
| | | //ç¨æ·æ¯ä»å¸ç§ |
| | | private String payer_currency; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class goods_detail { |
| | | private String goods_id;//ååç¼ç |
| | | private Integer quantity;//ååæ°é |
| | | private Integer unit_price;//åååä»· |
| | | private Integer discount_amount;//åå伿 éé¢ |
| | | private String goods_remark;//åå夿³¨ |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class payer { |
| | | |
| | | private String openid ;//ç¨æ·æ è¯ |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class promotion_detail { |
| | | private String coupon_id;//å¸ID |
| | | private String name;//伿 åç§° |
| | | private String scope;//伿 èå´ |
| | | private String type;//伿 ç±»å CASHï¼å
å¼ NOCASHï¼é¢å
å¼ |
| | | private Integer amount; //伿 å¸é¢é¢ |
| | | private String stock_id;//æ´»å¨ID |
| | | private Integer wechatpay_contribute;//微信åºèµ |
| | | private Integer merchant_contribute;//åæ·åºèµ |
| | | private Integer other_contribute;//å
¶ä»åºèµ |
| | | private String currency;//伿 å¸ç§ |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.dto.wxquery; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/29 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class scene_info { |
| | | |
| | | private String device_id; |
| | | |
| | | } |
| | |
| | | package com.sandu.ximon.admin.entity; |
| | | |
| | | import com.sandu.ximon.dao.domain.LedSFile; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | |
| | | private boolean isOthers=true; |
| | | private int version; //2ä¸ºç®æèç®ï¼9为å®ç¹èç®ï¼å
¶ä»ä¸ºé«çº§èç®ï¼è¯·èµå¼å
¶ä»ã |
| | | |
| | | private List<LedSFile> fileList; |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.AirDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.LightDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.PoleMonitorDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.c3ChargingProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonReportMessage; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5C3ReportEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5LightReportEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.FrameUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | // å¤§æ°æ°æ®æä»¤ä¸æ¥ |
| | | AirDataProcessor.getInstance().process(productKey, deviceName, frame); |
| | | // atmosphereAnalysis(productKey, deviceName, frame); |
| | | } else if (frame.getOrderType().equals(A5OrderEnum.RESPONSE_POLE_MONITOR_DATA.getCode())) { |
| | | PoleMonitorDataProcessor.getInstance().process(productKey, deviceName, frame); |
| | | } |
| | | } |
| | | |
| | | private void c3ChargingReportAnalysis(String productKey, String deviceName, CommonFrame frame) { |
| | | String functionCode = frame.getPayload().substring(2, 4); |
| | | if (A5C3ReportEnum.NETWORK_REQUEST.getCode().equals(functionCode)) { |
| | | A5C3CommonReportInnerFrame netRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_netRequestFrame"); |
| | | log.info(netRequestFrame.toString()); |
| | | } else if (A5C3ReportEnum.QR_CODE_REQUEST.getCode().equals(functionCode)) { |
| | | if (C3ChargingEnum.NETWORK_REQUEST.getCode().equals(functionCode)) { |
| | | // A5C3CommonReportInnerFrame netRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | // log.info("C3å
çµæ¡©ä¸æ¥å¤ç_netRequestFrame"); |
| | | // log.info(netRequestFrame.toString()); |
| | | //ç½ç»è¯·æ± |
| | | c3ChargingProcessor.c3ChargingProcessorgetInstance().process(productKey, deviceName, frame); |
| | | |
| | | } else if (C3ChargingEnum.QR_CODE_REQUEST.getCode().equals(functionCode)) { |
| | | A5C3CommonReportInnerFrame codeRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_codeRequestFrame"); |
| | | log.info(codeRequestFrame.toString()); |
| | | } else if (A5C3ReportEnum.HEART_BEAT.getCode().equals(functionCode)) { |
| | | } else if (C3ChargingEnum.HEART_BEAT.getCode().equals(functionCode)) { |
| | | //å¿è·³å
|
| | | c3ChargingProcessor.c3ChargingProcessorgetInstance().process(productKey, deviceName, frame); |
| | | } else if (A5C3ReportEnum.CHARGE_COMPLETE.getCode().equals(functionCode)) { |
| | | } else if (C3ChargingEnum.CHARGE_COMPLETE.getCode().equals(functionCode)) { |
| | | A5C3CommonReportInnerFrame completeRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_completeRequestFrame"); |
| | | log.info(completeRequestFrame.toString()); |
| | | } else if (A5C3ReportEnum.CHARGE_STOP.getCode().equals(functionCode)) { |
| | | } else if (C3ChargingEnum.CHARGE_STOP.getCode().equals(functionCode)) { |
| | | A5C3CommonReportInnerFrame stopRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_stopRequestFrame"); |
| | | log.info(stopRequestFrame.toString()); |
| | | } else if (A5C3ReportEnum.ERROR_CODE.getCode().equals(functionCode)) { |
| | | } else if (C3ChargingEnum.ERROR_CODE.getCode().equals(functionCode)) { |
| | | A5C3ErrorCodeReportInnerFrame errorCodeRequestFrame = new A5C3ErrorCodeReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_errorCodeRequestFrame"); |
| | | log.info(errorCodeRequestFrame.toString()); |
| | |
| | | } |
| | | |
| | | public static AirDataProcessor getInstance() { |
| | | return AirDataProcessor.AirDataProcessorHolder.INSTANCE; |
| | | return AirDataProcessorHolder.INSTANCE; |
| | | } |
| | | |
| | | private static class AirDataProcessorHolder { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.amqp.processor; |
| | | |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5LightPoleHeelingHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5AtmosphereReportEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.service.AirDataService; |
| | | import com.sandu.ximon.admin.service.LightPoleHeelingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/24 9:45 |
| | | */ |
| | | @Slf4j |
| | | public class PoleMonitorDataProcessor implements IMessageProcessor { |
| | | public PoleMonitorDataProcessor() { |
| | | |
| | | } |
| | | |
| | | public static PoleMonitorDataProcessor getInstance() { |
| | | return PoleMonitorDataProcessorHolder.INSTANCE; |
| | | } |
| | | |
| | | private static class PoleMonitorDataProcessorHolder { |
| | | |
| | | private static final PoleMonitorDataProcessor INSTANCE = new PoleMonitorDataProcessor(); |
| | | } |
| | | |
| | | @Override |
| | | public void process(String productKey, String deviceName, CommonFrame frame) { |
| | | String functionCode = frame.getPayload().substring(2, 4); |
| | | if (LightPoleHeelingEnum.TheHeartbeatPackage.getCode().equals(functionCode)) { |
| | | log.info("å¿è·³ç¸åºââç¯æå¾æ"); |
| | | A5LightPoleHeelingHeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5LightPoleHeelingHeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info(heartbeatReportInnerFrame.toString()); |
| | | |
| | | SpringContextHolder.getBean(LightPoleHeelingService.class).saveLightPoleHeelingHeartbeat(deviceName, heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | |
| | | // SpringContextHolder.getBean(LightService.class).saveLight(deviceName,heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sandu.ximon.admin.manager.iot.amqp.processor; |
| | | |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3CommonReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3HeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3OperationReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingReportEnum; |
| | | import com.sandu.ximon.admin.service.C3ChargingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | @Override |
| | | public void process(String productKey, String deviceName, CommonFrame frame) { |
| | | String functionCode = frame.getPayload().substring(2, 4); |
| | | if (C3ChargingReportEnum.HeartBeat_Data.getCode().equals(functionCode)) { |
| | | if (C3ChargingEnum.HEART_BEAT.getCode().equals(functionCode)) { |
| | | log.info("å¿è·³ç¸åºââC3å
çµæ¡©æ°æ®" + productKey + " ------- " + deviceName); |
| | | A5C3HeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5C3HeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_heartbeatReportInnerFrame"); |
| | | log.info(heartbeatReportInnerFrame.toString()); |
| | | |
| | | if (heartbeatReportInnerFrame.isValidate()) { |
| | | SpringContextHolder.getBean(C3ChargingService.class).saveReportData(deviceName, heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | SpringContextHolder.getBean(C3ChargingService.class).updateReportState(deviceName |
| | | , heartbeatReportInnerFrame.getHeartBeatDataPackage().getC3Mac() |
| | | , heartbeatReportInnerFrame.getHeartBeatDataPackage().getStatusBit() |
| | | , heartbeatReportInnerFrame.getHeartBeatDataPackage().getDeviceTemperature()); |
| | | } |
| | | } else if (C3ChargingEnum.StartCharging.getCode().equals(functionCode)) { |
| | | log.info("å¿è·³ååºââC3å
çµæ¡©å¼å§å
çµ"); |
| | |
| | | // if (operationReportInnerFrame.isValidate()) { |
| | | // SpringContextHolder.getBean(C3ChargingService.class).saveReportData(deviceName, operationReportInnerFrame.getHeartBeatDataPackage()); |
| | | // } |
| | | } else if (C3ChargingEnum.NETWORK_REQUEST.getCode().equals(functionCode)) { |
| | | A5C3CommonReportInnerFrame netRequestFrame = new A5C3CommonReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("C3å
çµæ¡©ä¸æ¥å¤ç_netRequestFrame"); |
| | | log.info(netRequestFrame.toString()); |
| | | |
| | | if (netRequestFrame.isValidate()) { |
| | | SpringContextHolder.getBean(C3ChargingService.class).saveReporEquipment(deviceName, netRequestFrame.getMcuUdid(), netRequestFrame.getDestinationAddress()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // ç®æ å°å 4 |
| | | private String destinationAddress; |
| | | private String mcuUdid; |
| | | |
| | | @Override |
| | | public A5C3CommonReportInnerFrame transformFrame(String hex) { |
| | |
| | | |
| | | setDestinationAddress(hex.substring(8, 16)); |
| | | |
| | | /** |
| | | * 设置mcu_udid |
| | | */ |
| | | if(getFunctionCode().equals("40")){ |
| | | setMcuUdid(hex.substring(16, hex.length() - 8)); |
| | | } |
| | | |
| | | setCrc32(hex.substring(hex.length() - 8)); |
| | | // æ ¡éªCRC32 |
| | | String frame = hex.substring(2, hex.length() - 8); |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.report; |
| | | |
| | | import cn.hutool.core.util.HexUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.BaseResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IResponseInnerFrame; |
| | |
| | | return null; |
| | | } |
| | | this.c3Mac = hex.substring(0, 8); |
| | | this.year = hex.substring(8, 10); |
| | | this.month = hex.substring(10, 12); |
| | | this.day = hex.substring(12, 14); |
| | | this.hour = hex.substring(14, 16); |
| | | this.min = hex.substring(16, 18); |
| | | this.sec = hex.substring(18, 20); |
| | | this.chargingPort = hex.substring(20, 24); |
| | | this.statusBit = hex.substring(24, 26); |
| | | this.deviceTemperature = (parseVal(hex, 26, 28) + "." + parseVal(hex, 28, 30)); |
| | | this.gridVoltage = hex.substring(30, 34); |
| | | this.gridCurrent = hex.substring(34, 38); |
| | | this.frequency = hex.substring(38, 42); |
| | | this.powerFactor = hex.substring(42, 46); |
| | | this.activePower = hex.substring(46, 50); |
| | | this.reactivePower = hex.substring(50, 54); |
| | | this.chargedCapacity = hex.substring(54, 58); |
| | | this.reservedCapacity = hex.substring(58, 62); |
| | | this.remainingAmount = hex.substring(62, 66); |
| | | this.alreadyChargingTime = hex.substring(66, 72); |
| | | this.year = parseVal(hex.substring(8, 10)); |
| | | this.month = parseVal(hex.substring(10, 12)); |
| | | this.day = parseVal(hex.substring(12, 14)); |
| | | this.hour = parseVal(hex.substring(14, 16)); |
| | | this.min = parseVal(hex.substring(16, 18)); |
| | | this.sec = parseVal(hex.substring(18, 20)); |
| | | this.chargingPort = parseVal(hex.substring(20, 24)); |
| | | this.statusBit = parseVal(hex.substring(24, 26)); |
| | | this.deviceTemperature = temperatureTransition(hex.substring(26, 30)) + ""; |
| | | this.gridVoltage = (parseVal(hex, 30, 34) * 0.01) + ""; |
| | | this.gridCurrent = (parseVal(hex, 34, 38) * 0.01 + ""); |
| | | this.frequency = (parseVal(hex, 38, 42) * 0.01 + ""); |
| | | this.powerFactor = (parseVal(hex, 42, 46) * 0.01 + ""); |
| | | this.activePower = (parseVal(hex, 46, 50) * 0.01 + ""); |
| | | this.reactivePower = (parseVal(hex, 50, 54) * 0.01 + ""); |
| | | this.chargedCapacity = (parseVal(hex, 54, 58) * 0.01 + ""); |
| | | this.reservedCapacity = (parseVal(hex, 58, 62) * 0.01 + ""); |
| | | this.remainingAmount = (parseVal(hex, 62, 66) * 0.01 + ""); |
| | | this.alreadyChargingTime = parseVal(hex.substring(66, 72)); |
| | | //72-80ä¿çï¼ææªä½¿ç¨ |
| | | |
| | | return this; |
| | | } |
| | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| | | |
| | | private String parseVal(String hex) { |
| | | return Integer.parseInt(hex, 16) + ""; |
| | | } |
| | | |
| | | /** |
| | | * å°16è¿å¶è½¬æ2è¿å¶ï¼è¿è¡è¡¥ç ï¼åç åºç¡ä¸+1ï¼ï¼å¾å°æ£ç¡®æ°å¼ |
| | | * ä¼ å
¥16è¿å¶ç温度ï¼ç±»å为String |
| | | * å¦F500 |
| | | */ |
| | | public Double temperatureTransition(String temperature) { |
| | | |
| | | //å°ä¼ è¿æ¥ç16è¿å¶ç转为2è¿å¶ |
| | | String twoBinStr = hexStr2BinStr(temperature); |
| | | |
| | | if ("1".equals(twoBinStr.substring(0, 1))) { |
| | | //æé«ä½æ¯1ï¼ä¸ºè´æ°,å°16è¿å¶çè¿è¡è¡¥ç ï¼è¿å |
| | | int max = 0b1111111111111111; |
| | | double result = (max - HexUtil.hexToInt(temperature)) * (-0.01); |
| | | return result; |
| | | |
| | | } else if ("0".equals(twoBinStr.substring(0, 1))) { |
| | | //æé«ä½æ¯0ï¼æ£æ°ï¼ç´æ¥è¿å |
| | | double result = (HexUtil.hexToInt(temperature)) * (0.01); |
| | | return result; |
| | | |
| | | } |
| | | // |
| | | return 0.00; |
| | | } |
| | | |
| | | /** |
| | | * 16è¿å¶å符串转为äºè¿å¶ |
| | | */ |
| | | public String hexStr2BinStr(String hexStr) { |
| | | if (hexStr == null || hexStr.length() % 2 != 0) { |
| | | return null; |
| | | } |
| | | String bString = "", tmp; |
| | | for (int i = 0; i < hexStr.length(); i++) { |
| | | tmp = "0000" + Integer.toBinaryString(Integer.parseInt(hexStr.substring(i, i + 1), 16)); |
| | | bString += tmp.substring(tmp.length() - 4); |
| | | } |
| | | return bString; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.report; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.BaseResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | import lombok.Data; |
| | | import lombok.ToString; |
| | | |
| | | import java.text.DecimalFormat; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/18 9:51 |
| | | * C3å
çµæ¡©æ¥è¯¢æä»¤ååºå¸§ |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | public class A5C3QueryReportInnerFrame extends BaseResponseInnerFrame<A5C3QueryReportInnerFrame> { |
| | | //MACå°å |
| | | private String mac; |
| | | //çæ¬å· |
| | | private String version; |
| | | //å¿è·³å
é´éæ¶é´ |
| | | private String IntervalTime; |
| | | //æ¥è¯¢çµå/çµæµå¸¸æ° |
| | | private String constant; |
| | | //æ¥è¯¢å°å(ææ¶ä¸ç¨å°ï¼ |
| | | private String address; |
| | | //æ
éç |
| | | private String faultCode; |
| | | |
| | | @Override |
| | | public A5C3QueryReportInnerFrame transformFrame(String hex) { |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | // MQTTéä¿¡æ¹å¼(1) |
| | | setConnectType(hex.substring(0, 2)); |
| | | // åè½ç (1) |
| | | setFunctionCode(hex.substring(2, 4)); |
| | | // è´è·é¿åº¦(2) |
| | | setPayloadLength(hex.substring(4, 8)); |
| | | //MACå°å |
| | | setMac(hex.substring(8, 16)); |
| | | |
| | | retuenInfomation(functionCode, hex.substring(16, hex.length() - 8)); |
| | | |
| | | setCrc32(hex.substring(hex.length() - 8)); |
| | | // æ ¡éªCRC32 |
| | | String frame = hex.substring(2, hex.length() - 8); |
| | | this.setValidate(CRC32Utils.validateFrame(frame, getCrc32())); |
| | | return this; |
| | | } |
| | | |
| | | public void retuenInfomation(String functionCode, String hex) { |
| | | |
| | | /** |
| | | * æ¥è¯¢çæ¬å· |
| | | */ |
| | | if (functionCode.equals(C3ChargingEnum.QueryVersion.getCode())) { |
| | | if (hex.length() != 8) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | DecimalFormat df = new DecimalFormat("00"); |
| | | setVersion("ç¡¬ä»¶çæ¬å·ï¼" + df.format(parseVal(hex, 0, 2)) + df.format(parseVal(hex, 2, 4)) |
| | | + "; " + "è½¯ä»¶çæ¬å·ï¼" + df.format(parseVal(hex, 4, 6)) + df.format(parseVal(hex, 6, 8))); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | */ |
| | | if (functionCode.equals(C3ChargingEnum.QueryIntervalTime.getCode())) { |
| | | if (hex.length() != 4) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | setIntervalTime("å¿è·³å
é´éæ¶é´(s)ï¼" + parseVal(hex, 0, 4)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢çµå/çµæµå¸¸æ° |
| | | */ |
| | | if (functionCode.equals(C3ChargingEnum.QueryConstant.getCode())) { |
| | | if (hex.length() != 4) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | setConstant("çµå常æ°ï¼" + parseVal(hex, 0, 2) + " ;çµæµå¸¸æ°ï¼" + parseVal(hex, 2, 4)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å°å(ææ¶ä¸ç¨å°ï¼ |
| | | */ |
| | | if (functionCode.equals(C3ChargingEnum.QueryAddress.getCode())) { |
| | | if (hex.length() != 4) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | setAddress(hex); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å°å(ææ¶ä¸ç¨å°ï¼ |
| | | */ |
| | | if (functionCode.equals(C3ChargingEnum.QueryFaultCode.getCode())) { |
| | | if (hex.length() != 4) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | setFaultCode(hex); |
| | | } |
| | | } |
| | | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.report; |
| | | |
| | | import cn.hutool.core.util.HexUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.BaseResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | import lombok.Data; |
| | | import lombok.ToString; |
| | | |
| | | /** |
| | | * ç¯æå¾æå¿è·³å
䏿¥ |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | public class A5LightPoleHeelingHeartbeatReportInnerFrame extends BaseResponseInnerFrame<A5LightPoleHeelingHeartbeatReportInnerFrame> { |
| | | |
| | | // ç®æ å°å 4 |
| | | private String destinationAddress; |
| | | // å¿è·³å
æ°æ® |
| | | private HeartBeatDataPackage heartBeatDataPackage; |
| | | |
| | | |
| | | @Override |
| | | public A5LightPoleHeelingHeartbeatReportInnerFrame transformFrame(String hex) { |
| | | // é¿åº¦ä¸ä¸è´æ¶ï¼è¿ånull |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | // MQTTéä¿¡æ¹å¼(1) |
| | | setConnectType(hex.substring(0, 2)); |
| | | // åè½ç (1) |
| | | setFunctionCode(hex.substring(2, 4)); |
| | | // è´è·é¿åº¦(2) |
| | | setPayloadLength(hex.substring(4, 8)); |
| | | |
| | | setDestinationAddress(hex.substring(8, 12)); |
| | | |
| | | String heartBeatData = hex.substring(12, hex.length() - 8); |
| | | heartBeatDataPackage = new HeartBeatDataPackage(); |
| | | heartBeatDataPackage.transformFrame(heartBeatData); |
| | | setHeartBeatDataPackage(heartBeatDataPackage); |
| | | |
| | | setCrc32(hex.substring(hex.length() - 8)); |
| | | // æ ¡éªCRC32 |
| | | String frame = hex.substring(2, hex.length() - 8); |
| | | this.setValidate(CRC32Utils.validateFrame(frame, getCrc32())); |
| | | return this; |
| | | } |
| | | |
| | | @Data |
| | | public static class HeartBeatDataPackage implements IResponseInnerFrame<HeartBeatDataPackage> { |
| | | //设å¤åå· |
| | | private String equipmentModel; |
| | | //Xè½´ |
| | | private double theXAxis; |
| | | //Yè½´ |
| | | private double theYAxis; |
| | | //Zè½´ |
| | | private double theZAxis; |
| | | //é¢ç |
| | | private String reservedA; |
| | | private String reservedB; |
| | | private String reservedC; |
| | | private String reservedD; |
| | | |
| | | @Override |
| | | public HeartBeatDataPackage transformFrame(String hex) { |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | this.equipmentModel = "V" + (parseVal(hex, 0, 2)) + "." + String.format("%02d", parseVal(hex, 2, 4)); |
| | | this.theXAxis = NumberUtil.round(temperatureTransition(hex.substring(4, 8)) * 0.1, 1).doubleValue(); |
| | | this.theYAxis = NumberUtil.round(temperatureTransition(hex.substring(8, 12)) * 0.1, 1).doubleValue(); |
| | | this.theZAxis = NumberUtil.round(temperatureTransition(hex.substring(12, 16)) * 0.1, 1).doubleValue(); |
| | | this.reservedA = hex.substring(16, 20); |
| | | this.reservedB = hex.substring(20, 24); |
| | | this.reservedC = hex.substring(24, 28); |
| | | this.reservedD = hex.substring(28, 32); |
| | | //72-80ä¿çï¼ææªä½¿ç¨ |
| | | |
| | | return this; |
| | | } |
| | | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| | | |
| | | private String parseVal(String hex) { |
| | | return Integer.parseInt(hex, 16) + ""; |
| | | } |
| | | |
| | | /** |
| | | * å°16è¿å¶è½¬æ2è¿å¶ï¼è¿è¡è¡¥ç ï¼åç åºç¡ä¸+1ï¼ï¼å¾å°æ£ç¡®æ°å¼ |
| | | * ä¼ å
¥16è¿å¶ç温度ï¼ç±»å为String |
| | | * å¦F500 |
| | | */ |
| | | public Double temperatureTransition(String temperature) { |
| | | |
| | | //å°ä¼ è¿æ¥ç16è¿å¶ç转为2è¿å¶ |
| | | String twoBinStr = hexStr2BinStr(temperature); |
| | | |
| | | if ("1".equals(twoBinStr.substring(0, 1))) { |
| | | //æé«ä½æ¯1ï¼ä¸ºè´æ°,å°16è¿å¶çè¿è¡è¡¥ç ï¼è¿å |
| | | int max = 0b1111111111111111; |
| | | double result = (max - HexUtil.hexToInt(temperature)) * (-0.01); |
| | | return result; |
| | | |
| | | } else if ("0".equals(twoBinStr.substring(0, 1))) { |
| | | //æé«ä½æ¯0ï¼æ£æ°ï¼ç´æ¥è¿å |
| | | double result = (HexUtil.hexToInt(temperature)) * (0.01); |
| | | return result; |
| | | |
| | | } |
| | | // |
| | | return 0.00; |
| | | } |
| | | |
| | | /** |
| | | * 16è¿å¶å符串转为äºè¿å¶ |
| | | */ |
| | | public String hexStr2BinStr(String hexStr) { |
| | | if (hexStr == null || hexStr.length() % 2 != 0) { |
| | | return null; |
| | | } |
| | | String bString = "", tmp; |
| | | for (int i = 0; i < hexStr.length(); i++) { |
| | | tmp = "0000" + Integer.toBinaryString(Integer.parseInt(hexStr.substring(i, i + 1), 16)); |
| | | bString += tmp.substring(tmp.length() - 4); |
| | | } |
| | | return bString; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.report; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.BaseResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | import lombok.Data; |
| | | import lombok.ToString; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/14 16:36 |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | public class A5LightPoleHeelingOperationReportInnerFrame extends BaseResponseInnerFrame<A5LightPoleHeelingOperationReportInnerFrame> { |
| | | //MACå°å |
| | | private String mac; |
| | | //ååºç¶æ |
| | | // 0x00 æå |
| | | // 0x01 æ ¡éªç é误 |
| | | // 0x02 é¿åº¦é误 |
| | | // 0x03 åFlash失败é误 |
| | | // 0xFF å
¶ä»é误 |
| | | |
| | | private String state; |
| | | |
| | | @Override |
| | | public A5LightPoleHeelingOperationReportInnerFrame transformFrame(String hex) { // é¿åº¦ä¸ä¸è´æ¶ï¼è¿ånull |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | // MQTTéä¿¡æ¹å¼(1) |
| | | setConnectType(hex.substring(0, 2)); |
| | | // åè½ç (1) |
| | | setFunctionCode(hex.substring(2, 4)); |
| | | // è´è·é¿åº¦(2) |
| | | setPayloadLength(hex.substring(4, 8)); |
| | | //MACå°å |
| | | setMac(hex.substring(8, 12)); |
| | | //硬件交äºååºç»æ |
| | | setState(returnState(hex.substring(12, 14))); |
| | | |
| | | setCrc32(hex.substring(hex.length() - 8)); |
| | | // æ ¡éªCRC32 |
| | | String frame = hex.substring(2, hex.length() - 8); |
| | | this.setValidate(CRC32Utils.validateFrame(frame, getCrc32())); |
| | | return this; |
| | | } |
| | | |
| | | public String returnState(String stateCode) { |
| | | String State = ""; |
| | | switch (stateCode) { |
| | | case "00": |
| | | State = "æä½æå"; |
| | | break; |
| | | case "01": |
| | | State = "æ ¡éªç é误"; |
| | | break; |
| | | case "02": |
| | | State = "é¿åº¦é误"; |
| | | break; |
| | | case "03": |
| | | State = "åFlash失败é误"; |
| | | break; |
| | | case "FF": |
| | | State = "å
¶ä»é误"; |
| | | break; |
| | | default: |
| | | } |
| | | return State; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.report; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.BaseResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | import lombok.Data; |
| | | import lombok.ToString; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/22 16:23 |
| | | */ |
| | | @Data |
| | | @ToString(callSuper = true) |
| | | public class A5LightPoleHeelingQueryReportInnerFrame extends BaseResponseInnerFrame<A5LightPoleHeelingQueryReportInnerFrame> { |
| | | //ç®æ å°å |
| | | private String devicesName; |
| | | //å¿è·³å
é´éæ¶é´ |
| | | private String IntervalTime; |
| | | |
| | | @Override |
| | | public A5LightPoleHeelingQueryReportInnerFrame transformFrame(String hex) { |
| | | if (StrUtil.isBlank(hex)) { |
| | | return null; |
| | | } |
| | | // MQTTéä¿¡æ¹å¼(1) |
| | | setConnectType(hex.substring(0, 2)); |
| | | // åè½ç (1) |
| | | setFunctionCode(hex.substring(2, 4)); |
| | | // è´è·é¿åº¦(2) |
| | | setPayloadLength(hex.substring(4, 8)); |
| | | //MACå°å |
| | | setDevicesName(hex.substring(8, 12)); |
| | | |
| | | retuenInfomation(functionCode, hex.substring(12, hex.length() - 8)); |
| | | |
| | | setCrc32(hex.substring(hex.length() - 8)); |
| | | // æ ¡éªCRC32 |
| | | String frame = hex.substring(2, hex.length() - 8); |
| | | this.setValidate(CRC32Utils.validateFrame(frame, getCrc32())); |
| | | return this; |
| | | } |
| | | |
| | | public void retuenInfomation(String functionCode, String hex) { |
| | | /** |
| | | * æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | */ |
| | | if (functionCode.equals(LightPoleHeelingEnum.QueryIntervalTime.getCode())) { |
| | | if (hex.length() != 4) { |
| | | throw new BusinessException("æ°æ®é误ï¼è¯·éæ°è¯·æ±ï¼"); |
| | | } |
| | | setIntervalTime("å¿è·³å
é´éæ¶é´(s)ï¼" + parseVal(hex, 0, 4)); |
| | | } |
| | | } |
| | | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3ClearedFaultCodeReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3ClearedFaultCodeReqInnerFrame(String c3Mac) { |
| | | |
| | | payload = c3Mac; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.ClearedFaultCode.getCode(); |
| | | String payloadLength = "0004"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3QueryFaultCodeReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3QueryFaultCodeReqInnerFrame(String c3Mac) { |
| | | payload = c3Mac ; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.QueryFaultCode.getCode(); |
| | | String payloadLength = "0004"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3ReadTheHeartbeatPackageReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3ReadTheHeartbeatPackageReqInnerFrame(String c3Mac) { |
| | | payload = c3Mac ; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.ReadTheHeartbeatPackage.getCode(); |
| | | String payloadLength = "0004"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3RestoreFactoryValueReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3RestoreFactoryValueReqInnerFrame(String c3Mac) { |
| | | |
| | | payload = c3Mac; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.RestoreFactoryValue.getCode(); |
| | | String payloadLength = "0004"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3SetAddressReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3SetAddressReqInnerFrame(String c3Mac, String address) { |
| | | payload = c3Mac + address; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.SetAddress.getCode(); |
| | | String payloadLength = "0008"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3SetCalendarReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3SetCalendarReqInnerFrame(String c3Mac, int year, int month, int day, int hour, int min, int sec) { |
| | | |
| | | payload = c3Mac + hex10To16(year) + hex10To16(month) + hex10To16(day) + hex10To16(hour) + hex10To16(min) + hex10To16(sec); |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.SetCalendar.getCode(); |
| | | String payloadLength = "000A"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | |
| | | private String hex10To16(int value) { |
| | | return String.format("%02X", value); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3SetConstantReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public C3SetConstantReqInnerFrame(String c3Mac, String constant) { |
| | | payload = c3Mac + constant; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = C3ChargingEnum.SetConstant.getCode(); |
| | | String payloadLength = "0006"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | import java.text.DecimalFormat; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class C3SetHeartbeatPacketTimeReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | //ç¨äºå¤ææ¯è®¾ç½® å
çµæ¶ å¿è·³å
é´éæ¶é´æè
设置 éå
çµæ¶ å¿è·³å
é´éæ¶é´ |
| | | private boolean flag; |
| | | |
| | | public C3SetHeartbeatPacketTimeReqInnerFrame(String c3Mac, int time, boolean flag) { |
| | | String data = Integer.toHexString(time); |
| | | switch (data.length()) { |
| | | case 1: |
| | | data = "000" + data; |
| | | break; |
| | | case 2: |
| | | data = "00" + data; |
| | | break; |
| | | case 3: |
| | | data = "0" + data; |
| | | break; |
| | | default: |
| | | |
| | | } |
| | | |
| | | payload = c3Mac + data; |
| | | this.flag = flag; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode; |
| | | if (flag) { |
| | | //å
çµæ¶ |
| | | functionCode = C3ChargingEnum.SetHeartbeatPacketTimeCharging.getCode(); |
| | | } else { |
| | | //éå
çµæ¶ |
| | | functionCode = C3ChargingEnum.SetHeartbeatPacketTimeNotCharging.getCode(); |
| | | } |
| | | String payloadLength = "0006"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:29 |
| | | */ |
| | | public class LightPoleHeelingHeartbeatPackageReqInnerFrame implements IRequestInnerFrame { |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = LightPoleHeelingEnum.TheHeartbeatPackage.getCode(); |
| | | String payloadLength = "0002"; |
| | | String payload = "FFFF"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:29 |
| | | */ |
| | | public class LightPoleHeelingQueryIntervalTimeReqInnerFrame implements IRequestInnerFrame { |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = LightPoleHeelingEnum.QueryIntervalTime.getCode(); |
| | | String payloadLength = "0002"; |
| | | String payload = "FFFF"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * |
| | | * @date 2022/3/22 15:29 |
| | | */ |
| | | public class LightPoleHeelingRestartReqInnerFrame implements IRequestInnerFrame { |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = LightPoleHeelingEnum.RestartLightPoleHeeling.getCode(); |
| | | String payloadLength = "0002"; |
| | | String payload = "FFFF"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:29 |
| | | */ |
| | | public class LightPoleHeelingSetHeartbeatPacketTimeReqInnerFrame implements IRequestInnerFrame { |
| | | private final String payload; |
| | | |
| | | public LightPoleHeelingSetHeartbeatPacketTimeReqInnerFrame(int time) { |
| | | String data = Integer.toHexString(time); |
| | | switch (data.length()) { |
| | | case 1: |
| | | data = "000" + data; |
| | | break; |
| | | case 2: |
| | | data = "00" + data; |
| | | break; |
| | | case 3: |
| | | data = "0" + data; |
| | | break; |
| | | default: |
| | | |
| | | } |
| | | |
| | | payload = "FFFF" + data; |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = LightPoleHeelingEnum.SetHeartbeatPacketTime.getCode(); |
| | | String payloadLength = "0004"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.frame.inner.request; |
| | | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IRequestInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightPoleHeelingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.MQTTConnectTypeEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/3 16:43 |
| | | */ |
| | | public class LightPoleHeelingSetSensorStateReqInnerFrame implements IRequestInnerFrame { |
| | | |
| | | public LightPoleHeelingSetSensorStateReqInnerFrame() { |
| | | } |
| | | |
| | | @Override |
| | | public String getEncodeFrame() { |
| | | String functionCode = LightPoleHeelingEnum.SetSensorState.getCode(); |
| | | String payloadLength = "0002"; |
| | | String payload = "FFFF"; |
| | | String frame = functionCode + payloadLength + payload; |
| | | return MQTTConnectTypeEnum.SYNCHRONIZATION.getCode() + frame.toUpperCase() + CRC32Utils.getCRC32(frame.toUpperCase()); |
| | | } |
| | | } |
| | |
| | | //æ¢å¤åºåå¼ |
| | | RestoreFactoryValue("29"), |
| | | //软éå¯ |
| | | RestartCharging("2B"); |
| | | RestartCharging("2B"), |
| | | |
| | | //以ä¸ä¸ºä¸»å¨ä¸æ¥ |
| | | /** |
| | | * ç½ç»è¯·æ± |
| | | */ |
| | | NETWORK_REQUEST("40"), |
| | | /** |
| | | * äºç»´ç è¯·æ± |
| | | */ |
| | | QR_CODE_REQUEST("41"), |
| | | /** |
| | | * 䏿¥å¿è·³å
|
| | | */ |
| | | HEART_BEAT("42"), |
| | | /** |
| | | * 䏿¥å
çµç»æ |
| | | */ |
| | | CHARGE_COMPLETE("43"), |
| | | /** |
| | | * 䏿¥å
çµä¸æ |
| | | */ |
| | | CHARGE_STOP("44"), |
| | | /** |
| | | * 䏿¥æ
éç |
| | | */ |
| | | ERROR_CODE("45"); |
| | | |
| | | private String code; |
| | | |
| | |
| | | C3ChargingEnum(String code) { |
| | | this.code = code; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.rrpc.enums; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:31 |
| | | */ |
| | | public enum LightPoleHeelingEnum { |
| | | //æ¥è¯¢å¿è·³å
æ°æ® |
| | | TheHeartbeatPackage("01"), |
| | | //æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | QueryIntervalTime("02"), |
| | | //软éå¯ç¯æå¾æ |
| | | RestartLightPoleHeeling("10"), |
| | | //设置å¿è·³å
æ¶é´(ç§ï¼ |
| | | SetHeartbeatPacketTime("11"), |
| | | //è®¾ç½®ä¼ æå¨ä¸ºåå§ç¶æ |
| | | SetSensorState("12"); |
| | | |
| | | private String code; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | LightPoleHeelingEnum(String code) { |
| | | this.code = code; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/16 9:46 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class AlipayConfigParam { |
| | | |
| | | private String appId; |
| | | |
| | | /** |
| | | * åæ·ç§é¥/PKCS8æ ¼å¼RSA2ç§é¥ |
| | | */ |
| | | private String privateKey; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String publicKey; |
| | | |
| | | /** |
| | | * åä½ä¼ä¼´èº«ä»½ï¼PIDï¼ |
| | | */ |
| | | private String pid; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/28 15:17 |
| | | */ |
| | | @Data |
| | | public class C3ChargingAddParam { |
| | | //ID |
| | | private Long c3Id; |
| | | //ç©çå°å |
| | | private String mcuUdid; |
| | | //å
çµæ¡©åç§° |
| | | private String c3Name; |
| | | //C3å
çµæ¡©å°å |
| | | private String c3Mac; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | |
| | | private String c3Mac = ""; |
| | | |
| | | //å
çµé |
| | | |
| | | // @NotEmpty(message = "å
çµéä¸è½ä¸ºç©º") |
| | | private Integer chargingCapacity; |
| | | |
| | | //å
çµéé¢ |
| | | |
| | | // @NotEmpty(message = "å
çµéé¢ä¸è½ä¸ºç©º") |
| | | private Double chargeAmount; |
| | | |
| | | //设置å¿è·³å
é´éæ¶é´(ç§ï¼ |
| | | private int time; |
| | | |
| | | //设置çµå/çµæµå¸¸æ°(åä¸åè)(é»è®¤å¼0xBC64) |
| | | private String constant = "BC64"; |
| | | |
| | | //设置å°å |
| | | private String address; |
| | | |
| | | //å¹´ |
| | | private int year; |
| | | //æ |
| | | private int month; |
| | | //æ¥ |
| | | private int day; |
| | | //æ¶ |
| | | private int hour; |
| | | //å |
| | | private int min; |
| | | //ç§ |
| | | private int sec; |
| | | |
| | | //C3å
çµæ¡©è¡¨æ¥è¯¢å
³é®å |
| | | private String keyword; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/18 16:35 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class C3mChargingChargeParam { |
| | | |
| | | private Integer c3Id; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Integer hour; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Integer min; |
| | | |
| | | |
| | | /** |
| | | * è´¹ç |
| | | */ |
| | | private Double charge; |
| | | |
| | | |
| | | private Long timestamp; |
| | | |
| | | } |
| | |
| | | TaskTerminalVO[] terminals; |
| | | |
| | | private List<Integer> terminalIds; |
| | | |
| | | private List<Integer> fileIds; |
| | | |
| | | TaskRunTimeVO[] exec; |
| | | |
| | | // 任塿§è¡è§åï¼æ¯å¤©ä¸º 0ï¼æ¯å¨ä¸º 1ï¼æå¨ä¸º 2) |
| | | // private Integer rule; |
| | | |
| | | |
| | | |
| | | /* |
| | | |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | /** |
| | | * ç¯æå¾æ |
| | | * |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:18 |
| | | */ |
| | | |
| | | @Data |
| | | public class LightPoleHeelingListParam { |
| | | //ç¯æå¾æå表æ¥è¯¢å
³é®å |
| | | private String keyword; |
| | | //å¤çç¶æ |
| | | private Integer processingState; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | /** |
| | | * ç¯æå¾æ |
| | | * |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:18 |
| | | */ |
| | | |
| | | @Data |
| | | public class LightPoleHeelingParam { |
| | | |
| | | @NotEmpty(message = "ç¯æå¾æç¡¬ä»¶å°åä¸è½ä¸ºç©º") |
| | | private String deviceName = ""; |
| | | |
| | | //设置å¿è·³å
é´éæ¶é´(ç§ï¼ |
| | | private int time; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | /** |
| | | * ç¯æå¾æè¦åå¤ç |
| | | * |
| | | * @author ZZQ |
| | | * @date 2022/3/22 15:18 |
| | | */ |
| | | |
| | | @Data |
| | | public class LightPoleHeelingProcessingParam { |
| | | |
| | | @NotEmpty(message = "ç¯æå¾æç¡¬ä»¶å°åä¸è½ä¸ºç©º") |
| | | private String deviceName = ""; |
| | | |
| | | /** |
| | | * è¦åå· |
| | | */ |
| | | private Long warningNumber; |
| | | |
| | | /** |
| | | * å¤çåç¶æ |
| | | */ |
| | | private Integer processingState; |
| | | |
| | | /** |
| | | * å¤çæè§ |
| | | */ |
| | | private String processingOpinion; |
| | | |
| | | /** |
| | | * å¤ç人 |
| | | */ |
| | | private String processingPerson; |
| | | |
| | | /** |
| | | * å¤çåXè½´ |
| | | */ |
| | | private Double theXAxis; |
| | | |
| | | /** |
| | | * å¤çåYè½´ |
| | | */ |
| | | private Double theYAxis; |
| | | |
| | | /** |
| | | * å¤çåZè½´ |
| | | */ |
| | | private Double theZAxis; |
| | | |
| | | |
| | | } |
| | |
| | | //设å¤åºåå·,åå¨è±æåæ¯ç设å¤åºåå·ï¼åæ¯é为大å |
| | | private String deviceSerial; |
| | | //设å¤éªè¯ç ï¼è®¾å¤æºèº«ä¸çå
ä½å¤§å忝 |
| | | // private String validateCode; |
| | | private String validateCode; |
| | | /** |
| | | * ç»æè¤ç³äºæå头ç¸å
³åæ° |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/22 16:46 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class PayParam { |
| | | |
| | | private Long poleId; |
| | | |
| | | private String orderType; |
| | | |
| | | private Double AliPayTotalAmount; |
| | | |
| | | private Double totalAmount; |
| | | |
| | | private Integer WxPayTotalAmount; |
| | | |
| | | private Integer subscribeChargingCapacity; |
| | | |
| | | private String outTradeNo; |
| | | |
| | | private Long orderId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class ResetClientPasswordPrarm { |
| | | |
| | | @NotNull |
| | | private Long id; |
| | | @NotEmpty |
| | | private String oldPassword; |
| | | @NotEmpty |
| | | private String newPassword; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/16 9:46 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class WxpayConfigParam { |
| | | |
| | | /** |
| | | * appid |
| | | */ |
| | | private String appId; |
| | | |
| | | /** |
| | | * app端appid |
| | | */ |
| | | private String appAppId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String mchId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String privateKey; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.pay.alipay; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.AlipayConfigParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.ClientService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.admin.utils.SpringContextUtil; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import com.sandu.ximon.dao.mapper.UsrAlipayConfigMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/15 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class UsrAlipayConfigService extends BaseServiceImpl<UsrAlipayConfigMapper, AliConfigEntity> { |
| | | |
| | | private final UsrAlipayConfigMapper usrAlipayConfigMapper; |
| | | private final ClientService clientService; |
| | | private final PoleService poleService; |
| | | |
| | | public AliConfigEntity getConfigByPoleId(Long poleId) { |
| | | Pole pole = poleService.getById(poleId); |
| | | if (pole == null) { |
| | | throw new BusinessException("ç¯æidé误æç¯æä¸åå¨"); |
| | | } |
| | | AliConfigEntity config; |
| | | if (pole.getClientId() == null) { |
| | | config = getById(0); |
| | | } |
| | | config = getOne(Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getCreateUserId, SecurityUtils.getUserId())); |
| | | if(config==null){ |
| | | throw new BusinessException("ç¨æ·æªé
ç½®æ¯ä»é
ç½®,请é
ç½®åéè¯"); |
| | | } |
| | | return config; |
| | | } |
| | | |
| | | |
| | | public static UsrAlipayConfigService getBean(){ |
| | | return (UsrAlipayConfigService) SpringContextUtil.getBean("UsrAlipayConfigService"); |
| | | } |
| | | |
| | | |
| | | public boolean addAliPayConfig(AlipayConfigParam configParam){ |
| | | AliConfigEntity config =new AliConfigEntity(); |
| | | BeanUtil.copyProperties(configParam,config); |
| | | if(SecurityUtils.getClientId()!=null){ |
| | | config.setCreateUserId(SecurityUtils.getUserId()); |
| | | if(clientService.findClientId()){ |
| | | config.setClientId(clientService.getClientId()); |
| | | } |
| | | } |
| | | return save(config); |
| | | } |
| | | |
| | | public boolean updateAliPayConfig(Integer id,AlipayConfigParam configParam){ |
| | | AliConfigEntity byId = getById(id); |
| | | if(byId==null){ |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | AliConfigEntity config =new AliConfigEntity(); |
| | | BeanUtil.copyProperties(configParam,config); |
| | | config.setConfigId(id); |
| | | return updateById(config); |
| | | } |
| | | |
| | | public boolean deleteAliPayConfig(Integer id){ |
| | | AliConfigEntity byId = getById(id); |
| | | if(byId==null){ |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | return removeById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | public List<AliConfigEntity> configList(BaseConditionVO baseConditionVO,String keyword){ |
| | | LambdaQueryWrapper<AliConfigEntity> wrapper =new LambdaQueryWrapper<>(); |
| | | System.out.println("----------------------------"+clientService.findClientId()); |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if(SecurityUtils.getClientId()!=null){//å®¢æ· |
| | | if(clientService.findClientId()){//äºçº§å®¢æ· |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper= Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getCreateUserId,SecurityUtils.getUserId()); |
| | | }else if(!clientService.findClientId()){//ä¸çº§å®¢æ· |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper= Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getClientId,SecurityUtils.getUserId()); |
| | | } |
| | | } else {//管ç |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper= Wrappers.lambdaQuery(AliConfigEntity.class); |
| | | } |
| | | |
| | | if(!keyword.isEmpty()){ |
| | | wrapper= wrapper.like(AliConfigEntity::getConfigId,keyword).or( |
| | | getAppId->{ |
| | | getAppId.like(AliConfigEntity::getAppId,keyword); |
| | | } |
| | | ).or( |
| | | getPid->{ |
| | | getPid.like(AliConfigEntity::getPid,keyword); |
| | | } |
| | | ).or( |
| | | getPublicKey->{ |
| | | getPublicKey.like(AliConfigEntity::getPublicKey,keyword); |
| | | } |
| | | ).or( |
| | | getPrivateKey->{ |
| | | getPrivateKey.like(AliConfigEntity::getPrivateKey,keyword); |
| | | } |
| | | ); |
| | | } |
| | | return list(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.pay.wx; |
| | | |
| | | import cn.dreampie.encription.EncriptionKit; |
| | | import cn.hutool.core.codec.Base64; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; |
| | | import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayRefundResult; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult; |
| | | import com.github.binarywang.wxpay.constant.WxPayConstants; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.IpUtil; |
| | | import com.sandu.ximon.admin.dto.YSY_AccessTokenDto; |
| | | import com.sandu.ximon.admin.dto.wxquery.WxOrderDto; |
| | | import com.sandu.ximon.admin.pay.wxpay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author chenjiantian |
| | | * @date 2021/8/12 11:26 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | @AllArgsConstructor |
| | | public class WxFastPayService { |
| | | |
| | | private final com.github.binarywang.wxpay.service.WxPayService wxPayService; |
| | | //private final WxPayProperties wxPayProperties; |
| | | // public static final String WECHAT_ORDER_PAY_CALLBACK_URL = "http://49.235.239.118:20012/callback/pay/wechatCallback"; |
| | | public static final String WECHAT_ORDER_PAY_CALLBACK_URL = "http://49.235.239.118:20012/callback/pay/wechatCallback"; |
| | | //微信订åç¶ææ¥è¯¢ |
| | | public static final String WECHAT_ORDER_QUETY_URL = "https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/"; |
| | | public static final String WECHAT_ORDER_QUETY = "?mchid="; |
| | | |
| | | private final UsrWxPayConfigService wxPayConfigService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * appæ¯ä» |
| | | * |
| | | * @param body ååæè¿° |
| | | * @param |
| | | * @param totalFee æ¯ä»éé¢ï¼åï¼ |
| | | * @return |
| | | */ |
| | | public SortedMap<Object, Object> appPay(String body, String orderSn, int totalFee, Long poleId) { |
| | | WxConfigEntity wxConfig = wxPayConfigService.getConfigByPoleId(poleId); |
| | | WxPayUnifiedOrderRequest wxPayUnifiedOrderRequest = new WxPayUnifiedOrderRequest(); |
| | | wxPayUnifiedOrderRequest.setBody(body); |
| | | wxPayUnifiedOrderRequest.setOutTradeNo(orderSn); |
| | | wxPayUnifiedOrderRequest.setTotalFee(totalFee); |
| | | |
| | | //wxPayUnifiedOrderRequest.setSignType(WxPayConstants.SignType.MD5); |
| | | wxPayUnifiedOrderRequest.setSpbillCreateIp(IpUtil.getRealIp()); |
| | | wxPayUnifiedOrderRequest.setNotifyUrl(WECHAT_ORDER_PAY_CALLBACK_URL); |
| | | wxPayUnifiedOrderRequest.setTradeType(WxPayConstants.TradeType.APP); |
| | | |
| | | try { |
| | | WxPayUnifiedOrderResult wxPayUnifiedOrderResult = wxPayService.unifiedOrder(wxPayUnifiedOrderRequest); |
| | | String time = String.valueOf(System.currentTimeMillis() / 1000); |
| | | if (WxPayConstants.ResultCode.SUCCESS.equals(wxPayUnifiedOrderResult.getResultCode())) { |
| | | SortedMap<Object, Object> parameters = new TreeMap<>(); |
| | | /*hashMap.put("appId", wxPayUnifiedOrderResult.getAppid()); |
| | | hashMap.put("nonceStr", wxPayUnifiedOrderResult.getNonceStr()); |
| | | hashMap.put("prepayId", wxPayUnifiedOrderResult.getPrepayId()); |
| | | // hashMap.put("package", "prepay_id=" + wxPayUnifiedOrderResult.getPrepayId()); |
| | | hashMap.put("signType", WxPayConstants.SignType.MD5); |
| | | hashMap.put("timeStamp", time); |
| | | hashMap.put("partnerid", wxPayProperties.getMchId());*/ |
| | | parameters.put("appid", wxPayUnifiedOrderResult.getAppid()); |
| | | |
| | | parameters.put("noncestr", wxPayUnifiedOrderResult.getNonceStr()); // éæºå符串 |
| | | parameters.put("partnerid", wxConfig.getMchId()); // åæ·id |
| | | |
| | | // parameters.put("out_trade_no", orderId);//åæ·è®¢åå· |
| | | parameters.put("prepayid", wxPayUnifiedOrderResult.getPrepayId()); |
| | | parameters.put("package", "Sign=WXPay"); |
| | | parameters.put("timestamp", time); |
| | | |
| | | String sign = createSign(parameters, wxConfig.getPrivateKey()); |
| | | |
| | | //hashMap.put("paySign", wechatSign); |
| | | parameters.put("Sign", sign); |
| | | return parameters; |
| | | } else { |
| | | log.error("微信æ¯ä»å¤±è´¥ï¼{}", wxPayUnifiedOrderResult.getErrCodeDes()); |
| | | throw new BusinessException("微信æ¯ä»å¤±è´¥ï¼" + wxPayUnifiedOrderResult.getErrCodeDes()); |
| | | } |
| | | } catch (WxPayException e) { |
| | | log.error("微信æ¯ä»å¤±è´¥ï¼{}", e.getErrCodeDes()); |
| | | throw new BusinessException("微信æ¯ä»å¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | /* private String createSign(SortedMap<Object, Object> parameters) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | Set es = parameters.entrySet();// ææåä¸ä¼ åçåæ°æç
§accsiiæåºï¼ååºï¼ |
| | | for (Object e : es) { |
| | | Map.Entry entry = (Map.Entry) e; |
| | | String k = (String) entry.getKey(); |
| | | Object v = entry.getValue(); |
| | | if (null != v && !"".equals(v) && !"sign".equals(k) && !"key".equals(k)) { |
| | | sb.append(k + "=" + v + "&"); |
| | | } |
| | | } |
| | | sb.append("key=" + wxPayProperties.getMchKey()); |
| | | System.out.println("åç¬¦ä¸²æ¼æ¥åæ¯:" + sb.toString()); |
| | | return SecureUtil.md5(sb.toString()).toUpperCase(); |
| | | }*/ |
| | | |
| | | |
| | | /** |
| | | * 微信订åç¶ææ¥è¯¢ |
| | | * @param poleId |
| | | * @param outTradeNo |
| | | * @return |
| | | */ |
| | | private Object WxOrderQuery(Long poleId,String outTradeNo){ |
| | | WxConfigEntity wxConfig = wxPayConfigService.getConfigByPoleId(poleId); |
| | | if(wxConfig==null){ |
| | | throw new BusinessException("è·å微信æ¯ä»é
置失败"); |
| | | } |
| | | String s = HttpUtil.get(WECHAT_ORDER_QUETY_URL + outTradeNo + WECHAT_ORDER_QUETY + wxConfig.getMchId());//WxOrderDto |
| | | WxOrderDto wxOrderDto = JSON.parseObject(s, WxOrderDto.class); |
| | | |
| | | return wxOrderDto.getTrade_state(); |
| | | } |
| | | |
| | | /** |
| | | * @param parameters |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("rawtypes") |
| | | private String createSign(SortedMap<Object, Object> parameters, String Key) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | Set es = parameters.entrySet();// ææåä¸ä¼ åçåæ°æç
§accsiiæåºï¼ååºï¼ |
| | | Iterator it = es.iterator(); |
| | | while (it.hasNext()) { |
| | | Map.Entry entry = (Map.Entry) it.next(); |
| | | String k = (String) entry.getKey(); |
| | | Object v = entry.getValue(); |
| | | if (null != v && !"".equals(v) && !"sign".equals(k) && !"key".equals(k)) { |
| | | sb.append(k + "=" + v + "&"); |
| | | } |
| | | } |
| | | sb.append("key=" + Key); |
| | | System.out.println("åç¬¦ä¸²æ¼æ¥åæ¯:" + sb.toString()); |
| | | String sign = EncriptionKit.encrypt(sb.toString()).toUpperCase(); |
| | | return sign; |
| | | } |
| | | |
| | | public WxPayOrderNotifyResult parseOrderNotifyResult(WxPayService wxPayService, String xmlData) { |
| | | try { |
| | | return wxPayService.parseOrderNotifyResult(xmlData); |
| | | } catch (WxPayException e) { |
| | | e.printStackTrace(); |
| | | throw new BusinessException("è§£æåè°ç»æå¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | public WxPayRefundNotifyResult parseRefundNotifyResult(WxPayService wxPayService, String xmlData) { |
| | | try { |
| | | return wxPayService.parseRefundNotifyResult(xmlData); |
| | | } catch (WxPayException e) { |
| | | e.printStackTrace(); |
| | | throw new BusinessException("è§£æåè°ç»æå¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订å鿬¾ åªè½éæ¬¾ä¸æ¬¡ |
| | | * |
| | | * @param wxPayService |
| | | * @param orderId |
| | | * @param refundFee |
| | | * @param callbackUrl |
| | | * @return |
| | | */ |
| | | public boolean refundOrder(WxPayService wxPayService, String orderId, String refundSn, Integer refundFee, String callbackUrl) { |
| | | WxPayRefundRequest refundRequest = new WxPayRefundRequest(); |
| | | refundRequest.setOutTradeNo(orderId); |
| | | refundRequest.setOutRefundNo(refundSn); |
| | | refundRequest.setRefundFee(refundFee); |
| | | refundRequest.setTotalFee(refundFee); |
| | | refundRequest.setNotifyUrl(callbackUrl); |
| | | try { |
| | | WxPayRefundResult wxPayRefundResult = wxPayService.refund(refundRequest); |
| | | if (WxPayConstants.ResultCode.SUCCESS.equals(wxPayRefundResult.getResultCode())) { |
| | | return true; |
| | | } else { |
| | | log.error("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼{}", wxPayRefundResult.getErrCodeDes()); |
| | | throw new BusinessException("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼" + wxPayRefundResult.getErrCodeDes()); |
| | | } |
| | | } catch (WxPayException e) { |
| | | log.error("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼{}", e.getErrCodeDes()); |
| | | throw new BusinessException("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæäºç»´ç 仿¬¾ |
| | | */ |
| | | public String generateQRCodePay(WxPayService wxPayService, String body, |
| | | String orderId, int totalFee, String callbackUrl) { |
| | | WxPayUnifiedOrderRequest wxPayUnifiedOrderRequest = new WxPayUnifiedOrderRequest(); |
| | | wxPayUnifiedOrderRequest.setBody(body); |
| | | wxPayUnifiedOrderRequest.setOutTradeNo(orderId); |
| | | wxPayUnifiedOrderRequest.setTotalFee(totalFee); |
| | | wxPayUnifiedOrderRequest.setProductId(orderId); |
| | | |
| | | wxPayUnifiedOrderRequest.setSignType(WxPayConstants.SignType.MD5); |
| | | wxPayUnifiedOrderRequest.setSpbillCreateIp(IpUtil.getRealIp()); |
| | | wxPayUnifiedOrderRequest.setNotifyUrl(callbackUrl); |
| | | wxPayUnifiedOrderRequest.setTradeType(WxPayConstants.TradeType.NATIVE); |
| | | |
| | | try { |
| | | WxPayUnifiedOrderResult wxPayUnifiedOrderResult = wxPayService.unifiedOrder(wxPayUnifiedOrderRequest); |
| | | if (WxPayConstants.ResultCode.SUCCESS.equals(wxPayUnifiedOrderResult.getResultCode())) { |
| | | byte[] scanPayQrcodeMode2 = wxPayService.createScanPayQrcodeMode2(wxPayUnifiedOrderResult.getCodeURL(), null, null); |
| | | String encode = Base64.encode(scanPayQrcodeMode2); |
| | | return encode; |
| | | } else { |
| | | log.error("微信æ¯ä»å¤±è´¥ï¼{}", wxPayUnifiedOrderResult.getErrCodeDes()); |
| | | throw new BusinessException("微信æ¯ä»å¤±è´¥ï¼" + wxPayUnifiedOrderResult.getErrCodeDes()); |
| | | } |
| | | } catch (WxPayException e) { |
| | | log.error("微信æ¯ä»å¤±è´¥ï¼{}", e.getErrCodeDes()); |
| | | throw new BusinessException("微信æ¯ä»å¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 鿬¾ |
| | | * |
| | | * @param totalAmount |
| | | * @param refundAmount |
| | | * @param outTradeNo |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | public boolean refund(Double totalAmount, Double refundAmount, String outTradeNo, Long poleId) { |
| | | WxConfigEntity wxConfig = UsrWxPayConfigService.getBean().getConfigByPoleId(poleId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String refundNo = sdf.format(new Date()); |
| | | WxPayRefundRequest refundRequest = new WxPayRefundRequest(); |
| | | refundRequest.setOutTradeNo(outTradeNo); |
| | | refundRequest.setOutRefundNo(refundNo); |
| | | refundRequest.setTotalFee(Integer.valueOf(parseWxAmount((totalAmount + "")))); |
| | | refundRequest.setRefundFee(Integer.valueOf(parseWxAmount((refundAmount + "")))); |
| | | try { |
| | | WxPayRefundResult wxPayRefundResult = wxPayService.refund(refundRequest); |
| | | if (WxPayConstants.ResultCode.SUCCESS.equals(wxPayRefundResult.getResultCode())) { |
| | | return true; |
| | | } else { |
| | | log.error("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼{}", wxPayRefundResult.getErrCodeDes()); |
| | | throw new BusinessException("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼" + wxPayRefundResult.getErrCodeDes()); |
| | | } |
| | | } catch (WxPayException e) { |
| | | log.error("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼{}", e.getErrCodeDes()); |
| | | throw new BusinessException("å¾®ä¿¡éæ¬¾å¤±è´¥ï¼" + e.getErrCodeDes()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢ä¸ºå¾®ä¿¡éé¢(å) |
| | | * |
| | | * @param normalAmount 0.01å
|
| | | * @return |
| | | */ |
| | | public static String parseWxAmount(String normalAmount) { |
| | | // ä¿ç2ä½å°æ° |
| | | double totalAmountDouble = Double.parseDouble(new DecimalFormat("#.00").format( |
| | | Double.parseDouble(normalAmount))); |
| | | String amount = (totalAmountDouble * 100) + ""; |
| | | amount = amount.substring(0, amount.indexOf(".")); |
| | | return amount; |
| | | } |
| | | |
| | | } |
| ÎļþÃû´Ó sandu-common/src/main/java/com/sandu/common/third/pay/wx/WxPayConfiguration.java ÐÞ¸Ä |
| | |
| | | package com.sandu.common.third.pay.wx; |
| | | package com.sandu.ximon.admin.pay.wx; |
| | | |
| | | import com.github.binarywang.wxpay.config.WxPayConfig; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| ÎļþÃû´Ó sandu-common/src/main/java/com/sandu/common/third/pay/wx/WxPayProperties.java ÐÞ¸Ä |
| | |
| | | package com.sandu.common.third.pay.wx; |
| | | package com.sandu.ximon.admin.pay.wx; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.pay.wxpay; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.WxpayConfigParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.ClientService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.admin.utils.SpringContextUtil; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import com.sandu.ximon.dao.mapper.UsrWxPayConfigMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/18 14:37 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class UsrWxPayConfigService extends BaseServiceImpl<UsrWxPayConfigMapper, WxConfigEntity> { |
| | | |
| | | private final UsrWxPayConfigMapper wxPayConfigMapper; |
| | | private final ClientService clientService; |
| | | private final PoleService poleService; |
| | | |
| | | public WxConfigEntity getConfigByPoleId(Long poleId) { |
| | | Pole pole = poleService.getById(poleId); |
| | | if (pole == null) { |
| | | throw new BusinessException("ç¯æidé误æç¯æä¸åå¨"); |
| | | } |
| | | WxConfigEntity config; |
| | | if (pole.getClientId() == null) { |
| | | config = getById(0); |
| | | } |
| | | config = getOne(Wrappers.lambdaQuery(WxConfigEntity.class).eq(WxConfigEntity::getCreateUserId, SecurityUtils.getUserId())); |
| | | if (config == null) { |
| | | throw new BusinessException("ç¨æ·æªé
ç½®æ¯ä»é
ç½®,请é
ç½®åéè¯"); |
| | | } |
| | | return config; |
| | | } |
| | | |
| | | |
| | | public static UsrWxPayConfigService getBean() { |
| | | return (UsrWxPayConfigService) SpringContextUtil.getBean("UsrWxPayConfigService"); |
| | | } |
| | | |
| | | |
| | | public boolean addWxPayConfig(WxpayConfigParam configParam) { |
| | | WxConfigEntity config = new WxConfigEntity(); |
| | | BeanUtil.copyProperties(configParam, config); |
| | | config.setAppid(configParam.getAppId()); |
| | | config.setAppappid(configParam.getAppAppId()); |
| | | if(SecurityUtils.getClientId()!=null){ |
| | | config.setCreateUserId(SecurityUtils.getUserId()); |
| | | if(clientService.findClientId()){ |
| | | config.setClientId(clientService.getClientId()); |
| | | } |
| | | } |
| | | return save(config); |
| | | } |
| | | |
| | | public boolean updateWxPayConfig(Long id, WxpayConfigParam configParam) { |
| | | WxConfigEntity byId = getById(id); |
| | | if (byId == null) { |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | WxConfigEntity config = new WxConfigEntity(); |
| | | BeanUtil.copyProperties(configParam, config); |
| | | config.setAppid(configParam.getAppId()); |
| | | config.setAppappid(configParam.getAppAppId()); |
| | | config.setConfigId(id); |
| | | return updateById(config); |
| | | } |
| | | |
| | | public boolean deleteWxPayConfig(Long id) { |
| | | WxConfigEntity byId = getById(id); |
| | | if (byId == null) { |
| | | throw new BusinessException("é
ç½®idé误æé
ç½®ä¸åå¨"); |
| | | } |
| | | return removeById(id); |
| | | } |
| | | |
| | | |
| | | public List<WxConfigEntity> configList(BaseConditionVO baseConditionVO,String keyword) { |
| | | LambdaQueryWrapper<WxConfigEntity> wrapper = new LambdaQueryWrapper<>(); |
| | | System.out.println("----------------------------" + clientService.findClientId()); |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if (SecurityUtils.getClientId() != null) {//å®¢æ· |
| | | if (clientService.findClientId()) {//äºçº§å®¢æ· |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper = Wrappers.lambdaQuery(WxConfigEntity.class).eq(WxConfigEntity::getCreateUserId, SecurityUtils.getUserId()); |
| | | } else if (!clientService.findClientId()) {//ä¸çº§å®¢æ· |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper = Wrappers.lambdaQuery(WxConfigEntity.class).eq(WxConfigEntity::getClientId, SecurityUtils.getUserId()); |
| | | } |
| | | } else {//管ç |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | wrapper = Wrappers.lambdaQuery(WxConfigEntity.class); |
| | | } |
| | | if(!keyword.isEmpty()){ |
| | | wrapper= wrapper.like(WxConfigEntity::getConfigId,keyword).or( |
| | | appid->{ |
| | | appid.like(WxConfigEntity::getAppid,keyword); |
| | | } |
| | | ).or( |
| | | appappid->{ |
| | | appappid.like(WxConfigEntity::getAppappid,keyword); |
| | | } |
| | | ).or( |
| | | mchId->{ |
| | | mchId.like(WxConfigEntity::getMchId,keyword); |
| | | } |
| | | ).or( |
| | | privateKey->{ |
| | | privateKey.like(WxConfigEntity::getPrivateKey,keyword); |
| | | } |
| | | ); |
| | | } |
| | | return list(wrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | private WaterQualityEquipmentService waterQualityEquipmentService; |
| | | private WaterQualityDataService waterQualityDataService; |
| | | |
| | | @Scheduled(cron = "0 0 0/1 * * ?") |
| | | // @Scheduled(cron = "0 0 0/1 * * ?") |
| | | public void UserSubjectRefund() { |
| | | List<WaterQualityEquipmentBo> waterQualityEquipmentList = waterQualityEquipmentService.listWaterQualityEquipment(); |
| | | for (WaterQualityEquipment waterQualityEquipment : waterQualityEquipmentList) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security; |
| | | |
| | | import sun.misc.BASE64Decoder; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.io.OutputStream; |
| | | |
| | | public class base64_Img { |
| | | |
| | | public static void main(String[] args) { |
| | | //str = GetImageStr(); |
| | | String s="1645784824360\",\n" + |
| | | " \"data\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBA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Jyfoy9/a1/Zn1KRJdSvX1CWNPKjlvvBN/dyRx7mfy43uNP\\nkZE3ln2KQu5mbBYlmls/2uv2bNO/5B+ozWGeCbLwXqFqSBkdYLCM/r6ZzjNHLLs/6t5/1r2Yff8A\\nc/Ly/rXsyb4SfB3UhqNp4q8XWbWVtZSR3WlaNcri7urtGLW95fwEZtra3YCeC2l/0iedY2ljihVg\\n9v8AbL/5N88Wf9hLwt/6kmn+/wDU/Unmo/8Ahs74Ac/8VJqx/wC5Z1rJ6+tt/P165ya+MP2mv2ob\\nT4tadB4J8F2d9ZeE4L2G/wBT1DUo44L/AFy7tTN9jhS0jmnFppltI32oCaQ3N1ci1kkit1t9kjjF\\n3WltVv5Ob7+a+/fdh/Wz/X+unmf/2Q==\\n"; |
| | | GenerateImage(s); |
| | | } |
| | | |
| | | // å¾ç转åæbase64å符串 |
| | | // public static String GetImageStr() { |
| | | // String imgFile = "D:\\tanbing.jpg";// å¾
å¤ççå¾ç |
| | | // InputStream in = null; |
| | | // byte[] data = null; |
| | | // // 读åå¾çåèæ°ç» |
| | | // try { |
| | | // in = new FileInputStream(imgFile); |
| | | // data = new byte[in.available()]; |
| | | // in.read(data); |
| | | // in.close(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // // 对åèæ°ç»Base64ç¼ç |
| | | // BASE64Encoder encoder = new BASE64Encoder(); |
| | | // System.out.println(encoder.encode(data)); |
| | | // return encoder.encode(data);// è¿åBase64ç¼ç è¿çåèæ°ç»å符串 |
| | | // } |
| | | |
| | | // 对åèæ°ç»å符串è¿è¡Base64è§£ç å¹¶çæå¾ç |
| | | public static boolean GenerateImage(String imgStr) { |
| | | if (imgStr == null) { |
| | | // å¾åæ°æ®ä¸ºç©º |
| | | return false; |
| | | } |
| | | BASE64Decoder decoder = new BASE64Decoder(); |
| | | try { |
| | | // Base64è§£ç |
| | | byte[] b = decoder.decodeBuffer(imgStr); |
| | | for (int i = 0; i < b.length; ++i) { |
| | | if (b[i] < 0) {// è°æ´å¼å¸¸æ°æ® |
| | | b[i] += 256; |
| | | } |
| | | } |
| | | // çæjpegå¾ç |
| | | String imgFilePath = "D:\\Download\\jieping.jpg";// æ°çæçå¾ç |
| | | OutputStream out = new FileOutputStream(imgFilePath); |
| | | out.write(b); |
| | | out.flush(); |
| | | out.close(); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security; |
| | | |
| | | import org.apache.commons.lang.StringEscapeUtils; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/2/25 17:26 |
| | | * @Version 1.0 |
| | | */ |
| | | public class ceshi { |
| | | public static void main(String[] args) { |
| | | String s="{\\\"programId\\\":378,\\\"_id\\\":\\\"2ab6dac6-bf1d-4393-bd2c-22ba9631bc0a\\\",\\\"name\\\":\\\"ç«åª\\\",\\\"width\\\":192,\\\"height\\\":192,\\\"layers\\\":[{\\\"id\\\":1,\\\"sources\\\":[{\\\"id\\\":\\\"212\\\",\\\"_id\\\":\\\"23ccc7aa-f571-4d08-95e2-426a9a8cef37\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª01.jpg\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":126178,\\\"playTime\\\":0,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"213\\\",\\\"_id\\\":\\\"2fb1e5d4-72dd-458a-bf26-d79b7344fd11\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª02.jpg\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":37268,\\\"playTime\\\":6,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"223\\\",\\\"_id\\\":\\\"39fd4620-bfa8-4df8-9637-51e833a71a50\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª09.png\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":3170450,\\\"playTime\\\":48,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"214\\\",\\\"_id\\\":\\\"cd46a125-3cd0-4adf-9f21-ba83c6dce786\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª03.jpg\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":41160,\\\"playTime\\\":12,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"217\\\",\\\"_id\\\":\\\"c1cbac8f-5af0-4976-8b70-50cf189fd0ca\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª04.jpg\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":168335,\\\"playTime\\\":18,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"218\\\",\\\"_id\\\":\\\"bcb0a5a5-b40a-4beb-84fe-00e14afdb046\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª05.jpg\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":236649,\\\"playTime\\\":24,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"221\\\",\\\"_id\\\":\\\"4f3aeb15-2d5c-45d1-8bcc-c41ce75ecde1\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª06.png\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":766854,\\\"playTime\\\":30,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"222\\\",\\\"_id\\\":\\\"453398cb-8099-4fa9-bc86-d36d92107d7f\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª07.png\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":762731,\\\"playTime\\\":36,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"224\\\",\\\"_id\\\":\\\"274ea4a4-d8b5-449e-8972-d027476bb9ca\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"ç«åª08.png\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":3102346,\\\"playTime\\\":42,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0},{\\\"id\\\":\\\"215\\\",\\\"_id\\\":\\\"c59a1450-a48d-437e-a337-fc87bd14bfc2\\\",\\\"_type\\\":\\\"Image\\\",\\\"md5\\\":null,\\\"name\\\":\\\"å¦å.png\\\",\\\"left\\\":0,\\\"top\\\":0,\\\"width\\\":192,\\\"height\\\":192,\\\"size\\\":430804,\\\"playTime\\\":54,\\\"timeSpan\\\":6,\\\"fileExt\\\":\\\"\\\",\\\"mime\\\":\\\"image\\/jpeg\\\",\\\"lineHeight\\\":null,\\\"html\\\":null,\\\"center\\\":false,\\\"speed\\\":null,\\\"entryEffect\\\":\\\"None\\\",\\\"exitEffect\\\":\\\"None\\\",\\\"entryEffectTimeSpan\\\":0,\\\"exitEffectTimeSpan\\\":0,\\\"backgroundColor\\\":\\\"\\\",\\\"language\\\":\\\"\\\",\\\"timezone\\\":0,\\\"city\\\":\\\"\\\",\\\"code\\\":0}],\\\"repeat\\\":true}],\\\"totalSize\\\":8842775,\\\"version\\\":0,\\\"others\\\":true}"; |
| | | String tmp = StringEscapeUtils.unescapeJavaScript(s); |
| | | System.out.println("tmp:" + tmp); |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security.order; |
| | | |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import org.springframework.context.ApplicationEvent; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Version 1.0 |
| | | */ |
| | | public class C3mOrderQueryEvent extends ApplicationEvent { |
| | | |
| | | private C3mOrder c3mOrderEntity; |
| | | |
| | | private Long startTime; |
| | | |
| | | public C3mOrderQueryEvent(Object source, C3mOrder c3mOrderEntity, Long startTime) { |
| | | super(source); |
| | | this.c3mOrderEntity = c3mOrderEntity; |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public C3mOrder getC3mOrderEntity() { |
| | | return c3mOrderEntity; |
| | | } |
| | | |
| | | public Long getStartTime() { |
| | | return startTime; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security.order; |
| | | |
| | | import com.sandu.ximon.admin.utils.SpringContextUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | @Component("OrderQueryListener") |
| | | public class OrderQueryListener { |
| | | |
| | | @Autowired |
| | | public ApplicationEventPublisher publisher; |
| | | |
| | | private static final ExecutorService orderEventPool = Executors.newFixedThreadPool(5); |
| | | |
| | | public static OrderQueryListener getBean(){ |
| | | return (OrderQueryListener) SpringContextUtil.getBean("OrderQueryListener"); |
| | | } |
| | | |
| | | /** |
| | | * å¯å¨è®¢åæ«æ |
| | | * @param type 0:C3å
çµæ¡©æ«æå¯å¨ |
| | | */ |
| | | public void startScan (Integer type) { |
| | | // è½½å
¥è®¢åæ«æ |
| | | orderEventPool.submit(new OrderQueryTask(type)); |
| | | } |
| | | |
| | | |
| | | // @Scheduled(cron = "0/10 * * * * ? ") |
| | | // public void orderScan () { |
| | | // if(isQuery) { |
| | | // /** |
| | | // * è·åææè®¢åï¼æ ¹æ®è®¢åç±»åä¸åè¿è¡ä¸åçQuery |
| | | // */ |
| | | // // C3å
çµæ¡©é¨å |
| | | // Set<String> keys = redisUtils.keys(C3mRedisConstant.C3_NO_PAY_ORDER.getCode() + "*"); |
| | | // for (String key : keys) { |
| | | // C3mOrderEntity c3mOrderEntity = JSON.parseObject(redisUtils.get(key), C3mOrderEntity.class); |
| | | // LogUtils.error("æ¥è¯¢è®¢åï¼" + JSON.toJSONString(c3mOrderEntity)); |
| | | // publisher.publishEvent(new C3mOrderQueryEvent(this, c3mOrderEntity)); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security.order; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.sandu.ximon.admin.config.C3mRedisConfig; |
| | | import com.sandu.ximon.admin.utils.LogUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import com.sandu.ximon.dao.enums.C3mRedisConstant; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Queue; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentLinkedQueue; |
| | | |
| | | @Data |
| | | public class OrderQueryTask implements Runnable{ |
| | | |
| | | private static Queue<OrderQueryTask> taskList = new ConcurrentLinkedQueue<>(); |
| | | // ä»»å¡ç±»å:C3è®¢åæ«æ(0)ã |
| | | private Integer type; |
| | | // æ¯å¦ç»§ç»æ«æ |
| | | private boolean isScanning = true; |
| | | |
| | | public void stopTask(){ |
| | | this.isScanning = false; |
| | | } |
| | | |
| | | public OrderQueryTask(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | /** |
| | | * å¯å¨åï¼ç»æ¢ææç¸åç±»åçæ«æä»»å¡ |
| | | */ |
| | | stopAndAddTask(type, this); |
| | | for(OrderQueryTask task :taskList) { |
| | | if(task.getType().equals(0)){ |
| | | // å¯å¨C3è®¢åæ«æ |
| | | c3mOrderTaskScan(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void c3mOrderTaskScan() { |
| | | LogUtils.error("å¯å¨C3mè®¢åæ«æä»»å¡"); |
| | | Long totalTime = 0L; |
| | | // ç»§ç»æ«ææ¶ï¼è¿è¡å¾ªç¯æ«æ |
| | | while(isScanning) { |
| | | totalTime = totalTime + C3mRedisConfig.ORDER_QUERY_TIME; |
| | | // å¤ææ«ææ¶é¿æ¯å¦å·²è¶
åºè®¢åè¶
æ¶æ¶é´ |
| | | if(totalTime > C3mRedisConfig.ORDER_MAX_TIME) { |
| | | return; |
| | | } |
| | | // çå¾
æ«æé´é |
| | | try { |
| | | Thread.sleep(C3mRedisConfig.ORDER_QUERY_TIME * 1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 夿æ¯å¦ç»§ç»æ«æ |
| | | if(isScanning) { |
| | | /** |
| | | * è·åææè®¢åï¼æ ¹æ®è®¢åç±»åä¸åè¿è¡ä¸åçQuery |
| | | */ |
| | | // C3å
çµæ¡©é¨å |
| | | RedisUtils redisUtils = RedisUtils.getBean(); |
| | | Set<String> keys = redisUtils.keys(C3mRedisConstant.C3_NO_PAY_ORDER.getCode() + "*"); |
| | | for (String key : keys) { |
| | | C3mOrder c3mOrderEntity = JSON.parseObject(redisUtils.get(key), C3mOrder.class); |
| | | LogUtils.error("å½åè®¢åæ»æ°ï¼"+keys.size()+",æ¨éæ¥è¯¢è®¢å("+c3mOrderEntity.getOutTradeNo()+")å°äºä»¶å¤çï¼" + JSON.toJSONString(c3mOrderEntity)); |
| | | OrderQueryListener.getBean().publisher.publishEvent(new C3mOrderQueryEvent(this, c3mOrderEntity, new Date().getTime())); |
| | | } |
| | | }else { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void stopAndAddTask (Integer type, OrderQueryTask newTask) { |
| | | synchronized (OrderQueryTask.class) { |
| | | LogUtils.error("é置并æ¸
ç©ºè®¢åæ«æéå"); |
| | | boolean clear = true; |
| | | Queue<OrderQueryTask> newTaskList = new ConcurrentLinkedQueue<>(); |
| | | newTaskList.offer(newTask); |
| | | while (clear) { |
| | | OrderQueryTask task = taskList.poll(); |
| | | if (null == task) { |
| | | clear = false; |
| | | } else { |
| | | if (task.getType().equals(type)) { |
| | | task.stopTask(); |
| | | } else { |
| | | newTaskList.offer(task); |
| | | } |
| | | } |
| | | } |
| | | taskList = newTaskList; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.security.order; |
| | | |
| | | public enum OrderScanType { |
| | | C3M(0) |
| | | |
| | | ; |
| | | private Integer type; |
| | | |
| | | OrderScanType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | } |
| | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.c3ChargingProcessor; |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.admin.manager.iot.frame.A5Frame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3HeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3OperationReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3QueryReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.admin.param.C3ChargingAddParam; |
| | | import com.sandu.ximon.admin.param.C3ChargingParam; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Slf4j |
| | | @AllArgsConstructor |
| | | public class C3ChargingService extends BaseServiceImpl<C3mChargingMapper, C3mCharging> { |
| | | private C3mChargingMapper c3mChargingMapper; |
| | | private final C3mChargingChargeService c3mChargingChargeService; |
| | | private final PoleBindingService bindingService; |
| | | private final PoleService poleService; |
| | | |
| | | /** |
| | | * ä¿å䏿¥C3å
çµè®¾å¤å¿è·³æ°æ® |
| | | * |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean saveReportData(String deviceName, A5C3HeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, deviceName)); |
| | | public boolean updateReportState(String deviceName, String c3Mac, String statusBit, String deviceTemperature) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getPoleDevicesCode, deviceName)); |
| | | if (one != null) { |
| | | one.setStatusBit(Integer.valueOf(statusBit)); |
| | | one.setDeviceTemperature(deviceTemperature); |
| | | one.setPoleDevicesCode(deviceName); |
| | | one.setC3Mac(c3Mac); |
| | | |
| | | // List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, one.getC3Id())); |
| | | // if (list.size() == 0) {//è´¹çè¡¨ä¸æ²¡ææ¤å
çµæ¡©æ°æ®æ¶ æ·»å é»è®¤è´¹ç |
| | | // c3mChargingChargeService.initCharge((one.getC3Id()).intValue()); |
| | | // } |
| | | return updateById(one); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿å䏿¥C3å
çµè®¾å¤å¿è·³æ°æ® |
| | | * |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean saveReporEquipment(String deviceName, String mcuUdid, String c3Mac) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | if (one == null) { |
| | | //å°è®¾å¤ä¿¡æ¯æ·»å å°å
çµæ¡©è®¾å¤è¡¨ |
| | | C3mCharging c3mCharging = new C3mCharging(); |
| | | c3mCharging.setMcuUdid(deviceName); |
| | | c3mCharging.setC3Mac(heartBeatDataPackage.getC3Mac()); |
| | | c3mCharging.setStatusBit(Integer.valueOf(heartBeatDataPackage.getStatusBit())); |
| | | c3mCharging.setDeviceTemperature(heartBeatDataPackage.getDeviceTemperature()); |
| | | return save(c3mCharging); |
| | | c3mCharging.setMcuUdid(mcuUdid); |
| | | c3mCharging.setPoleDevicesCode(deviceName); |
| | | c3mCharging.setC3Mac(c3Mac); |
| | | boolean flag = save(c3mCharging); |
| | | //设置费ç |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list.size() == 0) {//è´¹çè¡¨ä¸æ²¡ææ¤å
çµæ¡©æ°æ®æ¶ æ·»å é»è®¤è´¹ç |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | |
| | | return flag; |
| | | } else { |
| | | one.setStatusBit(Integer.valueOf(heartBeatDataPackage.getStatusBit())); |
| | | one.setDeviceTemperature(heartBeatDataPackage.getDeviceTemperature()); |
| | | return updateById(one); |
| | | //å°è®¾å¤ä¿¡æ¯æ·»å å°å
çµæ¡©è®¾å¤è¡¨ |
| | | one.setPoleDevicesCode(deviceName); |
| | | one.setC3Mac(c3Mac); |
| | | boolean flag = updateById(one); |
| | | //设置费ç |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list.size() == 0) {//è´¹çè¡¨ä¸æ²¡ææ¤å
çµæ¡©æ°æ®æ¶ æ·»å é»è®¤è´¹ç |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | |
| | | return flag; |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public List<C3mCharging> getC3ChargingList(BaseConditionVO baseConditionVO) { |
| | | public List<C3ChargingBo> getC3ChargingListByKeyword(BaseConditionVO baseConditionVO, C3ChargingParam c3ChargingParam) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return list(); |
| | | if(c3ChargingParam == null){ |
| | | c3ChargingParam = new C3ChargingParam(); |
| | | } |
| | | |
| | | //å
³é®åå»é¤ç©ºæ ¼ |
| | | if (c3ChargingParam.getKeyword() != null) { |
| | | c3ChargingParam.setKeyword(c3ChargingParam.getKeyword().trim()); |
| | | } |
| | | |
| | | List<C3ChargingBo> c3ChargingBoList |
| | | = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword()); |
| | | return c3ChargingBoList; |
| | | } |
| | | |
| | | /** |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3StartChargingReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3FinishChargingReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3EndOfTheSynchronizationReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3QueryVersionReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | A5C3QueryReportInnerFrame a5C3QueryReportInnerFrame = new A5C3QueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | if (a5C3QueryReportInnerFrame.isValidate()) { |
| | | return a5C3QueryReportInnerFrame.getVersion(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3QueryIntervalTimeReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | A5C3QueryReportInnerFrame queryReportInnerFrame = new A5C3QueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | if (queryReportInnerFrame.isValidate()) { |
| | | return queryReportInnerFrame.getIntervalTime(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3QueryConstantReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | A5C3QueryReportInnerFrame queryReportInnerFrame = new A5C3QueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | if (queryReportInnerFrame.isValidate()) { |
| | | return queryReportInnerFrame.getConstant(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3QueryAddressReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3QueryReportInnerFrame queryReportInnerFrame = new A5C3QueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (queryReportInnerFrame.isValidate()) { |
| | | return queryReportInnerFrame.getAddress(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ
éç |
| | | * |
| | | * @param c3Mac |
| | | */ |
| | | public String QueryFaultCode(String c3Mac) { |
| | | C3QueryFaultCodeReqInnerFrame c3QueryFaultCodeReqInnerFrame = |
| | | new C3QueryFaultCodeReqInnerFrame(c3Mac); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3QueryFaultCodeReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3QueryReportInnerFrame queryReportInnerFrame = new A5C3QueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (queryReportInnerFrame.isValidate()) { |
| | | return queryReportInnerFrame.getFaultCode(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读å¿è·³å
|
| | | * |
| | | * @param c3Mac |
| | | */ |
| | | public A5C3HeartbeatReportInnerFrame.HeartBeatDataPackage ReadTheHeartbeatPackage(String c3Mac) { |
| | | C3ReadTheHeartbeatPackageReqInnerFrame readTheHeartbeatPackageReqInnerFrame = |
| | | new C3ReadTheHeartbeatPackageReqInnerFrame(c3Mac); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), readTheHeartbeatPackageReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3HeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5C3HeartbeatReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (heartbeatReportInnerFrame.isValidate()) { |
| | | return heartbeatReportInnerFrame.getHeartBeatDataPackage(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´(ç§ï¼-å
çµç¶ææ¶/éå
çµç¶ææ¶ |
| | | * |
| | | * @param c3Mac |
| | | * @param setTime |
| | | * @return |
| | | */ |
| | | public String SetHeartbeatPacketTimeCharging(String c3Mac, int setTime, boolean flag) { |
| | | if (setTime <= 0) { |
| | | throw new BusinessException("设置çå¿è·³å
é´éæ¶é´é误ï¼"); |
| | | } |
| | | C3SetHeartbeatPacketTimeReqInnerFrame setHeartbeatPacketTimeChargingReqInnerFrame = |
| | | new C3SetHeartbeatPacketTimeReqInnerFrame(c3Mac, setTime, flag); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), setHeartbeatPacketTimeChargingReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置çµå/çµæµå¸¸æ°(åä¸åè)(é»è®¤å¼0xBC64) |
| | | * |
| | | * @param c3Mac |
| | | * @param constant |
| | | * @return |
| | | */ |
| | | public String SetConstant(String c3Mac, String constant) { |
| | | |
| | | C3SetConstantReqInnerFrame setConstantReqInnerFrame = |
| | | new C3SetConstantReqInnerFrame(c3Mac, constant); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), setConstantReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置å°å |
| | | * |
| | | * @param c3Mac |
| | | * @param address |
| | | * @return |
| | | */ |
| | | public String SetAddress(String c3Mac, String address) { |
| | | if (address == null || address.length() != 8) { |
| | | throw new BusinessException("å°åä¿¡æ¯é误ï¼"); |
| | | } |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3MACå°åä¸åå¨"); |
| | | } |
| | | |
| | | if (getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, address)) != null) { |
| | | throw new BusinessException("æ°çå°åä¿¡æ¯å·²åå¨ï¼"); |
| | | } |
| | | |
| | | C3SetAddressReqInnerFrame setAddressReqInnerFrame = |
| | | new C3SetAddressReqInnerFrame(c3Mac, address); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), setAddressReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | if ("æä½æå".equals(operationReportInnerFrame.getState())) { |
| | | //ä¿®æ¹æåéè¦æ´æ¹æ°æ®åºæ°æ® |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | one.setC3Mac(address); |
| | | updateById(one); |
| | | } |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¥åï¼åå¿è·³å
ä¸ç6åèæ¥ææ¶é´ï¼ |
| | | * |
| | | * @param c3Mac |
| | | * @return |
| | | */ |
| | | public String SetCalendar(String c3Mac, int year, int month, int day, int hour, int min, int sec) { |
| | | |
| | | |
| | | C3SetCalendarReqInnerFrame setCalendarReqInnerFrame = |
| | | new C3SetCalendarReqInnerFrame(c3Mac, year, month, day, hour, min, sec); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), setCalendarReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ
éç 䏿¥æ¸
é¤ |
| | | * |
| | | * @param c3Mac |
| | | * @return |
| | | */ |
| | | public String ClearedFaultCode(String c3Mac) { |
| | | |
| | | |
| | | C3ClearedFaultCodeReqInnerFrame clearedFaultCodeReqInnerFrame = |
| | | new C3ClearedFaultCodeReqInnerFrame(c3Mac); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), clearedFaultCodeReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¢å¤åºåå¼ |
| | | * |
| | | * @param c3Mac |
| | | * @return |
| | | */ |
| | | public String RestoreFactoryValue(String c3Mac) { |
| | | |
| | | |
| | | C3RestoreFactoryValueReqInnerFrame restoreFactoryValueReqInnerFrame = |
| | | new C3RestoreFactoryValueReqInnerFrame(c3Mac); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), restoreFactoryValueReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_C3_DATA.getCode(), c3RestartChargingReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff0a04ffff", a5Frame); |
| | | C3mCharging c3mCharging = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3Mac)); |
| | | if (c3mCharging == null) { |
| | | throw new BusinessException("C3å
çµæ¡©ç¡¬ä»¶mcu_udidä¸åå¨"); |
| | | } |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(c3mCharging.getPoleDevicesCode(), a5Frame); |
| | | // CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC("32313243305008ff1a06ffff", a5Frame); |
| | | |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5C3OperationReportInnerFrame operationReportInnerFrame = new A5C3OperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | public boolean addC3Charging(C3ChargingAddParam c3ChargingAddParam) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, c3ChargingAddParam.getMcuUdid())); |
| | | if (one != null) { |
| | | throw new BusinessException("硬件设å¤å·²åå¨ï¼"); |
| | | } |
| | | |
| | | if (c3ChargingAddParam.getC3Name() == null || c3ChargingAddParam.getMcuUdid() == null) { |
| | | throw new BusinessException("æ·»å C3å
çµæ¡©è®¾å¤åºéï¼"); |
| | | } |
| | | C3mCharging c3mCharging = new C3mCharging(); |
| | | c3mCharging.setMcuUdid(c3ChargingAddParam.getMcuUdid()); |
| | | if (c3ChargingAddParam.getC3Name() != null) { |
| | | c3mCharging.setC3Name(c3ChargingAddParam.getC3Name()); |
| | | } |
| | | c3mCharging.setC3Mac(c3ChargingAddParam.getC3Mac()); |
| | | return save(c3mCharging); |
| | | } |
| | | |
| | | public boolean updateC3ChargingName(C3ChargingAddParam c3ChargingAddParam) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Id, c3ChargingAddParam.getC3Id())); |
| | | if (one == null) { |
| | | throw new BusinessException("硬件设å¤ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | if (c3ChargingAddParam.getC3Id() == null || c3ChargingAddParam.getC3Name() == null) { |
| | | throw new BusinessException("æ·»å C3å
çµæ¡©è®¾å¤åºéï¼"); |
| | | } |
| | | C3mCharging c3mCharging = new C3mCharging(); |
| | | c3mCharging.setC3Id(c3ChargingAddParam.getC3Id()); |
| | | c3mCharging.setC3Name(c3ChargingAddParam.getC3Name()); |
| | | return updateById(c3mCharging); |
| | | } |
| | | |
| | | public C3mCharging getC3mByPoleId(Long poleId) { |
| | | PoleBinding one = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, 2).eq(PoleBinding::getPoleId, poleId)); |
| | | if (one == null) { |
| | | throw new BusinessException("æªæ¾å°ç»å®å
³ç³»"); |
| | | } |
| | | return getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, one.getDeviceCode())); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.C3mChargingChargeParam; |
| | | import com.sandu.ximon.dao.domain.C3mChargingCharge; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingChargeMapper; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/10 13:58 |
| | | * @Version 1.0 |
| | | * c3å
çµæ¡©è´¹çç¸å
³ |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class C3mChargingChargeService extends BaseServiceImpl<C3mChargingChargeMapper, C3mChargingCharge> { |
| | | private final C3mChargingChargeMapper c3mChargingChargeMapper; |
| | | private final PoleBindingService bindingService; |
| | | private final C3mChargingMapper chargingMapper; |
| | | |
| | | /** |
| | | * ä¿®æ¹è´¹ç |
| | | * |
| | | * @param chargeEntities |
| | | * @param |
| | | * @return |
| | | */ |
| | | public boolean updateCharge(List<C3mChargingCharge> chargeEntities) { |
| | | // å é¤åæ¬åå¨çè´¹ç |
| | | c3mChargingChargeMapper.deleteCharge(chargeEntities.get(0).getC3Id()); |
| | | Long timestamp = new Date().getTime(); |
| | | // å°è´¹çæ·»å è³æ°æ®åº |
| | | for (C3mChargingCharge c3m : chargeEntities) { |
| | | c3m.setTimestamp(timestamp); |
| | | save(c3m); |
| | | } |
| | | // LogService.getBean().log(userId,username,"ä¿®æ¹C3mè´¹ç",null, |
| | | // "{ "+ JSON.toJSONString(chargeEntities)+" }"); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æå
¥è´¹ç |
| | | * |
| | | * @param c3 |
| | | * @return |
| | | */ |
| | | public boolean initCharge(C3mChargingChargeParam c3) { |
| | | C3mChargingCharge charge = new C3mChargingCharge(); |
| | | BeanUtil.copyProperties(c3, charge); |
| | | charge.setTimestamp(new Date().getTime()); |
| | | // c3mChargingChargeMapper.insertCharge(charge); |
| | | return save(charge); |
| | | } |
| | | |
| | | /** |
| | | * èªå¨æå
¥é»è®¤è´¹ç |
| | | * |
| | | * @param c3Id |
| | | */ |
| | | public void initCharge(Integer c3Id) { |
| | | List<C3mChargingCharge> chargeList = getChargeByC3Id(c3Id); |
| | | if (chargeList.size() == 0) { |
| | | // ä¸åå¨è´¹çæ¶ï¼çæå个费çå¹¶æå
¥æ°æ®åº |
| | | C3mChargingCharge c3mChargeEntity = new C3mChargingCharge();/*C3mChargingCharge.getInitInstance(c3Id);*/ |
| | | c3mChargeEntity.setC3Id(c3Id); |
| | | c3mChargeEntity.setHour(0); |
| | | c3mChargeEntity.setMin(0); |
| | | c3mChargeEntity.setCharge(8.8); |
| | | c3mChargeEntity.setTimestamp(new Date().getTime()); |
| | | c3mChargingChargeMapper.insertCharge(c3mChargeEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<C3mChargingCharge> getChargeByC3Id(Integer c3Id) { |
| | | // æ¥æ¾æ°æ®åºææè´¹ç |
| | | List<C3mChargingCharge> list = c3mChargingChargeMapper.getChargeByC3Id(c3Id); |
| | | // 夿listä¸ºåæ¡ç´æ¥è¿å |
| | | if (list.size() < 2) { |
| | | return list; |
| | | } |
| | | // å°æ¶åè¿è¡æåº |
| | | Collections.sort(list, new Comparator<C3mChargingCharge>() { |
| | | @Override |
| | | public int compare(C3mChargingCharge o1, C3mChargingCharge o2) { |
| | | int i = o2.getHour().compareTo(o1.getHour()); |
| | | if (i == 0) { |
| | | return o2.getMin().compareTo(o1.getMin()); |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public boolean equals(Object obj) { |
| | | return false; |
| | | } |
| | | }); |
| | | // list翻转 |
| | | Collections.reverse(list); |
| | | // æ¶é´æ®µåç¬¦æ¼æ¥ |
| | | for (int i = 1; i < list.size(); i++) { |
| | | C3mChargingCharge pre = list.get(i - 1); |
| | | C3mChargingCharge now = list.get(i); |
| | | pre.setStrTime( |
| | | pre.getHour() + "ç¹" + pre.getMin() + "å å° " + |
| | | now.getHour() + "ç¹" + now.getMin() + "å" |
| | | ); |
| | | if (i == list.size() - 1) { |
| | | pre = now; |
| | | now = list.get(0); |
| | | if (now.getHour() < pre.getHour()) { |
| | | pre.setStrTime( |
| | | pre.getHour() + "ç¹" + pre.getMin() + "å å° " + |
| | | "鿥" + now.getHour() + "ç¹" + now.getMin() + "å" |
| | | ); |
| | | } else { |
| | | pre.setStrTime( |
| | | pre.getHour() + "ç¹" + pre.getMin() + "å å° " + |
| | | now.getHour() + "ç¹" + now.getMin() + "å" |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¯æidæ¥æ¾è´¹ç |
| | | * |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | public List<C3mChargingCharge> getChargeByPoleId(Long poleId) { |
| | | PoleBinding one = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, 2).eq(PoleBinding::getPoleId, poleId)); |
| | | if (one == null) { |
| | | throw new BusinessException("æªæ¾å°ç»å®å
³ç³»"); |
| | | } |
| | | Long c3Id = chargingMapper.getAllByC3Mac(one.getDeviceCode()).getC3Id(); |
| | | return getChargeByC3Id(c3Id.intValue()); |
| | | } |
| | | |
| | | public boolean deleteC3mCharging(Integer c3mId) { |
| | | return c3mChargingChargeMapper.deleteCharge(c3mId); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.config.C3mRedisConfig; |
| | | import com.sandu.ximon.admin.pay.wx.WxFastPayService; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.security.order.OrderQueryListener; |
| | | import com.sandu.ximon.admin.security.order.OrderScanType; |
| | | import com.sandu.ximon.admin.utils.AliPayUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.vo.C3mOrderVO; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.C3mRedisConstant; |
| | | import com.sandu.ximon.dao.enums.OrderStatus; |
| | | import com.sandu.ximon.dao.enums.OrderType; |
| | | import com.sandu.ximon.dao.mapper.C3mOrderMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/10 14:24 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class C3mOrderService extends BaseServiceImpl<C3mOrderMapper, C3mOrder> { |
| | | |
| | | private final RedisUtils redisUtils; |
| | | private final PoleService poleService; |
| | | private final C3mOrderMapper c3mOrderMapper; |
| | | private final WxFastPayService fastPayService; |
| | | private final OrderQueryListener orderQueryListener; |
| | | |
| | | public boolean orderRefund(String outTradeNo, Double refundAmount/*, Long userId, String username*/) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | String username = SecurityUtils.getUsername(); |
| | | C3mOrder orderByOutTradeNo = c3mOrderMapper.getOrderByOutTradeNo(outTradeNo); |
| | | if (orderByOutTradeNo.getTotalAmount() < refundAmount) { |
| | | throw new BusinessException("鿬¾éé¢é误,ä¸è½å¤§äºä»æ¬¾éé¢"); |
| | | } |
| | | if (null == orderByOutTradeNo) { |
| | | return false; |
| | | } else { |
| | | orderByOutTradeNo.setRefundAmount(refundAmount); |
| | | return c3mOrderRefund(orderByOutTradeNo, "页é¢API鿬¾", userId, username); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private boolean c3mOrderRefund(C3mOrder C3mOrder, String msg, Long userId, String username) { |
| | | // è¿è¡é款ï¼è®¾ç½®è®¢åç¶æä¸ºå·²éæ¬¾ |
| | | boolean b = false; |
| | | if (C3mOrder.getOrderType().equals(OrderType.ALIPAY.getCode())) { |
| | | b = AliPayUtils.alipayrefund( |
| | | C3mOrder.getPoleId(), |
| | | C3mOrder.getOutTradeNo(), |
| | | C3mOrder.getRefundAmount()); |
| | | } else if (C3mOrder.getOrderType().equals(OrderType.WXPAY.getCode())) { |
| | | // è¿è¡å¾®ä¿¡é款 |
| | | b = fastPayService.refund( |
| | | C3mOrder.getTotalAmount(), |
| | | C3mOrder.getRefundAmount(), |
| | | C3mOrder.getOutTradeNo(), |
| | | C3mOrder.getPoleId() |
| | | ); |
| | | } |
| | | C3mOrder.setRefundTimestamp(new Date().getTime()); |
| | | C3mOrder.setRefundMsg(msg); |
| | | if (b) { |
| | | C3mOrder.setOrderStatus(OrderStatus.REFUND.getStatus()); |
| | | c3mOrderMapper.updateRefundOrder(C3mOrder); |
| | | /* logService.log( |
| | | userId, |
| | | ServerTask.SERVER_TASK, |
| | | "C3m订åå¤ç", |
| | | null, |
| | | "{ æä½è
("+username+")" + |
| | | "订å鿬¾: "+C3mOrder.getOutTradeNo() |
| | | +",è®¢åæ»éé¢:"+C3mOrder.getTotalAmount() |
| | | +",鿬¾éé¢: "+C3mOrder.getTotalAmount()+"}");*/ |
| | | return true; |
| | | } else { |
| | | C3mOrder.setOrderStatus(OrderStatus.REFUND_FAILED.getStatus()); |
| | | c3mOrderMapper.updateRefundOrder(C3mOrder); |
| | | /* logService.log( |
| | | userId, |
| | | ServerTask.SERVER_TASK, |
| | | "C3m订åå¤ç", |
| | | null, |
| | | "{ æä½è
("+username+")" + |
| | | "订å鿬¾(失败): "+C3mOrder.getOutTradeNo() |
| | | +",è®¢åæ»éé¢:"+C3mOrder.getTotalAmount() |
| | | +",鿬¾éé¢: "+C3mOrder.getTotalAmount()+"}");*/ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public C3mOrder advancePayOrder(Long streetlightId, C3mCharging c3m, String orderType, Double totalAmount, |
| | | Integer subscribeChargingCapacity) { |
| | | |
| | | // å¤æè¯¥å
çµæ¡©æ¯å¦å卿£å¨è¿è¡ä¸ç订å |
| | | String chargingJson = redisUtils.get(C3mRedisConstant.C3_CHARGING_ORDER.getCode() + c3m.getC3Mac()); |
| | | if (null != chargingJson) { |
| | | return null; |
| | | } |
| | | Pole pole = poleService.getById(streetlightId); |
| | | if (null == pole) { |
| | | return null; |
| | | } |
| | | // çæè®¢åï¼å¹¶å è½½å°redisç¼åï¼è®¾ç½®è¶
æ¶æ¶é´ä¸º5åé |
| | | C3mOrder c3mOrderEntity = new C3mOrderVO().generateOrder( |
| | | streetlightId, |
| | | pole.getDeviceCode(), |
| | | c3m.getC3Mac(), |
| | | OrderType.getOrderType(orderType), |
| | | totalAmount, |
| | | subscribeChargingCapacity |
| | | ); |
| | | // å è½½å°redisç¼åä¸, æ¥è¯¢æ¨¡åèªå¨æ¥è¯¢ç¶æå¹¶å¤ç |
| | | boolean b = redisUtils.set( |
| | | C3mRedisConstant.C3_NO_PAY_ORDER.getCode() + c3m.getC3Mac() + c3mOrderEntity.getOutTradeNo(), |
| | | JSON.toJSONString(c3mOrderEntity), |
| | | C3mRedisConfig.ORDER_MAX_TIME |
| | | ); |
| | | // æ¨éå°èªå¨æ¥è¯¢æ¨¡åï¼è¿è¡æ«æå¯å¨ |
| | | orderQueryListener.startScan(OrderScanType.C3M.getType()); |
| | | return b ? c3mOrderEntity : null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.AddClientPrarm; |
| | | import com.sandu.ximon.admin.param.ResetClientPasswordPrarm; |
| | | import com.sandu.ximon.admin.param.UpdateClientPrarm; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.domain.Client; |
| | |
| | | import com.sandu.ximon.dao.domain.Role; |
| | | import com.sandu.ximon.dao.mapper.ClientMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | if (addClientPrarm.getClientSuperior() != null && !"".equals(addClientPrarm.getClientSuperior())) { |
| | | Client one = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getClientName, addClientPrarm.getClientSuperior())); |
| | | if (one != null) { |
| | | client.setSuperiorId(one.getId()); |
| | | if (one.getSuperiorId() == null) { |
| | | client.setSuperiorId(one.getId()); |
| | | } else { |
| | | throw new BusinessException("ä¸çº§å®¢æ·ä¸è½ä¸ºäºçº§ç¨æ·"); |
| | | } |
| | | } else { |
| | | throw new BusinessException("ä¸çº§å®¢æ·ä¸åå¨"); |
| | | } |
| | |
| | | return updateById(client); |
| | | } |
| | | |
| | | public boolean resetPassword(ResetClientPasswordPrarm resetClientPasswordPrarm) { |
| | | Client client = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, resetClientPasswordPrarm.getId())); |
| | | |
| | | if (client == null) { |
| | | throw new BusinessException("è¯¥ç¨æ·ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | PasswordEncoder pw = new BCryptPasswordEncoder(); |
| | | //夿æ§å¯ç 䏿°æ®åºæ¯å¦ä¸è´ |
| | | if (pw.matches(resetClientPasswordPrarm.getOldPassword(), client.getPassword())) { |
| | | //å 坿°å¯ç |
| | | String encode = pw.encode(resetClientPasswordPrarm.getNewPassword()); |
| | | client.setPassword(encode); |
| | | return updateById(client); |
| | | } else { |
| | | throw new BusinessException("æ§å¯ç 䏿£ç¡®ï¼è¯·éæ°ç¡®è®¤å¯ç ï¼"); |
| | | } |
| | | } |
| | | |
| | | public boolean deleteClient(Long id) { |
| | | //夿å é¤ç¨æ·æ¯å¦åå¨ |
| | | Client one = getById(id); |
| | |
| | | } |
| | | |
| | | /** |
| | | * \ |
| | | * å
¶ä»ç±»ç¨æ¥æ¥æ¾å®¢æ·idä½¿ç¨ å¦ææ²¡æä¸çº§å®¢æ· è¿è¿åç¨æ·ID |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public Long getClientId(Long userId) { |
| | | Client one = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, userId)); |
| | | if (one != null && one.getSuperiorId() != null) { |
| | | return one.getSuperiorId(); |
| | | } else { |
| | | return userId; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¸çº§å®¢æ·è¿åfalse äºçº§å®¢æ·è¿åtrue |
| | | * |
| | | * @return |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¸çº§å®¢æ·è¿åfalse äºçº§å®¢æ·è¿åtrue |
| | | * |
| | | * @return |
| | | */ |
| | | public boolean findClientId(Long userId) { |
| | | Client one = getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, userId)); |
| | | if (one != null && one.getSuperiorId() != null) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | |
| | |
| | | public class IpVolumeMissionService extends BaseServiceImpl<IpVolumeMissionMapper, IpVolumeMission> { |
| | | private final IpVolumeMissionMapper ipVolumeMissionMapper; |
| | | private final ClientService clientService; |
| | | private final IpVolumeService ipVolumeService; |
| | | private final IpVolumeFileService ipVolumeFileService; |
| | | private final BroadcastV2TaskFileService broadcastV2TaskFileService; |
| | | private final BroadcastV2TaskTerminalService broadcastV2TaskTerminalService; |
| | |
| | | taskFileEntity.setFileId(fileId); |
| | | |
| | | IpVolumeFile fileEntity = ipVolumeFileService.getById(fileId); |
| | | if(fileEntity==null){ |
| | | throw new BusinessException("fileId为"+fileId+"çæä»¶ä¸åå¨"); |
| | | if (fileEntity == null) { |
| | | throw new BusinessException("fileId为" + fileId + "çæä»¶ä¸åå¨"); |
| | | } |
| | | // String absolutePath = MinIoConstant.getAbsolutePath( |
| | | // MinIoConstant.BROADCAST_FILE.getBucketName() + fileEntity.getUserId(), |
| | |
| | | //return new ArrayList<>(); |
| | | } |
| | | |
| | | public IpVolumeMission getByTaskId(Integer taskId) { |
| | | public TaskVO getByTaskId(Integer taskId) { |
| | | TaskVO task = TaskAPIUtils.getTask(taskId); |
| | | if (task == null) { |
| | | throw new BusinessException("æå¡å¨æªæ¾å°è¯¥ä»»å¡"); |
| | |
| | | if (byId == null) { |
| | | throw new BusinessException("æ¬å°æªæ¾å°è¯¥ä»»å¡"); |
| | | } |
| | | if (SecurityUtils.getClientId() != null) { |
| | | if (clientService.findClientId()) { |
| | | if (byId.getUserId() != SecurityUtils.getUserId()) { |
| | | throw new BusinessException("ä»»å¡å½å±é误"); |
| | | } |
| | | |
| | | byId.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | } else { |
| | | if (byId.getClientId() != SecurityUtils.getUserId()) { |
| | | throw new BusinessException("ä»»å¡å½å±é误"); |
| | | } |
| | | } |
| | | |
| | | return byId; |
| | | |
| | | } |
| | | task.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | // byId.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | task.setBdate(byId.getOnDate()); |
| | | task.setEdate(byId.getOffDate()); |
| | | |
| | | List<BroadcastV2TaskFile> taskFiles = broadcastV2TaskFileService.list(Wrappers.lambdaQuery(BroadcastV2TaskFile.class) |
| | | .eq(BroadcastV2TaskFile::getTaskId, taskId)); |
| | | List<BroadcastV2TaskTerminal> taskTerminals = broadcastV2TaskTerminalService.list(Wrappers.lambdaQuery(BroadcastV2TaskTerminal.class) |
| | | .eq(BroadcastV2TaskTerminal::getTaskId, taskId)); |
| | | |
| | | if (!taskFiles.isEmpty()) { |
| | | taskFiles.forEach( |
| | | fileId -> { |
| | | // IpVolumeFile volumeFile = ipVolumeFileService.getById(fileId.getFileId()); |
| | | // if(volumeFile==null){ |
| | | // throw new BusinessException("任塿件ä¸åå¨"); |
| | | // } |
| | | task.getFileIds().add(fileId.getFileId()); |
| | | // byId.getFileIds().add(fileId.getFileId()); |
| | | } |
| | | ); |
| | | |
| | | } |
| | | if (!taskTerminals.isEmpty()) { |
| | | taskTerminals.forEach( |
| | | terminalId -> { |
| | | // BroadcastTerminalV2Entity v2Entity = ipVolumeService.getById(terminalId.getTerminalId()); |
| | | // if(v2Entity==null){ |
| | | // throw new BusinessException("è¯¥ä»»å¡ææ 设å¤ä½¿ç¨"); |
| | | // } |
| | | task.getTerminalIds().add(terminalId.getTerminalId()); |
| | | // byId.getTerminalIds().add(terminalId.getTerminalId()); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | return task; |
| | | |
| | | |
| | | } |
| | |
| | | public class LEDProgramFileService extends BaseServiceImpl<LEDProgramFileMapper, LEDProgramFile> { |
| | | |
| | | private final LEDProgramFileMapper ledProgramFileMapper; |
| | | private final ClientService clientService; |
| | | |
| | | public boolean addProgramFile(LEDProgramFileParam param) { |
| | | LEDProgramFile file = new LEDProgramFile(); |
| | |
| | | if (SecurityUtils.getClientId() != null) { |
| | | file.setUserName(SecurityUtils.getUsername()); |
| | | } |
| | | // if("mp4".equals(fileUploadDto.getFileType())){ |
| | | // fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | // } |
| | | return save(file); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingProcessingParam; |
| | | import com.sandu.ximon.dao.domain.LightPoleHeelingProcessing; |
| | | import com.sandu.ximon.dao.mapper.LightPoleHeelingProcessingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/25 11:41 |
| | | */ |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LightPoleHeelingProcessingServices extends BaseServiceImpl<LightPoleHeelingProcessingMapper, LightPoleHeelingProcessing> { |
| | | /** |
| | | * ç¯æå¾æè¦åå¤ç |
| | | */ |
| | | public boolean ProcessingLightPoleHeeling(LightPoleHeelingProcessingParam param) { |
| | | LightPoleHeelingProcessing lightPoleHeelingProcessing = new LightPoleHeelingProcessing(); |
| | | lightPoleHeelingProcessing.setProcessingPerson(param.getProcessingPerson()); |
| | | lightPoleHeelingProcessing.setProcessingState(param.getProcessingState()); |
| | | lightPoleHeelingProcessing.setTheXAxis(param.getTheXAxis()); |
| | | lightPoleHeelingProcessing.setTheYAxis(param.getTheYAxis()); |
| | | lightPoleHeelingProcessing.setTheZAxis(param.getTheZAxis()); |
| | | return save(lightPoleHeelingProcessing); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.dao.domain.AirData; |
| | | import com.sandu.ximon.dao.domain.ForHelp; |
| | | import com.sandu.ximon.admin.manager.iot.frame.A5Frame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.*; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingListParam; |
| | | import com.sandu.ximon.dao.domain.Light; |
| | | import com.sandu.ximon.dao.domain.LightPoleHeeling; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.LightPoleHeelingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LightPoleHeelingService extends BaseServiceImpl<LightPoleHeelingMapper, LightPoleHeeling> { |
| | | /** |
| | | * æ¥è¯¢å
¨é¨ç¯æå¾ä¾§åè¦ |
| | | */ |
| | | public List<LightPoleHeeling> listLightPoleHeeling() { |
| | | LambdaQueryWrapper<LightPoleHeeling> wrapper = Wrappers.lambdaQuery(LightPoleHeeling.class); |
| | | List<LightPoleHeeling> list = list(wrapper); |
| | | |
| | | return list; |
| | | } |
| | | private LightPoleHeelingMapper lightPoleHeelingMapper; |
| | | |
| | | /** |
| | | * æ¨¡ç³æ¥è¯¢ |
| | | */ |
| | | public List<LightPoleHeeling> listLightPoleHeelingByKeyword(String keyword) { |
| | | |
| | | LambdaQueryWrapper<LightPoleHeeling> wrapper = Wrappers.lambdaQuery(LightPoleHeeling.class); |
| | | if (keyword != null) { |
| | | wrapper.like(LightPoleHeeling::getLightPoleName, keyword).or( |
| | | lambdaQueryWrapper -> { |
| | | lambdaQueryWrapper.like(LightPoleHeeling::getLightPoleId, keyword); |
| | | } |
| | | ).or( |
| | | lambdaQueryWrapper -> { |
| | | lambdaQueryWrapper.like(LightPoleHeeling::getWarningNumber, keyword); |
| | | } |
| | | ); |
| | | public List<LightPoleHeeling> listLightPoleHeelingByKeyword(BaseConditionVO baseConditionVO, LightPoleHeelingListParam lightPoleHeelingListParam) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if (lightPoleHeelingListParam == null) { |
| | | lightPoleHeelingListParam = new LightPoleHeelingListParam(); |
| | | } |
| | | List<LightPoleHeeling> forHelpList = list(wrapper); |
| | | return forHelpList; |
| | | |
| | | //å
³é®åå»é¤ç©ºæ ¼ |
| | | if (lightPoleHeelingListParam.getKeyword() != null) { |
| | | lightPoleHeelingListParam.setKeyword(lightPoleHeelingListParam.getKeyword().trim()); |
| | | } |
| | | |
| | | List<LightPoleHeeling> lightPoleHeelings |
| | | = lightPoleHeelingMapper.listLightPoleHeeling(lightPoleHeelingListParam.getKeyword(), lightPoleHeelingListParam.getProcessingState()); |
| | | |
| | | return lightPoleHeelings; |
| | | } |
| | | |
| | | /** |
| | | * ç¯æå¾æå¿è·³å
|
| | | * |
| | | * @param deviceName |
| | | */ |
| | | public A5LightPoleHeelingHeartbeatReportInnerFrame.HeartBeatDataPackage LightPoleHeelingHeartbeatPackage(String deviceName) { |
| | | LightPoleHeelingHeartbeatPackageReqInnerFrame lightPoleHeelingHeartbeatPackageReqInnerFrame = new LightPoleHeelingHeartbeatPackageReqInnerFrame(); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode(), lightPoleHeelingHeartbeatPackageReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceName, a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | |
| | | A5LightPoleHeelingHeartbeatReportInnerFrame heartbeatReportInnerFrame |
| | | = new A5LightPoleHeelingHeartbeatReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (heartbeatReportInnerFrame.isValidate()) { |
| | | |
| | | //ç¯æå¾æå¿è·³å
ä¿åæ°æ®åº |
| | | saveLightPoleHeelingHeartbeat(deviceName, heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | |
| | | return heartbeatReportInnerFrame.getHeartBeatDataPackage(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¿è·³å
é´éæ¶é´ |
| | | * |
| | | * @param deviceName |
| | | */ |
| | | public String QueryIntervalTime(String deviceName) { |
| | | LightPoleHeelingQueryIntervalTimeReqInnerFrame queryIntervalTimeReqInnerFrame |
| | | = new LightPoleHeelingQueryIntervalTimeReqInnerFrame(); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode(), queryIntervalTimeReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceName, a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | |
| | | A5LightPoleHeelingQueryReportInnerFrame queryReportInnerFrame = new A5LightPoleHeelingQueryReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (queryReportInnerFrame.isValidate()) { |
| | | return queryReportInnerFrame.getIntervalTime(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 软éå¯ |
| | | * |
| | | * @param deviceName |
| | | */ |
| | | public String RestartLightPoleHeeling(String deviceName) { |
| | | LightPoleHeelingRestartReqInnerFrame restartReqInnerFrame |
| | | = new LightPoleHeelingRestartReqInnerFrame(); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode(), restartReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceName, a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | |
| | | A5LightPoleHeelingOperationReportInnerFrame operationReportInnerFrame |
| | | = new A5LightPoleHeelingOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´(ç§ï¼ |
| | | * |
| | | * @param devicesName |
| | | * @param setTime |
| | | * @return |
| | | */ |
| | | public String SetHeartbeatPacketTime(String devicesName, int setTime) { |
| | | if (setTime <= 0) { |
| | | throw new BusinessException("设置çå¿è·³å
é´éæ¶é´é误ï¼"); |
| | | } |
| | | LightPoleHeelingSetHeartbeatPacketTimeReqInnerFrame setHeartbeatPacketTimeReqInnerFrame = |
| | | new LightPoleHeelingSetHeartbeatPacketTimeReqInnerFrame(setTime); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode(), setHeartbeatPacketTimeReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(devicesName, a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5LightPoleHeelingOperationReportInnerFrame operationReportInnerFrame |
| | | = new A5LightPoleHeelingOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ä¼ æå¨ä¸ºåå§ç¶æ |
| | | * |
| | | * @return |
| | | */ |
| | | public String SetSensorState(String devicesName) { |
| | | LightPoleHeelingSetSensorStateReqInnerFrame setSensorStateReqInnerFrame = |
| | | new LightPoleHeelingSetSensorStateReqInnerFrame(); |
| | | |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode(), setSensorStateReqInnerFrame); |
| | | System.out.println(a5Frame + " -----a5Frame"); |
| | | |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(devicesName, a5Frame); |
| | | System.out.println(commonFrame + " -----commonFrame"); |
| | | |
| | | A5LightPoleHeelingOperationReportInnerFrame operationReportInnerFrame |
| | | = new A5LightPoleHeelingOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (operationReportInnerFrame.isValidate()) { |
| | | return operationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªé误ï¼è¯·éæ°è¯·æ±"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿åå¿è·³å
æ°æ® |
| | | * |
| | | * @param deviceName |
| | | * @param heartBeatDataPackage |
| | | * @return |
| | | */ |
| | | public boolean saveLightPoleHeelingHeartbeat(String deviceName, A5LightPoleHeelingHeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) { |
| | | |
| | | LightPoleHeeling lightPoleHeeling = new LightPoleHeeling(); |
| | | lightPoleHeeling.setMac(deviceName); |
| | | lightPoleHeeling.setTheXAxis(heartBeatDataPackage.getTheXAxis()); |
| | | lightPoleHeeling.setTheYAxis(heartBeatDataPackage.getTheYAxis()); |
| | | lightPoleHeeling.setTheZAxis(heartBeatDataPackage.getTheZAxis()); |
| | | if (Math.abs(heartBeatDataPackage.getTheXAxis()) >= 10 || Math.abs(heartBeatDataPackage.getTheYAxis()) >= 10) { |
| | | lightPoleHeeling.setWarningLevel(1);//ä¸çº§è¦å |
| | | } else if ((Math.abs(heartBeatDataPackage.getTheXAxis()) >= 5 && Math.abs(heartBeatDataPackage.getTheXAxis()) < 10) |
| | | || (Math.abs(heartBeatDataPackage.getTheYAxis()) >= 5 && Math.abs(heartBeatDataPackage.getTheYAxis()) < 10)) { |
| | | lightPoleHeeling.setWarningLevel(2);//äºçº§è¦å |
| | | } else { |
| | | lightPoleHeeling.setWarningLevel(0);//æ£å¸¸ |
| | | } |
| | | |
| | | return save(lightPoleHeeling); |
| | | } |
| | | } |
| | |
| | | throw new BusinessException("å é¤ä»»å¡å¤±è´¥"); |
| | | } |
| | | |
| | | boolean del; |
| | | // å é¤ç»å®ç¯æ |
| | | if (!lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getTaskId, taskIdList))) { |
| | | throw new BusinessException("å é¤ç»å®ç¯æå¤±è´¥"); |
| | | } |
| | | // if (!lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).notIn(LightTaskPoleRelation::getTaskId, taskIdList))) { |
| | | // throw new BusinessException("æªæ¾å°ä»»å¡/ç¯æç»å®å
³ç³»"); |
| | | // } |
| | | // lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getTaskId, taskIdList)); |
| | | taskIdList.forEach( |
| | | taskId->{ |
| | | lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).eq(LightTaskPoleRelation::getTaskId,taskId)); |
| | | } |
| | | ); |
| | | |
| | | return true; |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.enums.RoleLevelStatus; |
| | | import com.sandu.common.execption.BusinessException; |
| | |
| | | } |
| | | |
| | | public List<MenuNode> treeList() { |
| | | List<Menu> list = list(); |
| | | LambdaQueryWrapper<Menu> menuLambdaQueryWrapper = Wrappers.lambdaQuery(Menu.class).orderByAsc(Menu::getSeq); |
| | | List<Menu> list = list(menuLambdaQueryWrapper); |
| | | return list.stream() |
| | | .filter(menu -> menu.getPid().equals(0L)) |
| | | .map(menu -> covertMenuNode(menu, list)).collect(Collectors.toList()); |
| | |
| | | * @param deviceSerial 设å¤åºåå·,åå¨è±æåæ¯ç设å¤åºåå·ï¼åæ¯é为大å |
| | | * // * @param validateCode 设å¤éªè¯ç ï¼è®¾å¤æºèº«ä¸çå
ä½å¤§å忝 |
| | | */ |
| | | // public YSY_MonitorDto addYSYMonitor(String accessToken, String deviceSerial, String validateCode) { |
| | | public YSY_MonitorDto addYSYMonitor(String accessToken, String deviceSerial) { |
| | | public YSY_MonitorDto addYSYMonitor(String accessToken, String deviceSerial, String validateCode) { |
| | | // public YSY_MonitorDto addYSYMonitor(String accessToken, String deviceSerial) { |
| | | |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("accessToken", accessToken); |
| | | paramMap.put("deviceSerial", deviceSerial); |
| | | // paramMap.put("validateCode", validateCode); |
| | | if(validateCode != null ){ |
| | | paramMap.put("validateCode", validateCode); |
| | | } |
| | | String s = HttpUtil.post(YSY_URL + ADD_DEVICE_URL, paramMap); |
| | | System.out.println(s); |
| | | YSY_MonitorDto monitorDto = JSON.parseObject(s, YSY_MonitorDto.class); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.redis.RedisService; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.dto.DeviceStatus; |
| | |
| | | private final RedisService redisService; |
| | | private final PoleBindingService poleBindingService; |
| | | private final PoleGroupRelationService groupRelationService; |
| | | private final ClientService clientService; |
| | | |
| | | public boolean addPole(PoleParam param) { |
| | | Pole pole = new Pole(); |
| | |
| | | } |
| | | |
| | | Pole pole = new Pole(); |
| | | String strh = uniqueMac.substring(uniqueMac.length() - 2, uniqueMac.length()); |
| | | pole.setDeviceCode(strh); |
| | | pole.setPoleName(strh); |
| | | String strm = uniqueMac.substring(0, uniqueMac.length() - 2); |
| | | int i = Integer.parseInt(strm); |
| | | pole.setPoleCode(generatePoleCode()); |
| | | pole.setDeviceType(i); |
| | | setMac = save(pole); |
| | | /* String type = uniqueMac.substring(uniqueMac.length() - 2, uniqueMac.length()); |
| | | String Code = uniqueMac.substring(0, uniqueMac.length() - 2);*/ |
| | | pole.setDeviceCode(uniqueMac); |
| | | pole.setPoleName(uniqueMac); |
| | | /* int i = Integer.parseInt(strm);*/ |
| | | if("00".equals(a1DeviceMacRespInnerFrame.getType())){ |
| | | pole.setDeviceType(0); |
| | | }else if("01".equals(a1DeviceMacRespInnerFrame.getType())){ |
| | | pole.setDeviceType(1); |
| | | } |
| | | |
| | | return setMac; |
| | | pole.setPoleCode(generatePoleCode()); |
| | | Pole one = getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, uniqueMac)); |
| | | // setMac = save(pole); |
| | | if(one==null){ |
| | | return save(pole); |
| | | }else { |
| | | pole.setId(one.getId()); |
| | | return updateById(pole); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public List<String> listDeviceCodeByIds(List<Long> poleIdList) { |
| | |
| | | if (pole == null) { |
| | | throw new BusinessException("ç¯æä¸åå¨"); |
| | | } |
| | | pole.setClientId(clientId); |
| | | pole.setUserId(clientId); |
| | | if(!clientService.findClientId(clientId)){ |
| | | pole.setClientId(clientService.getClientId(clientId)); |
| | | } |
| | | r = updateById(pole); |
| | | |
| | | if (!r) { |
| | |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword,Long cilentId) { |
| | | LambdaQueryWrapper<Pole> eq; |
| | | // if(SecurityUtils.getClientId()!=null){ |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if(clientService.findClientId(cilentId)){ |
| | | eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getUserId, cilentId); |
| | | }else{ |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, cilentId) |
| | | .or( |
| | | pole->{ |
| | | pole.eq(Pole::getUserId, cilentId); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | // }else { |
| | | // PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | // eq = Wrappers.lambdaQuery(Pole.class); |
| | | // } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if (!keyword.isEmpty()){ |
| | | eq.like(Pole::getPoleName,keyword).or( |
| | | code->{ |
| | | code.like(Pole::getPoleCode,keyword); |
| | | } |
| | | ).or( |
| | | deviceCode->{ |
| | | deviceCode.like(Pole::getDeviceCode,keyword); |
| | | } |
| | | ); |
| | | } |
| | | List<Pole> list ; |
| | | list =list(eq); |
| | | setCount(list); |
| | | setOnline(list); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.sandu.ximon.admin.utils.JsonUtil; |
| | | import com.sandu.ximon.admin.utils.LightemitUtils; |
| | | import com.sandu.ximon.admin.utils.LogUtils; |
| | | import com.sandu.ximon.dao.domain.LedSFile; |
| | | import com.sandu.ximon.dao.domain.PoleLightemitEntity; |
| | | import com.sandu.ximon.dao.domain.PoleXixunPlayerEntity; |
| | | import com.sandu.ximon.dao.mapper.PoleXixunPlayerEntityMapper; |
| | |
| | | private final RealtimeServerBean realtimeServerBean; |
| | | private final PoleLightemitService poleLightemitService; |
| | | private final ClientService clientService; |
| | | private final LedSFileService xiXunFileService; |
| | | |
| | | |
| | | public boolean insert(ProgramPro programPro) { |
| | |
| | | poleXixunPlayer.setHeight(programPro.getHeight()); |
| | | poleXixunPlayer.setWidth(programPro.getWidth()); |
| | | poleXixunPlayer.setTotalSize((float) programPro.getTotalSize() / 1000000 + "MB"); |
| | | // poleXixunPlayer.setTotalSize( Long.parseLong(programPro.getTotalSize()) / 1000000 + "MB"); |
| | | // programPro.setProgramId(poleXixunPlayer.getProgramId()); |
| | | // System.out.println(poleXixunPlayer.getProgramId()); |
| | | poleXixunPlayer.setRequestBody(json); |
| | |
| | | |
| | | public Object getByPid(Long pid) { |
| | | PoleXixunPlayerEntity byId = getById(pid); |
| | | List<Long> fileIds=new ArrayList<>(); |
| | | List<LedSFile> file=new ArrayList<>(); |
| | | if (byId == null) { |
| | | throw new BusinessException("æªæ¾å°è¯¥èç®"); |
| | | } |
| | |
| | | programPro = JsonUtil.convertJsonStringToObject(json, ProgramPro.class); |
| | | programPro.setProgramId(pid); |
| | | programPro.setScreenShot(byId.getScreenShot()); |
| | | programPro.getLayers().forEach( |
| | | layerPro -> { |
| | | layerPro.getSources().forEach( |
| | | sourcePro -> { |
| | | long fileId = Long.parseLong(sourcePro.getId()); |
| | | file.add(xiXunFileService.getById(fileId)); |
| | | } |
| | | ); |
| | | } |
| | | ); |
| | | programPro.setFileList(file); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.utils; |
| | | |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.AlipayTradeRefundModel; |
| | | import com.alipay.api.request.AlipayTradeQueryRequest; |
| | | import com.alipay.api.request.AlipayTradeRefundRequest; |
| | | import com.alipay.api.response.AlipayTradeRefundResponse; |
| | | import com.google.gson.Gson; |
| | | import com.sandu.ximon.admin.config.AlipayConfig; |
| | | import com.sandu.ximon.admin.pay.alipay.UsrAlipayConfigService; |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | @AllArgsConstructor |
| | | public class AliPayUtils { |
| | | |
| | | |
| | | public static boolean alipayQuery(String out_trade_no, Long streetlightId) { |
| | | AliConfigEntity aliConfigEntity = UsrAlipayConfigService.getBean().getConfigByPoleId(streetlightId);// è·å客æ·çæ¯ä»å®é
ç½® |
| | | String checkStr = ConfigCheckUtils.checkAlipayConfig(aliConfigEntity); |
| | | if (checkStr != null) { |
| | | LogUtils.error("æ¥è¯¢å¤±è´¥"); |
| | | return false; |
| | | } |
| | | //è·å¾åå§åçAlipayClient |
| | | AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.gatewayUrl, |
| | | aliConfigEntity.getAppId(), aliConfigEntity.getPrivateKey(), |
| | | AlipayConfig.format, AlipayConfig.charset, aliConfigEntity. |
| | | getPublicKey(), AlipayConfig.sign_type); |
| | | |
| | | //设置请æ±åæ° |
| | | AlipayTradeQueryRequest alipayRequest = new AlipayTradeQueryRequest(); |
| | | |
| | | //åæ·è®¢åå·ï¼åæ·ç½ç«è®¢åç³»ç»ä¸å¯ä¸è®¢åå· |
| | | alipayRequest.setBizContent("{\"out_trade_no\":\"" + out_trade_no + "\"}"); |
| | | |
| | | //è¯·æ± |
| | | String result = null; |
| | | try { |
| | | result = alipayClient.execute(alipayRequest).getBody(); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Map map = (Map) new Gson().fromJson(result, Map.class).get("alipay_trade_query_response"); |
| | | if (map.get("sub_msg") != null) { |
| | | if ("交æä¸åå¨".equals(map.get("sub_msg"))) { |
| | | return false; |
| | | } |
| | | } |
| | | if (map.get("trade_status") == null) { |
| | | return false; |
| | | } |
| | | if ("TRADE_SUCCESS".equals(map.get("trade_status"))) { |
| | | // String payTime = (String) map.get("send_pay_date"); |
| | | return true; |
| | | } else if ("TRADE_CLOSED".equals(map.get("trade_status"))) { |
| | | LogUtils.error("交æå·²å
³é(æ¯ä»å®)"); |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¯ä»å®é款æ¥å£ |
| | | * |
| | | * @return |
| | | */ |
| | | public static boolean alipayrefund(Long streetlightId, |
| | | String out_trade_no, |
| | | Double refundAmount) { |
| | | //LogService.getBean().log((long)0, ServerTask.SERVER_TASK,"鿬¾æä½",null,"{ è¿è¡æ¯ä»å®é款:"+out_trade_no+" }"); |
| | | //鿬¾éé¢ï¼ä¸è½å¤§äºè®¢åæ»éé¢ |
| | | String refund_amount = refundAmount + ""; |
| | | //鿬¾çåå 说æ |
| | | String refund_reason = "å
çµæ¡©é款"; |
| | | //æ è¯ä¸æ¬¡é款请æ±ï¼åä¸ç¬äº¤æå¤æ¬¡é款éè¦ä¿è¯å¯ä¸ï¼å¦éé¨å鿬¾ï¼åæ¤åæ°å¿
ä¼ ã |
| | | String out_request_no = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
| | | |
| | | AliConfigEntity AliConfigEntity = UsrAlipayConfigService.getBean().getConfigByPoleId(streetlightId); //æ¾å°æ¯åªä¸ªå®¢æ·çå
çµæ¡© 就鿬¾ç»è° |
| | | String checkStr = ConfigCheckUtils.checkAlipayConfig(AliConfigEntity); |
| | | if (checkStr != null) { |
| | | return false; |
| | | } |
| | | |
| | | // SDK å
Œ
±è¯·æ±ç±»ï¼å
å«å
Œ
±è¯·æ±åæ°ï¼ä»¥åå°è£
äºç¾åä¸éªç¾ï¼å¼åè
æ éå
³æ³¨ç¾åä¸éªç¾ |
| | | AlipayClient client = new DefaultAlipayClient(AlipayConfig.gatewayUrl, AliConfigEntity.getAppId(), |
| | | AliConfigEntity.getPrivateKey(), AlipayConfig.format, |
| | | AlipayConfig.charset, AliConfigEntity.getPublicKey(), AlipayConfig.sign_type); |
| | | AlipayTradeRefundRequest alipay_request = new AlipayTradeRefundRequest(); |
| | | AlipayTradeRefundModel model = new AlipayTradeRefundModel(); |
| | | model.setOutTradeNo(out_trade_no); |
| | | // model.setTradeNo(out_trade_no); |
| | | model.setRefundAmount(refund_amount); |
| | | model.setRefundReason(refund_reason); |
| | | model.setOutRequestNo(out_request_no); |
| | | alipay_request.setBizModel(model); |
| | | |
| | | AlipayTradeRefundResponse alipay_response = null; |
| | | try { |
| | | alipay_response = client.execute(alipay_request); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // System.out.println(alipay_response.getBody()); |
| | | if ("10000".equals(alipay_response.getCode())) { |
| | | // 鿬¾æå |
| | | // LogService.getBean().log((long)0, ServerTask.SERVER_TASK,"鿬¾æä½",null,"{ è¿è¡æ¯ä»å®é款(æå):"+out_trade_no+",鿬¾éé¢:"+refundAmount+" }"); |
| | | return true; |
| | | } |
| | | //ä¿å鿬¾éé¢å鿬¾åå·ï¼å°è®¢åç¶æç½®ä¸ºå®æï¼RFERRORï¼ï¼ä¿åå°æ°æ®åº |
| | | // LogService.getBean().log((long)0, ServerTask.SERVER_TASK,"鿬¾æä½",null,"{ è¿è¡æ¯ä»å®é款(失败):"+out_trade_no+",鿬¾éé¢:"+refundAmount+",reason: "+ JSON.toJSONString(alipay_response)+" }"); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.utils; |
| | | |
| | | |
| | | import com.sandu.ximon.dao.domain.AliConfigEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class ConfigCheckUtils { |
| | | |
| | | public static String checkAlipayConfig(AliConfigEntity WxConfigEntity) { |
| | | if(WxConfigEntity == null) { |
| | | return "ä¸å失败ï¼è¯·è系管çåå¤çï¼é误ç ï¼100"; |
| | | } else if (WxConfigEntity.getAppId() == null || WxConfigEntity.getPrivateKey() == null || WxConfigEntity.getPublicKey() == null) { |
| | | return "ä¸å失败ï¼è¯·è系管çåå¤çï¼é误ç ï¼101"; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.joda.time.DateTime; |
| | | import org.joda.time.LocalDate; |
| | | import org.joda.time.format.DateTimeFormat; |
| | | import org.joda.time.format.DateTimeFormatter; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æ¥æå¤ç |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | public class DateUtils { |
| | | /** |
| | | * æ¶é´æ ¼å¼(yyyy-MM-dd) |
| | | */ |
| | | public final static String DATE_PATTERN = "yyyy-MM-dd"; |
| | | /** |
| | | * æ¶é´æ ¼å¼(yyyy-MM-dd HH:mm:ss) |
| | | */ |
| | | public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | public final static String ORDER_DATE = "yyyyMMddHHmmss"; |
| | | |
| | | public final static String DATE_TIME_SEC_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | |
| | | |
| | | public static Date timestamp2DateTimePattern(Long timestamp) { |
| | | return stringToDate(timestamp + "", DATE_TIME_SEC_PATTERN); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥ææ ¼å¼å æ¥ææ ¼å¼ä¸ºï¼yyyy-MM-dd |
| | | * |
| | | * @param date æ¥æ |
| | | * @return è¿åyyyy-MM-ddæ ¼å¼æ¥æ |
| | | */ |
| | | public static String format(Date date) { |
| | | return format(date, DATE_PATTERN); |
| | | } |
| | | |
| | | public static String orderFormat(Date date) { |
| | | return format(date, ORDER_DATE); |
| | | } |
| | | |
| | | public static String dateFormat(Date date) { |
| | | return format(date, DATE_TIME_PATTERN); |
| | | } |
| | | |
| | | public static String dateFormatSec(Date date) { |
| | | return format(date, DATE_TIME_SEC_PATTERN); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥ææ ¼å¼å æ¥ææ ¼å¼ä¸ºï¼yyyy-MM-dd |
| | | * |
| | | * @param date æ¥æ |
| | | * @param pattern æ ¼å¼ï¼å¦ï¼DateUtils.DATE_TIME_PATTERN |
| | | * @return è¿åyyyy-MM-ddæ ¼å¼æ¥æ |
| | | */ |
| | | public static String format(Date date, String pattern) { |
| | | if (date != null) { |
| | | SimpleDateFormat df = new SimpleDateFormat(pattern); |
| | | return df.format(date); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * åç¬¦ä¸²è½¬æ¢ææ¥æ |
| | | * |
| | | * @param strDate æ¥æå符串 |
| | | * @param pattern æ¥æçæ ¼å¼ï¼å¦ï¼DateUtils.DATE_TIME_PATTERN |
| | | */ |
| | | public static Date stringToDate(String strDate, String pattern) { |
| | | if (StringUtils.isBlank(strDate)) { |
| | | return null; |
| | | } |
| | | |
| | | DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern); |
| | | return fmt.parseLocalDateTime(strDate).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¨æ°ï¼è·åå¼å§æ¥æãç»ææ¥æ |
| | | * |
| | | * @param week 卿 0æ¬å¨ï¼-1ä¸å¨ï¼-2ä¸ä¸å¨ï¼1ä¸å¨ï¼2ä¸ä¸å¨ |
| | | * @return è¿ådate[0]å¼å§æ¥æãdate[1]ç»ææ¥æ |
| | | */ |
| | | public static Date[] getWeekStartAndEnd(int week) { |
| | | DateTime dateTime = new DateTime(); |
| | | LocalDate date = new LocalDate(dateTime.plusWeeks(week)); |
| | | |
| | | date = date.dayOfWeek().withMinimumValue(); |
| | | Date beginDate = date.toDate(); |
| | | Date endDate = date.plusDays(6).toDate(); |
| | | return new Date[]{beginDate, endDate}; |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãç§ãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param seconds ç§æ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå ç§åçæ¥æ |
| | | */ |
| | | public static Date addDateSeconds(Date date, int seconds) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusSeconds(seconds).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãåéãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param minutes åéæ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå åéåçæ¥æ |
| | | */ |
| | | public static Date addDateMinutes(Date date, int minutes) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusMinutes(minutes).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãå°æ¶ãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param hours å°æ¶æ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå å°æ¶åçæ¥æ |
| | | */ |
| | | public static Date addDateHours(Date date, int hours) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusHours(hours).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçã天ãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param days 天æ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå 天åçæ¥æ |
| | | */ |
| | | public static Date addDateDays(Date date, int days) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusDays(days).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãå¨ãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param weeks 卿°ï¼è´æ°ä¸ºå |
| | | * @return å /åå å¨åçæ¥æ |
| | | */ |
| | | public static Date addDateWeeks(Date date, int weeks) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusWeeks(weeks).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãæãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param months ææ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå æåçæ¥æ |
| | | */ |
| | | public static Date addDateMonths(Date date, int months) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusMonths(months).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¹æ¥æçãå¹´ãè¿è¡å /å |
| | | * |
| | | * @param date æ¥æ |
| | | * @param years å¹´æ°ï¼è´æ°ä¸ºå |
| | | * @return å /åå å¹´åçæ¥æ |
| | | */ |
| | | public static Date addDateYears(Date date, int years) { |
| | | DateTime dateTime = new DateTime(date); |
| | | return dateTime.plusYears(years).toDate(); |
| | | } |
| | | |
| | | /** |
| | | * è·å两个æ¶é´å¤©æ°å·® |
| | | * |
| | | * @param oDate |
| | | * @param nDate |
| | | * @return |
| | | */ |
| | | public static Long betweenDateDay(@NotNull Date oDate, @NotNull Date nDate) { |
| | | return Long.valueOf((nDate.getTime() - nDate.getTime())) / (1000 * 60 * 60 * 24); |
| | | } |
| | | |
| | | /** |
| | | * è·å两个æ¶é´å°æ¶å·® |
| | | * |
| | | * @param oDate |
| | | * @param nDate |
| | | * @return |
| | | */ |
| | | public static Long betweenDateHours(@NotNull Date oDate, @NotNull Date nDate) { |
| | | return Long.valueOf((nDate.getTime() - oDate.getTime())) / (1000 * 60 * 60); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¬æç¬¬ä¸å¤© |
| | | * |
| | | * @return |
| | | */ |
| | | public static Date getMonthFirstDay() { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.DAY_OF_MONTH, |
| | | calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¬ææåä¸å¤© |
| | | * |
| | | * @return |
| | | */ |
| | | public static Date getMonthLastDay() { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.DAY_OF_MONTH, |
| | | calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | public static String toChineseDateStr(long ms) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | // è·åæ»ç§æ° |
| | | Long sec = ms / 1000; |
| | | ms = ms % 1000; |
| | | String msStr = "";//SuppDataUtils.SuppData(ms+"",3); |
| | | // ç§æ°å¤§äº60æ¶ |
| | | if (sec > 60) { |
| | | long min = sec / 60; |
| | | sec = sec % 60; |
| | | if (min > 60) { |
| | | long hour = min / 60; |
| | | min = min % 60; |
| | | sb.append(hour + "æ¶" + min + "å" + sec + "." + msStr + "ç§"); |
| | | } else { |
| | | sb.append(min + "å" + sec + "." + msStr + "ç§"); |
| | | } |
| | | } else { |
| | | sb.append(sec + "." + msStr + "ç§"); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.utils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | public class OrderUtils { |
| | | |
| | | public static String generateOutTradeNo () { |
| | | String outTradeNo = DateUtils.orderFormat(new Date()); |
| | | String uuid = UUID.randomUUID().toString().substring(0, 2); |
| | | outTradeNo = outTradeNo + uuid; |
| | | return outTradeNo; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.sandu.ximon.admin.utils.OrderUtils; |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import com.sandu.ximon.dao.enums.OrderStatus; |
| | | import com.sandu.ximon.dao.enums.OrderType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/3/10 11:48 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class C3mOrderVO extends C3mOrder{ |
| | | |
| | | |
| | | public static String REQUEST_URL = "http://www.ximonsmart.com/charge/#/charge/"; |
| | | /** |
| | | * 订åID |
| | | */ |
| | | @TableId |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * ç¯æID |
| | | */ |
| | | private Long poleId; |
| | | |
| | | /** |
| | | * å
çµæ¡©MAC |
| | | */ |
| | | private String c3Mac; |
| | | |
| | | /** |
| | | * 对åºçç¯æè®¾å¤mac |
| | | */ |
| | | private String poleMac; |
| | | |
| | | /** |
| | | * 订ååæ·å· |
| | | */ |
| | | private String outTradeNo; |
| | | |
| | | /** |
| | | * 订åç±»å(C3mOrderType) |
| | | */ |
| | | private String orderType; |
| | | |
| | | /** |
| | | * è®¢åæ»éé¢ |
| | | */ |
| | | private Double totalAmount; |
| | | |
| | | /** |
| | | * 宿¶éé¢ |
| | | */ |
| | | private Double receiptAmount; |
| | | |
| | | /** |
| | | * 鿬¾ |
| | | */ |
| | | private Double refundAmount; |
| | | |
| | | /** |
| | | * ä¹°å®¶å¸å·(æ¯ä»å®) |
| | | */ |
| | | private String aliBuyerLogonId; |
| | | |
| | | /** |
| | | * é¢çº¦çµé |
| | | */ |
| | | private Integer subscribeChargingCapacity; |
| | | |
| | | /** |
| | | * å®å
çµé |
| | | */ |
| | | private Double actualChargingCapacity; |
| | | |
| | | /** |
| | | * 订åå建æ¶é´æ³ |
| | | */ |
| | | private Long createTimestamp; |
| | | |
| | | /** |
| | | * è®¢åæ¯ä»æ¶é´æ³ |
| | | */ |
| | | private Long payTimestamp; |
| | | |
| | | /** |
| | | * 订å鿬¾æ¶é´æ³ |
| | | */ |
| | | private Long refundTimestamp; |
| | | |
| | | /** |
| | | * 订å鿬¾è¯´æ |
| | | */ |
| | | private String refundMsg; |
| | | |
| | | /** |
| | | * å¼å§å
çµæ¶é´æ³ |
| | | */ |
| | | private Long startChargingTimestamp; |
| | | |
| | | /** |
| | | * ç»æå
çµæ¶é´æ³ |
| | | */ |
| | | private Long stopChargingTimestamp; |
| | | |
| | | /** |
| | | * 订åç¶æï¼// æªæ¯ä»(0)ï¼å·²æ¯ä»(1),已鿬¾(2),鿬¾ä¸(3),鿬¾å¤±è´¥(4),订å宿(5) |
| | | */ |
| | | private Integer orderStatus; |
| | | |
| | | /** |
| | | * å
çµæ¡©åç§° |
| | | */ |
| | | private String c3Name; |
| | | |
| | | /** |
| | | * ç¯æåç§° |
| | | */ |
| | | private String poleName; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * çææ°è®¢å |
| | | * @param c3Mac C3ç©çå°å |
| | | * @param orderType 订åç±»å |
| | | * @param totalAmount æ»éé¢ |
| | | * @param subscribeChargingCapacity é¢å
çµé |
| | | */ |
| | | public C3mOrder generateOrder(Long poleId, String poleMac, String c3Mac, OrderType orderType, Double totalAmount, |
| | | Integer subscribeChargingCapacity) { |
| | | this.poleId = poleId; |
| | | this.poleMac = poleMac; |
| | | this.orderId = -1L; |
| | | this.c3Mac = c3Mac; |
| | | this.outTradeNo = OrderUtils.generateOutTradeNo(); |
| | | this.orderType = orderType.getCode(); |
| | | this.totalAmount = totalAmount; |
| | | this.receiptAmount = 0d; |
| | | this.refundAmount = 0d; |
| | | this.aliBuyerLogonId = ""; |
| | | this.subscribeChargingCapacity = subscribeChargingCapacity; |
| | | this.actualChargingCapacity = 0d; |
| | | this.createTimestamp = new Date().getTime(); |
| | | this.payTimestamp = 0L; |
| | | this.startChargingTimestamp = 0L; |
| | | this.stopChargingTimestamp = 0L; |
| | | this.refundTimestamp = 0L; |
| | | this.refundMsg = ""; |
| | | this.orderStatus = OrderStatus.NO_PAY.getStatus(); |
| | | return this; |
| | | } |
| | | } |
| | |
| | | package com.sandu.ximon.admin.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.sandu.ximon.admin.dto.BroadcastTaskType; |
| | | import com.sandu.ximon.admin.param.IPTaskParam; |
| | | import com.sandu.ximon.admin.param.IpVolumeMissionParam; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TaskVO { |
| | |
| | | // ç³»ç»ä¿ç |
| | | private BigInteger btime; |
| | | // 任塿§è¡è§åï¼æ¯å¤©ä¸º 0ï¼æ¯å¨ä¸º 1ï¼æå¨ä¸º 2) |
| | | @JsonIgnore |
| | | private Integer rule; |
| | | // ä»»å¡å¼å§æ¥æï¼ä¸è¬ä¸ºä»»å¡åå»ºæ¥æ |
| | | private BigInteger bdate; |
| | |
| | | // 任塿§è¡æ¶é´å表 |
| | | private TaskRunTimeVO[] exec; |
| | | // é³é¢æä»¶å表 |
| | | @JsonIgnore |
| | | private TaskMediaFileVO[] files; |
| | | // ææ¾ç»ç«¯ ID å表 |
| | | @JsonIgnore |
| | | private TaskTerminalVO[] terminals; |
| | | |
| | | @JsonIgnore |
| | | private String userName; |
| | | |
| | | private String weeks; |
| | | |
| | | private List<Integer> fileIds=new ArrayList<>(); |
| | | |
| | | private List<Integer> TerminalIds=new ArrayList<>(); |
| | | |
| | | } |