Explorar o código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into rehabilitation_dev

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/rehabilitation/SpecialDiseaseMessagesDO.java
wangjun %!s(int64=3) %!d(string=hai) anos
pai
achega
6b1d31040a
Modificáronse 18 ficheiros con 161 adicións e 65 borrados
  1. 0 41
      business/base-service/src/main/java/com/yihu/jw/rehabilitation/SpecialistPatientRelationDao.java
  2. 3 0
      common/common-entity/sql记录
  3. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/Device.java
  4. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceSosLogDO.java
  5. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/DmHospitalDO.java
  6. 0 9
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java
  7. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/team/WlyyAdminTeamDO.java
  8. 2 4
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/team/WlyyAdminTeamMemberDO.java
  9. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/rehabilitation/SpecialDiseaseMessagesDO.java
  10. 2 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java
  11. 8 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PayEndpoint.java
  12. 27 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/DeviceDetailService.java
  13. 11 5
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/pay/PayService.java
  14. 12 2
      svr/svr-cloud-care/src/main/resources/application.yml
  15. 80 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorPhthisisFollowupController.java
  16. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/GuidanceMessageLogDao.java
  17. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationDetailAppointmentDao.java
  18. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationOperateRecordsDao.java

+ 0 - 41
business/base-service/src/main/java/com/yihu/jw/rehabilitation/SpecialistPatientRelationDao.java

@ -1,41 +0,0 @@
package com.yihu.jw.rehabilitation;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/4/25.
 */
