提交 77082a22 authored 作者: zhoushaopan's avatar zhoushaopan

feat(配套设备库): 修改配套整个流程

修改配套整个流程
上级 174ce433
...@@ -60,6 +60,9 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport { ...@@ -60,6 +60,9 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport {
@Value("${qrcode.path}") @Value("${qrcode.path}")
private String qrCodePath; private String qrCodePath;
@Value("${file.matching.excel}")
private String excelPath;
@Bean(name = "format") @Bean(name = "format")
DateTimeFormatter format() { DateTimeFormatter format() {
return DateTimeFormatter.ofPattern(formatValue); return DateTimeFormatter.ofPattern(formatValue);
...@@ -72,6 +75,7 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport { ...@@ -72,6 +75,7 @@ public class WebMvcConfigConfig extends WebMvcConfigurationSupport {
protected void addResourceHandlers(ResourceHandlerRegistry registry) { protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/file/**").addResourceLocations("file:" + path); registry.addResourceHandler("/file/**").addResourceLocations("file:" + path);
registry.addResourceHandler("/code/**").addResourceLocations("file:" + qrCodePath); registry.addResourceHandler("/code/**").addResourceLocations("file:" + qrCodePath);
registry.addResourceHandler("/excel/**").addResourceLocations("file:"+excelPath);
//静态资源 //静态资源
registry.addResourceHandler( "/**" ).addResourceLocations( "classpath:/static/" ); registry.addResourceHandler( "/**" ).addResourceLocations( "classpath:/static/" );
// swagger handler // swagger handler
......
...@@ -51,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -51,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
...@@ -163,7 +164,7 @@ public class MatchingDeviceController { ...@@ -163,7 +164,7 @@ public class MatchingDeviceController {
@PostMapping(value = "/add") @PostMapping(value = "/add")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity addStorageBill(@RequestBody @Validated MatchingDeviceBillSaveVo matchingDeviceBillSaveVo) { public ResponseEntity addStorageBill(@RequestBody @Validated MatchingDeviceBillSaveVo matchingDeviceBillSaveVo) {
Boolean isPrint = matchingDeviceBillSaveVo.getIsPrint() != 0; // Boolean isPrint = matchingDeviceBillSaveVo.getIsPrint() != 0;
//添加账单 //添加账单
// MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillSaveVo.toDo(); // MatchingDeviceBill matchingDeviceBillEntity = matchingDeviceBillSaveVo.toDo();
// matchingDeviceBillEntity.setFileRets(FilesUtil.stringFileToList(matchingDeviceBillSaveVo.getFileRets())); // matchingDeviceBillEntity.setFileRets(FilesUtil.stringFileToList(matchingDeviceBillSaveVo.getFileRets()));
...@@ -186,11 +187,33 @@ public class MatchingDeviceController { ...@@ -186,11 +187,33 @@ public class MatchingDeviceController {
throw new ApiException("序列号不能相同"); throw new ApiException("序列号不能相同");
} }
}); });
//add 固定资产号的校验
List<String> fixList = matchingDeviceBillSaveVo.getMatchingDeviceSaveVoList().stream().
map(MatchingDeviceSaveVo::getFixedAssetsCodeNumber).collect(Collectors.toList());
//所有的入库配套设备的序列号
List<String> allFixedList = matchingDeviceLibraryService.getAllFixedList();
allFixedList.retainAll(fixList);
if (allFixedList.size() > 0) {
throw new ApiException("固定资产号" + allFixedList + "已存在");
}
//做校验 入库的配套设备的序列号不能一样
//先去重
fixList.forEach(s -> {
int frequency = Collections.frequency(fixList, s);
if (frequency > 1) {
throw new ApiException("序列号不能相同");
}
});
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("x"); stringBuffer.append("x");
Integer userId = userUtils.getCurrentUserId(); // Integer userId = userUtils.getCurrentUserId();
//发起任务 //发起任务
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
// userIds.add(userId);
Integer userId = matchingDeviceBillSaveVo.getCurrentUserId();
userIds.add(userId); userIds.add(userId);
//保存后的task //保存后的task
TaskBto taskBto1; TaskBto taskBto1;
...@@ -222,12 +245,12 @@ public class MatchingDeviceController { ...@@ -222,12 +245,12 @@ public class MatchingDeviceController {
List<PrintVo> printVos = new ArrayList<>(); List<PrintVo> printVos = new ArrayList<>();
List<MatchingDeviceLibrary> matchingDeviceLibraries = new ArrayList<>(); List<MatchingDeviceLibrary> matchingDeviceLibraries = new ArrayList<>();
String logMessage; String logMessage = "新增配套设备入库";
if (isPrint) { // if (isPrint) {
logMessage = "新增配套设备入库(打印标签)"; // logMessage = "新增配套设备入库(打印标签)";
} else { // } else {
logMessage = "新增配套设备入库(未打印标签)"; // logMessage = "新增配套设备入库(未打印标签)";
} // }
//存储配套设备 //存储配套设备
for (MatchingDeviceSaveVo matchingDeviceSaveVo : matchingDeviceBillSaveVo.getMatchingDeviceSaveVoList()) { for (MatchingDeviceSaveVo matchingDeviceSaveVo : matchingDeviceBillSaveVo.getMatchingDeviceSaveVoList()) {
MatchingDeviceLibrary matchingDeviceLibraryEntity = matchingDeviceSaveVo.toDo(); MatchingDeviceLibrary matchingDeviceLibraryEntity = matchingDeviceSaveVo.toDo();
...@@ -450,6 +473,19 @@ public class MatchingDeviceController { ...@@ -450,6 +473,19 @@ public class MatchingDeviceController {
return ResponseEntity.ok(map); return ResponseEntity.ok(map);
} }
@ApiOperation(value = "模糊查询配套装备分页(有资产固定的版本)", notes = "可以通过这个接口查询装备列表")
@PostMapping("/feature/summary1")
public ResponseEntity getAll1(@RequestBody MatchingDeviceSelectVo matchingDeviceSelectVo) {
Page<MatchingDeviceLibrary> matchingDeviceLibraryPage = matchingDeviceLibraryService.getMatchingDevicePage1(matchingDeviceSelectVo);
List<MatchingDeviceLibrary> content = matchingDeviceLibraryPage.getContent();
if (content.size() >0){
content.forEach(MatchingDeviceLibrary::setConfigName);
}
Map<String, Object> map = new HashMap<>();
map.put("matchingDeviceLibraryPage", matchingDeviceLibraryPage);
return ResponseEntity.ok(map);
}
@ApiOperation(value = "查询配套装备详情", notes = "可以通过这个接口查询配套装备详情") @ApiOperation(value = "查询配套装备详情", notes = "可以通过这个接口查询配套装备详情")
@GetMapping("/feature/detail/{id}") @GetMapping("/feature/detail/{id}")
...@@ -490,6 +526,7 @@ public class MatchingDeviceController { ...@@ -490,6 +526,7 @@ public class MatchingDeviceController {
public ResponseEntity update(@RequestBody @Validated MatchingDeviceEditVo matchingDeviceEditVo) { public ResponseEntity update(@RequestBody @Validated MatchingDeviceEditVo matchingDeviceEditVo) {
//查询所有的配套设备 //查询所有的配套设备
List<String> seqNumberList = matchingDeviceLibraryService.getAllMatchingDeviceLibraryListSeqNumberList(); List<String> seqNumberList = matchingDeviceLibraryService.getAllMatchingDeviceLibraryListSeqNumberList();
List<String> allFixedList = matchingDeviceLibraryService.getAllFixedList();
MatchingDeviceLibrary m = matchingDeviceLibraryService.getOne(matchingDeviceEditVo.getMatchingDeviceId()); MatchingDeviceLibrary m = matchingDeviceLibraryService.getOne(matchingDeviceEditVo.getMatchingDeviceId());
if (matchingDeviceEditVo.getCreateUnit() != null && !m.getCreateUnit().equals(matchingDeviceEditVo.getCreateUnit())) { if (matchingDeviceEditVo.getCreateUnit() != null && !m.getCreateUnit().equals(matchingDeviceEditVo.getCreateUnit())) {
//添加设备日志 //添加设备日志
...@@ -606,6 +643,95 @@ public class MatchingDeviceController { ...@@ -606,6 +643,95 @@ public class MatchingDeviceController {
m.setStopUnitId(userUtils.getCurrentUnitId()); m.setStopUnitId(userUtils.getCurrentUnitId());
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
} }
//brand
if (matchingDeviceEditVo.getBrand() != null &&
!matchingDeviceEditVo.getBrand().equals(m.getBrand())) {
//添加设备日志 品牌
String remark = "将设备的品牌改为" + matchingDeviceEditVo.getBrand();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setBrand(matchingDeviceEditVo.getBrand());
}
//fixedAssetsCodeNumber
if (matchingDeviceEditVo.getFixedAssetsCodeNumber() != null &&
!matchingDeviceEditVo.getFixedAssetsCodeNumber().equals(m.getFixedAssetsCodeNumber())) {
//添加设备日志 固定资产号 allFixedList
String remark = "将设备的固定资产号改为" + matchingDeviceEditVo.getFixedAssetsCodeNumber();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
if (allFixedList.contains(matchingDeviceEditVo.getFixedAssetsCodeNumber())) {
throw new ApiException("该固定资产号已经存在");
}else {
m.setFixedAssetsCodeNumber(matchingDeviceEditVo.getFixedAssetsCodeNumber());
}
}
//manageUnit
if (matchingDeviceEditVo.getManageUnit() != null &&
!matchingDeviceEditVo.getManageUnit().equals(m.getManageUnit())) {
//添加设备日志 资产管理单位
String remark = "将设备的资产管理单位改为" + matchingDeviceEditVo.getManageUnit();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setManageUnit(matchingDeviceEditVo.getManageUnit());
}
//userUnit
if (matchingDeviceEditVo.getUseUnit() != null &&
!matchingDeviceEditVo.getUseUnit().equals(m.getUseUnit())) {
//添加设备日志 使用单位
String remark = "将设备的使用单位改为" + matchingDeviceEditVo.getUseUnit();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setUseUnit(matchingDeviceEditVo.getUseUnit());
}
//deployAddress
if (matchingDeviceEditVo.getDeployAddress() != null &&
!matchingDeviceEditVo.getDeployAddress().equals(m.getDeployAddress())) {
//添加设备日志 部署地址
String remark = "将设备的部署地址改为" + matchingDeviceEditVo.getDeployAddress();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setDeployAddress(matchingDeviceEditVo.getDeployAddress());
}
//amount
if (matchingDeviceEditVo.getAmount() != null &&
!matchingDeviceEditVo.getAmount().equals(m.getAmount())) {
//添加设备日志 合同金额
String remark = "将设备的合同金额改为" + matchingDeviceEditVo.getAmount();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setAmount(matchingDeviceEditVo.getAmount());
}
//purchaseWay
if (matchingDeviceEditVo.getPurchaseWay() != null &&
!matchingDeviceEditVo.getPurchaseWay().equals(m.getPurchaseWay())) {
//添加设备日志 采购方式
String remark = "将设备的采购方式改为" + matchingDeviceEditVo.getPurchaseWay();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setPurchaseWay(matchingDeviceEditVo.getPurchaseWay());
}
//yiName
if (matchingDeviceEditVo.getYiName() != null &&
!matchingDeviceEditVo.getYiName().equals(m.getYiName())) {
//添加设备日志 乙方名称
String remark = "将设备的乙方名称改为" + matchingDeviceEditVo.getYiName();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setYiName(matchingDeviceEditVo.getYiName());
}
//signDate
if (matchingDeviceEditVo.getSignDate() != null &&
!matchingDeviceEditVo.getSignDate().equals(m.getSignDate())) {
//添加设备日志 签订日期
String remark = "将设备的签订日期改为" + matchingDeviceEditVo.getSignDate();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null, null);
deviceLogService.addLog(deviceLogDto);
m.setSignDate(matchingDeviceEditVo.getSignDate());
}
matchingDeviceLibraryService.update(m); matchingDeviceLibraryService.update(m);
return ResponseEntity.ok("修改成功"); return ResponseEntity.ok("修改成功");
...@@ -945,6 +1071,20 @@ public class MatchingDeviceController { ...@@ -945,6 +1071,20 @@ public class MatchingDeviceController {
matchingDeviceLibraryService.batchUpdateStatus(statusVO); matchingDeviceLibraryService.batchUpdateStatus(statusVO);
return ResponseEntity.ok("修改成功"); return ResponseEntity.ok("修改成功");
} }
@ApiOperation(value = "配套设备库的表格导入", notes = "配套设备库的表格导入")
@PostMapping("/importExcel")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity importExcel(@RequestParam("file") MultipartFile file) {
return ResponseEntity.ok(matchingDeviceLibraryService.importExcel(file));
}
@ApiOperation(value = "配套设备库的表格导出", notes = "配套设备库的表格导出")
@PostMapping("/exportExcel")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity exportExcel(@RequestBody List<MatchingDeviceLibrary> matchingDeviceLibraryList) {
return ResponseEntity.ok(matchingDeviceLibraryService.exportExcel(matchingDeviceLibraryList));
}
/** /**
* @return 生成配套设备附件的序列号 * @return 生成配套设备附件的序列号
*/ */
......
...@@ -29,4 +29,7 @@ public interface MatchingDeviceBillService { ...@@ -29,4 +29,7 @@ public interface MatchingDeviceBillService {
* @param matchingDeviceBillEntity 更新账单 * @param matchingDeviceBillEntity 更新账单
*/ */
MatchingDeviceBill update(MatchingDeviceBill matchingDeviceBillEntity); MatchingDeviceBill update(MatchingDeviceBill matchingDeviceBillEntity);
} }
package com.tykj.dev.device.matching.service; package com.tykj.dev.device.matching.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary; import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import com.tykj.dev.device.matching.subject.vo.MatchingUnitVo; import com.tykj.dev.device.matching.subject.vo.*;
import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo; import com.tykj.dev.device.matching.subject.vo.excel.MatchingDeviceSaveVoExcelList;
import com.tykj.dev.device.matching.subject.vo.RelationDeviceVo;
import com.tykj.dev.device.matching.subject.vo.StatusVO;
import com.tykj.dev.rfid.entity.vo.RfidPrintVo; import com.tykj.dev.rfid.entity.vo.RfidPrintVo;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -55,6 +53,11 @@ public interface MatchingDeviceLibraryService { ...@@ -55,6 +53,11 @@ public interface MatchingDeviceLibraryService {
*/ */
List<MatchingDeviceLibrary> getMatchingDevicePage(MatchingDeviceSelectVo matchingDeviceSelectVo); List<MatchingDeviceLibrary> getMatchingDevicePage(MatchingDeviceSelectVo matchingDeviceSelectVo);
/**
* @param matchingDeviceSelectVo 装备查询vo 修改分页
*/
Page<MatchingDeviceLibrary> getMatchingDevicePage1(MatchingDeviceSelectVo matchingDeviceSelectVo);
/** /**
* @param unitId 单位id * @param unitId 单位id
...@@ -110,6 +113,12 @@ public interface MatchingDeviceLibraryService { ...@@ -110,6 +113,12 @@ public interface MatchingDeviceLibraryService {
*/ */
List<String> getAllMatchingDeviceLibraryListSeqNumberList(); List<String> getAllMatchingDeviceLibraryListSeqNumberList();
/**
* 查询所有的固定资产号
* @return
*/
List<String> getAllFixedList();
/** /**
* 修改单位名称从而修改配套设备库装备的创建单位的名称 * 修改单位名称从而修改配套设备库装备的创建单位的名称
* @param matchingUnitVo 修改单位名称的vo * @param matchingUnitVo 修改单位名称的vo
...@@ -149,4 +158,17 @@ public interface MatchingDeviceLibraryService { ...@@ -149,4 +158,17 @@ public interface MatchingDeviceLibraryService {
*/ */
void updateLifeStatus2(Integer lifeStatus,List<Integer> ids); void updateLifeStatus2(Integer lifeStatus,List<Integer> ids);
/**
* 配套设备库表格导入
* @return
*/
List<MatchingDeviceSaveVo> importExcel(MultipartFile file);
/**
* 导出excel
* @param matchingDeviceLibraries
* @return
*/
String exportExcel(List<MatchingDeviceLibrary> matchingDeviceLibraries);
} }
package com.tykj.dev.device.matching.service.impl; package com.tykj.dev.device.matching.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash; import com.tykj.dev.blockcha.subject.entity.BcHash;
...@@ -13,30 +17,35 @@ import com.tykj.dev.device.matching.rfid.MatchingDeviceRfidService; ...@@ -13,30 +17,35 @@ import com.tykj.dev.device.matching.rfid.MatchingDeviceRfidService;
import com.tykj.dev.device.matching.rfid.MatchingDeviceRfidServiceImpl; import com.tykj.dev.device.matching.rfid.MatchingDeviceRfidServiceImpl;
import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService; import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary; import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import com.tykj.dev.device.matching.subject.vo.MatchingUnitVo; import com.tykj.dev.device.matching.subject.vo.*;
import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo; import com.tykj.dev.device.matching.subject.vo.excel.MatchingDeviceSaveVoExcelList;
import com.tykj.dev.device.matching.subject.vo.RelationDeviceVo;
import com.tykj.dev.device.matching.subject.vo.StatusVO;
import com.tykj.dev.device.user.cache.UnitsCache; import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DateUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.PageUtil; import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.rfid.entity.vo.PrintVo; import com.tykj.dev.rfid.entity.vo.PrintVo;
import com.tykj.dev.rfid.entity.vo.RfidPrintVo; import com.tykj.dev.rfid.entity.vo.RfidPrintVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.io.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
...@@ -47,6 +56,7 @@ import java.util.stream.Collectors; ...@@ -47,6 +56,7 @@ import java.util.stream.Collectors;
* @author dengdiyi * @author dengdiyi
*/ */
@Service @Service
@Slf4j
public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibraryService { public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibraryService {
@Autowired @Autowired
...@@ -70,6 +80,9 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -70,6 +80,9 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
@Resource @Resource
private UnitsCache unitsCache; private UnitsCache unitsCache;
@Value("${file.matching.excel}")
private String fileUrl;
@Override @Override
public MatchingDeviceLibrary addEntity(MatchingDeviceLibrary matchingDeviceLibraryEntity) { public MatchingDeviceLibrary addEntity(MatchingDeviceLibrary matchingDeviceLibraryEntity) {
MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity); MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity);
...@@ -226,6 +239,40 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -226,6 +239,40 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
} }
} }
@Override
public Page<MatchingDeviceLibrary> getMatchingDevicePage1(MatchingDeviceSelectVo matchingDeviceSelectVo) {
PredicateBuilder<MatchingDeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.like(matchingDeviceSelectVo.getModelLike() != null,"model","%"+matchingDeviceSelectVo.getModelLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getNameLike() != null,"name","%"+matchingDeviceSelectVo.getNameLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getBrandLike() != null,"brand","%"+matchingDeviceSelectVo.getBrandLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getFixedAssetsCodeNumberLike() != null,
"fixedAssetsCodeNumber","%"+matchingDeviceSelectVo.getFixedAssetsCodeNumberLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getManageUnitLike() != null,
"manageUnit","%"+matchingDeviceSelectVo.getManageUnitLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getUseUnitLike() != null,"useUnit","%"+matchingDeviceSelectVo.getUseUnitLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getDeployAddressLike() != null,
"deployAddress","%"+matchingDeviceSelectVo.getDeployAddressLike()+"%");
predicateBuilder.like(matchingDeviceSelectVo.getYiNameLike() != null,"yiName","%"+matchingDeviceSelectVo.getYiNameLike()+"%");
if (matchingDeviceSelectVo.getSignStartDate() != null ){
predicateBuilder.ge("signDate",matchingDeviceSelectVo.getSignStartDate());
}
if(matchingDeviceSelectVo.getSignEndDate() != null){
predicateBuilder.le("signDate",matchingDeviceSelectVo.getSignEndDate());
}
predicateBuilder.like(matchingDeviceSelectVo.getRemakeLike() != null,"remake","%"+matchingDeviceSelectVo.getRemakeLike()+"%");
if (matchingDeviceSelectVo.getMatchingType() == 0){
predicateBuilder.eq(matchingDeviceSelectVo.getMatchingType() != null,"lifeStatus",2);
}
if (matchingDeviceSelectVo.getMatchingType() == 1){
predicateBuilder.eq(matchingDeviceSelectVo.getMatchingType() != null,"lifeStatus",23);
}
predicateBuilder.eq(matchingDeviceSelectVo.getUnitId() != null,"createUnitId",matchingDeviceSelectVo.getUnitId());
if (matchingDeviceSelectVo.getUnitIds() != null){
predicateBuilder.in("createUnitId",matchingDeviceSelectVo.getUnitIds().toArray());
}
return matchingDeviceLibraryDao.findAll(predicateBuilder.build(),matchingDeviceSelectVo.getPageable());
}
@Override @Override
public List<MatchingDeviceLibrary> getMatchingByUnitIdAll(Integer unitId) { public List<MatchingDeviceLibrary> getMatchingByUnitIdAll(Integer unitId) {
...@@ -344,6 +391,12 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -344,6 +391,12 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@Override
public List<String> getAllFixedList() {
return matchingDeviceLibraryDao.findAll().stream().map(MatchingDeviceLibrary::getFixedAssetsCodeNumber)
.collect(Collectors.toList());
}
@Override @Override
public void updateMatchingDeviceCreateUnitNameByUnitName(MatchingUnitVo matchingUnitVo) { public void updateMatchingDeviceCreateUnitNameByUnitName(MatchingUnitVo matchingUnitVo) {
matchingDeviceLibraryDao.updateCreateUnitName(matchingUnitVo.getOriginUnitName(),matchingUnitVo.getUpdateUnitName()); matchingDeviceLibraryDao.updateCreateUnitName(matchingUnitVo.getOriginUnitName(),matchingUnitVo.getUpdateUnitName());
...@@ -412,6 +465,68 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -412,6 +465,68 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
matchingDeviceLibraryDao.batchUpdate2(lifeStatus,ids); matchingDeviceLibraryDao.batchUpdate2(lifeStatus,ids);
} }
@Value("${file.matching.excel}")
private String fileExcel;
@Override
public List<MatchingDeviceSaveVo> importExcel(MultipartFile file) {
ImportParams importParams = new ImportParams();
importParams.setHeadRows(1);
importParams.setTitleRows(0);
try {
return ExcelImportUtil.importExcel(file.getInputStream(), MatchingDeviceSaveVo.class, importParams);
} catch (Exception e) {
e.printStackTrace();
log.info("异常信息:{}",e.getMessage());
throw new ApiException(e.getMessage());
}
}
@Override
public String exportExcel(List<MatchingDeviceLibrary> matchingDeviceLibraries) {
try {
ExportParams exportParams = new ExportParams();
exportParams.setSheetName("配套设备库导出");
List<MatchingDeviceSaveVo> matchingDeviceSaveVoList = new ArrayList<>();
for (int i = 0; i < matchingDeviceLibraries.size(); i++) {
MatchingDeviceSaveVo matchingDeviceSaveVo = new MatchingDeviceSaveVo();
MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraries.get(i);
BeanUtils.copyProperties(matchingDeviceLibrary,matchingDeviceSaveVo);
if (matchingDeviceSaveVo.getSignDate() != null){
matchingDeviceSaveVo.setSignDate(DateUtil.localDate2String(matchingDeviceLibrary.getSignDate()));
}
matchingDeviceSaveVo.setNum((i+1));
matchingDeviceSaveVoList.add(matchingDeviceSaveVo);
}
// matchingDeviceLibraries.forEach(matchingDeviceLibrary -> {
// MatchingDeviceSaveVo matchingDeviceSaveVo = new MatchingDeviceSaveVo();
// BeanUtils.copyProperties(matchingDeviceLibrary,matchingDeviceSaveVo);
// if (matchingDeviceSaveVo.getSignDate() != null){
// matchingDeviceSaveVo.setSignDate(DateUtil.localDate2String(matchingDeviceLibrary.getSignDate()));
// }
// matchingDeviceSaveVoList.add(matchingDeviceSaveVo);
// });
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, MatchingDeviceSaveVo.class, matchingDeviceSaveVoList);
String uuid = UUID.randomUUID().toString();
File file = new File(fileExcel + uuid + ".xlsx");
// if (!file.exists()){
// file.mkdirs();
//// file.createNewFile();
// log.info("创建文件夹");
// }
FileOutputStream fileOutputStream = new FileOutputStream(file);
workbook.write(fileOutputStream);
fileOutputStream.close();
return uuid+ ".xlsx";
} catch (IOException e) {
e.printStackTrace();
log.info("文件导出异常:{}",e.getMessage());
}
return null;
}
/** /**
* @param matchingDeviceSelectVo 配套设备查询vo * @param matchingDeviceSelectVo 配套设备查询vo
......
package com.tykj.dev.device.matching.subject.domin; package com.tykj.dev.device.matching.subject.domin;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.SpringUtils; import com.tykj.dev.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -15,8 +17,11 @@ import org.springframework.data.annotation.CreatedDate; ...@@ -15,8 +17,11 @@ import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
...@@ -59,6 +64,10 @@ public class MatchingDeviceLibrary { ...@@ -59,6 +64,10 @@ public class MatchingDeviceLibrary {
*/ */
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
private String name; private String name;
@ApiModelProperty(value = "品牌")
private String brand;
/** /**
* 创建单位 * 创建单位
*/ */
...@@ -78,6 +87,33 @@ public class MatchingDeviceLibrary { ...@@ -78,6 +87,33 @@ public class MatchingDeviceLibrary {
*/ */
@ApiModelProperty(value = "设备序列号") @ApiModelProperty(value = "设备序列号")
private String seqNumber; private String seqNumber;
@ApiModelProperty(value = "固定资产号")
private String fixedAssetsCodeNumber;
@ApiModelProperty(value = "资产管理单位")
private String manageUnit;
@ApiModelProperty(value = "使用单位")
private String useUnit;
@ApiModelProperty(value = "部署地址")
private String deployAddress;
@ApiModelProperty(value = "合同金额")
private String amount;
@ApiModelProperty(value = "采购方式")
private String purchaseWay;
@ApiModelProperty(value = "乙方名称")
private String yiName;
@ApiModelProperty(value = "签订日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private LocalDate signDate;
/** /**
* rfid表面号 * rfid表面号
*/ */
...@@ -187,13 +223,18 @@ public class MatchingDeviceLibrary { ...@@ -187,13 +223,18 @@ public class MatchingDeviceLibrary {
public MatchingDeviceLibrary setConfigName(){ public MatchingDeviceLibrary setConfigName(){
ConfigCache configCache = SpringUtils.getBean("initConfigCache"); ConfigCache configCache = SpringUtils.getBean("initConfigCache");
if (configCache != null) { UnitsCache unitCache = SpringUtils.getBean("initUnitCache");
if (configCache != null && unitCache != null) {
setLifeStatusName(configCache.getLifeStatusMap().get(this.lifeStatus)==null?"-":configCache.getLifeStatusMap().get(this.lifeStatus)); setLifeStatusName(configCache.getLifeStatusMap().get(this.lifeStatus)==null?"-":configCache.getLifeStatusMap().get(this.lifeStatus));
setTypeName(configCache.getMatchingTypeMap().get(Integer.valueOf(this.type))==null?"-":configCache.getMatchingTypeMap().get(Integer.valueOf(this.type))); if (this.type != null){
setTypeName(configCache.getMatchingTypeMap().get(Integer.valueOf(this.type))==null?"-":configCache.getMatchingTypeMap().get(Integer.valueOf(this.type)));
}
if (this.statusJson != null){ if (this.statusJson != null){
statusJsonRet = JacksonUtil.readValue(this.statusJson, new TypeReference<FileRet>() { statusJsonRet = JacksonUtil.readValue(this.statusJson, new TypeReference<FileRet>() {
}); });
} }
setCreateUnit(unitCache.findById(this.createUnitId).getName());
} }
return this; return this;
} }
......
...@@ -46,6 +46,9 @@ public class MatchingDeviceBillSaveVo { ...@@ -46,6 +46,9 @@ public class MatchingDeviceBillSaveVo {
@ApiModelProperty(value = "任务id") @ApiModelProperty(value = "任务id")
private Integer taskId = 0; private Integer taskId = 0;
@ApiModelProperty(value = "当前登录人的id")
private Integer currentUserId;
@Valid @Valid
......
package com.tykj.dev.device.matching.subject.vo; package com.tykj.dev.device.matching.subject.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
...@@ -80,4 +84,33 @@ public class MatchingDeviceEditVo { ...@@ -80,4 +84,33 @@ public class MatchingDeviceEditVo {
@ApiModelProperty(value = "文件") @ApiModelProperty(value = "文件")
private FileRet fileRet; private FileRet fileRet;
@ApiModelProperty(value = "品牌")
private String brand;
@ApiModelProperty(value = "固定资产号")
private String fixedAssetsCodeNumber;
@ApiModelProperty(value = "资产管理单位")
private String manageUnit;
@ApiModelProperty(value = "使用单位")
private String useUnit;
@ApiModelProperty(value = "部署地址")
private String deployAddress;
@ApiModelProperty(value = "合同金额")
private String amount;
@ApiModelProperty(value = "采购方式")
private String purchaseWay;
@ApiModelProperty(value = "乙方名称")
private String yiName;
@ApiModelProperty(value = "签订日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private LocalDate signDate;
} }
package com.tykj.dev.device.matching.subject.vo; package com.tykj.dev.device.matching.subject.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary; import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import com.tykj.dev.misc.utils.DateFormatUtil;
import com.tykj.dev.misc.utils.DateUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
...@@ -14,40 +23,90 @@ import java.util.List; ...@@ -14,40 +23,90 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel("配套设备存储类") @ApiModel("配套设备存储类")
@ExcelTarget("matchingDeviceSaveVo")
public class MatchingDeviceSaveVo { public class MatchingDeviceSaveVo {
@NotNull(message = "type不能为空") @ApiModelProperty(value = "序号")
@ApiModelProperty(value = "设备类型") @Excel(name = "序号")
private String type; private Integer num;
@NotNull(message = "model不能为空") @NotNull(message = "model不能为空")
@ApiModelProperty(value = "型号") @ApiModelProperty(value = "型号")
@Excel(name = "型号")
private String model; private String model;
@NotNull(message = "name不能为空") // @NotNull(message = "name不能为空")
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
@Excel(name = "资产名称")
private String name; private String name;
@NotNull(message = "name不能为空") @ApiModelProperty(value = "品牌")
@ApiModelProperty(value = "形态") @Excel(name = "品牌")
private String style; private String brand;
@NotNull(message = "seqNumber不能为空")
@ApiModelProperty(value = "设备序列号")
@Excel(name = "装备序列号")
private String seqNumber;
@ApiModelProperty(value = "固定资产号")
@Excel(name = "固定资产号")
private String fixedAssetsCodeNumber;
@NotNull(message = "createUnit不能为空") // @NotNull(message = "createUnit不能为空")
@ApiModelProperty(value = "创建单位") @ApiModelProperty(value = "创建单位")
@Excel(name = "创建单位")
private String createUnit; private String createUnit;
@NotNull(message = "createUnitId不能为空") @NotNull(message = "createUnitId不能为空")
@ApiModelProperty(value = "创建单位Id") @ApiModelProperty(value = "创建单位Id")
private Integer createUnitId; private Integer createUnitId;
@NotNull(message = "locationUnitId不能为空") @ApiModelProperty(value = "资产管理单位")
@Excel(name = "资产管理单位")
private String manageUnit;
@ApiModelProperty(value = "使用单位")
@Excel(name = "使用单位")
private String useUnit;
@ApiModelProperty(value = "部署地址")
@Excel(name = "部署地址")
private String deployAddress;
@ApiModelProperty(value = "合同金额")
@Excel(name = "合同金额")
private String amount;
@ApiModelProperty(value = "采购方式")
@Excel(name = "采购方式")
private String purchaseWay;
@ApiModelProperty(value = "乙方名称")
@Excel(name = "乙方名称")
private String yiName;
@ApiModelProperty(value = "签订日期")
@Excel(name = "签订日期")
// @DateTimeFormat(pattern = "yyyy-MM-dd")
// @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private String signDate;
@ApiModelProperty(value = "备注")
private String remake;
// @NotNull(message = "type不能为空")
@ApiModelProperty(value = "设备类型")
private String type;
// @NotNull(message = "name不能为空")
@ApiModelProperty(value = "形态")
private String style;
// @NotNull(message = "locationUnitId不能为空")
@ApiModelProperty(value = "所在单位Id") @ApiModelProperty(value = "所在单位Id")
private Integer locationUnitId; private Integer locationUnitId;
@NotNull(message = "seqNumber不能为空")
@ApiModelProperty(value = "设备序列号")
private String seqNumber;
// @NotNull(message = "rfidSurfaceId不能为空") // @NotNull(message = "rfidSurfaceId不能为空")
@ApiModelProperty(value = "rfid表面号") @ApiModelProperty(value = "rfid表面号")
private String rfidSurfaceId; private String rfidSurfaceId;
...@@ -77,12 +136,16 @@ public class MatchingDeviceSaveVo { ...@@ -77,12 +136,16 @@ public class MatchingDeviceSaveVo {
@ApiModelProperty(value = "锁定状态,0-未锁定可用,1-锁定不可用") @ApiModelProperty(value = "锁定状态,0-未锁定可用,1-锁定不可用")
private Integer lockStatus = 0; private Integer lockStatus = 0;
public MatchingDeviceLibrary toDo() { public MatchingDeviceLibrary toDo() {
MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary(); MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary();
BeanUtils.copyProperties(this, matchingDeviceLibraryEntity); BeanUtils.copyProperties(this, matchingDeviceLibraryEntity);
matchingDeviceLibraryEntity.setLifeStatus(2); matchingDeviceLibraryEntity.setLifeStatus(2);
matchingDeviceLibraryEntity.setDeviceId(0); matchingDeviceLibraryEntity.setDeviceId(0);
matchingDeviceLibraryEntity.setLocationUnitId(this.createUnitId); matchingDeviceLibraryEntity.setLocationUnitId(this.createUnitId);
matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate));
//签订日期进行时间的转换
// matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate));
// if (matchingDeviceLibraryEntity.getRfidCardId()==null||"".equals(matchingDeviceLibraryEntity.getRfidCardId())){ // if (matchingDeviceLibraryEntity.getRfidCardId()==null||"".equals(matchingDeviceLibraryEntity.getRfidCardId())){
// matchingDeviceLibraryEntity.setRfidCardId(UUID.randomUUID().toString()); // matchingDeviceLibraryEntity.setRfidCardId(UUID.randomUUID().toString());
// } // }
......
package com.tykj.dev.device.matching.subject.vo; package com.tykj.dev.device.matching.subject.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.misc.base.CustomPage; import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column;
import java.time.LocalDate;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -51,6 +57,51 @@ public class MatchingDeviceSelectVo extends CustomPage { ...@@ -51,6 +57,51 @@ public class MatchingDeviceSelectVo extends CustomPage {
private Integer matchingDeviceStatus ; private Integer matchingDeviceStatus ;
//使用状态 签订日期 合同金额 装备序列号 采购方式 不需要
//
@ApiModelProperty(value = "型号 模糊查询")
private String modelLike ;
@ApiModelProperty(value = "资产名称 模糊查询")
private String nameLike ;
@ApiModelProperty(value = "品牌 模糊查询")
private String brandLike ;
@ApiModelProperty(value = "固定资产号 模糊查询")
private String fixedAssetsCodeNumberLike;
@ApiModelProperty(value = "资产管理单位 模糊查询")
private String manageUnitLike ;
@ApiModelProperty(value = "使用单位 模糊查询")
private String useUnitLike;
@ApiModelProperty(value = "部署地址 模糊查询")
private String deployAddressLike ;
@ApiModelProperty(value = "乙方名称 模糊查询")
private String yiNameLike;
@ApiModelProperty(value = "签订开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private LocalDate signStartDate;
@ApiModelProperty(value = "签订结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private LocalDate signEndDate;
@ApiModelProperty(value = "备注 模糊查询")
private String remakeLike;
@ApiModelProperty(value = "类型 1 代表只查询停用的") @ApiModelProperty(value = "类型 1 代表只查询停用的")
private Integer matchingType ; private Integer matchingType ;
@ApiModelProperty(value = "单位ID的集合")
private List<Integer> unitIds; ;
} }
package com.tykj.dev.device.matching.subject.vo.excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSaveVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("导入配套设备库的excel")
@ExcelTarget("matchingDeviceSaveVoExcelList")
public class MatchingDeviceSaveVoExcelList {
@ApiModelProperty(value = "集合")
private List<MatchingDeviceSaveVo> list;
}
...@@ -68,6 +68,12 @@ ...@@ -68,6 +68,12 @@
<artifactId>snappy-java</artifactId> <artifactId>snappy-java</artifactId>
<version>1.1.2.6</version> <version>1.1.2.6</version>
</dependency> </dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-spring-boot-starter</artifactId>
<version>3.3.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -22,4 +22,14 @@ public class DateUtil { ...@@ -22,4 +22,14 @@ public class DateUtil {
return localDateTime.toLocalDate(); return localDateTime.toLocalDate();
} }
public static LocalDate string2LocalDate(String format){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
return LocalDate.parse(format, formatter);
}
public static String localDate2String(LocalDate localDate){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
return formatter.format(localDate);
}
} }
...@@ -11,13 +11,15 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -11,13 +11,15 @@ spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update #spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/ #file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin # spring boot admin
file.path=/Users/zjm/code/test-tu/ file.path=/Users/zhoushaopan/file/
preview.path=http://192.168.102.169:8087/file/ preview.path=http://192.168.102.169:8087/file/
spring.boot.admin.client.url=http://localhost:8769 spring.boot.admin.client.url=http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087w spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087
block.flag=true block.flag=true
readMachine.ip=192.168.101.201 readMachine.ip=192.168.101.201
qrcode.path = C:/Users/zsp/Desktop/qrcode/ qrcode.path = C:/Users/zsp/Desktop/qrcode/
qrcode.preview.path=http://192.168.101.133:8087/code/ qrcode.preview.path=http://192.168.101.133:8087/code/
carrier.url = http://192.168.0.101:8087/configuration/saveConfiguration carrier.url = http://192.168.0.101:8087/configuration/saveConfiguration
file.matching.excel=/Users/zhoushaopan/excel/
...@@ -9,4 +9,5 @@ preview.path=http://10.153.4.11:8088/equip/file/ ...@@ -9,4 +9,5 @@ preview.path=http://10.153.4.11:8088/equip/file/
#preview.path=http://192.168.0.80:8088/equip/file/ #preview.path=http://192.168.0.80:8088/equip/file/
block.flag=true block.flag=true
carrier.url = http://10.153.4.11:8088/carrier/configuration/saveConfiguration carrier.url = http://10.153.4.11:8088/carrier/configuration/saveConfiguration
\ No newline at end of file file.matching.excel=/data/equip/matching/excel/
\ No newline at end of file
...@@ -10,4 +10,5 @@ spring.jmx.enabled=false ...@@ -10,4 +10,5 @@ spring.jmx.enabled=false
block.flag=false block.flag=false
qrcode.path = /opt/qrcode/ qrcode.path = /opt/qrcode/
qrcode.preview.path=http://10.153.4.11:8088/equipTest/code/ qrcode.preview.path=http://10.153.4.11:8088/equipTest/code/
carrier.url = http://10.153.4.11:8088/carrierTest/configuration/saveConfiguration carrier.url = http://10.153.4.11:8088/carrierTest/configuration/saveConfiguration
\ No newline at end of file file.matching.excel=/data/equipTest/matching/excel/
\ No newline at end of file
...@@ -15,4 +15,6 @@ readMachine.ip=192.168.101.202 ...@@ -15,4 +15,6 @@ readMachine.ip=192.168.101.202
qrcode.path = /opt/qrcode/ qrcode.path = /opt/qrcode/
qrcode.preview.path=http://192.168.0.80/equip/code/ qrcode.preview.path=http://192.168.0.80/equip/code/
carrier.url = http://192.168.0.80:8088/carrier/configuration/saveConfiguration carrier.url = http://192.168.0.80:8088/carrier/configuration/saveConfiguration
\ No newline at end of file
file.matching.excel=/data/equip/excel/
\ No newline at end of file
...@@ -33,7 +33,10 @@ public class UnitsCache { ...@@ -33,7 +33,10 @@ public class UnitsCache {
} }
public Units findById(Integer id) { public Units findById(Integer id) {
return idMap.get(id); if (idMap.containsKey(id)){
return idMap.get(id);
}
return new Units();
} }
public List<Units> findAll(){ public List<Units> findAll(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论