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

[清退业务 file] 代码提交

上级 64b81a32
...@@ -215,7 +215,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -215,7 +215,7 @@ public class JavaToPdfHtmlFreeMarker {
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice)); list1.add(documentDevice);
} }
); );
data.put("documentDevices",list1); data.put("documentDevices",list1);
...@@ -236,7 +236,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -236,7 +236,7 @@ public class JavaToPdfHtmlFreeMarker {
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice)); list1.add(documentDevice);
} }
); );
data.put("documentDevices",list1); data.put("documentDevices",list1);
...@@ -261,85 +261,14 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -261,85 +261,14 @@ public class JavaToPdfHtmlFreeMarker {
documentDevice -> { documentDevice -> {
documentDevice.setCode(i.get()); documentDevice.setCode(i.get());
i.set(i.get() + 1); i.set(i.get() + 1);
list1.add(toDocDevice(documentDevice)); list1.add(documentDevice);
} }
); );
data.put("documentDevices",list1); 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;
}
/** /**
......
...@@ -69,6 +69,12 @@ public class RepelQueryController { ...@@ -69,6 +69,12 @@ public class RepelQueryController {
return ResponseEntity.ok(repelQueryService.findDeviceChooseRepel(fielding,unitId)); return ResponseEntity.ok(repelQueryService.findDeviceChooseRepel(fielding,unitId));
} }
@PostMapping(value ="/deviceChooseRepel1/{unitId}")
@ApiOperation(value = "省本级任务清退装备查询接口", notes = "省本级任务清退装备查询接口")
public ResponseEntity findDeviceRepel1(@RequestBody List<Integer> fielding, @PathVariable Integer unitId){
return ResponseEntity.ok(repelQueryService.findDeviceChooseRepel1(fielding,unitId));
}
@GetMapping(value ="/deviceSendOut/{taskId}") @GetMapping(value ="/deviceSendOut/{taskId}")
@ApiOperation(value = "出库查询装备", notes = "代办任务通知页面详情") @ApiOperation(value = "出库查询装备", notes = "代办任务通知页面详情")
public ResponseEntity findDeviceSendOut(@PathVariable Integer taskId){ public ResponseEntity findDeviceSendOut(@PathVariable Integer taskId){
......
...@@ -54,7 +54,7 @@ public class RepelTaskStatistical extends BaseEntity { ...@@ -54,7 +54,7 @@ public class RepelTaskStatistical extends BaseEntity {
/** /**
* 任务状态 1.正常提交 2.延期 3.等待审核 * 任务状态 1.正常提交 2.延期 3.等待审核
*/ */
@ApiModelProperty(value = "任务状态 1.正常提交 2.延期 3.等待审核") @ApiModelProperty(value = "任务状态 1.正常提交 2.延期 3.等待审核 4.等待上传单据")
private Integer taskStatus; private Integer taskStatus;
/** /**
......
...@@ -48,4 +48,8 @@ public class StorageDeviceRepel { ...@@ -48,4 +48,8 @@ public class StorageDeviceRepel {
private String userAName; private String userAName;
private String userBName; private String userBName;
private String senderName;
private String senderId;
} }
...@@ -96,4 +96,9 @@ public interface RepelQueryService { ...@@ -96,4 +96,9 @@ public interface RepelQueryService {
*/ */
List<TaskBto> findOutsideTheProvince(); List<TaskBto> findOutsideTheProvince();
/**
* 省自己装备清退列表查询的接口
*/
DeviceChooseRepel findDeviceChooseRepel1(List<Integer> fielding,Integer unitId);
} }
...@@ -110,6 +110,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -110,6 +110,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id); lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id);
lifeStatus.add(DeviceLifeStatus.REPEL.id); lifeStatus.add(DeviceLifeStatus.REPEL.id);
lifeStatus.add(DeviceLifeStatus.REPAIRING.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
lifeStatus.add(DeviceLifeStatus.USE.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);
...@@ -187,6 +189,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -187,6 +189,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (correspondingLevel.get()&&deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),strings)){ if (correspondingLevel.get()&&deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(),strings)){
if (deviceRepel.getRepelStatus()==1) { if (deviceRepel.getRepelStatus()==1) {
modelCounts.clear(); modelCounts.clear();
lifeStatus.remove(DeviceLifeStatus.REPEL.id);
deviceRepel.getModels().forEach(i -> { deviceRepel.getModels().forEach(i -> {
modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i, strings,lifeStatus))); modelCounts.add(new ModelCount(i, deviceLibraryDao.countAllByModelAndOwnUnitInAndLifeStatusIn(i, strings,lifeStatus)));
}); });
...@@ -212,6 +215,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -212,6 +215,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id); lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id);
lifeStatus.add(DeviceLifeStatus.REPEL.id); lifeStatus.add(DeviceLifeStatus.REPEL.id);
lifeStatus.add(DeviceLifeStatus.REPAIRING.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
lifeStatus.add(DeviceLifeStatus.USE.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());
...@@ -410,10 +415,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -410,10 +415,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
StringBuffer ids=new StringBuffer(); StringBuffer ids=new StringBuffer();
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId()); DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId()); RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
List<ModelCount> modelCountList= JacksonUtil.readValue(repelTaskStatistical.getModelCount(), new TypeReference<List<ModelCount>>() {}); // List<ModelCount> modelCountList= JacksonUtil.readValue(repelTaskStatistical.getModelCount(), new TypeReference<List<ModelCount>>() {});
List<ModelCount> modelCountList= new ArrayList<>();
modelCountList.forEach( modelCountList.forEach(
modelCount -> { modelCount -> {
map.put(modelCount.getModel(),modelCount.getCount()); map.put(modelCount.getModel(),0);
} }
); );
List<ModelCount> modelCounts=new ArrayList<>(); List<ModelCount> modelCounts=new ArrayList<>();
...@@ -538,7 +544,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -538,7 +544,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setReceiveUserA(storageDeviceRepel.getUserBName()); deviceRepelDetail.setReceiveUserA(storageDeviceRepel.getUserBName());
} }
//判断是否为入库单据待补充 还是直接入库。 //判断是否为入库单据待补充 还是直接入库。
if (storageDeviceRepel.getFileRets()!=null&&storageDeviceRepel.getFileRets().size()!=0) { RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
if (storageDeviceRepel.getFileRets()!=null&&storageDeviceRepel.getFileRets().size()!=0) {
List<StatusEnum> enumList=new ArrayList<>(); List<StatusEnum> enumList=new ArrayList<>();
enumList.add(StatusEnum.SEND_BACK_1209); enumList.add(StatusEnum.SEND_BACK_1209);
enumList.add(StatusEnum.SEND_BACK_1213); enumList.add(StatusEnum.SEND_BACK_1213);
...@@ -546,13 +554,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -546,13 +554,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),enumList); TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),enumList);
deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets())); deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets()));
deviceRepelDetail.setRepelStatus(2); deviceRepelDetail.setRepelStatus(2);
taskService.moveToEnd(taskBto); repelTaskStatistical.setTaskStatus(1);
taskService.moveToEnd(taskBto);
} else { } else {
if (storageDeviceRepel.getIsIgnore()==null) { if (storageDeviceRepel.getIsIgnore()==null) {
//判断当前状态是否为SEND_BACK_1209 清退装备等待入库 //判断当前状态是否为SEND_BACK_1209 清退装备等待入库
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(), StatusEnum.SEND_BACK_1209); TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(), StatusEnum.SEND_BACK_1209);
repelTaskStatistical.setTaskStatus(4);
taskService.moveToSpecial(taskBto, StatusEnum.SEND_BACK_1215, 0); taskService.moveToSpecial(taskBto, StatusEnum.SEND_BACK_1215, 0);
}else { }else {
repelTaskStatistical.setTaskStatus(1);
taskService.moveToEnd(taskBto); taskService.moveToEnd(taskBto);
} }
} }
...@@ -580,8 +592,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -580,8 +592,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time); log.info("更新数据装备以及所属单位{}",System.currentTimeMillis()-time);
repelDeviceUnitService.saveAllRepelDeviceUnit(list); repelDeviceUnitService.saveAllRepelDeviceUnit(list);
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(1);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId()); DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
...@@ -673,12 +683,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -673,12 +683,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setDeviceIds(StringUtils.ListToString(orderOutData.getDevIds())); deviceRepelDetail.setDeviceIds(StringUtils.ListToString(orderOutData.getDevIds()));
deviceRepelDetail.setOutboundFile(FilesUtil.stringFileToList(orderOutData.getOutboundFileList())); deviceRepelDetail.setOutboundFile(FilesUtil.stringFileToList(orderOutData.getOutboundFileList()));
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
deviceRepelDetail.setScripts(orderOutData.getScriptSaveVos());
deviceRepelDetail.setScriptJson(JacksonUtil.toJSon(orderOutData.getScriptSaveVos()));
deviceRepelDetail.setNum("NO:第"+ LocalDateTime.now().getYear()+"QT"+deviceRepelDetail.getId()); deviceRepelDetail.setNum("NO:第"+ LocalDateTime.now().getYear()+"QT"+deviceRepelDetail.getId());
deviceRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
deviceLibraryDao.upDateLeftStatusAndOwnUnitName(DeviceLifeStatus.REPEL.id,orderOutData.getReceiveUnit(),orderOutData.getDevIds()); deviceLibraryDao.upDateLeftStatusAndOwnUnitName(DeviceLifeStatus.REPEL.id,orderOutData.getReceiveUnit(),orderOutData.getDevIds());
deviceRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
deviceRepelDetail.setScripts(orderOutData.getScriptSaveVos());
deviceRepelDetail.setScriptJson(JacksonUtil.toJSon(orderOutData.getScriptSaveVos()));
TaskBto taskBto= sendOutSuperior(units.getUnitId(),deviceRepelDetail.getId(),null); TaskBto taskBto= sendOutSuperior(units.getUnitId(),deviceRepelDetail.getId(),null);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"发起退役任务,待上传回执单据",gainThisUser(user.getUserId(),user.getUnitsId()))); addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"发起退役任务,待上传回执单据",gainThisUser(user.getUserId(),user.getUnitsId())));
return deviceRepelDetail; return deviceRepelDetail;
...@@ -692,13 +702,22 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -692,13 +702,22 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1210); TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1210);
DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId()); DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets())); deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets()));
// deviceRepelDetail.setReceiveUserAId(storageDeviceRepel.getUserA()); if (storageDeviceRepel.getUserBName()!=null) {
deviceRepelDetail.setReceiveUserA(storageDeviceRepel.getUserAName()); deviceRepelDetail.setReceiveUserB(storageDeviceRepel.getUserBName());
// deviceRepelDetail.setReceiveUserBId(storageDeviceRepel.getUserB()); }
deviceRepelDetail.setReceiveUserB(storageDeviceRepel.getUserBName()); if (storageDeviceRepel.getUserB()!=null){
deviceRepelDetail.setReceiveUserbId(storageDeviceRepel.getUserB());
taskService.moveToEnd(taskBto); }
if (storageDeviceRepel.getUserA()!=null){
deviceRepelDetail.setReceiveUseraId(storageDeviceRepel.getUserA());
}
if (storageDeviceRepel.getUserBName()!=null) {
deviceRepelDetail.setReceiveUserA(storageDeviceRepel.getUserBName());
}
taskService.moveToEnd(taskBto);
deviceRepelDetail.setRepelStatus(2);
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds()); List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach( libraries.forEach(
deviceLibrary -> { deviceLibrary -> {
...@@ -754,7 +773,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -754,7 +773,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibraries.forEach( deviceLibraries.forEach(
deviceLibrary -> deviceLibrary.setLifeStatus(DeviceLifeStatus.IN_LIBRARY.id) deviceLibrary -> deviceLibrary.setLifeStatus(DeviceLifeStatus.IN_LIBRARY.id)
); );
deviceLibraryService.sendHash(deviceLibraries); deviceLibraryDao.saveAll(deviceLibraries);
} }
......
...@@ -80,10 +80,16 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -80,10 +80,16 @@ public class RepelQueryServiceImpl implements RepelQueryService {
List<DeviceLibrary> deviceLibraries=new ArrayList<>(); List<DeviceLibrary> deviceLibraries=new ArrayList<>();
List<DeviceLibrary> deviceLibrariesAbnormal=new ArrayList<>(); List<DeviceLibrary> deviceLibrariesAbnormal=new ArrayList<>();
Units units= unitsService.findById(unitId); Units units= unitsService.findById(unitId);
deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).stream().map(DeviceLibrary::setConfigName).forEach( deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).stream()
.filter(deviceLibrary -> deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_LIBRARY.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPEL.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPAIRING.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_TRANSIT.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.USE.id))
.map(DeviceLibrary::setConfigName).forEach(
deviceLibrary -> { deviceLibrary -> {
if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){ if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
if (deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==15 ||deviceLibrary.getLifeStatus()==4) { if (deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==15 ||deviceLibrary.getLifeStatus()==14) {
deviceLibraries.add(deviceLibrary); deviceLibraries.add(deviceLibrary);
}else { }else {
deviceLibrariesAbnormal.add(deviceLibrary); deviceLibrariesAbnormal.add(deviceLibrary);
...@@ -240,6 +246,32 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -240,6 +246,32 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return taskService.findBillIdAndBillType(list.stream().map(DeviceRepelDetail::getId).collect(Collectors.toList()), BusinessEnum.SEND_BACK.id); return taskService.findBillIdAndBillType(list.stream().map(DeviceRepelDetail::getId).collect(Collectors.toList()), BusinessEnum.SEND_BACK.id);
} }
@Override
public DeviceChooseRepel findDeviceChooseRepel1(List<Integer> fielding, Integer unitId) {
List<DeviceLibrary> deviceLibraries=new ArrayList<>();
List<DeviceLibrary> deviceLibrariesAbnormal=new ArrayList<>();
Units units= unitsService.findById(unitId);
deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).stream()
.filter(deviceLibrary -> deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_LIBRARY.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPAIRING.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_TRANSIT.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.USE.id))
.map(DeviceLibrary::setConfigName).forEach(
deviceLibrary -> {
if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
if (deviceLibrary.getLifeStatus()==2 ||deviceLibrary.getLifeStatus()==14) {
deviceLibraries.add(deviceLibrary);
}else {
deviceLibrariesAbnormal.add(deviceLibrary);
}
}else {
deviceLibrariesAbnormal.add(deviceLibrary);
}
}
);
return new DeviceChooseRepel(deviceLibraries,deviceLibrariesAbnormal);
}
private DevRepelVo devRepelVo(DeviceLibrary deviceLibrary){ private DevRepelVo devRepelVo(DeviceLibrary deviceLibrary){
return new DevRepelVo(deviceLibrary.getId(),deviceLibrary.getName(),deviceLibrary.getModel(),deviceLibrary.getSeqNumber(),deviceLibrary.getType(),deviceLibrary.getTypeName(),deviceLibrary.getUpdateTime()); return new DevRepelVo(deviceLibrary.getId(),deviceLibrary.getName(),deviceLibrary.getModel(),deviceLibrary.getSeqNumber(),deviceLibrary.getType(),deviceLibrary.getTypeName(),deviceLibrary.getUpdateTime());
......
...@@ -62,6 +62,11 @@ public class WorkHandover { ...@@ -62,6 +62,11 @@ public class WorkHandover {
*/ */
private String inUserName; private String inUserName;
/**
* 上级领导
*/
private String leadershipName;
/** /**
* 代办业务 json * 代办业务 json
*/ */
...@@ -98,8 +103,6 @@ public class WorkHandover { ...@@ -98,8 +103,6 @@ public class WorkHandover {
@ApiModelProperty(value = "区块链RID",name = "recordId") @ApiModelProperty(value = "区块链RID",name = "recordId")
private String recordId; private String recordId;
/** /**
* 发起用户集合 * 发起用户集合
*/ */
......
...@@ -9,10 +9,13 @@ import com.tykj.dev.device.user.config.url.ApiResult; ...@@ -9,10 +9,13 @@ import com.tykj.dev.device.user.config.url.ApiResult;
import com.tykj.dev.device.user.config.url.UrlAccessDecisionManager; import com.tykj.dev.device.user.config.url.UrlAccessDecisionManager;
import com.tykj.dev.device.user.config.url.UrlAccessDeniedHandler; import com.tykj.dev.device.user.config.url.UrlAccessDeniedHandler;
import com.tykj.dev.device.user.config.url.UrlFilterInvocationSecurityMetadataSource; import com.tykj.dev.device.user.config.url.UrlFilterInvocationSecurityMetadataSource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity;
...@@ -20,6 +23,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe ...@@ -20,6 +23,7 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.session.SessionRegistryImpl; import org.springframework.security.core.session.SessionRegistryImpl;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy; import org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy;
import org.springframework.security.web.session.ConcurrentSessionFilter; import org.springframework.security.web.session.ConcurrentSessionFilter;
...@@ -184,4 +188,5 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -184,4 +188,5 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
return new BCryptPasswordEncoder(); return new BCryptPasswordEncoder();
} }
// //
} }
...@@ -23,6 +23,10 @@ public class MyFailHandler implements AuthenticationFailureHandler { ...@@ -23,6 +23,10 @@ public class MyFailHandler implements AuthenticationFailureHandler {
httpServletResponse.setStatus(200); httpServletResponse.setStatus(200);
httpServletResponse.setCharacterEncoding("utf-8"); httpServletResponse.setCharacterEncoding("utf-8");
httpServletResponse.setContentType("application/json"); httpServletResponse.setContentType("application/json");
httpServletResponse.getWriter().println("{\"code\":401,\"msg\":\""+e.getMessage()+"\"}"); if (e.getMessage().equals("Bad credentials")){
httpServletResponse.getWriter().println("{\"code\":401,\"msg\":\"密码错误请重新输入\"}");
}else {
httpServletResponse.getWriter().println("{\"code\":401,\"msg\":\"" + e.getMessage() + "\"}");
}
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论