提交 91b2b287 authored 作者: Matrix's avatar Matrix

修改了装备模块不兼容的泛型部分

上级 de6f5485
...@@ -80,27 +80,27 @@ public class DeviceCheckController { ...@@ -80,27 +80,27 @@ public class DeviceCheckController {
@GetMapping("/area/{fatherId}") @GetMapping("/area/{fatherId}")
@ApiOperation(value = "查询指定区域下的所有区域信息") @ApiOperation(value = "查询指定区域下的所有区域信息")
public ResultObj findAreaUnderId(@PathVariable Integer fatherId) { public ResponseEntity<ResultObj> findAreaUnderId(@PathVariable Integer fatherId) {
return new ResultObj(areaRepo.findByFatherId(fatherId)); return ResponseEntity.ok(new ResultObj(areaRepo.findByFatherId(fatherId)));
} }
@ApiOperation(value = "根据id查询核查统计数据", notes = "可以通过这个接口查询核查统计数据") @ApiOperation(value = "根据id查询核查统计数据", notes = "可以通过这个接口查询核查统计数据")
@GetMapping("/stat/{id}") @GetMapping("/stat/{id}")
public ResultObj findStatById(@PathVariable Integer id) { public ResponseEntity<ResultObj> findStatById(@PathVariable Integer id) {
//还要查询出所有的 //还要查询出所有的
CheckStatVo statVoList = statRepo.findById(id) CheckStatVo statVoList = statRepo.findById(id)
.map(DeviceCheckStat::toVo) .map(DeviceCheckStat::toVo)
.orElse(CheckStatVo.empty()); .orElse(CheckStatVo.empty());
return new ResultObj(statVoList); return ResponseEntity.ok(new ResultObj(statVoList));
} }
@ApiOperation(value = "根据id查询核查详情数据", notes = "可以通过这个接口查询核查详情数据") @ApiOperation(value = "根据id查询核查详情数据", notes = "可以通过这个接口查询核查详情数据")
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ResultObj findDetail(@PathVariable Integer id) { public ResponseEntity<ResultObj> findDetail(@PathVariable Integer id) {
CheckDetailVo detailVoList = detailRepo.findById(id) CheckDetailVo detailVoList = detailRepo.findById(id)
.map(transUtil::CheckDetailDo2Vo) .map(transUtil::CheckDetailDo2Vo)
.orElse(null); .orElse(null);
return new ResultObj(detailVoList); return ResponseEntity.ok(new ResultObj(detailVoList));
} }
/** /**
...@@ -113,7 +113,7 @@ public class DeviceCheckController { ...@@ -113,7 +113,7 @@ public class DeviceCheckController {
*/ */
@ApiOperation(value = "发起核查", notes = "发起核查流程") @ApiOperation(value = "发起核查", notes = "发起核查流程")
@PostMapping("/check/bill") @PostMapping("/check/bill")
public ResultObj startManualCheck(@RequestBody CheckBillVo billVo) { public ResponseEntity<ResultObj> startManualCheck(@RequestBody CheckBillVo billVo) {
// 1. 添加发起核查bill记录 // 1. 添加发起核查bill记录
DeviceCheckBillEntity billDo = transUtil.checkBillVo2Do(billVo); DeviceCheckBillEntity billDo = transUtil.checkBillVo2Do(billVo);
billRepo.save(billDo); billRepo.save(billDo);
...@@ -156,7 +156,7 @@ public class DeviceCheckController { ...@@ -156,7 +156,7 @@ public class DeviceCheckController {
taskService.start(checkedTask); taskService.start(checkedTask);
} }
return new ResultObj(String.format("[%s]单位成功发起对 %s 单位的核查任务分发", startUnit.getName(), checkedUnitNames)); return ResponseEntity.ok(new ResultObj(String.format("[%s]单位成功发起对 %s 单位的核查任务分发", startUnit.getName(), checkedUnitNames)));
} }
...@@ -170,7 +170,7 @@ public class DeviceCheckController { ...@@ -170,7 +170,7 @@ public class DeviceCheckController {
*/ */
@ApiOperation(value = "专管员A核查详情单") @ApiOperation(value = "专管员A核查详情单")
@PutMapping("/detail/A/{id}") @PutMapping("/detail/A/{id}")
public ResponseEntity checkUserA(@PathVariable Integer id, public ResponseEntity<ResultObj> checkUserA(@PathVariable Integer id,
@RequestParam int assignUserId, @RequestParam int assignUserId,
@RequestParam String checkResult, @RequestParam String checkResult,
@RequestBody DevLibVo devLibVo) { @RequestBody DevLibVo devLibVo) {
...@@ -191,13 +191,13 @@ public class DeviceCheckController { ...@@ -191,13 +191,13 @@ public class DeviceCheckController {
*/ */
@ApiOperation(value = "专管员B核查详情单") @ApiOperation(value = "专管员B核查详情单")
@PutMapping("/detail/B/{id}") @PutMapping("/detail/B/{id}")
public ResponseEntity checkUserB(@PathVariable Integer id, public ResponseEntity<ResultObj> checkUserB(@PathVariable Integer id,
@RequestParam int checkStatus, @RequestParam int checkStatus,
@RequestParam(required = false, defaultValue = "0") int checkUserAId, @RequestParam(required = false, defaultValue = "0") int checkUserAId,
@RequestParam(required = false, defaultValue = "0") int checkUserBId) { @RequestParam(required = false, defaultValue = "0") int checkUserBId) {
if (checkStatus == 0) { if (checkStatus == 0) {
return ResponseEntity.status(400).body("checkStatus不应该为0!"); return ResponseEntity.status(400).body(new ResultObj("checkStatus不应该为0!"));
} }
//先更新checkUser //先更新checkUser
...@@ -237,7 +237,7 @@ public class DeviceCheckController { ...@@ -237,7 +237,7 @@ public class DeviceCheckController {
@ApiOperation(value = "核查组A/B确认核查详情单") @ApiOperation(value = "核查组A/B确认核查详情单")
@PutMapping("/detail/C/{id}") @PutMapping("/detail/C/{id}")
public ResponseEntity checkUserC(@PathVariable Integer id, public ResponseEntity<ResultObj> checkUserC(@PathVariable Integer id,
@RequestParam boolean pass) { @RequestParam boolean pass) {
TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id); TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id);
DeviceCheckDetailEntity currentDetail = detailRepo.findById(id).get(); DeviceCheckDetailEntity currentDetail = detailRepo.findById(id).get();
...@@ -289,7 +289,7 @@ public class DeviceCheckController { ...@@ -289,7 +289,7 @@ public class DeviceCheckController {
@ApiOperation(value = "统计数据确认") @ApiOperation(value = "统计数据确认")
@PostMapping("/stat/verify") @PostMapping("/stat/verify")
public ResponseEntity statConfirm(@RequestParam int statId) { public ResponseEntity<ResultObj> statConfirm(@RequestParam int statId) {
//将当前的统计task完结 //将当前的统计task完结
TaskBto currentTask = taskService.get(CONFIRM_CHECK_STAT.id, statId); TaskBto currentTask = taskService.get(CONFIRM_CHECK_STAT.id, statId);
currentTask = taskService.moveToEnd(currentTask); currentTask = taskService.moveToEnd(currentTask);
......
package com.tykj.dev.device.destroy.controller; package com.tykj.dev.device.destroy.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.enums.DestroyStatus;
import com.tykj.dev.device.destroy.entity.vo.*; import com.tykj.dev.device.destroy.entity.vo.*;
import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
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;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo; import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
...@@ -14,15 +18,12 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto; ...@@ -14,15 +18,12 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.common.BusinessEnum; import com.tykj.dev.device.task.subject.common.BusinessEnum;
import com.tykj.dev.device.task.subject.common.StatusEnum; import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.user.subject.entity.User; import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.AuthenticationUtils; import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.utils.ListUtil; import com.tykj.dev.misc.utils.ListUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil; import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.enums.DestroyStatus;
import com.tykj.dev.socket.MyWebSocket; import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -33,7 +34,6 @@ import org.springframework.data.domain.Page; ...@@ -33,7 +34,6 @@ import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -113,7 +113,7 @@ public class DeviceDestroyController { ...@@ -113,7 +113,7 @@ public class DeviceDestroyController {
@ApiOperation(value = "查询可销毁装备列表", notes = "通过这个接口查询可销毁装备接口") @ApiOperation(value = "查询可销毁装备列表", notes = "通过这个接口查询可销毁装备接口")
@PostMapping(value = "/devices") @PostMapping(value = "/devices")
public ResponseEntity<List<DeviceLibrary>> selectDevices(@RequestBody CanDestroyDeviceSelectVo canDestoryDeviceSelectVo) { public ResponseEntity selectDevices(@RequestBody CanDestroyDeviceSelectVo canDestoryDeviceSelectVo) {
DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo(); DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
BeanUtils.copyProperties(canDestoryDeviceSelectVo, deviceLibrarySelectVo); BeanUtils.copyProperties(canDestoryDeviceSelectVo, deviceLibrarySelectVo);
deviceLibrarySelectVo.setLifeStatus(Arrays.asList(2, 5, 12)); deviceLibrarySelectVo.setLifeStatus(Arrays.asList(2, 5, 12));
......
package com.tykj.dev.misc.utils; package com.tykj.dev.misc.utils;
import com.tykj.dev.misc.base.ResultObj;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -18,10 +19,10 @@ public class ResultUtil<T> { ...@@ -18,10 +19,10 @@ public class ResultUtil<T> {
* *
* @param data 获取的数据 * @param data 获取的数据
*/ */
public static <T> ResponseEntity<T> success(T data) { public static <T> ResponseEntity<ResultObj> success(T data) {
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8"); httpHeaders.add(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8");
return new ResponseEntity<>(data,httpHeaders,HttpStatus.OK); return new ResponseEntity<>(new ResultObj(data), httpHeaders, HttpStatus.OK);
} }
/** /**
...@@ -29,22 +30,22 @@ public class ResultUtil<T> { ...@@ -29,22 +30,22 @@ public class ResultUtil<T> {
* *
* @param data 获取的数据 * @param data 获取的数据
*/ */
public static <T> ResponseEntity<T> success(T data,HttpHeaders headers) { public static <T> ResponseEntity<ResultObj> success(T data, HttpHeaders headers) {
return new ResponseEntity<>(data,headers,HttpStatus.OK); return new ResponseEntity<>(new ResultObj(data), headers, HttpStatus.OK);
} }
/** /**
* 失败返回结果 * 失败返回结果
*/ */
public static <T> ResponseEntity<T> failed() { public static <T> ResponseEntity<ResultObj> failed() {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
} }
/** /**
* 失败返回结果 * 失败返回结果
*/ */
public static <T> ResponseEntity<T> failed(T content) { public static <T> ResponseEntity<ResultObj> failed(T content) {
return new ResponseEntity<>(content,HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(new ResultObj(content), HttpStatus.INTERNAL_SERVER_ERROR);
} }
/** /**
...@@ -57,15 +58,15 @@ public class ResultUtil<T> { ...@@ -57,15 +58,15 @@ public class ResultUtil<T> {
/** /**
* 失败返回结果 * 失败返回结果
*/ */
public static <T> ResponseEntity<T> failed(HttpStatus httpStatus,T content) { public static <T> ResponseEntity<ResultObj> failed(HttpStatus httpStatus, T content) {
return new ResponseEntity<>(content,httpStatus); return new ResponseEntity<>(new ResultObj(content), httpStatus);
} }
/** /**
* 参数验证失败返回结果 * 参数验证失败返回结果
*/ */
public static <T> ResponseEntity<T> validateFailed(T content) { public static <T> ResponseEntity<ResultObj> validateFailed(T content) {
return failed(HttpStatus.INTERNAL_SERVER_ERROR,content); return failed(HttpStatus.INTERNAL_SERVER_ERROR, content);
} }
......
...@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.service.DeviceLogService; ...@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo; import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
...@@ -14,7 +15,6 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto; ...@@ -14,7 +15,6 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.common.BusinessEnum; import com.tykj.dev.device.task.subject.common.BusinessEnum;
import com.tykj.dev.device.task.subject.common.StatusEnum; import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.user.subject.entity.User; import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.AuthenticationUtils; import com.tykj.dev.device.user.util.AuthenticationUtils;
...@@ -26,15 +26,14 @@ import com.tykj.dev.rfid.entity.domin.RfidChangeLog; ...@@ -26,15 +26,14 @@ import com.tykj.dev.rfid.entity.domin.RfidChangeLog;
import com.tykj.dev.rfid.entity.enums.RfidChangeStatus; import com.tykj.dev.rfid.entity.enums.RfidChangeStatus;
import com.tykj.dev.rfid.entity.vo.*; import com.tykj.dev.rfid.entity.vo.*;
import com.tykj.dev.rfid.service.LibraryWarningLogService; import com.tykj.dev.rfid.service.LibraryWarningLogService;
import com.tykj.dev.rfid.service.RfidService;
import com.tykj.dev.rfid.service.RfidChangeBillService; import com.tykj.dev.rfid.service.RfidChangeBillService;
import com.tykj.dev.rfid.service.RfidChangeLogService; import com.tykj.dev.rfid.service.RfidChangeLogService;
import com.tykj.dev.rfid.service.RfidService;
import com.tykj.dev.rfid.timeTask.InventoryScheduled; import com.tykj.dev.rfid.timeTask.InventoryScheduled;
import com.tykj.dev.socket.MyWebSocket; import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -45,7 +44,10 @@ import javax.transaction.Transactional; ...@@ -45,7 +44,10 @@ import javax.transaction.Transactional;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/** /**
* @author huangxiahao * @author huangxiahao
...@@ -187,9 +189,9 @@ public class RfidController { ...@@ -187,9 +189,9 @@ public class RfidController {
return selectRfidChangeDetail(rfidChangeBill.getId()); return selectRfidChangeDetail(rfidChangeBill.getId());
} }
@ApiOperation(value = "标签管理概览",notes = "通过这个借口可以查看标签管理的概览") @ApiOperation(value = "标签管理概览", notes = "通过这个借口可以查看标签管理的概览")
@PostMapping(value = "/summary") @PostMapping(value = "/summary")
public ResponseEntity<Page<DeviceLibrary>> getTagSummary(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo){ public ResponseEntity getTagSummary(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
Page<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable()); Page<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable());
return ResultUtil.success(deviceLibraryEntities); return ResultUtil.success(deviceLibraryEntities);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论