LAPTOP-KB9HII50\70708 2 vuotta sitten
vanhempi
commit
030e720518

+ 7 - 1
business/base-service/src/main/java/com/yihu/jw/inpatient/service/BaseInpatientRegistrationService.java

@ -117,7 +117,7 @@ public class BaseInpatientRegistrationService extends BaseJpaService {
        return registrationDO;
    }
    public PageEnvelop page(String patient,String name,Integer page,Integer size){
    public PageEnvelop page(String patient,String name,String startTime,String endTime,Integer page,Integer size){
        String sql = "select * from base_inpatient_registration where 1=1";
        if(StringUtils.isNotBlank(patient)){
            sql += " and patient = '"+patient+"'";
@ -127,6 +127,12 @@ public class BaseInpatientRegistrationService extends BaseJpaService {
        if(StringUtils.isNotBlank(name)){
            sql += " and (name like '%"+name+"%' or idcard like '%"+name+"%')";
        }
        if(StringUtils.isNotBlank(startTime)){
            sql += " and create_time>='"+startTime+"'";
        }
        if(StringUtils.isNotBlank(endTime)){
            sql += " and create_time<='"+endTime+"'";
        }
        String countSql = sql.replace("select *","select count(*)");
        String limit = " order by create_time desc limit "+(page-1)*size+","+size;

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/inpatient/BaseInpatientRegistrationDO.java

@ -44,6 +44,7 @@ public class BaseInpatientRegistrationDO extends UuidIdentityEntityWithCreateTim
    private Date updateTime;//提交时间
    private Object data;//临时存续方信息
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time")
@ -253,4 +254,13 @@ public class BaseInpatientRegistrationDO extends UuidIdentityEntityWithCreateTim
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
    @Transient
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
}

+ 0 - 90
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleMenuDO.java

@ -1,90 +0,0 @@
package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
/**
 * 角色菜单表实体
 * 
 * @author litaohong on  2018年10月23日
 *
 */
@Entity
@Table(name = "base_role_menu")
@SequenceGenerator(name="id_generated", sequenceName="BASE_ROLE_MENU_SEQ")
public class BaseRoleMenuDO extends IntegerIdentityEntity {
    /**
	 * 角色标识
	 */
	private String code;
    /**
	 * 角色名称
	 */
	private String name;
    /**
	 * 角色拥有的菜单id列表,逗号分隔,对应base_menu表
	 */
	private String menuId;
    /**
	 * 角色状态,0失效 1有效
	 */
	private String del;
    /**
	 * 角色说明
	 */
	private String description;
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "menu_id")
    public String getMenuId() {
        return menuId;
    }
    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
	@Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}

+ 0 - 21
svr/svr-base/src/main/java/com/yihu/jw/base/dao/role/BaseRoleMenuDao.java

@ -1,21 +0,0 @@
package com.yihu.jw.base.dao.role;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaRepository;
/**
 * 
 * 角色菜单表 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseRoleMenuDao extends JpaRepository<BaseRoleMenuDO, Integer>, JpaSpecificationExecutor<BaseRoleMenuDO>  {
}

+ 7 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/menu/BaseAppMenuEndPoint.java

@ -42,10 +42,10 @@ public class BaseAppMenuEndPoint extends EnvelopRestEndpoint {
    @PostMapping("/save")
    @ApiOperation(value = "保存或修改")
    public Envelop save(@ApiParam(name = "data", value = "data",required = true)
                        @RequestParam(value = "data") String data) {
    public Envelop save(@ApiParam(name = "jsonData", value = "jsonData",required = true)
                        @RequestParam(value = "jsonData") String jsonData) {
        try {
            BaseAppMenu newBaseApp = toEntity(data, BaseAppMenu.class);
            BaseAppMenu newBaseApp = toEntity(jsonData, BaseAppMenu.class);
            if (StringUtils.isEmpty(newBaseApp.getCode())) {
                return failed("编码不能为空!");
            }
@ -68,7 +68,7 @@ public class BaseAppMenuEndPoint extends EnvelopRestEndpoint {
                if(!baseAppMenuService.isUniqueCode("0", newBaseApp.getCode())){
                    return ObjEnvelop.getError("编码已存在",-1);
                }
                newBaseApp.setDel(1);
                baseAppMenuDao.save(newBaseApp);
                return ObjEnvelop.getSuccess("操作成功",newBaseApp);
            } else {
@ -116,8 +116,8 @@ public class BaseAppMenuEndPoint extends EnvelopRestEndpoint {
    }
    @GetMapping("/getComboTreeData")
    @ApiOperation(value = "获取资源报表分类下拉框数据")
    public Envelop getComboTreeData(@ApiParam(name = "type", value = "type",required = true)
    @ApiOperation(value = "获取下拉框数据")
    public Envelop getComboTreeData(@ApiParam(name = "type", value = "类型 1医生 2居民",required = true)
                                    @RequestParam(value = "type") Integer type) {
        try {
            List<BaseAppMenu> list = baseAppMenuDao.findAllByType(type);
@ -150,7 +150,7 @@ public class BaseAppMenuEndPoint extends EnvelopRestEndpoint {
    @GetMapping("/getTreeData")
    @ApiOperation(value = "根据条件,获取菜单列表(树形结构)")
    public Envelop getTreeData(@ApiParam(name = "codeName", value = "资源报表分类编码或名称")
    public Envelop getTreeData(@ApiParam(name = "codeName", value = "菜单编码或名称")
                               @RequestParam(value = "codeName",required = false) String codeName,
                               @ApiParam(name = "type",required = true, value = "类型 1医生 2居民")
                               @RequestParam(value = "type") Integer type) {

+ 0 - 104
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/BaseRoleMenuEndpoint.java

@ -1,104 +0,0 @@
package com.yihu.jw.base.endpoint.role;
import com.yihu.jw.base.service.role.BaseRoleMenuService;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import com.yihu.jw.restmodel.base.role.BaseRoleMenuVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* 角色菜单表控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.BaseRoleMenu.PREFIX)
@Api(value = "角色菜单表管理", description = "角色菜单表管理服务接口", tags = {"wlyy基础服务 - 角色菜单表管理服务接口"})
public class BaseRoleMenuEndpoint extends EnvelopRestEndpoint {
@Autowired
private BaseRoleMenuService baseRoleMenuService;
@PostMapping(value = BaseRequestMapping.BaseRoleMenu.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<BaseRoleMenuVO> create (
    @ApiParam(name = "json_data", value = "Json数据", required = true)
    @RequestBody String jsonData) throws Exception {
    BaseRoleMenuDO baseRoleMenu = toEntity(jsonData, BaseRoleMenuDO.class);
    baseRoleMenu = baseRoleMenuService.save(baseRoleMenu);
    return success(baseRoleMenu, BaseRoleMenuVO.class);
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleMenu.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    baseRoleMenuService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleMenu.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseRoleMenuVO> update (
        @ApiParam(name = "json_data", value = "Json数据", required = true)
        @RequestBody String jsonData) throws Exception {
        BaseRoleMenuDO baseRoleMenu = toEntity(jsonData, BaseRoleMenuDO.class);
        if (null == baseRoleMenu.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        baseRoleMenu = baseRoleMenuService.save(baseRoleMenu);
        return success(baseRoleMenu, BaseRoleMenuVO.class);
        }
        @GetMapping(value = BaseRequestMapping.BaseRoleMenu.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<BaseRoleMenuVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<BaseRoleMenuDO> baseRoleMenus = baseRoleMenuService.search(fields, filters, sorts, page, size);
                int count = (int)baseRoleMenuService.getCount(filters);
                return success(baseRoleMenus, count, page, size, BaseRoleMenuVO.class);
         }
         @GetMapping(value = BaseRequestMapping.BaseRoleMenu.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<BaseRoleMenuVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<BaseRoleMenuDO> baseRoleMenus = baseRoleMenuService.search(fields, filters, sorts);
                  return success(baseRoleMenus, BaseRoleMenuVO.class);
         }
 }

+ 0 - 22
svr/svr-base/src/main/java/com/yihu/jw/base/service/role/BaseRoleMenuService.java

@ -1,22 +0,0 @@
package com.yihu.jw.base.service.role;
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 角色菜单表服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年10月23日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BaseRoleMenuService extends BaseJpaService<BaseRoleMenuDO, BaseRoleMenuDao> {
}

+ 0 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.equipment.WlyyUserAreaDao;
import com.yihu.jw.base.dao.equipment.WlyyUserEquipmentDao;
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasDao;
import com.yihu.jw.base.service.org.BaseOrgUserService;
@ -56,8 +55,6 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    @Autowired
    private SaasDao saasDao;
    @Autowired
    private BaseRoleMenuDao baseRoleMenuDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired

+ 46 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/archives/PatientArchivesEndpoint.java

@ -1,10 +1,18 @@
package com.yihu.jw.hospital.endpoint.archives;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.contant.CommonContant;
import com.yihu.jw.entity.base.inpatient.BaseInpatientRegistrationDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.hospital.record.HospitalPatientInpatientRecordDO;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.record.service.HospitalPatientInpatientRecordService;
import com.yihu.jw.inpatient.service.BaseInpatientRegistrationService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -15,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
@ -27,6 +36,12 @@ public class PatientArchivesEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private HospitalPatientInpatientRecordService inpatientRecordService;
    @Autowired
    private BaseInpatientRegistrationService inpatientRegistrationService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @GetMapping(value = "findInpatientRecently")
    @ApiOperation(value = "获取最近一次住院记录")
@ -47,4 +62,35 @@ public class PatientArchivesEndpoint extends EnvelopRestEndpoint {
        }
        return Envelop.getError(CommonContant.Message.GET_ERROR);
    }
    @GetMapping(value = "leaveHospitalDrugs")
    @ApiOperation(value = "出院带药")
    public Envelop leaveHospitalDrugs(@ApiParam(name = "patient", value = "patient", required = true)
                        @RequestParam(value = "patient", required = true)String patient,
                        @ApiParam(name = "startTime", value = "开始时间", required = true)
                        @RequestParam(value = "startTime", required = true)String startTime,
                        @ApiParam(name = "endTime", value = "结束时间", required = true)
                        @RequestParam(value = "endTime", required = true)String endTime,
                        @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                        @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                        @ApiParam(name = "size", value = "每页分页大小", required = true, defaultValue = "10")
                        @RequestParam(value = "size", required = true,defaultValue = "10")Integer size){
        try {
            PageEnvelop pageEnvelop = inpatientRegistrationService.page(patient,null,startTime,endTime,page,size);
            for (Object o:pageEnvelop.getDetailModelList()){
                BaseInpatientRegistrationDO registrationDO = (BaseInpatientRegistrationDO)o;
                JSONObject data = new JSONObject();
                List<WlyyPrescriptionDO> pre = prescriptionDao.findByPatientCode(patient);
                if(pre.size()>0){
                    WlyyPrescriptionDO prescriptionDO = pre.get(0);
                    data.put("prescriptionId",prescriptionDO.getId());
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(),1);
                    data.put("infoDOS",infoDOS);
                }
            }
            return pageEnvelop;
        }catch (Exception e){
            return failedException2(e);
        }
    }
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/inpatient/DoctorInpatientRegistrationEndpoint.java

@ -31,7 +31,7 @@ public class DoctorInpatientRegistrationEndpoint extends EnvelopRestEndpoint {
                        @RequestParam(value = "size", required = true,defaultValue = "10")Integer size){
        try {
            return inpatientRegistrationService.page(null,name,page,size);
            return inpatientRegistrationService.page(null,name,null,null,page,size);
        }catch (Exception e){
            return failedException2(e);
        }

+ 17 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/inpatient/PatientInpatientEndpoint.java

@ -0,0 +1,17 @@
package com.yihu.jw.hospital.endpoint.inpatient;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by yeshijie on 2022/12/12.
 */
@RestController
@RequestMapping(value ="/patient/inpatient")
@Api(value = "居民端-住院相关",  tags = {"居民端-住院相关"})
public class PatientInpatientEndpoint extends EnvelopRestEndpoint {
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/inpatient/PatientInpatientRegistrationEndpoint.java

@ -57,7 +57,7 @@ public class PatientInpatientRegistrationEndpoint extends EnvelopRestEndpoint {
                        @RequestParam(value = "size", required = true,defaultValue = "10")Integer size){
        try {
            return inpatientRegistrationService.page(patient,null,page,size);
            return inpatientRegistrationService.page(patient,null,null,null,page,size);
        }catch (Exception e){
            return failedException2(e);
        }