Browse Source

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

LiTaohong 6 years ago
parent
commit
e15604fa88

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -270,6 +270,7 @@ public class BaseRequestMapping {
     */
    public static class BasePatient extends Basic {
        public static final String PREFIX  = "/basePatient";
        public static final String getPatientById  = "/getPatientById";
    }
    /**

+ 10 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java

@ -16,6 +16,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -69,6 +70,15 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
        return success(basePatient, BasePatientVO.class);
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.getPatientById)
    @ApiOperation(value = "获取列表")
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
            @RequestParam(value = "id", required = true) String id) throws Exception {
        Map<String,Object> basePatients = basePatientService.getPatientInfo(id);
        return success(basePatients.toString());
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<BasePatientVO> page(

+ 27 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/BasePatientService.java

@ -1,9 +1,18 @@
package com.yihu.jw.base.service.patient;
import com.yihu.jw.base.dao.patient.BasePatientDao;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import org.springframework.util.CollectionUtils;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 
@ -19,4 +28,22 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
 */
@Service
public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatientDao> {
    /**
     * 居民id
     * @param patientId
     * @return
     */
    public Map<String,Object> getPatientInfo(String patientId) throws Exception{
        Map<String,Object> resultMap = new HashMap<>();
        if(StringUtils.isEmpty(patientId)){
            return resultMap;
        }
        List<BasePatientDO> patientDOList = this.findByField("id",patientId);
        if(CollectionUtils.isEmpty(patientDOList)){
            return resultMap;
        }
        resultMap = JavaBeanUtils.bean2Map(patientDOList.get(0));
        return resultMap;
    }
}