Compare commits

..

3 Commits

Author SHA1 Message Date
王保桦 7022ca19f7 删除部分页面,添加设备管理页面 4 years ago
王保桦 3189db0048 Merge remote-tracking branch 'origin/master' 4 years ago
wbh 4743d1acde 修复logout时当前用户错误的问题 4 years ago
  1. 54
      java/local/src/main/java/cn/toesbieya/jxc/controller/sys/EquipmentController.java
  2. 20
      java/local/src/main/java/cn/toesbieya/jxc/model/vo/EquipmentVo.java
  3. 22
      java/local/src/main/java/cn/toesbieya/jxc/model/vo/search/EquipmentSearch.java
  4. 121
      java/local/src/main/java/cn/toesbieya/jxc/service/sys/SysEquipmentService.java
  5. 10
      java/local/src/main/java/cn/toesbieya/jxc/service/sys/SysSupplierService.java
  6. 4
      java/local/src/main/resources/application-local.yml
  7. 2
      vue/full/src/config/index.js
  8. 2
      vue/full/src/layout/component/Footer/index.vue
  9. 53
      vue/full/src/router/module/admin/child/system.js
  10. 8
      vue/full/src/router/module/dev/index.js
  11. 4
      vue/full/src/router/module/doc/index.js
  12. 6
      vue/full/src/util/index.js
  13. 1
      vue/full/src/view/admin/system/supplier/EditDialog.vue
  14. 4
      vue/full/src/view/admin/system/supplier/indexPage.vue
  15. 0
      vue/full/src/view/admin/user/userInfo/component/EditDialog.vue

@ -0,0 +1,54 @@
package cn.toesbieya.jxc.controller.sys;
import cn.toesbieya.jxc.model.entity.SysEquipment;
import cn.toesbieya.jxc.model.vo.search.EquipmentSearch;
import cn.toesbieya.jxc.service.sys.SysEquipmentService;
import cn.toesbieya.jxc.model.vo.R;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("system/equipment")
public class EquipmentController {
@Resource
private SysEquipmentService service;
@PostMapping("search")
public R search(@RequestBody EquipmentSearch vo) {
return R.success(service.search(vo));
}
@PostMapping("add")
public R add(@RequestBody SysEquipment equipment) {
String errMsg = validateCreateParam(equipment);
if (errMsg != null) return R.fail("添加失败," + errMsg);
equipment.setId(null);
equipment.setCreateTime(System.currentTimeMillis());
return service.add(equipment);
}
@PostMapping("update")
public R update(@RequestBody SysEquipment equipment) {
String errMsg = validateUpdateParam(equipment);
return errMsg == null ? service.update(equipment) : R.fail("修改失败," + errMsg);
}
@PostMapping("del")
public R del(@RequestBody SysEquipment equipment) {
if (equipment.getId() == null) return R.fail("删除失败,参数错误");
return service.del(equipment);
}
private String validateCreateParam(SysEquipment equipment) {
if (StringUtils.isEmpty(equipment.getName())) return "设备名称不能为空";
return null;
}
private String validateUpdateParam(SysEquipment equipment) {
if (equipment.getId() == null) return "参数错误";
return validateCreateParam(equipment);
}
}

@ -0,0 +1,20 @@
package cn.toesbieya.jxc.model.vo;
import cn.toesbieya.jxc.model.entity.SysEquipment;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.beans.BeanUtils;
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class EquipmentVo extends SysEquipment {
private String regionName;
public EquipmentVo(SysEquipment parent) {
BeanUtils.copyProperties(parent, this);
}
}

@ -0,0 +1,22 @@
package cn.toesbieya.jxc.model.vo.search;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class EquipmentSearch extends BaseSearch {
private Integer id;
private String name;
private String spec;
private String introduction;
private String supplier;
private String manuDate;
private String buyDate;
private String location;
private Boolean enable;
private Long startTime;
private Long endTime;
}

