Browse Source

refactor:[资源库管理][钥匙关管理]前端模块化重构

master
15881625488@163.com 3 weeks ago
parent
commit
62ccdf85c3
15 changed files with 453 additions and 40 deletions
  1. +10
    -20
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java
  2. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java
  3. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Mjy.java
  4. +156
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/mjy/MjyDto.java
  5. +94
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/zcg/ZcgDto.java
  6. +77
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/mjy/MjySearchForm.java
  7. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java
  8. +21
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/MjyMapper.java
  9. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/ZcgMapper.java
  10. +15
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IMjyService.java
  11. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java
  12. +43
    -5
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java
  13. +6
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java
  14. +19
    -0
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/MjyMapper.xml
  15. +2
    -2
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/ZcgMapper.xml

+ 10
- 20
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java View File

@ -3,6 +3,11 @@ package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.business.domain.Zcg;
import com.hxhq.business.dto.mjy.MjyDto;
import com.hxhq.business.form.mjy.MjySearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
import com.hxhq.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -29,38 +34,23 @@ public class MjyController extends BaseController
/**
* 查询麻精药列表
*/
@RequiresPermissions("business:resource:mjy:list")
@GetMapping("/list")
public TableDataInfo list(Mjy mjy)
public TableDataInfo list(MjySearchForm form)
{
startPage();
List<Mjy> list = mjyService.queryList(mjy);
List<MjyDto> list = mjyService.queryList(form);
return getDataTable(list);
}
/**
* 获取麻精药详细信息
*/
@RequiresPermissions("business:resource:mjy:list")
@GetMapping(value = "/info")
public AjaxResult getInfo(Long id)
{
return AjaxResult.success(mjyService.getById(id));
return AjaxResult.success(mjyService.queryInfo(id));
}
/**
* 新增麻精药信息
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody Mjy mjy)
{
return toAjax(mjyService.saveOrUpdate(mjy));
}
/**
* 删除麻精药信息
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody Long[] ids)
{
return toAjax(mjyService.removeByIds(Arrays.asList(ids)));
}
}

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java View File

@ -3,6 +3,7 @@ package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.business.dto.zcg.ZcgDto;
import com.hxhq.business.form.zcg.YsffForm;
import com.hxhq.business.form.zcg.YsghForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
@ -39,7 +40,7 @@ public class ZcgController extends BaseController
public TableDataInfo list(ZcgSearchForm form)
{
startPage();
List<Zcg> list = zcgService.queryList(form);
List<ZcgDto> list = zcgService.queryList(form);
return getDataTable(list);
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Mjy.java View File

@ -36,7 +36,7 @@ public class Mjy extends MpBaseEntity
private String kcdw;
/** 失效日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sxrq;
/** 制剂状态:1:入库;3:已发放;5:已锁定;7:待归档;9:归档;11:待解档 */

+ 156
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/mjy/MjyDto.java View File

