提交 71b86ebb authored 作者: 133's avatar 133

Merge branch 'bug' of git.yfzx.zjtys.com.cn:matrix/device-back

...@@ -43,7 +43,7 @@ public class DeviceLog { ...@@ -43,7 +43,7 @@ public class DeviceLog {
/** /**
* 日志类型(默认0为装备日志,1为设备日志) * 日志类型(默认0为装备日志,1为设备日志)
*/ */
@ApiModelProperty(value = "日志类型(默认0为装备日志,1为设备日志)") @ApiModelProperty(value = "日志类型(默认0为装备日志,1为配套设备日志)")
private Integer type = 0; private Integer type = 0;
/** /**
* 装备id * 装备id
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId> <artifactId>misc</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-file</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId> <artifactId>config</artifactId>
......
...@@ -2,6 +2,8 @@ package com.tykj.dev.device.matching.controller; ...@@ -2,6 +2,8 @@ package com.tykj.dev.device.matching.controller;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLogDao; import com.tykj.dev.device.library.repository.DeviceLogDao;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService; import com.tykj.dev.device.library.service.DeviceLogService;
...@@ -43,10 +45,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -43,10 +45,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -104,6 +103,9 @@ public class MatchingDeviceController { ...@@ -104,6 +103,9 @@ public class MatchingDeviceController {
@Autowired @Autowired
private RfidService rfidService; private RfidService rfidService;
@ApiOperation(value = "添加配套设备", notes = "可以通过这个接口添加配套设备") @ApiOperation(value = "添加配套设备", notes = "可以通过这个接口添加配套设备")
@PostMapping(value = "/add") @PostMapping(value = "/add")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -116,6 +118,7 @@ public class MatchingDeviceController { ...@@ -116,6 +118,7 @@ public class MatchingDeviceController {
} }
//添加账单 //添加账单
MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillSaveVo.toDo(); MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillSaveVo.toDo();
matchingDeviceBillEntity.setFileRets(FilesUtil.stringFileToList(matchingDeviceBillSaveVo.getFileRets()));
MatchingDeviceBill m = matchingDeviceBillService.addEntity(matchingDeviceBillEntity); MatchingDeviceBill m = matchingDeviceBillService.addEntity(matchingDeviceBillEntity);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("x"); stringBuffer.append("x");
...@@ -142,10 +145,10 @@ public class MatchingDeviceController { ...@@ -142,10 +145,10 @@ public class MatchingDeviceController {
stringBuffer.append(d.getId()); stringBuffer.append(d.getId());
stringBuffer.append("x"); stringBuffer.append("x");
//存装备日志 //存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(1, d.getId(), "发起新增配套", fileVoList,taskBto.getId()); DeviceLogDto deviceLogDto = new DeviceLogDto(1, d.getId(), "发起新增配套", fileVoList,taskBto1.getId());
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
} }
rfidService.printString(printVos); // rfidService.printString(printVos);
//set账单新增设备详情 //set账单新增设备详情
m.setDeviceDetail(stringBuffer.toString()); m.setDeviceDetail(stringBuffer.toString());
matchingDeviceBillService.update(m); matchingDeviceBillService.update(m);
...@@ -245,6 +248,8 @@ public class MatchingDeviceController { ...@@ -245,6 +248,8 @@ public class MatchingDeviceController {
return ResponseEntity.ok(list); return ResponseEntity.ok(list);
} }
@ApiOperation(value = "更新配套设备", notes = "可以通过这个接口更新配套设备") @ApiOperation(value = "更新配套设备", notes = "可以通过这个接口更新配套设备")
@PostMapping("/update") @PostMapping("/update")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -312,6 +317,7 @@ public class MatchingDeviceController { ...@@ -312,6 +317,7 @@ public class MatchingDeviceController {
TaskBto taskBto = taskService.get(billId, BusinessEnum.ADD_MATCHING_DEVICE.id); TaskBto taskBto = taskService.get(billId, BusinessEnum.ADD_MATCHING_DEVICE.id);
//获取账单 //获取账单
MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillService.getOne(billId); MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillService.getOne(billId);
matchingDeviceBillEntity.setFileRetList(FilesUtil.stringFileToList(matchingDeviceBillEntity.getFileRets()));
macthingDetailVo.setMatchingDeviceBill(matchingDeviceBillEntity); macthingDetailVo.setMatchingDeviceBill(matchingDeviceBillEntity);
//获取设备 //获取设备
List<Integer> integerList = StringSplitUtil.userIdSplit(matchingDeviceBillEntity.getDeviceDetail()); List<Integer> integerList = StringSplitUtil.userIdSplit(matchingDeviceBillEntity.getDeviceDetail());
...@@ -329,6 +335,21 @@ public class MatchingDeviceController { ...@@ -329,6 +335,21 @@ public class MatchingDeviceController {
return ResponseEntity.ok(macthingDetailVo); return ResponseEntity.ok(macthingDetailVo);
} }
@ApiOperation(value = "根据任务id查询相关单据", notes = "根据任务id查询相关单据")
@GetMapping(value = "/fileMap/{taskId}")
public ResponseEntity selectFileRetMap(@PathVariable("taskId") int taskId) {
Map<String,List<FileRet>> map=new HashMap<>();
//获取业务
TaskBto taskBto = taskService.get(taskId);
//获取账单
MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillService.getOne(taskBto.getBillId());
//获取设备
map.put("配发单",FilesUtil.stringFileToList(matchingDeviceBillEntity.getFileRets()));
return ResponseEntity.ok(map);
}
@ApiOperation(value = "查询所有配套设备型号", notes = "查询所有配套设备型号") @ApiOperation(value = "查询所有配套设备型号", notes = "查询所有配套设备型号")
@GetMapping(value = "/selectAllModel") @GetMapping(value = "/selectAllModel")
public ResponseEntity selectAllModel() { public ResponseEntity selectAllModel() {
......
package com.tykj.dev.device.matching.subject.domin; package com.tykj.dev.device.matching.subject.domin;
import com.tykj.dev.device.file.entity.FileRet;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -13,6 +14,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; ...@@ -13,6 +14,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* entity class for matching_device_bill * entity class for matching_device_bill
...@@ -99,4 +101,11 @@ public class MatchingDeviceBill { ...@@ -99,4 +101,11 @@ public class MatchingDeviceBill {
@ApiModelProperty(value = "区块链记录id") @ApiModelProperty(value = "区块链记录id")
private String recordId; private String recordId;
@Column(name = "file_rets",columnDefinition = "TEXT")
private String fileRets;
@Transient
@ApiModelProperty(value = "配发文件集合对象")
private List<FileRet> fileRetList ;
} }
package com.tykj.dev.device.matching.subject.vo; package com.tykj.dev.device.matching.subject.vo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill; import com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -37,6 +38,8 @@ public class MatchingDeviceBillSaveVo { ...@@ -37,6 +38,8 @@ public class MatchingDeviceBillSaveVo {
@ApiModelProperty(value = "审核人id") @ApiModelProperty(value = "审核人id")
private Integer userbId; private Integer userbId;
private List<FileRet> fileRets;
@Valid @Valid
@NotEmpty(message = "matchingDeviceSaveVoList不能为空") @NotEmpty(message = "matchingDeviceSaveVoList不能为空")
@ApiModelProperty(value = "配套设备列表") @ApiModelProperty(value = "配套设备列表")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论