Kaynağa Gözat

Merge remote-tracking branch 'origin/V1' into V1

tomatozq 5 yıl önce
ebeveyn
işleme
9f69581743

+ 37 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/ParkingDeviceDAO.java

@@ -0,0 +1,37 @@
+package com.jpsoft.smart.modules.base.dao;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.jpsoft.smart.modules.base.entity.AlarmConfig;
+import com.jpsoft.smart.modules.base.entity.ParkingDevice;
+import com.jpsoft.smart.modules.common.dto.Sort;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-5-22 16:46
+ */
+@Repository
+public interface ParkingDeviceDAO {
+
+    int insert(ParkingDevice entity);
+
+    int update(ParkingDevice entity);
+
+    int exist(Long id);
+
+    ParkingDevice get(Long id);
+
+    int delete(Long id);
+
+    List<ParkingDevice> list();
+
+    List<ParkingDevice> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    ParkingDevice findByParkDeviceNo(@Param("parkDeviceNo") String parkDeviceNo);
+
+
+}

+ 74 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/ParkingDevice.java

@@ -0,0 +1,74 @@
+package com.jpsoft.smart.modules.base.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-5-22 16:39
+ */
+@Data
+@ApiModel(value = "base_parking_device的实体类")
+public class ParkingDevice {
+
+    /**
+     *主键
+     */
+    @ApiModelProperty(value = "主键")
+    private Long id;
+    /**
+     * 编号
+     */
+    @ApiModelProperty(value = "道闸编号")
+    private String parkDeviceNo;
+    /**
+     * 名称
+     */
+    @ApiModelProperty(value = "道闸名称")
+    private String parkDeviceName;
+
+
+
+    @ApiModelProperty(value = "ip_port")
+    private String ipPort;
+
+
+    private String key;
+
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+}

+ 26 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/ParkingDeviceService.java

@@ -0,0 +1,26 @@
+package com.jpsoft.smart.modules.base.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.smart.modules.base.entity.ParkingDevice;
+import com.jpsoft.smart.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-5-22 16:42
+ */
+public interface ParkingDeviceService {
+
+
+    ParkingDevice get(Long id);
+    boolean exist(Long id);
+    int insert(ParkingDevice model);
+    int update(ParkingDevice model);
+    int delete(Long id);
+    List<ParkingDevice> list();
+    Page<ParkingDevice> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+
+    ParkingDevice findByParkDeviceNo(String deviceCode);
+}

+ 83 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/ParkingDeviceServiceImpl.java

@@ -0,0 +1,83 @@
+package com.jpsoft.smart.modules.base.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.smart.modules.base.dao.ParkingDeviceDAO;
+import com.jpsoft.smart.modules.base.entity.ParkingDevice;
+import com.jpsoft.smart.modules.base.service.ParkingDeviceService;
+import com.jpsoft.smart.modules.common.dto.Sort;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-5-22 16:43
+ */
+@Transactional
+@Component(value="parkingDeviceService")
+public class ParkingDeviceServiceImpl implements ParkingDeviceService {
+
+    @Resource(name="parkingDeviceDAO")
+    private ParkingDeviceDAO parkingDeviceDAO;
+
+
+
+    @Override
+    public ParkingDevice get(Long id) {
+        // TODO Auto-generated method stub
+        return parkingDeviceDAO.get(id);
+    }
+
+    @Override
+    public int insert(ParkingDevice model) {
+        // TODO Auto-generated method stub
+        //model.set${PkFieldName}(UUID.randomUUID().toString());
+
+        return parkingDeviceDAO.insert(model);
+    }
+
+    @Override
+    public int update(ParkingDevice model) {
+        // TODO Auto-generated method stub
+        return parkingDeviceDAO.update(model);
+    }
+
+    @Override
+    public int delete(Long id) {
+        // TODO Auto-generated method stub
+        return parkingDeviceDAO.delete(id);
+    }
+
+    @Override
+    public boolean exist(Long id) {
+        // TODO Auto-generated method stub
+        int count = parkingDeviceDAO.exist(id);
+
+        return count > 0 ? true : false;
+    }
+
+    @Override
+    public List<ParkingDevice> list() {
+        // TODO Auto-generated method stub
+        return parkingDeviceDAO.list();
+    }
+
+    @Override
+    public Page<ParkingDevice> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize, boolean count, List<Sort> sortList) {
+        Page<ParkingDevice> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            parkingDeviceDAO.search(searchParams,sortList);
+        });
+
+        return page;
+    }
+
+    @Override
+    public ParkingDevice findByParkDeviceNo(String deviceCode) {
+        return parkingDeviceDAO.findByParkDeviceNo(deviceCode);
+    }
+
+}

