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

[清退模块]添加了装备日志

上级 10f8a61b
package com.tykj.dev.config;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Component;
@Component
public class BeanConfig {
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(10);
return taskScheduler;
}
}
......@@ -6,6 +6,8 @@ import com.alibaba.fastjson.TypeReference;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.SendBackBill;
import com.tykj.dev.device.sendback.entity.domain.SendBackBillDetail;
......@@ -67,6 +69,9 @@ public class SendBackServiceImpl implements SendBackService {
@Autowired
DeviceLibraryService deviceLibraryService;
@Autowired
DeviceLogService deviceLogService;
@Autowired
public SendBackServiceImpl(TaskService taskService,DeviceLibraryDao deviceLibraryDao, SendBackBillDao sendBackBillEntityDao, TaskDao taskDao, UnitsDao unitsDao, AreaDao areaDao, UserDao userDao, UserDao userDao1, SendBackBillDetailDao sendBackBillDetailEntityDao) {
this.taskService=taskService;
......@@ -371,7 +376,12 @@ public class SendBackServiceImpl implements SendBackService {
根据idList查询装备列表
*/
List<DeviceLibrary> deviceList = deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(idList);
deviceList.forEach(devices -> devices.setOwnUnit(units.getName()));
deviceList.forEach(devices -> {
DeviceLogDto deviceLogDto = new DeviceLogDto(devices.getId(),"清退异常将装备的所属单位从"+devices.getOwnUnit()+"改为"+units.getName(),null);
deviceLogService.addLog(deviceLogDto);
devices.setOwnUnit(units.getName());
deviceLibraryService.update(devices);
});
/*
在parentTask的账单中移除id
......@@ -499,6 +509,7 @@ public class SendBackServiceImpl implements SendBackService {
SendBackBillDetail backBillDetailEntity = sendBackBillDetailEntityDao.save(sendBackBillDetailEntity);
bill.setFormId(backBillDetailEntity.getId());
sendBackBillEntityDao.save(bill);
return ResponseEntity.ok("装备出库发起成功等待审核");
}
......
......@@ -25,6 +25,7 @@ import com.tykj.dev.device.repair.subject.domin.RepairBill;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.retired.service.DeviceRetiredBillService;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.sendback.entity.domain.SendBackBill;
import com.tykj.dev.device.sendback.repository.SendBackBillDao;
import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
......@@ -382,7 +383,11 @@ public class LogAspect {
case 16:
SendBackBillDao sendBackBillDao = SpringUtils.getBean("sendBackBillDao");
if (sendBackBillDao != null) {
getFieldsParam(sendBackBillDao.getOne(outPutTask.getBillId()));
SendBackBill sendBackBill = sendBackBillDao.getOne(outPutTask.getBillId());
getFieldsParam(sendBackBill);
// if (){
//
// }
}
break;
case 19:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论