提交 ead90422 authored 作者: zhoushaopan's avatar zhoushaopan

feat(自查模块): 新增了日常检查流程

新增了日常检查流程
上级 22ab57ad
......@@ -57,6 +57,9 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport {
@Value("${spring.jackson.local-date-format:yyyy-MM-dd}")
private String localDatePattern;
@Value("${qrcode.path}")
private String qrCodePath;
@Bean(name = "format")
DateTimeFormatter format() {
return DateTimeFormatter.ofPattern(formatValue);
......@@ -68,6 +71,7 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport {
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/file/**").addResourceLocations("file:" + path);
registry.addResourceHandler("/code/**").addResourceLocations("file:" + qrCodePath);
//静态资源
registry.addResourceHandler( "/**" ).addResourceLocations( "classpath:/static/" );
// swagger handler
......
......@@ -865,7 +865,7 @@ public class DeviceLibraryController {
//添加装备日志
//修改型号就要修改列装id
PackingVo packingVo = libraryUpdateVo.getPackingVo();
String remarkModel = "将装备的型号由" + deviceLibraryEntity.getModel() + "改为" + packingVo.getModel();
String remarkModel = "将序列号为:"+deviceLibraryEntity.getSeqNumber()+"装备的型号由" + deviceLibraryEntity.getModel() + "改为" + packingVo.getModel();
String remarkType = "";
String remarkName = "";
String remarkMatchingRange = "";
......@@ -873,17 +873,17 @@ public class DeviceLibraryController {
deviceLibraryEntity.setPackingId(packingVo.getPackingId());
if (!deviceLibraryEntity.getName().equals(packingVo.getName())){
remarkName = "将装备的名称由" + deviceLibraryEntity.getName() + "改为" + packingVo.getName();
remarkName = "将序列号为:"+deviceLibraryEntity.getSeqNumber()+"装备的名称由" + deviceLibraryEntity.getName() + "改为" + packingVo.getName();
deviceLibraryEntity.setName(packingVo.getName());
}
//修改形态
if (!deviceLibraryEntity.getType().equals(packingVo.getType())){
remarkType= "将装备的形态由" + deviceLibraryEntity.getTypeName() + "改为" + packingVo.getTypeName();
remarkType= "将序列号为"+deviceLibraryEntity.getSeqNumber()+"装备的形态由" + deviceLibraryEntity.getTypeName() + "改为" + packingVo.getTypeName();
deviceLibraryEntity.setType(packingVo.getType());
}
//修改配用范围
if (!deviceLibraryEntity.getMatchingRange().equals(packingVo.getMatchingRange())){
remarkMatchingRange = "将装备的配用范围由" + deviceLibraryEntity.getMatchingRangeName() + "改为" + packingVo.getMatchingRangeName();
remarkMatchingRange = "将序列号为"+deviceLibraryEntity.getSeqNumber()+"装备的配用范围由" + deviceLibraryEntity.getMatchingRangeName() + "改为" + packingVo.getMatchingRangeName();
deviceLibraryEntity.setMatchingRange(packingVo.getMatchingRange());
}
String lastRemark = (remarkModel+remarkType+remarkName+remarkMatchingRange).replaceAll("\\\"", "");
......@@ -898,7 +898,7 @@ public class DeviceLibraryController {
list.add(units1.getUnitId());
list.add(units2.getUnitId());
List<Integer> userList = userCache.findAllByUnitsIdIn(list).stream().map(User::getUserId).collect(Collectors.toList());
MessageBto messageBto = new MessageBto(0, 0,userUtils.getCurrentUserUnitName()+lastRemark,
MessageBto messageBto = new MessageBto(0, 0,lastRemark,
userList,1,1);
messageService.add(messageBto);
}else {
......
......@@ -291,6 +291,7 @@ public class DeviceLibrary implements Serializable {
@ApiModelProperty(value = "状态",notes = "1 读取到 0 未读取到")
private Integer status;
// @Transient
// private DeviceLibraryPosition deviceLibraryPosition;
......
......@@ -49,6 +49,25 @@
<artifactId>commons-net</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.2.6</version>
</dependency>
</dependencies>
</project>
package com.tykj.dev.misc.qrcode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用于处理ZB传过来的数据
*
* @author Administrator
*/
public class DeviceDataUtil {
Map<Integer,String> stringMap = new HashMap<>();
int totalPage = -1;
/**
* 如果字符串完整了就返回True 否则返回 False
* @return 数据是否完整
*/
public Boolean addString(String str){
//解析当前页,总页数
// int firstFlagIndexOf = str.indexOf("Ǵ");
int firstFlagIndexOf = str.indexOf("!");
int currentPage = Integer.parseInt(str.substring(0,firstFlagIndexOf));
str = str.substring(firstFlagIndexOf+1);
// int secondFlagIndexOf = str.indexOf("Ǵ");
int secondFlagIndexOf = str.indexOf("!");
int totalPage = Integer.parseInt(str.substring(0, secondFlagIndexOf));
if (this.totalPage==-1){
this.totalPage = totalPage;
}
str = str.substring(secondFlagIndexOf+1);
stringMap.put(currentPage,str);
return stringMap.size() == totalPage;
}
public String getCompleteString(){
StringBuilder stringBuffer = new StringBuilder();
for (Integer integer : stringMap.keySet()) {
stringBuffer.append(stringMap.get(integer));
}
return stringBuffer.toString();
}
public static void main(String[] args) {
List<String> strings = new ArrayList<>();
strings.add("1!1!H4sIAAAAAAAAAKtWKkkszvZMUbIyMjQwNdABc/0Sc1OVrJSebZ35bOP853Man83Z9WJZ49ONDU/7J77Yuv35rJZn05c+3bHj2eKGZ/OXPtm9+2nXQiWI1pDKAqBWqDnORamJJakuQAw0zcjAyEjXwFTX0FLBwNjK0ACooTg5MQ8im1eak6OjlJJalpmc6pOZVJRYlJlarGQVXa2Um5+SmgNTkAd2GIRdArYJwk7OSE3ODkotLs0pAVtelJaZ4pxYlALylxLIotRCv9LcpNQiINfCwsLQxNTSyMzS0EypVoe2NpjT3AYLpdrYWgB+a8XlxgEAAA==");
DeviceDataUtil deviceDataUtil = new DeviceDataUtil();
for (int i = 0; i < strings.size(); i++) {
deviceDataUtil.addString(strings.get(i));
}
String json = GZIPUtils.uncompressToString(deviceDataUtil.getCompleteString());
System.out.println("json = " + json);
}
}
package com.tykj.dev.misc.qrcode;
/**
* @author zsp
* @create 2022/5/16 16:55
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.springframework.util.Base64Utils;
public class GZIPUtils {
public static final String GZIP_ENCODE_UTF_8 = "UTF-8";
public static final String GZIP_ENCODE_ISO_8859_1 = "ISO-8859-1";
/**
* 字符串压缩为GZIP字节数组
* @param str
* @return
*/
public static String compress(String str) {
return compress(str, GZIP_ENCODE_UTF_8);
}
/**
* 字符串压缩为GZIP字节数组
* @param str
* @param encoding
* @return
*/
public static String compress(String str, String encoding) {
if (str == null || str.length() == 0) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip;
try {
gzip = new GZIPOutputStream(out);
gzip.write(str.getBytes(encoding));
gzip.close();
} catch (IOException e) {
e.printStackTrace();
}
return Base64Utils.encodeToString(out.toByteArray());
}
/**
* 解压并返回String
* @param data
* @return
*/
public static String uncompressToString(String data) {
return uncompressToString(data, GZIP_ENCODE_UTF_8);
}
/**
* 解压
* @param data
* @param encoding
* @return
*/
public static String uncompressToString(String data, String encoding) {
byte[] bytes = Base64Utils.decodeFromString(data);
if (bytes == null || bytes.length == 0) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
try {
GZIPInputStream ungzip = new GZIPInputStream(in);
byte[] buffer = new byte[256];
int n;
while ((n = ungzip.read(buffer)) >= 0) {
out.write(buffer, 0, n);
}
return out.toString(encoding);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] args) {
List<String> strings = new ArrayList<>();
strings.add("1Ǵ1ǴH4sIAAAAAAAAAKtWKkkszvZMUbIyMjQwsNQBc/0Sc1OVrJSebZ35bOP853Man83Z9WJZ49ONDU/7J77Yuv35rJZn05c+3bHj2eKGZ/OXPtm9+2nXQiWI1pDKApBWQyjXuSg1sSTVBYiVrAzNTI0szAwNTSwNDAx0lIqTE/MgEnmlOTk6SimpZZnJqT6ZSUWJRZmpxRDhWgD5newOoAAAAA==");
DeviceDataUtil deviceDataUtil = new DeviceDataUtil();
for (int i = 0; i < strings.size(); i++) {
deviceDataUtil.addString(strings.get(i));
}
String json = GZIPUtils.uncompressToString(deviceDataUtil.getCompleteString());
}
}
package com.tykj.dev.misc.qrcode;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.qrcode.vo.TaskData;
import com.tykj.dev.misc.utils.JacksonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zsp
* @create 2022/5/19 10:29
*/
@Slf4j
@Component
public class QrCodeBillUtil {
@Value("${qrcode.path}")
private String qrCodePath;
@Value("${qrcode.preview.path}")
private String qrCodePreviewPath;
/**
* 创建工具类
*/
public List<String> createCode(TaskData taskData){
String join = JacksonUtil.toJSon(taskData);
List<String> code = getCodeNum(join);
List<String> preview = new ArrayList<>();
//总页数
if (code.size() > 0) {
int totalPage = code.size();
for (int i = 0; i < totalPage; i++) {
//拼接字符串 定义好的格式:当前页+特殊符号+总页数+特殊符号+内容
String data = (i + 1) + "!" + code.size() + "!" + code.get(i);
log.info("data:{}",data);
//放在二维码里面
try {
String codePath = QRCodeUtil.encode(data, null, qrCodePath, false);
codePath = qrCodePreviewPath + codePath;
preview.add(codePath);
return preview;
} catch (Exception e) {
}
}
}
return new ArrayList<>();
}
public TaskData parseCode(List<String> strings){
DeviceDataUtil deviceDataUtil = new DeviceDataUtil();
List<String> collect = strings.stream().sorted(Comparator.comparing(s -> {
int i = s.indexOf("!");
s = s.substring(0,i);
return Integer.valueOf(s);
})).distinct().collect(Collectors.toList());
//循环判断
Boolean flag = false;
for (int i = 0; i < collect.size(); i++) {
flag = deviceDataUtil.addString(collect.get(i));
}
if (!flag){
throw new ApiException("没有扫完");
}
String json = GZIPUtils.uncompressToString(deviceDataUtil.getCompleteString());
//解析
TaskData taskData = JacksonUtil.readValue(json, TaskData.class);
return taskData;
}
/**
* 生成二维码的个数以及页数
*
* @param data 源数据
* @return 生成二维码的个数以及页数
*/
public List<String> getCodeNum(String data) {
//先压缩和加密
String s = GZIPUtils.compress(data);
//然后截取
return QrStringSplitUtil.stringToList2(s, 900);
}
}
package com.tykj.dev.misc.qrcode;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* @author zsp
* @create 2022/5/16 14:06
*/
public class QrStringSplitUtil {
public static List<String> stringToList2(String str,int maxResult){
List<String> list = new ArrayList<>();
//按照该长度进行字符串的分割
//将输入的字符串分割为几份
//总记录数:totalRecord
//每页最大记录数:maxResult
//其中maxResult-1就是totalRecord/maxResult的最大的余数
//总页数:totalPage
int totalRecord = str.length();
int totalPage = (totalRecord + maxResult -1) / maxResult;
//int size = str.length()/length+1;
System.out.println(totalRecord);
for (int i = 0; i < totalPage; i++) {
if (i==totalPage-1){
String substring = str.substring(i * maxResult, str.length());
list.add(substring);
}else {
String substring = str.substring(i * maxResult, (i + 1) * maxResult);
list.add(substring);
}
}
System.out.println(list);
return list;
}
public static String subString(String text, int start, int end, String encode) throws UnsupportedEncodingException {
//按照该长度进行字符串的分割
if( text == null || text == ""){
return null;
}
StringBuffer sb = new StringBuffer();
int currentLength = 0;
for( char c : text.toCharArray() )
{
currentLength += String_length(String.valueOf(c));
if( currentLength > start && currentLength <= end )
{
sb.append(c);
}else {
continue;
}
}
return sb.toString();
}
public static int String_length(String value) {
int valueLength = 0;
if (value!=null) {
String chinese = "[\u4e00-\u9fa5]";
for (int i = 0; i < value.length(); i++) {
String temp = value.substring(i, i + 1);
if (temp.matches(chinese)) {
valueLength += 2;
} else {
valueLength += 1;
}
}
}
return valueLength;
}
// public static void main(String[] args) throws UnsupportedEncodingException {
//// String str = "1234567890124564698797946532132132132156周";
// String str = "1中解大数据量的数量55";
// System.out.println("str = " + str.length());
// ArrayList<Object> objects = new ArrayList<>();
// //总记录数:totalRecord
// //每页最大记录数:maxResult
// //其中maxResult-1就是totalRecord/maxResult的最大的余数
// //总页数:totalPage
// int totalRecord = String_length(str);
// System.out.println("totalRecord = " + totalRecord);
// int maxResult = 7;
// int totalPage = (totalRecord + maxResult -1) / maxResult;
// for (int i = 1; i <= totalPage; i++) {
// String s = subString(str, (i-1)*maxResult, i*maxResult, "utf-8");
// System.out.println(s);
// objects.add(s);
// }
// System.out.println("split = " + objects);
// }
public static void main(String[] args) {
String str = "1234567890124564698797946532132132132156";
System.out.println("str = " + str.length());
List<String> list = stringToList2(str, 6);
System.out.println("list = " + list);
}
}
package com.tykj.dev.misc.qrcode.vo;
import lombok.Data;
/**
* @author zsp
* @create 2022/5/18 16:38
*/
@Data
public class DeviceCodeVO {
/**
* 型号
*/
private String model;
/**
* 装备名称
*/
private String name;
/**
* 类型
*/
private Integer type;
/**
* 检查结果(0:丢失,1:无误,2:新增)
*/
private Integer checkResult;
/**
* rfid卡号
*/
private String rfidCardId;
/**
* 序列号
*/
private String seqNumber;
}
package com.tykj.dev.misc.qrcode.vo;
import lombok.Data;
import java.util.List;
/**
* @author zsp
* @create 2022/5/16 13:18
*/
@Data
public class QrCodeVO {
private String data;
private Integer taskId;
/**
* 1 日常检查 0 常规检查
*/
private Integer type;
private String tas;
}
package com.tykj.dev.misc.qrcode.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* @author zsp
*/
@Data
public class TaskData {
public Integer taskId;
public String taskName;
/**
* 0 代表日常检查 1 自查 2 检查(核查的中的检查) 3 核查 4 出库 5入库
*/
public Integer taskType;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
public Date taskCreateDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
public Date scanDate;
List<DeviceCodeVO> deviceLibraries;
}
package com.tykj.dev.device.selfcheck.repository;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface SelfCheckUnitBillDao extends JpaRepository<SelfCheckUnitBill, Integer>, JpaSpecificationExecutor<SelfCheckUnitBill> {
/**
* 根据单位id进行查询
* @param unitId 单位id
* @return 实体对象
*/
SelfCheckUnitBill findByUnitId(Integer unitId);
}
......@@ -2,8 +2,10 @@ package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import com.tykj.dev.misc.qrcode.vo.TaskData;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......@@ -44,4 +46,20 @@ public interface SelfCheckBillService {
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
/**
* 生成二维码
* @param taskData
*/
// List<String> createQrcode(List<DeviceLibrary> deviceLibraryList);
// List<String> createQrcode(CreateCodeVO createCodeVO);
List<String> createQrcode(TaskData taskData);
/**
* 解析二维码
*/
List<DeviceLibrary> parseQrCode(List<String> strings);
Map<String,Object> selectDetail(Integer billId);
}
package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill;
/**
* @author zsp
*/
public interface SelfCheckUnitBillService {
SelfCheckUnitBill add(SelfCheckUnitBill selfCheckUnitBill);
SelfCheckUnitBill findByUnitId(Integer unitId);
}
package com.tykj.dev.device.selfcheck.service.impl;
import com.tykj.dev.device.selfcheck.repository.SelfCheckUnitBillDao;
import com.tykj.dev.device.selfcheck.service.SelfCheckUnitBillService;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill;
import com.tykj.dev.misc.utils.JacksonUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author zsp
* @create 2022/5/17 13:15
*/
@Service
public class SelfCheckUnitBillServiceImpl implements SelfCheckUnitBillService {
@Resource
private SelfCheckUnitBillDao selfCheckUnitBillDao;
@Override
public SelfCheckUnitBill add(SelfCheckUnitBill selfCheckUnitBill) {
selfCheckUnitBill.setDayDeviceList(JacksonUtil.toJSon(selfCheckUnitBill.getDeviceLibraryList()));
return selfCheckUnitBillDao.save(selfCheckUnitBill);
}
@Override
public SelfCheckUnitBill findByUnitId(Integer unitId) {
return selfCheckUnitBillDao.findByUnitId(unitId);
}
}
package com.tykj.dev.device.selfcheck.subject.domin;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -147,6 +148,17 @@ public class SelfCheckBill {
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房")
private Integer storageLocationId;
@ApiModelProperty(value = "是否是日常检查",notes = "0代表 常规检查, 1代表 日常检查")
private Integer isDayCheck = 0;
// @ApiModelProperty(value = "生成二维码的地址")
// @Column(name = "qr_code_path",columnDefinition = "TEXT")
// private String qrcodePath ;
@ApiModelProperty(value = "日常检查装备的集合")
@Column(name = "day_check_list",columnDefinition = "TEXT")
private String dayCheckList;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房, null代表是所有库房")
@Transient
private String storageLocationName;
......@@ -179,4 +191,20 @@ public class SelfCheckBill {
@Transient
private Integer taskId;
@Transient
@ApiModelProperty(name = "")
private Integer taskCreateDate;
@Transient
@ApiModelProperty("日常检查的设备列表")
private List<DeviceLibrary> dayDeviceLibraries;
@Transient
@ApiModelProperty("日常检查设备信息列表")
private List<DeviceLibrary> inDeviceLibraries;
@Transient
@ApiModelProperty("日常检查的设备新增设备列表")
private List<DeviceLibrary> newDeviceLibraries;
}
package com.tykj.dev.device.selfcheck.subject.domin;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* entity class for self_examination_bill
*
* @author zsp
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update self_check_unit_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("日常检查和单位的表")
public class SelfCheckUnitBill {
/**
* 主键id
*/
@Id
@GeneratedValue
@ApiModelProperty(name = "主键id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id;
/**
* 自查周期(1:月度,2:季度,3:年度,0:未设定周期)
*/
@ApiModelProperty(value = "单位id")
private Integer unitId;
/**
* 自查标题
*/
@ApiModelProperty(value = "装备记录详情")
@Column(name = "day_device_list",columnDefinition = "TEXT")
private String dayDeviceList;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@Transient
@ApiModelProperty(value = "选中的系统装备列表")
private List<DeviceLibrary> deviceLibraryList;
}
package com.tykj.dev.device.selfcheck.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("生成二维码的vo")
public class CreateCodeVO {
@ApiModelProperty(name = "1 日常检查 0 常规检查 ", example = "1")
private Integer type;
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(name = "任务id", example = "1")
private Integer taskId;
@ApiModelProperty(name = "任务名称", example = "1")
private String taskName;
@ApiModelProperty(value = "装备集合")
private List<DeviceLibrary> deviceLibraryList;
}
package com.tykj.dev.device.selfcheck.subject.vo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("更新日常检查的vo")
public class DayVO {
@ApiModelProperty(name = "业务id")
private Integer id;
@ApiModelProperty(value = "非在库装备集合")
private List<DeviceLibrary> unStockDevices;
@ApiModelProperty(name = "新增未记录装备RFID列表")
private List<String> newDeviceList;
@ApiModelProperty(value = "检查附件名")
private List<FileRet> checkFiles;
@ApiModelProperty(name = "自查详情", example = "10x21x", value = "自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增")
private String checkDetail;
@NotNull(message = "checkedCount不能为空")
@Min(value = 0,message = "checkedCount不能小于0")
@ApiModelProperty(name = "实查数量", example = "1")
private Integer checkedCount;
@ApiModelProperty(name = "任务id")
private Integer taskId;
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
@ApiModelProperty(name = "自查结果", example = "数量x0 0 缺失 1无误 2 新增")
private String checkResult;
}
......@@ -42,16 +42,16 @@ public class SelfCheckSaveVo {
@ApiModelProperty(name = "应查数量", example = "1")
private Integer checkingCount;
@NotNull(message = "checkedCount不能为空")
// @NotNull(message = "checkedCount不能为空")
@Min(value = 0,message = "checkedCount不能小于0")
@ApiModelProperty(name = "实查数量", example = "1")
private Integer checkedCount;
@NotNull(message = "checkResult不能为空")
// @NotNull(message = "checkResult不能为空")
@ApiModelProperty(name = "自查结果", example = "通过")
private String checkResult;
@NotNull(message = "checkDetail不能为空")
// @NotNull(message = "checkDetail不能为空")
@ApiModelProperty(name = "自查详情", example = "10x21x", value = "自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增")
private String checkDetail;
......@@ -67,6 +67,12 @@ public class SelfCheckSaveVo {
@ApiModelProperty(value = "手持终端信息")
private String handheldTerminalInformation;
@ApiModelProperty(value = "是否是日常检查",notes = "0代表 常规检查, 1代表 日常检查")
private Integer isDayCheck = 0;
@ApiModelProperty(value = "日常检查装备的集合")
private List<DeviceLibrary> dayCheckList ;
public SelfCheckBill toDo() {
SelfCheckBill selfExaminationBillEntity = new SelfCheckBill();
BeanUtils.copyProperties(this, selfExaminationBillEntity);
......
......@@ -113,6 +113,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/logout/impersonate*").permitAll()
.antMatchers("/packageVersion/getVersion","/equip/packageVersion/getVersion").permitAll()//
.antMatchers("/equip/file/llq/**").permitAll()
.antMatchers("/code/**","/equip/code/**").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// @Override
......@@ -155,7 +156,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) {
//swagger静态资源访问
web.ignoring().antMatchers("/v2/api-docs", "/v2/api-docs-ext", "/configuration/ui", "/swagger-resources/**", "/configuration/security", "/swagger-ui/", "/swagger-ui/**", "/swagger-ui.html", "/doc.html", "/webjars/**", "/swagger-resources/configuration/ui", "**/swagge‌​r-ui.html", "/static/**", "**/**/index.html", "**/index.html", "/**/index.html", "/js/**", "/css/**", "/fonds/**", "/img/**","/access/send","/user/s");
web.ignoring().antMatchers("/v2/api-docs", "/v2/api-docs-ext", "/configuration/ui", "/swagger-resources/**", "/configuration/security", "/swagger-ui/", "/swagger-ui/**", "/swagger-ui.html", "/doc.html", "/webjars/**", "/swagger-resources/configuration/ui", "**/swagger-ui.html", "/static/**", "**/**/index.html", "**/index.html", "/**/index.html", "/js/**", "/css/**", "/fonds/**", "/img/**","/access/send","/user/s");
}
@Bean
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论