+ 16 - 1
common/src/main/java/com/jpsoft/smart/modules/business/service/impl/WorkAttendanceServiceImpl.java

@@ -184,7 +184,22 @@ public class WorkAttendanceServiceImpl implements WorkAttendanceService {
 							List<WorkAttendance> workAttendances = workAttendanceDAO.findByPeriod(personId,alarmConfig.getId(),recordTime.toDate());
 
 							if (workAttendances.size()>0){
-								continue;
+								//可能存在考勤机离线后没有实时传输回打卡记录,这时需要判断数据库中已有该时间段打卡时间<当前打卡时间的数量
+								long count = workAttendances.stream().filter(item->item.getRecordTime().compareTo(recordDate)<0).count();
+
+								if (count==0){
+									//说明当前打卡时间更早,故删除现有该时间段打卡记录
+									for (WorkAttendance workAttendance : workAttendances) {
+										workAttendance.setDelFlag(true);
+										workAttendance.setUpdateTime(new Date());
+
+										workAttendanceDAO.update(workAttendance);
+									}
+								}
+								else{
+									//数据库中已有该时间段打卡时间<当前打卡时间,则忽略当前考勤记录
+									continue;
+								}
 							}
 						}
 					} else {

+ 7 - 6
common/src/main/java/com/jpsoft/smart/modules/common/utils/ParkApiUtil.java

@@ -2,6 +2,7 @@ package com.jpsoft.smart.modules.common.utils;
 
 import cn.hutool.http.HttpRequest;
 import com.jpsoft.smart.config.ParkingConfig;
+import com.jpsoft.smart.modules.base.entity.ParkingDevice;
 import com.jpsoft.smart.modules.common.service.IRedisService;
 import net.sf.json.JSONObject;
 import org.apache.commons.lang3.StringUtils;
@@ -24,16 +25,16 @@ public class ParkApiUtil {
     private IRedisService redisService;
 
 
-    public String getXToken(){
+    public String getXToken(ParkingDevice parkingDevice){
 
-        String body = HttpRequest.get(parkingConfig.getIp() +"/ipms/subSystem/generate/token?userName=" + parkingConfig.getUserName()).execute().body();
+        String body = HttpRequest.get(parkingDevice.getIpPort()+"/ipms/subSystem/generate/token?userName=" + parkingConfig.getUserName()).execute().body();
         JSONObject jsonbody = JSONObject.fromObject(body);
         String data = jsonbody.getString("data");
 
         String accessToken = JSONObject.fromObject(data).getString("accessToken");
         if (StringUtils.isNotBlank(accessToken)){
 
-            redisService.put("accessToken","accessToken",accessToken,86400L);
+            redisService.put("accessToken",parkingDevice.getKey(),accessToken,86400L);
 
             return accessToken;
 
@@ -44,7 +45,7 @@ public class ParkApiUtil {
         }
     }
 
-    public JSONObject httpRequest(String url, String accessToken,String method,HashMap map){
+    public JSONObject httpRequest(ParkingDevice parkingDevice,String url, String accessToken,String method,HashMap map){
 
         if (method.equals("POST")){
 
@@ -59,7 +60,7 @@ public class ParkApiUtil {
 
 
 
-            String body = HttpRequest.post(parkingConfig.getIp()+url).addHeaders(heardMap).body(jsonMapString).execute().body();
+            String body = HttpRequest.post(parkingDevice.getIpPort()+url).addHeaders(heardMap).body(jsonMapString).execute().body();
             JSONObject jsonbody = JSONObject.fromObject(body);
             return jsonbody;
 
@@ -71,7 +72,7 @@ public class ParkApiUtil {
         }
         else {
 
-            String body = HttpRequest.get(parkingConfig.getIp()+"/ipms/device/sluice/channel").header("accessToken",accessToken).form(map).execute().body();
+            String body = HttpRequest.get(parkingDevice.getIpPort()+"/ipms/device/sluice/channel").header("accessToken",accessToken).form(map).execute().body();
             return null;
         }
 

+ 118 - 0
common/src/main/resources/mapper/base/ParkingDevice.xml

@@ -0,0 +1,118 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.smart.modules.base.dao.ParkingDeviceDAO">
+    <sql id="Base_Column_List">
+	id_,
+	park_device_no,
+	park_device_name,
+	ip_port,
+	key_,
+	del_flag,
+	create_by,
+	create_time,
+	update_by,
+	update_time
+</sql>
+    <resultMap id="ParkingDeviceMap" type="com.jpsoft.smart.modules.base.entity.ParkingDevice">
+        <result property="id" column="id_"/>
+        <result property="parkDeviceNo" column="park_device_no"/>
+        <result property="parkDeviceName" column="park_device_name"/>
+        <result property="ipPort" column="ip_port"/>
+        <result property="key" column="key_"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.smart.modules.base.entity.ParkingDevice">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="${pkFieldName}">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into base_parking_device
+	    (park_device_no,park_device_name,ip_port,key_,del_flag,create_by,create_time,
+	    update_by,update_time)
+		values
+		(
+            #{parkDeviceNo,jdbcType=VARCHAR}
+            ,#{parkDeviceName,jdbcType=VARCHAR}
+            ,#{ipPort,jdbcType=VARCHAR}
+            ,#{key,jdbcType=VARCHAR}
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{updateTime,jdbcType= TIMESTAMP }
+
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="Long">
+        delete from base_parking_device where id_=#{id,jdbcType=BIGINT}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.smart.modules.base.entity.ParkingDevice">
+        update base_parking_device
+        <set>
+            <if test="id!=null">
+                id_=#{id,jdbcType=BIGINT},
+            </if>
+            <if test="parkDeviceNo!=null">
+                park_device_no=#{parkDeviceNo,jdbcType=VARCHAR},
+            </if>
+            <if test="parkDeviceName!=null">
+                park_device_name=#{parkDeviceName,jdbcType=VARCHAR},
+            </if>
+            <if test="ipPort!=null">
+                ip_port=#{ipPort,jdbcType=VARCHAR},
+            </if>
+            <if test="key!=null">
+                key_=#{key,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="Long" resultMap="ParkingDeviceMap">
+        select * from base_parking_device where id_=#{0}  and del_flag=0
+    </select>
+    <select id="exist" parameterType="Long" resultType="int">
+        select count(*) from base_parking_device where id_=#{0}  and del_flag=0
+    </select>
+    <select id="list" resultMap="ParkingDeviceMap">
+        select * from base_parking_device where del_flag=0
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="ParkingDeviceMap">
+
+    </select>
+
+    <!--auto generated by MybatisCodeHelper on 2020-05-22-->
+    <select id="findByParkDeviceNo" resultMap="ParkingDeviceMap">
+        select
+        <include refid="Base_Column_List"/>
+        from base_parking_device
+        where park_device_no=#{parkDeviceNo}
+        and del_flag = 0
+    </select>
+
+
+</mapper>

+ 14 - 5
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -152,11 +152,20 @@
                 </foreach>
             </if>
             <if test="searchParams.companyCode != null">
-                and exists (
-                    select t1.id_ from base_person_info t1,base_company_info t2
-                    where t1.company_id =t2.id_
-                    and t2.code_ like #{searchParams.companyCode}
-                    and t1.del_flag=0 and t1.id_ = a.person_id
+                and (
+                    exists (
+                        select t1.id_ from base_person_info t1,base_company_info t2
+                        where t1.company_id =t2.id_
+                        and t2.code_ like #{searchParams.companyCode}
+                        and t1.del_flag=0 and t1.id_ = a.person_id
+                    )
+                    or
+                    exists (
+                        select t1.id_ from base_device_info t1,base_company_info t2
+                        where t1.company_id =t2.id_
+                        and t2.code_ like #{searchParams.companyCode}
+                        and t1.device_no = a.device_no
+                    )
                 )
             </if>
             <if test="searchParams.personId != null">

+ 5 - 0
web/src/main/java/com/jpsoft/smart/modules/business/controller/HealthPublicityController.java

@@ -3,6 +3,7 @@ package com.jpsoft.smart.modules.business.controller;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.github.pagehelper.Page;
+import com.jpsoft.smart.config.TemperatureConfig;
 import com.jpsoft.smart.modules.base.entity.CompanyInfo;
 import com.jpsoft.smart.modules.base.entity.DeviceInfo;
 import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
@@ -44,6 +45,9 @@ public class HealthPublicityController {
     @Autowired
     private PersonCompanyService personCompanyService;
 
+    @Autowired
+    private TemperatureConfig temperatureConfig;
+
     @GetMapping("/healthPublicity")
     public String index(String companyId, Model model) {
         CompanyInfo companyInfo = companyInfoService.get(companyId);
@@ -126,6 +130,7 @@ public class HealthPublicityController {
         model.addAttribute("dayAbnormalNum", dayAbnormalNum);
         model.addAttribute("totalAbnormalNum", totalAbnormalNum);
         model.addAttribute("normalDays", normalDays);
+        model.addAttribute("temperatureConfig", temperatureConfig);
 
         return "motemwall_pc";
     }

+ 18 - 13
web/src/main/java/com/jpsoft/smart/modules/pay/alipay/AlipayController.java

@@ -23,14 +23,8 @@ import com.alipay.api.response.AlipayTradeWapPayResponse;
 import com.ijpay.alipay.AliPayApi;
 import com.ijpay.alipay.AliPayApiConfig;
 import com.ijpay.alipay.AliPayApiConfigKit;
-import com.jpsoft.smart.modules.base.entity.CompanyPaymentInfo;
-import com.jpsoft.smart.modules.base.entity.ElectricClientInfo;
-import com.jpsoft.smart.modules.base.entity.ParkingRecord;
-import com.jpsoft.smart.modules.base.entity.RechargeRecord;
-import com.jpsoft.smart.modules.base.service.CompanyPaymentInfoService;
-import com.jpsoft.smart.modules.base.service.ElectricClientInfoService;
-import com.jpsoft.smart.modules.base.service.ParkingRecordService;
-import com.jpsoft.smart.modules.base.service.RechargeRecordService;
+import com.jpsoft.smart.modules.base.entity.*;
+import com.jpsoft.smart.modules.base.service.*;
 import com.jpsoft.smart.modules.business.service.RechargeService;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.electricity.server.protocol.MeterReceivePacket;
@@ -94,6 +88,9 @@ public class AlipayController {
     @Autowired
     private ParkApiUtil parkApiUtil;
 
+    @Autowired
+    private ParkingDeviceService parkingDeviceService;
+
 
 
     @ApiOperation(value = "支付宝扫码支付")
@@ -431,10 +428,11 @@ public class AlipayController {
                 parkingRecord.setPaymentTime(DateUtil.parse(params.get("gmt_payment")));
 
                 try {
+                    ParkingDevice parkingDevice = parkingDeviceService.findByParkDeviceNo(parkingRecord.getParkingDeviceNo());
 
-                    String accessToken = (String) redisService.get("accessToken", "accessToken");
+                    String accessToken = (String) redisService.get("accessToken", parkingDevice.getKey());
                     if (StringUtils.isBlank(accessToken)){
-                        accessToken = parkApiUtil.getXToken();
+                        accessToken = parkApiUtil.getXToken(parkingDevice);
                     }
 
                     HashMap<String,Object> map = new HashMap<>();
@@ -443,11 +441,18 @@ public class AlipayController {
                         map.put("carNum",parkingRecord.getCarNum());
                         map.put("consumeMoney",parkingRecord.getPayAmount().floatValue());
                         map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
-                        jsonObject = parkApiUtil.httpRequest("/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
+                        jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
                     }else {
-                        map.put("deviceCode",parkingRecord.getParkingDeviceNo());
+                        map.put("carNum",parkingRecord.getCarNum());
+                        map.put("consumeMoney",parkingRecord.getPayAmount().floatValue());
+                        map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
+                        map.put("feeType",9);
+                        jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
+
+                        /*map.put("deviceCode",parkingRecord.getParkingDeviceNo());
                         map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
-                        jsonObject = parkApiUtil.httpRequest("/ipms/payment/bydevice/success",accessToken,"POST",map);
+                        map.put("feeType",9);
+                        jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/payment/bydevice/success",accessToken,"POST",map);*/
 
                     }
 

+ 18 - 13
web/src/main/java/com/jpsoft/smart/modules/pay/weixin/WxPayController.java

@@ -8,14 +8,8 @@ import com.ijpay.core.kit.HttpKit;
 import com.ijpay.core.kit.WxPayKit;
 import com.ijpay.wxpay.WxPayApi;
 import com.ijpay.wxpay.model.UnifiedOrderModel;
-import com.jpsoft.smart.modules.base.entity.CompanyPaymentInfo;
-import com.jpsoft.smart.modules.base.entity.ElectricClientInfo;
-import com.jpsoft.smart.modules.base.entity.ParkingRecord;
-import com.jpsoft.smart.modules.base.entity.RechargeRecord;
-import com.jpsoft.smart.modules.base.service.CompanyPaymentInfoService;
-import com.jpsoft.smart.modules.base.service.ElectricClientInfoService;
-import com.jpsoft.smart.modules.base.service.ParkingRecordService;
-import com.jpsoft.smart.modules.base.service.RechargeRecordService;
+import com.jpsoft.smart.modules.base.entity.*;
+import com.jpsoft.smart.modules.base.service.*;
 import com.jpsoft.smart.modules.business.service.RechargeService;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.electricity.server.protocol.MeterReceivePacket;
@@ -74,6 +68,9 @@ public class WxPayController {
     @Autowired
     private ParkApiUtil parkApiUtil;
 
+    @Autowired
+    private ParkingDeviceService parkingDeviceService;
+
     @ApiOperation(value = "微信JSAPI支付")
     @GetMapping("/webPay")
     public MessageResult webPay(String recordId,String openId) {
@@ -370,10 +367,11 @@ public class WxPayController {
 
                     try {
 
+                        ParkingDevice parkingDevice = parkingDeviceService.findByParkDeviceNo(parkingRecord.getParkingDeviceNo());
 
-                        String accessToken = (String) redisService.get("accessToken", "accessToken");
+                        String accessToken = (String) redisService.get("accessToken", parkingDevice.getKey());
                         if (StringUtils.isBlank(accessToken)){
-                            accessToken = parkApiUtil.getXToken();
+                            accessToken = parkApiUtil.getXToken(parkingDevice);
                         }
 
                         HashMap<String,Object> map = new HashMap<>();
@@ -383,11 +381,18 @@ public class WxPayController {
                             map.put("carNum",parkingRecord.getCarNum());
                             map.put("consumeMoney",parkingRecord.getPayAmount().floatValue());
                             map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
-                             jsonObject = parkApiUtil.httpRequest("/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
+                             jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
                         }else {
-                            map.put("deviceCode",parkingRecord.getParkingDeviceNo());
+                            map.put("carNum",parkingRecord.getCarNum());
+                            map.put("consumeMoney",parkingRecord.getPayAmount().floatValue());
+                            map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
+                            map.put("feeType",10);
+                            jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/integration/kingdo/payment/success",accessToken,"POST",map);
+
+                            /*map.put("deviceCode",parkingRecord.getParkingDeviceNo());
                             map.put("feeAmount",parkingRecord.getPayAmount().floatValue());
-                             jsonObject = parkApiUtil.httpRequest("/ipms/payment/bydevice/success",accessToken,"POST",map);
+                            map.put("feeType",10);
+                             jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/payment/bydevice/success",accessToken,"POST",map);*/
 
                         }
 

+ 24 - 7
web/src/main/java/com/jpsoft/smart/modules/wechat/controller/WxController.java

@@ -98,6 +98,9 @@ public class WxController {
     @Autowired
     private CompanyPaymentInfoService companyPaymentInfoService;
 
+    @Autowired
+    private ParkingDeviceService parkingDeviceService;
+
 
     @ApiOperation(value = "获取微信配置")
     @GetMapping(value = "/getConfig")
@@ -943,10 +946,11 @@ public class WxController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "companyInfoId", paramType = "query", required = true, value = "公司id"),
             @ApiImplicitParam(name = "carNum", paramType = "query", required = true, value = "车牌号"),
+            @ApiImplicitParam(name = "deviceCode", paramType = "query", required = true, value = "默认设备编号"),
             @ApiImplicitParam(name = "openId", paramType = "query", required = false, value = "openId")
 
     })
-    public MessageResult getMsgByCarNum(String companyInfoId, String carNum,String openId) {
+    public MessageResult getMsgByCarNum(String companyInfoId, String carNum,String deviceCode,String openId) {
         int code = 200;
         String message = "查询成功";
         Object data = "";
@@ -954,6 +958,9 @@ public class WxController {
 
         HashMap<String, Object> dataMap = new HashMap<>();
         try {
+            if (StringUtils.isNotBlank(carNum) && StringUtils.isBlank(deviceCode)){
+                return new MessageResult(false, "功能未开放,请在出口扫码", "", 400);
+            }
 
             if (StringUtils.isBlank(openId)){
                 throw new Exception("获取用户信息失败");
@@ -972,16 +979,17 @@ public class WxController {
             if (StringUtils.isBlank(carNum)) {
                 return new MessageResult(false, "车牌号为空", "", 400);
             }
+            ParkingDevice parkingDevice = parkingDeviceService.findByParkDeviceNo(deviceCode);
 
-            String accessToken = (String) redisService.get("accessToken", "accessToken");
+            String accessToken = (String) redisService.get("accessToken", parkingDevice.getKey());
             if (StringUtils.isBlank(accessToken)) {
-                accessToken = parkApiUtil.getXToken();
+                accessToken = parkApiUtil.getXToken(parkingDevice);
             }
 
             HashMap<String, Object> map = new HashMap<>();
             map.put("carNum", carNum);
             map.put("queryType", 1);
-            net.sf.json.JSONObject jsonObject = parkApiUtil.httpRequest("/ipms/integration/kingdo/payment/info", accessToken, "POST", map);
+            net.sf.json.JSONObject jsonObject = parkApiUtil.httpRequest(parkingDevice,"/ipms/integration/kingdo/payment/info", accessToken, "POST", map);
 
 
             if (jsonObject.getString("errMsg").equals("success")) {
@@ -1093,15 +1101,24 @@ public class WxController {
                 result = false;
                 return new MessageResult(result, message, data, code);
             }
+            ParkingDevice parkingDevice = parkingDeviceService.findByParkDeviceNo(deviceCode);
+            if (parkingDevice == null){
+                code = 400;
+                message = "道闸设备未配置外网ip端口";
+                result = false;
+                return new MessageResult(result, message, data, code);
+            }
+
+
 
-            String accessToken = (String) redisService.get("accessToken", "accessToken");
+            String accessToken = (String) redisService.get("accessToken", parkingDevice.getKey());
             if (StringUtils.isBlank(accessToken)) {
-                accessToken = parkApiUtil.getXToken();
+                accessToken = parkApiUtil.getXToken(parkingDevice);
             }
 
             HashMap<String, Object> map = new HashMap<>();
             map.put("deviceCode", deviceCode);
-            net.sf.json.JSONObject jsonObject1 = parkApiUtil.httpRequest("/ipms/payment/bydevice", accessToken, "POST", map);
+            net.sf.json.JSONObject jsonObject1 = parkApiUtil.httpRequest(parkingDevice,"/ipms/payment/bydevice", accessToken, "POST", map);
 
 
             //测试死数据,部署是删除

+ 1 - 1
web/src/main/resources/templates/motemwall_pc.html

@@ -188,7 +188,7 @@
 							</div>
 							<div class="mui-media-body">
 								<span th:text="${item.name}"></span>
-								<span class="mui-pull-right color05c8af" th:text="${item.temperature}"></span>
+								<span class="mui-pull-right" th:class="${item.temperature>37.2 ? 'colorfe616c': 'color05c8af'}" th:text="${item.temperature}"></span>
 							</div>
 							<p th:text="${#dates.format(item.recordTime, 'MM-dd HH:mm')}"></p>
 						</div>