提交 b3978a05 authored 作者: 133's avatar 133

[清退] [用户] [装备]代码提交

上级 1fdf171f
...@@ -209,11 +209,6 @@ public class DeviceLibrary { ...@@ -209,11 +209,6 @@ public class DeviceLibrary {
childs.add(deviceLibraryEntity); childs.add(deviceLibraryEntity);
} }
public DeviceLibrary toVo(){
if (!this.locationUnit.equals(this.ownUnit)){
this.manageStatus=0;
}
return this;
}
} }
...@@ -64,9 +64,9 @@ public class SendBackController { ...@@ -64,9 +64,9 @@ public class SendBackController {
} }
@ApiOperation(value = "处理异常,修改装备的所属单位",notes = "处理异常,修改装备的所属单位") @ApiOperation(value = "处理异常,修改装备的所属单位",notes = "处理异常,修改装备的所属单位")
@PostMapping("/endException/{userId}/{taskId}") @GetMapping("/endException/{userId}/{taskId}/{type}")
ResponseEntity endException(@PathVariable("userId") Integer userId,@PathVariable("taskId") Integer taskId){ ResponseEntity endException(@PathVariable("userId") Integer userId,@PathVariable("taskId") Integer taskId,@PathVariable("type") Integer type){
return sendBackService.endException(taskId,userId); return sendBackService.endException(taskId,userId,type);
} }
...@@ -150,4 +150,12 @@ public class SendBackController { ...@@ -150,4 +150,12 @@ public class SendBackController {
return sendBackService.sendBackInCheck(taskId,sendBackOut,userId); return sendBackService.sendBackInCheck(taskId,sendBackOut,userId);
} }
@ApiOperation(value = "异常处理详情接口")
@GetMapping("/select/exception/{taskId}")
public ResponseEntity exception(@PathVariable("taskId") Integer taskId){
return sendBackService.exceptionSelect(taskId);
}
} }
package com.tykj.dev.device.sendback.entity.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName AbnormalDescribe.java
* @Description TODO
* @createTime 2020年09月25日 14:26:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("异常装备描述")
public class AbnormalDescribe {
private String model;
private Integer id;
private String name;
private String des;
}
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author zjm
* @version 1.0.0
* @ClassName AbnormalVo.java
* @Description TODO
* @createTime 2020年09月25日 10:18:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("清退出库表单")
public class AbnormalVo {
@ApiModelProperty(value = "经办人")
private String name;
@ApiModelProperty(value = "经办人id")
private Integer id;
@ApiModelProperty(value = "截止时间")
private Date time;
private List<DeviceLibrary> deviceLibraryList;
@ApiModelProperty(value = "未在库装备备注")
private UnDeviceDesVo unDeviceDesVo;
}
...@@ -78,7 +78,15 @@ public class SendBackOutVo { ...@@ -78,7 +78,15 @@ public class SendBackOutVo {
@ApiModelProperty(value = "清退单url") @ApiModelProperty(value = "清退单url")
private String returnNoteUrl; private String returnNoteUrl;
@ApiModelProperty(value = "清退单name") @ApiModelProperty(value = "清退单name")
private String returnNoteName; private String returnNoteName;
@ApiModelProperty(value = "是否可以出库")
private Integer isNotOutbound;
@ApiModelProperty(value = "异常taskid")
private Integer excTask;
} }
...@@ -25,7 +25,7 @@ public class SendBackRequst { ...@@ -25,7 +25,7 @@ public class SendBackRequst {
private Integer parentTaskId; private Integer parentTaskId;
@ApiModelProperty(value = "未在库装备备注") @ApiModelProperty(value = "未在库装备备注")
private HashMap<Integer,UnDeviceDesVo> unDeviceDes; private UnDeviceDesVo unDeviceDesVo;
@ApiModelProperty(value = "查询类型,0:省级 1:市级 2:区县级") @ApiModelProperty(value = "查询类型,0:省级 1:市级 2:区县级")
private Integer type; private Integer type;
......
...@@ -43,7 +43,7 @@ public class SendBackVo { ...@@ -43,7 +43,7 @@ public class SendBackVo {
private List<DeviceLibrary> unDevice; private List<DeviceLibrary> unDevice;
@ApiModelProperty(value = "异常装备描述") @ApiModelProperty(value = "异常装备描述")
private List<UnDeviceDesVo> unDeviceDes; private UnDeviceDesVo unDeviceDes;
@ApiModelProperty(value = "区域和任务id") @ApiModelProperty(value = "区域和任务id")
private HashMap<String,Integer> areaToTaskId; private HashMap<String,Integer> areaToTaskId;
......
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <h4>Description : </h4> * <h4>Description : </h4>
...@@ -27,7 +28,6 @@ public class UnDeviceDesVo { ...@@ -27,7 +28,6 @@ public class UnDeviceDesVo {
private String unitName; private String unitName;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String des; private List<AbnormalDescribe> des;
} }
...@@ -5,6 +5,8 @@ import com.tykj.dev.device.sendback.entity.vo.SendBackOutFormVo; ...@@ -5,6 +5,8 @@ import com.tykj.dev.device.sendback.entity.vo.SendBackOutFormVo;
import com.tykj.dev.device.sendback.entity.vo.SendBackOutVo; import com.tykj.dev.device.sendback.entity.vo.SendBackOutVo;
import com.tykj.dev.device.sendback.entity.vo.SendBackRequst; import com.tykj.dev.device.sendback.entity.vo.SendBackRequst;
import com.tykj.dev.device.sendback.entity.vo.SendBackVo; import com.tykj.dev.device.sendback.entity.vo.SendBackVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import java.util.List; import java.util.List;
...@@ -53,7 +55,7 @@ public interface SendBackService { ...@@ -53,7 +55,7 @@ public interface SendBackService {
* @param taskId 上报异常的taskid * @param taskId 上报异常的taskid
* @return 成功 * @return 成功
*/ */
ResponseEntity endException(Integer taskId, Integer userId); ResponseEntity endException(Integer taskId, Integer userId,Integer type);
/** /**
* 清退装备校对发起——专管员A * 清退装备校对发起——专管员A
...@@ -118,4 +120,11 @@ public interface SendBackService { ...@@ -118,4 +120,11 @@ public interface SendBackService {
* @return 成功 * @return 成功
*/ */
ResponseEntity endTask(Integer taskId); ResponseEntity endTask(Integer taskId);
/**
* 异常行为 查询接口
*/
ResponseEntity exceptionSelect(Integer task);
} }
...@@ -52,4 +52,6 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE ...@@ -52,4 +52,6 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
List<Task> findTaskEntitiesByParentTaskId(Integer parentTaskId); List<Task> findTaskEntitiesByParentTaskId(Integer parentTaskId);
Task findByBusinessTypeAndOwnUnitAndBillStatus(Integer type,Integer ownUnit,Integer billStatus); Task findByBusinessTypeAndOwnUnitAndBillStatus(Integer type,Integer ownUnit,Integer billStatus);
Task findByParentTaskIdAndAndTitle(Integer parentId,String title);
} }
...@@ -9,18 +9,25 @@ package com.tykj.dev.device.user.subject.controller; ...@@ -9,18 +9,25 @@ package com.tykj.dev.device.user.subject.controller;
*/ */
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.SecurityUser; import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.service.AreaService; import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.misc.exception.ApiException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.Optional;
/** /**
* 区域视图层 * 区域视图层
*/ */
...@@ -31,6 +38,8 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -31,6 +38,8 @@ import springfox.documentation.annotations.ApiIgnore;
public class AreaController { public class AreaController {
@Autowired @Autowired
AreaService areaService; AreaService areaService;
@Autowired
AreaDao areaDao;
@GetMapping(value = "/area/units") @GetMapping(value = "/area/units")
@ApiOperation(value = "查询权限接口,按照类型划分,具体字段查看model", notes = "成功返回分类的权限对象") @ApiOperation(value = "查询权限接口,按照类型划分,具体字段查看model", notes = "成功返回分类的权限对象")
...@@ -38,4 +47,16 @@ public class AreaController { ...@@ -38,4 +47,16 @@ public class AreaController {
return ResponseEntity.ok(areaService.findAll(securityUser.getCurrentUserInfo().getUnits().getAreaId())); return ResponseEntity.ok(areaService.findAll(securityUser.getCurrentUserInfo().getUnits().getAreaId()));
} }
@GetMapping(value = "/select/area/{areaId}")
@ApiOperation(value = "查询区域对象,传入areaId", notes = "成功返回区域对象")
public ResponseEntity areaId(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @PathVariable Integer areaId) {
Optional<Area> areaOptional = areaDao.findById(areaId);
if (areaOptional.isPresent()){
return ResponseEntity.ok(areaOptional.get());
}else {
throw new ApiException(ResponseEntity.status(500).body("areaId查询不到"));
}
}
} }
...@@ -37,9 +37,10 @@ public class RoleController { ...@@ -37,9 +37,10 @@ public class RoleController {
@ApiOperation(value = "角色添加和修改接口,新增不需要传id,修改必须传id", notes = "成功返回角色对象") @ApiOperation(value = "角色添加和修改接口,新增不需要传id,修改必须传id", notes = "成功返回角色对象")
public ResponseEntity addRole(@RequestBody RoleVo roleVo) { public ResponseEntity addRole(@RequestBody RoleVo roleVo) {
Role role = roleService.save(roleVo.toDo()); Role role = roleService.save(roleVo.toDo());
if (rolePermissionsService.findAllByRoleId(role.getRoleId()).size() != 0) { if (roleVo.getRoleId()!=null) {
rolePermissionsService.deleteFindRoleId(role.getRoleId()); if (rolePermissionsService.findAllByRoleId(role.getRoleId()).size() != 0) {
rolePermissionsService.deleteFindRoleId(role.getRoleId());
}
} }
List<Integer> list = roleVo.getPermissionsIds(); List<Integer> list = roleVo.getPermissionsIds();
if (list != null && list.size() != 0) { if (list != null && list.size() != 0) {
......
...@@ -69,7 +69,7 @@ public class RoleServiceImpl implements RoleService { ...@@ -69,7 +69,7 @@ public class RoleServiceImpl implements RoleService {
return RolePage.builder().data(rolePage.getContent()) return RolePage.builder().data(rolePage.getContent())
.page(page) .page(page)
.size(size) .size(size)
.total(rolePage.getSize()) .total(Math.toIntExact(rolePage.getTotalElements()))
.build(); .build();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论