public interface SpecialistPatientRelationDao extends PagingAndSortingRepository<SpecialistPatientRelationDO, String>,
        JpaSpecificationExecutor<SpecialistPatientRelationDO> {
    public List<SpecialistPatientRelationDO> findByDoctorAndStatus(String doctor, String status);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2  and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByDoctorAndPatient(String doctor, String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and (p.patient=?2 or p.healthAssistant=?2) and p.signStatus='1' and p.status>=0 ")
    SpecialistPatientRelationDO findByPatientAndDoctor(String doctor, String patient);
    List<SpecialistPatientRelationDO> findAllBySignStatus(String signStatus);
    @Modifying
    @Query("update SpecialistPatientRelationDO p set p.doctor = ?2, p.doctorName=?3 where p.patient=?1 and p.signStatus='1' and p.status>=0 ")
    void updateSpecialistByPatient(String patient, String doctor, String doctorName);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient =?2 and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByTeamCodeAndPatient(Integer teamCode, String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.teamCode =?3 and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByDoctorAndPatientAndTeamCode(String doctor, String patient, Integer teamCode);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.doctor=?3 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamCodeAndPatientAndDoctor(Integer teamCode, String patient, String doctor);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamAndPatient(Integer teamCode, String patient);
}

+ 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
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceSosLogDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -11,6 +12,7 @@ import java.util.Date;
 */
@Entity
@Table(name="base_device_sos_log")
@SequenceGenerator(name="id_generated", sequenceName="seq_base_device_sos_log")
public class DeviceSosLogDO extends IdEntity {
    private String patient; //居民code
    private String patientName; //姓名

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/DmHospitalDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -13,6 +14,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "dm_hospital")
@SequenceGenerator(name="id_generated", sequenceName="seq_dm_hospital")
public class DmHospitalDO extends IntegerIdentityEntity {
	private static final long serialVersionUID = 8039389705624435301L;

+ 0 - 9
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java

@ -61,7 +61,6 @@ public class SystemMessageDO extends UuidIdentityEntity {
     */
    private String del;
    private String over;//是否操作结束 是否操作结束 1否,0是
    private String code;
    /**
     *已读时间
     */
@ -223,12 +222,4 @@ public class SystemMessageDO extends UuidIdentityEntity {
    public void setOver(String over) {
        this.over = over;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/team/WlyyAdminTeamDO.java

@ -17,6 +17,7 @@ import java.util.List;
@Entity
@Table(name = "wlyy_admin_team")
@EntityListeners(AuditingEntityListener.class)
public class WlyyAdminTeamDO implements Serializable {
    private Integer id;

+ 2 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/team/WlyyAdminTeamMemberDO.java

@ -3,10 +3,7 @@ package com.yihu.jw.entity.hospital.team;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.*;
import java.util.Date;
/**
@ -14,6 +11,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "wlyy_admin_team_member")
@SequenceGenerator(name="id_generated", sequenceName="seq_wlyy_admin_team_member")
public class WlyyAdminTeamMemberDO extends IntegerIdentityEntity {
    private static final long serialVersionUID = 1L;
    private Long teamId;

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/rehabilitation/SpecialDiseaseMessagesDO.java

@ -1,6 +1,6 @@
package com.yihu.jw.entity.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -13,7 +13,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wlyy_special_disease_messages")
public class SpecialDiseaseMessagesDO extends UuidIdentityEntity {
public class SpecialDiseaseMessagesDO extends IdEntity {
    private String name;
    private String address;

+ 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);

+ 8 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PayEndpoint.java

@ -88,9 +88,15 @@ public class PayEndpoint extends EnvelopRestEndpoint {
    @GetMapping("orderInfo")
    @ApiOperation(value = "订单详情")
    public ObjEnvelop orderInfo(@ApiParam(name = "id", value = "订单id") @RequestParam(value = "id", required = true) Integer id) {
    public ObjEnvelop orderInfo(@ApiParam(name = "id", value = "订单id")
                                    @RequestParam(value = "id", required = false) Integer id,
                                @ApiParam(name = "orderId", value = "工单id")
                                @RequestParam(value = "orderId", required = false) String orderId) {
        try {
            JSONObject json = payService.orderInfo(id);
            if(StringUtil.isBlank(orderId)&&id==null){
                return ObjEnvelop.getError("入参有误",-1);
            }
            JSONObject json = payService.orderInfo(id,orderId);
            return ObjEnvelop.getSuccess("获取成功",json);
        } catch (Exception e) {
            return failedObjEnvelopException2(e);

+ 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");
			//注册日志
		}
	}
}

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

@ -189,10 +189,16 @@ public class PayService {
     * 订单详情接口
     * @param id
     */
    public JSONObject orderInfo(Integer id){
    public JSONObject orderInfo(Integer id,String orderId){
        JSONObject resJson = new JSONObject();
        resJson.put("id",id);
        BusinessOrderDO businessOrderDO = businessOrderDao.findOne(id);
        BusinessOrderDO businessOrderDO;
        if(StringUtil.isBlank(orderId)){
            businessOrderDO = businessOrderDao.findOne(id);
        }else{
            businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
        }
        resJson.put("id",businessOrderDO.getId());
        resJson.put("orderId",businessOrderDO.getRelationCode());
        String type = businessOrderDO.getOrderCategory();
        Integer status = businessOrderDO.getStatus();
        resJson.put("orderCategory",type);
@ -354,7 +360,7 @@ public class PayService {
            result.put(ResponseContant.resultMsg, "工单未创建支付订单");
            return result;
        }
        JSONObject payInfo = orderInfo(businessOrderDO.getId());
        JSONObject payInfo = orderInfo(businessOrderDO.getId(),null);
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, payInfo);
        return result;
@ -523,7 +529,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;
        }

+ 12 - 2
svr/svr-cloud-care/src/main/resources/application.yml

@ -183,6 +183,9 @@ systemSetting:
base:
  url: http://172.17.110.212:10020/
  hospitalUrl: http://172.26.0.107:10022/
cloudCare:
  url: http://172.26.0.107:9112/
---
spring:
  profiles: jwtest
@ -288,6 +291,9 @@ systemSetting:
base:
  url: http://172.17.110.212:10020/
  hospitalUrl: http://172.26.0.107:10022/
cloudCare:
  url: http://172.26.0.107:9112/
---
spring:
  profiles: jwprod
@ -396,7 +402,8 @@ base:
  url: http://172.17.110.212:10020/
  hospitalUrl: http://172.26.0.107:10022/
cloudCare:
  url: http://172.26.0.107:9112/
---
spring:
  profiles: hzprod
@ -501,4 +508,7 @@ systemSetting:
  isApplication: 0 # 是否需要资质申请 1需要 0 不需要
base:
  hospitalUrl: http://127.0.0.7:10022/
  hospitalUrl: http://127.0.0.7:10022/
cloudCare:
  url: https://zhyzh.hzxc.gov.cn/device/

+ 80 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorPhthisisFollowupController.java

@ -0,0 +1,80 @@
package com.yihu.wlyy.web.doctor.followup;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.followup.PhthisisFollowupService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 医生端:肺结核随访服务控制器
 *
 * @author lith on 2019-05-05
 */
@RestController
@RequestMapping(value = "/doctor/phthisis", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "医生端-肺结核随访记录服务")
public class DoctorPhthisisFollowupController extends BaseController {
    @Autowired
    private PhthisisFollowupService phthisisFollowupService;
    @PostMapping(value = "/saveFirst")
    @ApiOperation(value = "保存第一次肺结核随访数据")
    public String saveFirstFollowup(@ApiParam(name = "jsonData", value = "随访json") @RequestParam(value = "jsonData", required = true) String jsonData) {
        StringBuilder errMsg = new StringBuilder();
        try {
            if(!phthisisFollowupService.saveFirstFollowup(jsonData,errMsg)){
                return error( -1, "保存第一次肺结核随访数据失败," + errMsg);
            }
        } catch (Exception e) {
            return errorResult(e);
        }
        return write(200, "保存第一次肺结核随访数据成功!");
    }
    @PostMapping(value = "/saveNTimes")
    @ApiOperation("保存第n次肺结核随访数据")
    public String saveNTimesFollowup(@ApiParam(name = "jsonData", value = "随访json") @RequestParam(value = "jsonData", required = true) String jsonData) {
        StringBuilder errMsg = new StringBuilder();
        try {
            if(!phthisisFollowupService.saveNTimesFollowup(jsonData,errMsg)){
                return error( -1, "保存第n次肺结核随访数据失败," + errMsg);
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "保存第n次肺结核随访数据失败," + e.getMessage());
        }
        return write(200, "保存第n次肺结核随访数据成功!");
    }
    @GetMapping(value = "/getFirst")
    @ApiOperation("查询第一次肺结核随访数据详情")
    public String queryFirst(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject firstFollowupES = phthisisFollowupService.queryFirstByFollowupId(followupId);
            return write(200, "查询成功!", "data", firstFollowupES);
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败!" + e.getMessage());
        }
    }
    @GetMapping(value = "/getNTimes")
    @ApiOperation("查询第n次肺结核随访数据详情")
    public String queryNTimes(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            List<JSONObject> ntimesFollowups = phthisisFollowupService.queryNTimesByFollowupId(followupId);
            return write(200, "查询成功!", "data", ntimesFollowups);
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败!" + e.getMessage());
        }
    }
}

business/base-service/src/main/java/com/yihu/jw/rehabilitation/GuidanceMessageLogDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/GuidanceMessageLogDao.java


business/base-service/src/main/java/com/yihu/jw/rehabilitation/RehabilitationDetailAppointmentDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationDetailAppointmentDao.java


business/base-service/src/main/java/com/yihu/jw/rehabilitation/RehabilitationOperateRecordsDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationOperateRecordsDao.java