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

[zjm] 负责模块代码提交

上级 a915d304
......@@ -207,7 +207,7 @@ public enum LogType {
DECOMMISSIONING_1(100201,DECOMMISSIONING.id, ORIGIN_STATUS.id,SEND_BACK_1210.id , "发起退役任务,等待中办签字单据"),
DECOMMISSIONING_2(100202,DECOMMISSIONING.id, SEND_BACK_1210.id,END.id , "上传中办签字单据,任务结束"),
DECOMMISSIONING_3(100203,DECOMMISSIONING.id, ORIGIN_STATUS.id,DECOMMISSIONING_1250.id , "发起了退役任务的草稿"),
DECOMMISSIONING_4(100204,DECOMMISSIONING.id, DECOMMISSIONING_1250.id,SEND_BACK_1210.id , "上传中办签字单据,任务结束"),
DECOMMISSIONING_4(100204,DECOMMISSIONING.id, DECOMMISSIONING_1250.id,SEND_BACK_1210.id , "退役出库完成,等待上传退役签收单"),
DECOMMISSIONING_5(100205,DECOMMISSIONING.id, SEND_BACK_1210.id,END.id , "上传中办签字单据,任务结束"),
DECOMMISSIONING_6(100206,DECOMMISSIONING.id, ORIGIN_STATUS.id,DECOMMISSIONING_1251.id , "发起退役任务,等待待用签章审核"),
DECOMMISSIONING_7(100207,DECOMMISSIONING.id, DECOMMISSIONING_1251.id,DECOMMISSIONING_1250.id , "调用电子签章审核,拒绝"),
......
......@@ -42,10 +42,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
......@@ -159,7 +156,13 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
deviceDecommissioningDetail=deviceDecommissioningDetailService.findDeviceDecommissioningDetail(taskBto.getBillId());
taskBto= taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1210,"country");
deviceDecommissioningDetail.setDecommissioningStatus(taskBto.getBillStatus());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"保存退役任务草稿",gainThisUser(userId,units.getUnitId())));
if (decommissioningOrderOutData.getSendUserbId()!=null){
deviceDecommissioningDetail.setSendUserbId(decommissioningOrderOutData.getSendUserbId());
}
if (decommissioningOrderOutData.getSenderUserB()!=null){
deviceDecommissioningDetail.setSenderUserB(decommissioningOrderOutData.getSenderUserB());
}
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起退役任务,待上传回执单据",gainThisUser(userId,units.getUnitId())));
}else {
deviceDecommissioningDetail = decommissioningOrderOutData.toDeviceDecommissioningDetail();
deviceDecommissioningDetailService.saveDeviceDecommissioningDetail(deviceDecommissioningDetail);
......@@ -167,6 +170,9 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
addMessage(new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "发起退役任务,待上传回执单据", gainThisUser(user.getUserId(), user.getUnitsId())));
deviceDecommissioningDetail.setNum("NO:第" + LocalDateTime.now().getYear() + "QT" + deviceDecommissioningDetail.getId());
deviceDecommissioningDetail.setDecommissioningStatus(taskBto.getBillStatus());
deviceDecommissioningDetail.setSendUserbId(decommissioningOrderOutData.getSendUserbId());
deviceDecommissioningDetail.setSenderUserB(decommissioningOrderOutData.getSenderUserB());
}
deviceDecommissioningDetail.setLeftSignatureId(decommissioningOrderOutData.getLeftSignatureId());
deviceDecommissioningDetail.setApplyNumber(decommissioningOrderOutData.getApplyNumber());
......@@ -260,6 +266,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
deviceDecommissioningDetail.setDecommissioningStatus(taskBto.getBillStatus());
}
deviceDecommissioningDetail.setReceiveTime(new Date());
deviceDecommissioningDetail.setApplyNumber(orderOutData.getApplyNumber());
deviceDecommissioningDetail.setReplayNumber(orderOutData.getReplayNumber());
deviceDecommissioningDetail.setReplyFiles(FilesUtil.stringFileToList(orderOutData.getReplyFileList()));
......@@ -361,7 +368,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUserId()!=userId).map(User::getUserId).collect(Collectors.toList());
}
/**
......
......@@ -79,9 +79,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
deviceDestroyBill= deviceDestroyBillVo.toDeviceDestroyBill();
if (deviceDestroyBillVo.getApplyId()!=null) {
Optional<DeviceDestroyBill> deviceDestroyBill1 = deviceDestroyBillService.findApplyId(deviceDestroyBillVo.getApplyId());
if (deviceDestroyBill1.isPresent()) {
deviceDestroyBill.setId(deviceDestroyBill1.get().getId());
}
deviceDestroyBill1.ifPresent(deviceDestroyBill2 -> deviceDestroyBill.setId(deviceDestroyBill2.getId()));
}
deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill);
deviceDestroyBill.setNum("NO:第" + LocalDateTime.now().getYear() + "XF" + deviceDestroyBill.getId());
......@@ -124,14 +122,15 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"销毁任务等待补充手续",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId())));
}
deviceDestroyBill.setDestroyTime(deviceDestroyBillVo.getDestroyTime());
deviceDestroyBill.setSupervisor(deviceDestroyBillVo.getSupervisor());
deviceDestroyBill.setLeader(deviceDestroyBillVo.getLeader());
deviceDestroyBill.setUndertaker(deviceDestroyBillVo.getUndertaker());
deviceDestroyBill.setApplyNumber(deviceDestroyBillVo.getApplyNumber());
deviceDestroyBill.setReplayNumber(deviceDestroyBillVo.getReplayNumber());
deviceDestroyBill.setApplyFiles(FilesUtil.stringFileToList(deviceDestroyBill.getApplyFileList()));
deviceDestroyBill.setReplayFiles(FilesUtil.stringFileToList(deviceDestroyBill.getReplayFileList()));
deviceDestroyBill.setScriptJson(JacksonUtil.toJSon(deviceDestroyBill.getScripts()));
deviceDestroyBill.setApplyFiles(FilesUtil.stringFileToList(deviceDestroyBillVo.getApplyFileList()));
deviceDestroyBill.setReplayFiles(FilesUtil.stringFileToList(deviceDestroyBillVo.getReplayFileList()));
deviceDestroyBill.setScriptJson(JacksonUtil.toJSon(deviceDestroyBillVo.getScripts()));
deviceLibraryDao.upDateSeqNumbersLeftStatus(DeviceLifeStatus.IN_THE_DESTROYED.id,seqNumbers);
deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill);
devLogAdd(seqNumbers,"发了销毁任务,状态转化为销毁中",securityUser.getCurrentUserInfo().getUserId());
......@@ -239,7 +238,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
* 根据单位id查询用户 去除用户id
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> !user.getUserId().equals(userId)).map(User::getUserId).collect(Collectors.toList());
}
/**
......
......@@ -614,26 +614,62 @@ public class JavaToPdfHtmlFreeMarker {
for (int i=0;i<documentDevices.size();i++){
DocumentDevice documentDevice=documentDevices.get(i);
int len=documentDevice.getDeviceSerialNumber().length();
if (len>=3500){
String deviceSerialNumber=documentDevice.getDeviceSerialNumber();
if (len > 1568){
int page=0;
int remainder = len % 1568;
int pageCount = (remainder > 0) ? len/1568 + 1 : len/1568;
while (page<pageCount-1) {
if (page==0) {
documentDevice.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber().substring(page * 1568, (page + 1) * 1568));
list.add(documentDevice);
lists.add(list);
}else {
DocumentDevice documentDevice1=new DocumentDevice();
documentDevice1.setDeviceSerialNumber(deviceSerialNumber.substring(page * 1568, (page + 1) * 1568));
list.add(documentDevice1);
lists.add(list);
}
list = new ArrayList<>();
page++;
}
DocumentDevice documentDevice1=new DocumentDevice();
documentDevice1.setDeviceSerialNumber(deviceSerialNumber.substring((pageCount-1)*1568, len));
list.add(documentDevice1);
count.set(len-(pageCount-1)*1568);
}else if (len==1568){
list.add(documentDevice);
lists.add(list);
list=new ArrayList<>();
}else {
int totle=count.get()+54+len;
if (totle>3510){
DocumentDevice documentDevice1=new DocumentDevice();
documentDevice1.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber().substring(3510-count.get(),len));
documentDevice.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber().substring(0,3510-count.get()));
list.add(documentDevice);
lists.add(list);
list=new ArrayList<>();
list.add(documentDevice1);
count.set(totle-3510);
list = new ArrayList<>();
}
else {
int totle=count.get()+29+len;
if (totle > 1568){
// if (len>56) {
if (1568-count.get()>56) {
DocumentDevice documentDevice1 = new DocumentDevice();
documentDevice1.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber().substring(1568 - count.get(), len));
documentDevice.setDeviceSerialNumber(documentDevice.getDeviceSerialNumber().substring(0, 1568 - count.get()));
list.add(documentDevice);
lists.add(list);
list = new ArrayList<>();
list.add(documentDevice1);
int num = documentDevice1.getDeviceSerialNumber().length();
int yu = num % 56;
count.set(num + yu);
}else {
list.add(documentDevice);
lists.add(list);
list = new ArrayList<>();
count.set(0);
// list.add(documentDevice);
}
}else {
list.add(documentDevice);
int yu=len%54;
int s=54-yu;
count.set(totle+s);
int yu=len%56;
totle=totle+(56-yu);
count.set(totle);
}
}
if (i==documentDevices.size()-1){
......@@ -641,7 +677,6 @@ public class JavaToPdfHtmlFreeMarker {
}
}
return lists;
}
/**
......@@ -661,28 +696,61 @@ public class JavaToPdfHtmlFreeMarker {
for (int i=0;i<workHandoverDevices.size();i++){
WorkHandoverDevice workHandoverDevice=workHandoverDevices.get(i);
int len=workHandoverDevice.getSeqs().length();
if (len>=3500){
String deviceSerialNumber=workHandoverDevice.getSeqs();
if (len > 1568){
int page=0;
int remainder = len % 1568;
int pageCount = (remainder > 0) ? len/1568 + 1 : len/1568;
while (page<pageCount-1) {
if (page==0) {
workHandoverDevice.setSeqs(workHandoverDevice.getSeqs().substring(page * 1568, (page + 1) * 1568));
list.add(workHandoverDevice);
lists.add(list);
}else {
WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice();
workHandoverDevice1.setSeqs(deviceSerialNumber.substring(page * 1568, (page + 1) * 1568));
list.add(workHandoverDevice1);
lists.add(list);
}
list = new ArrayList<>();
page++;
}
WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice();
workHandoverDevice1.setSeqs(deviceSerialNumber.substring((pageCount-1)*1568, len));
list.add(workHandoverDevice1);
count.set(len-(pageCount-1)*1568);
} else if (len==1568){
workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs()));
list.add(workHandoverDevice);
lists.add(list);
list=new ArrayList<>();
}else {
int totle=count.get()+54+len;
if (totle>3510){
WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice();
workHandoverDevice1.setSeqs(toString(workHandoverDevice1.getSeqs().substring(3510-count.get(),len)));
workHandoverDevice.setSeqs(toString(workHandoverDevice1.getSeqs().substring(0,3510-count.get())));
list.add(workHandoverDevice);
lists.add(list);
list=new ArrayList<>();
list.add(workHandoverDevice1);
count.set(totle-3510);
int totle=count.get()+29+len;
if (totle>1568){
if (1568-count.get()>56) {
WorkHandoverDevice workHandoverDevice1 = new WorkHandoverDevice();
workHandoverDevice1.setSeqs(toString(workHandoverDevice1.getSeqs().substring(3510 - count.get(), len)));
workHandoverDevice.setSeqs(toString(workHandoverDevice1.getSeqs().substring(0, 3510 - count.get())));
list.add(workHandoverDevice);
lists.add(list);
list = new ArrayList<>();
list.add(workHandoverDevice1);
int num = workHandoverDevice1.getSeqs().length();
int yu = num % 56;
count.set(num + yu);
}else {
list.add(workHandoverDevice);
lists.add(list);
list = new ArrayList<>();
count.set(0);
}
}else {
workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs()));
list.add(workHandoverDevice);
int yu=len%54;
int s=54-yu;
count.set(totle+s);
int yu=len%56;
totle=totle+(56-yu);
count.set(totle);
}
}
if (i==workHandoverDevices.size()-1){
......
......@@ -169,12 +169,12 @@ public class LossBillServiceImpl implements LossBillService {
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,StringUtils.stringToList(deviceLoss.getDevIds()));
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"装备找回业务审核成功",gainThisUser(user.getUserId(),user.getUnitsId())));
}else {
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"装备找回业务审核不通过",gainThisUser(user.getUserId(),user.getUnitsId())));
User user1= userService.findByUser(taskBto.getCreateUserId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"装备找回业务审核不通过",findUnitId(user1.getUnitsId())));
deviceLoss.setBackStatus(3);
}
}else {
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.RETRIEVE1400);
Units parentUnits=unitsService.findUnitAreaId(area.getFatherId());
deviceLoss.setCityUnitName(units.getName());
deviceLoss.setCityDes(retrieveAuditvo.getDes());
......@@ -186,7 +186,8 @@ public class LossBillServiceImpl implements LossBillService {
}else {
taskService.moveToEnd(taskBto);
deviceLoss.setBackStatus(3);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"装备找回业务审核不通过",gainThisUser(user.getUserId(),user.getUnitsId())));
User user1= userService.findByUser(taskBto.getCreateUserId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"装备找回业务审核不通过",findUnitId(user1.getUnitsId())));
}
}
......@@ -256,7 +257,7 @@ public class LossBillServiceImpl implements LossBillService {
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> !user.getUserId().equals(userId)).map(User::getUserId).collect(Collectors.toList());
}
/**
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>equip</artifactId>
<groupId>com.tykj</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-policydocument</artifactId>
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-file</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.policydocument.entity;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Transient;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName PolicyDocument.java
* @Description 政策文件信息
* @createTime 2021年05月13日 10:59:00
*/
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@ApiModel("政策文件信息")
public class PolicyDocument extends BaseEntity {
private String name;
@Column(name = "file_string" ,columnDefinition = "TEXT")
private String fileString;
@Transient
private List<FileRet> fileRetList;
}
package com.tykj.dev.device.policydocument;
\ No newline at end of file
......@@ -35,10 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
......@@ -82,7 +79,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
public TaskBto saveDeviceScrapDraft(Integer userId, ScrapOrderOutData scrapOrderOutData) {
User user = userService.findByUser(userId);
Units units = unitsService.findById(user.getUnitsId());
Scrap scrap = scrapOrderOutData.toScrap();
Scrap scrap;
List<ScriptSaveVo> scriptSaveVos = scrapOrderOutData.getScriptSaveVos();
List<String> seqNumbers = new ArrayList<>();
TaskBto taskBto;
......@@ -93,9 +90,8 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
}
}
);
scrap.setDeviceIds(StringUtils.ListToString(scrapOrderOutData.getDevIds()));
scrap.setOutboundFile(FilesUtil.stringFileToList(scrapOrderOutData.getOutboundFileList()));
if (scrapOrderOutData.getTaskId()==null) {
scrap= scrapOrderOutData.toScrap();
if (scrapOrderOutData.getApplyId() != null){
Optional<Scrap> scrap1 = scrapService.findApplyId(scrapOrderOutData.getApplyId());
if (scrap1.isPresent()) {
......@@ -108,12 +104,15 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
scrap.setScrapStatus(taskBto.getBillStatus());
}else {
taskBto=taskService.get(scrapOrderOutData.getTaskId());
Scrap scrap1= scrapService.findScrap(taskBto.getBillId());
scrap.setId(scrap1.getId());
scrap= scrapService.findScrap(taskBto.getBillId());
scrap.setScrapStatus(taskBto.getBillStatus());
scrap.setNum(scrap1.getNum());
scrap.setSenderUserB(scrapOrderOutData.getSenderUserB());
scrap.setSendUserbId(scrapOrderOutData.getSendUserbId());
}
scrap.setDeviceIds(StringUtils.ListToString(scrapOrderOutData.getDevIds()));
scrap.setOutboundFile(FilesUtil.stringFileToList(scrapOrderOutData.getOutboundFileList()));
scrap.setOutboundFile(FilesUtil.stringFileToList(scrapOrderOutData.getOutboundFileList()));
scrap.setApplyNumber(scrapOrderOutData.getApplyNumber());
scrap.setReplayNumber(scrapOrderOutData.getReplayNumber());
......@@ -223,7 +222,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
}
taskBto = taskService.moveToEnd(taskBto);
scrap.setScrapStatus(taskBto.getBillStatus());
scrap.setReceiveTime(new Date());
deviceLibraryDao.upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SCRAP_I.id,scrap.getReceiveUnit(),0,seqNumbers);
scrapService.saveScrap(scrap);
devLogAdd(seqNumbers,"报废任务完成,状态转化为已报废",user.getUserId());
......@@ -355,7 +354,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUserId()!=userId).map(User::getUserId).collect(Collectors.toList());
}
/**
......
......@@ -24,7 +24,6 @@ import java.util.List;
@Entity
@EntityListeners(AuditingEntityListener.class)
@ApiModel("清退账单")
@SQLDelete(sql = "update device_check_bill set delete_tag = 1 where id = ?")
public class DeviceRepel extends BaseEntity {
/**
* 数据id
......
......@@ -125,7 +125,7 @@ public class AgainStorageBillServiceImpl implements AgainStorageBillService {
}
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> !user.getUserId().equals(userId)).map(User::getUserId).collect(Collectors.toList());
}
/**
* 异步添加装备日志
......
......@@ -150,7 +150,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
}
);
List<SupervisorVo> supervisorVoList=new ArrayList<>();
//市区关系信息
Map<Integer,List<SupervisorVo>> supervisorMap=new HashMap<>();
//省本级
......@@ -159,14 +158,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
unitNameMap.forEach((k,v)->{
Units units1= unitsService.findbyName(k);
//区
if (units1.getLevel() == 3) {
List<SupervisorVo> supervisorVoList=new ArrayList<>();
if (units1.getLevel() == 3){
Area area1 = areaService.findByid(units1.getAreaId());
Units father = unitsService.findUnitAreaId(area1.getFatherId());
if (supervisorMap.containsKey(father.getUnitId())) {
List<SupervisorVo> supervisorVoList1 = supervisorMap.get(father.getUnitId());
supervisorVoList1.add(new SupervisorVo(units1.getName(), units1.getUnitId()));
supervisorMap.put(father.getUnitId(), supervisorVoList1);
} else {
supervisorVoList.add(new SupervisorVo(units1.getName(), units1.getUnitId()));
supervisorMap.put(father.getUnitId(), supervisorVoList);
......@@ -471,11 +471,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibraryDao.upDateLockStatus(1, resolveConfirm.getDevIds());
}
deviceRepelDetail.setDeviceIds(StringUtils.ListToString(resolveConfirm.getDevIds()));
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
if (resolveConfirm.getDes()!=null&&resolveConfirm.getDes().equals("")) {
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
}
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
log.info("提交装备接口结束{}",System.currentTimeMillis()-stime);
}
@Override
public void resolveAudit(Integer taskId, RepelAuditResult repelAuditResult) {
......@@ -1174,7 +1178,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> !user.getUserId().equals(userId)).map(User::getUserId).collect(Collectors.toList());
}
/**
......
......@@ -98,7 +98,7 @@ public class TrainController {
return ResponseEntity.ok(unitsService.findLeftNavigationNotDirectlyUnit(securityUser));
}
@PostMapping("/export/trainUser/{trainId}")
@GetMapping("/export/trainUser/{trainId}")
@ApiOperation(value = "导出培训人员信息", notes = "导出培训人员信息")
public ResponseEntity selectTrainUnitsOrganization(@PathVariable Integer trainId, HttpServletRequest request, HttpServletResponse response){
TrainTheme trainTheme= trainThemeService.findById(trainId);
......
......@@ -42,6 +42,7 @@ import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
......@@ -100,6 +101,7 @@ public class TrainJobController {
*/
@ApiOperation(value = "1.培训业务新建接口", notes = "有两类人员,一必须培训的人员,这里状态为报名确认,只需要确认就ok,2。不是必须报名的人员 状态 待报名,需要让用户选择报名 或不报名")
@PostMapping("/initiate")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity newTrain(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody TrainThemeAddVo trainThemeAddVo) {
TrainTheme trainThemeNoDb= trainThemeAddVo.toDo();
trainThemeNoDb.setTrainDataFiles(FilesUtil.stringFileToList(trainThemeAddVo.getTrainDataFileList()));
......@@ -181,6 +183,7 @@ public class TrainJobController {
* @param signUpReturn
* @return
*/
@Transactional(rollbackFor = Exception.class)
@ApiOperation(value = "2。报名和确认接口", notes = "若是确认请填写confirm为1,若报名returns=0、若不报名returns=1")
@PostMapping("/signUp")
public ResponseEntity signUp(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody signUpReturn signUpReturn) {
......@@ -232,6 +235,7 @@ public class TrainJobController {
* 管理者拒绝某个单位的报名
* @return
*/
@Transactional(rollbackFor = Exception.class)
@ApiOperation(value = "拒绝某个单位的报名", notes = "拒绝某个单位的报名")
@GetMapping("/refuse/{taskId}")
public ResponseEntity signUp(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @PathVariable Integer taskId) {
......@@ -254,6 +258,7 @@ public class TrainJobController {
* @param trainId
* @return
*/
@Transactional(rollbackFor = Exception.class)
@GetMapping("/signUpEnd/{trainId}")
public ResponseEntity signUpEnd(@PathVariable Integer trainId) {
TrainTheme trainTheme = trainThemeService.findById(trainId);
......@@ -274,6 +279,7 @@ public class TrainJobController {
//培训中
@GetMapping("/inTraining/{trainId}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity inTraining(@PathVariable Integer trainId) {
TrainTheme trainTheme = trainThemeService.findById(trainId);
trainTaskService.selectBillidAndBillType(trainId, BusinessEnum.TRAIN.id, StatusEnum.TRAIN1010.id).forEach(
......@@ -290,6 +296,7 @@ public class TrainJobController {
//市培训待审核
@ApiOperation(value = "3 录入成绩后调用的接口", notes = "状态改为'市培训申请发证")
@PostMapping("/gradesGrade")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity cityAudit(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody GradeEntryVo gradeEntryVo) {
TrainTheme trainTheme = trainThemeService.findById(gradeEntryVo.getTrainThemeId());
trainTheme.setTrainPapersFiles(FilesUtil.stringFileToList(gradeEntryVo.getTrainPapersFileList()));
......@@ -321,6 +328,7 @@ public class TrainJobController {
@ApiOperation(value = "省培训发证审核以及市培训申请发证审核调用接口", notes = "同意培训完成")
@PostMapping("/auditResult")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity gradeeEntry(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody GradeEntryVo gradeEntryVo) {
//向专管员证书表中添加数据
if (gradeEntryVo.getIsCertificate()==0) {
......@@ -377,6 +385,7 @@ public class TrainJobController {
* @param signUpReturn
* @return
*/
@Transactional(rollbackFor = Exception.class)
@ApiOperation(value = "end。成绩查看确认接口")
@PostMapping("/resultsConfirm")
public ResponseEntity resultsConfirm(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody signUpReturn signUpReturn) {
......
......@@ -161,12 +161,12 @@ public class TrainThemeServiceImpl implements TrainThemeService {
taskBtoList.forEach(
taskBto1 -> {
TrainUnit trainUnit=trainUnitMap.get(taskBto1.getOwnUnit());
if (taskBto1.getBillStatus().equals(StatusEnum.TRAIN1002.id)){
List<TrainUser> trainUsersNotSignUp = trainUsers.stream().filter(trainUser -> trainUser.getUnitsId().equals(taskBto1.getOwnUnit()) && trainUser.getIsSignUp() == 2).collect(Collectors.toList());
if (taskBto1.getBillStatus().equals(StatusEnum.TRAIN1002.id)){
flag.set(false);
notSignUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(), unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsers, taskBto1.getId(),trainUnit.getSubmitStatus()));
notSignUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(), unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsersNotSignUp, taskBto1.getId(),trainUnit.getSubmitStatus()));
}else {
List<TrainUser> trainUsersSignUp = trainUsers.stream().filter(trainUser -> trainUser.getUnitsId().equals(taskBto1.getOwnUnit()) && trainUser.getIsSignUp() == 1).collect(Collectors.toList());
List<TrainUser> trainUsersNotSignUp = trainUsers.stream().filter(trainUser -> trainUser.getUnitsId().equals(taskBto1.getOwnUnit()) && trainUser.getIsSignUp() == 2).collect(Collectors.toList());
if (trainUsersSignUp.size() != 0) {
signUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(),unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsersSignUp, taskBto1.getId(),trainUnit.getSubmitStatus()));
}
......
......@@ -191,7 +191,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
return userService.findAllByUnite(unitId).stream().filter(user -> !user.getUserId().equals(userId)).map(User::getUserId).collect(Collectors.toList());
}
/**
......
......@@ -41,7 +41,7 @@
<profile>
<id>test</id>
<properties>
<pom.package>jar</pom.package>
<pom.package>war</pom.package>
<activatedProperties>test</activatedProperties>
</properties>
</profile>
......@@ -132,6 +132,11 @@
<artifactId>dev-finalcheck</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-excel</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-taskselect</artifactId>
......
......@@ -5,12 +5,12 @@
<meta charset="UTF-8" />
<title>Document</title>
<style>
body {
body,span,p,tr,td {
font-size: 15px;
font-family: SimHei;
padding: 0;
margin: 0;
padding: 0;
}
/*@page{size:297mm 210mm;}<!-- 设置PDF页面大小,此配置只对生成PDF文件有效,不会对页面显示生效 -->*/
@page {
size: 297mm 210mm;
......@@ -24,9 +24,10 @@
.bottomTxt {
text-align: center;
font-size: 10px;
color: #646464;
font-size: 15px;
height: 10px;
color: #000;
margin-top: 4px;
line-height: 10px;
}
......@@ -100,8 +101,8 @@
color: #141414;
} */
.returnTablePrint .title .number {
font-size: 10px;
color: #646464;
font-size: 15px;
color: #000;
}
/* .returnTablePrint .other{
......@@ -130,7 +131,8 @@
box-sizing: border-box;
border-bottom: 1px solid #7f7f7f;
color: #000;
line-height: 20px;
height: 24px;
line-height: 24px;
}
.returnTablePrint .line1 .sendTo {
......@@ -151,7 +153,7 @@
.returnTablePrint .line1 .sendTo span:nth-child(2),
.returnTablePrint .line1 .sendNum span:nth-child(2) {
color: #4a475d;
color: #000;
display: inline-block;
margin-left: 5px;
}
......@@ -236,27 +238,31 @@
}
.returnTablePrint .checkName span:nth-child(2) {
color: #4a475d;
color: #000;
display: inline-block;
margin-left: 20px;
}
.returnTablePrint>>>.el-table tbody .cell {
color: #141414;
color: #000;
}
.returnTablePrint .label {
color: #646464;
font-size: 12px;
color: #000;
font-size: 15px;
;
}
.returnTablePrint .value {
color: #000;
font-size: 12px;
font-size: 15px;
;
}
.returnTablePrint .main-title span{
font-size: 22px;
color: #333;
font-weight: bold;
}
.returnTablePrint .main-title {
font-size: 17px;
color: #000000;
......@@ -277,7 +283,7 @@
table.altrowstable {
width: 100%;
font-size: 11px;
font-size: 15px;
color: #141414;
border-width: 0px;
border-color: #a9c6c9;
......@@ -292,25 +298,22 @@
border-style: solid;
border-color: #a9c6c9;
background-color: #dedede;
height: 20px;
line-height: 20px;
font-size: 10px;
height: 24px;
line-height: 24px;
font-size: 15px;
}
table.altrowstable td {
border-width: 0px;
height: 20px;
line-height: 20px;
font-size: 10px;
height: 24px;
line-height: 24px;
font-size: 15px;
/*border-style: solid;*/
/*border-color: #a9c6c9;*/
border: 1px solid #bebebe;
/*border: 1px solid #bebebe;*/
word-break: break-all;
word-wrap: break-word;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.oddrowcolor {
......@@ -367,13 +370,13 @@
<div class="line2 tableList">
<table class="altrowstable" id="alternatecolor">
<tr>
<th>序号</th>
<th width="70px">序号</th>
<th>型号</th>
<th>形态</th>
<th>密级</th>
<th>应用领域</th>
<th width="50px">密级</th>
<th width="120px">应用领域</th>
<th>数量</th>
<th>装备序列号</th>
<th width="420px">装备序列号</th>
<th>备注</th>
</tr>
<#list documentDevices as dev>
......
......@@ -5,17 +5,18 @@
<meta charset="UTF-8" />
<title>Document</title>
<style>
body {
body,span,p,tr,td {
font-size: 15px;
font-family: SimHei;
margin: 0;
padding: 0;
font-family: SimHei;
}
.bottomTxt {
text-align: center;
font-size: 10px;
color: #646464;
height: 10px;
font-size: 15px;
color: #000;
height: 15px;
line-height: 10px;
}
......@@ -98,9 +99,13 @@
.returnTablePrint .title span:nth-child(2) span {
font-size: 20px;
color: #141414;
color: #000;
}
.returnTablePrint .main-title span{
font-size: 22px;
color: #333;
font-weight: bold;
}
.returnTablePrint .main-title {
font-size: 17px;
color: #000000;
......@@ -109,8 +114,8 @@
table.altrowstable {
width: 100%;
font-size: 14px;
color: #141414;
font-size: 15px;
color: #000;
border-width: 0px;
border-color: #a9c6c9;
border-collapse: collapse;
......@@ -120,30 +125,22 @@
}
table.altrowstable th {
border-width: 0px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
background-color: #dedede;
height: 20px;
line-height: 20px;
font-size: 10px;
border: 1px solid #bebebe;
height: 24px;
line-height: 24px;
font-size: 15px;
}
table.altrowstable td {
border-width: 0px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
word-break: break-all;
/*border: 1px solid #bebebe;*/
word-wrap: break-word;
height: 20px;
line-height: 20px;
font-size: 10px;
height: 24px;
line-height: 24px;
font-size: 15px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.oddrowcolor {
......@@ -155,9 +152,9 @@
}
.person {
color: #4a475b;
color: #000;
text-align: right;
font-size: 16px;
font-size: 15px;
}
.person>span {
......@@ -180,32 +177,30 @@
<p class="title" style="margin-bottom:20px">
<div class="main-title">
<span>
${title!}
${title}
</span>
</div>
</p>
<div style="height: 900px;">
<table class="altrowstable" id="alternatecolor">
<tr>
<th>序号</th>
<th width="70px">序号</th>
<th style="width: 150px;">型号</th>
<th>形态</th>
<th>密级</th>
<th>状态</th>
<th style="width: 150px;">装备序列号</th>
<th>校对结果</th>
<th width="100px">密级</th>
<th width="100px">应用领域</th>
<th>装备序列号</th>
</tr>
<#list documentDevices as dev>
<tr>
<td>
${dev.code!}
</td>
<td>${dev.model!}</td>
<td>${dev.category!}</td>
<td>${dev.securityClassification!}</td>
<td>${dev.applicationField!}</td>
<td>${dev.deviceSerialNumber!}</td>
<td>${dev.proofreading!}</td>
<td>${dev.model}</td>
<td>${dev.category}</td>
<td>${dev.securityClassification}</td>
<td>${dev.applicationField}</td>
<td>${dev.deviceSerialNumber}</td>
</tr>
</#list>
</table>
......
......@@ -5,7 +5,8 @@
<meta charset="UTF-8" />
<title>Document</title>
<style>
body {
body,span,p,tr,td {
font-size: 15px;
font-family: SimHei;
margin: 0;
padding: 0;
......@@ -18,10 +19,11 @@
.bottomTxt {
text-align: center;
font-size: 10px;
color: #646464;
height: 10px;
line-height: 10px;
font-size: 15px;
color: #000;
height: 16px;
margin-top: 4px;
line-height: 16px;
}
.returnTablePrint {
......@@ -82,8 +84,8 @@
color: #141414;
} */
.returnTablePrint .title .number {
font-size: 10px;
color: #646464;
font-size: 15px;
color: #000;
}
/* .returnTablePrint .other{
......@@ -108,7 +110,7 @@
.returnTablePrint .line1 {
width: 100%;
font-size: 12px;
font-size: 15px;
box-sizing: border-box;
border-bottom: 1px solid #7f7f7f;
color: #000;
......@@ -136,7 +138,7 @@
.returnTablePrint .line1 .sendTo span:nth-child(2),
.returnTablePrint .line1 .sendNum span:nth-child(2) {
color: #4a475d;
color: #000;
display: inline-block;
margin-left: 5px;
}
......@@ -204,7 +206,7 @@
}
.returnTablePrint .checkName span:nth-child(2) {
color: #4a475d;
color: #000;
display: inline-block;
margin-left: 20px;
}
......@@ -214,15 +216,19 @@
}
.returnTablePrint .label {
color: #646464;
font-size: 10px;
color: #000;
font-size: 15px;
}
.returnTablePrint .value {
color: #000;
font-size: 10px;
font-size: 15px;
}
.returnTablePrint .main-title span{
font-size: 22px;
color: #333;
font-weight: bold;
}
.returnTablePrint .main-title {
font-size: 17px;
color: #000000;
......@@ -245,7 +251,7 @@
table.altrowstable {
width: 100%;
font-size: 11px;
color: #141414;
color: #000;
border-width: 0px;
border-color: #a9c6c9;
border-collapse: collapse;
......@@ -256,30 +262,25 @@
table.altrowstable th {
border-width: 0px;
padding: 5px;
border-style: solid;
border-color: #a9c6c9;
background-color: #dedede;
word-break: break-all;
height: 20px;
line-height: 20px;
font-size: 10px;
height: 24px;
line-height: 24px;
font-size: 15px;
}
table.altrowstable td {
border-width: 0px;
height: 20px;
line-height: 20px;
font-size: 10px;
height: 24px;
line-height: 24px;
font-size: 15px;
/*border-style: solid;*/
/*border-color: #a9c6c9;*/
/*border: 1px solid #bebebe;*/
word-break: break-all;
word-wrap: break-word;
border-bottom: 1px solid #bebebe;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.oddrowcolor {
......@@ -297,6 +298,8 @@
</head>
<body>
<div class="returnTablePrint">
<div class="content">
<div>
......@@ -305,12 +308,12 @@
<div class="title">
<div class="main-title">
<span>
工作交接单
工作交接单2
</span>
</div>
<div style="width:100%;text-align:left;font-size: 1px;margin-bottom:2px">
<div style="text-align:left;display: inline-block; width: 49%" class="number">
<span class="number">时间:${time!}</span>
<span class="number">时间:${time}</span>
</div>
<!-- <div style="text-align:center;display: inline-block; width: 34%" class="number">
<span></span>
......@@ -324,7 +327,7 @@
<div class="line2 tableList">
<table class="altrowstable" id="alternatecolor">
<tr>
<th>序号</th>
<th width="70px">序号</th>
<th>型号</th>
<th>名称</th>
<th>在库</th>
......@@ -332,7 +335,7 @@
<th>报废</th>
<th>清退</th>
<th>其他</th>
<th >装备序列号</th>
<th width="420px">装备序列号</th>
</tr>
<#list documentDevices as dev>
<tr>
......
......@@ -34,6 +34,11 @@
<groupId>com.tykj.dev</groupId>
<artifactId>socket</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>com.tykj</groupId>-->
<!--<artifactId>dev-file</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>blockcha</artifactId>
......
......@@ -83,7 +83,7 @@ public class UnitsServiceImpl implements UnitsService {
}
);
List<Area> countys = areaDao.findAllByFatherId(area.getId());
List<Area> countys = areaDao.findAllByFatherId(area.getId()).stream().filter(area1 -> area1.getType() <= 3).collect(Collectors.toList());
if (countys != null && countys.size() != 0) {
countys.forEach(
area1 -> unitsDao.findAllByAreaId(area1.getId()).forEach(
......@@ -126,14 +126,14 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public List<Integer> findListSubordinateId(Integer unitsId) {
Integer areaId = unitsDao.findById(unitsId).get().getAreaId();
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
return unitsDao.findAllByAreaIdIn(areaIds).stream().map(Units::getUnitId).collect(Collectors.toList());
}
@Override
public List<UnitsVo> findListVoSubordinateAreaId(Integer areaId) {
List<UnitsVo> unitsVos=new ArrayList<>();
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
if (areaIds.size() != 0) {
unitsVos= unitsDao.findAllByAreaIdIn(areaIds).stream().map(Units::toVo).collect(Collectors.toList());
}
......@@ -148,7 +148,7 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public List<UnitsTrainVo> findListUnitsTrainVo(Integer unitsId) {
Integer areaId = unitsDao.findById(unitsId).get().getAreaId();
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds=areaDao.findAllByFatherId(areaId).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
return unitsDao.findAllByAreaIdIn(areaIds).stream().map(Units::toUnitsTrainVo).collect(Collectors.toList());
}
......@@ -172,7 +172,7 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public List<Units> findBySubordinate(Integer unitsId) {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> units1= unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel()==1){
units1.add(units);
......@@ -184,7 +184,7 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public List<Units> findBySubordinateNotOneself(Integer unitsId) {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> units1= unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel()==1){
// units1.add(units);
......@@ -233,7 +233,7 @@ public class UnitsServiceImpl implements UnitsService {
Optional<Units> unitsOptional = unitsDao.findById(unitsId);
if (unitsOptional.isPresent()) {
Units units=unitsOptional.get();
List<Integer> areaIds = areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
List<Integer> areaIds = areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> unitsList= unitsDao.findAllByAreaIdIn(areaIds);
unitsList.add(units);
return unitsList;
......@@ -269,7 +269,7 @@ public class UnitsServiceImpl implements UnitsService {
LeftNavigation leftNavigation2=new LeftNavigation(0,"省直属",leftNavigationList2, UUID.randomUUID().toString(),1,22,null);
leftNavigationList.add(leftNavigation2);
}
List<Area> areas= areaDao.findAllByFatherId(areaId);
List<Area> areas= areaDao.findAllByFatherId(areaId).stream().filter(area -> area.getType() <= 3).collect(Collectors.toList());
if (areas.size()!=0) {
provinceAndCity(belongsArea,areas,leftNavigationList);
}else {
......@@ -302,7 +302,7 @@ public class UnitsServiceImpl implements UnitsService {
leftNavigationList=leftNavigationList1;
}
List<Area> areas= areaDao.findAllByFatherId(areaId);
List<Area> areas= areaDao.findAllByFatherId(areaId).stream().filter(area -> area.getType() <= 3).collect(Collectors.toList());
if (areas.size()!=0) {
provinceAndCity(belongsArea,areas,leftNavigationList);
}else {
......@@ -341,7 +341,7 @@ public class UnitsServiceImpl implements UnitsService {
@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());
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
return unitsDao.findAllByAreaIdIn(areaIds);
}
......
......@@ -296,8 +296,13 @@ public class UserServiceImpl implements UserService {
private Specification<User> getUserSpecification(UserConditionsVo userConditionsVo) {
PredicateBuilder<User> predicateBuilder = Specifications.and();
if (userConditionsVo.getType()==1){
List<Integer> ids= areaService.findIdQuerySubordinateIds(userConditionsVo.getUnitsId());
List<Integer> unitIds= unitsDao.findAllByAreaIdIn(ids).stream().map(Units::getUnitId).collect(Collectors.toList());
List<Integer> unitIds;
if (userConditionsVo.getUnitsId()!=0) {
List<Integer> ids = areaService.findIdQuerySubordinateIds(userConditionsVo.getUnitsId());
unitIds = unitsDao.findAllByAreaIdIn(ids).stream().map(Units::getUnitId).collect(Collectors.toList());
}else {
unitIds = unitsDao.findAllByType(2).stream().map(Units::getUnitId).collect(Collectors.toList());
}
predicateBuilder.in("unitsId",unitIds.toArray());
}else {
predicateBuilder.eq("unitsId",userConditionsVo.getUnitsId());
......
......@@ -47,6 +47,7 @@
<module>dev-loss</module>
<module>dev-decommissioning</module>
<module>dev-excel</module>
<module>dev-policydocument</module>
</modules>
<properties>
......@@ -162,6 +163,12 @@
<artifactId>dev-library</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-policydocument</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-matching</artifactId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论