wujunjie 7 年 前
コミット
b3e75dc7c2

+ 37 - 32
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java

@ -56,6 +56,8 @@ public class AppealService extends BaseService {
    private String wlyyService;
    @Autowired
    private MessageDao messageDao;
    @Value("${image.imgUrlDomain}")
    private String imgUrlDomain;
    /**
     * 分页查找问题
@ -77,13 +79,13 @@ public class AppealService extends BaseService {
        PageRequest pageRequest = new PageRequest(page - 1, rows, sort);
        // 设置查询条件
        Map<String, SearchFilter> filters = new HashMap<>();
        if (type != -1) {
        if (type!=-1){
            filters.put("type", new SearchFilter("type", SearchFilter.Operator.EQ, type));
        }
        if (identity != -1) {
        if (identity!=-1){
            filters.put("identity", new SearchFilter("identity", SearchFilter.Operator.EQ, identity));
        }
        if (status != -1) {
        if (status!=-1){
            filters.put("status", new SearchFilter("status", SearchFilter.Operator.EQ, status));
        }
        // 未删除
@ -93,6 +95,7 @@ public class AppealService extends BaseService {
    }
    /**
     * 根据类型、身份、状态查询申诉列表
     *
@ -143,10 +146,10 @@ public class AppealService extends BaseService {
        int status = appeal.getStatus();
//        identity 1、患者 2、医生
        String name = null;
        if (StringUtils.isNotBlank(creater)) {
        if(StringUtils.isNotBlank(creater)){
            if (identity == 1) {
                name = patientDao.findNameByCode(creater);
            } else {
            }else{
                Doctor doctor = doctorDao.findByCode(creater);
                name = doctor.getName();
            }
@ -161,22 +164,23 @@ public class AppealService extends BaseService {
        map.put("idcard", appeal.getIdcard());
        map.put("images", images);
        map.put("result", result);
        if (status == 0) {
            appealDao.modifyAppealStatus(id, 1);
        map.put("imgUrlDomain", imgUrlDomain);
        if (status == 0){
            appealDao.modifyAppealStatus(id,1);
        }
        return map;
    }
    //根据申诉ID保存处理结果,并更改状态
    public void saveAppealResult(long id, String result) throws Exception {
        appealDao.modifyAppealResult(id, result);
        appealDao.modifyAppealStatus(id, 2);
        appealDao.modifyAppealResult(id,result);
        appealDao.modifyAppealStatus(id,2);
    }
    public void delappeal(String ids) {
        if (ids != null) {
        if(ids!=null){
            String[] _ids = ids.split(",");
            for (String id : _ids) {
            for(String id:_ids){
                Long _id = Long.valueOf(id);
                appealDao.delAppeal(_id);
            }
@ -190,7 +194,7 @@ public class AppealService extends BaseService {
     * @throws Exception
     */
    @Transactional
    public void dealAppeal(Long id, String result) throws Exception {
    public void dealAppeal(Long id,String result) throws Exception {
        Appeal appeal = appealDao.findFeedbackById(id);
        appeal.setResult(result);
        appeal.setStatus(2);
@ -211,26 +215,27 @@ public class AppealService extends BaseService {
            msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
            JSONObject json = smsService.sendMsg(appeal.getPhone(), msgContent.toString());
            SMS sms = new SMS();
            Date date = new Date();
            // 延后5分钟
            sms.setContent(msgContent.toString());
            sms.setDeadline(date);
            sms.setCzrq(date);
            sms.setMobile(appeal.getPhone());
            sms.setIp("127.0.0.1");
            sms.setType(11);
            sms.setStatus(1);
        SMS sms = new SMS();
        Date date = new Date();
        // 延后5分钟
        sms.setContent(msgContent.toString());
        sms.setDeadline(date);
        sms.setCzrq(date);
        sms.setMobile(appeal.getPhone());
        sms.setIp("127.0.0.1");
        sms.setType(11);
        sms.setStatus(1);
        sms.setCaptcha("");
        smsDao.save(sms);
        if (json == null) {
            // 发送失败
            logger.error("申诉处理完成:短信发送失败");
        } else if (json.getInt("result") != 0) {
            logger.error("申诉处理完成:短信发送失败"+json.getString("description"));
        } else {
            //发送成功,保存到数据库
            smsDao.save(sms);
            if (json == null) {
                // 发送失败
                logger.error("申诉处理完成:短信发送失败");
            } else if (json.getInt("result") != 0) {
                logger.error("申诉处理完成:短信发送失败" + json.getString("description"));
            } else {
                //发送成功,保存到数据库
                smsDao.save(sms);
            }
        }
            if (appeal.getIdentity() == 2) {
                String creater = appeal.getCreater();
@ -266,4 +271,4 @@ public class AppealService extends BaseService {
            e.printStackTrace();
        }
    }
}
}