| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwBusinessDeviceDTO; |
| | | import com.sinata.system.domain.query.MwBusinessDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwBusinessDeviceVO; |
| | | import com.sinata.system.service.MwBusinessDeviceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"业务设备相关接口"}) |
| | | @RequestMapping("/backend/mwBusinessDevice") |
| | | public class MwBusinessDeviceController { |
| | | private final MwBusinessDeviceService mwBusinessDeviceService; |
| | | |
| | | /** |
| | | * 业务设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("业务设备分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwBusinessDeviceVO>> pageList(@Valid @RequestBody MwBusinessDeviceQuery query) { |
| | | return R.ok(mwBusinessDeviceService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwBusinessDeviceVO> detail(@ApiParam(name = "id", value = "业务设备id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwBusinessDeviceService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwBusinessDeviceDTO dto) { |
| | | mwBusinessDeviceService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwBusinessDeviceDTO dto) { |
| | | mwBusinessDeviceService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "业务设备id", required = true) @PathVariable("id") Long id) { |
| | | mwBusinessDeviceService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/hospital/page") |
| | | @ApiOperation(value = "转运记录分页列表") |
| | | @PostMapping("/hospital/page") |
| | | public R<PageDTO<MwCheckoutRecordVO>> pageList(@Valid @RequestBody CheckoutRecordQuery query) { |
| | | return R.ok(mwCheckoutRecordService.pageHospitalTransitList(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/hospital/export") |
| | | @ApiOperation("转运记录导出") |
| | | @PostMapping("/hospital/export") |
| | | public void checkoutRecordExport(@RequestBody CheckoutRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | mwCheckoutRecordService.checkoutRecordExport(query, response); |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @GetMapping("/hospital/detail/{departmentId}") |
| | | @ApiOperation(value = "转运记录详情") |
| | | @GetMapping("/hospital/detail/{departmentId}") |
| | | public R<MwCheckoutRecordVO> hospitalDetail(@ApiParam(name = "id", value = "医院id", required = true) @PathVariable("departmentId") Long departmentId) { |
| | | return R.ok(mwCheckoutRecordService.hospitalDetail(departmentId)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/hospital/detailPage") |
| | | @ApiOperation(value = "转运记录医废详情分页列表") |
| | | @PostMapping("/hospital/detailPage") |
| | | public R<PageDTO<MwMedicalWasteBoxVO>> hospitalDetailPage(@Valid @RequestBody MwCheckoutRecordItemQuery query) { |
| | | return R.ok(mwCheckoutRecordService.hospitalDetailPage(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/transit/page") |
| | | @ApiOperation(value = "运输记录分页列表") |
| | | @PostMapping("/transit/page") |
| | | public R<PageDTO<MwTransitRecordVO>> transitPageList(@Valid @RequestBody MwTransitRecordQuery query) { |
| | | return R.ok(mwCheckoutRecordService.transitPageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/transit/detail/{id}") |
| | | @ApiOperation("运输记录详情") |
| | | @GetMapping("/transit/detail/{id}") |
| | | public R<MwTransitRecordVO> transitDetail(@ApiParam(name = "id", value = "运输记录id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwCheckoutRecordService.transitDetail(id)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/transit/detailPage") |
| | | @ApiOperation("运输记录详情分页列表") |
| | | @PostMapping("/transit/detailPage") |
| | | public R<PageDTO<MwMedicalWasteBoxVO>> transitDetailPage(@Valid @RequestBody MwTransitRecordQuery query) { |
| | | return R.ok(mwCheckoutRecordService.transitDetailPageList(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("医废追溯分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwCollectRecordVO>> pageList(@Valid @RequestBody MwCollectRecordQuery query) { |
| | | return R.ok(collectRecordService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("医废追溯详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MwCollectRecordVO> detail(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(collectRecordService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwCollectRecordDTO dto) { |
| | | collectRecordService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> remove(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | collectRecordService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/process/{id}") |
| | | @ApiOperation("流转过程") |
| | | @GetMapping("/process/{id}") |
| | | public R<MedicalWasteProcessVO> getProcess(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(collectRecordService.getProcess(id)); |
| | | } |
| | |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MwCollectRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | collectRecordService.export(query, response); |
| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwContractDTO; |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | import com.sinata.system.service.MwContractService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "合同管理相关接口") |
| | | @RequestMapping("/backend/mwContract") |
| | | public class MwContractController { |
| | | private final MwContractService mwContractService; |
| | | |
| | | /** |
| | | * 合同分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("合同分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwContractVO>> pageList(@Valid @RequestBody MwContractQuery query) { |
| | | return R.ok(mwContractService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwContractVO> detail(@ApiParam(name = "id", value = "合同id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwContractService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增合同") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwContractDTO dto) { |
| | | mwContractService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑合同") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwContractDTO dto) { |
| | | mwContractService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "合同id", required = true) @PathVariable("id") Long id) { |
| | | mwContractService.delete(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/statics") |
| | | @ApiOperation(value = "统计数据") |
| | | @PostMapping("/statics") |
| | | public R<DisposalRecordStaticsVO> statics(@RequestBody MwDisposalRecordQuery query) { |
| | | return R.ok(mwDisposalRecordService.statics(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("处置显示分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwDisposalRecordVO>> pageList(@Valid @RequestBody MwDisposalRecordQuery query) { |
| | | return R.ok(mwDisposalRecordService.pageList(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/detail") |
| | | @ApiOperation("详情") |
| | | @PostMapping("/detail") |
| | | public R<PageDTO<MwDisposalRecordItemVO>> detail(@Valid @RequestBody MwDisposalRecordItemQuery query) { |
| | | return R.ok(mwDisposalRecordService.detail(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("处置单位分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<DisposalUnitVO>> pageList(@RequestBody DepartmentQuery query) { |
| | | return R.ok(sysDepartmentService.pageDisposalUnitList(query)); |
| | | } |
| | |
| | | * |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增处置单位") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody DisposalUnitDTO dto) { |
| | | sysDepartmentService.addDisposalUnit(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑处置单位") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody DisposalUnitDTO dto) { |
| | | sysDepartmentService.editDisposalUnit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("处置单位详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<DisposalUnitVO> detail(@ApiParam(name = "id", value = "处置单位id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(sysDepartmentService.getDisposalUnitDetailById(id)); |
| | | } |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除处置单位") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "处置单位id", required = true) @PathVariable("id") Long id) { |
| | | sysDepartmentService.deleteDisposalUnit(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("医疗机构分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MedicalInstitutionVO>> pageList(@RequestBody DepartmentQuery query) { |
| | | return R.ok(sysDepartmentService.pageMedicalList(query)); |
| | | } |
| | |
| | | * |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增医疗机构") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MedicalInstitutionDTO dto) { |
| | | sysDepartmentService.addMedical(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDisposalList/{id}") |
| | | @ApiOperation("根据父级区域id查询处置单位列表") |
| | | @GetMapping("/getDisposalList/{id}") |
| | | public R<List<DisposalUnitVO>> getDisposalUnitList(@ApiParam(name = "id", value = "父级区域id") @PathVariable("id") Long id) { |
| | | return R.ok(sysDepartmentService.getDisposalUnitListByParentId(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑医疗机构") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MedicalInstitutionDTO dto) { |
| | | sysDepartmentService.editMedical(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("医疗机构详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<MedicalInstitutionVO> detail(@ApiParam(name = "id", value = "医疗机构id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(sysDepartmentService.getMedicalDetailById(id)); |
| | | } |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除医疗机构") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "医疗机构id", required = true) @PathVariable("id") Long id) { |
| | | sysDepartmentService.deleteMedical(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("设备管理分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwMicroEquipmentVO>> pageList(@Valid @RequestBody MwMicroEquipmentQuery query) { |
| | | return R.ok(mwMicroEquipmentService.pageList(query)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增设备") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwMicroEquipmentDTO dto) { |
| | | mwMicroEquipmentService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑设备") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwMicroEquipmentDTO dto) { |
| | | mwMicroEquipmentService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "设备id", required = true) @PathVariable("id") Long id) { |
| | | mwMicroEquipmentService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/storedMedicalWastePage") |
| | | @ApiOperation("待处理的医废列表") |
| | | @PostMapping("/storedMedicalWastePage") |
| | | public R<PageDTO<MwMedicalWasteBoxVO>> storedMedicalWastePage(@Valid @RequestBody StorageRecordQuery query) { |
| | | return R.ok(mwMicroEquipmentService.storedMedicalWastePage(query)); |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("微型设备列表") |
| | | @GetMapping("/list") |
| | | public R<List<MwMicroEquipmentVO>> getList() { |
| | | return R.ok(mwMicroEquipmentService.getList()); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("设备使用记录分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwMicroEquipmentRecordVO>> pageList(@Valid @RequestBody MwMicroEquipmentRecordQuery query) { |
| | | return R.ok(mwMicroEquipmentRecordService.pageList(query)); |
| | | } |
| | |
| | | * |
| | | * @param query |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出设备使用记录") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MwMicroEquipmentRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | mwMicroEquipmentRecordService.export(query, response); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增使用记录") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwMicroEquipmentRecordDTO dto) { |
| | | mwMicroEquipmentRecordService.add(dto); |
| | | return R.ok(); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/statics/title") |
| | | @ApiOperation("处置分析表头") |
| | | @GetMapping("/statics/title") |
| | | public R<List<MwMicroEquipmentStaticsTitleVO>> staticsTitle() { |
| | | return R.ok(mwMicroEquipmentRecordService.staticsTitle()); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/statics/data") |
| | | @ApiOperation("处置分析数据") |
| | | @PostMapping("/statics/data") |
| | | public R<List<List<String>>> staticsData(@Valid @RequestBody MwMicroEquipmentStaticsQuery query) { |
| | | return R.ok(mwMicroEquipmentRecordService.getStaticsData(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/statics/export") |
| | | @ApiOperation("处置分析导出") |
| | | @PostMapping("/statics/export") |
| | | public void export(@Valid @RequestBody MwMicroEquipmentStaticsQuery query, HttpServletResponse response) { |
| | | try { |
| | | mwMicroEquipmentRecordService.staticsExport(query, response); |
| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwMonitorDeviceDTO; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | import com.sinata.system.service.MwMonitorDeviceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"监控设备"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/mwMonitorDevice") |
| | | public class MwMonitorDeviceController { |
| | | private final MwMonitorDeviceService mwMonitorDeviceService; |
| | | |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("监控设备分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwMonitorDeviceVO>> pageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 监控设备详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("监控设备详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwMonitorDeviceVO> detail(@ApiParam(name = "id", value = "监控设备id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwMonitorDeviceService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwMonitorDeviceDTO dto) { |
| | | mwMonitorDeviceService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwMonitorDeviceDTO dto) { |
| | | mwMonitorDeviceService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除") |
| | | @PostMapping("/remove/{id}") |
| | | public R<?> remove(@ApiParam(name = "id", value = "监控设备id", required = true) @PathVariable("id") Long id) { |
| | | mwMonitorDeviceService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("防护器具分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwProtectionEquipmentVO>> pageList(@Valid @RequestBody MwProtectionEquipmentQuery query) { |
| | | return R.ok(mwProtectionEquipmentService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwProtectionEquipmentVO> detail(@ApiParam(name = "id", value = "防护器具id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwProtectionEquipmentService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增防护器具") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwProtectionEquipmentDTO dto) { |
| | | mwProtectionEquipmentService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwProtectionEquipmentDTO dto) { |
| | | mwProtectionEquipmentService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "防护器具id", required = true) @PathVariable("id") Long id) { |
| | | mwProtectionEquipmentService.delete(id); |
| | | return R.ok(); |
| | |
| | | * |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/addStock") |
| | | @ApiOperation("增加库存") |
| | | @PostMapping("/addStock") |
| | | public R<?> addStock(@Valid @RequestBody MwProtectionEquipmentRecordDTO dto) { |
| | | mwProtectionEquipmentService.addStock(dto); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/recordPage") |
| | | @ApiOperation("增减记录") |
| | | @PostMapping("/recordPage") |
| | | public R<PageDTO<MwProtectionEquipmentRecordVO>> recordPage(@Valid @RequestBody MwProtectionEquipmentRecordQuery query) { |
| | | return R.ok(mwProtectionEquipmentService.recordPage(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("规章制度分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwProtectionRegulationVO>> pageList(@Valid @RequestBody MwProtectionRegulationQuery query) { |
| | | return R.ok(mwProtectionRegulationService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwProtectionRegulationVO> detail(@ApiParam(name = "id", value = "规章制度id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwProtectionRegulationService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增规章制度") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwProtectionRegulationDTO dto) { |
| | | mwProtectionRegulationService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑规章制度") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwProtectionRegulationDTO dto) { |
| | | mwProtectionRegulationService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "规章制度id", required = true) @PathVariable("id") Long id) { |
| | | mwProtectionRegulationService.delete(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("防护作业分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwProtectionTaskVO>> pageList(@Valid @RequestBody MwProtectionTaskQuery query) { |
| | | return R.ok(mwProtectionTaskService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("防护作业详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwProtectionTaskVO> detail(@ApiParam(name = "id", value = "防护作业id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwProtectionTaskService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增防护作业") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwProtectionTaskDTO dto) { |
| | | mwProtectionTaskService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑防护作业") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwProtectionTaskDTO dto) { |
| | | mwProtectionTaskService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "防护作业id", required = true) @PathVariable("id") Long id) { |
| | | mwProtectionTaskService.delete(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("监管单位分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<RegulatoryUnitVO>> pageList(@RequestBody DepartmentQuery query) { |
| | | return R.ok(sysDepartmentService.pageRegulatoryUnitList(query)); |
| | | } |
| | |
| | | * |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增监管单位") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody RegulatoryUnitDTO dto) { |
| | | sysDepartmentService.addRegulatoryUnit(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑监管单位") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody RegulatoryUnitDTO dto) { |
| | | sysDepartmentService.editRegulatoryUnit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("监管单位详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<RegulatoryUnitVO> detail(@ApiParam(name = "id", value = "监管单位id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(sysDepartmentService.getRegulatoryUnitDetailById(id)); |
| | | } |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除监管单位") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "监管单位id", required = true) @PathVariable("id") Long id) { |
| | | sysDepartmentService.deleteRegulatoryUnit(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("暂存间分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwStagingRoomVO>> pageList(@Valid @RequestBody MwStagingRoomQuery query) { |
| | | return R.ok(mwStagingRoomService.pageList(query)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增暂存间") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwStagingRoomDTO dto) { |
| | | mwStagingRoomService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑暂存间") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwStagingRoomDTO dto) { |
| | | mwStagingRoomService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除暂存间") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "暂存间id", required = true) @PathVariable("id") Long id) { |
| | | mwStagingRoomService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getByHospitalId/{departmentId}") |
| | | @ApiOperation(value = "根据医院id查询暂存间", notes = "入库、出库记录暂存间筛选级联数据") |
| | | @GetMapping("/getByHospitalId/{departmentId}") |
| | | public R<MwStagingRoomVO> getByHospitalId(@ApiParam(name = "departmentId", value = "医院id", required = true) @PathVariable("departmentId") Long departmentId) { |
| | | return R.ok(mwStagingRoomService.getByHospitalId(departmentId)); |
| | | } |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/storageRecord") |
| | | @ApiOperation("暂存间入库记录") |
| | | @PostMapping("/storageRecord") |
| | | public R<PageDTO<MwStorageRecordVO>> storageRecord(@Valid @RequestBody StorageRecordQuery query) { |
| | | return R.ok(mwStagingRoomService.storageRecord(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/storageRecord/export") |
| | | @ApiOperation("暂存间入库记录导出") |
| | | @PostMapping("/storageRecord/export") |
| | | public void storageRecordExport(@RequestBody StorageRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | mwStagingRoomService.storageRecordExport(query, response); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/checkoutRecord") |
| | | @ApiOperation("暂存间出库记录") |
| | | @PostMapping("/checkoutRecord") |
| | | public R<PageDTO<MwCheckoutRecordVO>> checkoutRecord(@Valid @RequestBody CheckoutRecordQuery query) { |
| | | return R.ok(mwStagingRoomService.checkoutRecord(query)); |
| | | } |
| | |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/checkoutRecord/export") |
| | | @ApiOperation("暂存间出库记录导出") |
| | | @PostMapping("/checkoutRecord/export") |
| | | public void checkoutRecordExport(@RequestBody CheckoutRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | mwStagingRoomService.checkoutRecordExport(query, response); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("年检记录分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwTransitCarAnnualInspectionVO>> pageList(@Valid @RequestBody MwTransitCarAnnualInspectionQuery query) { |
| | | return R.ok(mwTransitCarAnnualInspectionService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwTransitCarAnnualInspectionVO> detail(@ApiParam(name = "id", value = "年检记录id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwTransitCarAnnualInspectionService.detail(id)); |
| | | } |
| | |
| | | * |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增年检记录") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwTransitCarAnnualInspectionDTO dto) { |
| | | mwTransitCarAnnualInspectionService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑年检记录") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwTransitCarAnnualInspectionDTO dto) { |
| | | mwTransitCarAnnualInspectionService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "年检记录id", required = true) @PathVariable("id") Long id) { |
| | | mwTransitCarAnnualInspectionService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("车辆分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwTransitCarVO>> pageList(@Valid @RequestBody TransitCarQuery query) { |
| | | return R.ok(mwTransitCarService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwTransitCarVO> detail(@ApiParam(name = "id", value = "车辆id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwTransitCarService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增车辆") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwTransitCarDTO dto) { |
| | | mwTransitCarService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑车辆") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwTransitCarDTO dto) { |
| | | mwTransitCarService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "车辆id", required = true) @PathVariable("id") Long id) { |
| | | mwTransitCarService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("保养记录分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwTransitCarMaintenanceVO>> pageList(@Valid @RequestBody MwTransitCarMaintenanceQuery query) { |
| | | return R.ok(mwTransitCarMaintenanceService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | @GetMapping("/{id}") |
| | | public R<MwTransitCarMaintenanceVO> detail(@ApiParam(name = "id", value = "保养记录id", required = true) @PathVariable Long id) { |
| | | return R.ok(mwTransitCarMaintenanceService.detail(id)); |
| | | } |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwTransitCarMaintenanceDTO dto) { |
| | | mwTransitCarMaintenanceService.add(dto); |
| | | return R.ok(); |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwTransitCarMaintenanceDTO dto) { |
| | | mwTransitCarMaintenanceService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "保养记录id", required = true) @PathVariable("id") Long id) { |
| | | mwTransitCarMaintenanceService.removeById(id); |
| | | return R.ok(); |
New file |
| | |
| | | package com.sinata.web.core.config; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | /** |
| | | * 存储-配置 |
| | | * |
| | | * @author mitao |
| | | */ |
| | | @ConfigurationProperties(prefix = "oss") |
| | | @Component |
| | | @Slf4j |
| | | @Data |
| | | public class OssConfig { |
| | | |
| | | private String folder = "dev"; |
| | | |
| | | private String accessKeyId; |
| | | |
| | | private String accessKeySecret; |
| | | |
| | | private String uploadEndpoint; |
| | | |
| | | private String downloadEndpoint; |
| | | |
| | | private String bucketName; |
| | | |
| | | private long downloadUrlExpiration; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | |
| | | log.debug("OSS配置信息:" + JSONObject.toJSONString(this)); |
| | | } |
| | | |
| | | public String getStoreFolder() { |
| | | |
| | | return getFolder(); |
| | | } |
| | | |
| | | } |
| | |
| | | excludes: /system/notice |
| | | # 匹配链接 |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | oss: |
| | | accessKeyId: LTAI4FyQgM99x9JKDtcL3mp2 |
| | | accessKeySecret: 0qffirCRqugdtnKPvCXz36yvLmYLWX |
| | | upload-endpoint: https://oss-cn-chengdu.aliyuncs.com |
| | | download-endpoint: https://ja-medical-service.oss-cn-chengdu.aliyuncs.com/ |
| | | bucketName: ja-medical-service |
| | | folder: medical |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiModel("业务设备数据传输对象") |
| | | public class MwBusinessDeviceDTO { |
| | | |
| | | @ApiModelProperty("业务设备id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("采购日期") |
| | | private Date purchaseDate; |
| | | |
| | | @ApiModelProperty("设备状态 1:正常,2:丢失,3:损坏") |
| | | private Integer deviceStatus; |
| | | |
| | | @ApiModelProperty("使用年限,单位:年") |
| | | private Integer serviceLifetime; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiModel("合同数据传输对象") |
| | | public class MwContractDTO { |
| | | |
| | | @ApiModelProperty("合同id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | @NotNull(message = "单位id不能为空") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("合同编号") |
| | | @NotBlank(message = "合同编号不能为空") |
| | | private String contractNumber; |
| | | |
| | | @ApiModelProperty("合同名称") |
| | | @NotBlank(message = "合同名称不能为空") |
| | | private String contractName; |
| | | |
| | | @ApiModelProperty("合同金额") |
| | | @NotNull(message = "合同金额不能为空") |
| | | private BigDecimal contractAmount; |
| | | |
| | | @ApiModelProperty("合同生效日期") |
| | | @NotNull(message = "合同生效日期不能为空") |
| | | private Date effectiveDate; |
| | | |
| | | @ApiModelProperty("合同终止日期") |
| | | @NotNull(message = "合同终止日期不能为空") |
| | | private Date terminationDate; |
| | | |
| | | @ApiModelProperty("甲方名称") |
| | | @NotBlank(message = "甲方名称不能为空") |
| | | private String partyAName; |
| | | |
| | | @ApiModelProperty("甲方联系人") |
| | | @NotBlank(message = "甲方联系人不能为空") |
| | | private String partyAContact; |
| | | |
| | | @ApiModelProperty("甲方联系电话") |
| | | @NotBlank(message = "甲方联系电话不能为空") |
| | | private String partyAPhone; |
| | | |
| | | @ApiModelProperty("乙方名称") |
| | | @NotBlank(message = "乙方名称不能为空") |
| | | private String partyBName; |
| | | |
| | | @ApiModelProperty("乙方联系人") |
| | | @NotBlank(message = "乙方联系人不能为空") |
| | | private String partyBContact; |
| | | |
| | | @ApiModelProperty("乙方联系电话") |
| | | @NotBlank(message = "乙方联系电话不能为空") |
| | | private String partyBPhone; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("附件列表") |
| | | private List<MwAttachmentDTO> attachmentList; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiModel("监控设备数据传输对象") |
| | | public class MwMonitorDeviceDTO { |
| | | |
| | | @ApiModelProperty("监控设备id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | @NotNull(message = "区域id不能为空") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | @NotBlank(message = "设备名称不能为空") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("监控设备编号") |
| | | @NotBlank(message = "监控设备编号不能为空") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("通道号") |
| | | @NotNull(message = "通道号不能为空") |
| | | private Integer channelNumber; |
| | | |
| | | @ApiModelProperty("自动关闭时间(分钟)") |
| | | @NotNull(message = "自动关闭时间不能为空") |
| | | private Integer autoShutdownTime; |
| | | |
| | | @ApiModelProperty("备注信息") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.query; |
| | | |
| | | import com.sinata.common.entity.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("业务设备查询数据传输对象") |
| | | public class MwBusinessDeviceQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 241372705492427149L; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceNumber; |
| | | |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("设备状态 1:正常,2:丢失,3:损坏") |
| | | private Integer deviceStatus; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.query; |
| | | |
| | | import com.sinata.common.entity.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("合同查询数据传输对象") |
| | | public class MwContractQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 7969486922223741063L; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("合同编号") |
| | | private String contractNumber; |
| | | |
| | | @ApiModelProperty("合同名称") |
| | | private String contractName; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.query; |
| | | |
| | | import com.sinata.common.entity.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("监控设备查询数据传输对象") |
| | | public class MwMonitorDeviceQuery extends BasePage { |
| | | private static final long serialVersionUID = -3480238000583765269L; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String deviceName; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiModel("业务设备视图对象") |
| | | public class MwBusinessDeviceVO { |
| | | |
| | | @ApiModelProperty("业务设备id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("采购日期") |
| | | private Date purchaseDate; |
| | | |
| | | @ApiModelProperty("设备状态 1:正常,2:丢失,3:损坏") |
| | | private Integer deviceStatus; |
| | | |
| | | @ApiModelProperty("使用年限,单位:年") |
| | | private Integer serviceLifetime; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiOperation("合同视图对象") |
| | | public class MwContractVO { |
| | | |
| | | @ApiModelProperty("合同id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("合同编号") |
| | | private String contractNumber; |
| | | |
| | | @ApiModelProperty("合同名称") |
| | | private String contractName; |
| | | |
| | | @ApiModelProperty("合同金额") |
| | | private BigDecimal contractAmount; |
| | | |
| | | @ApiModelProperty("合同生效日期") |
| | | private Date effectiveDate; |
| | | |
| | | @ApiModelProperty("合同终止日期") |
| | | private Date terminationDate; |
| | | |
| | | @ApiModelProperty("甲方名称") |
| | | private String partyAName; |
| | | |
| | | @ApiModelProperty("甲方联系人") |
| | | private String partyAContact; |
| | | |
| | | @ApiModelProperty("甲方联系电话") |
| | | private String partyAPhone; |
| | | |
| | | @ApiModelProperty("乙方名称") |
| | | private String partyBName; |
| | | |
| | | @ApiModelProperty("乙方联系人") |
| | | private String partyBContact; |
| | | |
| | | @ApiModelProperty("乙方联系电话") |
| | | private String partyBPhone; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty("附件列表") |
| | | private List<MwAttachmentVO> attachmentList; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/12/20 |
| | | */ |
| | | @Data |
| | | @ApiModel("监控设备视图对象") |
| | | public class MwMonitorDeviceVO { |
| | | |
| | | @ApiModelProperty("监控设备id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("区域id") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("设备名称") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("监控设备编号") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("通道号") |
| | | private Integer channelNumber; |
| | | |
| | | @ApiModelProperty("自动关闭时间(分钟)") |
| | | private Integer autoShutdownTime; |
| | | |
| | | @ApiModelProperty("备注信息") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | package com.sinata.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MwBusinessDevice; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.query.MwBusinessDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwBusinessDeviceVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface MwBusinessDeviceMapper extends BaseMapper<MwBusinessDevice> { |
| | | |
| | | /** |
| | | * 业务设备分页列表 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | Page<MwBusinessDeviceVO> pageList(Page<MwBusinessDeviceVO> page, @Param("query") MwBusinessDeviceQuery query, @Param("treeCode") String treeCode); |
| | | } |
| | |
| | | package com.sinata.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MwContract; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface MwContractMapper extends BaseMapper<MwContract> { |
| | | |
| | | /** |
| | | * 合同分页列表 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Page<MwContractVO> pageList(Page<MwContractVO> page, @Param("query") MwContractQuery query); |
| | | } |
| | |
| | | package com.sinata.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MwMonitorDevice; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface MwMonitorDeviceMapper extends BaseMapper<MwMonitorDevice> { |
| | | |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param page |
| | | * @param query |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | Page<MwMonitorDeviceVO> pageList(Page<MwMonitorDeviceVO> page, @Param("query") MwMonitorDeviceQuery query, @Param("treeCode") String treeCode); |
| | | } |
| | |
| | | package com.sinata.system.service; |
| | | |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MwBusinessDevice; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.system.domain.dto.MwBusinessDeviceDTO; |
| | | import com.sinata.system.domain.query.MwBusinessDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwBusinessDeviceVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | public interface MwBusinessDeviceService extends IService<MwBusinessDevice> { |
| | | /** |
| | | * 业务设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageDTO<MwBusinessDeviceVO> pageList(MwBusinessDeviceQuery query); |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwBusinessDeviceVO detail(Long id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | void add(MwBusinessDeviceDTO dto); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | */ |
| | | void edit(MwBusinessDeviceDTO dto); |
| | | } |
| | |
| | | package com.sinata.system.service; |
| | | |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MwContract; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.system.domain.dto.MwContractDTO; |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | public interface MwContractService extends IService<MwContract> { |
| | | /** |
| | | * 合同分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageDTO<MwContractVO> pageList(MwContractQuery query); |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwContractVO detail(Long id); |
| | | |
| | | /** |
| | | * 新增合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | void add(MwContractDTO dto); |
| | | |
| | | /** |
| | | * 编辑合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | void edit(MwContractDTO dto); |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | void delete(Long id); |
| | | } |
| | |
| | | package com.sinata.system.service; |
| | | |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MwMonitorDevice; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.system.domain.dto.MwMonitorDeviceDTO; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | public interface MwMonitorDeviceService extends IService<MwMonitorDevice> { |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageDTO<MwMonitorDeviceVO> pageList(MwMonitorDeviceQuery query); |
| | | |
| | | /** |
| | | * 监控设备详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwMonitorDeviceVO detail(Long id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | void add(MwMonitorDeviceDTO dto); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | void edit(MwMonitorDeviceDTO dto); |
| | | } |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.system.domain.MwBusinessDevice; |
| | | import com.sinata.system.domain.dto.MwBusinessDeviceDTO; |
| | | import com.sinata.system.domain.query.MwBusinessDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwBusinessDeviceVO; |
| | | import com.sinata.system.mapper.MwBusinessDeviceMapper; |
| | | import com.sinata.system.service.MwBusinessDeviceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MwBusinessDeviceServiceImpl extends ServiceImpl<MwBusinessDeviceMapper, MwBusinessDevice> implements MwBusinessDeviceService { |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | /** |
| | | * 业务设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageDTO<MwBusinessDeviceVO> pageList(MwBusinessDeviceQuery query) { |
| | | String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId()); |
| | | Page<MwBusinessDeviceVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MwBusinessDeviceVO detail(Long id) { |
| | | return BeanUtils.copyBean(this.getById(id), MwBusinessDeviceVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void add(MwBusinessDeviceDTO dto) { |
| | | MwBusinessDevice mwBusinessDevice = BeanUtils.copyBean(dto, MwBusinessDevice.class); |
| | | Long count = this.lambdaQuery().eq(MwBusinessDevice::getDeviceNumber, mwBusinessDevice.getDeviceNumber()).count(); |
| | | if (count > 0) { |
| | | throw new ServiceException("设备编号重复"); |
| | | } |
| | | save(mwBusinessDevice); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | */ |
| | | @Override |
| | | public void edit(MwBusinessDeviceDTO dto) { |
| | | if (Objects.isNull(dto.getId())) { |
| | | throw new ServiceException("业务设备id不能为空"); |
| | | } |
| | | MwBusinessDevice mwBusinessDevice = BeanUtils.copyBean(dto, MwBusinessDevice.class); |
| | | Long count = this.lambdaQuery().eq(MwBusinessDevice::getDeviceNumber, mwBusinessDevice.getDeviceNumber()).ne(MwBusinessDevice::getId, dto.getId()).count(); |
| | | if (count > 0) { |
| | | throw new ServiceException("设备编号重复"); |
| | | } |
| | | updateById(mwBusinessDevice); |
| | | } |
| | | } |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.sinata.system.domain.MwContract; |
| | | import com.sinata.system.mapper.MwContractMapper; |
| | | import com.sinata.system.service.MwContractService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.system.domain.MwAttachment; |
| | | import com.sinata.system.domain.MwContract; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwContractDTO; |
| | | import com.sinata.system.domain.query.MwContractQuery; |
| | | import com.sinata.system.domain.vo.MwAttachmentVO; |
| | | import com.sinata.system.domain.vo.MwContractVO; |
| | | import com.sinata.system.enums.AttachmentTypeEnum; |
| | | import com.sinata.system.mapper.MwContractMapper; |
| | | import com.sinata.system.service.MwAttachmentService; |
| | | import com.sinata.system.service.MwContractService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MwContractServiceImpl extends ServiceImpl<MwContractMapper, MwContract> implements MwContractService { |
| | | private final SysDepartmentService sysDepartmentService; |
| | | private final MwAttachmentService mwAttachmentService; |
| | | |
| | | /** |
| | | * 合同分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageDTO<MwContractVO> pageList(MwContractQuery query) { |
| | | if (Objects.isNull(query.getDepartmentId())) { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | if (Objects.isNull(myDepartment)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | query.setDepartmentId(myDepartment.getId()); |
| | | } |
| | | Page<MwContractVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MwContractVO detail(Long id) { |
| | | MwContractVO mwContractVO = BeanUtils.copyBean(getById(id), MwContractVO.class); |
| | | List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, id).list(); |
| | | mwContractVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class)); |
| | | return mwContractVO; |
| | | } |
| | | |
| | | /** |
| | | * 新增合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(MwContractDTO dto) { |
| | | MwContract mwContract = BeanUtils.copyBean(dto, MwContract.class); |
| | | if (CollUtils.isNotEmpty(dto.getAttachmentList())) { |
| | | List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class); |
| | | mwAttachments.forEach(attachment -> { |
| | | attachment.setTargetId(mwContract.getId()); |
| | | attachment.setType(AttachmentTypeEnum.CONTRACT.getCode()); |
| | | }); |
| | | mwAttachmentService.saveBatch(mwAttachments); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑合同 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void edit(MwContractDTO dto) { |
| | | if (Objects.isNull(dto.getId())) { |
| | | throw new ServiceException("合同id不能为空"); |
| | | } |
| | | MwContract mwContract = BeanUtils.copyBean(dto, MwContract.class); |
| | | updateById(mwContract); |
| | | if (CollUtils.isNotEmpty(dto.getAttachmentList())) { |
| | | //删除原来的附件 |
| | | mwAttachmentService.lambdaUpdate().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, dto.getId()).remove(); |
| | | List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class); |
| | | mwAttachments.forEach(attachment -> { |
| | | attachment.setTargetId(mwContract.getId()); |
| | | attachment.setType(AttachmentTypeEnum.CONTRACT.getCode()); |
| | | }); |
| | | mwAttachmentService.saveBatch(mwAttachments); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void delete(Long id) { |
| | | //删除附件 |
| | | mwAttachmentService.lambdaUpdate().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, id).remove(); |
| | | //执行删除 |
| | | removeById(id); |
| | | } |
| | | } |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.system.domain.MwMonitorDevice; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwMonitorDeviceDTO; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | import com.sinata.system.mapper.MwMonitorDeviceMapper; |
| | | import com.sinata.system.service.MwMonitorDeviceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MwMonitorDeviceServiceImpl extends ServiceImpl<MwMonitorDeviceMapper, MwMonitorDevice> implements MwMonitorDeviceService { |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageDTO<MwMonitorDeviceVO> pageList(MwMonitorDeviceQuery query) { |
| | | String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId()); |
| | | Page<MwMonitorDeviceVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 监控设备详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MwMonitorDeviceVO detail(Long id) { |
| | | MwMonitorDeviceVO mwMonitorDeviceVO = BeanUtils.copyBean(getById(id), MwMonitorDeviceVO.class); |
| | | SysDepartment department = sysDepartmentService.getById(mwMonitorDeviceVO.getDepartmentId()); |
| | | if (Objects.nonNull(department)) { |
| | | mwMonitorDeviceVO.setDepartmentName(department.getDepartmentName()); |
| | | } |
| | | return mwMonitorDeviceVO; |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void add(MwMonitorDeviceDTO dto) { |
| | | MwMonitorDevice mwMonitorDevice = BeanUtils.copyBean(dto, MwMonitorDevice.class); |
| | | Long count = this.lambdaQuery().eq(MwMonitorDevice::getDeviceNumber, mwMonitorDevice.getDeviceNumber()).count(); |
| | | if (count > 0) { |
| | | throw new ServiceException("监控设备编号重复"); |
| | | } |
| | | save(mwMonitorDevice); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void edit(MwMonitorDeviceDTO dto) { |
| | | if (Objects.isNull(dto.getId())) { |
| | | throw new ServiceException("监控设备id不能为空"); |
| | | } |
| | | Long count = this.lambdaQuery().eq(MwMonitorDevice::getDeviceNumber, dto.getDeviceNumber()).ne(MwMonitorDevice::getId, dto.getId()).count(); |
| | | if (count > 0) { |
| | | throw new ServiceException("监控设备编号重复"); |
| | | } |
| | | MwMonitorDevice mwMonitorDevice = BeanUtils.copyBean(dto, MwMonitorDevice.class); |
| | | updateById(mwMonitorDevice); |
| | | } |
| | | } |
| | |
| | | UPDATE_TIME, |
| | | ID, DEPARTMENT_ID, DEVICE_NAME, DEVICE_NUMBER, PURCHASE_DATE, DEVICE_STATUS, SERVICE_LIFETIME, REMARK |
| | | </sql> |
| | | <select id="pageList" resultType="com.sinata.system.domain.vo.MwBusinessDeviceVO"> |
| | | SELECT MBD.ID, |
| | | MBD.DEPARTMENT_ID, |
| | | MBD.DEVICE_NAME, |
| | | MBD.DEVICE_NUMBER, |
| | | MBD.PURCHASE_DATE, |
| | | MBD.DEVICE_STATUS, |
| | | MBD.SERVICE_LIFETIME, |
| | | MBD.REMARK, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_BUSINESS_DEVICE MBD |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MBD.DEPARTMENT_ID |
| | | <where> |
| | | MBD.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%') |
| | | </if> |
| | | <if test="query.deviceNumber != null and query.deviceNumber != ''"> |
| | | AND MBD.DEVICE_NUMBER LIKE CONCAT('%',#{query.deviceNumber},'%') |
| | | </if> |
| | | <if test="query.deviceName != null and query.deviceName != ''"> |
| | | AND MBD.DEVICE_NAME LIKECONCAT('%',#{query.deviceName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | UPDATE_TIME, |
| | | ID, DEPARTMENT_ID, CONTRACT_NUMBER, CONTRACT_NAME, CONTRACT_AMOUNT, EFFECTIVE_DATE, TERMINATION_DATE, PARTY_A_NAME, PARTY_A_CONTACT, PARTY_A_PHONE, PARTY_B_NAME, PARTY_B_CONTACT, PARTY_B_PHONE, ATTACHMENT, REMARK |
| | | </sql> |
| | | <select id="pageList" resultType="com.sinata.system.domain.vo.MwContractVO"> |
| | | SELECT MC.ID, |
| | | MC.DEPARTMENT_ID, |
| | | MC.CONTRACT_NUMBER, |
| | | MC.CONTRACT_NAME, |
| | | MC.CONTRACT_AMOUNT, |
| | | MC.EFFECTIVE_DATE, |
| | | MC.TERMINATION_DATE, |
| | | MC.PARTY_A_NAME, |
| | | MC.PARTY_A_CONTACT, |
| | | MC.PARTY_A_PHONE, |
| | | MC.PARTY_B_NAME, |
| | | MC.PARTY_B_CONTACT, |
| | | MC.PARTY_B_PHONE, |
| | | MC.REMARK, |
| | | MC.CREATE_TIME, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_CONTRACT MC |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MC.DEPARTMENT_ID |
| | | <where> |
| | | MC.DEL_FLAG = 0 |
| | | <if test="query.departmentId != null "> |
| | | AND MC.DEPARTMENT_ID = #{query.departmentId} |
| | | </if> |
| | | <if test="query.contractNumber != null and query.contractNumber != ''"> |
| | | AND MC.CONTRACT_NUMBER LIKE CONCAT('%',#{query.contractNumber},'%') |
| | | </if> |
| | | <if test="query.contractName != null and query.contractName != ''"> |
| | | AND MC.CONTRACT_NAME LIKE CONCAT('%',#{query.contractName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | UPDATE_TIME, |
| | | ID, DEPARTMENT_ID, DEVICE_NAME, DEVICE_NUMBER, CHANNEL_NUMBER, AUTO_SHUTDOWN_TIME, REMARK |
| | | </sql> |
| | | <select id="pageList" resultType="com.sinata.system.domain.vo.MwMonitorDeviceVO"> |
| | | SELECT MMD.ID, |
| | | MMD.DEPARTMENT_ID, |
| | | MMD.DEVICE_NAME, |
| | | MMD.DEVICE_NUMBER, |
| | | MMD.CHANNEL_NUMBER, |
| | | MMD.AUTO_SHUTDOWN_TIME, |
| | | MMD.REMARK, |
| | | SD.DEPARTMENT_NAME |
| | | FROM MW_MONITOR_DEVICE MMD |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MMD.DEPARTMENT_ID |
| | | <where> |
| | | MMD.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%') |
| | | </if> |
| | | <if test="query.deviceName!=null and query.deviceName !=''"> |
| | | AND MMD.DEVICE_NAME LIKE CONCAT('%',#{query.deviceName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |