Browse Source

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

chenweida 7 years ago
parent
commit
f29d86f921

+ 23 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java

@ -24,27 +24,27 @@ public class Doctor extends IdEntity {
    private String code;        // 业务主键
    private String name;
    private String name;        //姓名
    private Integer sex;        // 性别(1男,2女)
    private Date birthday;
    private String photo;
    private String mobile;
    private String password;
    private Date birthday;      //生日
    private String photo;       //头像http地址
    private String mobile;      //手机号
    private String password;    //密码
    private String salt;        // 密码标识
    private Integer status;     // 状态(1正常,0禁用)
    private String province;
    private String city;
    private String town;
    private String province;    //省code
    private String city;         //市code
    private String town;         //区县code
    private String provinceName;
    private String cityName;
    private String townName;
    private String provinceName;//省名称
    private String cityName;    //市名称
    private String townName;    //区县名称
    private String hospital;        // 医院代码
    private String hospitalName;
    private String hospitalName;    //医院名称
    private String dept;            // 科室代码
    private String deptName;
    private String deptName;        //可是名称
    private String job;             // 职称代码
    private String jobName;         // 职称名
@ -62,9 +62,10 @@ public class Doctor extends IdEntity {
    private String idcard;          //身份证号
    private Integer isFamous;       //是否是名医 1是  0或者空不是
    private String isPasswordPrompt;// 是否提示密码信息 1是 0或者空是否
    private String isHelp;//是否求助  1已经求助 0未求助
    private String isHelp;          //是否求助  1已经求助 0未求助
    private Double evaluateScore;//评分
    private String checkPassword;   //审方密码
    public Double getEvaluateScore() {
        return evaluateScore;
@ -396,4 +397,12 @@ public class Doctor extends IdEntity {
    public void setIsPasswordPrompt(String isPasswordPrompt) {
        this.isPasswordPrompt = isPasswordPrompt;
    }
    public String getCheckPassword() {
        return checkPassword;
    }
    public void setCheckPassword(String checkPassword) {
        this.checkPassword = checkPassword;
    }
}

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDispensaryCode;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -20,7 +21,7 @@ public interface PrescriptionDispensaryCodeDao extends PagingAndSortingRepositor
//    @Query("select  count(1) from wlyy_prescription_dispensary_code p1 \n" +
//            "LEFT JOIN wlyy_prescription p2 on p1.prescription_Code = p2.code where p2.status in(21,20,100) and p2.patient =?1 ")
//    int dispensaryCodeCount(String patientCode);
    @Query("select count(1) from PrescriptionDispensaryCode a where a.code= ?1 ")
    @Query("select count(1) from PrescriptionDispensaryCode a ,Prescription b where a.prescriptionCode =b.code and a.code= ?1 and b.status != 100")
    Integer getResidentQRCodeCount(String code);
//    @Query("select p1 from PrescriptionInfo p1 left join Prescription p2 on p1.prescriptionCode=p2.code where p1.prescriptionCode = ?1")

+ 17 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -49,6 +49,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    private HttpUtil httpUtil;
    private static Object obj = new Object();
    private static Object obj2 = new Object();
    @Value("${fastDFS.fastdfs_file_url}")
    String fastdfs_file_url;
@ -66,16 +67,16 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            }
        }
        List<Object> params = new ArrayList<>();
        String precriptionSql = "select * from wlyy_prescription p1 LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where 1=1 ";
        String precriptionSql = "select * from wlyy_prescription_dispensary_code p2 left join  wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where 1=1 ";
        if(status!=null){
            precriptionSql += " and b.status = ? ";
            precriptionSql += " and p1.status = ? ";
            params.add(status);
        }else {
            precriptionSql += " and b.status in (20,21,100)" ;
            precriptionSql += " and p1.status in (20,21,100)" ;
        }
        if(timeType!=null){
            precriptionSql +=  "and TIMESTAMPDIFF(SECOND, a.create_Time, CURRENT_TIME) > ? ORDER BY b.status desc ,a.create_Time desc ";
            precriptionSql +=  "and TIMESTAMPDIFF(SECOND, a.create_Time, CURRENT_TIME) > ? ORDER BY p1.status desc ,p2.create_Time desc ";
            params.add(timeLimit);
        }
        precriptionSql += " limit "+(page-1)*pagesize+","+pagesize;
@ -144,9 +145,17 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    //生成配送员(健管师)取药码
    public PrescriptionDispensaryCode saveDoctorQRCode(String code,String token,String prescriptionCode){
        String jgsID= "";//配送员用户ID后4位
        String jgsCode = code+jgsID.substring(jgsID.length()-4);
        String jgsCode= "";
        synchronized (obj2){
            boolean bl = true;
            while (bl){
                String randomNum = randomString("0123456789",2);
                jgsCode = code +randomNum;
                bl = getResidentQRCodeCount(jgsCode);
            }
        }
        //String jgsID= "";//配送员用户ID后4位
//        String jgsCode = code+"1234";//code+jgsID.substring(jgsID.length()-4);
        ObjectNode imgNode2 = makeQrcodeFromWeiXin(token,jgsCode);
        String fileUrl = fastdfs_file_url + imgNode2.get("groupName").toString().replaceAll("\"","")
                + "/" + imgNode2.get("remoteFileName").toString().replaceAll("\"","");
@ -191,6 +200,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
        return null;
    }
    //随机生成匹配数字
    public  String randomString(String base, int length) {
        Random random = new Random();
        StringBuffer sb = new StringBuffer();

+ 3 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.patient.prescription;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
@ -48,7 +49,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
     */
    @RequestMapping(value = "/dispensaryCode/savePatientQRCode",method = RequestMethod.GET)
    @ResponseBody
    //@ObserverRequired
    @ObserverRequired
    public String saveQRCode(
            //@RequestParam(value = "dispensaryType",required = true) Integer dispensaryType,
            @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
@ -73,7 +74,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
     */
    @RequestMapping(value = "/dispensaryCode/saveDoctorQRCode",method = RequestMethod.GET)
    @ResponseBody
    //@ObserverRequired
    @ObserverRequired
    public String saveDoctorQRCode(
            @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode,
            @RequestParam(value = "code",required = true) String code){