Browse Source

feat:[资源库管理][仪器管理]存储位置

master
HanLong 2 months ago
parent
commit
9c2bf36a9a
6 changed files with 83 additions and 35 deletions
  1. +5
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  2. +5
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java
  3. +33
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java
  4. +27
    -8
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/YqForm.java
  5. +6
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/YqSearchForm.java
  6. +7
    -9
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java

+ 5
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java View File

@ -7,7 +7,6 @@ import com.hxhq.business.domain.*;
import com.hxhq.business.dto.gyzj.ListDto;
import com.hxhq.business.dto.sj.SjListDto;
import com.hxhq.business.enums.NormalEnum;
import com.hxhq.business.enums.SnTypeEnum;
import com.hxhq.business.form.common.GenSnForm;
import com.hxhq.business.form.common.SignForm;
import com.hxhq.business.form.gsp.GspSearchListForm;
@ -227,7 +226,7 @@ public class PublicController extends BaseController {
@GetMapping("/yqList")
public TableDataInfo yqList(YqSearchForm form)
{
form.setFridge(NormalEnum.no.getValue());
form.setCcwz(NormalEnum.no.getValue());
startPage();
List<Yq> list = yqService.queryList(form);
return getDataTable(list);
@ -289,15 +288,15 @@ public class PublicController extends BaseController {
}
/**
* 冰箱列表
* 存储位置列表
* @return
*/
@GetMapping("/fridgeList")
public AjaxResult getFridgeList(YqSearchForm form) {
@GetMapping("/storageLocation")
public AjaxResult getStorageLocation(YqSearchForm form) {
List<SysDept> superiorAndSubordinate = sysDeptService.getSuperiorAndSubordinate(SecurityUtils.getLoginUser().getSysUser().getDeptId());
List<Long> deptIdList = superiorAndSubordinate.stream().map(SysDept::getDeptId).collect(Collectors.toList());
form.setDeptIdList(deptIdList);
form.setFridge(NormalEnum.yes.getValue());
form.setCcwz(NormalEnum.yes.getValue());
List<Yq> list = yqService.queryList(form);
return success(list);
}

+ 5
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java View File

@ -91,6 +91,11 @@ public class YqController extends BaseController {
@PostMapping("/update")
@RequiresPermissions("business:resource:yq:bj")
public AjaxResult update(@RequestBody @Validated YqForm form) {
if(form.getCcwz() != null && form.getCcwz() == 1) {
form.setCcwzInfo("否");
} else {
form.setCcwzInfo("是");
}
SysDept sysDept = sysDeptService.selectDeptById(form.getBmId());
form.setBmMc(sysDept.getDeptName());
form.setQmrId(SecurityUtils.getUserId());

+ 33
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java View File

@ -2,6 +2,7 @@ package com.hxhq.business.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
@ -82,17 +83,43 @@ public class Yq extends MpBaseEntity {
*/
@NotNull(message = "请选择所温层")
@Compare(name = "温层")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String wc;
/** 是否是冰箱 1-否 10-是 */
private Integer fridge;
/** 是否是存储位置 1-否 10-是 */
private Integer ccwz;
public Integer getFridge() {
return fridge;
@Compare(name = "是否是存储位置")
@TableField(exist = false)
private String ccwzInfo;
/** 放置地点 */
@Compare(name = "放置地点")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String fzdd;
public String getCcwzInfo() {
return ccwzInfo;
}
public void setCcwzInfo(String ccwzInfo) {
this.ccwzInfo = ccwzInfo;
}
public Integer getCcwz() {
return ccwz;
}
public void setCcwz(Integer ccwz) {
this.ccwz = ccwz;
}
public String getFzdd() {
return fzdd;
}
public void setFridge(Integer fridge) {
this.fridge = fridge;
public void setFzdd(String fzdd) {
this.fzdd = fzdd;
}
public void setMc(String mc) {

+ 27
- 8
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/YqForm.java View File

@ -1,6 +1,5 @@
package com.hxhq.business.form.yq;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hxhq.common.core.annotation.Excel;
import org.hibernate.validator.constraints.Length;
@ -63,7 +62,6 @@ public class YqForm {
/**
* 温层
*/
@NotNull(message = "请选择所温层")
@Excel(name = "温层")
private String wc;
@ -72,8 +70,13 @@ public class YqForm {
@Length(max = 500, message = "备注不能超过500字")
private String remark;
/** 是否是冰箱 1-否 10-是 */
private Integer fridge;
/** 是否是存储位置 1-否 10-是 */
private Integer ccwz;
private String ccwzInfo;
/** 放置地点 */
private String fzdd;
/** 签名人密码 */
@NotNull(message = "请输入签名人密码")
@ -177,11 +180,27 @@ public class YqForm {
this.bmId = bmId;
}
public Integer getFridge() {
return fridge;
public Integer getCcwz() {
return ccwz;
}
public void setCcwz(Integer ccwz) {
this.ccwz = ccwz;
}
public String getFzdd() {
return fzdd;
}
public void setFzdd(String fzdd) {
this.fzdd = fzdd;
}
public String getCcwzInfo() {
return ccwzInfo;
}
public void setFridge(Integer fridge) {
this.fridge = fridge;
public void setCcwzInfo(String ccwzInfo) {
this.ccwzInfo = ccwzInfo;
}
}

+ 6
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/YqSearchForm.java View File

@ -24,8 +24,8 @@ public class YqSearchForm {
/** 部门名称 */
private String bmMc;
/** 是否是冰箱 1-否 10-是 */
private Integer fridge;
/** 是否是存储位置 1-否 10-是 */
private Integer ccwz;
private List<Long> deptIdList;
@ -37,12 +37,12 @@ public class YqSearchForm {
this.deptIdList = deptIdList;
}
public Integer getFridge() {
return fridge;
public Integer getCcwz() {
return ccwz;
}
public void setFridge(Integer fridge) {
this.fridge = fridge;
public void setCcwz(Integer ccwz) {
this.ccwz = ccwz;
}
public String getBmMc() {

+ 7
- 9
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java View File

@ -1,17 +1,12 @@
package com.hxhq.business.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.business.domain.MjyJcgj;
import com.hxhq.business.domain.YqJcgj;
import com.hxhq.business.enums.zykgl.JcgjlxEnum;
import com.hxhq.business.enums.zykgl.JcmcysEnum;
@ -19,9 +14,7 @@ import com.hxhq.business.form.yq.YqForm;
import com.hxhq.business.form.yq.YqSearchForm;
import com.hxhq.business.service.IYqJcgjService;
import com.hxhq.business.utils.ObjectCompareUtil;
import com.hxhq.common.core.domain.MpBaseEntity;
import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.domain.SysUser;
import com.hxhq.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
@ -75,8 +68,8 @@ public class YqServiceImpl extends ServiceImpl implements IYqServi
if(StringUtils.isNotEmpty(form.getBmMc())) {
queryWrapper.like("d.dept_name", form.getBmMc());
}
if(form.getFridge() != null) {
queryWrapper.eq("y.fridge", form.getFridge());
if(form.getCcwz() != null) {
queryWrapper.eq("y.ccwz", form.getCcwz());
}
if(CollectionUtils.isNotEmpty(form.getDeptIdList())) {
queryWrapper.in("y.bm_id", form.getDeptIdList());
@ -110,6 +103,11 @@ public class YqServiceImpl extends ServiceImpl implements IYqServi
if(yq == null) {
throw new ServiceException("仪器不存在或已删除");
}
if(yq.getCcwz() != null && yq.getCcwz() == 1) {
yq.setCcwzInfo("否");
} else {
yq.setCcwzInfo("是");
}
List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(yq, yqForm);
if (fieldChanges.size() == 0) {

Loading…
Cancel
Save