Jelajahi Sumber

分配健管师接口添加

lyr 8 tahun lalu
induk
melakukan
6db27c451e

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

@ -1664,7 +1664,7 @@ public class FamilyContractService extends BaseService {
        if(signFamily == null){
            result.put("status",-1);
            result.put("msg","患者不存在家庭签约");
            result.put("msg","居民不存在家庭签约");
        }
        if(doctor == null){
            result.put("status",-2);

+ 30 - 8
src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -688,20 +688,42 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param healthDoctor 健康管理师code
     * @return
     */
    @RequestMapping(value = "/patient_health_doctor")
    @RequestMapping(value = "/sign_info_update")
    @ResponseBody
    public String setHealthDoctor(String patient,String healthDoctor){
    public String setHealthDoctor(String patient,@RequestParam(required = false) String healthDoctor
            ,@RequestParam(required = false)String expensesType){
        try{
            JSONObject result = familyContractService.updateHealthDoctor(patient,healthDoctor);
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "患者不能为空");
            }
            if(StringUtils.isNotEmpty(healthDoctor)) {
                JSONObject result = familyContractService.updateHealthDoctor(patient, healthDoctor);
            if(result.getInt("status") == 1){
                return write(200,"分配健管师成功");
            }else{
                return error(-1,result.getString("msg"));
                if (result.getInt("status") != 1) {
                    return error(-1, result.getString("msg"));
                }
            }
            if(StringUtils.isNotEmpty(expensesType)){
                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 error(-1, "更新失败");
                }
            }
            return write(200,"更新成功");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"分配健管师失败");
            return error(-1,"更新失败");
        }
    }
}