Explorar el Código

查询签约社保流水号

lyr hace 8 años
padre
commit
9d4656bcda

+ 1 - 1
src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1383,7 +1383,7 @@ public class FamilyContractService extends BaseService {
    public SignFamily findByJiatingPatient(String code) {
        return signFamilyDao.findFamilySignByPatient(code);
        return signFamilyDao.findByjiatingPatientYes(code);
    }
    /**

+ 66 - 29
src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -4,6 +4,7 @@ import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,7 +23,7 @@ import java.util.HashMap;
@RestController
@RequestMapping(value = "/manage_util")
@Api(description = "管理工具及后台任务控制")
public class ManagerUtilController extends BaseController{
public class ManagerUtilController extends BaseController {
    @Autowired
    PatientDiseaseService diseaseService;
@ -32,19 +33,22 @@ public class ManagerUtilController extends BaseController{
    QuartzHelper quartzHelper;
    @Autowired
    DoctorWorkTimeService workTimeService;
    @Autowired
    StatisticsService statisticsService;
    /*********************************************患者疾病相关******************************************/
    /**
     * 更新到redis
     *
     * @return
     */
    @RequestMapping(value = "/disease/to_redis")
    public String updateToRedid(){
        try{
    public String updateToRedid() {
        try {
            diseaseService.updateToRedis();
            return write(200,"更新成功");
        }catch (Exception e){
            return error(-1,"更新失败");
            return write(200, "更新成功");
        } catch (Exception e) {
            return error(-1, "更新失败");
        }
    }
@ -54,49 +58,82 @@ public class ManagerUtilController extends BaseController{
     * @return
     */
    @RequestMapping(value = "/disease/to_disease")
    public String updateToDisease(){
        try{
    public String updateToDisease() {
        try {
            diseaseService.updateToDisease();
            return write(200,"更新成功");
        }catch (Exception e){
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"更新失败");
            return error(-1, "更新失败");
        }
    }
    /**
     * 查询患者redis疾病
     *
     * @param patient
     * @return
     */
    @RequestMapping(value = "/disease/patient")
    public String getDiseaseFromRedis(String patient){
        try{
            return write(200,"查询成功","data",redisTemplate.opsForValue().get("disease:" + patient));
        }catch (Exception e){
    public String getDiseaseFromRedis(String patient) {
        try {
            return write(200, "查询成功", "data", redisTemplate.opsForValue().get("disease:" + patient));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
    }
    /***********************************************名医咨询相关****************************************/
    /**
     * 开始名医咨询剩余次数统计任务
     *
     * @return
     */
    @RequestMapping(value = "/famous_doctor/start_job")
    public String startConsultTimesJob(){
        try{
            if(!quartzHelper.isExistJob("famous-doctor-times")) {
    public String startConsultTimesJob() {
        try {
            if (!quartzHelper.isExistJob("famous-doctor-times")) {
                quartzHelper.addJob(FamousConsultTimesJob.class, "0 0 0 * * ?", "famous-doctor-times", new HashMap<String, Object>());
                return write(200,"启动成功");
            }else{
                return write(200,"任务已存在");
                return write(200, "启动成功");
            } else {
                return write(200, "任务已存在");
            }
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"启动失败");
            return error(-1, "启动失败");
        }
    }
    /**
     * 名医咨询剩余次数手动更新
     *
     * @return
     */
    @RequestMapping(value = "/famous_doctor/times_update")
    public String famousConsultTimeUpdate(){
        try{
    public String famousConsultTimeUpdate() {
        try {
            workTimeService.consultTimesRemain(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
            return write(200,"更新成功");
        }catch (Exception e){
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "更新失败");
        }
    }
    /*********************************************统计相关*******************************************/
    /**
     * 更新人口数据到redis
     *
     * @return
     */
    public String peopleNumToRedis() {
        try {
            statisticsService.peopleNumToRedis();
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"更新失败");
            return error(-1, "更新失败");
        }
    }
}

+ 82 - 40
src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -155,7 +155,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param group      患者组 1是健康人群组 2是慢病  3是65岁以上人群
     * @param emerMobile 应急人手机号
     * @param images     图片URL,多图以逗号分隔
     * @param expenses     签约费用
     * @param expenses   签约费用
     * @return
     */
    @RequestMapping(value = "agent")
@ -163,7 +163,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    public String agent(
            String name,
            String idcard,
            @RequestParam(required = false)String ssc,
            @RequestParam(required = false) String ssc,
            String mobile,
            @RequestParam(required = false, defaultValue = "") String disease,
            @RequestParam(required = false) String emerMobile,
@ -172,7 +172,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            String healthDoctor,
            String healthDoctorName,
            String images,
            @RequestParam(required = false,defaultValue = "0") String expenses,
            @RequestParam(required = false, defaultValue = "0") String expenses,
            String doctor,//全科医生code
            String doctorName,//全科医生名字
            String signDoctorCode,//簽約人code
@ -216,7 +216,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "身份证号不允许为空!");
            }
            if(StringUtils.isEmpty(ssc)){
            if (StringUtils.isEmpty(ssc)) {
                return error(-1, "社保卡号不允许为空!");
            }
            if (StringUtils.isEmpty(mobile)) {
@ -236,7 +236,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            Doctor cDoctor = doctorService.findDoctorByCode(getUID());
            SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
                    healthDoctor, healthDoctorName, majorDoctor, majorDoctorName, cDoctor.getHospital(), cDoctor.getHosptialName(),
                    idcard, ssc, mobile, emerMobile, images, disease,expenses,signDoctorCode,signDoctorName,signDoctorLevel,group);
                    idcard, ssc, mobile, emerMobile, images, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, group);
            if (sf == null) {
                return error(-1, "代理签约失败!");
@ -257,7 +257,6 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param healthDoctorName 健康管理师姓名
     * @param majorDoctor      专科医生标识
     * @param disease          疾病code
     * @param majorhDoctorName 专科医生姓名
     * @param msgid            消息id
     * @param patientIDcard    患者身份证
     * @param type             处理类型:1同意,2拒绝
@ -275,10 +274,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            @RequestParam(required = false) String majorDoctorName,
            long msgid,
            String patientIDcard,
            int type,String group,
            @RequestParam(required = false,defaultValue = "0") String expenses) {
            int type, String group,
            @RequestParam(required = false, defaultValue = "0") String expenses) {
        try {
            int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type, disease, majorDoctor, majorDoctorName,group,expenses);
            int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type, disease, majorDoctor, majorDoctorName, group, expenses);
            if (res == -1) {
                return error(-1, "未知的处理类型!");
            } else if (res == 0) {
@ -454,17 +453,17 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "patient_sanshi_signinfo")
    @ResponseBody
    public String getPatientSanshiSignByIdCard(String idCard){
        try{
            if(StringUtils.isEmpty(idCard)){
                return error(-1,"请输入身份证号!");
    public String getPatientSanshiSignByIdCard(String idCard) {
        try {
            if (StringUtils.isEmpty(idCard)) {
                return error(-1, "请输入身份证号!");
            }
            JSONObject result = familyContractService.getSanshiSingInfoByPatientIdCard(idCard);
            return write(200,"查询成功!","data",result);
        }catch (Exception e){
            return error(-1,"查询失败!");
            return write(200, "查询成功!", "data", result);
        } catch (Exception e) {
            return error(-1, "查询失败!");
        }
    }
@ -472,28 +471,38 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * 更新患者签约补贴类型
     *
     * @param expensesType 补贴类型
     * @param patient 患者
     * @param patient      患者
     * @return
     */
    @RequestMapping(value = "/expenses_type_update")
    @ResponseBody
    public String updateExpensesType(String expensesType,String patient){
        try{
            if(StringUtils.isEmpty(expensesType)){
                return error(-1,"补贴类型不能为空");
    public String updateExpensesType(String expensesType, String patient) {
        try {
            if (StringUtils.isEmpty(expensesType)) {
                return error(-1, "补贴类型不能为空");
            }
            if(StringUtils.isEmpty(patient)){
                return error(-1,"患者不能为空");
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "患者不能为空");
            }
            if(familyContractService.updateExpensesType(expensesType,patient)){
                return write(200,"更新成功");
            }else{
                return write(-1,"不存在该患者签约");
            SignFamily familySign = familyContractService.findByPatient(patient);
            if (familySign == null) {
                return error(-1, "居民家庭签约不存在");
            } else {
                if (StringUtils.isNotEmpty(familySign.getMedicalInsuranceNum())) {
                    return error(-1, "数据已上传社保,不能修改补贴类型");
                }
            }
            if (familyContractService.updateExpensesType(expensesType, patient)) {
                return write(200, "更新成功");
            } else {
                return write(-1, "不存在该患者签约");
            }
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"更新失败");
            return error(-1, "更新失败");
        }
    }
@ -505,8 +514,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/patient_signing")
    @ResponseBody
    public String getSigningPatientInfo(String patient){
        try{
    public String getSigningPatientInfo(String patient) {
        try {
            Patient temp = patientInfoService.findByCode(patient);
            if (temp != null) {
                JSONObject json = new JSONObject();
@ -541,20 +550,20 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                json.put("ssc", temp.getSsc());
                String diseases = redisTemplate.opsForValue().get("disease:" + patient);
                if(!StringUtils.isEmpty(diseases)){
                    json.put("diseases",new JSONArray(diseases));
                }else{
                    json.put("diseases","");
                if (!StringUtils.isEmpty(diseases)) {
                    json.put("diseases", new JSONArray(diseases));
                } else {
                    json.put("diseases", "");
                }
                SignFamily jtSign = familyContractService.findSigningByPatient(patient);
                // 家庭签约
                if(jtSign != null){
                if (jtSign != null) {
                    json.put("applySurrDate", jtSign.getPatientApplyUnsignDate());
                    json.put("applyDate", jtSign.getPatientApplyDate());
                    json.put("jtSign",new JSONObject(jtSign));
                }else{
                    json.put("jtSign", new JSONObject(jtSign));
                } else {
                    throw new Exception("未找到患者待家庭签约的数据");
                }
@ -562,9 +571,42 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            } else {
                return error(-1, "患者信息查询失败!");
            }
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "患者信息查询失败");
        }
    }
    /**
     * 获取家庭签约社保流水号
     *
     * @param patient
     * @return
     */
    @RequestMapping(value = "/medical_insurance_num")
    @ResponseBody
    public String getMedicalInsuranceNum(String patient) {
        try {
            JSONObject json = new JSONObject();
            SignFamily familySign = familyContractService.findByPatient(patient);
            if (familySign != null) {
                if (StringUtils.isNotEmpty(familySign.getMedicalInsuranceNum())) {
                    json.put("status", 1); // 已上传社保
                    json.put("medicalInsuranceNum", familySign.getMedicalInsuranceNum());
                } else {
                    json.put("status", 0);
                    json.put("medicalInsuranceNum", "");
                }
            } else {
                json.put("status", -1); // 没有家庭签约
                json.put("medicalInsuranceNum", "");
            }
            return write(200, "查询成功", "data", json);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"患者信息查询失败");
            return error(-1, "查询失败");
        }
    }
}