@ -0,0 +1,156 @@
package com.hxhq.business.dto.mjy;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* @author 15881
*/
public class MjyDto {
/** 名称 */
private String mc;
/** 编号 */
private String bh;
/** 浓度 */
private String nd;
/** 浓度单位 */
private String nddw;
/** 库存 */
private String kc;
/** 库存单位 */
private String kcdw;
/** 失效日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sxrq;
/** 制剂状态:1:入库;3:已发放;5:已锁定;7:待归档;9:归档;11:待解档 */
private Integer zjzt;
/** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */
private Integer jyzt;
/** 暂存柜 */
private String zcgMc;
/** 存储条件 */
private String cctj;
/** 存储位置 */
private String ccwz;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getMc() {
return mc;
}
public void setMc(String mc) {
this.mc = mc;
}
public String getBh() {
return bh;
}
public void setBh(String bh) {
this.bh = bh;
}
public String getNd() {
return nd;
}
public void setNd(String nd) {
this.nd = nd;
}
public String getNddw() {
return nddw;
}
public void setNddw(String nddw) {
this.nddw = nddw;
}
public String getKc() {
return kc;
}
public void setKc(String kc) {
this.kc = kc;
}
public String getKcdw() {
return kcdw;
}
public void setKcdw(String kcdw) {
this.kcdw = kcdw;
}
public Date getSxrq() {
return sxrq;
}
public void setSxrq(Date sxrq) {
this.sxrq = sxrq;
}
public Integer getZjzt() {
return zjzt;
}
public void setZjzt(Integer zjzt) {
this.zjzt = zjzt;
}
public Integer getJyzt() {
return jyzt;
}
public void setJyzt(Integer jyzt) {
this.jyzt = jyzt;
}
public String getZcgMc() {
return zcgMc;
}
public void setZcgMc(String zcgMc) {
this.zcgMc = zcgMc;
}
public String getCctj() {
return cctj;
}
public void setCctj(String cctj) {
this.cctj = cctj;
}
public String getCcwz() {
return ccwz;
}
public void setCcwz(String ccwz) {
this.ccwz = ccwz;
}
}

+ 94
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/zcg/ZcgDto.java View File

@ -0,0 +1,94 @@
package com.hxhq.business.dto.zcg;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* @author 15881
*/
public class ZcgDto {
/** 暂存柜id*/
private Long id;
/** 暂存柜名称 */
private String mc;
/** 钥匙1领取人名称 */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String lqr1Mc;
/** 钥匙2领取人名称 */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String lqr2Mc;
/** 状态:1:未借用;5:借用中 */
private Integer zt;
/** 关联药剂 */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String glyj;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMc() {
return mc;
}
public void setMc(String mc) {
this.mc = mc;
}
public String getLqr1Mc() {
return lqr1Mc;
}
public void setLqr1Mc(String lqr1Mc) {
this.lqr1Mc = lqr1Mc;
}
public String getLqr2Mc() {
return lqr2Mc;
}
public void setLqr2Mc(String lqr2Mc) {
this.lqr2Mc = lqr2Mc;
}
public Integer getZt() {
return zt;
}
public void setZt(Integer zt) {
this.zt = zt;
}
public String getGlyj() {
return glyj;
}
public void setGlyj(String glyj) {
this.glyj = glyj;
}
}

+ 77
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/mjy/MjySearchForm.java View File

