提交 5e5efb84 authored 作者: 133's avatar 133

【清退】提交BUG修改代码

上级 4936e1c6
...@@ -3,9 +3,11 @@ package com.tykj.dev.device.library.repository; ...@@ -3,9 +3,11 @@ package com.tykj.dev.device.library.repository;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
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 org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import javax.transaction.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -64,5 +66,16 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>, ...@@ -64,5 +66,16 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List<DeviceLibrary> findAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames); List<DeviceLibrary> findAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
List<DeviceLibrary> findAllByOwnUnitAndLocationUnitAndLifeStatus(String ownUnitName,String locationUnitName,Integer status); List<DeviceLibrary> findAllByOwnUnitAndLocationUnitAndLifeStatus(String ownUnitName,String locationUnitName,Integer status);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus where o.id in :idList")
int upDateLeftStatus(Integer lifeStatus,@Param("idList") List<Integer> idList);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName where o.id in :idList")
int upDateLeftStatusAndUnitName(Integer lifeStatus,String unitName,@Param("idList") List<Integer> idList);
} }
...@@ -68,7 +68,12 @@ public enum DeviceLifeStatus { ...@@ -68,7 +68,12 @@ public enum DeviceLifeStatus {
/** /**
* 使用 * 使用
*/ */
USE(14, "使用"); USE(14, "使用"),
/**
* 待清退
*/
REPEL(15,"清退");
public Integer id; public Integer id;
......
...@@ -73,12 +73,21 @@ public class RepelQueryController { ...@@ -73,12 +73,21 @@ public class RepelQueryController {
return ResponseEntity.ok(repelQueryService.clearedList(unitId)); return ResponseEntity.ok(repelQueryService.clearedList(unitId));
} }
// /**
// * 省直属任务装备查询接口
// */
// @GetMapping(value ="/provinceDirectlyUnderDev/{taskId}")
// @ApiOperation(value = "省直属任务装备查询接口", notes = "省直属任务装备查询接口")
// public ResponseEntity provinceDirectlyUnderDev(@PathVariable Integer taskId){
// return ResponseEntity.ok(repelQueryService.provinceDirectlyUnderDev(taskId));
// }
/** /**
* 省直属任务装备查询接口 * 省直属任务单位列表查询接口
*/ */
@GetMapping(value ="/provinceDirectlyUnderDev/{taskId}") @GetMapping(value ="/provinceDirectlyUnderDev/{taskId}")
@ApiOperation(value = "省直属任务装备查询接口", notes = "省直属任务装备查询接口") @ApiOperation(value = "省直属任务单位列表查询接口", notes = "省直属任务装备查询接口")
public ResponseEntity provinceDirectlyUnderDev(@PathVariable Integer taskId){ public ResponseEntity provinceDirectlyUnderDev(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.provinceDirectlyUnderDev(taskId)); return ResponseEntity.ok(repelQueryService.directlyUnderUnitLeftNavigation(taskId));
} }
} }
...@@ -64,6 +64,7 @@ public class DeviceRepel extends BaseEntity { ...@@ -64,6 +64,7 @@ public class DeviceRepel extends BaseEntity {
* *
*/ */
@ApiModelProperty(value = "正文") @ApiModelProperty(value = "正文")
@Column(columnDefinition = "TEXT")
private String files; private String files;
......
...@@ -40,6 +40,12 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -40,6 +40,12 @@ public class DeviceRepelDetail extends BaseEntity {
@ApiModelProperty(value = "账单id") @ApiModelProperty(value = "账单id")
private Integer repelId; private Integer repelId;
/**
* 编号
*/
@ApiModelProperty(value = "单据编号")
private String num;
/** /**
* 申请文号 * 申请文号
*/ */
......
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.device.user.base.ret.LeftNavigation;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName DirectlyUnderNavigation.java
* @Description TODO
* @createTime 2021年01月18日 10:41:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("直属单位列表")
public class DirectlyUnderNavigation {
/**
* id
*/
private Integer id;
/**
* 名称
*/
private String name;
/**
* 定位id
*/
private String location;
}
...@@ -5,7 +5,9 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; ...@@ -5,7 +5,9 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical; import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel; import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel;
import com.tykj.dev.device.sendback.entity.vo.DirectlyUnderNavigation;
import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo; import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo;
import com.tykj.dev.device.user.base.ret.LeftNavigation;
import java.util.List; import java.util.List;
...@@ -53,7 +55,13 @@ public interface RepelQueryService { ...@@ -53,7 +55,13 @@ public interface RepelQueryService {
List<DeviceLibrary> clearedList(Integer unitId); List<DeviceLibrary> clearedList(Integer unitId);
/** /**
* *省直属任务装备查询接口
*/ */
List<DeviceLibrary> provinceDirectlyUnderDev(Integer taskId); List<DeviceLibrary> provinceDirectlyUnderDev(Integer taskId);
/**
* 查询直属单位列表
*/
List<DirectlyUnderNavigation> directlyUnderUnitLeftNavigation(Integer taskId);
} }
...@@ -35,6 +35,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -35,6 +35,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -115,16 +117,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -115,16 +117,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepel.getTaskScopes().forEach( deviceRepel.getTaskScopes().forEach(
unisId->{ unisId->{
Units units1= unitsService.findById(unisId); Units units1= unitsService.findById(unisId);
if (units1.getType()==2) {
directlUnderUnit.set(deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId())));
}else if (units1.getType()==1){
log.info("asdasdas{}",units1.getName());
Area area1=areaService.findByid(units1.getAreaId()); Area area1=areaService.findByid(units1.getAreaId());
if ("2".equals(unitsService.findById(unisId).getCode())) {
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(unisId))){
directlUnderUnit.set(true);
}
}else {
deviceRepelDetail.setSendUnit(units1.getName()); deviceRepelDetail.setSendUnit(units1.getName());
deviceRepelDetail.setSendUnitId(units1.getUnitId()); deviceRepelDetail.setSendUnitId(units1.getUnitId());
deviceRepelDetail.setId(null); deviceRepelDetail.setId(null);
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(unisId))){ if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(units1.getUnitId()))){
TaskBto taskBto1= cityRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),taskBto.getId()); TaskBto taskBto1= cityRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),0,area1.getName(),model,"")); list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),0,area1.getName(),model,""));
} }
...@@ -136,8 +137,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -136,8 +137,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setSendUnit(units.getName()); deviceRepelDetail.setSendUnit(units.getName());
deviceRepelDetail.setId(null); deviceRepelDetail.setId(null);
if (directlUnderUnit.get()){ if (directlUnderUnit.get()){
TaskBto taskBto1 = directlyUnderTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId()); TaskBto taskBto2 = directlyUnderTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),0,"省直属",model,"")); list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto2.getId(),0,"省直属",model,""));
} }
deviceRepelDetail.setId(null); deviceRepelDetail.setId(null);
List<String> strings=new ArrayList<>(); List<String> strings=new ArrayList<>();
...@@ -294,11 +295,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -294,11 +295,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
// List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {}); // List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {});
// log.info("---{}",modelCountList.size()); // log.info("---{}",modelCountList.size());
// boolean flag= repelTaskStatisticalService.findAllRepelTaskStatistical(589,286).stream().allMatch(e->e.getTaskStatus()!=1); // boolean flag= repelTaskStatisticalService.findAllRepelTaskStatistical(589,286).stream().allMatch(e->e.getTaskStatus()!=1);
} }
@Override @Override
public void submitChooseDevice(Integer taskId, ResolveConfirm resolveConfirm) { public void submitChooseDevice(Integer taskId, ResolveConfirm resolveConfirm) {
long stime=System.currentTimeMillis();
log.info("提交装备接口开始{}",taskId);
Map<String,Integer> map=new HashMap<>(); Map<String,Integer> map=new HashMap<>();
StringBuffer ids=new StringBuffer(); StringBuffer ids=new StringBuffer();
TaskBto taskBto= taskService.get(taskId); TaskBto taskBto= taskService.get(taskId);
...@@ -317,11 +320,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -317,11 +320,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibrary -> { deviceLibrary -> {
map.put(deviceLibrary.getModel(), map.get(deviceLibrary.getModel()) + 1); map.put(deviceLibrary.getModel(), map.get(deviceLibrary.getModel()) + 1);
ids.append(",").append(deviceLibrary.getId()); ids.append(",").append(deviceLibrary.getId());
deviceLibrary.setLifeStatus(12); // deviceLibrary.setLifeStatus(12);
} }
); );
deviceLibraryDao.saveAll(deviceLibraries); log.info("存储设备开始");
long time1=System.currentTimeMillis();
deviceLibraryDao.upDateLeftStatus(2,resolveConfirm.getDevIds());
log.info("存储结束{}",System.currentTimeMillis()-time1);
for (String key:map.keySet()){ for (String key:map.keySet()){
ModelCount modelCount = new ModelCount(); ModelCount modelCount = new ModelCount();
modelCount.setCount(map.get(key)); modelCount.setCount(map.get(key));
...@@ -336,6 +341,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -336,6 +341,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setDeviceIds(ids.toString()); deviceRepelDetail.setDeviceIds(ids.toString());
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes()); deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
log.info("提交装备接口结束{}",System.currentTimeMillis()-stime);
} }
@Override @Override
...@@ -379,6 +385,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -379,6 +385,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
orderOutDataRepelDetail.setDeviceIds(deviceRepelDetail.getDeviceIds()); orderOutDataRepelDetail.setDeviceIds(deviceRepelDetail.getDeviceIds());
orderOutDataRepelDetail.setLeftSignatureId(UUID.randomUUID().toString()); orderOutDataRepelDetail.setLeftSignatureId(UUID.randomUUID().toString());
orderOutDataRepelDetail.setRightSignatureId(UUID.randomUUID().toString()); orderOutDataRepelDetail.setRightSignatureId(UUID.randomUUID().toString());
orderOutDataRepelDetail.setNum("NO:第"+ LocalDateTime.now().getYear()+"QT"+deviceRepelDetail.getId());
deviceRepelDetailService.saveDeviceRepelDetail(orderOutDataRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(orderOutDataRepelDetail);
taskBto.setOwnUnit(orderOutData.getReceiveUnitId()); taskBto.setOwnUnit(orderOutData.getReceiveUnitId());
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1209,0); taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1209,0);
...@@ -400,20 +407,24 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -400,20 +407,24 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (unitsService.findById(deviceRepelDetail.getReceiveUnitId()).getLevel()==2){ if (unitsService.findById(deviceRepelDetail.getReceiveUnitId()).getLevel()==2){
inStock=2; inStock=2;
}else { }else {
inStock=12; inStock=15;
} }
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds()); List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach( libraries.forEach(
deviceLibrary -> { deviceLibrary -> {
deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit()); // deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit()); // deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setLifeStatus(inStock); // deviceLibrary.setLifeStatus(inStock);
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId())); list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
} }
); );
deviceLibraryDao.saveAll(libraries); log.info("更新数据装备以及所属单位-{}",libraries.size());
repelDeviceUnitService.saveAllRepelDeviceUnit(list); long time=System.currentTimeMillis();
deviceLibraryDao.upDateLeftStatusAndUnitName(inStock,deviceRepelDetail.getReceiveUnit(),StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time);
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId()); RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(1); repelTaskStatistical.setTaskStatus(1);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
...@@ -440,15 +451,19 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -440,15 +451,19 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibrary -> { deviceLibrary -> {
Units units1= unitsService.findbyName(deviceLibrary.getOwnUnit()); Units units1= unitsService.findbyName(deviceLibrary.getOwnUnit());
list.add(new RepelDeviceUnit(deviceLibrary.getId(),units1.getUnitId())); list.add(new RepelDeviceUnit(deviceLibrary.getId(),units1.getUnitId()));
deviceLibrary.setLocationUnit(units.getName()); // deviceLibrary.setLocationUnit(units.getName());
deviceLibrary.setOwnUnit(units.getName()); // deviceLibrary.setOwnUnit(units.getName());
deviceLibrary.setLifeStatus(12); // deviceLibrary.setLifeStatus(15);
ids.append(",").append(deviceLibrary.getId()); ids.append(",").append(deviceLibrary.getId());
} }
); );
log.info("更新数据装备以及所属单位-{}",libraries.size());
long time=System.currentTimeMillis();
deviceLibraryDao.upDateLeftStatusAndUnitName(15,units.getName(),StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time);
deviceRepelDetail.setDeviceIds(ids.toString()); deviceRepelDetail.setDeviceIds(ids.toString());
deviceLibraryDao.saveAll(libraries); // deviceLibraryDao.saveAll(libraries);
repelDeviceUnitService.saveAllRepelDeviceUnit(list); repelDeviceUnitService.saveAllRepelDeviceUnit(list);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
isEnd(taskBto,deviceRepelDetail.getRepelId()); isEnd(taskBto,deviceRepelDetail.getRepelId());
...@@ -496,14 +511,18 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -496,14 +511,18 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds()); List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach( libraries.forEach(
deviceLibrary -> { deviceLibrary -> {
deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit()); // deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit()); // deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setLifeStatus(2); // deviceLibrary.setLifeStatus(2);
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId())); list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
} }
); );
log.info("更新数据装备以及所属单位-{}",libraries.size());
long time=System.currentTimeMillis();
deviceLibraryDao.upDateLeftStatusAndUnitName(2,deviceRepelDetail.getReceiveUnit(),StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time);
deviceLibraryDao.saveAll(libraries); // deviceLibraryDao.saveAll(libraries);
repelDeviceUnitService.saveAllRepelDeviceUnit(list); repelDeviceUnitService.saveAllRepelDeviceUnit(list);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
} }
......
...@@ -7,6 +7,7 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; ...@@ -7,6 +7,7 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit; import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical; import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel; import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel;
import com.tykj.dev.device.sendback.entity.vo.DirectlyUnderNavigation;
import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo; import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo;
import com.tykj.dev.device.sendback.service.*; import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.sendback.util.StringUtils; import com.tykj.dev.device.sendback.util.StringUtils;
...@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -115,6 +117,22 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -115,6 +117,22 @@ public class RepelQueryServiceImpl implements RepelQueryService {
} }
@Override
public List<DirectlyUnderNavigation> directlyUnderUnitLeftNavigation(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
List<DirectlyUnderNavigation> list=new ArrayList<>();
DeviceRepelDetail deviceRepelDetail=repelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
DeviceRepel deviceRepel=deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
unitsService.findAllByIdIn(StringUtils.stringToList(deviceRepel.getTaskScope())).forEach(
units -> {
if (units.getType()==2){
list.add(new DirectlyUnderNavigation(units.getUnitId(),units.getName(), UUID.randomUUID().toString()));
}
}
);
return list;
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){ private List<DeviceLibrary> findInvoleDevice(String involeDevice){
if (involeDevice!=null && !involeDevice.equals("")&& !involeDevice.equals(",")) { if (involeDevice!=null && !involeDevice.equals("")&& !involeDevice.equals(",")) {
List<String> idStringList = Arrays.asList(involeDevice.split(",")); List<String> idStringList = Arrays.asList(involeDevice.split(","));
......
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;
/**
* @author zjm
* @version 1.0.0
* @ClassName sendDevice.java
* @Description TODO
* @createTime 2021年01月18日 09:36:00
*/
@Service
@Slf4j
public class sendDevice implements CommandLineRunner {
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Override
public void run(String... args) throws Exception {
log.info("开始模拟数据");
// DeviceLibrary deviceLibrary= deviceLibraryDao.findById(4).get();
// for (int i=0;i<100;i++){
// deviceLibrary.setId(null);
// deviceLibraryDao.save(deviceLibrary);
// }
log.info("模拟数据结束");
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论