Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 years ago
parent
commit
2e6b9acbb3

+ 100 - 17
common/common-entity/src/main/java/com/yihu/device/entity/DeviceDetail.java

@ -5,30 +5,41 @@ import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by ysj on 2018/01/10.
 * 设备表
 */
@Entity
@Table(name = "wlyy_devices")
public class DeviceDetail extends IdEntity{
    private String deviceName;
    private String deviceModel;
    private String deviceCode;
    private String manufacturer;
    private String applyDate;;
    private String orgName;
    private String linkman;
    private String tel;
    private String serverIp;
    private String manufacturerCode;
    private String address;
    private String representative;
    private String applicantName;
    private String applicantIdentity;
    private String applicantTel;
    private String applicantMail;
    private String deviceName;//设备名称
    private String deviceModel;//型号
    private String deviceCode;//设备唯一标识
    private String manufacturer;//厂家名称
    private String applyDate;//申请日期
    private String orgName;//(居民)机构名称
    private String linkman;//联系人(居民)
    private String tel;//联系人(居民)电话
    private String serverIp;//服务IP地址
    private String manufacturerCode;//厂商代码threeNod:三诺 urion:优瑞恩 bioland:爱奥乐 comvee:康为
    private String address;//厂家地址
    private String representative;//法人代表
    private String applicantName;//申请注册人(发放人/医生)
    private String applicantIdentity;//申请人(发放人/医生)身份证号
    private String applicantTel;//申请人(发放人/医生)手机
    private String applicantMail;//申请人(发放人/医生)邮箱
    //1.4.8版本新增字段
    private String sim;//SIM卡
    private String manufacturerId;//厂商表的业务关联code
    private Boolean grant;//是否发放(0否1是)
    private String grantAdminTeam;//发放的患者所在团队
    private String grantOrgCode;//发放所在机构
    private Integer binding;//是否绑定(0否 1 绑定单端口 2 绑定双端口)
    private String bindingCount;//绑定次数({"1":"0", "2":"0"})
    private Date grantTime;//发放时间
    /** default constructor */
    public DeviceDetail() {
@ -199,4 +210,76 @@ public class DeviceDetail extends IdEntity{
    public void setApplicantMail(String applicantMail) {
        this.applicantMail = applicantMail;
    }
    @Column(name = "manufacturer_id")
    public String getManufacturerId() {
        return manufacturerId;
    }
    public void setManufacturerId(String manufacturerId) {
        this.manufacturerId = manufacturerId;
    }
    @Column(name = "sim")
    public String getSim() {
        return sim;
    }
    public void setSim(String sim) {
        this.sim = sim;
    }
    @Column(name = "is_grant")
    public Boolean getGrant() {
        return grant;
    }
    public void setGrant(Boolean grant) {
        this.grant = grant;
    }
    @Column(name = "grant_admin_team")
    public String getGrantAdminTeam() {
        return grantAdminTeam;
    }
    public void setGrantAdminTeam(String grantAdminTeam) {
        this.grantAdminTeam = grantAdminTeam;
    }
    @Column(name = "grant_org_code")
    public String getGrantOrgCode() {
        return grantOrgCode;
    }
    public void setGrantOrgCode(String grantOrgCode) {
        this.grantOrgCode = grantOrgCode;
    }
    @Column(name = "binding")
    public Integer getBinding() {
        return binding;
    }
    public void setBinding(Integer binding) {
        this.binding = binding;
    }
    @Column(name = "binding_count")
    public String getBindingCount() {
        return bindingCount;
    }
    public void setBindingCount(String bindingCount) {
        this.bindingCount = bindingCount;
    }
    @Column(name = "grant_time")
    public Date getGrantTime() {
        return grantTime;
    }
    public void setGrantTime(Date grantTime) {
        this.grantTime = grantTime;
    }
}

+ 87 - 0
common/common-entity/src/main/java/com/yihu/device/entity/DeviceManufacturer.java

@ -0,0 +1,87 @@
package com.yihu.device.entity;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/6/5.
 * 设备厂商表
 */
@Entity
@Table(name = "wlyy_manufacturer")
public class DeviceManufacturer extends IdEntity {
    private String code;//关联标识
    private String manufacturerCode;//厂商代码
    private String manufacturerName;//厂商名称
    private String address;//厂商地址
    private String representative;//法人代表
    private Date czrq;//创建时间
    private Integer del;//逻辑删除(1删除 0保留)
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "manufacturer_code")
    public String getManufacturerCode() {
        return manufacturerCode;
    }
    public void setManufacturerCode(String manufacturerCode) {
        this.manufacturerCode = manufacturerCode;
    }
    @Column(name = "manufacturer_name")
    public String getManufacturerName() {
        return manufacturerName;
    }
    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }
    @Column(name = "address")
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    @Column(name = "representative")
    public String getRepresentative() {
        return representative;
    }
    public void setRepresentative(String representative) {
        this.representative = representative;
    }
    @Column(name = "czrq")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java

@ -78,4 +78,8 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
            " AND t1.idcard NOT IN(SELECT DISTINCT s.idcard FROM wlyy_sign_family s,wlyy_old_people_physical_examination o WHERE s.admin_team_code=?1 AND s.`status`>0 AND s.idcard=o.id_card " +
            " AND o.medical_time>?2 )ORDER BY t1.openid DESC,CONVERT(t1.NAME USING gbk)",nativeQuery = true)
    List<Patient> findExaminationRemind(long teamcode, Date medicalTime);
    //根据code获取地址
    @Query("select p.address from Patient p where p.code = ?1")
    String getAddress(String patient);
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/healthBank/PatientHealthBankService.java

@ -0,0 +1,24 @@
package com.yihu.wlyy.service.app.healthBank;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional(rollbackFor = Exception.class)
public class PatientHealthBankService extends BaseService {
    @Autowired
    private PatientDao patientDao;
    /**
     * 根据patient判断居民是否为海沧区
     * @param patient
     * @return
     */
    public boolean distinguish(String patient){
        String address = patientDao.getAddress(patient);
        return address.contains("海沧");
    }
}

+ 37 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/healthBank/PatientHealthBankController.java

@ -0,0 +1,37 @@
package com.yihu.wlyy.web.patient.healthBank;
import com.yihu.wlyy.service.app.healthBank.PatientHealthBankService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/patient/healthBank", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-健康银行管理")
public class PatientHealthBankController extends BaseController {
    @Autowired
    private PatientHealthBankService patientHealthBankService;
    /**
     * 判断居民是否为海沧区居民
     * @param patient
     * @return
     */
    @RequestMapping(value = "/distinguish", method = RequestMethod.GET)
    @ApiOperation("区分门户显示(判断是否为海沧区居民)")
    public String distinguish(@RequestParam(value = "patient") String patient){
        try {
            Boolean d = patientHealthBankService.distinguish(patient);
            return write(200, "查询成功!","data", d);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}