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

[清退] 提交代码 1-25

上级 bce9059c
...@@ -61,6 +61,9 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>, ...@@ -61,6 +61,9 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
boolean existsAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames); boolean existsAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
Integer countAllByModelAndOwnUnitIn(String model,List<String> unitNames);
List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames); List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames);
List<DeviceLibrary> findAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames); List<DeviceLibrary> findAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
......
...@@ -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.RepelManagementVo;
import com.tykj.dev.device.sendback.entity.vo.SendBackOutFormVo; 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;
...@@ -61,19 +62,19 @@ public class RepelQueryController { ...@@ -61,19 +62,19 @@ public class RepelQueryController {
/** /**
* 待清退列表 * 待清退列表
*/ */
@GetMapping(value ="/toRepelList/{unitId}") @PostMapping(value ="/toRepelList")
@ApiOperation(value = "待清退列表", notes = "待清退列表") @ApiOperation(value = "待清退列表", notes = "待清退列表")
public ResponseEntity toRepelList(@PathVariable Integer unitId){ public ResponseEntity toRepelList(@RequestBody RepelManagementVo repelManagementVo){
return ResponseEntity.ok(repelQueryService.toRepelList(unitId)); return ResponseEntity.ok(repelQueryService.toRepelList(repelManagementVo));
} }
/** /**
* 已清退列表 * 已清退列表
*/ */
@GetMapping(value ="/clearedList/{unitId}") @PostMapping(value ="/clearedList")
@ApiOperation(value = "已清退列表", notes = "清退列表") @ApiOperation(value = "已清退列表", notes = "清退列表")
public ResponseEntity clearedList(@PathVariable Integer unitId){ public ResponseEntity clearedList(@RequestBody RepelManagementVo repelManagementVo){
return ResponseEntity.ok(repelQueryService.clearedList(unitId)); return ResponseEntity.ok(repelQueryService.clearedList(repelManagementVo));
} }
// /** // /**
......
...@@ -80,7 +80,7 @@ public class DeviceRepel extends BaseEntity { ...@@ -80,7 +80,7 @@ public class DeviceRepel extends BaseEntity {
* 1。全量清退 2。部分清退 * 1。全量清退 2。部分清退
*/ */
@ApiModelProperty(value = "清退状态 1。全量清退 2。部分清退") @ApiModelProperty(value = "清退状态 1。全量清退 2。部分清退")
private Integer repelStatus; private Integer repelStatus=1;
/** /**
* 发起人名称 * 发起人名称
......
...@@ -226,6 +226,10 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -226,6 +226,10 @@ public class DeviceRepelDetail extends BaseEntity {
@Column(name = "auditing_feedback",columnDefinition = "TEXT") @Column(name = "auditing_feedback",columnDefinition = "TEXT")
private String auditingFeedback; private String auditingFeedback;
@ApiModelProperty(value = "清退状态",name = "1.清退中,2.清退完成")
private Integer repelStatus;
@Transient @Transient
@ApiModelProperty(value = "装备List") @ApiModelProperty(value = "装备List")
private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>(); private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>();
...@@ -234,4 +238,6 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -234,4 +238,6 @@ public class DeviceRepelDetail extends BaseEntity {
@ApiModelProperty(value = "清退单对象") @ApiModelProperty(value = "清退单对象")
private List<FileRet> billFiles ; private List<FileRet> billFiles ;
} }
package com.tykj.dev.device.sendback.entity.vo; package com.tykj.dev.device.sendback.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.Date;
/** /**
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
...@@ -17,13 +20,34 @@ import lombok.NoArgsConstructor; ...@@ -17,13 +20,34 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
@ApiModel("清退管理-统计点击列表对象") @ApiModel("清退管理-统计点击列表对象")
public class DevRepelVo { public class DevRepelVo {
/**
* 数据id
*/
private Integer id; private Integer id;
/**
* 名称
*/
private String name; private String name;
/**
* 类型
*/
private String model; private String model;
/**
* 装备序列号
*/
private String code; private String code;
/**
* 形态
*/
private Integer type; private Integer type;
/**
* 清退时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date repelTime;
} }
package com.tykj.dev.device.sendback.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelManagementVo.java
* @Description 清退管理 清退清退vo
* @createTime 2021年01月23日 12:42:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("清退管理 清退清退vo")
public class RepelManagementVo {
@ApiModelProperty(name = "开始清退的年份 默认各式 2020-01-01 00:00:00")
private Long time;
@ApiModelProperty(name = "开始清退的年份 默认各式 2020-01-01 00:00:00")
private Long endTime;
@ApiModelProperty(name = "单位id")
private Integer unitId;
}
...@@ -4,5 +4,9 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; ...@@ -4,5 +4,9 @@ import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
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.Date;
import java.util.List;
public interface DeviceRepelDetailDao extends JpaRepository<DeviceRepelDetail, Integer>, JpaSpecificationExecutor<DeviceRepelDetail> { public interface DeviceRepelDetailDao extends JpaRepository<DeviceRepelDetail, Integer>, JpaSpecificationExecutor<DeviceRepelDetail> {
List<DeviceRepelDetail> findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(Date time,Date endTime, Integer unitId, Integer repelStatus);
} }
package com.tykj.dev.device.sendback.service; package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import java.util.Date;
import java.util.List; import java.util.List;
public interface DeviceRepelDetailService { public interface DeviceRepelDetailService {
...@@ -26,4 +28,9 @@ public interface DeviceRepelDetailService { ...@@ -26,4 +28,9 @@ public interface DeviceRepelDetailService {
DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId); DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId);
List<DeviceRepelDetail> findAll(); List<DeviceRepelDetail> findAll();
/**
* 根据年份以及单位 查询清退的装备列表
*/
List<DeviceLibrary> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId);
} }
...@@ -44,7 +44,7 @@ public interface RepelQueryService { ...@@ -44,7 +44,7 @@ public interface RepelQueryService {
/** /**
* 待清退列表 省 * 待清退列表 省
*/ */
List<ModelNameGroup> toRepelList(Integer unitId); List<ModelNameGroup> toRepelList(RepelManagementVo repelManagementVo);
/** /**
...@@ -55,7 +55,7 @@ public interface RepelQueryService { ...@@ -55,7 +55,7 @@ public interface RepelQueryService {
/** /**
* 已清退列表 * 已清退列表
*/ */
List<ModelNameGroup> clearedList(Integer unitId); List<ModelNameGroup> clearedList(RepelManagementVo repelManagementVo);
/** /**
*省直属任务装备查询接口 (无用) *省直属任务装备查询接口 (无用)
...@@ -69,7 +69,6 @@ public interface RepelQueryService { ...@@ -69,7 +69,6 @@ public interface RepelQueryService {
List<DirectlyUnderNavigation> directlyUnderUnitLeftNavigation(Integer taskId); List<DirectlyUnderNavigation> directlyUnderUnitLeftNavigation(Integer taskId);
/** /**
*省直属任务装备已选择装备列表接口 *省直属任务装备已选择装备列表接口
*/ */
......
...@@ -11,10 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,10 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -69,6 +66,17 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -69,6 +66,17 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
return deviceRepelDetailDao.findAll(); return deviceRepelDetailDao.findAll();
} }
@Override
public List<DeviceLibrary> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId) {
List<DeviceLibrary> libraries=new ArrayList<>();
deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2).forEach(
deviceRepelDetail -> {
libraries.addAll(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
}
);
return libraries;
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){ private List<DeviceLibrary> findInvoleDevice(String involeDevice){
if (involeDevice!=null && !involeDevice.equals(",") ) { if (involeDevice!=null && !involeDevice.equals(",") ) {
......
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.service.FilesUtil; 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;
...@@ -21,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -21,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.Id; import javax.persistence.Id;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -96,9 +99,9 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -96,9 +99,9 @@ public class RepelQueryServiceImpl implements RepelQueryService {
} }
@Override @Override
public List<ModelNameGroup> toRepelList(Integer unitId) { public List<ModelNameGroup> toRepelList(RepelManagementVo repelManagementVo) {
Units units= unitsService.findById(unitId); Units units= unitsService.findById(repelManagementVo.getUnitId());
return toModelNameGroup(deviceLibraryDao.findAllByOwnUnitAndLocationUnitAndLifeStatus(units.getName(),units.getName(),15)); return toModelNameGroup(deviceLibraryDao.findAllByOwnUnitAndLocationUnitAndLifeStatus(units.getName(),units.getName(),15).stream().filter(deviceLibrary -> deviceLibrary.getUpdateTime().getTime()>=repelManagementVo.getTime()&&deviceLibrary.getUpdateTime().getTime()<=repelManagementVo.getEndTime()).collect(Collectors.toList()));
} }
private List<ModelNameGroup> toModelNameGroup(List<DeviceLibrary> deviceLibraries){ private List<ModelNameGroup> toModelNameGroup(List<DeviceLibrary> deviceLibraries){
...@@ -145,9 +148,9 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -145,9 +148,9 @@ public class RepelQueryServiceImpl implements RepelQueryService {
@Override @Override
public List<ModelNameGroup> clearedList(Integer unitId) { public List<ModelNameGroup> clearedList(RepelManagementVo repelManagementVo) {
new Date(repelManagementVo.getTime());
return toModelNameGroup(deviceUnitService.findHasRepel(unitId)); return toModelNameGroup(repelDetailService.findYearAndUnitToDeviceList(new Date(repelManagementVo.getTime()),new Date(repelManagementVo.getEndTime()),repelManagementVo.getUnitId()));
} }
@Override @Override
...@@ -204,7 +207,7 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -204,7 +207,7 @@ public class RepelQueryServiceImpl implements RepelQueryService {
} }
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(),deviceLibrary.getUpdateTime());
} }
private List<DeviceLibrary> findInvoleDevice(String involeDevice){ private List<DeviceLibrary> findInvoleDevice(String involeDevice){
......
...@@ -36,12 +36,22 @@ public class WorkHandover { ...@@ -36,12 +36,22 @@ public class WorkHandover {
/** /**
* 交接人 * 交接人
*/ */
private Integer handoverUserId; private Integer handoverUserAId;
/** /**
* 移交人 * 交接人b
*/ */
private Integer turnOverUserId; private Integer handoverUserBId;
/**
* 移交人a
*/
private Integer turnOverUserAId;
/**
* 移交人b
*/
private Integer turnOverUserBId;
/** /**
* 监交人 * 监交人
......
...@@ -22,17 +22,22 @@ public class WorkHandoverAddVo { ...@@ -22,17 +22,22 @@ public class WorkHandoverAddVo {
/** /**
* 交接人 * 交接人
*/ */
private Integer handoverUserId; private Integer handoverUserAId;
/** /**
* 移交人 * 交接人b
*/ */
private Integer turnOverUserId; private Integer handoverUserBId;
/** /**
* 监交人 * 移交人a
*/ */
private String inUserName; private Integer turnOverUserAId;
/**
* 移交人b
*/
private Integer turnOverUserBId;
public WorkHandover toWorkHandover() { public WorkHandover toWorkHandover() {
......
...@@ -77,7 +77,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService { ...@@ -77,7 +77,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
workHandover.setFileLists(JacksonUtil.toJSon(workHandoverEndAddVo.getFileLists())); workHandover.setFileLists(JacksonUtil.toJSon(workHandoverEndAddVo.getFileLists()));
workHandover = workHandoverDao.save(workHandover); workHandover = workHandoverDao.save(workHandover);
//把移交人的所有代办任务和跟踪任务替换名称,换成交接人 //把移交人的所有代办任务和跟踪任务替换名称,换成交接人
taskService.workHandover(workHandover.getHandoverUserId(), workHandover.getTurnOverUserId()); taskService.workHandover(workHandover.getHandoverUserAId(), workHandover.getTurnOverUserAId());
//推入完结状态 //推入完结状态
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id); TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id);
taskService.moveToEnd(taskBto); taskService.moveToEnd(taskBto);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论