forked from rongchao/epmet-cloud-rizhao
8 changed files with 509 additions and 0 deletions
@ -0,0 +1,59 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PhysicianManageDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 医师姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 医师证件号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 电话 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 级别(职称) |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 隶属机构 |
||||
|
*/ |
||||
|
private String subOrg; |
||||
|
|
||||
|
/** |
||||
|
* 机构级别 |
||||
|
*/ |
||||
|
private String orgLevel; |
||||
|
|
||||
|
/** |
||||
|
* 识别码(医师执业证号码) |
||||
|
*/ |
||||
|
private String imsi; |
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PhysicianManageFormDTO extends PageFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 医师姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 医师证件号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 电话 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 级别(职称) |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 隶属机构 |
||||
|
*/ |
||||
|
private String subOrg; |
||||
|
|
||||
|
/** |
||||
|
* 机构级别 |
||||
|
*/ |
||||
|
private String orgLevel; |
||||
|
|
||||
|
/** |
||||
|
* 识别码(医师执业证号码) |
||||
|
*/ |
||||
|
private String imsi; |
||||
|
|
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.PhysicianManageDTO; |
||||
|
import com.epmet.dto.form.PhysicianManageFormDTO; |
||||
|
import com.epmet.service.PhysicianManageService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("physicianManage") |
||||
|
public class PhysicianManageController { |
||||
|
|
||||
|
@Autowired |
||||
|
private PhysicianManageService physicianManageService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<PhysicianManageDTO>> page(@RequestParam Map<String, Object> params) { |
||||
|
PageData<PhysicianManageDTO> page = physicianManageService.page(params); |
||||
|
return new Result<PageData<PhysicianManageDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
||||
|
public Result<PhysicianManageDTO> get(@PathVariable("id") String id) { |
||||
|
PhysicianManageDTO data = physicianManageService.get(id); |
||||
|
return new Result<PhysicianManageDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody PhysicianManageFormDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
physicianManageService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody PhysicianManageFormDTO dto) { |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
physicianManageService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids) { |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
physicianManageService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("search") |
||||
|
public Result<PageData<PhysicianManageDTO>> search(@RequestBody PhysicianManageFormDTO dto) { |
||||
|
return new Result().ok(physicianManageService.search(dto)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.PhysicianManageDTO; |
||||
|
import com.epmet.entity.PhysicianManageEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface PhysicianManageDao extends BaseDao<PhysicianManageEntity> { |
||||
|
|
||||
|
List<PhysicianManageDTO> search(@Param("name") String name, @Param("idCard") String idCard, |
||||
|
@Param("level") String level, @Param("subOrg") String subOrg, |
||||
|
@Param("orgLevel") String orgLevel); |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("physician_manage") |
||||
|
public class PhysicianManageEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 医师姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 医师证件号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 电话 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 级别(职称) |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 隶属机构 |
||||
|
*/ |
||||
|
private String subOrg; |
||||
|
|
||||
|
/** |
||||
|
* 机构级别 |
||||
|
*/ |
||||
|
private String orgLevel; |
||||
|
|
||||
|
/** |
||||
|
* 识别码(医师执业证号码) |
||||
|
*/ |
||||
|
private String imsi; |
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PhysicianManageExcel { |
||||
|
|
||||
|
@Excel(name = "主键ID") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "医师姓名") |
||||
|
private String name; |
||||
|
|
||||
|
@Excel(name = "医师证件号") |
||||
|
private String idCard; |
||||
|
|
||||
|
@Excel(name = "电话") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "级别(职称)") |
||||
|
private String level; |
||||
|
|
||||
|
@Excel(name = "隶属机构") |
||||
|
private String subOrg; |
||||
|
|
||||
|
@Excel(name = "机构级别") |
||||
|
private String orgLevel; |
||||
|
|
||||
|
@Excel(name = "识别码(医师执业证号码)") |
||||
|
private String imsi; |
||||
|
|
||||
|
@Excel(name = "删除标识 0.未删除 1.已删除") |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.PhysicianManageDTO; |
||||
|
import com.epmet.dto.form.PhysicianManageFormDTO; |
||||
|
import com.epmet.entity.PhysicianManageEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
public interface PhysicianManageService extends BaseService<PhysicianManageEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<PhysicianManageDTO> |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
PageData<PhysicianManageDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<PhysicianManageDTO> |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
List<PhysicianManageDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return PhysicianManageDTO |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
PhysicianManageDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
void save(PhysicianManageFormDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
void update(PhysicianManageFormDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-06-20 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
PageData<PhysicianManageDTO> search(PhysicianManageFormDTO dto); |
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.dao.PhysicianManageDao; |
||||
|
import com.epmet.dto.PhysicianManageDTO; |
||||
|
import com.epmet.dto.form.PhysicianManageFormDTO; |
||||
|
import com.epmet.entity.PhysicianManageEntity; |
||||
|
import com.epmet.service.PhysicianManageService; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 日照:医师管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-06-20 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PhysicianManageServiceImpl extends BaseServiceImpl<PhysicianManageDao, PhysicianManageEntity> implements PhysicianManageService { |
||||
|
|
||||
|
@Override |
||||
|
public PageData<PhysicianManageDTO> page(Map<String, Object> params) { |
||||
|
IPage<PhysicianManageEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, PhysicianManageDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<PhysicianManageDTO> list(Map<String, Object> params) { |
||||
|
List<PhysicianManageEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, PhysicianManageDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<PhysicianManageEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<PhysicianManageEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PhysicianManageDTO get(String id) { |
||||
|
PhysicianManageEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, PhysicianManageDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(PhysicianManageFormDTO dto) { |
||||
|
PhysicianManageEntity entity = ConvertUtils.sourceToTarget(dto, PhysicianManageEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(PhysicianManageFormDTO dto) { |
||||
|
PhysicianManageEntity entity = ConvertUtils.sourceToTarget(dto, PhysicianManageEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageData<PhysicianManageDTO> search(PhysicianManageFormDTO dto) { |
||||
|
PageInfo<PhysicianManageDTO> pageInfo = PageHelper.startPage(dto.getPageNo(), dto.getPageSize(), dto.getIsPage()) |
||||
|
.doSelectPageInfo(() -> baseDao.search(dto.getName(), dto.getIdCard(), dto.getLevel(), dto.getSubOrg(), dto.getOrgLevel())); |
||||
|
return new PageData<>(pageInfo.getList() == null ? new ArrayList<>() : pageInfo.getList(), pageInfo.getTotal()); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue