Selaa lähdekoodia

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 vuotta sitten
vanhempi
commit
3b74d27f74

+ 27 - 11
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -8,6 +8,8 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.sound.sampled.Mixer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -50,6 +53,8 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
@ -81,7 +86,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
     * @param sorts
     * @return
     */
    public List<Map<String,Object>> queryPatientBaseInfo(String nameOrIdcard,int page,int size,String sorts)throws Exception{
    public MixEnvelop queryPatientBaseInfo(String nameOrIdcard, int page, int size, String sorts)throws Exception{
        List<Map<String, Object>> result = new ArrayList<>();
        String param = null == nameOrIdcard ? "": nameOrIdcard;
        String sql = "SELECT\n" +
@ -96,23 +101,34 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
                "ELSE\n" +
                "\t'未知'\n" +
                "END AS \"sex\",\n" +
                " phone AS \"phone\",\n" +
                " mobile AS \"phone\",\n" +
                " committee_name AS \"committeeName\",\n" +
                " province_name || city_name || town_name || street_name AS \"address\"\n" +
                " province_name AS \"provinceName\"," +
                " city_name AS \"cityName\", " +
                "town_name AS \"townName\"," +
                " street_name \"streetName\"," +
                " address AS \"address\"\n" +
                "FROM\n" +
                "\tbase_patient\n" +
                "WHERE\n" +
                "\tNAME LIKE '%%'\n" +
                "OR idcard LIKE '%%'\n" +
                "ORDER BY\n" +
                "\tbase_patient\n";
        if (StringUtils.isNotEmpty(nameOrIdcard)){
            sql+="WHERE\n" +
                    "\tNAME LIKE '%"+nameOrIdcard+"%'\n" +
                    "OR idcard LIKE '%"+nameOrIdcard+"%'\n";
        }
        sql+="ORDER BY\n" +
                "\tcreate_time DESC";
        String countSql = "select count(id) from base_patient where name like '%" + param + "%' or idcard like '%" + param + "%'";
        Long count  = jdbcTemplate.queryForObject(countSql,Long.class);
        if(count <= 0){
            return result;
            return null;
        }
        result = jdbcTemplate.queryForList(sql);
        return result;
        MixEnvelop envelop = new MixEnvelop();
        result = hibenateUtils.createSQLQuery(sql,page,size);
        envelop.setDetailModelList(result);
        envelop.setTotalCount(count.intValue());
        envelop.setCurrPage(page);
        envelop.setPageSize(size);
        return envelop;
    }
    /**

+ 4 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java

@ -5,6 +5,7 @@ import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
@ -113,7 +114,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.BasePatient.getBaseInfo)
    @ApiOperation(value = "获取居民基础信息列表")
    public ListEnvelop queryPatientBaseInfo(
    public MixEnvelop queryPatientBaseInfo(
            @ApiParam(name = "nameOrIdcard", value = "居民姓名或身份证")
            @RequestParam(value = "nameOrIdcard", required = false) String nameOrIdcard,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
@ -123,7 +124,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<Map<String,Object>> basePatients = basePatientService.queryPatientBaseInfo(nameOrIdcard, page,size,sorts);
        return success(basePatients);
        return basePatientService.queryPatientBaseInfo(nameOrIdcard, page,size,sorts);
    }
}

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

@ -195,6 +195,7 @@ public class QrcodeService {
                        System.out.println("rs"+rs);
                        com.alibaba.fastjson.JSONObject rsJson = JSON.parseObject(rs);
                        uploadVO = objectMapper.readValue(rsJson.getJSONObject("obj").toJSONString(),UploadVO.class);
                        inputStream.close();
                    }else {
                        // 上传服务器
@ -204,7 +205,7 @@ public class QrcodeService {
                    return uploadVO.getFullUri();
                } else {
                    throw new Exception("请求微信生成二维码失败!");
                }
            }
            } else {
                throw new Exception("请求微信生成二维码失败!");
            }