2022年9月16日

dev
litao 3 years ago
parent 0ef80c4dcb
commit 20848903c6
  1. 38
      lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/ApplyDetail.java
  2. 3
      lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Goods.java
  3. 48
      lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Report.java
  4. 4
      lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java
  5. 93
      lab-service-api/lab-file-api/src/main/java/org/springblade/file/entity/EquipVerificationLog.java
  6. 4
      lab-service/lab-capital/src/main/java/org/springblade/lims/capital/service/impl/ApplyOrderServiceImpl.java
  7. 58
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/ApplyController.java
  8. 35
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java
  9. 2
      lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationController.java
  10. 56
      lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationLogController.java
  11. 36
      lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.java
  12. 25
      lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.xml
  13. 34
      lab-service/lab-file/src/main/java/org/springblade/file/service/IEquipVerificationLogService.java
  14. 50
      lab-service/lab-file/src/main/java/org/springblade/file/service/impl/EquipVerificationLogServiceImpl.java
  15. 27
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  16. 8
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java
  17. 1092
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java
  18. 10
      lab-service/lab-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@ -26,27 +26,21 @@ public class ApplyDetail extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 申领id
*/
@ApiModelProperty(value = "申领id") @ApiModelProperty(value = "申领id")
private Long applyId; private Long applyId;
@ApiModelProperty(value = "申领单号") @ApiModelProperty(value = "申领单号")
private String applyCode; private String applyCode;
/**
* 物品类型
*/
@ApiModelProperty(value = "物品类型(2:耗材,1:资产)") @ApiModelProperty(value = "物品类型(2:耗材,1:资产)")
private Integer type; private Integer type;
/**
* 物品编号
*/
@ApiModelProperty(value = "物品编号") @ApiModelProperty(value = "物品编号")
private String productCode; private String productCode;
/**
* 物品编号 @ApiModelProperty(value = "物品批次号")
*/ private String batchNum;
@ApiModelProperty(value = "物品id") @ApiModelProperty(value = "物品id")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long productId; private Long productId;
@ -57,24 +51,16 @@ public class ApplyDetail extends BaseEntity {
@ApiModelProperty(value = "是否危险品") @ApiModelProperty(value = "是否危险品")
private Integer danger; private Integer danger;
/** @ApiModelProperty(value = "申领数量")
* 申请数量
*/
@ApiModelProperty(value = "申请数量")
private Integer applyNum; private Integer applyNum;
/**
* 实际出库数量
*/
@ApiModelProperty(value = "实际出库数量") @ApiModelProperty(value = "实际出库数量")
private Integer outNum; private Integer outNum;
@ApiModelProperty(value = "实际出库数量") @ApiModelProperty(value = "异常变更数量")
@TableField(exist = false) @TableField(exist = false)
private Integer newOutNum; private Integer newOutNum;
/**
* 归还数量
*/
@ApiModelProperty(value = "归还数量") @ApiModelProperty(value = "归还数量")
private Integer returnNum; private Integer returnNum;
@ -82,15 +68,9 @@ public class ApplyDetail extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private Integer needReturnNum; private Integer needReturnNum;
/**
* 单位
*/
@ApiModelProperty(value = "单位") @ApiModelProperty(value = "单位")
private String unit; private String unit;
/**
* 归还时间
*/
@ApiModelProperty(value = "归还时间") @ApiModelProperty(value = "归还时间")
@DateTimeFormat( @DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss" pattern = "yyyy-MM-dd HH:mm:ss"

@ -93,4 +93,7 @@ public class Goods extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private List<ProductStoreDetial> detials; private List<ProductStoreDetial> detials;
@TableField(exist = false)
private String sort;
} }

@ -21,7 +21,9 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseEntity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
@ -42,64 +44,44 @@ public class Report extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 报损物品id
*/
@ApiModelProperty(value = "报损物品id") @ApiModelProperty(value = "报损物品id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long reportGoodsId; private Long reportGoodsId;
/**
* 报损物品名称
*/
@ApiModelProperty(value = "报损物品名称") @ApiModelProperty(value = "报损物品名称")
private String reportGoodsName; private String reportGoodsName;
/**
* 报损数量
*/
@ApiModelProperty(value = "报损数量") @ApiModelProperty(value = "报损数量")
private Integer reportNum; private Integer reportNum;
/**
* 报损原因 @ApiModelProperty(value = "批次数量")
*/ private String batchNum;
@ApiModelProperty(value = "报损原因") @ApiModelProperty(value = "报损原因")
private String reportReason; private String reportReason;
/**
* 报废申请人id
*/
@ApiModelProperty(value = "报废申请人id") @ApiModelProperty(value = "报废申请人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long scrapApplyerId; private Long scrapApplyerId;
/**
* 报废申请人名称
*/
@ApiModelProperty(value = "报废申请人名称") @ApiModelProperty(value = "报废申请人名称")
private String scrapApplyerName; private String scrapApplyerName;
/**
* 报废申请时间
*/
@ApiModelProperty(value = "报废申请时间") @ApiModelProperty(value = "报废申请时间")
private LocalDateTime scrapApplyerTime; private LocalDateTime scrapApplyerTime;
/**
* 报废审核人id
*/
@ApiModelProperty(value = "报废审核人id") @ApiModelProperty(value = "报废审核人id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long scrapCheckerId; private Long scrapCheckerId;
/**
* 报废审核人name
*/
@ApiModelProperty(value = "报废审核人name") @ApiModelProperty(value = "报废审核人name")
private String scrapCheckerName; private String scrapCheckerName;
/**
* 报废审核时间
*/
@ApiModelProperty(value = "报废审核时间") @ApiModelProperty(value = "报废审核时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime scrapCheckerTime; private LocalDateTime scrapCheckerTime;
/**
* 处理时间
*/
@ApiModelProperty(value = "处理时间") @ApiModelProperty(value = "处理时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

@ -65,6 +65,10 @@ public enum DictBizEnum {
* 是否留样 * 是否留样
*/ */
SIMPLE_NAME_TWO("simpleNameTwo"), SIMPLE_NAME_TWO("simpleNameTwo"),
/**
* 打印的url配置
*/
PRINT_URL("printUrl"),
; ;

@ -0,0 +1,93 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.file.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* 仪器检定管理实体类
*
* @author BladeX
* @since 2022-07-22
*/
@Data
@TableName("t_equip_verification_log")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "EquipVerification对象", description = "仪器检定管理")
public class EquipVerificationLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
@ApiModelProperty(value = "租户ID")
private String tenantId;
/**
* 设备id
*/
private String instrumentId;
/**
* 设备名称
*/
@ApiModelProperty(value = "设备名称")
private String equipName;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
private String equipModel;
/**
* 生产厂家或品牌
*/
@ApiModelProperty(value = "生产厂家或品牌")
private String manufacturerOrBrand;
/**
* 启用时间
*/
@ApiModelProperty(value = "启用时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime enableTime;
/**
* 上次检定时间
*/
@ApiModelProperty(value = "上次检定时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastVerificationTime;
/**
* 检定周期
*/
@ApiModelProperty(value = "检定周期(天)(业务字典 equip_verification_cycle)")
private Integer cycle;
/**
* 检定次数
*/
@ApiModelProperty(value = "检定次数")
private Integer total;
}

@ -37,7 +37,6 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
public class ApplyOrderServiceImpl extends BaseServiceImpl<ApplyOrderMapper, ApplyOrder> implements IApplyOrderService { public class ApplyOrderServiceImpl extends BaseServiceImpl<ApplyOrderMapper, ApplyOrder> implements IApplyOrderService {
private final IApplyOrderDetailService applyOrderDetailService; private final IApplyOrderDetailService applyOrderDetailService;
private final ICkOrderService ckOrderService; private final ICkOrderService ckOrderService;
@ -52,7 +51,6 @@ public class ApplyOrderServiceImpl extends BaseServiceImpl<ApplyOrderMapper, App
private final ApplyOrderDetailMapper applyOrderDetailMapper; private final ApplyOrderDetailMapper applyOrderDetailMapper;
@Override @Override
public IPage<ApplyOrderVO> selectApplyOrderPage(IPage<ApplyOrderVO> page, ApplyOrderVO applyOrder) { public IPage<ApplyOrderVO> selectApplyOrderPage(IPage<ApplyOrderVO> page, ApplyOrderVO applyOrder) {
return page.setRecords(baseMapper.selectApplyOrderPage(page, applyOrder)); return page.setRecords(baseMapper.selectApplyOrderPage(page, applyOrder));
@ -60,7 +58,6 @@ public class ApplyOrderServiceImpl extends BaseServiceImpl<ApplyOrderMapper, App
/** /**
* 添加申请单 * 添加申请单
*
* @param applyOrderVO * @param applyOrderVO
* @return * @return
*/ */
@ -75,7 +72,6 @@ public class ApplyOrderServiceImpl extends BaseServiceImpl<ApplyOrderMapper, App
applyOrder.setApplyTime(LocalDateTime.now()); applyOrder.setApplyTime(LocalDateTime.now());
applyOrder.setApplyUserId(AuthUtil.getUserId()); applyOrder.setApplyUserId(AuthUtil.getUserId());
applyOrder.setApplyUser(AuthUtil.getUserName()); applyOrder.setApplyUser(AuthUtil.getUserName());
// applyOrder.setIsDeleted(0);
if (applyOrder.getStatus() == null) { if (applyOrder.getStatus() == null) {
applyOrder.setStatus(0); applyOrder.setStatus(0);
} }

@ -3,6 +3,7 @@ package org.springblade.lims.goods.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mysql.cj.util.StringUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
@ -11,6 +12,8 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.lims.capital.entity.ProductStoreDetial;
import org.springblade.lims.capital.service.IProductStoreDetialService;
import org.springblade.lims.goods.entity.Apply; import org.springblade.lims.goods.entity.Apply;
import org.springblade.lims.goods.entity.ApplyDetail; import org.springblade.lims.goods.entity.ApplyDetail;
import org.springblade.lims.goods.entity.Goods; import org.springblade.lims.goods.entity.Goods;
@ -52,6 +55,8 @@ public class ApplyController extends BladeController {
private final ISysClient sysClient; private final ISysClient sysClient;
private final IProductStoreDetialService productStoreDetialService;
/** /**
* 1.分页 申领列表 * 1.分页 申领列表
*/ */
@ -205,6 +210,21 @@ public class ApplyController extends BladeController {
goods.setNum(goods.getNum() - applyDetail.getApplyNum()); goods.setNum(goods.getNum() - applyDetail.getApplyNum());
goodsService.updateById(goods); goodsService.updateById(goods);
} }
// 扣批次数量
String batchNum = applyDetail.getBatchNum();
if (batchNum != null && !"".equals(batchNum)) {
String[] split = batchNum.split(",");
for (String s : split) {
String[] strings = s.split(":");
LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId());
wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0]));
ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper);
int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]);
productStoreDetial.setNum(i);
productStoreDetialService.updateById(productStoreDetial);
}
}
} }
applyDetailService.saveBatch(detailList); applyDetailService.saveBatch(detailList);
} }
@ -293,7 +313,8 @@ public class ApplyController extends BladeController {
*/ */
@PostMapping("/update") @PostMapping("/update")
public void update(@RequestBody ApplyVO applyVO) { public void update(@RequestBody ApplyVO applyVO) {
Apply apply = BeanUtil.copy(applyVO, Apply.class); // Apply apply = BeanUtil.copy(applyVO, Apply.class);
Apply apply = applyService.getById(applyVO.getId());
apply.setIsUpdate(1); apply.setIsUpdate(1);
apply.setStatus(2); apply.setStatus(2);
applyService.updateById(apply); applyService.updateById(apply);
@ -303,12 +324,47 @@ public class ApplyController extends BladeController {
List<ApplyDetail> detailList = applyVO.getDetailList(); List<ApplyDetail> detailList = applyVO.getDetailList();
if (detailList != null && detailList.size() > 0) { if (detailList != null && detailList.size() > 0) {
for (ApplyDetail applyDetail : detailList) { for (ApplyDetail applyDetail : detailList) {
// 修改库存数量
Goods goods = goodsService.getById(applyDetail.getProductId()); Goods goods = goodsService.getById(applyDetail.getProductId());
Integer bigDecimal = goods.getNum() + applyDetail.getOutNum(); Integer bigDecimal = goods.getNum() + applyDetail.getOutNum();
Integer subtract = bigDecimal - applyDetail.getNewOutNum(); Integer subtract = bigDecimal - applyDetail.getNewOutNum();
goods.setNum(subtract); goods.setNum(subtract);
goodsService.updateById(goods); goodsService.updateById(goods);
applyDetail.setOutNum(applyDetail.getNewOutNum()); applyDetail.setOutNum(applyDetail.getNewOutNum());
// 修改批次数量
ApplyDetail detail = applyDetailService.getById(applyDetail.getId());
// 先恢复申领前数量
String num = detail.getBatchNum();
if (num != null && !"".equals(num)) {
String[] split = num.split(",");
for (String s : split) {
String[] strings = s.split(":");
LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId());
wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0]));
ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper);
int i = productStoreDetial.getNum() + Integer.parseInt(strings[1]);
productStoreDetial.setNum(i);
productStoreDetialService.updateById(productStoreDetial);
}
}
// 修改更改后数量
String batchNum = applyDetail.getBatchNum();
if (batchNum != null && !"".equals(batchNum)) {
String[] split = batchNum.split(",");
for (String s : split) {
String[] strings = s.split(":");
LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId());
wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0]));
ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper);
int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]);
productStoreDetial.setNum(i);
productStoreDetialService.updateById(productStoreDetial);
}
}
applyDetail.getBatchNum();
} }
applyDetailService.updateBatchById(detailList); applyDetailService.updateBatchById(detailList);
} }

