浏览代码

代码修改

yeshijie 7 年之前
父节点
当前提交
fffaf5e490

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -69,7 +69,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    @Query("update Message a set a.prescriptionStatus=?2 where a.relationCode = ?1 and a.type=?3 ")
    int updatePreScriptionMessage(String relateCode,String prescriptionStatus,Integer type);
    int updatePreScriptionMessage(String relationCode,String prescriptionStatus,Integer type);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.type = ?2")
    @Modifying

+ 40 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionAdjustService.java

@ -118,6 +118,7 @@ public class PrescriptionAdjustService extends BaseService {
     * 上传ca认证信息
     * @param code
     */
    @Transactional
    public JSONObject uploadCaDigital(String code){
        JSONObject re = new JSONObject();
        Prescription prescription = prescriptionDao.findByCode(code);
@ -130,36 +131,45 @@ public class PrescriptionAdjustService extends BaseService {
                if("1".equals(zyCode)){
                    JSONArray returnData = data.getJSONArray("returnData");
                    if(returnData.size()>0){
                        JSONObject pre = returnData.getJSONArray(0).getJSONObject(0);
                        //认证成功-审核完成
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
                        //设置审核通过
                        PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
                        reviewed.setStatus(1);
                        reviewed.setReviewedTime(new Date());
                        prescriptionDao.save(prescription);
                        //审核通过模板消息
                        prescriptionInfoService.sendRMess(prescription.getCode(), 1);
                        //发送Im消息
                        JSONObject content = new JSONObject();
                        content.put("title", "我已经审核您" + DateUtil.dateToStr(prescription.getCreateTime(), "yyyy-MM-dd") + "发起的续方申请");
                        content.put("result", "审核通过");
                        content.put("reason", "");
                        content.put("url", "");
                        imUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "15", content.toString(), null);
                        //修改系统的续方消息的审核状态
                        messageDao.updatePreScriptionMessage(prescription.getConsult(), "1", 6);
                        //获取智业待结算接口,更新药品金额
                        prescriptionService.getPerscriptionInfoCostFromPayInfo(prescription.getCode());
                        //添加日志
                        prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),1,2);
                        re.put("status",200);
                        //{"status":200,"msg":"CA认证通过接口!","data":"{\"CODE\":\"1\",\"returnData\":[{\"result\":\"True\"}],\"byRefParaData\":[{ \"errorMsg\": \"\" }]}"}
                        JSONObject pre = returnData.getJSONObject(0);
                        if("True".equals(pre.getString("result"))){
                            //认证成功-审核完成
                            prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
                            //设置审核通过
                            PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
                            reviewed.setStatus(1);
                            reviewed.setReviewedTime(new Date());
                            prescriptionDao.save(prescription);
                            //审核通过模板消息
                            prescriptionInfoService.sendRMess(prescription.getCode(), 1);
                            //修改系统的续方消息的审核状态
                            messageDao.updatePreScriptionMessage(prescription.getConsult(), "1", 6);
                            //获取智业待结算接口,更新药品金额
                            prescriptionService.getPerscriptionInfoCostFromPayInfo(prescription.getCode());
                            //添加日志
                            prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),1,2);
                            //发送Im消息
                            JSONObject content = new JSONObject();
                            content.put("title", "我已经审核您" + DateUtil.dateToStr(prescription.getCreateTime(), "yyyy-MM-dd") + "发起的续方申请");
                            content.put("result", "审核通过");
                            content.put("reason", "");
                            content.put("url", "");
                            imUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "15", content.toString(), null);
                            re.put("status",200);
                        }else {
                            //请求失败
                            prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),0,2);
                            JSONArray byRefParaData = data.getJSONArray("byRefParaData");
                            re.put("status",-1);
                            re.put("msg",byRefParaData.getJSONObject(0).getString("errorMsg"));
                        }
                    }else {
                        //请求失败
                        prescriptionLogService.addLog(prescription,PrescriptionLog.PrescriptionLogType.zy.getValue(),0,2);