| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.gd.common.GenericConverter; |
| | | import org.sxkj.gd.orderdata.dto.GdDataObjectionDTO; |
| | | import org.sxkj.gd.orderdata.entity.GdDataObjectionEntity; |
| | | import org.sxkj.gd.orderdata.param.GdDataObjectionDetailParam; |
| | | import org.sxkj.gd.orderdata.param.GdDataObjectionPageParam; |
| | | import org.sxkj.gd.orderdata.vo.GdDataObjectionVO; |
| | | import org.sxkj.gd.orderdata.excel.GdDataObjectionExcel; |
| | | import org.sxkj.gd.orderdata.wrapper.GdDataObjectionWrapper; |
| | | import org.sxkj.gd.orderdata.service.IGdDataObjectionService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 数据异议申请表 控制器 |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入gdDataObjection") |
| | | public R<GdDataObjectionVO> detail(GdDataObjectionEntity gdDataObjection) { |
| | | GdDataObjectionEntity detail = gdDataObjectionService.getOne(Condition.getQueryWrapper(gdDataObjection)); |
| | | public R<GdDataObjectionVO> detail(GdDataObjectionDetailParam gdDataObjection) { |
| | | GdDataObjectionEntity detail = gdDataObjectionService.getOne(Condition.getQueryWrapper(GenericConverter.convert(gdDataObjection, GdDataObjectionEntity.class))); |
| | | return R.data(GdDataObjectionWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 数据异议申请表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入gdDataObjection") |
| | | public R<IPage<GdDataObjectionVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdDataObjection, Query query) { |
| | | IPage<GdDataObjectionEntity> pages = gdDataObjectionService.page(Condition.getPage(query), Condition.getQueryWrapper(gdDataObjection, GdDataObjectionEntity.class)); |
| | | return R.data(GdDataObjectionWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入gdDataObjection") |
| | | public R<IPage<GdDataObjectionVO>> page(GdDataObjectionVO gdDataObjection, Query query) { |
| | | public R<IPage<GdDataObjectionVO>> page(GdDataObjectionPageParam gdDataObjection, Query query) { |
| | | IPage<GdDataObjectionVO> pages = gdDataObjectionService.selectGdDataObjectionPage(Condition.getPage(query), gdDataObjection); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 数据异议申请表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入gdDataObjection") |
| | | public R save(@Valid @RequestBody GdDataObjectionEntity gdDataObjection) { |
| | | return R.status(gdDataObjectionService.save(gdDataObjection)); |
| | | } |
| | | |
| | | /** |
| | | * 数据异议申请表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入gdDataObjection") |
| | | public R update(@Valid @RequestBody GdDataObjectionEntity gdDataObjection) { |
| | | return R.status(gdDataObjectionService.updateById(gdDataObjection)); |
| | | } |
| | | |
| | | /** |
| | | * 数据异议申请表 新增或修改 |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入gdDataObjection") |
| | | public R submit(@Valid @RequestBody GdDataObjectionEntity gdDataObjection) { |
| | | return R.status(gdDataObjectionService.saveOrUpdate(gdDataObjection)); |
| | | public R submit(@Valid @RequestBody GdDataObjectionDTO gdDataObjectionDTO) { |
| | | return R.status(gdDataObjectionService.saveOrUpdateDataObjection(gdDataObjectionDTO)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @GetMapping("/export-gdDataObjection") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "导出数据", notes = "传入gdDataObjection") |
| | | public void exportGdDataObjection(@ApiIgnore @RequestParam Map<String, Object> gdDataObjection, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<GdDataObjectionEntity> queryWrapper = Condition.getQueryWrapper(gdDataObjection, GdDataObjectionEntity.class); |
| | | // /** |
| | | // * 导出数据 |
| | | // */ |
| | | // @GetMapping("/export-gdDataObjection") |
| | | // @ApiOperationSupport(order = 9) |
| | | // @ApiOperation(value = "导出数据", notes = "传入gdDataObjection") |
| | | // public void exportGdDataObjection(@ApiIgnore @RequestParam Map<String, Object> gdDataObjection, BladeUser bladeUser, HttpServletResponse response) { |
| | | // QueryWrapper<GdDataObjectionEntity> queryWrapper = Condition.getQueryWrapper(gdDataObjection, GdDataObjectionEntity.class); |
| | | //if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(GdDataObjection::getTenantId, bladeUser.getTenantId()); |
| | | //} |
| | | queryWrapper.lambda().eq(GdDataObjectionEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | List<GdDataObjectionExcel> list = gdDataObjectionService.exportGdDataObjection(queryWrapper); |
| | | ExcelUtil.export(response, "数据异议申请表数据" + DateUtil.time(), "数据异议申请表数据表", list, GdDataObjectionExcel.class); |
| | | } |
| | | // queryWrapper.lambda().eq(GdDataObjectionEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | // List<GdDataObjectionExcel> list = gdDataObjectionService.exportGdDataObjection(queryWrapper); |
| | | // ExcelUtil.export(response, "数据异议申请表数据" + DateUtil.time(), "数据异议申请表数据表", list, GdDataObjectionExcel.class); |
| | | // } |
| | | |
| | | } |