Ver código fonte

代码修改

suqinyi 3 meses atrás
pai
commit
72079fe134

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/article/KnowledgeArticleUserDO.java

@ -19,7 +19,7 @@ public class KnowledgeArticleUserDO extends UuidIdentityEntityWithOperator {
	private String user;//用户code
	private String userName;//用户名称
	private String relationCode;//文章code或者问卷code
	private Integer relationType;//1文章2问卷
	private Integer relationType;//1、文章 2、问卷  3、指导  4、im咨询
	private String relationName;//文章名称
	private Integer fabulous;//1已赞0未赞
	private Integer isRead;//1已读0未读

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

@ -324,6 +324,47 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
        }
    }
    /**
     * 医生把文章推送给居民
     * [
     *   {"user": "用户code"},
     *   {"userName": "用户名称"},
     *   {"relationCode": "文章code或者问卷code"},
     *   {"relationType": "1、文章 2、问卷  3、指导  4、im咨询"},
     *   {"relationName": "文章名称"},
     *   {"fabulous": "1已赞0未赞"},
     *   {"isRead": "1已读0未读"},
     *   {"share": "1已分享0未分享"},
     *   {"collection": "是否收藏1是0否"},
     *   {"used": "1常用0不常用"},
     *   {"del": "是否删除,1正常,0删除"}
     * ]
     */
    @PostMapping(value = "/sendArticleToUser")
    @ApiOperation(value = "发送文章/问卷")
    public ListEnvelop sendArticleToUser(
            @ApiParam(name = "json", value = "发送文章/问卷") @RequestParam(value = "json", required = false) String json
    ) throws Exception {
        try {
            System.out.println("sendArticleToUser==>"+json);
            JSONArray jsonArray = JSONArray.parseArray(json);
            List<KnowledgeArticleUserDO> knowledgeArticleUserDOList = new ArrayList<>();
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                KnowledgeArticleUserDO entity = toEntity(jsonObject.toJSONString(), KnowledgeArticleUserDO.class);
                knowledgeArticleUserDOList.add(entity);
            }
            List<KnowledgeArticleUserDO> list=  knowledgeArticleUserService.sendArticleToUser(knowledgeArticleUserDOList);
            ListEnvelop listEnvelop = new ListEnvelop();
            listEnvelop.setDetailModelList(list);
            return listEnvelop;
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setArticleUsed)
    @ApiOperation(value = "设置文章为常用/不常用")
    public ObjEnvelop setArticleUsed(
@ -339,6 +380,8 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchPatientArticle)
    @ApiOperation(value = "获取患者文章列表")
    public Envelop searchPatientArticle(

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

@ -258,7 +258,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        if (businessDOS != null && businessDOS.size() != 0) {
            for (BasePatientBusinessDO patientBusinessDO : businessDOS) {
//                BasePatientBusinessDO basePatientBusinessDO = patientBusinessDao.findByPatientAndRelationCodeAndDel(patientBusinessDO.getPatient(), patientBusinessDO.getRelationCode());
                //这边要改成能发多次
//                //这边要改成能发多次
//                if (basePatientBusinessDO != null) {
//                    throw new Exception("已发送过!");
//                }

+ 18 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleUserService.java

@ -3,18 +3,34 @@ package com.yihu.jw.hospital.service.consult;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * 健康文章中间表层代码
 *
 * @author
 * @date
 */
@Service
public class KnowledgeArticleUserService extends BaseJpaService<KnowledgeArticleUserDO, KnowledgeArticleUserDao> {
	
    @Autowired
    private KnowledgeArticleUserDao knowledgeArticleUserDao;
    public List<KnowledgeArticleUserDO> sendArticleToUser(List<KnowledgeArticleUserDO> knowledgeArticleUserDOList) {
        ArrayList<KnowledgeArticleUserDO> list = new ArrayList<>();
        if (knowledgeArticleUserDOList != null && knowledgeArticleUserDOList.size() > 0) {
            for (KnowledgeArticleUserDO articleUserDO : knowledgeArticleUserDOList) {
                KnowledgeArticleUserDO userDO = knowledgeArticleUserDao.save(articleUserDO);
                list.add(userDO);
            }
        }
        System.out.println("保存数量==>"+list.size());
        return list;
    }
}

+ 1 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/template/controller/DoctorGuidanceTempController.java

@ -186,6 +186,7 @@ public class DoctorGuidanceTempController extends BaseController {
            @RequestParam(defaultValue = "1") @ApiParam(value = "当前页码") String pageNo
    ) {
        try {
            System.out.println("查询指导模板=>doctorCode=>"+doctorCode+" templeteName=>"+templeteName);
            Map<String, Object> result = guidanceTempService.list(doctorCode, templeteName, Integer.parseInt(pageSize), Integer.parseInt(pageNo));
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {

+ 1 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/template/service/DoctorGuidanceTempService.java

@ -210,6 +210,7 @@ public class DoctorGuidanceTempService {
        detailSql += sql + limitSql;
        countSql += sql;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(detailSql);
        System.out.println("detailSql=>"+detailSql+"  list.size()=>"+list.size());
        Integer integer = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("data",list);