@ -0,0 +1,121 @@
package cn.toesbieya.jxc.service.sys;
import cn.toesbieya.jxc.annoation.UserAction;
import cn.toesbieya.jxc.mapper.SysEquipmentMapper;
import cn.toesbieya.jxc.model.entity.SysEquipment;
import cn.toesbieya.jxc.model.vo.EquipmentVo;
import cn.toesbieya.jxc.model.vo.R;
import cn.toesbieya.jxc.model.vo.result.PageResult;
import cn.toesbieya.jxc.model.vo.search.EquipmentSearch;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class SysEquipmentService {
@Resource
private SysEquipmentMapper equipmentMapper;
public PageResult<EquipmentVo> search(EquipmentSearch vo){
Integer id = vo.getId();
String name = vo.getName();
String spec = vo.getSpec();
String introduction = vo.getIntroduction();
String supplier = vo.getSupplier();
String location = vo.getLocation();
Boolean enable = vo.getEnable();
String manuDate = vo.getManuDate();
String buyDate = vo.getBuyDate();
Long startTime = vo.getStartTime();
Long endTime = vo.getEndTime();
Wrapper<SysEquipment> wrapper =
Wrappers.lambdaQuery(SysEquipment.class)
.eq(id != null,SysEquipment::getId,id)
.like(!StringUtils.isEmpty(name),SysEquipment::getName,name)
.like(!StringUtils.isEmpty(spec),SysEquipment::getSpec,spec)
.like(!StringUtils.isEmpty(introduction),SysEquipment::getIntroduction,introduction)
.like(!StringUtils.isEmpty(supplier),SysEquipment::getSupplier,supplier)
.like(!StringUtils.isEmpty(location),SysEquipment::getLocation,location)
.like(!StringUtils.isEmpty(manuDate),SysEquipment::getManuDate,manuDate)
.like(!StringUtils.isEmpty(buyDate),SysEquipment::getBuyDate,buyDate)
.eq(enable != null,SysEquipment::isEnable,enable)
.ge(startTime != null,SysEquipment::getCreateTime,startTime)
.le(endTime != null,SysEquipment::getCreateTime,endTime)
.orderByDesc(SysEquipment::getCreateTime);
PageHelper.startPage(vo.getPage(), vo.getPageSize());
List<SysEquipment> equipments = equipmentMapper.selectList(wrapper);
PageResult<SysEquipment> pageResult = new PageResult<>(equipments);
int equipmentNum = equipments.size();
List<EquipmentVo> list = new ArrayList<>(equipmentNum);
equipments.forEach(equipment -> {
list.add(new EquipmentVo(equipment));
});
return new PageResult<>(pageResult.getTotal(),list);
}
@UserAction("'添加设备:'+ #equipment.name")
public R add(SysEquipment equipment){
if (isNameExist(equipment.getName(), null)) {
return R.fail(String.format("添加失败,设备【%s】已存在", equipment.getName()));
}
int rows = equipmentMapper.insert(equipment);
return rows > 0 ? R.success("添加成功") : R.fail("添加失败");
}
@UserAction("'修改设备' + #equipment.name")
public R update(SysEquipment equipment){
Integer id = equipment.getId();
String name = equipment.getName();
if(isNameExist(name,id)) {
return R.fail(String.format("修改失败,设备【%s】已存在", name));
}
equipmentMapper.update(
null,
Wrappers.lambdaUpdate(SysEquipment.class)
.set(SysEquipment::getName, name)
.set(SysEquipment::getSupplier, equipment.getSupplier())
.set(SysEquipment::getIntroduction, equipment.getIntroduction())
.set(SysEquipment::getManuDate,equipment.getManuDate())
.set(SysEquipment::getBuyDate,equipment.getBuyDate())
.set(SysEquipment::getSpec, equipment.getSpec())
.set(SysEquipment::getLocation, equipment.getLocation())
.set(SysEquipment::isEnable, equipment.isEnable())
.eq(SysEquipment::getId, id)
);
return R.success("修改成功");
}
@UserAction("'删除设备:'+ #equipment.name")
public R del(SysEquipment equipment) {
int rows = equipmentMapper.delete(
Wrappers.lambdaQuery(SysEquipment.class)
.eq(SysEquipment::getId, equipment.getId())
.eq(SysEquipment::isEnable, false)
);
return rows > 0 ? R.success("删除成功") : R.fail("删除失败,请刷新重试");
}
private boolean isNameExist(String name, Integer id) {
Integer num = equipmentMapper.selectCount(
Wrappers.lambdaQuery(SysEquipment.class)
.eq(SysEquipment::getName, name)
.ne(id != null, SysEquipment::getId, id)
);
return num != null && num > 0;
}
}