@ -0,0 +1,77 @@
package com.hxhq.business.form.mjy;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
* @author 15881
*/
public class MjySearchForm {
/** 名称 */
private String mc;
/** 编号 */
private String bh;
/** 失效日期开始 */
private String startDate;
/** 失效日期结束 */
private String endDate;
/** 制剂状态:1:入库;3:已发放;5:已锁定;7:待归档;9:归档;11:待解档 */
private Integer zjzt;
/** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */
private Integer jyzt;
public String getMc() {
return mc;
}
public void setMc(String mc) {
this.mc = mc;
}
public String getBh() {
return bh;
}
public void setBh(String bh) {
this.bh = bh;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public Integer getZjzt() {
return zjzt;
}
public void setZjzt(Integer zjzt) {
this.zjzt = zjzt;
}
public Integer getJyzt() {
return jyzt;
}
public void setJyzt(Integer jyzt) {
this.jyzt = jyzt;
}
}

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java View File

@ -10,7 +10,7 @@ public class YsghForm {
private Long id;
/** 暂存柜ids */
private String ids;
private String[] ids;
/** 签名意义 */
private String qmyy;
@ -33,11 +33,11 @@ public class YsghForm {
/** 接收人密码 */
private String jsrmm;
public String getIds() {
public String[] getIds() {
return ids;
}
public void setIds(String ids) {
public void setIds(String[] ids) {
this.ids = ids;
}

+ 21
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/MjyMapper.java View File

@ -1,7 +1,15 @@
package com.hxhq.business.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.hxhq.business.domain.Mjy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hxhq.business.domain.Zcg;
import com.hxhq.business.dto.mjy.MjyDto;
import com.hxhq.business.dto.zcg.ZcgDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 麻精药Mapper接口
*
@ -10,5 +18,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface MjyMapper extends BaseMapper<Mjy>
{
/**
* 查询暂存柜列表
* @param queryWrapper
* @return
*/
List<MjyDto> queryList(@Param("ew") Wrapper<Mjy> queryWrapper);
/**
* 查询暂存柜
* @param id
* @return
*/
Mjy queryInfo(@Param("id") Long id);
}

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/ZcgMapper.java View File

@ -3,6 +3,7 @@ package com.hxhq.business.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.hxhq.business.domain.Zcg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hxhq.business.dto.zcg.ZcgDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,7 +23,7 @@ public interface ZcgMapper extends BaseMapper
* @param queryWrapper
* @return
*/
List<Zcg> queryList(@Param("ew") Wrapper<Zcg> queryWrapper);
List<ZcgDto> queryList(@Param("ew") Wrapper<Zcg> queryWrapper);
/**
* 查询暂存柜

+ 15
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IMjyService.java View File

@ -3,6 +3,10 @@ package com.hxhq.business.service;
import java.util.List;
import com.hxhq.business.domain.Mjy;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hxhq.business.domain.Zcg;
import com.hxhq.business.dto.mjy.MjyDto;
import com.hxhq.business.form.mjy.MjySearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
/**
* 麻精药Service接口
@ -15,9 +19,17 @@ public interface IMjyService extends IService
/**
* 查询麻精药列表
*
* @param mjy 麻精药
* @return 麻精药集合
* @param form 暂存柜
* @return 暂存柜集合
*/
public List<Mjy> queryList(Mjy mjy);
public List<MjyDto> queryList(MjySearchForm form);
/**
* 查询麻精药
*
* @param id
* @return 暂存柜
*/
public Mjy queryInfo(Long id);
}

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java View File

@ -5,6 +5,7 @@ import java.util.Map;
import com.hxhq.business.domain.Zcg;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hxhq.business.dto.zcg.ZcgDto;
import com.hxhq.business.form.zcg.YsffForm;
import com.hxhq.business.form.zcg.YsghForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
@ -23,7 +24,7 @@ public interface IZcgService extends IService
* @param form 暂存柜
* @return 暂存柜集合
*/
public List<Zcg> queryList(ZcgSearchForm form);
public List<ZcgDto> queryList(ZcgSearchForm form);
/**
* 查询暂存柜

+ 43
- 5
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java View File

@ -3,6 +3,11 @@ package com.hxhq.business.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.Zcg;
import com.hxhq.business.dto.mjy.MjyDto;
import com.hxhq.business.form.mjy.MjySearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm;
import com.hxhq.common.core.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.MjyMapper;
import com.hxhq.business.domain.Mjy;
@ -21,14 +26,47 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
/**
* 查询麻精药列表
*
* @param mjy 麻精药
* @return 麻精药
* @param form 暂存柜
* @return 暂存柜
*/
@Override
public List<Mjy> queryList(Mjy mjy)
{
public List<MjyDto> queryList(MjySearchForm form) {
QueryWrapper<Mjy> queryWrapper = Wrappers.query();
return this.list(queryWrapper);
queryWrapper.eq("t.del_flag", "0");
if (form.getJyzt() != null && form.getJyzt().intValue() > 0) {
queryWrapper.eq("t.jyzt", form.getJyzt());
}
if (form.getZjzt() != null && form.getZjzt().intValue() > 0) {
queryWrapper.eq("t.zjzt", form.getZjzt());
}
if (StringUtils.isNoneBlank(form.getMc())) {
queryWrapper.and(p -> p.like("t.`mc`", form.getMc()));
}
if (StringUtils.isNoneBlank(form.getBh())) {
queryWrapper.and(p -> p.like("t.`bh`", form.getBh()));
}
if (StringUtils.isNoneBlank(form.getStartDate())) {
queryWrapper.apply("t.sxrq>={0}", form.getStartDate());
}
if (StringUtils.isNoneBlank(form.getEndDate())) {
queryWrapper.apply("t.sxrq<{0}", form.getEndDate());
}
return baseMapper.queryList(queryWrapper);
}
/**
* 查询麻精药
*
* @param id
* @return 暂存柜
*/
@Override
public Mjy queryInfo(Long id) {
if (id == null || id.longValue() < 0) {
throw new SecurityException("参数id不正确");
}
return baseMapper.queryInfo(id);
}
}

+ 6
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java View File

@ -8,6 +8,7 @@ import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.ZcgTz;
import com.hxhq.business.dto.zcg.ZcgDto;
import com.hxhq.business.enums.zykgl.JyztEnum;
import com.hxhq.business.enums.zykgl.zcgJyztEnum;
import com.hxhq.business.form.zcg.YsffForm;
@ -45,8 +46,9 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
* @return 暂存柜
*/
@Override
public List<Zcg> queryList(ZcgSearchForm form) {
public List<ZcgDto> queryList(ZcgSearchForm form) {
QueryWrapper<Zcg> queryWrapper = Wrappers.query();
queryWrapper.eq("t.del_flag", "0");
if (form.getZt() != null && form.getZt().intValue() > 0) {
queryWrapper.eq("t.zt", form.getZt());
}
@ -56,6 +58,7 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
if (form.getJyrId() != null && form.getJyrId().intValue() > 0) {
queryWrapper.and(p -> p.eq("t.`lqr1_id`", form.getJyrId()).or().eq("t.`lqr2_id`", form.getJyrId()));
}
queryWrapper.orderByDesc("t.create_time");
return baseMapper.queryList(queryWrapper);
}
@ -136,11 +139,11 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS
@Override
@Transactional(rollbackFor = Exception.class)
public void ysghBatch(YsghForm form) {
if (StringUtils.isBlank(form.getIds())) {
if (form.getIds().length<0) {
throw new SecurityException("参数ids不正确");
}
QueryWrapper<Zcg> queryWrapper = Wrappers.query();
queryWrapper.in("id", form.getIds().split(","));
queryWrapper.in("id", form.getIds());
List<Zcg> zcgList = this.list(queryWrapper);
List<ZcgTz> zcgTzList = new ArrayList<>();
if (zcgList.size() > 0) {

+ 19
- 0
hxhq-modules/hxhq-system/src/main/resources/mapper/business/MjyMapper.xml View File

@ -3,4 +3,23 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.MjyMapper">
<select id="queryInfo" resultType="com.hxhq.business.domain.Mjy">
select t.*
FROM `t_mjy` t
where t.id=#{id}
</select>
<select id="queryList" resultType="com.hxhq.business.dto.mjy.MjyDto">
select t.id,t.mc,t.bh,t.nd,t.nddw,t.kc,t.kcdw,t.sxrq,t.zjzt,t.jyzt,t.cctj,t.ccwz,t.create_time
,z.mc as zcgMc
FROM `t_mjy` t
left join `t_zcg` z on z.id=t.zcg_id
<if test="ew.sqlSegment != '' and ew.sqlSegment != null">
<where>
${ew.sqlSegment}
</where>
</if>
</select>
</mapper>

+ 2
- 2
hxhq-modules/hxhq-system/src/main/resources/mapper/business/ZcgMapper.xml View File

@ -10,8 +10,8 @@
where t.id=#{id}
</select>
<select id="queryList" resultType="com.hxhq.business.domain.Zcg">
select t.*
<select id="queryList" resultType="com.hxhq.business.dto.zcg.ZcgDto">
select t.id,t.mc,t.lqr1_mc,t.lqr2_mc,t.zt,t.glyj,t.create_time
FROM `t_zcg` t
<if test="ew.sqlSegment != '' and ew.sqlSegment != null">
<where>

Loading…
Cancel
Save