|
@@ -92,26 +92,27 @@ public class DatumPointController {
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
- @RequestMapping(value = "/queryData",method=RequestMethod.POST)
|
|
|
- public R<DatumPointVo> queryData(HttpServletRequest request,String queryName,String contractId ,Integer type){
|
|
|
+ @GetMapping("/queryData")
|
|
|
+ public R<DatumPointVo> queryData(String queryName,String contractId ,Integer type){
|
|
|
if(StringUtil.isEmpty(queryName)||StringUtil.isEmpty(contractId)||StringUtil.isEmpty(type)){
|
|
|
return R.fail("缺少参数");
|
|
|
}
|
|
|
-
|
|
|
LambdaQueryWrapper<DatumPoint> wrapper = Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getName,queryName).eq(DatumPoint::getContractId,contractId).eq(DatumPoint::getType,type);
|
|
|
DatumPoint dap = this.service.getOne(wrapper);
|
|
|
DatumPointVo vo = new DatumPointVo();
|
|
|
- BeanUtils.copyProperties(dap,vo);
|
|
|
+ if(dap!=null) {
|
|
|
+ BeanUtils.copyProperties(dap, vo);
|
|
|
+ }
|
|
|
return R.data(vo);
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping("/import")
|
|
|
- public R<String> importXy(@RequestParam("file") MultipartFile file, Integer type , Long contractId) throws Exception {
|
|
|
- if(file != null&& type!=null && contractId!=null) {
|
|
|
+ public R<String> importXy(@RequestParam("file") MultipartFile file, Integer type , Long contractId,Long projectId) throws Exception {
|
|
|
+ if(file != null&& type!=null && contractId!=null&&projectId!=null) {
|
|
|
String fileName = Objects.requireNonNull(file.getOriginalFilename());
|
|
|
- if(Pattern.matches(".(\\.xls)x?$",fileName.toLowerCase(Locale.ROOT))) {
|
|
|
- return R.success(this.service.importData(file,contractId,type));
|
|
|
+ if(Pattern.matches(".+(\\.xls)x?$",fileName.toLowerCase(Locale.ROOT))) {
|
|
|
+ return R.success(this.service.importData(file,contractId,projectId,type));
|
|
|
} else {
|
|
|
R.fail("文件格式不正确,请上传Excel文件");
|
|
|
}
|