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

【清退】提交BUG修改代码

上级 4936e1c6
......@@ -3,9 +3,11 @@ package com.tykj.dev.device.library.repository;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
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.repository.query.Param;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
......@@ -64,5 +66,16 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List<DeviceLibrary> findAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
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 {
/**
* 使用
*/
USE(14, "使用");
USE(14, "使用"),
/**
* 待清退
*/
REPEL(15,"清退");
public Integer id;
......
......@@ -73,12 +73,21 @@ public class RepelQueryController {
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}")
@ApiOperation(value = "省直属任务装备查询接口", notes = "省直属任务装备查询接口")
@ApiOperation(value = "省直属任务单位列表查询接口", notes = "省直属任务装备查询接口")
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 {
*
*/
@ApiModelProperty(value = "正文")
@Column(columnDefinition = "TEXT")
private String files;
......
......@@ -40,6 +40,12 @@ public class DeviceRepelDetail extends BaseEntity {
@ApiModelProperty(value = "账单id")
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;
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.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.user.base.ret.LeftNavigation;
import java.util.List;
......@@ -53,7 +55,13 @@ public interface RepelQueryService {
List<DeviceLibrary> clearedList(Integer unitId);
/**
*
*省直属任务装备查询接口
*/
List<DeviceLibrary> provinceDirectlyUnderDev(Integer taskId);
/**
* 查询直属单位列表
*/
List<DirectlyUnderNavigation> directlyUnderUnitLeftNavigation(Integer taskId);
}
......@@ -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.RepelTaskStatistical;
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.service.*;
import com.tykj.dev.device.sendback.util.StringUtils;
......@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
......@@ -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){
if (involeDevice!=null && !involeDevice.equals("")&& !involeDevice.equals(",")) {
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论