소스 검색

控制器RequestBody休正为RequestParam

LiTaohong 6 년 전
부모
커밋
23677bf342

+ 7 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java

@ -42,7 +42,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "创建")
    public ObjEnvelop<BaseDoctorVO> create(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
        BaseDoctorDO baseDoctor = toEntity(jsonData, BaseDoctorDO.class);
        baseDoctor = baseDoctorService.save(baseDoctor);
        return success(baseDoctor, BaseDoctorVO.class);
@ -61,7 +61,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseDoctorVO> update(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
        BaseDoctorDO baseDoctor = toEntity(jsonData, BaseDoctorDO.class);
        if (null == baseDoctor.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
@ -119,7 +119,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
        return success(map.toString());
    }
 /**
    /*
     * 医生信息(基本信息 + 医院执业信息)列表
     * @param name
     * @param idcard
@ -128,7 +128,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
  /*  @PostMapping(value = BaseRequestMapping.BaseDoctor.docFullInfo)
    @PostMapping(value = BaseRequestMapping.BaseDoctor.docFullInfo)
    @ApiOperation(value = "获取列表")
    public Envelop getDoctorFullInfolist(
            @ApiParam(name = "name", value = "医生姓名")
@ -150,17 +150,17 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    }
    *//**
    /**
     * 获取医生 所属机构/部门/职称/职务 树形结构数据
     * @return
     * @throws Exception
     *//*
     */
    @PostMapping(value = BaseRequestMapping.BaseDoctor.docOrgTreeInfo)
    @ApiOperation(value = "获取医生所属机构树形结构数据")
    public Envelop getDoctorOrgTree() throws Exception {
        String data = baseDoctorService.getOrgTree();
        return success(data);
    }*/
    }
}

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/org/BaseOrgEndpoint.java

@ -45,7 +45,7 @@ public class BaseOrgEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "创建")
    public Envelop create(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        BaseOrgDO baseOrg = toEntity(jsonObject.getJSONObject("org").toJSONString(), BaseOrgDO.class);
        String  msg = baseOrgService.createOrUpdateOrg(baseOrg,jsonObject.getJSONObject("admin"));
@ -68,7 +68,7 @@ public class BaseOrgEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseOrgVO> update(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
        BaseOrgDO baseOrg = toEntity(jsonData, BaseOrgDO.class);
        if (null == baseOrg.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);

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

@ -44,7 +44,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "创建")
    public Envelop create(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
       String msg = basePatientService.createPatient(jsonData);
       if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
           return success(msg);
@ -65,7 +65,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "更新")
    public ObjEnvelop<BasePatientVO> update(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
            @RequestParam String jsonData) throws Exception {
        BasePatientDO basePatient = toEntity(jsonData, BasePatientDO.class);
        if (null == basePatient.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/team/BaseTeamEndpoint.java

@ -44,7 +44,7 @@ private BaseTeamService baseTeamService;
@ApiOperation(value = "创建")
public Envelop create (
    @ApiParam(name = "json_data", value = "Json数据", required = true)
    @RequestBody String jsonData) throws Exception {
    @RequestParam String jsonData) throws Exception {
    String msg = baseTeamService.createTeam(jsonData);
    if(StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
        return success(msg);
@ -65,7 +65,7 @@ public Envelop create (
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseTeamVO> update (
        @ApiParam(name = "json_data", value = "Json数据", required = true)
        @RequestBody String jsonData) throws Exception {
        @RequestParam String jsonData) throws Exception {
        BaseTeamDO baseTeam = toEntity(jsonData, BaseTeamDO.class);
        if (null == baseTeam.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);

+ 7 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.doctor.BaseDoctorDao;
//import com.yihu.jw.base.dao.org.OrgTreeDao;
import com.yihu.jw.base.dao.org.OrgTreeDao;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
@ -47,8 +48,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    @Autowired
    private JdbcTemplate jdbcTemplate;
/*    @Autowired
    private OrgTreeDao orgTreeDao;*/
    @Autowired
    private OrgTreeDao orgTreeDao;
    /**
@ -91,7 +92,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param docStatus
     * @return
     */
    /*public List<Map<String,Object>> getDoctorFullInfo(String name,String idcard,String orgCode,String docStatus){
    public List<Map<String,Object>> getDoctorFullInfo(String name,String idcard,String orgCode,String docStatus){
        List<Map<String,Object>> result = new ArrayList<>();
        StringBuilder sql = new StringBuilder();
        sql.append("select doc.id,doc.name,doc.idcard,case doc.sex when 1 then '男' when 2 then '女' else '未知' end as sex,doc.del as status,hos.hosp_name,hos.dept_name,hos.role_name,hos.job_title_name from base_doctor doc,base_doctor_hospital hos where doc.id = hos.doctor_code and hos.del = 1");
@ -123,10 +124,10 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    }
    *//**
    /**
     * 构建机构区域树形结构
     * @return
     *//*
     */
    public String getOrgTree(){
        List<TreeNode> treeNodes = new ArrayList<>();
@ -138,5 +139,5 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        filter.getExcludes().add("allChildren");
        return JSONObject.toJSONString(treeNode, filter);
    }*/
    }
}