提交 db0059f3 authored 作者: 邓砥奕's avatar 邓砥奕

修改bug

上级 ad4060d0
...@@ -5,6 +5,7 @@ import com.tykj.dev.device.library.repository.DeviceLogDao; ...@@ -5,6 +5,7 @@ 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;
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.DeviceLog; import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.library.subject.vo.DeviceLogUserVo; import com.tykj.dev.device.library.subject.vo.DeviceLogUserVo;
import com.tykj.dev.device.library.subject.vo.FileVo; import com.tykj.dev.device.library.subject.vo.FileVo;
...@@ -180,13 +181,16 @@ public class MatchingDeviceController { ...@@ -180,13 +181,16 @@ public class MatchingDeviceController {
@ApiOperation(value = "查询配套装备详情", notes = "可以通过这个接口查询配套装备详情") @ApiOperation(value = "查询配套装备详情", notes = "可以通过这个接口查询配套装备详情")
@GetMapping("/feature/detail/{id}") @GetMapping("/feature/detail/{id}")
public ResponseEntity getDetail(@PathVariable("id") int id) { public ResponseEntity getDetail(@PathVariable("id") int id) {
MacthingDeviceDetailVo macthingDeviceDetailVo = new MacthingDeviceDetailVo(); List<Object> list = new ArrayList<>();
//添加配套设备详情 //添加配套设备详情
MatchingDeviceLibrary m = matchingDeviceLibraryService.getOne(id); MatchingDeviceLibrary m = matchingDeviceLibraryService.getOne(id);
macthingDeviceDetailVo.setMatchingDeviceLibrary(m); list.add(m);
//添加关联装备详情 //添加关联装备详情
if (m.getDeviceId() != 0) { if (m.getDeviceId() != 0) {
macthingDeviceDetailVo.setDeviceLibrary(deviceLibraryService.getOne(m.getDeviceId())); list.add(deviceLibraryService.getOne(m.getDeviceId()));
}
else {
list.add(new DeviceLibrary());
} }
//添加设备履历日志 //添加设备履历日志
List<DeviceLogUserVo> deviceLogs = deviceLogDao.getAllByDeviceIdAndType(id, 1).stream() List<DeviceLogUserVo> deviceLogs = deviceLogDao.getAllByDeviceIdAndType(id, 1).stream()
...@@ -194,8 +198,8 @@ public class MatchingDeviceController { ...@@ -194,8 +198,8 @@ public class MatchingDeviceController {
.map(DeviceLogDto::toVo) .map(DeviceLogDto::toVo)
.sorted(Comparator.comparing(DeviceLogUserVo::getCreateTime)) .sorted(Comparator.comparing(DeviceLogUserVo::getCreateTime))
.collect(Collectors.toList()); .collect(Collectors.toList());
macthingDeviceDetailVo.setDeviceLogUserVos(deviceLogs); list.add(deviceLogs);
return ResponseEntity.ok(macthingDeviceDetailVo); return ResponseEntity.ok(list);
} }
@ApiOperation(value = "更新配套设备", notes = "可以通过这个接口更新配套设备") @ApiOperation(value = "更新配套设备", notes = "可以通过这个接口更新配套设备")
...@@ -251,4 +255,16 @@ public class MatchingDeviceController { ...@@ -251,4 +255,16 @@ public class MatchingDeviceController {
macthingDetailVo.setTaskLogUserVos(taskLogService.getByTaskId(taskBto.getId())); macthingDetailVo.setTaskLogUserVos(taskLogService.getByTaskId(taskBto.getId()));
return ResponseEntity.ok(macthingDetailVo); return ResponseEntity.ok(macthingDetailVo);
} }
@ApiOperation(value = "查询所有配套设备型号", notes = "查询所有配套设备型号")
@GetMapping(value = "/selectAllModel")
public ResponseEntity selectAllModel(){
return ResponseEntity.ok(matchingDeviceLibraryService.getAllModel());
}
@ApiOperation(value = "查询所有配套设备名称", notes = "查询所有配套设备名称")
@GetMapping(value = "/selectAllName")
public ResponseEntity selectAllName(){
return ResponseEntity.ok(matchingDeviceLibraryService.getAllName());
}
} }
...@@ -4,6 +4,8 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary; ...@@ -4,6 +4,8 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
......
...@@ -5,6 +5,8 @@ import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo; ...@@ -5,6 +5,8 @@ import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
...@@ -40,4 +42,14 @@ public interface MatchingDeviceLibraryService { ...@@ -40,4 +42,14 @@ public interface MatchingDeviceLibraryService {
* 配套设备分页查询 * 配套设备分页查询
*/ */
Page<MatchingDeviceLibrary> getPage(MatchingDeviceSelectVo matchingDeviceSelectVo, Pageable pageable); Page<MatchingDeviceLibrary> getPage(MatchingDeviceSelectVo matchingDeviceSelectVo, Pageable pageable);
/**
* @return 所有类型
*/
List<String> getAllModel();
/**
* @return 所有名称
*/
List<String> getAllName();
} }
...@@ -18,8 +18,7 @@ import org.springframework.stereotype.Service; ...@@ -18,8 +18,7 @@ import org.springframework.stereotype.Service;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.List; import java.util.*;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -100,6 +99,26 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -100,6 +99,26 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
} }
} }
/**
* @return 所有类型
*/
@Override
public List<String> getAllModel() {
Set<String> models = new HashSet<>();
matchingDeviceLibraryDao.findAll().forEach(matchingDeviceLibrary -> models.add(matchingDeviceLibrary.getModel()));
return new ArrayList<>(models);
}
/**
* @return 所有名称
*/
@Override
public List<String> getAllName() {
Set<String> names = new HashSet<>();
matchingDeviceLibraryDao.findAll().forEach(matchingDeviceLibrary -> names.add(matchingDeviceLibrary.getName()));
return new ArrayList<>(names);
}
/** /**
* @param matchingDeviceSelectVo 配套设备查询vo * @param matchingDeviceSelectVo 配套设备查询vo
* 创建通用查询条件筛选器 * 创建通用查询条件筛选器
......
...@@ -2,16 +2,17 @@ package com.tykj.dev.device.repair.controller; ...@@ -2,16 +2,17 @@ package com.tykj.dev.device.repair.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.repair.service.RepairBillService; import com.tykj.dev.device.repair.service.RepairBillService;
import com.tykj.dev.device.repair.subject.domin.RepairBill;
import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo; import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
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.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import java.util.ArrayList;
import org.springframework.web.bind.annotation.RestController; import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -30,4 +31,13 @@ public class RepairBillSelectController { ...@@ -30,4 +31,13 @@ public class RepairBillSelectController {
public ResponseEntity selectRepairBill(@RequestBody RepairBillSelectVo repairBillSelectVo) { public ResponseEntity selectRepairBill(@RequestBody RepairBillSelectVo repairBillSelectVo) {
return ResultUtil.success(repairBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable())); return ResultUtil.success(repairBillService.getPage(repairBillSelectVo, repairBillSelectVo.getPageable()));
} }
@ApiOperation(value = "查询维修单详情", notes = "可以通过这个接口查询维修单详情")
@GetMapping(value = "/archives/repair/detail/{id}")
public ResponseEntity selectRepairBillDetail(@PathVariable("id") int id){
List<Object> list = new ArrayList<>();
//获取维修单
RepairBill repairBill = repairBillService.getOne(id);
return null;
}
} }
...@@ -176,6 +176,7 @@ public class RepairController { ...@@ -176,6 +176,7 @@ public class RepairController {
@ApiOperation(value = "发起维修审核", notes = "可以通过这个接口发起维修审核") @ApiOperation(value = "发起维修审核", notes = "可以通过这个接口发起维修审核")
@PostMapping(value = "/sendConfirm") @PostMapping(value = "/sendConfirm")
public ResponseEntity sendConfirm(@RequestBody RepairConfirmVo deviceRepairConfirmVo) { public ResponseEntity sendConfirm(@RequestBody RepairConfirmVo deviceRepairConfirmVo) {
Integer level = userUtils.getCurrentUnitLevel();
TaskBto taskBto = taskService.get(deviceRepairConfirmVo.getTaskId()); TaskBto taskBto = taskService.get(deviceRepairConfirmVo.getTaskId());
//获取维修单,送修单,装备详情 //获取维修单,送修单,装备详情
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId()); RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
...@@ -184,49 +185,69 @@ public class RepairController { ...@@ -184,49 +185,69 @@ public class RepairController {
List<Integer> idList = StringSplitUtil.split(deviceIdDetail); List<Integer> idList = StringSplitUtil.split(deviceIdDetail);
//审核成功 //审核成功
if (deviceRepairConfirmVo.getStatus() == 0) { if (deviceRepairConfirmVo.getStatus() == 0) {
taskBto.setOwnUnit(userPublicService.findUnitIdByName(repairBill.getReceiveUnit())); if (userUtils.getCurrentUnitLevel()!=1) {
taskBto.setOwnUnit(userPublicService.findUnitIdByName(repairBill.getReceiveUnit()));
}
//任务推至下一阶段 //任务推至下一阶段
if (repairSendBill.getRepairUseraId()!=null) { if (level==1) {
//指定用户 if (repairSendBill.getRepairUseraId() != null) {
taskService.update(taskService.moveToNext(taskBto,repairSendBill.getRepairUseraId())); //指定用户
taskService.update(taskService.moveToNext(taskBto, repairSendBill.getRepairUseraId()));
} else {
//不指定用户
taskService.update(taskService.moveToNext(taskBto));
}
} }
else { //省送国家,任务之间推至维修状态,发起人a的待办
//不指定用户 else{
taskService.update(taskService.moveToNext(taskBto)); taskService.update(taskService.moveToSpecial(taskBto,StatusEnum.REPAIRING,repairSendBill.getStartUseraId()));
} }
//存业务日志 //存业务日志
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null); TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null);
taskLogService.addLog(taskLogBto); taskLogService.addLog(taskLogBto);
// //如果当前为省,改变装备的所在为中办 //如果当前为省,改变装备的所在为中办
// if (userUtils.getCurrentUnitLevel()==1){ if (level==1){
// //获取当前业务维修详情 //获取当前业务维修详情
// List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId()); List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId());
// //获取所有父业务id //获取所有父业务id
// List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail()); List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto.getNodeIdDetail());
// fathers.forEach(integer -> { fathers.forEach(integer -> {
// //筛选出父业务相同装备的维修详情 //筛选出父业务相同装备的维修详情
// List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream() List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
// .filter(repairDetail -> idList.contains(repairDetail.getDeviceId())) .filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
// .collect(Collectors.toList()); .collect(Collectors.toList());
// //添加维修详情 //添加维修详情
// repairDetailEntities.addAll(repairDetails); repairDetailEntities.addAll(repairDetails);
// }); });
// //改变维修详情装备所在单位为中办 //改变维修详情装备所在单位为中办
// repairDetailEntities.forEach(repairDetail -> { repairDetailEntities.forEach(repairDetail -> {
// repairDetail.setLocationUnit("中办"); repairDetail.setLocationUnit("中办");
// deviceRepairDetailService.update(repairDetail); deviceRepairDetailService.update(repairDetail);
// }); });
// } }
//更新维修单和送修单状态 //更新维修单和送修单状态
repairBill.setRepairStatus(2); //如果当前为省像国家发起的
if (level==1){
repairBill.setRepairStatus(4);
repairSendBill.setRepairStatus(5);
}
else {
repairBill.setRepairStatus(2);
repairSendBill.setRepairStatus(2);
}
deviceRepairBillService.update(repairBill); deviceRepairBillService.update(repairBill);
repairSendBill.setRepairStatus(2);
deviceRepairSendBillService.update(repairSendBill); deviceRepairSendBillService.update(repairSendBill);
//修改装备状态,存装备日志 //修改装备状态,存装备日志
if (idList.size()>0) { if (idList.size()>0) {
for (Integer id:idList) { for (Integer id:idList) {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(3); //如果当前为省像国家发起的
if (level==1){
deviceLibraryEntity.setLifeStatus(4);
}
else {
deviceLibraryEntity.setLifeStatus(3);
}
deviceLibraryEntity.setManageStatus(0); deviceLibraryEntity.setManageStatus(0);
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"审核成功并出库",null); DeviceLogDto deviceLogDto = new DeviceLogDto(id,"审核成功并出库",null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
...@@ -470,6 +491,8 @@ public class RepairController { ...@@ -470,6 +491,8 @@ public class RepairController {
// @ApiOperation(value = "送国家维修装备出库",notes = "可以通过这个接口送国家维修装备出库") // @ApiOperation(value = "送国家维修装备出库",notes = "可以通过这个接口送国家维修装备出库")
// @PostMapping(value = "/sendCountry") // @PostMapping(value = "/sendCountry")
// public ResponseEntity sendCountry(@RequestBody RepairBillSaveVo repairBillSaveVo){ // public ResponseEntity sendCountry(@RequestBody RepairBillSaveVo repairBillSaveVo){
// //获取父任务
// TaskBto fatherTask = taskService.get(repairBillSaveVo.getTaskId());
// //添加维修单,送修单 // //添加维修单,送修单
// RepairBill repairbill= new RepairBill(); // RepairBill repairbill= new RepairBill();
// RepairSendBill repairSendBill = new RepairSendBill(); // RepairSendBill repairSendBill = new RepairSendBill();
...@@ -487,55 +510,52 @@ public class RepairController { ...@@ -487,55 +510,52 @@ public class RepairController {
// String s1 ="NO:第"+calendar.get(Calendar.YEAR)+"PF"+repairBill1.getId()+"号"; // String s1 ="NO:第"+calendar.get(Calendar.YEAR)+"PF"+repairBill1.getId()+"号";
// repairBill1.setDocNum(s1); // repairBill1.setDocNum(s1);
// deviceRepairBillService.update(repairBill1); // deviceRepairBillService.update(repairBill1);
// TaskSaveVo taskSaveVo = new TaskSaveVo(); // //发起维修业务
// taskSaveVo.setTitle("维修业务"); // List<Integer> userIds = new ArrayList<>();
// taskSaveVo.setBillId(repairBill1.getId()); // userIds.add(userId);
// taskSaveVo.setBillStatus(17); // userIds.add(repairBillSaveVo.getStartUserbId());
// taskSaveVo.setUserReadDetail("x"); // TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_CONFIRM.id,"维修业务",repairBillSaveVo.getTaskId(),fatherTask.getNodeIdDetail()+fatherTask.getId()+".",repairBill1.getId(),5,userUtils.getCurrentUnitId(),1,null,userIds);
// taskSaveVo.setTopFlagDetail("x"); // Task saveEntity = taskService.start(taskBto);
// taskSaveVo.setBussinessType(5); // //存业务日志
// taskSaveVo.setStartUserId(userId); // List<FileVo> fileVoList = new ArrayList<>();
// taskSaveVo.setNodeIdDetail("."+repairBillSaveVo.getTaskId()+"."); // fileVoList.add(new FileVo("出库确认单",repairBillSaveVo.getFileName(),repairBillSaveVo.getFileUrl()));
// taskSaveVo.setParentTaskId(repairBillSaveVo.getTaskId()); // TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"向"+repairBillSaveVo.getReceiveUnit()+"发起装备维修",fileVoList);
// TaskEntity taskEntity = taskSaveVo.toDo(); // taskLogService.addLog(taskLogBto);
// TaskEntity saveEntity = taskService.addEntity(taskEntity);
// //添加送修单
// repairSendBill.setRepairStatus(0); // repairSendBill.setRepairStatus(0);
// repairSendBill.setSendTime(new Date()); // repairSendBill.setSendTime(new Date());
// StringBuffer stringBuffer = new StringBuffer(); // StringBuffer stringBuffer = new StringBuffer();
// //存维修详情单
// for (DeviceDetailVo d:repairBillSaveVo.getDeviceList()) { // for (DeviceDetailVo d:repairBillSaveVo.getDeviceList()) {
// stringBuffer.append(d.getDeviceId()); // stringBuffer.append(d.getDeviceId());
// stringBuffer.append("Ǵ"); // stringBuffer.append("Ǵ");
// stringBuffer.append(d.getRemark()); // stringBuffer.append(d.getRemark());
// stringBuffer.append("Ǵ"); // stringBuffer.append("Ǵ");
// LogVo bussinessLogVo = new LogVo(); // RepairDetail repairDetail = new RepairDetail();
// bussinessLogVo.setDeviceId(d.getDeviceId()); // repairDetail.setDeviceId(d.getDeviceId());
// bussinessLogVo.setFileDetail("Ǵ"+repairBillSaveVo.getFileName()+"Ǒ"+repairBillSaveVo.getFileUrl()+"Ǒ"+"出库确认单"+"Ǵ"); // DeviceLibrary deviceLibraryEntity =deviceLibraryService.getOne(d.getDeviceId());
// bussinessLogVo.setRemark("向"+repairBillSaveVo.getReceiveUnit()+"发起装备维修"); // repairDetail.setLocationUnit(userUtils.getCurrentUserUnitName());
// bussinessLogVo.setTaskId(saveEntity.getId()); // repairDetail.setModel(deviceLibraryEntity.getModel());
// deviceLogService.addLog(bussinessLogVo); // repairDetail.setName(deviceLibraryEntity.getName());
// repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit());
// repairDetail.setRemark(d.getRemark());
// repairDetail.setRepairStatus(0);
// repairDetail.setRfidSurfaceId(deviceLibraryEntity.getRfidSurfaceId());
// repairDetail.setSeqNumber(deviceLibraryEntity.getSeqNumber());
// repairDetail.setType(deviceLibraryEntity.getType());
// repairDetail.setDeviceRepairBillId(repairBill1.getId());
// deviceRepairDetailService.save(repairDetail);
// //存装备日志
// DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(),"向"+repairBillSaveVo.getReceiveUnit()+"发起装备维修",fileVoList);
// deviceLogService.addLog(deviceLogDto);
// } // }
// //存送修单
// repairSendBill.setRepairDeviceDetail(stringBuffer.toString()); // repairSendBill.setRepairDeviceDetail(stringBuffer.toString());
// repairSendBill.setDeviceRepairBillId(repairBill1.getId()); // repairSendBill.setDeviceRepairBillId(repairBill1.getId());
// repairSendBill.setVar1(repairBillSaveVo.getAgent()); // repairSendBill.setAgent(repairBillSaveVo.getAgent());
// repairSendBill.setTitle("维修业务"); // repairSendBill.setTitle("维修业务");
// deviceRepairSendBillService.addEntity(repairSendBill); // deviceRepairSendBillService.addEntity(repairSendBill);
// //发起任务 // myWebSocket.sendMessage1();
// JobEntity job1 = new JobEntity(); // return ResponseEntity.ok(saveEntity);
// job1.setBelongUserId(userId);
// job1.setInvoleUserId("x"+userId+"x");
// job1.setIsDone(1);
// job1.setBillStatus(16);
// job1.setTaskId(saveEntity.getId());
// JobEntity job2 = new JobEntity();
// job2.setTaskId(saveEntity.getId());
// job2.setBelongUserId(repairBillSaveVo.getStartUserBId());
// job2.setInvoleUserId(job1.getInvoleUserId()+job2.getBelongUserId()+"x");
// job2.setBillStatus(17);
// job2.setTaskId(saveEntity.getId());
// jobService.addEntity(job1);
// jobService.addEntity(job2);
// return new ResultObj(saveEntity,"发起维修成功");
// } // }
@ApiOperation(value = "送国家维修装备出库审核", notes = "可以通过这个接口送国家维修装备出库审核") @ApiOperation(value = "送国家维修装备出库审核", notes = "可以通过这个接口送国家维修装备出库审核")
......
...@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.vo.FileVo; ...@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.task.subject.domin.TaskLog; import com.tykj.dev.device.task.subject.domin.TaskLog;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo; import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
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.UserUtils;
import com.tykj.dev.misc.base.BeanHelper; import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.SpringUtils; import com.tykj.dev.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -15,6 +16,7 @@ import org.modelmapper.ModelMapper; ...@@ -15,6 +16,7 @@ import org.modelmapper.ModelMapper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -54,13 +56,26 @@ public class TaskLogBto { ...@@ -54,13 +56,26 @@ public class TaskLogBto {
this.fileVoList = new ArrayList<>(); this.fileVoList = new ArrayList<>();
} }
public TaskLogBto(Integer taskId, String remark, Integer createUserId) {
this.taskId = taskId;
this.remark = remark;
this.createUserId = createUserId;
}
/** /**
* dto类转化为do类 * dto类转化为do类
*/ */
public TaskLog toDo() { public TaskLog toDo() {
UserUtils userUtils = SpringUtils.getBean("userUtils");
TaskLog taskLog = new TaskLog(); TaskLog taskLog = new TaskLog();
taskLog.setTaskId(this.taskId); taskLog.setTaskId(this.taskId);
taskLog.setRemark(this.remark); taskLog.setRemark(this.remark);
if (this.createUserId!=null){
taskLog.setCreateUserId(this.createUserId);
}
else {
taskLog.setCreateUserId(Objects.requireNonNull(userUtils).getCurrentUserId());
}
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("Ǵ"); stringBuffer.append("Ǵ");
if (this.fileVoList != null && this.fileVoList.size() > 0) { if (this.fileVoList != null && this.fileVoList.size() > 0) {
......
...@@ -58,7 +58,6 @@ public class TaskLog { ...@@ -58,7 +58,6 @@ public class TaskLog {
* 创建用户id * 创建用户id
*/ */
@ApiModelProperty(value = "创建用户id") @ApiModelProperty(value = "创建用户id")
@CreatedBy
private Integer createUserId; private Integer createUserId;
/** /**
* 创建时间 * 创建时间
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论