Browse Source

添加科室疾病首页图标相关接口

humingfen 3 years ago
parent
commit
2696392693

+ 37 - 0
business/base-service/src/main/java/com/yihu/jw/dict/service/DeptHomepageBannerService.java

@ -0,0 +1,37 @@
package com.yihu.jw.dict.service;
import com.yihu.jw.entity.hospital.manage.BaseDeptHomepageBannerDO;
import com.yihu.jw.entity.hospital.manage.BaseDeptHomepageBannerDO;
import com.yihu.jw.hospital.dict.BaseDeptHomepageBannerDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
@Service
public class DeptHomepageBannerService extends BaseJpaService<BaseDeptHomepageBannerDO, BaseDeptHomepageBannerDao> {
    @Autowired
    private BaseDeptHomepageBannerDao deptHomepageBannerDao;
    public BaseDeptHomepageBannerDO updateDeptHomepageBanner(BaseDeptHomepageBannerDO deptHomepageBannerDO) {
        //判断新增或编辑
        if (deptHomepageBannerDO.getId() == null) {
            deptHomepageBannerDO.setCreateTime(new Date());
            deptHomepageBannerDO.setDel(1);
            return deptHomepageBannerDao.save(deptHomepageBannerDO);
        } else {
            BaseDeptHomepageBannerDO oldDeptHomepageBanner = deptHomepageBannerDao.findOne(deptHomepageBannerDO.getId());
            BeanUtils.copyProperties(deptHomepageBannerDO, oldDeptHomepageBanner, getNullPropertyNames(deptHomepageBannerDO));
            return deptHomepageBannerDao.save(oldDeptHomepageBanner);
        }
    }
    public void delDeptHomepageBanner(Integer id) {
        deptHomepageBannerDao.delete(id);
    }
}

+ 14 - 14
business/base-service/src/main/java/com/yihu/jw/dict/service/DiseaseHomepageBannerService.java