@ -84,22 +84,22 @@ public class SysSupplierService {
return new PageResult<>(pageResult.getTotal(), list);
}
@UserAction("'添加供应商:'+ #supplier.name")
@UserAction("'添加试剂厂商:'+ #supplier.name")
public R add(SysSupplier supplier) {
if (isNameExist(supplier.getName(), null)) {
return R.fail(String.format("添加失败,供应商【%s】已存在", supplier.getName()));
return R.fail(String.format("添加失败,试剂厂商【%s】已存在", supplier.getName()));
}
int rows = supplierMapper.insert(supplier);
return rows > 0 ? R.success("添加成功") : R.fail("添加失败");
}
@UserAction("'修改供应商:'+ #supplier.name")
@UserAction("'修改试剂厂商:'+ #supplier.name")
public R update(SysSupplier supplier) {
Integer id = supplier.getId();
String name = supplier.getName();
if (isNameExist(name, id)) {
return R.fail(String.format("修改失败,供应商【%s】已存在", name));
return R.fail(String.format("修改失败,试剂厂商【%s】已存在", name));
}
supplierMapper.update(
@ -117,7 +117,7 @@ public class SysSupplierService {
return R.success("修改成功");
}
@UserAction("'删除供应商:'+ #supplier.name")
@UserAction("'删除试剂厂商:'+ #supplier.name")
public R del(SysSupplier supplier) {
int rows = supplierMapper.delete(
Wrappers.lambdaQuery(SysSupplier.class)

@ -1,8 +1,8 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/jxc_admin?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true
url: jdbc:mysql://localhost:3306/git_project?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true
username: root
password: 123456
password: 226482
redis:
host: localhost
port: 6379

@ -5,7 +5,7 @@ module.exports = {
contextPath,
//页面标题、登录注册页的标题
title: 'BiuBiuBiu~',
title: '试剂管理系统',
//logo地址
logo: `${contextPath}static/img/logo.svg`,

@ -1,6 +1,6 @@
<template functional>
<div class="copyright">
Copyright © 2020 - <a href="https://github.com/toesbieya" target="_blank">toesbieya</a>
Copyright © 2022 - 智慧应用软件研发工作室
</div>
</template>

@ -16,18 +16,6 @@ const router = {
component: 'admin/system/menu/',
meta: {title: '菜单管理', noCache: true}
},
{
path: 'role',
name: 'roleManagement',
component: 'admin/system/role/',
meta: {title: '角色管理'}
},
{
path: 'user',
name: 'userManagement',
component: 'admin/system/user/',
meta: {title: '用户管理'}
},
{
path: 'category',
name: 'categorySetting',
@ -44,8 +32,45 @@ const router = {
path: 'supplier',
name: 'supplierManagement',
component: 'admin/system/supplier/',
meta: {title: '供应商管理'}
}
meta: {title: '试剂厂商管理'}
},
{
path:'equipment',
name: 'equipmentManagement',
component: 'admin/system/equipment/',
meta: {title: '设备管理'}
},
{
path:'position',
name: 'positionManagement',
component: 'admin/system/position/',
meta: {title: '仓位管理'}
},
{
path:'reagent',
name: 'reagentManagement',
component: 'admin/system/reagent/',
meta: {title: '试剂管理'}
},
{
path:'storehouse',
name: 'storehouseManagement',
component: 'admin/system/storehouse/',
meta: {title: '仓库管理'}
},
{
path:'cargoSpace',
name: 'cargoSpaceManagement',
component: 'admin/system/cargoSpace/',
meta: {title: '货位管理'}
},
{
path:'dictionary ',
name: 'dictionary Management',
component: 'admin/system/dictionary /',
meta: {title: '字典管理'}
},
]
}

@ -1,8 +0,0 @@
/*顶级菜单:开发用的页面*/
import component from "@/view/dev"
export default {
path: '/dev',
component,
meta: {title: '开发专用页面', icon: 'svg-develop', noAuth: true, noCache: true}
}

@ -1,4 +0,0 @@
export default {
path: 'https://doc.toesbieya.cn/jxc-admin',
meta: {title: '文档', icon: 'svg-documentation', noAuth: true}
}

@ -175,14 +175,14 @@ export function mergeObj(target, source) {
}
/**
* 日期格式化
* 日期格式化到毫秒
*
* @param fmt {*|string} 格式y(+..y)-M(+M)-d(+d)-H(+H)-m(+m)-s(+s)-S-毫秒
* @param date {Date} 可选被格式化的日期
* @return {string} 格式化后的日期字符串
*/
export function timeFormat(fmt, date = new Date()) {
if (isEmpty(fmt)) fmt = 'yyyy-MM-dd HH:mm:ss'
if (isEmpty(fmt)) fmt = 'yyyy-MM-dd'
const o = {
"M+": date.getMonth() + 1, //月份
@ -209,6 +209,8 @@ export function timeFormat(fmt, date = new Date()) {
return fmt
}
export function throttle(func, delay = 100) {
let timeoutID
let lastExec = 0

@ -140,6 +140,7 @@ export default {
},
clearForm() {
resetObj(this.form)
this.$nextTick(() => this.$refs.form.clearValidate())
},

@ -1,7 +1,7 @@
<template>
<list-page :data="listPageConfig">
<template v-slot:searchForm>
<el-form-item label="供应商">
<el-form-item label="试剂厂商">
<el-input v-model="searchForm.name" clearable maxlength="50"/>
</el-form-item>
<el-form-item label="行政区域">
@ -42,7 +42,7 @@
<template v-slot:tableColumn>
<el-table-column align="center" label="#" type="index" width="80"/>
<el-table-column align="center" label="供应商" prop="name" show-overflow-tooltip/>
<el-table-column align="center" label="试剂厂商" prop="name" show-overflow-tooltip/>
<el-table-column align="center" label="行政区域" prop="regionName" show-overflow-tooltip/>
<el-table-column align="center" label="地 址" prop="address" show-overflow-tooltip/>
<el-table-column align="center" label="联系人" prop="linkman" show-overflow-tooltip/>

Loading…
Cancel
Save