提交 f7b45981 authored 作者: zjm's avatar zjm

合并dev

......@@ -897,6 +897,22 @@ public class AllotBillController {
});
return deviceVoList;
}
private List<DeviceVo> getDeviceVoList1(List<ScriptSaveVo> scriptSaveVos) {
List<DeviceVo> deviceVoList = new ArrayList<>();
scriptSaveVos.forEach(scriptSaveVo -> {
DeviceVo deviceVo = new DeviceVo();
deviceVo.setModel(scriptSaveVo.getModel());
deviceVo.setParts(scriptSaveVo.getName());
deviceVo.setRemark(scriptSaveVo.getRemark());
deviceVo.setNum(scriptSaveVo.getSeqNumber());
deviceVo.setVisible(scriptSaveVo.getInvisibleRange());
deviceVo.setWith(scriptSaveVo.getAllotType());
deviceVo.setSecurityClassification(scriptSaveVo.getSecretLevel());
deviceVo.setCount(scriptSaveVo.getNum() + "");
deviceVoList.add(deviceVo);
});
return deviceVoList;
}
@ApiOperation(value = "上传发送方配发单", notes = "上传配发单")
@PostMapping(value = "/uploadFile")
......@@ -1135,6 +1151,40 @@ public class AllotBillController {
return ResponseEntity.ok(allotBillService.updateFiles(updateFilesVO));
}
@GetMapping("/dataToZt")
@ApiOperation("主动推送数据给zt")
public ResponseEntity dataToZt(Integer billId){
//调用载体
AllotBill allotBill = allotBillService.getOne(billId);
List<ScriptSaveVo> scriptSaveVos = JacksonUtil.readValue(allotBill.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {});
List<DeviceVo> deviceVoList = getDeviceVoList1(scriptSaveVos);
if (deviceVoList.size() > 0) {
log.info("开始调用载体接口");
ConfigUration configUration = ConfigUration.builder()
//出库时间
.outboundTime(DateUtil.getLocalDateTime(allotBill.getCreateTime()))
//收方a
.debitMemberThatAName(userCache.findById(allotBill.getReceiveUseraId()).getName())
//收方b
.debitMemberThatBName(userCache.findById(allotBill.getReceiveUserbId()).getName())
//发起单位
.initiateUnit(unitsCache.findById(allotBill.getSendUnitId()).getName())
//接收单位
.receiveUnit(unitsCache.findById(allotBill.getReceiveUnitId()).getName())
//state 状态 zjm说默认传1
.state(1)
.deviceVos(deviceVoList)
// senderMemberThatAName 发方A
.senderMemberThatAName(userCache.findById(allotBill.getSendUseraId()).getName())
// senderMemberThatAName senderMemberThatBName
.senderMemberThatBName(userCache.findById(allotBill.getSendUserbId()).getName())
.signatureStatus(0)
.build();
restTemplate.postForEntity(carrierUrl, configUration, String.class);
}
return ResponseEntity.ok("成功");
}
//递归取出最大目录
public PackingLibrary getPackingLibrary(PackingLibrary packingLibrary) {
......
......@@ -1366,6 +1366,12 @@ public class DeviceLibraryController {
return ResponseEntity.ok(deviceLibraries);
}
@PostMapping("/queryByOwnUnit")
@ApiOperation(value = "根据单位名称查询单位所属设备")
public ResponseEntity<List<DeviceLibrary>> queryByOwnUnit(@RequestBody DevNameVO devNameVO){
return ResponseEntity.ok(deviceLibraryService.queryByOwnUniName(devNameVO.getName()));
}
// @ApiOperation(value = "修改单位名称", notes = "修改单位名称")
// @PostMapping("/updateDeviceLocationAndOwnUnit")
......
......@@ -592,5 +592,12 @@ public interface DeviceLibraryService {
*/
List<PartsVo> findAllParts(Integer deviceId);
/**
* 根据所属单位名称查询
* @param ownUniName
* @return
*/
List<DeviceLibrary> queryByOwnUniName(String ownUniName);
}
......@@ -1756,6 +1756,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return partsVos;
}
@Override
public List<DeviceLibrary> queryByOwnUniName(String ownUniName) {
List<DeviceLibrary> deviceLibraryList = deviceLibraryDao.findAllByOwnUnit(ownUniName);
if (deviceLibraryList != null && deviceLibraryList.size() >0){
deviceLibraryList.forEach(DeviceLibrary::setConfigName);
}
return deviceLibraryList;
}
private Specification<DeviceLibrary> getSelectSpecification(DeviceLibrarySelectVo deviceLibrarySelectVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
//unitId为空,默认查询当前单位
......
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.stereotype.Repository;
/**
* @author dengdiyi
*/
@Data
@ApiModel("查询dev名称vo")
@Repository
public class DevNameVO {
private String name;
}
......@@ -114,7 +114,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/packageVersion/getVersion","/equip/packageVersion/getVersion").permitAll()//
.antMatchers("/equip/file/llq/**").permitAll()
.antMatchers("/code/**","/equip/code/**").permitAll()
.antMatchers("/upload").permitAll()
.antMatchers("/upload","/device/queryByOwnUnit","/allot/dataToZt").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论