@ -91,7 +91,7 @@ public class GoodsController extends BladeController {
if (goods.getLocation() != null) { if (goods.getLocation() != null) {
queryWrapper.eq(Goods::getLocation, goods.getLocation()); queryWrapper.eq(Goods::getLocation, goods.getLocation());
} }
queryWrapper.orderByDesc(Goods::getUpdateTime); queryWrapper.orderByDesc(Goods::getCreateTime);
IPage<Goods> page = goodsService.page(Condition.getPage(query), queryWrapper); IPage<Goods> page = goodsService.page(Condition.getPage(query), queryWrapper);
List<Goods> goodsList = page.getRecords(); List<Goods> goodsList = page.getRecords();
for (Goods goods1 : goodsList) { for (Goods goods1 : goodsList) {
@ -221,11 +221,6 @@ public class GoodsController extends BladeController {
//报损 //报损
@PostMapping("/report") @PostMapping("/report")
public void report(@RequestBody Report report) { public void report(@RequestBody Report report) {
// 修改库存
// Goods goods = goodsService.getById(report.getReportGoodsId());
// Integer goodsNum = goods.getNum();
// goods.setNum(goodsNum -= report.getReportNum());
// goodsService.updateById(goods);
// 报损记录 // 报损记录
report.setScrapApplyerId(AuthUtil.getUserId()); report.setScrapApplyerId(AuthUtil.getUserId());
report.setScrapApplyerName(AuthUtil.getUserName()); report.setScrapApplyerName(AuthUtil.getUserName());
@ -240,9 +235,25 @@ public class GoodsController extends BladeController {
Report byId = reportService.getById(report.getId()); Report byId = reportService.getById(report.getId());
// 修改库存 // 修改库存
Goods goods = goodsService.getById(byId.getReportGoodsId()); Goods goods = goodsService.getById(byId.getReportGoodsId());
Integer goodsNum = goods.getNum(); Integer goodsNum = goods.getNum() - byId.getReportNum();
goods.setNum(goodsNum -= byId.getReportNum()); goods.setNum(goodsNum);
goodsService.updateById(goods); goodsService.updateById(goods);
// 修改批次数量
String batchNum = byId.getBatchNum();
if (batchNum != null && !"".equals(batchNum)) {
String[] split = batchNum.split(",");
for (String s : split) {
String[] strings = s.split(":");
LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProductStoreDetial::getGoodsId, byId.getReportGoodsId());
wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0]));
ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper);
int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]);
productStoreDetial.setNum(i);
productStoreDetialService.updateById(productStoreDetial);
}
}
// 报损记录 // 报损记录
byId.setScrapCheckerId(AuthUtil.getUserId()); byId.setScrapCheckerId(AuthUtil.getUserId());
byId.setScrapCheckerName(AuthUtil.getUserName()); byId.setScrapCheckerName(AuthUtil.getUserName());
@ -276,8 +287,14 @@ public class GoodsController extends BladeController {
public R<IPage> inDetail(Goods goods, Query query) { public R<IPage> inDetail(Goods goods, Query query) {
LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProductStoreDetial> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProductStoreDetial::getGoodsId, goods.getId()); wrapper.eq(ProductStoreDetial::getGoodsId, goods.getId());
// wrapper.eq(ProductStoreDetial::getStatus, 0); if (goods.getStatus() != null) {
wrapper.eq(ProductStoreDetial::getStatus, goods.getStatus());
}
if (goods.getSort() != null && !"".equals(goods.getSort())) {
wrapper.orderByAsc(ProductStoreDetial::getCreateTime);
} else {
wrapper.orderByDesc(ProductStoreDetial::getCreateTime); wrapper.orderByDesc(ProductStoreDetial::getCreateTime);
}
IPage<ProductStoreDetial> page = productStoreDetialService.page(Condition.getPage(query), wrapper); IPage<ProductStoreDetial> page = productStoreDetialService.page(Condition.getPage(query), wrapper);
List<ProductStoreDetial> records = page.getRecords(); List<ProductStoreDetial> records = page.getRecords();
for (ProductStoreDetial record : records) { for (ProductStoreDetial record : records) {

@ -38,7 +38,6 @@ import javax.validation.Valid;
/** /**
* 仪器检定管理 控制器 * 仪器检定管理 控制器
*
* @author BladeX * @author BladeX
* @since 2022-07-22 * @since 2022-07-22
*/ */
@ -51,6 +50,7 @@ public class EquipVerificationController extends BladeController {
private final IEquipVerificationService equipVerificationService; private final IEquipVerificationService equipVerificationService;
private final ILimsClient limsClient; private final ILimsClient limsClient;
/** /**
* 详情 * 详情
*/ */

@ -0,0 +1,56 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.file.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.file.entity.EquipVerificationLog;
import org.springblade.file.service.IEquipVerificationLogService;
import org.springframework.web.bind.annotation.*;
/**
* 仪器检定管理 控制器
*
* @author BladeX
* @since 2022-07-22
*/
@RestController
@AllArgsConstructor
@RequestMapping("/equipVerificationLog")
@Api(value = "仪器检定记录", tags = "仪器检定记录")
public class EquipVerificationLogController extends BladeController {
private final IEquipVerificationLogService equipVerificationLogService;
@GetMapping("/list")
public R<IPage> list(EquipVerificationLog equipVerificationLog, Query query) {
LambdaQueryWrapper<EquipVerificationLog> wrapper = new LambdaQueryWrapper<>();
if (equipVerificationLog.getEquipName() != null && !"".equals(equipVerificationLog.getEquipName())) {
wrapper.like(EquipVerificationLog::getEquipName,equipVerificationLog.getEquipName()).or()
.like(EquipVerificationLog::getEquipModel,equipVerificationLog.getEquipName()).or()
.like(EquipVerificationLog::getManufacturerOrBrand,equipVerificationLog.getEquipName());
}
wrapper.orderByDesc(EquipVerificationLog::getCreateTime);
return R.data(equipVerificationLogService.page(Condition.getPage(query), wrapper));
}
}

@ -0,0 +1,36 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.file.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.file.entity.EquipVerification;
import org.springblade.file.entity.EquipVerificationLog;
import org.springblade.file.vo.EquipVerificationVO;
import java.util.List;
/**
* 仪器检定管理 Mapper 接口
*
* @author BladeX
* @since 2022-07-22
*/
public interface EquipVerificationLogMapper extends BaseMapper<EquipVerificationLog> {
}

@ -0,0 +1,25 @@
<?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="org.springblade.file.mapper.EquipVerificationLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="equipVerificationResultMap" type="org.springblade.file.entity.EquipVerificationLog">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="is_deleted" property="isDeleted"/>
<result column="status" property="status"/>
<result column="equip_name" property="equipName"/>
<result column="equip_model" property="equipModel"/>
<result column="manufacturer_or_brand" property="manufacturerOrBrand"/>
<result column="enable_time" property="enableTime"/>
<result column="last_verification_time" property="lastVerificationTime"/>
<result column="cycle" property="cycle"/>
<result column="total" property="total"/>
</resultMap>
</mapper>

@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.file.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.file.entity.EquipVerification;
import org.springblade.file.entity.EquipVerificationLog;
import org.springblade.file.vo.EquipVerificationVO;
/**
* 仪器检定管理 服务类
*
* @author BladeX
* @since 2022-07-22
*/
public interface IEquipVerificationLogService extends BaseService<EquipVerificationLog> {
}

@ -0,0 +1,50 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.file.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.file.entity.EquipVerification;
import org.springblade.file.entity.EquipVerificationLog;
import org.springblade.file.enums.EquipVerificationEnum;
import org.springblade.file.mapper.EquipVerificationLogMapper;
import org.springblade.file.mapper.EquipVerificationMapper;
import org.springblade.file.service.IEquipVerificationLogService;
import org.springblade.file.service.IEquipVerificationService;
import org.springblade.file.vo.EquipVerificationVO;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
/**
* 仪器检定管理 服务实现类
*
* @author BladeX
* @since 2022-07-22
*/
@Service
public class EquipVerificationLogServiceImpl extends BaseServiceImpl<EquipVerificationLogMapper, EquipVerificationLog> implements IEquipVerificationLogService {
}

@ -18,6 +18,7 @@ import com.spire.doc.documents.HorizontalAlignment;
import com.spire.doc.documents.Paragraph; import com.spire.doc.documents.Paragraph;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
@ -827,6 +828,10 @@ public class EntrustController extends BladeController {
map.put("ywc", service.count(queryWrapper)); map.put("ywc", service.count(queryWrapper));
queryWrapper.clear(); queryWrapper.clear();
queryWrapper.eq("entrust_status", "-1");
map.put("yzf", service.count(queryWrapper));
queryWrapper.clear();
// queryWrapper.eq("entrust_status", "-1"); // queryWrapper.eq("entrust_status", "-1");
// map.put("sb", service.count(queryWrapper)); // map.put("sb", service.count(queryWrapper));
// } // }
@ -1627,4 +1632,26 @@ public class EntrustController extends BladeController {
public void repairPrint(String id, HttpServletResponse response) { public void repairPrint(String id, HttpServletResponse response) {
service.repairPrint(id, response); service.repairPrint(id, response);
} }
/**
* 26.委托单报废
*/
@PostMapping("/entrustScrap")
public R entrustScrap(@RequestParam String id) {
// 修改委托单状态
Entrust entrust = new Entrust();
entrust.setId(Long.valueOf(id));
entrust.setEntrustStatus("-1");
// 修改检测
LambdaQueryWrapper<Examine> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Examine::getEntrustId, id);
List<Examine> examineList = examineService.list(wrapper);
if (examineList != null && examineList.size() > 0) {
for (Examine examine : examineList) {
examine.setStatus(-1);
}
examineService.updateBatchById(examineList);
}
return R.status(service.updateById(entrust));
}
} }

@ -287,8 +287,8 @@ public class ExamineController extends BladeController {
if ("4".equals(examine.getEntrustStatus())) { if ("4".equals(examine.getEntrustStatus())) {
wrapper.eq(Examine::getStatus, 1); wrapper.eq(Examine::getStatus, 1);
} }
//审核驳回 //审核作废
if ("5".equals(examine.getEntrustStatus())) { if ("-1".equals(examine.getEntrustStatus())) {
wrapper.eq(Examine::getStatus, -1); wrapper.eq(Examine::getStatus, -1);
} }
// 模糊查询 // 模糊查询
@ -332,7 +332,7 @@ public class ExamineController extends BladeController {
@GetMapping("/getExmineStatusAndCount") @GetMapping("/getExmineStatusAndCount")
public R<Map<String, Integer>> getExmineStatusAndCount(String deptId) { public R<Map<String, Integer>> getExmineStatusAndCount(String deptId) {
Map<String, Integer> map = new HashMap<>(10); Map<String, Integer> map = new HashMap<>(10);
QueryWrapper queryWrapper = new QueryWrapper<Examine>(); QueryWrapper<Examine> queryWrapper = new QueryWrapper<Examine>();
queryWrapper.eq("is_distribute", 0); queryWrapper.eq("is_distribute", 0);
queryWrapper.eq("status", 0); queryWrapper.eq("status", 0);
@ -360,7 +360,7 @@ public class ExamineController extends BladeController {
queryWrapper.eq("status", -1); queryWrapper.eq("status", -1);
queryWrapper.eq("dept_id", deptId); queryWrapper.eq("dept_id", deptId);
map.put("bh", examineService.count(queryWrapper)); map.put("yzf", examineService.count(queryWrapper));
queryWrapper.clear(); queryWrapper.clear();
return R.data(map); return R.data(map);

@ -111,11 +111,19 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
@Override @Override
public boolean updateUserInfo(User user) { public boolean updateUserInfo(User user) {
String realPath = sysClient.getParamValue("electronic_signature_real_path").getData();
User byId = this.getById(user.getId());
if (byId.getElectronicSignature() != null && !"".equals(byId.getElectronicSignature())) {
File file = new File(realPath + byId.getElectronicSignature());
if (file.exists()) {
file.delete();
}
}
user.setPassword(null); user.setPassword(null);
if (!"".equals(user.getElectronicSignature()) && user.getElectronicSignature() != null) { if (!"".equals(user.getElectronicSignature()) && user.getElectronicSignature() != null) {
Random random = new Random(); Random random = new Random();
String fileName = random.nextLong() + ".png"; String fileName = random.nextLong() + ".png";
String path = sysClient.getParamValue("electronic_signature_real_path").getData() + fileName; String path = realPath + fileName;
// byte[] bytes = Base64Utils.decodeFromString(user.getElectronicSignature()); // byte[] bytes = Base64Utils.decodeFromString(user.getElectronicSignature());
// byte[] decode = Base64.getMimeDecoder().decode(user.getElectronicSignature()); // byte[] decode = Base64.getMimeDecoder().decode(user.getElectronicSignature());

Loading…
Cancel
Save