提交 834b4ed5 authored 作者: 133's avatar 133

[清退] 添加账单查询列表

上级 5df9d118
...@@ -2,10 +2,7 @@ package com.tykj.dev.device.sendback.controller; ...@@ -2,10 +2,7 @@ package com.tykj.dev.device.sendback.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.vo.OrderOutData; import com.tykj.dev.device.sendback.entity.vo.*;
import com.tykj.dev.device.sendback.entity.vo.RepelAuditResult;
import com.tykj.dev.device.sendback.entity.vo.ResolveConfirm;
import com.tykj.dev.device.sendback.entity.vo.StorageDeviceRepel;
import com.tykj.dev.device.sendback.service.RepelBusinessService; import com.tykj.dev.device.sendback.service.RepelBusinessService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -165,4 +162,5 @@ public class RepelDevController { ...@@ -165,4 +162,5 @@ public class RepelDevController {
repelBusinessService.provinceDirectlyUnder(taskId); repelBusinessService.provinceDirectlyUnder(taskId);
return ResponseEntity.ok("省直属单位任务提交成功"); return ResponseEntity.ok("省直属单位任务提交成功");
} }
} }
...@@ -3,6 +3,7 @@ package com.tykj.dev.device.sendback.controller; ...@@ -3,6 +3,7 @@ package com.tykj.dev.device.sendback.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.sendback.entity.vo.DeviceIdLIstVo; import com.tykj.dev.device.sendback.entity.vo.DeviceIdLIstVo;
import com.tykj.dev.device.sendback.entity.vo.ModelAndTypeVo; import com.tykj.dev.device.sendback.entity.vo.ModelAndTypeVo;
import com.tykj.dev.device.sendback.entity.vo.SendBackOutFormVo;
import com.tykj.dev.device.sendback.service.RepelQueryService; import com.tykj.dev.device.sendback.service.RepelQueryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -123,4 +124,9 @@ public class RepelQueryController { ...@@ -123,4 +124,9 @@ public class RepelQueryController {
return ResponseEntity.ok(repelQueryService.findRepelListModelNameGroup(modelAndTypeVo)); return ResponseEntity.ok(repelQueryService.findRepelListModelNameGroup(modelAndTypeVo));
} }
@ApiOperation(value = "查询清退单列表")
@GetMapping("/getList")
public ResponseEntity getList() {
return ResponseEntity.ok(repelQueryService.getList());
}
} }
...@@ -44,19 +44,22 @@ public class DeviceRepel extends BaseEntity { ...@@ -44,19 +44,22 @@ public class DeviceRepel extends BaseEntity {
* 页面类型 * 页面类型
*/ */
@ApiModelProperty(value = "列装id文本 新建时不用填写") @ApiModelProperty(value = "列装id文本 新建时不用填写")
@Column(name = "fielding",columnDefinition = "TEXT")
private String fielding; private String fielding;
/** /**
* 描述 * 描述
*/ */
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
@Column(name = "describes",columnDefinition = "TEXT")
private String describes; private String describes;
/** /**
* 任务范围 * 任务范围
* 字典值 *
*/ */
@ApiModelProperty(value = "任务范围 新建时不用填写") @ApiModelProperty(value = "任务范围 新建时不用填写")
@Column(name = "task_scope",columnDefinition = "TEXT")
private String taskScope; private String taskScope;
/** /**
......
package com.tykj.dev.device.sendback.entity.domain; package com.tykj.dev.device.sendback.entity.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.misc.base.BaseEntity; import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -175,25 +176,32 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -175,25 +176,32 @@ public class DeviceRepelDetail extends BaseEntity {
/** /**
* 出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配 * 出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/ */
@Column(name = "send_check_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配") @ApiModelProperty(value = "出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配")
private String sendCheckDetail; private String sendCheckDetail;
/** /**
* 出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条 * 出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/ */
@ApiModelProperty(value = "出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条") @ApiModelProperty(value = "出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条")
@Column(name = "send_check_result",columnDefinition = "TEXT")
private String sendCheckResult; private String sendCheckResult;
/** /**
* 接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配 * 接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/ */
@ApiModelProperty(value = "接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配") @ApiModelProperty(value = "接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配")
@Column(name = "receive_check_detail",columnDefinition = "TEXT")
private String receiveCheckDetail; private String receiveCheckDetail;
/** /**
* 接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条 * 接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/ */
@ApiModelProperty(value = "接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条") @ApiModelProperty(value = "接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条")
@Column(name = "receive_check_result",columnDefinition = "TEXT")
private String receiveCheckResult; private String receiveCheckResult;
@ApiModelProperty(value = "装备id集合") @ApiModelProperty(value = "装备id集合")
@Column(name = "device_ids",columnDefinition = "TEXT")
private String deviceIds; private String deviceIds;
@ApiModelProperty(value = "发件单位签章id") @ApiModelProperty(value = "发件单位签章id")
...@@ -209,15 +217,21 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -209,15 +217,21 @@ public class DeviceRepelDetail extends BaseEntity {
* 提交描述 * 提交描述
*/ */
@ApiModelProperty(value = "提交描述") @ApiModelProperty(value = "提交描述")
@Column(name = "submit_description",columnDefinition = "TEXT")
private String submitDescription; private String submitDescription;
/** /**
* 审核反馈 * 审核反馈
*/ */
@ApiModelProperty(value = "审核反馈") @ApiModelProperty(value = "审核反馈")
@Column(name = "auditing_feedback",columnDefinition = "TEXT")
private String auditingFeedback; private String auditingFeedback;
@Transient @Transient
@ApiModelProperty(value = "装备List") @ApiModelProperty(value = "装备List")
private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>(); private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>();
@Transient
@ApiModelProperty(value = "清退单对象")
private List<FileRet> billFiles ;
} }
...@@ -67,12 +67,14 @@ public class RepelTaskStatistical extends BaseEntity { ...@@ -67,12 +67,14 @@ public class RepelTaskStatistical extends BaseEntity {
* 提交的型号和数量 json存储modelCount对象 * 提交的型号和数量 json存储modelCount对象
*/ */
@ApiModelProperty(value = "提交的型号和数量 json存储modelCount对象") @ApiModelProperty(value = "提交的型号和数量 json存储modelCount对象")
@Column(name = "model_count",columnDefinition = "TEXT")
private String modelCount; private String modelCount;
/** /**
* 描述 * 描述
*/ */
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
@Column(name = "des",columnDefinition = "TEXT")
private String des; private String des;
/** /**
......
...@@ -25,4 +25,6 @@ public class StorageDeviceRepel { ...@@ -25,4 +25,6 @@ public class StorageDeviceRepel {
private List<FileRet> inFiles; private List<FileRet> inFiles;
private List<Integer> deviceIds; private List<Integer> deviceIds;
private Integer userId;
} }
...@@ -2,6 +2,8 @@ package com.tykj.dev.device.sendback.service; ...@@ -2,6 +2,8 @@ package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import java.util.List;
public interface DeviceRepelDetailService { public interface DeviceRepelDetailService {
/** /**
* 添加清退详情 * 添加清退详情
...@@ -22,4 +24,6 @@ public interface DeviceRepelDetailService { ...@@ -22,4 +24,6 @@ public interface DeviceRepelDetailService {
* @return 详情对象 * @return 详情对象
*/ */
DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId); DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId);
List<DeviceRepelDetail> findAll();
} }
...@@ -75,7 +75,6 @@ public interface RepelBusinessService { ...@@ -75,7 +75,6 @@ public interface RepelBusinessService {
void oneselfRepel(Integer taskId,StorageDeviceRepel storageDeviceRepel,Integer userId); void oneselfRepel(Integer taskId,StorageDeviceRepel storageDeviceRepel,Integer userId);
/** /**
* 省直属任务等待上传 * 省直属任务等待上传
*/ */
......
...@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary; ...@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; 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.vo.*; import com.tykj.dev.device.sendback.entity.vo.*;
import org.springframework.http.ResponseEntity;
import java.util.List; import java.util.List;
...@@ -80,4 +81,10 @@ public interface RepelQueryService { ...@@ -80,4 +81,10 @@ public interface RepelQueryService {
List<DevRepelVo> repelManagementListDetails(List<Integer> ids); List<DevRepelVo> repelManagementListDetails(List<Integer> ids);
/**
查询清退单
*/
List<DeviceRepelDetail> getList();
} }
...@@ -64,6 +64,11 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -64,6 +64,11 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
} }
} }
@Override
public List<DeviceRepelDetail> findAll() {
return deviceRepelDetailDao.findAll();
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){ private List<DeviceLibrary> findInvoleDevice(String involeDevice){
if (involeDevice!=null && !involeDevice.equals(",") ) { if (involeDevice!=null && !involeDevice.equals(",") ) {
......
...@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service; ...@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -93,6 +94,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -93,6 +94,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
Units units=unitsService.findById(user.getUnitsId()); Units units=unitsService.findById(user.getUnitsId());
Area area=areaService.findByid(units.getAreaId()); Area area=areaService.findByid(units.getAreaId());
AtomicBoolean directlUnderUnit= new AtomicBoolean(false); AtomicBoolean directlUnderUnit= new AtomicBoolean(false);
AtomicBoolean correspondingLevel= new AtomicBoolean(false);
deviceRepel.setFielding(StringUtils.ListToString(deviceRepel.getFieldingIds())); deviceRepel.setFielding(StringUtils.ListToString(deviceRepel.getFieldingIds()));
deviceRepel.setTaskScope(StringUtils.ListToString(deviceRepel.getTaskScopes())); deviceRepel.setTaskScope(StringUtils.ListToString(deviceRepel.getTaskScopes()));
deviceRepel.setFiles(FilesUtil.stringFileToList(deviceRepel.getFileRets())); deviceRepel.setFiles(FilesUtil.stringFileToList(deviceRepel.getFileRets()));
...@@ -115,20 +117,23 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -115,20 +117,23 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}); });
String model=JacksonUtil.toJSon(modelCounts); String model=JacksonUtil.toJSon(modelCounts);
deviceRepel.getTaskScopes().forEach( deviceRepel.getTaskScopes().forEach(
unisId->{ unisId-> {
Units units1= unitsService.findById(unisId); if (unisId != units.getUnitId()) {
if (units1.getType()==2) { Units units1 = unitsService.findById(unisId);
directlUnderUnit.set(deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()))); if (units1.getType() == 2) {
}else if (units1.getType()==1){ directlUnderUnit.set(deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(units1.getUnitId())));
log.info("asdasdas{}",units1.getName()); } else if (units1.getType() == 1) {
Area area1=areaService.findByid(units1.getAreaId()); Area area1 = areaService.findByid(units1.getAreaId());
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(units1.getUnitId()))){ 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, ""));
} }
}
}else {
correspondingLevel.set(true);
} }
} }
); );
...@@ -143,7 +148,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -143,7 +148,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setId(null); deviceRepelDetail.setId(null);
List<String> strings=new ArrayList<>(); List<String> strings=new ArrayList<>();
strings.add(units.getName()); strings.add(units.getName());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),strings)){
if (correspondingLevel.get()&&deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),strings)){
TaskBto taskBto1 = oneselfTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId()); TaskBto taskBto1 = oneselfTask(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(),taskBto1.getId(),0,"省本级",model,""));
} }
...@@ -178,17 +184,19 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -178,17 +184,19 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
String model=JacksonUtil.toJSon(modelCounts); String model=JacksonUtil.toJSon(modelCounts);
List<RepelTaskStatistical> list=new ArrayList<>(); List<RepelTaskStatistical> list=new ArrayList<>();
deviceRepel.getTaskScopes().forEach( deviceRepel.getTaskScopes().forEach(
unisId->{ unisId-> {
Units units1= unitsService.findById(unisId); if (unisId != units.getUnitId()) {
Area area1=areaService.findByid(units1.getAreaId()); Units units1 = unitsService.findById(unisId);
deviceRepelDetail.setId(null); Area area1 = areaService.findByid(units1.getAreaId());
deviceRepelDetail.setSendUnit(units1.getName()); deviceRepelDetail.setId(null);
deviceRepelDetail.setSendUnitId(units1.getUnitId()); deviceRepelDetail.setSendUnit(units1.getName());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(units1.getUnitId()))){ deviceRepelDetail.setSendUnitId(units1.getUnitId());
TaskBto taskBto1= countyRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),taskBto.getId()); if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(units1.getUnitId()))) {
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),0,area1.getName(),model,"")); TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), model, ""));
} }
}
} }
); );
repelTaskStatisticalService.saveAllRepelTaskStatistical(list); repelTaskStatisticalService.saveAllRepelTaskStatistical(list);
...@@ -248,16 +256,18 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -248,16 +256,18 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List<RepelTaskStatistical> list = new ArrayList<>(); List<RepelTaskStatistical> list = new ArrayList<>();
StringUtils.stringToList(deviceRepel.getTaskScope()).forEach( StringUtils.stringToList(deviceRepel.getTaskScope()).forEach(
unisId -> { unisId -> {
Units units1 = unitsService.findById(unisId); if (unisId != deviceRepel.getUnitId()) {
Area area1 = areaService.findByid(units1.getAreaId()); Units units1 = unitsService.findById(unisId);
deviceRepelDetail.setId(null); Area area1 = areaService.findByid(units1.getAreaId());
deviceRepelDetail.setSendUnit(units1.getName()); deviceRepelDetail.setId(null);
deviceRepelDetail.setSendUnitId(units1.getUnitId()); deviceRepelDetail.setSendUnit(units1.getName());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(unisId))) { deviceRepelDetail.setSendUnitId(units1.getUnitId());
TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId()); if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(unisId))) {
list.add(new RepelTaskStatistical(deviceRepel.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), model, "")); TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId());
} list.add(new RepelTaskStatistical(deviceRepel.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), model, ""));
}
}
} }
); );
repelTaskStatisticalService.saveAllRepelTaskStatistical(list); repelTaskStatisticalService.saveAllRepelTaskStatistical(list);
...@@ -385,7 +395,7 @@ log.info("存储结束{}",System.currentTimeMillis()-time1); ...@@ -385,7 +395,7 @@ log.info("存储结束{}",System.currentTimeMillis()-time1);
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);
devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getSendUnit()+"装备清退出库"+",等待"+deviceRepelDetail.getReceiveUnit()+"接收"); devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getSendUnit()+"装备清退出库"+",等待"+deviceRepelDetail.getReceiveUnit()+"接收",userId);
orderOutDataRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds())); orderOutDataRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
//把一些字段填写到对象中,保存入库 //把一些字段填写到对象中,保存入库
//把任务状态修改为 清退提交装备待接收 //把任务状态修改为 清退提交装备待接收
...@@ -429,7 +439,7 @@ log.info("存储结束{}",System.currentTimeMillis()-time1); ...@@ -429,7 +439,7 @@ log.info("存储结束{}",System.currentTimeMillis()-time1);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
isEnd(taskBto,deviceRepelDetail.getRepelId()); isEnd(taskBto,deviceRepelDetail.getRepelId());
devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getReceiveUnit()+"接收"+deviceRepelDetail.getSendUnit()+"装备清退装备,任务完成"); devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getReceiveUnit()+"接收"+deviceRepelDetail.getSendUnit()+"装备清退装备,任务完成",storageDeviceRepel.getUserId());
//完结当前任务 //完结当前任务
//把任务状态修改为 清退提交装备已完成 //把任务状态修改为 清退提交装备已完成
//修改统计表中的数据信息 状态 //修改统计表中的数据信息 状态
...@@ -448,25 +458,20 @@ log.info("存储结束{}",System.currentTimeMillis()-time1); ...@@ -448,25 +458,20 @@ log.info("存储结束{}",System.currentTimeMillis()-time1);
List<DeviceLibrary> libraries= deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(storageDeviceRepel.getDeviceIds()); List<DeviceLibrary> libraries= deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(storageDeviceRepel.getDeviceIds());
libraries.forEach( libraries.forEach(
deviceLibrary -> { deviceLibrary -> {
Units units1= unitsService.findbyName(deviceLibrary.getOwnUnit());
list.add(new RepelDeviceUnit(deviceLibrary.getId(),units1.getUnitId()));
// deviceLibrary.setLocationUnit(units.getName());
// deviceLibrary.setOwnUnit(units.getName());
// deviceLibrary.setLifeStatus(15);
ids.append(",").append(deviceLibrary.getId()); ids.append(",").append(deviceLibrary.getId());
} }
); );
log.info("更新数据装备以及所属单位-{}",libraries.size()); log.info("更新数据装备以及所属单位-{}",libraries.size());
long time=System.currentTimeMillis(); long time=System.currentTimeMillis();
deviceLibraryDao.upDateLeftStatusAndUnitName(15,units.getName(),StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); deviceLibraryDao.upDateLeftStatusAndUnitName(15,units.getName(),libraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList()));
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time); 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());
devLogAdd(libraries,"省本级清退,把装备转变为待清退"); devLogAdd(libraries,"省本级清退,把装备转变为待清退",userId);
//完结当前任务 //完结当前任务
//修改统计表中的数据信息 状态 //修改统计表中的数据信息 状态
//把装备的状态都修改为待清退。 //把装备的状态都修改为待清退。
...@@ -524,7 +529,12 @@ log.info("存储结束{}",System.currentTimeMillis()-time1); ...@@ -524,7 +529,12 @@ log.info("存储结束{}",System.currentTimeMillis()-time1);
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time); log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time);
// deviceLibraryDao.saveAll(libraries); // deviceLibraryDao.saveAll(libraries);
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
//异步执行 已清退数据保存数据库
CompletableFuture.runAsync(() -> {
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
});
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
} }
...@@ -675,15 +685,17 @@ log.info("存储结束{}",System.currentTimeMillis()-time1); ...@@ -675,15 +685,17 @@ log.info("存储结束{}",System.currentTimeMillis()-time1);
} }
} }
public void devLogAdd(List<DeviceLibrary> deviceLibraries,String remark){ public void devLogAdd(List<DeviceLibrary> deviceLibraries,String remark,Integer userId){
List<DeviceLog> logDtos=new ArrayList<>(); List<DeviceLog> logDtos=new ArrayList<>();
deviceLibraries.forEach( deviceLibraries.forEach(
deviceLibrary -> { deviceLibrary -> {
logDtos.add(new DeviceLogDto(deviceLibrary.getId(),remark,null).toDo()); logDtos.add(new DeviceLogDto(deviceLibrary.getId(),remark,null,userId).toDo());
} }
); );
deviceLogService.saveAllLog(logDtos); CompletableFuture.runAsync(() -> {
deviceLogService.saveAllLog(logDtos);
});
} }
......
...@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -39,6 +40,10 @@ public class RepelDeviceUnitServiceImpl implements RepelDeviceUnitService { ...@@ -39,6 +40,10 @@ public class RepelDeviceUnitServiceImpl implements RepelDeviceUnitService {
@Override @Override
public List<DeviceLibrary> findHasRepel(Integer unitId) { public List<DeviceLibrary> findHasRepel(Integer unitId) {
List<Integer> ids= repelDeviceUnitDao.findAllByUnitsId(unitId).stream().map(RepelDeviceUnit::getDeviceId).collect(Collectors.toList()); List<Integer> ids= repelDeviceUnitDao.findAllByUnitsId(unitId).stream().map(RepelDeviceUnit::getDeviceId).collect(Collectors.toList());
return deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(ids); if (ids!=null&&ids.size()!=0) {
} return deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(ids);
}else {
return new ArrayList<>();
}
}
} }
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
...@@ -13,11 +14,13 @@ import com.tykj.dev.device.task.service.TaskService; ...@@ -13,11 +14,13 @@ 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;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
import jdk.nashorn.internal.ir.IfNode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.Id;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -73,7 +76,9 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -73,7 +76,9 @@ public class RepelQueryServiceImpl implements RepelQueryService {
deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).forEach( deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).forEach(
deviceLibrary -> { deviceLibrary -> {
if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){ if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
deviceLibraries.add(deviceLibrary); if (deviceLibrary.getLifeStatus()==2) {
deviceLibraries.add(deviceLibrary);
}
}else { }else {
deviceLibrariesAbnormal.add(deviceLibrary); deviceLibrariesAbnormal.add(deviceLibrary);
} }
...@@ -184,6 +189,20 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -184,6 +189,20 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return deviceLibraryDao.findAllById(ids).stream().map(this::devRepelVo).collect(Collectors.toList()); return deviceLibraryDao.findAllById(ids).stream().map(this::devRepelVo).collect(Collectors.toList());
} }
@Override
public List<DeviceRepelDetail> getList() {
List<DeviceRepelDetail> list=new ArrayList<>();
repelDetailService.findAll().forEach(
deviceRepelDetail -> {
if (deviceRepelDetail.getBillFile()!=null){
deviceRepelDetail.setBillFiles(FilesUtil.stringFileToList(deviceRepelDetail.getBillFile()));
list.add(deviceRepelDetail);
}
}
);
return list;
}
private DevRepelVo devRepelVo(DeviceLibrary deviceLibrary){ private DevRepelVo devRepelVo(DeviceLibrary deviceLibrary){
return new DevRepelVo(deviceLibrary.getId(),deviceLibrary.getName(),deviceLibrary.getModel(),deviceLibrary.getSeqNumber(),deviceLibrary.getType()); return new DevRepelVo(deviceLibrary.getId(),deviceLibrary.getName(),deviceLibrary.getModel(),deviceLibrary.getSeqNumber(),deviceLibrary.getType());
......
...@@ -42,4 +42,9 @@ public class LeftNavigation { ...@@ -42,4 +42,9 @@ public class LeftNavigation {
* 类型 * 类型
*/ */
private Integer type; private Integer type;
/**
* 序号
*/
private Integer order;
} }
...@@ -91,4 +91,12 @@ public class UnitsController { ...@@ -91,4 +91,12 @@ public class UnitsController {
return ResponseEntity.ok(unitsService.findByUserIdUnitsTrainListVo(unitsId)); return ResponseEntity.ok(unitsService.findByUserIdUnitsTrainListVo(unitsId));
} }
@GetMapping("/countries/units")
@ApiOperation(value = "省入库发件单位下拉接口", notes = "省入库发件单位下拉接口")
public ResponseEntity findSuperiorUnitsList(){
return ResponseEntity.ok(unitsService.findSuperiorUnitsList());
}
} }
...@@ -73,7 +73,7 @@ public class Area { ...@@ -73,7 +73,7 @@ public class Area {
} }
public LeftNavigation toLeftNavigation(){ public LeftNavigation toLeftNavigation(){
return new LeftNavigation(id,name,null, UUID.randomUUID().toString(),1); return new LeftNavigation(id,name,null, UUID.randomUUID().toString(),1,Double.valueOf(orders).intValue());
} }
......
...@@ -79,6 +79,13 @@ public class Units { ...@@ -79,6 +79,13 @@ public class Units {
@ApiModelProperty(value = "区域id", name = "areaId", example = "12321L") @ApiModelProperty(value = "区域id", name = "areaId", example = "12321L")
private Integer areaId; private Integer areaId;
/**
* 排序
*/
@ApiModelProperty(value = "排序", name = "showOrder", example = "12321L")
private Integer showOrder;
@ApiModelProperty(value = "区域名称", name = "areaName", example = "12321L") @ApiModelProperty(value = "区域名称", name = "areaName", example = "12321L")
@Transient @Transient
private String areaName; private String areaName;
...@@ -99,6 +106,7 @@ public class Units { ...@@ -99,6 +106,7 @@ public class Units {
"1234", "1234",
1,1, 1,1,
null, null,
null,
null null
); );
} }
...@@ -114,6 +122,6 @@ public class Units { ...@@ -114,6 +122,6 @@ public class Units {
} }
public LeftNavigation toLeftNavigation(){ public LeftNavigation toLeftNavigation(){
return new LeftNavigation(unitId,name,null, UUID.randomUUID().toString(),2); return new LeftNavigation(unitId,name,null, UUID.randomUUID().toString(),2,showOrder);
} }
} }
...@@ -121,4 +121,9 @@ public interface UnitsService extends PublicService<Units> { ...@@ -121,4 +121,9 @@ public interface UnitsService extends PublicService<Units> {
*/ */
LeftNavigation findLeftNavigation(SecurityUser securityUser); LeftNavigation findLeftNavigation(SecurityUser securityUser);
/**
* 省入库上级单位对象查询接口
*/
List<Units> findSuperiorUnitsList();
} }
...@@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity; ...@@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -112,12 +113,12 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -112,12 +113,12 @@ public class UnitsServiceImpl implements UnitsService {
} }
); );
} }
leftNavigation.setLeftNavigations(leftNavigationList1); leftNavigation.setLeftNavigations(leftNavigationList1.stream().sorted(Comparator.comparing(LeftNavigation::getOrder)).collect(Collectors.toList()));
leftNavigationList.add(leftNavigation); leftNavigationList.add(leftNavigation);
}); });
}else if (thisArea.getType()==2){ }else if (thisArea.getType()==2){
areas.forEach(area -> { areas.forEach(area -> {
leftNavigationList.addAll(unitsDao.findAllByAreaId(area.getId()).stream().map(Units::toLeftNavigation).collect(Collectors.toList())); leftNavigationList.addAll(unitsDao.findAllByAreaId(area.getId()).stream().map(Units::toLeftNavigation).sorted(Comparator.comparing(LeftNavigation::getOrder)).collect(Collectors.toList()));
}); });
}else { }else {
return leftNavigationList; return leftNavigationList;
...@@ -184,6 +185,7 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -184,6 +185,7 @@ public class UnitsServiceImpl implements UnitsService {
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList()); List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
List<Units> units1= unitsDao.findAllByAreaIdIn(areaIds); List<Units> units1= unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel()==1){ if (units.getLevel()==1){
units1.add(units);
units1.addAll(unitsDao.findAllByType(2)); units1.addAll(unitsDao.findAllByType(2));
} }
return units1; return units1;
...@@ -276,10 +278,18 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -276,10 +278,18 @@ public class UnitsServiceImpl implements UnitsService {
leftNavigation= belongsArea.toLeftNavigation(); leftNavigation= belongsArea.toLeftNavigation();
leftNavigationList= unitsDao.findAllByAreaId(belongsArea.getId()).stream().map(Units::toLeftNavigation).collect(Collectors.toList()); leftNavigationList= unitsDao.findAllByAreaId(belongsArea.getId()).stream().map(Units::toLeftNavigation).collect(Collectors.toList());
} }
leftNavigation.setLeftNavigations(leftNavigationList);
leftNavigation.setLeftNavigations(leftNavigationList.stream().sorted(Comparator.comparing(LeftNavigation::getOrder)).collect(Collectors.toList()));
return leftNavigation; return leftNavigation;
} }
@Override
public List<Units> findSuperiorUnitsList() {
return unitsDao.findAllByType(3);
}
@Override @Override
public Units save(Units units) { public Units save(Units units) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论