提交 135e1726 authored 作者: 133's avatar 133

【file 清退 user】 代码修改

上级 ad198e35
package com.tykj.dev.device.file.entity; package com.tykj.dev.device.file.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -25,7 +27,8 @@ public class Destruction { ...@@ -25,7 +27,8 @@ public class Destruction {
private String disposeUnitName; private String disposeUnitName;
@ApiModelProperty(name = "报废时间") @ApiModelProperty(name = "报废时间")
private String time; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date time;
@ApiModelProperty(name = "单据号") @ApiModelProperty(name = "单据号")
private String number; private String number;
......
...@@ -52,67 +52,5 @@ public class DocumentDevice { ...@@ -52,67 +52,5 @@ public class DocumentDevice {
public Integer getLen(){ public Integer getLen(){
return deviceSerialNumber.length(); return deviceSerialNumber.length();
} }
public DocumentDevice toDocumentDevice(){
switch (category){
case "1":
category="密码机";
break;
case "2":
category="密码模块";
break;
case "3":
category="密码芯片";
break;
case "4":
category="说明书";
break;
case "5":
category="U盘";
break;
case "6":
category="光盘";
break;
case "7":
category="密码软件";
break;
case "8":
category="密码卡";
default:
category="-";
break;
}
switch (securityClassification){
case "1":
securityClassification="绝密";
break;
case "2":
securityClassification="机密";
break;
case "3":
securityClassification="秘密";
break;
default:
securityClassification="无";
break;
}
switch (applicationField){
case "1":
applicationField="省一级";
break;
case "2":
applicationField="市一级";
break;
case "3":
applicationField="县一级";
break;
default:
applicationField="无";
break;
}
return this;
}
} }
...@@ -15,6 +15,10 @@ import org.xhtmlrenderer.pdf.ITextFontResolver; ...@@ -15,6 +15,10 @@ import org.xhtmlrenderer.pdf.ITextFontResolver;
import org.xhtmlrenderer.pdf.ITextRenderer; import org.xhtmlrenderer.pdf.ITextRenderer;
import java.io.*; import java.io.*;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -185,6 +189,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -185,6 +189,7 @@ public class JavaToPdfHtmlFreeMarker {
private static Map<String,Object> toMap(Documents documents,List<DocumentDevice> list,String test,Integer page,Integer count){ private static Map<String,Object> toMap(Documents documents,List<DocumentDevice> list,String test,Integer page,Integer count){
Map<String,Object> data = new HashMap(); Map<String,Object> data = new HashMap();
data.put("ul",test); data.put("ul",test);
data.put("number",documents.getNumber()); data.put("number",documents.getNumber());
data.put("title",documents.getTitle()); data.put("title",documents.getTitle());
...@@ -193,14 +198,16 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -193,14 +198,16 @@ public class JavaToPdfHtmlFreeMarker {
data.put("senderUnit",documents.getSenderUnit()); data.put("senderUnit",documents.getSenderUnit());
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
List<DocumentDevice> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1); AtomicInteger i= new AtomicInteger(1);
list.forEach( list.forEach(
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice));
} }
); );
data.put("documentDevices",list.stream().map(DocumentDevice::toDocumentDevice).collect(Collectors.toList())); data.put("documentDevices",list1);
return data; return data;
} }
...@@ -210,14 +217,16 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -210,14 +217,16 @@ public class JavaToPdfHtmlFreeMarker {
data.put("title",confirm.getTitle()); data.put("title",confirm.getTitle());
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
List<DocumentDevice> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1); AtomicInteger i= new AtomicInteger(1);
list.forEach( list.forEach(
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice));
} }
); );
data.put("documentDevices",list.stream().map(DocumentDevice::toDocumentDevice).collect(Collectors.toList())); data.put("documentDevices",list1);
return data; return data;
} }
...@@ -228,21 +237,96 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -228,21 +237,96 @@ public class JavaToPdfHtmlFreeMarker {
data.put("ul",test); data.put("ul",test);
data.put("unitName",destruction.getDisposeUnitName()); data.put("unitName",destruction.getDisposeUnitName());
data.put("number",destruction.getNumber()); data.put("number",destruction.getNumber());
data.put("time",destruction.getTime()); Instant instant = destruction.getTime().toInstant();
String local1 = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
data.put("time",local1);
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
List<DocumentDevice> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1); AtomicInteger i= new AtomicInteger(1);
list.forEach( list.forEach(
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice));
} }
); );
data.put("documentDevices",list.stream().map(DocumentDevice::toDocumentDevice).collect(Collectors.toList())); data.put("documentDevices",list1);
return data; return data;
} }
private static DocumentDevice toDocDevice(DocumentDevice documentDevice){
DocumentDevice documentDevice1=new DocumentDevice();
documentDevice1.setCode(documentDevice.getCode());
documentDevice1.setParts(documentDevice.getParts());
documentDevice1.setProductionSerialNumber(documentDevice.getProductionSerialNumber());
documentDevice1.setModel(documentDevice.getModel());
documentDevice1.setCount(documentDevice.getCount());
documentDevice1.setRemark(documentDevice.getRemark());
documentDevice1.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber());
switch (documentDevice.getCategory()){
case "1":
documentDevice1.setCategory("密码机");
break;
case "2":
documentDevice1.setCategory("密码模块");
break;
case "3":
documentDevice1.setCategory("密码芯片");
break;
case "4":
documentDevice1.setCategory("说明书");
break;
case "5":
documentDevice1.setCategory("U盘");
break;
case "6":
documentDevice1.setCategory("光盘");
break;
case "7":
documentDevice1.setCategory("密码软件");
break;
case "8":
documentDevice1.setCategory("密码卡");
default:
documentDevice1.setCategory("-");
break;
}
switch (documentDevice.getSecurityClassification()){
case "1":
documentDevice1.setSecurityClassification("绝密");
break;
case "2":
documentDevice1.setSecurityClassification("机密");
break;
case "3":
documentDevice1.setSecurityClassification("秘密");
break;
default:
documentDevice1.setSecurityClassification("无");
break;
}
switch (documentDevice.getApplicationField()){
case "1":
documentDevice1.setApplicationField("省一级");
break;
case "2":
documentDevice1.setApplicationField("市一级");
break;
case "3":
documentDevice1.setApplicationField("县一级");
break;
default:
documentDevice1.setApplicationField("无");
break;
}
return documentDevice1;
}
/** /**
......
...@@ -63,6 +63,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>, ...@@ -63,6 +63,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
Integer countAllByModelAndOwnUnitInAndLifeStatusNotIn(String model,List<String> unitNames,List<Integer> lifeStatus); Integer countAllByModelAndOwnUnitInAndLifeStatusNotIn(String model,List<String> unitNames,List<Integer> lifeStatus);
Integer countAllByModelAndOwnUnitInAndLifeStatusIn(String model,List<String> unitNames,List<Integer> lifeStatus);
List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames); List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames);
......
...@@ -100,10 +100,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -100,10 +100,9 @@ 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());
List<Integer> lifeStatus=new ArrayList<>(); List<Integer> lifeStatus=new ArrayList<>();
lifeStatus.add(DeviceLifeStatus.RETIRE.id); lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id);
lifeStatus.add(DeviceLifeStatus.LOSS.id); lifeStatus.add(DeviceLifeStatus.REPEL.id);
lifeStatus.add(DeviceLifeStatus.DESTROYED.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.SCRAP_I.id);
List<String> directlUnderUnitNames=new ArrayList<>(); List<String> directlUnderUnitNames=new ArrayList<>();
AtomicBoolean directlUnderUnit= new AtomicBoolean(false); AtomicBoolean directlUnderUnit= new AtomicBoolean(false);
AtomicBoolean correspondingLevel= new AtomicBoolean(false); AtomicBoolean correspondingLevel= new AtomicBoolean(false);
...@@ -146,7 +145,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -146,7 +145,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (deviceRepel.getRepelStatus()==1){ if (deviceRepel.getRepelStatus()==1){
modelCounts1.clear(); modelCounts1.clear();
deviceRepel.getModels().forEach(i->{ deviceRepel.getModels().forEach(i->{
modelCounts1.add(new ModelCount(i,deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusNotIn(i,unitsService.findBySubordinateUnitName(units1.getUnitId()),lifeStatus))); modelCounts1.add(new ModelCount(i,deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i,unitsService.findBySubordinateUnitName(units1.getUnitId()),lifeStatus)));
}); });
} }
list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), JacksonUtil.toJSon(modelCounts1), "")); list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), JacksonUtil.toJSon(modelCounts1), ""));
...@@ -165,7 +164,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -165,7 +164,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (deviceRepel.getRepelStatus()==1) { if (deviceRepel.getRepelStatus()==1) {
modelCounts.clear(); modelCounts.clear();
deviceRepel.getModels().forEach(i -> { deviceRepel.getModels().forEach(i -> {
modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusNotIn(i, directlUnderUnitNames,lifeStatus))); modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i, directlUnderUnitNames,lifeStatus)));
}); });
} }
TaskBto taskBto2 = directlyUnderTask(units.getUnitId(), deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId(),deviceRepel.getTitle()); TaskBto taskBto2 = directlyUnderTask(units.getUnitId(), deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId(),deviceRepel.getTitle());
...@@ -179,7 +178,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -179,7 +178,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (deviceRepel.getRepelStatus()==1) { if (deviceRepel.getRepelStatus()==1) {
modelCounts.clear(); modelCounts.clear();
deviceRepel.getModels().forEach(i -> { deviceRepel.getModels().forEach(i -> {
modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusNotIn(i, strings,lifeStatus))); modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i, strings,lifeStatus)));
}); });
} }
TaskBto taskBto1 = oneselfTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId(),deviceRepel.getTitle()); TaskBto taskBto1 = oneselfTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId(),deviceRepel.getTitle());
...@@ -198,10 +197,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -198,10 +197,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
// 生成的任务放入统计表中 关联信息 // 生成的任务放入统计表中 关联信息
// 修改当前任务的状态 市清退任务待区县提交 // 修改当前任务的状态 市清退任务待区县提交
List<Integer> lifeStatus=new ArrayList<>(); List<Integer> lifeStatus=new ArrayList<>();
lifeStatus.add(DeviceLifeStatus.RETIRE.id); lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id);
lifeStatus.add(DeviceLifeStatus.LOSS.id); lifeStatus.add(DeviceLifeStatus.REPEL.id);
lifeStatus.add(DeviceLifeStatus.DESTROYED.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.SCRAP_I.id);
User user = userService.findByUser(userId); User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId()); Units units=unitsService.findById(user.getUnitsId());
Area area=areaService.findByid(units.getAreaId()); Area area=areaService.findByid(units.getAreaId());
...@@ -234,7 +232,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -234,7 +232,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (deviceRepel.getRepelStatus()==1) { if (deviceRepel.getRepelStatus()==1) {
modelCounts1.clear(); modelCounts1.clear();
deviceRepel.getModels().forEach(i -> { deviceRepel.getModels().forEach(i -> {
modelCounts1.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusNotIn(i, unitNames,lifeStatus))); modelCounts1.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i, unitNames,lifeStatus)));
}); });
} }
TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId()); TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId());
......
...@@ -73,7 +73,7 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -73,7 +73,7 @@ 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())){
if (deviceLibrary.getLifeStatus()==2) { if (deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==15 ||deviceLibrary.getLifeStatus()==4) {
deviceLibraries.add(deviceLibrary); deviceLibraries.add(deviceLibrary);
} }
}else { }else {
......
...@@ -240,14 +240,16 @@ ...@@ -240,14 +240,16 @@
padding: 5px; padding: 5px;
border-style: solid; border-style: solid;
border-color: #a9c6c9; border-color: #a9c6c9;
background-color: #dedede;
} }
table.altrowstable td { table.altrowstable td {
border-width: 0px; border-width: 0px;
padding: 5px; padding: 5px;
border-style: solid; /*border-style: solid;*/
border-color: #a9c6c9; /*border-color: #a9c6c9;*/
word-break: break-all; word-break: break-all;
word-wrap: break-word; word-wrap: break-word;
border-bottom: 1px solid #bebebe;
} }
.oddrowcolor{ .oddrowcolor{
background-color:#fff; background-color:#fff;
...@@ -315,7 +317,7 @@ ...@@ -315,7 +317,7 @@
${dev.count} ${dev.count}
</#if> </#if>
</td> </td>
<td style="text-align: left;">${dev.deviceSerialNumber}</td> <td>${dev.deviceSerialNumber}</td>
</tr> </tr>
</#list> </#list>
</table> </table>
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
} }
.returnTablePrint .line3{ .returnTablePrint .line3{
width: 100%; width: 100%;
height: 50px; height: 80px;
/* box-sizing: border-box; */ /* box-sizing: border-box; */
/*height:150px;*/ /*height:150px;*/
/*display: flex;*/ /*display: flex;*/
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
box-sizing: border-box; box-sizing: border-box;
/*padding-left: 20px;*/ /*padding-left: 20px;*/
position: relative; position: relative;
line-height: 50px; line-height: 80px;
} }
.returnTablePrint .line3 .left{ .returnTablePrint .line3 .left{
border-right: 1px solid #7f7f7f; border-right: 1px solid #7f7f7f;
...@@ -248,12 +248,14 @@ ...@@ -248,12 +248,14 @@
padding: 5px; padding: 5px;
border-style: solid; border-style: solid;
border-color: #a9c6c9; border-color: #a9c6c9;
background-color: #dedede;
} }
table.altrowstable td { table.altrowstable td {
border-width: 0px; border-width: 0px;
padding: 5px; padding: 5px;
border-style: solid; /*border-style: solid;*/
border-color: #a9c6c9; /*border-color: #a9c6c9;*/
border: 1px solid #bebebe;
word-break:break-all; word-break:break-all;
word-wrap : break-word; word-wrap : break-word;
} }
......
...@@ -100,22 +100,23 @@ ...@@ -100,22 +100,23 @@
border-color: #a9c6c9; border-color: #a9c6c9;
border-collapse: collapse; border-collapse: collapse;
text-align: center; text-align: center;
/*table-layout: fixed;*/ table-layout: fixed;
/*word-break:break-all;*/ word-break:break-all;
} }
table.altrowstable th { table.altrowstable th {
border-width: 0px; border-width: 0px;
padding: 8px; padding: 8px;
border-style: solid; border-style: solid;
border-color: #a9c6c9; border-color: #a9c6c9;
background-color: #dedede;
} }
table.altrowstable td { table.altrowstable td {
border-width: 0px; border-width: 0px;
padding: 8px; padding: 8px;
border-style: solid; border-style: solid;
border-color: #a9c6c9; border-color: #a9c6c9;
/*word-break:break-all;*/ word-break:break-all;
/*word-wrap : break-word;*/ word-wrap : break-word;
} }
.oddrowcolor{ .oddrowcolor{
background-color:#fff; background-color:#fff;
...@@ -152,23 +153,25 @@ ...@@ -152,23 +153,25 @@
</span> </span>
</div> </div>
</p> </p>
<table class="altrowstable" id="alternatecolor"> <div style="height: 825px;">
<tr> <table class="altrowstable" id="alternatecolor">
<th>序号</th><th style="width: 150px;">型号</th><th>形态</th><th>密级</th><th>应用领域</th><th style="width: 150px;">装备序列号</th> <tr>
</tr> <th>序号</th><th style="width: 150px;">型号</th><th>形态</th><th>密级</th><th>应用领域</th><th style="width: 150px;">装备序列号</th>
<#list documentDevices as dev> </tr>
<tr> <#list documentDevices as dev>
<td> <tr>
<#if dev.code != 0> <td>
${dev.code} <#if dev.code != 0>
</#if> ${dev.code}
</td> </#if>
<td>${dev.model}</td><td>${dev.category}</td><td>${dev.securityClassification}</td><td>${dev.applicationField}</td><td>${dev.deviceSerialNumber}</td> </td>
</tr> <td>${dev.model}</td><td>${dev.category}</td><td>${dev.securityClassification}</td><td>${dev.applicationField}</td><td>${dev.deviceSerialNumber}</td>
</#list> </tr>
</table> </#list>
</table>
</div>
</div> </div>
<p class="person" style="margin-top: 50px"> <p class="person" style="margin-top: 20px">
<span style="width: 200px;text-align: left">经办人:</span> <span style="width: 200px;text-align: left">经办人:</span>
<span style="width: 200px;text-align: left">审核人:</span> <span style="width: 200px;text-align: left">审核人:</span>
</p> </p>
......
...@@ -50,7 +50,6 @@ public class UnitsController { ...@@ -50,7 +50,6 @@ public class UnitsController {
@GetMapping(value = "/area") @GetMapping(value = "/area")
@ApiOperation(value = "查询装备库、专管员左侧的区域单位列表", notes = "单位组织结构集合") @ApiOperation(value = "查询装备库、专管员左侧的区域单位列表", notes = "单位组织结构集合")
public ResponseEntity selectOrganizationUnits(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser) { public ResponseEntity selectOrganizationUnits(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser) {
log.info("数据星系:{}",securityUser);
return ResponseEntity.ok(unitsService.findLeftNavigation(securityUser)); return ResponseEntity.ok(unitsService.findLeftNavigation(securityUser));
} }
...@@ -73,6 +72,14 @@ public class UnitsController { ...@@ -73,6 +72,14 @@ public class UnitsController {
return ResponseEntity.ok(unitsService.findBySubordinate(unitsId)); return ResponseEntity.ok(unitsService.findBySubordinate(unitsId));
} }
@GetMapping(value = "/find/units/subordinate/{unitsId}")
@ApiOperation(value = "根据当前用户的单位ID查询下级单位对象(不包括type为2的)", notes = "单位")
public ResponseEntity findLastSubordinate(@PathVariable Integer unitsId) {
return ResponseEntity.ok(unitsService.findSubordinateList(unitsId));
}
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(value = "添加单位接口", notes = "单位") @ApiOperation(value = "添加单位接口", notes = "单位")
public ResponseEntity saveUnits(@RequestBody Units units){ public ResponseEntity saveUnits(@RequestBody Units units){
......
...@@ -133,4 +133,6 @@ public interface UnitsService extends PublicService<Units> { ...@@ -133,4 +133,6 @@ public interface UnitsService extends PublicService<Units> {
List<Units> findSuperiorUnitsList(); List<Units> findSuperiorUnitsList();
List<Units> findDirectlyUnder(); List<Units> findDirectlyUnder();
List<Units> findSubordinateList(Integer unitsId);
} }
...@@ -311,6 +311,13 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -311,6 +311,13 @@ public class UnitsServiceImpl implements UnitsService {
return unitsList; return unitsList;
} }
@Override
public List<Units> findSubordinateList(Integer unitsId) {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
return unitsDao.findAllByAreaIdIn(areaIds);
}
@Override @Override
public Units save(Units units) { public Units save(Units units) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论