| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.measuringinstrumentledger.dto.MeasuringInstrumentLedgerRecordDTO; |
| | | import com.ruoyi.measuringinstrumentledger.dto.MeasuringInstrumentLedgerDto; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerRecordMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord; |
| | | import com.ruoyi.measuringinstrumentledger.service.MeasuringInstrumentLedgerService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | |
| | | * @date : 2025/8/5 9:27 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "计量器具台账") |
| | | @Tag(name = "计量器具台账") |
| | | @RequestMapping("/measuringInstrumentLedger") |
| | | @AllArgsConstructor |
| | | public class MeasuringInstrumentLedgerController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MeasuringInstrumentLedgerService measuringInstrumentLedgerService; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Autowired |
| | | private MeasuringInstrumentLedgerRecordMapper measuringInstrumentLedgerRecordMapper; |
| | | private final MeasuringInstrumentLedgerService measuringInstrumentLedgerService; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final MeasuringInstrumentLedgerRecordMapper measuringInstrumentLedgerRecordMapper; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("计量器具台账-分页查询") |
| | | @Operation(summary = "计量器具台账-分页查询") |
| | | @Log(title = "计量器具台账-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | | IPage<MeasuringInstrumentLedger> listPage = measuringInstrumentLedgerService.listPage(page, measuringInstrumentLedger); |
| | |
| | | |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("计量器具台账-新增") |
| | | @Operation(summary = "计量器具台账-新增") |
| | | @Log(title = "计量器具台账-新增", businessType = BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) throws IOException { |
| | |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("计量器具台账-修改") |
| | | @Operation(summary = "计量器具台账-修改") |
| | | @Log(title = "计量器具台账-修改", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("计量器具台账-删除") |
| | | @Operation(summary = "计量器具台账-删除") |
| | | @Log(title = "计量器具台账-删除", businessType = BusinessType.DELETE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | |
| | | } |
| | | |
| | | @PostMapping("/verifying") |
| | | @ApiOperation("计量器具台账-检定") |
| | | @Operation(summary = "计量器具台账-检定") |
| | | @Log(title = "计量器具台账-检定", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult verifying(@RequestBody MeasuringInstrumentLedgerRecordDTO measuringInstrumentLedgerRecordDTO) throws IOException { |
| | | boolean update = measuringInstrumentLedgerService.verifying(measuringInstrumentLedgerRecordDTO); |
| | | public AjaxResult verifying(@RequestBody MeasuringInstrumentLedgerDto measuringInstrumentLedger) throws IOException { |
| | | boolean update = measuringInstrumentLedgerService.verifying(measuringInstrumentLedger); |
| | | return update ? AjaxResult.success("检定成功") : AjaxResult.error("检定失败"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Log(title = "导出计量器具台账", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出计量器具台账") |
| | | @Operation(summary = "导出计量器具台账") |
| | | public void export(HttpServletResponse response) { |
| | | measuringInstrumentLedgerService.export( response); |
| | | } |