优化代码
This commit is contained in:
parent
834fcf7e2d
commit
272cf93055
@ -195,7 +195,7 @@ public class AlgorithmArrangeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/exportArrangeById")
|
@GetMapping("/exportArrangeById")
|
||||||
@ApiOperation("导出报告")
|
@ApiOperation("导出布点报告")
|
||||||
public void exportArrangeById(String id, HttpServletResponse response) throws IOException {
|
public void exportArrangeById(String id, HttpServletResponse response) throws IOException {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
||||||
@ -222,7 +222,7 @@ public class AlgorithmArrangeController {
|
|||||||
String arrangeImageUrl = algorithmArrange.getArrangeImageUrl();
|
String arrangeImageUrl = algorithmArrange.getArrangeImageUrl();
|
||||||
if (StrUtil.isNotBlank(arrangeImageUrl)) {
|
if (StrUtil.isNotBlank(arrangeImageUrl)) {
|
||||||
map.put("img",
|
map.put("img",
|
||||||
Pictures.ofStream(Files.newInputStream(new File(httpServerConfig.getPlanFilePath() + arrangeImageUrl).toPath()), FileUtil.getPictureType(arrangeImageUrl)).size(800, 200).create());
|
Pictures.ofStream(Files.newInputStream(new File(httpServerConfig.getPlanFilePath() + arrangeImageUrl).toPath()), FileUtil.getPictureType(arrangeImageUrl)).fitSize().create());
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -243,8 +243,9 @@ public class AlgorithmArrangeController {
|
|||||||
"")).getPath() + "templates" + File.separator + "布点报告模板.docx";
|
"")).getPath() + "templates" + File.separator + "布点报告模板.docx";
|
||||||
XWPFTemplate compile = XWPFTemplate.compile(path, config);
|
XWPFTemplate compile = XWPFTemplate.compile(path, config);
|
||||||
XWPFTemplate template = compile.render(map);
|
XWPFTemplate template = compile.render(map);
|
||||||
|
// template.write(new FileOutputStream("E:\\巡视报告模板.docx"));
|
||||||
response.setContentType("application/octet-stream");
|
response.setContentType("application/octet-stream");
|
||||||
response.setHeader("Content-disposition", "attachment;filename='reportTemp.docx'");
|
response.setHeader("Content-disposition", "attachment;filename=reportTemp.docx");
|
||||||
|
|
||||||
OutputStream out = response.getOutputStream();
|
OutputStream out = response.getOutputStream();
|
||||||
BufferedOutputStream bos = new BufferedOutputStream(out);
|
BufferedOutputStream bos = new BufferedOutputStream(out);
|
||||||
|
@ -46,10 +46,10 @@ public class SubstationMaindeviceResumeController {
|
|||||||
@GetMapping("/getMaindeviceResume")
|
@GetMapping("/getMaindeviceResume")
|
||||||
@ApiOperation("分页查看主设备维修记录")
|
@ApiOperation("分页查看主设备维修记录")
|
||||||
public ResponseResult getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
public ResponseResult getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
||||||
String bayId, String deviceType, String mainDeviceName,
|
String bayId, String type,String deviceType, String mainDeviceName,
|
||||||
String startDate, String endDate) {
|
String startDate, String endDate) {
|
||||||
|
|
||||||
Page<Map<String, Object>> mapPage = resumeService.getMaindeviceResume(page, stationCode, areaId, bayId,
|
Page<Map<String, Object>> mapPage = resumeService.getMaindeviceResume(page, stationCode, areaId, bayId,type,
|
||||||
deviceType, mainDeviceName, startDate, endDate);
|
deviceType, mainDeviceName, startDate, endDate);
|
||||||
return ResponseResult.successData(mapPage);
|
return ResponseResult.successData(mapPage);
|
||||||
}
|
}
|
||||||
|
@ -89,14 +89,10 @@ public class SubstationMaindevice implements Serializable {
|
|||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联点位id,用于展示主设备全景画面
|
* 相机参数[{"patroldevice_name":"1","patroldevice_code":"","patroldevice_channelcode":"","patroldevice_pos":"","pos_name":""}]
|
||||||
*/
|
*/
|
||||||
private String deviceId;
|
private String patroldeviceJson;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否关联点位0:未关联;1:已关联
|
|
||||||
*/
|
|
||||||
private String contactFlag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据状态
|
* 数据状态
|
||||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
public interface SubstationMaindeviceResumeMapper extends BaseMapper<SubstationMaindeviceResume> {
|
public interface SubstationMaindeviceResumeMapper extends BaseMapper<SubstationMaindeviceResume> {
|
||||||
|
|
||||||
Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
||||||
String bayId, String deviceType, String mainDeviceName,
|
String bayId,String type, String deviceType, String mainDeviceName,
|
||||||
String startDate, String endDate);
|
String startDate, String endDate);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,6 @@ import java.util.Map;
|
|||||||
public interface ISubstationMaindeviceResumeService extends IService<SubstationMaindeviceResume> {
|
public interface ISubstationMaindeviceResumeService extends IService<SubstationMaindeviceResume> {
|
||||||
|
|
||||||
Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId,
|
||||||
String bayId, String deviceType, String mainDeviceName,
|
String bayId,String type, String deviceType, String mainDeviceName,
|
||||||
String startDate, String endDate);
|
String startDate, String endDate);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class SubstationMaindeviceResumeServiceImpl extends ServiceImpl<Substatio
|
|||||||
@Resource
|
@Resource
|
||||||
private SubstationMaindeviceResumeMapper maindeviceResumeMapper;
|
private SubstationMaindeviceResumeMapper maindeviceResumeMapper;
|
||||||
@Override
|
@Override
|
||||||
public Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId, String bayId, String deviceType, String mainDeviceName, String startDate, String endDate) {
|
public Page<Map<String, Object>> getMaindeviceResume(Page<Map<String, Object>> page, String stationCode, String areaId, String bayId,String type, String deviceType, String mainDeviceName, String startDate, String endDate) {
|
||||||
return maindeviceResumeMapper.getMaindeviceResume(page, stationCode, areaId, bayId,deviceType, mainDeviceName,startDate,endDate);
|
return maindeviceResumeMapper.getMaindeviceResume(page, stationCode, areaId, bayId,type,deviceType, mainDeviceName,startDate,endDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,7 @@ logging:
|
|||||||
com.genersoft.iot: error
|
com.genersoft.iot: error
|
||||||
com.genersoft.iot.vmp.storager.dao: info
|
com.genersoft.iot.vmp.storager.dao: info
|
||||||
com.genersoft.iot.vmp.gb28181: info
|
com.genersoft.iot.vmp.gb28181: info
|
||||||
|
com.deepoove.poi: warn
|
||||||
|
|
||||||
# 在线文档: swagger-ui(生产环境建议关闭)
|
# 在线文档: swagger-ui(生产环境建议关闭)
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
<if test="bayId != null and bayId != ''">
|
<if test="bayId != null and bayId != ''">
|
||||||
AND bay_id= #{bayId}
|
AND bay_id= #{bayId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="type != null and type != ''">
|
||||||
|
AND type= #{type}
|
||||||
|
</if>
|
||||||
<if test="deviceType != null and deviceType != ''">
|
<if test="deviceType != null and deviceType != ''">
|
||||||
AND device_type= #{deviceType}
|
AND device_type= #{deviceType}
|
||||||
</if>
|
</if>
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user