Commit cbf85bd1 by rongkailun

【新增】医疗管理功能

parent bae28f80
......@@ -4,6 +4,8 @@ import java.util.*;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -33,7 +35,6 @@ public class MedicalController {
// @RequiresPermissions("manage:medical:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = medicalService.queryPage(params);
return R.ok().put("page", page);
}
......@@ -55,9 +56,9 @@ public class MedicalController {
@RequestMapping("/save")
// @RequiresPermissions("manage:medical:save")
public R save(@RequestBody MedicalEntity medical){
medical.setId(UUID.randomUUID().toString());
medical.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
medical.setInputDate(new Date());
// medicalService.insertMedical(medical);
medicalService.save(medical);
return R.ok("新增成功!");
}
......@@ -68,8 +69,7 @@ public class MedicalController {
// @RequiresPermissions("manage:medical:update")
public R update(@RequestBody MedicalEntity medical){
medicalService.updateById(medical);
return R.ok();
return R.ok("修改成功!");
}
/**
......@@ -77,10 +77,9 @@ public class MedicalController {
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:medical:delete")
public R delete(@RequestBody Integer[] ids){
public R delete(@RequestBody String[] ids){
medicalService.removeByIds(Arrays.asList(ids));
return R.ok();
return R.ok("删除成功!");
}
@GetMapping("/getMedicalTypeList")
......
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -8,6 +10,7 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
/**
* ${comments}
......@@ -24,7 +27,7 @@ public class MedicalEntity implements Serializable {
/**
* $column.comments
*/
@TableId
@TableId(type=IdType.INPUT)
private String id;
/**
* $column.comments
......@@ -73,6 +76,7 @@ public class MedicalEntity implements Serializable {
*/
private String content;
@TableField("inputDate")
private Date inputDate;
}
package io.office.modules.manage.service.impl;
import io.netty.util.internal.StringUtil;
import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
......@@ -24,11 +25,17 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
MedicalDao medicalDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<MedicalEntity> medicalEntityQueryWrapper = new QueryWrapper<>();
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("title")))){
medicalEntityQueryWrapper.eq("title",params.get("title"));
}
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("type")))){
medicalEntityQueryWrapper.eq("type",params.get("type"));
}
IPage<MedicalEntity> page = this.page(
new Query<MedicalEntity>().getPage(params),
new QueryWrapper<MedicalEntity>()
medicalEntityQueryWrapper
);
return new PageUtils(page);
}
......
......@@ -27,7 +27,7 @@
<result property="auditor" column="auditor"/>
</resultMap>
<select id="selectPolicyList" resultMap="policyMap" parameterType="io.office.modules.manage.entity.dto.PolicyParams">
select class,title,editor,lasteditor,releasedate,updatedate,auditor,status from Policy
select id,class,title,editor,lasteditor,releasedate,updatedate,auditor,status from Policy
where 1=1
<if test="newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null">
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment