|
|
@ -1,7 +1,9 @@ |
|
|
|
package com.kms.yg.sz.controller; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
@ -13,6 +15,8 @@ import com.kms.system.service.SysDeptService; |
|
|
|
import com.kms.system.service.SysXzqhService; |
|
|
|
import com.kms.yg.sz.domain.BsSgcSzBzbp; |
|
|
|
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|
|
|
import com.kms.yg.sz.domain.dto.HistogramDto; |
|
|
|
import com.kms.yg.sz.domain.dto.PieDto; |
|
|
|
import com.kms.yg.sz.service.BsSgcSzSafeJbxxService; |
|
|
|
import com.shuili.common.core.controller.BaseController; |
|
|
|
import com.shuili.common.core.domain.SearchParam; |
|
|
@ -51,8 +55,7 @@ import com.shuili.common.enums.BusinessType; |
|
|
|
@RestController |
|
|
|
@RequestMapping("/yg/jbxx") |
|
|
|
@Api(tags = "水闸安全管理基本信息") |
|
|
|
public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
{ |
|
|
|
public class BsSgcSzSafeJbxxController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private BsSgcSzSafeJbxxService bsSgcSzSafeJbxxService; |
|
|
|
|
|
|
@ -62,18 +65,56 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
@Autowired |
|
|
|
private SysDeptService sysDeptService; |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getPie") |
|
|
|
public List<HashMap<String, String>> getPie() { |
|
|
|
|
|
|
|
Integer layer = sysXzqhService.getLayer(); |
|
|
|
|
|
|
|
String xzqh = sysXzqhService.getXzqh(); |
|
|
|
|
|
|
|
|
|
|
|
List<PieDto> list = bsSgcSzSafeJbxxService.getPie(layer, xzqh); |
|
|
|
|
|
|
|
|
|
|
|
List<HashMap<String, String>> listBy = new ArrayList<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
for (PieDto pieDto : list) { |
|
|
|
|
|
|
|
map.put(pieDto.getName(), pieDto.getNum()); |
|
|
|
|
|
|
|
} |
|
|
|
listBy.add(map); |
|
|
|
return listBy; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getHistogram") |
|
|
|
public HistogramDto getHistogram() { |
|
|
|
Integer layer = sysXzqhService.getLayer(); |
|
|
|
|
|
|
|
String xzqh = sysXzqhService.getXzqh(); |
|
|
|
|
|
|
|
HistogramDto dto = bsSgcSzSafeJbxxService.getHistogram(layer, xzqh); |
|
|
|
|
|
|
|
|
|
|
|
return dto; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 查询水闸安全管理基本信息列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/list") |
|
|
|
@ApiOperation("水闸安全管理基本信息列表") |
|
|
|
public IPage list(@RequestBody SearchParam<BsSgcSzSafeJbxx> sp) |
|
|
|
{ |
|
|
|
public IPage list(@RequestBody SearchParam<BsSgcSzSafeJbxx> sp) { |
|
|
|
BsSgcSzSafeJbxx data = sp.getData(); |
|
|
|
Page<BsSgcSzSafeJbxx> page = bsSgcSzSafeJbxxService.page(new Page<>(sp.getPageNum(), sp.getPageSize()), |
|
|
|
Wrappers.lambdaQuery(BsSgcSzSafeJbxx.class).like(data.getWagaName() != null, BsSgcSzSafeJbxx::getWagaName, data.getWagaName()) |
|
|
|
.eq(data.getWagaType() != null, BsSgcSzSafeJbxx::getWagaType, data.getWagaType()) |
|
|
|
.eq(data.getStatus()!=null,BsSgcSzSafeJbxx::getStatus,data.getStatus()) |
|
|
|
.eq(data.getStatus() != null, BsSgcSzSafeJbxx::getStatus, data.getStatus()) |
|
|
|
.likeRight(data.getAdcd() != null, BsSgcSzSafeJbxx::getAdcd, sysXzqhService.getSubString(data.getAdcd())) |
|
|
|
.orderByDesc(BsSgcSzSafeJbxx::getCreateTime)); |
|
|
|
|
|
|
@ -87,9 +128,10 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
|
|
|
|
Page<BsSgcSzSafeJbxx> page = bsSgcSzSafeJbxxService.page(new Page<>(sp.getPageNum(), sp.getPageSize()), |
|
|
|
Wrappers.lambdaQuery(BsSgcSzSafeJbxx.class).like(data.getWagaName() != null, BsSgcSzSafeJbxx::getWagaName, data.getWagaName()) |
|
|
|
.eq(BsSgcSzSafeJbxx::getStatus,"1").or().eq(BsSgcSzSafeJbxx::getStatus,"4") |
|
|
|
.eq(BsSgcSzSafeJbxx::getStatus, "1").or().eq(BsSgcSzSafeJbxx::getStatus, "4").or().eq(BsSgcSzSafeJbxx::getHzStatus,"0") |
|
|
|
.or().eq(BsSgcSzSafeJbxx::getZxStatus,"0") |
|
|
|
.eq(data.getWagaType() != null, BsSgcSzSafeJbxx::getWagaType, data.getWagaType()) |
|
|
|
.eq(data.getStatus()!=null,BsSgcSzSafeJbxx::getStatus,data.getStatus()) |
|
|
|
.eq(data.getStatus() != null, BsSgcSzSafeJbxx::getStatus, data.getStatus()) |
|
|
|
.likeRight(data.getAdcd() != null, BsSgcSzSafeJbxx::getAdcd, sysXzqhService.getSubString(data.getAdcd())) |
|
|
|
.orderByDesc(BsSgcSzSafeJbxx::getCreateTime)); |
|
|
|
|
|
|
@ -103,8 +145,7 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
@Log(title = "水闸安全管理基本信息导出", businessType = BusinessType.EXPORT) |
|
|
|
@PostMapping("/export") |
|
|
|
@ApiOperation("水闸安全管理基本信息导出") |
|
|
|
public AjaxResult export(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) |
|
|
|
{ |
|
|
|
public AjaxResult export(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) { |
|
|
|
List<BsSgcSzSafeJbxx> list = bsSgcSzSafeJbxxService.listByIds(bsSgcSzSafeJbxx.getIds()); |
|
|
|
ExcelUtil<BsSgcSzSafeJbxx> util = new ExcelUtil<>(BsSgcSzSafeJbxx.class); |
|
|
|
return util.exportExcel(list, "jbxx"); |
|
|
@ -115,8 +156,7 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
*/ |
|
|
|
@ApiOperation(" 水闸安全管理基本信息详情") |
|
|
|
@GetMapping(value = "/{id}") |
|
|
|
public AjaxResult getInfo(@PathVariable("id") String id) |
|
|
|
{ |
|
|
|
public AjaxResult getInfo(@PathVariable("id") String id) { |
|
|
|
return AjaxResult.success(bsSgcSzSafeJbxxService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
@ -126,8 +166,7 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
@Log(title = "水闸安全管理基本信息新增", businessType = BusinessType.INSERT) |
|
|
|
@PostMapping |
|
|
|
@ApiOperation("水闸安全管理基本信息新增") |
|
|
|
public AjaxResult add(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) |
|
|
|
{ |
|
|
|
public AjaxResult add(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) { |
|
|
|
BaseEntityUtils.preInsert(bsSgcSzSafeJbxx); |
|
|
|
return toAjax(bsSgcSzSafeJbxxService.save(bsSgcSzSafeJbxx)); |
|
|
|
} |
|
|
@ -138,8 +177,7 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
@ApiOperation("水闸安全管理基本信息修改") |
|
|
|
@Log(title = "水闸安全管理基本信息修改", businessType = BusinessType.UPDATE) |
|
|
|
@PutMapping |
|
|
|
public AjaxResult edit(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) |
|
|
|
{ |
|
|
|
public AjaxResult edit(@RequestBody BsSgcSzSafeJbxx bsSgcSzSafeJbxx) { |
|
|
|
return toAjax(bsSgcSzSafeJbxxService.updateById(bsSgcSzSafeJbxx)); |
|
|
|
} |
|
|
|
|
|
|
@ -148,9 +186,8 @@ public class BsSgcSzSafeJbxxController extends BaseController |
|
|
|
*/ |
|
|
|
@ApiOperation("水闸安全管理基本信息删除") |
|
|
|
@Log(title = "水闸安全管理基本信息删除", businessType = BusinessType.DELETE) |
|
|
|
@DeleteMapping("/{ids}") |
|
|
|
public AjaxResult remove(@PathVariable String[] ids) |
|
|
|
{ |
|
|
|
@DeleteMapping("/{ids}") |
|
|
|
public AjaxResult remove(@PathVariable String[] ids) { |
|
|
|
return toAjax(bsSgcSzSafeJbxxService.removeByIds(Arrays.asList(ids))); |
|
|
|
} |
|
|
|
} |
|
|
|