@ -19,7 +19,7 @@ public class DiseaseHomepageBannerService extends BaseJpaService<BaseDiseaseHome
    @Autowired
    private BaseDiseaseHomepageBannerDao diseaseHomepageBannerDao;
    public BaseDiseaseHomepageBannerDO createOrUpdate(BaseDiseaseHomepageBannerDO diseaseHomepageBannerDO) {
    public BaseDiseaseHomepageBannerDO updateDiseaseHomepageBanner(BaseDiseaseHomepageBannerDO diseaseHomepageBannerDO) {
        //判断新增或编辑
        if (diseaseHomepageBannerDO.getId() == null) {
            diseaseHomepageBannerDO.setCreateTime(new Date());
@ -36,23 +36,23 @@ public class DiseaseHomepageBannerService extends BaseJpaService<BaseDiseaseHome
        diseaseHomepageBannerDao.delete(id);
    }
    public MixEnvelop getDiseaseHomepageBannerList(String name, String hospital, Integer del, Integer page, Integer pageSize) throws Exception {
    public MixEnvelop findDiseaseHomepageBanner(Integer id, String name, Integer page, Integer pageSize) throws Exception {
        MixEnvelop mixEnvelop = new MixEnvelop();
        String filters = "";
        if (StringUtils.isNotBlank(name)) {
            filters += "name?" + name + ";";
        }
//        if (StringUtils.isNotBlank(number)) {
//            filters += "number?" + number + ";";
//        }
        if (StringUtils.isNotBlank(hospital)) {
            filters += "hospital=" + hospital + ";";
        }
        if (del != null) {
            filters += "del=" + del + ";";
        if (id != null) {
            filters += "id=" + id + ";";
        }else {
            if (StringUtils.isNotBlank(name)) {
                filters += "name?" + name + ";";
            }
        }
        Integer count = this.search(null, filters, null).size();
        List<BaseDiseaseHomepageBannerDO> list = this.search(null, filters, null, page, pageSize);
        List<BaseDiseaseHomepageBannerDO> list;
        if(page!= null && pageSize!=null) {
            list = this.search(null, filters, null, page, pageSize);
        }else {
            list = this.search(null, filters, null);
        }
        mixEnvelop.setMessage("获取成功!");
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/NationalDrugDictService.java

@ -61,7 +61,8 @@ public class NationalDrugDictService extends BaseJpaService<BaseNationalDrugDict
     */
    public MixEnvelop getNationalDrugList(String name, String number, String hospital, Integer status, Integer page, Integer pageSize) throws ParseException {
        MixEnvelop mixEnvelop = new MixEnvelop();
        String sql = "SELECT id,number,name,py_name,common_name,py_common_name,subject_class,subject_class_name,drug_code,drug_name,hospital,hospital_name,relation_code,`status` " +
        String sql = "SELECT id,number,name,py_name as pyName,common_name as commonName,py_common_name as pyCommonName,subject_class as subjectClass,subject_class_name as subjectClassName," +
                "drug_code as drugCode,drug_name as drugName,hospital,hospital_name as hospitalName,relation_code as relationCode,`status` " +
                "FROM `base_national_drug_dict` WHERE 1=1 ";
        if (StringUtils.isNotBlank(name)) {
            sql += "and name like '%" + name + "%' ";

+ 5 - 5
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNationalDrugDictDO.java

@ -40,7 +40,7 @@ public class BaseNationalDrugDictDO extends IntegerIdentityEntity {
    private String medicareSpecifications;//医保规格
    private String medicareUnit;//医保单位
    private String toxicology;//毒理分类
    private String toxicology_name;//毒理分类名称
    private String toxicologyName;//毒理分类名称
    private String prescription;//处方用药
    private String gmp;//gmp药品
    private String antimicrobial;//抗菌药分类id
@ -269,12 +269,12 @@ public class BaseNationalDrugDictDO extends IntegerIdentityEntity {
        this.toxicology = toxicology;
    }
    public String getToxicology_name() {
        return toxicology_name;
    public String getToxicologyName() {
        return toxicologyName;
    }
    public void setToxicology_name(String toxicology_name) {
        this.toxicology_name = toxicology_name;
    public void setToxicologyName(String toxicologyName) {
        this.toxicologyName = toxicologyName;
    }
    public String getPrescription() {

+ 8 - 4
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1463,10 +1463,14 @@ public class BaseHospitalRequestMapping {
        public static final String updateDictGroup = "/updateDictGroup";
        public static final String delDictGroup = "/delDictGroup";
        //系统参数配置
        public static final String getHospitalParameterList = "/getHospitalParameterList";
        public static final String createOrUpdateParameter = "createOrUpdateParameter";
        public static final String delHospitalParameter = "delHospitalParameter";
        //疾病首页标签配置
        public static final String findDiseaseHomepageBanner = "/findDiseaseHomepageBanner";
        public static final String updateDiseaseHomepageBanner = "/updateDiseaseHomepageBanner";
        public static final String delDiseaseHomepageBanner = "/delDiseaseHomepageBanner";
        //科室首页标签配置
        public static final String findDeptHomepageBanner = "/findDeptHomepageBanner";
        public static final String updateDeptHomepageBanner = "/updateDeptHomepageBanner";
        public static final String delDeptHomepageBanner = "/delDeptHomepageBanner";
    }
    /**

+ 37 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/DeptHomepageBannerEndpoint.java

@ -0,0 +1,37 @@
package com.yihu.jw.hospital.endpoint.dict;
import com.yihu.jw.dict.service.DeptHomepageBannerService;
import com.yihu.jw.entity.hospital.manage.BaseDeptHomepageBannerDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.PatientNoLogin.PREFIX)
@Api(value = "科室首页图标管理",tags = "科室首页图标")
public class DeptHomepageBannerEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DeptHomepageBannerService deptHomepageBannerService;
    @ApiOperation("删除疾病首页图标")
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.delDeptHomepageBanner)
    public Envelop delDeptHomepageBanner(@ApiParam(name = "id", value = "id", required = true)
                                            @RequestParam(value = "id", required = true) Integer id) {
        deptHomepageBannerService.delDeptHomepageBanner(id);
        return success();
    }
    @ApiOperation("新增/修改疾病首页图标")
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.updateDeptHomepageBanner)
    public Envelop updateDeptHomepageBanner(@ApiParam(name = "json", value = "json", required = true)
                                               @RequestParam(value = "json", required = true) String json) throws Exception {
        BaseDeptHomepageBannerDO deptHomepageBannerDO = objectMapper.readValue(json, BaseDeptHomepageBannerDO.class);
        return success(deptHomepageBannerService.updateDeptHomepageBanner(deptHomepageBannerDO));
    }
}

+ 52 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/DiseaseHomepageBannerEndPoint.java

@ -0,0 +1,52 @@
package com.yihu.jw.hospital.endpoint.dict;
import com.yihu.jw.dict.service.DiseaseHomepageBannerService;
import com.yihu.jw.entity.hospital.manage.BaseDiseaseHomepageBannerDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.PatientNoLogin.PREFIX)
@Api(value = "疾病首页图标管理",tags = "疾病首页图标管理")
public class DiseaseHomepageBannerEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private DiseaseHomepageBannerService diseaseHomepageBannerService;
    @ApiOperation("查询疾病首页图标")
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDiseaseHomepageBanner)
    public MixEnvelop findDiseaseHomepageBanner(@ApiParam(name = "id", value = "id", required = false)
                                                 @RequestParam(value = "id", required = false) Integer id,
                                                @ApiParam(name = "name", value = "name", required = false)
                                                 @RequestParam(value = "name", required = false) String name,
                                                @ApiParam(name = "page", value = "page", required = false)
                                                 @RequestParam(value = "page", required = false) Integer page,
                                                @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                                 @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        return diseaseHomepageBannerService.findDiseaseHomepageBanner(id, name, page, pageSize);
    }
    @ApiOperation("删除疾病首页图标")
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.delDiseaseHomepageBanner)
    public Envelop delDiseaseHomepageBanner(@ApiParam(name = "id", value = "id", required = true)
                           @RequestParam(value = "id", required = true) Integer id) {
        diseaseHomepageBannerService.delDiseaseHomepageBanner(id);
        return success();
    }
    @ApiOperation("新增/修改疾病首页图标")
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.updateDiseaseHomepageBanner)
    public Envelop updateDiseaseHomepageBanner(@ApiParam(name = "json", value = "json", required = true)
                                      @RequestParam(value = "json", required = true) String json) throws Exception {
        BaseDiseaseHomepageBannerDO diseaseHomepageBannerDO = objectMapper.readValue(json, BaseDiseaseHomepageBannerDO.class);
        return success(diseaseHomepageBannerService.updateDiseaseHomepageBanner(diseaseHomepageBannerDO));
    }
}