liubing 3 年 前
コミット
74ba2c6de1

+ 3 - 0
common/common-entity/sql记录

@ -1087,3 +1087,6 @@ alter table base.base_life_care_order add column pay_status TINYINT(2) DEFAULT n
alter table base.base_business_order_refund add column refuse_desc varchar(255) DEFAULT null COMMENT '拒绝退款说明';
ALTER table base.base_business_order_pay add column last_pay_time BIGINT(13) COMMENT '截至支付日期'
ALTER table base.base_business_order_pay add INDEX index_status_last_pay(status,last_pay_time)
-- 2021-07-12
ALTER table base.dm_device add column need_register tinyint(2) DEFAULT '0' COMMENT '是否需要注册 0否 1是'

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/Device.java

@ -27,6 +27,7 @@ public class Device extends IdEntity {
	private Date czrq;
	private String del;
	private String serviceTopic;//设备所属专题 防走失 preventLost
	private Integer needRegister;//设备是否注册iot(脉搏波血压计)
	@Column(name="category_code")
	public String getCategoryCode() {
@ -117,4 +118,12 @@ public class Device extends IdEntity {
	public void setServiceTopic(String serviceTopic) {
		this.serviceTopic = serviceTopic;
	}
	public Integer getNeedRegister() {
		return needRegister;
	}
	public void setNeedRegister(Integer needRegister) {
		this.needRegister = needRegister;
	}
}

+ 2 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -120,6 +120,8 @@ public class PadDeviceController extends BaseController {
                if (flagDevice == false){
                    return write(-1,"请填写投放地址");
                }
                //注册设备地址
                deviceDetailService.registerToWlyy(device);
            }
            //修改设备表中{"1":"0", "2":"0"}的绑定次数 和其他绑定信息
            deviceDetailService.updateAfterBinding(device,new Date(),flag);

+ 27 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/DeviceDetailService.java

@ -13,13 +13,18 @@ import com.yihu.jw.entity.care.device.DeviceDetail;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -43,6 +48,10 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
	private PatientDeviceDao patientDeviceDao;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	@Autowired
	private HttpClientUtil httpClientUtil;
	@Value("${cloudCare.url}")
	private String cloudDeviceUrl;
	/**
@ -182,4 +191,22 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
	public DeviceDetail findByDeviceSn(String deviceSn){
		return deviceDetailDao.findBySn(deviceSn);
	}
	/**
	 * 注册设备,通过iot项目进行数据推送
	 * @return
	 */
	public void registerToWlyy(DevicePatientDevice device){
		//判断设备类型
		Device deviceDO = deviceDao.findOne(device.getDeviceId());
		if (1==deviceDO.getNeedRegister()){
			// 设备注册至iot后 通过iot将设备数据转发
			String url = "http://www.cityihealth.com:43210/deviceManage/register";
			List<NameValuePair> params = new ArrayList<>();
			params.add(new BasicNameValuePair("deviceSN", device.getDeviceSn()));
			params.add(new BasicNameValuePair("pushAddress", cloudDeviceUrl));
			String response = httpClientUtil.post(url, params,"UTF-8");
			//注册日志
		}
	}
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/pay/PayService.java

@ -523,7 +523,7 @@ public class PayService {
        log.error("【退款通知】请求,getOrderNo:{}", orderDO.getOrderNo());
        String type = "";
        //防止重复支付
        if (orderDO.getStatus()!=1) {
        if (!(orderDO.getStatus()==1||orderDO.getStatus()==3)) {//待退款或同意退款
            log.error("【退款通知】请求,getStatus:{}", orderDO.getStatus());
            return;
        }