| | |
| | | // 指定发送邮件的主机为 |
| | | String host = "smtp.163.com"; |
| | | Properties properties = new Properties(); |
| | | properties.put("mail.smtp.host", "smtp.163.com"); |
| | | properties.put("mail.smtp.host", host); |
| | | properties.put("mail.smtp.socketFactory.port", "465"); |
| | | properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); |
| | | properties.put("mail.smtp.auth", "true"); |
| | |
| | | public javax.mail.PasswordAuthentication getPasswordAuthentication() |
| | | { |
| | | //发件人邮件用户名、授权码,换成自己的发件箱及授权码 |
| | | return new PasswordAuthentication("13281306557@163.com", "NUSdxDQqadYvVek2"); |
| | | return new PasswordAuthentication(from, "NUSdxDQqadYvVek2"); |
| | | } |
| | | }); |
| | | |
| | |
| | | // Set From,设置发件人 |
| | | InternetAddress fromMail = new InternetAddress(from); |
| | | //设置发件人名称,TODO 换成自己的发件箱 |
| | | fromMail.setPersonal(MimeUtility.encodeText("明星新能源科技有限公司<13281306557@163.com>")); |
| | | fromMail.setPersonal(MimeUtility.encodeText("明星新能源科技有限公司<" + from + ">")); |
| | | message.setFrom(fromMail); |
| | | // Set To: 设置收件人 |
| | | InternetAddress toMail = new InternetAddress(to); |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingGunService chargingGunService; |
| | | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private TFaultMessageService faultMessageService; |
| | |
| | | String gun_code = vo.getGun_code(); |
| | | //0:正常,1:故障,2=插枪 |
| | | Integer status = vo.getStatus(); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_gun_online"); |
| | | Long time = (Long) charging_pile_online.get(pile_code + gun_code); |
| | | Long time = (Long) redisTemplate.opsForHash().get("charging_gun_online", (pile_code + gun_code)); |
| | | //小于1分钟才处理数据,防止频繁查询数据 |
| | | if(null != time && (System.currentTimeMillis() - time) < 60000){ |
| | | return; |
| | | } |
| | | TChargingGun tChargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, (pile_code + gun_code)).eq(TChargingGun::getDelFlag, 0)); |
| | | if(null != tChargingGun){ |
| | | charging_pile_online.put(tChargingGun.getFullNumber(), System.currentTimeMillis()); |
| | | redisService.setCacheMap("charging_gun_online", charging_pile_online); |
| | | redisTemplate.opsForHash().put("charging_gun_online", tChargingGun.getFullNumber(), System.currentTimeMillis()); |
| | | |
| | | TChargingPile chargingPile = chargingPileService.getById(tChargingGun.getChargingPileId()); |
| | | //枪处于离线或者故障,返回状态为正常,则修改其状态 |
| | |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private IotInterfaceClient iotInterfaceClient; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private TFaultMessageService faultMessageService; |
| | |
| | | */ |
| | | @Override |
| | | public void updateStatus() { |
| | | Map<String, Object> charging_gun_online = redisService.getCacheMap("charging_gun_online"); |
| | | Set<String> keySet = charging_gun_online.keySet(); |
| | | List<TChargingGun> list = new ArrayList<>(); |
| | | if(keySet.size() > 0){ |
| | | list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getDelFlag, 0).in(TChargingGun::getFullNumber, keySet)); |
| | | } |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun chargingGun : list) { |
| | | Long time = (Long) charging_gun_online.get(chargingGun.getFullNumber()); |
| | | Long time = (Long) redisTemplate.opsForHash().get("charging_gun_online", chargingGun.getFullNumber()); |
| | | //判断设备是否真的离线3分钟(2分钟+代码中的60秒间隔处理存储) |
| | | if(null != time && System.currentTimeMillis() - time > 180000){ |
| | | TChargingGun chargingGun1 = new TChargingGun(); |
| | |
| | | |
| | | </select> |
| | | <select id="getRefundList" resultType="com.ruoyi.order.api.model.TChargingOrderRefund"> |
| | | |
| | | select * from (SELECT re.id, |
| | | re.`code`, |
| | | re.refund_code, |
| | | re.refund_title, |
| | | re.refund_reason, |
| | | re.refund_amount, |
| | | re.refund_total_amount, |
| | | re.refund_time, |
| | | re.pay_type, |
| | | re.pay_amount, |
| | | re.refund_remark, |
| | | co.recharge_serial_number as serail_number, |
| | | co.payment_amount, |
| | | co.create_time as pay_time, |
| | | co.id as order_id, |
| | | co.app_user_id as user_id, |
| | | 1 as type |
| | | select * from ( |
| | | SELECT |
| | | re.id, |
| | | re.`code`, |
| | | re.refund_code, |
| | | re.refund_title, |
| | | re.refund_reason, |
| | | re.refund_amount, |
| | | re.refund_total_amount, |
| | | re.refund_time, |
| | | re.pay_type, |
| | | re.pay_amount, |
| | | re.refund_remark, |
| | | co.recharge_serial_number as serail_number, |
| | | co.payment_amount, |
| | | co.create_time as pay_time, |
| | | co.id as order_id, |
| | | co.app_user_id as user_id, |
| | | 1 as type |
| | | FROM t_charging_order_refund re |
| | | LEFT JOIN t_charging_order co ON re.charging_order_id = co.id |
| | | UNION ALL |
| | | SELECT re.id, |
| | | re.`code`, |
| | | re.refund_code, |
| | | re.refund_title, |
| | | re.refund_reason, |
| | | re.refund_amount, |
| | | re.refund_total_amount, |
| | | re.refund_time, |
| | | re.pay_type, |
| | | re.pay_amount, |
| | | re.refund_remark, |
| | | so.serial_number, |
| | | so.payment_amount, |
| | | so.create_time as pay_time, |
| | | so.id as order_id, |
| | | so.app_user_id as user_id, |
| | | 2 as type |
| | | SELECT |
| | | re.id, |
| | | re.`code`, |
| | | re.refund_code, |
| | | re.refund_title, |
| | | re.refund_reason, |
| | | re.refund_amount, |
| | | re.refund_total_amount, |
| | | re.refund_time, |
| | | re.pay_type, |
| | | re.pay_amount, |
| | | re.refund_remark, |
| | | so.serial_number, |
| | | so.payment_amount, |
| | | so.create_time as pay_time, |
| | | so.id as order_id, |
| | | so.app_user_id as user_id, |
| | | 2 as type |
| | | FROM t_shopping_order_refund re |
| | | LEFT JOIN t_shopping_order so on re.shopping_order_id = so.id |
| | | UNION ALL |
| | | SELECT vr.id, |
| | | vr.`code`, |
| | | vr.refund_code, |
| | | vr.refund_title, |
| | | vr.refund_reason, |
| | | vr.refund_amount, |
| | | vr.refund_total_amount, |
| | | vr.refund_time, |
| | | vr.pay_type, |
| | | vr.pay_amount, |
| | | vr.refund_remark, |
| | | vo.serial_number, |
| | | vo.payment_amount, |
| | | vo.create_time as pay_time, |
| | | vo.id as order_id, |
| | | vo.app_user_id as user_id, |
| | | 3 as type |
| | | SELECT |
| | | vr.id, |
| | | vr.`code`, |
| | | vr.refund_code, |
| | | vr.refund_title, |
| | | vr.refund_reason, |
| | | vr.refund_amount, |
| | | vr.refund_total_amount, |
| | | vr.refund_time, |
| | | vr.pay_type, |
| | | vr.pay_amount, |
| | | vr.refund_remark, |
| | | vo.serial_number, |
| | | vo.payment_amount, |
| | | vo.create_time as pay_time, |
| | | vo.id as order_id, |
| | | vo.app_user_id as user_id, |
| | | 3 as type |
| | | FROM t_vip_order_refund vr |
| | | LEFT JOIN t_vip_order vo on vr.vip_order_id = vo.id |
| | | |
| | | |
| | | ) o |
| | | <where> |
| | | <if test="data.code != null and data.code != ''"> |
| | |
| | | tc.name as name, |
| | | cp.name AS siteName |
| | | FROM |
| | | `charging_pile_order`.`t_charging_order` co |
| | | (select site_id,create_time,charging_gun_id, charging_pile_id, current, (CASE WHEN need_elec = 0 THEN `current` ELSE need_elec END) as need_elec from `charging_pile_order`.`t_charging_order`) co |
| | | LEFT JOIN `charging_pile_service`.`t_charging_gun` tc ON co.charging_gun_id = tc.id |
| | | LEFT JOIN `charging_pile_service`.`t_charging_pile` cp ON tc.charging_pile_id = cp.id |
| | | <where> |
| | |
| | | AND toi.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.billing_user_id IN |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |
| | |
| | | AND toi.billing_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.billing_user_id IN |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |
| | |
| | | AND toi.billing_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND toi.billing_user_id IN |
| | | AND toi.app_user_id IN |
| | | <foreach collection="query.userIds" close=")" open="(" item="userId" separator=","> |
| | | #{userId} |
| | | </foreach> |