|
|
@@ -0,0 +1,152 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
|
|
+ *
|
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
|
+ * modification, are permitted provided that the following conditions are met:
|
|
|
+ *
|
|
|
+ * Redistributions of source code must retain the above copyright notice,
|
|
|
+ * this list of conditions and the following disclaimer.
|
|
|
+ * Redistributions in binary form must reproduce the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer in the
|
|
|
+ * documentation and/or other materials provided with the distribution.
|
|
|
+ * Neither the name of the dreamlu.net developer nor the names of its
|
|
|
+ * contributors may be used to endorse or promote products derived from
|
|
|
+ * this software without specific prior written permission.
|
|
|
+ * Author: Chill 庄骞 (smallchill@163.com)
|
|
|
+ */
|
|
|
+package org.springblade.los.documentTypes.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.los.basic.fees.entity.BFees;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import org.springblade.los.documentTypes.entity.BDocumentTypes;
|
|
|
+import org.springblade.los.documentTypes.vo.BDocumentTypesVO;
|
|
|
+import org.springblade.los.documentTypes.service.IBDocumentTypesService;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 业务-单证中心分组,各分公司独立 控制器
|
|
|
+ *
|
|
|
+ * @author BladeX
|
|
|
+ * @since 2025-08-26
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/bdocumenttypes")
|
|
|
+@Api(value = "业务-单证中心分组,各分公司独立", tags = "业务-单证中心分组,各分公司独立接口")
|
|
|
+public class BDocumentTypesController extends BladeController {
|
|
|
+
|
|
|
+ private final IBDocumentTypesService bDocumentTypesService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "详情", notes = "传入bDocumentTypes")
|
|
|
+ public R<BDocumentTypes> detail(BDocumentTypes bDocumentTypes) {
|
|
|
+ BDocumentTypes detail = bDocumentTypesService.getOne(Condition.getQueryWrapper(bDocumentTypes));
|
|
|
+ return R.data(detail);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入bDocumentTypes")
|
|
|
+ public R<IPage<BDocumentTypes>> list(BDocumentTypes bDocumentTypes, Query query) {
|
|
|
+ IPage<BDocumentTypes> pages = bDocumentTypesService.page(Condition.getPage(query), Condition.getQueryWrapper(bDocumentTypes));
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 自定义分页 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入bDocumentTypes")
|
|
|
+ public R<IPage<BDocumentTypesVO>> page(BDocumentTypesVO bDocumentTypes, Query query) {
|
|
|
+ IPage<BDocumentTypesVO> pages = bDocumentTypesService.selectBDocumentTypesPage(Condition.getPage(query), bDocumentTypes);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @GetMapping("/listAll")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入bDocumentTypes")
|
|
|
+ public R<List<BDocumentTypes>> listAll(BDocumentTypes doc) {
|
|
|
+ LambdaQueryWrapper<BDocumentTypes> lqw = new LambdaQueryWrapper<>(); // Condition.getQueryWrapper(bDocumentTypes)
|
|
|
+ lqw.eq(BDocumentTypes::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BDocumentTypes::getIsDeleted, 0)
|
|
|
+ .eq(ObjectUtils.isNotNull(doc.getBusinessType()), BDocumentTypes::getBusinessType, doc.getBusinessType())
|
|
|
+ .eq(ObjectUtils.isNotNull(doc.getClassifyCode()), BDocumentTypes::getClassifyCode, doc.getClassifyCode())
|
|
|
+ .eq(ObjectUtils.isNotNull(doc.getTypeName()), BDocumentTypes::getTypeName, doc.getTypeName())
|
|
|
+ .eq(ObjectUtils.isNotNull(doc.getGroupCode()), BDocumentTypes::getGroupCode, doc.getGroupCode());
|
|
|
+ lqw.orderByAsc(BDocumentTypes::getLineNo);
|
|
|
+
|
|
|
+ List<BDocumentTypes> pages = bDocumentTypesService.list(lqw);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "新增", notes = "传入bDocumentTypes")
|
|
|
+ public R save(@Valid @RequestBody BDocumentTypes bDocumentTypes) {
|
|
|
+ return R.status(bDocumentTypesService.save(bDocumentTypes));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "修改", notes = "传入bDocumentTypes")
|
|
|
+ public R update(@Valid @RequestBody BDocumentTypes bDocumentTypes) {
|
|
|
+ return R.status(bDocumentTypesService.updateById(bDocumentTypes));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增或修改 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @PostMapping("/submit")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "新增或修改", notes = "传入bDocumentTypes")
|
|
|
+ public R submit(@Valid @RequestBody BDocumentTypes bDocumentTypes) {
|
|
|
+ return R.status(bDocumentTypesService.saveOrUpdate(bDocumentTypes));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除 业务-单证中心分组,各分公司独立
|
|
|
+ */
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "删除", notes = "传入ids")
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ return R.status(bDocumentTypesService.removeByIds(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|