Commit e1343de8 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 2490b642 6d4c6ebe
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.LogisticsEntity;
import io.office.modules.manage.service.LogisticsService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 15:48:47
*/
@RestController
@RequestMapping("/logistics")
public class LogisticsController {
@Autowired
private LogisticsService logisticsService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:logistics:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = logisticsService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:logistics:info")
public R info(@PathVariable("id") String id){
LogisticsEntity logistics = logisticsService.getById(id);
return R.ok().put("logistics", logistics);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:logistics:save")
public R save(@RequestBody LogisticsEntity logistics){
logistics.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
logistics.setInputdate(new Date());
logisticsService.save(logistics);
return R.ok("新增成功!");
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:logistics:update")
public R update(@RequestBody LogisticsEntity logistics){
logisticsService.updateById(logistics);
return R.ok("修改成功!");
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:logistics:delete")
public R delete(@RequestBody String[] ids){
logisticsService.removeByIds(Arrays.asList(ids));
return R.ok("删除成功!");
}
}
......@@ -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.dao;
import io.office.modules.manage.entity.LogisticsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 15:48:47
*/
@Mapper
public interface LogisticsDao extends BaseMapper<LogisticsEntity> {
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 15:48:47
*/
@Data
@TableName("logistics")
public class LogisticsEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String type;
/**
* $column.comments
*/
private Integer level;
/**
* $column.comments
*/
private String jumppath;
/**
* $column.comments
*/
private String keyword;
/**
* $column.comments
*/
private String source;
/**
* $column.comments
*/
private String author;
/**
* $column.comments
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:smm:ss")
private Date releasetime;
/**
* $column.comments
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date implementationtime;
/**
* $column.comments
*/
private String remarks;
/**
* $column.comments
*/
private String content;
/**
* $column.comments
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableId("inputdate")
private Date inputdate;
}
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;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.LogisticsEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 15:48:47
*/
public interface LogisticsService extends IService<LogisticsEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service.impl;
import com.qiniu.util.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.LogisticsDao;
import io.office.modules.manage.entity.LogisticsEntity;
import io.office.modules.manage.service.LogisticsService;
@Service("logisticsService")
public class LogisticsServiceImpl extends ServiceImpl<LogisticsDao, LogisticsEntity> implements LogisticsService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<LogisticsEntity> logisticsEntityQueryWrapper = new QueryWrapper<>();
if(!StringUtils.isNullOrEmpty(String.valueOf(params.get("title")))){
logisticsEntityQueryWrapper.eq("title",params.get("title"));
}
if(!StringUtils.isNullOrEmpty(String.valueOf(params.get("keyword")))){
logisticsEntityQueryWrapper.eq("keyword",params.get("keyword"));
}
if(!StringUtils.isNullOrEmpty(String.valueOf(params.get("type")))){
logisticsEntityQueryWrapper.eq("type",params.get("type"));
}
IPage<LogisticsEntity> page = this.page(
new Query<LogisticsEntity>().getPage(params),
new QueryWrapper<LogisticsEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
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);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.office.modules.manage.dao.LogisticsDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.LogisticsEntity" id="logisticsMap">
<result property="id" column="id"/>
<result property="title" column="title"/>
<result property="type" column="type"/>
<result property="level" column="level"/>
<result property="jumppath" column="jumppath"/>
<result property="keyword" column="keyword"/>
<result property="source" column="source"/>
<result property="author" column="author"/>
<result property="releasetime" column="releaseTime"/>
<result property="implementationtime" column="implementationTime"/>
<result property="remarks" column="remarks"/>
<result property="content" column="content"/>
<result property="inputdate" column="inputDate"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -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