Commit 0456bb14 by rongkailun

【新增】医疗、物流添加审核功能

parent 191c6eb7
...@@ -2,17 +2,17 @@ package io.office.modules.manage.controller; ...@@ -2,17 +2,17 @@ package io.office.modules.manage.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.utils.IdKeysConstant; import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils; import io.office.modules.manage.utils.IdWorkerUtils;
import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
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.entity.LogisticsEntity;
import io.office.modules.manage.service.LogisticsService; import io.office.modules.manage.service.LogisticsService;
...@@ -20,7 +20,6 @@ import io.office.common.utils.PageUtils; ...@@ -20,7 +20,6 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.R; import io.office.common.utils.R;
/** /**
* ${comments} * ${comments}
* *
...@@ -30,7 +29,7 @@ import io.office.common.utils.R; ...@@ -30,7 +29,7 @@ import io.office.common.utils.R;
*/ */
@RestController @RestController
@RequestMapping("/logistics") @RequestMapping("/logistics")
public class LogisticsController { public class LogisticsController extends AbstractController {
@Autowired @Autowired
private LogisticsService logisticsService; private LogisticsService logisticsService;
...@@ -64,6 +63,9 @@ public class LogisticsController { ...@@ -64,6 +63,9 @@ public class LogisticsController {
public R save(@RequestBody LogisticsEntity logistics){ public R save(@RequestBody LogisticsEntity logistics){
logistics.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY)); logistics.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
logistics.setInputdate(new Date()); logistics.setInputdate(new Date());
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logisticsService.save(logistics); logisticsService.save(logistics);
return R.ok("新增成功!"); return R.ok("新增成功!");
} }
...@@ -74,6 +76,10 @@ public class LogisticsController { ...@@ -74,6 +76,10 @@ public class LogisticsController {
@RequestMapping("/update") @RequestMapping("/update")
// @RequiresPermissions("manage:logistics:update") // @RequiresPermissions("manage:logistics:update")
public R update(@RequestBody LogisticsEntity logistics){ public R update(@RequestBody LogisticsEntity logistics){
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setUpdatetime(new Date());
logisticsService.updateById(logistics); logisticsService.updateById(logistics);
return R.ok("修改成功!"); return R.ok("修改成功!");
} }
...@@ -83,9 +89,32 @@ public class LogisticsController { ...@@ -83,9 +89,32 @@ public class LogisticsController {
*/ */
@RequestMapping("/delete") @RequestMapping("/delete")
// @RequiresPermissions("manage:logistics:delete") // @RequiresPermissions("manage:logistics:delete")
public R delete(@RequestBody String[] ids){ public R delete(@RequestBody List<String> ids){
logisticsService.removeByIds(Arrays.asList(ids)); LogisticsEntity logistics = new LogisticsEntity();
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setUpdatetime(new Date());
logistics.setLevel(0);
QueryWrapper<LogisticsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",ids);
logisticsService.update(logistics,queryWrapper);
return R.ok("删除成功!"); return R.ok("删除成功!");
} }
@PostMapping("/verifyLogistics")
public R verifyMedical(@RequestBody LogisticsEntity logistics){
String username = getUser().getUsername();
logistics.setEditor(username);
logistics.setLasteditor(username);
logistics.setUpdatetime(new Date());
logistics.setCheckname(username);
logistics.setChecktime(new Date());
QueryWrapper<LogisticsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",logistics.getId());
logisticsService.update(logistics,queryWrapper);
return R.ok("审核成功!");
}
} }
...@@ -2,10 +2,12 @@ package io.office.modules.manage.controller; ...@@ -2,10 +2,12 @@ package io.office.modules.manage.controller;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService; import io.office.modules.manage.service.MedicalService;
import io.office.modules.manage.utils.IdKeysConstant; import io.office.modules.manage.utils.IdKeysConstant;
import io.office.modules.manage.utils.IdWorkerUtils; import io.office.modules.manage.utils.IdWorkerUtils;
import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -24,7 +26,7 @@ import io.office.common.utils.R; ...@@ -24,7 +26,7 @@ import io.office.common.utils.R;
*/ */
@RestController @RestController
@RequestMapping("/medical") @RequestMapping("/medical")
public class MedicalController { public class MedicalController extends AbstractController {
@Autowired @Autowired
private MedicalService medicalService; private MedicalService medicalService;
...@@ -57,7 +59,10 @@ public class MedicalController { ...@@ -57,7 +59,10 @@ public class MedicalController {
// @RequiresPermissions("manage:medical:save") // @RequiresPermissions("manage:medical:save")
public R save(@RequestBody MedicalEntity medical){ public R save(@RequestBody MedicalEntity medical){
medical.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY)); medical.setId(IdWorkerUtils.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
String username = getUser().getUsername();
medical.setInputDate(new Date()); medical.setInputDate(new Date());
medical.setEditor(username);
medical.setLasteditor(username);
medicalService.save(medical); medicalService.save(medical);
return R.ok("新增成功!"); return R.ok("新增成功!");
} }
...@@ -68,6 +73,10 @@ public class MedicalController { ...@@ -68,6 +73,10 @@ public class MedicalController {
@RequestMapping("/update") @RequestMapping("/update")
// @RequiresPermissions("manage:medical:update") // @RequiresPermissions("manage:medical:update")
public R update(@RequestBody MedicalEntity medical){ public R update(@RequestBody MedicalEntity medical){
String username = getUser().getUsername();
medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
medicalService.updateById(medical); medicalService.updateById(medical);
return R.ok("修改成功!"); return R.ok("修改成功!");
} }
...@@ -77,8 +86,16 @@ public class MedicalController { ...@@ -77,8 +86,16 @@ public class MedicalController {
*/ */
@RequestMapping("/delete") @RequestMapping("/delete")
// @RequiresPermissions("manage:medical:delete") // @RequiresPermissions("manage:medical:delete")
public R delete(@RequestBody String[] ids){ public R delete(@RequestBody List<String> ids){
medicalService.removeByIds(Arrays.asList(ids)); MedicalEntity medical = new MedicalEntity();
String username = getUser().getUsername();
medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
medical.setLevel(0);
QueryWrapper<MedicalEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",ids);
medicalService.update(medical,queryWrapper);
return R.ok("删除成功!"); return R.ok("删除成功!");
} }
...@@ -88,4 +105,19 @@ public class MedicalController { ...@@ -88,4 +105,19 @@ public class MedicalController {
return R.ok().put("list",list); return R.ok().put("list",list);
} }
@PostMapping("/verifyMedical")
public R verifyMedical(@RequestBody MedicalEntity medical){
String username = getUser().getUsername();
medical.setEditor(username);
medical.setLasteditor(username);
medical.setUpdatetime(new Date());
medical.setCheckname(username);
medical.setChecktime(new Date());
QueryWrapper<MedicalEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",medical.getId());
medicalService.update(medical,queryWrapper);
return R.ok("审核成功!");
}
} }
package io.office.modules.manage.entity; package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
...@@ -81,4 +82,17 @@ public class LogisticsEntity implements Serializable { ...@@ -81,4 +82,17 @@ public class LogisticsEntity implements Serializable {
@TableId("inputdate") @TableId("inputdate")
private Date inputdate; private Date inputdate;
private String status;
private String checkname;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date checktime;
private String editor;
private String lasteditor;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatetime;
@TableField("oldtitle")
private String titleOld;
} }
...@@ -86,4 +86,12 @@ public class MedicalEntity implements Serializable { ...@@ -86,4 +86,12 @@ public class MedicalEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date checktime; private Date checktime;
private String editor;
private String lasteditor;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatetime;
@TableField("oldtitle")
private String titleOld;
} }
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