suqinyi před 3 měsíci
rodič
revize
f1331585d0

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/article/service/KnowledgeArticleDictService.java

@ -705,7 +705,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
    public HashMap<String, Object> findSendPatientList(String doctorCode, String patientCode, String sendType, int page, int pageSize) {
        String sql = " SELECT DISTINCT \n" +
                " b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName'," +
                " c.fabulous 'userFabulous',\tc.is_read 'userIsRead',\tc.is_share 'userShare',\tc.collection 'userCollection'," +
                " c.fabulous 'userFabulous', c.is_read 'userIsRead',c.is_share 'userShare',c.collection 'userCollection'," +
                " a.* \n" +
                " FROM wlyy_knowledge_article_dict a " +
                " INNER JOIN base_patient_business b ON a.id=b.relation_code" +

+ 0 - 18
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/article/ArticleEndpoint.java

@ -301,24 +301,6 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    }
    /**
     * 查询文章发送记录
     * BasePatientBusinessDO
     */
    @PostMapping(value = "/findSendPatientList")
    @ApiOperation(value = "查询文章发送记录-发送文章/问卷")
    public ObjEnvelop findSendPatientList(
            @ApiParam(name = "doctorCode", value = "医生") @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "patientCode", value = "居民code") @RequestParam(value = "patientCode", required = false) String patientCode,
            @ApiParam(name = "sendType", value = "发送类型") @RequestParam(value = "sendType", required = false) String sendType,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
        HashMap<String, Object> result = knowledgeArticleDictService.findSendPatientList(doctorCode,patientCode, sendType, page, pageSize);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(result);
        return objEnvelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.sendPatientBusiness)

+ 21 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.article.dao.KnowledgeArticleDao;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.article.service.KnowledgeArticleDictService;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
@ -302,6 +303,26 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询文章发送记录
     * BasePatientBusinessDO
     */
    @PostMapping(value = "/findSendPatientList")
    @ApiOperation(value = "查询文章发送记录-发送文章/问卷")
    public ObjEnvelop findSendPatientList(
            @ApiParam(name = "doctorCode", value = "医生") @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "patientCode", value = "居民code") @RequestParam(value = "patientCode", required = false) String patientCode,
            @ApiParam(name = "sendType", value = "发送类型") @RequestParam(value = "sendType", required = false) String sendType,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
        HashMap<String, Object> result = knowledgeArticleService.findSendPatientList(doctorCode,patientCode, sendType, page, pageSize);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(result);
        return objEnvelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.sendPatientBusiness)
    @ApiOperation(value = "发送文章/问卷")

+ 28 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -468,4 +468,32 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        return result;
    }
    /**
     * 业务类型1、文章2、问卷   relationType
     */
    public HashMap<String, Object> findSendPatientList(String doctorCode, String patientCode, String sendType, int page, int pageSize) {
        String sql = " SELECT DISTINCT \n" +
                " b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName'," +
                " c.fabulous 'userFabulous', c.is_read 'userIsRead',c.is_share 'userShare',c.collection 'userCollection'," +
                " a.* \n" +
                " FROM wlyy_knowledge_article_dict a " +
                " INNER JOIN base_patient_business b ON a.id=b.relation_code" +
                " LEFT JOIN  wlyy_knowledge_article_user c ON a.id=c.relation_code \n" +
                " WHERE 1=1 AND b.relation_type='" + sendType + "' ";
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.doctor='" + doctorCode + "' ";
        }
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.patient='" + patientCode + "' ";
        }
        String countSql = " slect count(1) from (" + sql + ") qqq";
        sql += " order by create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
        List<BasePatientBusinessDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientBusinessDO.class));
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("data", list);
        resultMap.put("count", count);
        return resultMap;
    }
}