1. 新增帆软报表导入功能
2. 新增物料扩展牌号属性功能
This commit is contained in:
35
sql/dm/2026-01-14帆软报表上传菜单.sql
Normal file
35
sql/dm/2026-01-14帆软报表上传菜单.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
-- 帆软报表上传菜单(父级 1965981757204459521),请根据需要调整排序/图标
|
||||
|
||||
-- DM8 兼容写法:匿名块 + 变量赋值 + SELECT ... INTO
|
||||
BEGIN
|
||||
DECLARE
|
||||
v_parent_id BIGINT;
|
||||
v_menu_id BIGINT;
|
||||
v_button_id BIGINT;
|
||||
BEGIN
|
||||
v_parent_id := 1965981757204459521;
|
||||
|
||||
-- 计算主菜单 ID(非自增:使用当前最大值 + 1)
|
||||
SELECT COALESCE(MAX(id), 0) + 1 INTO v_menu_id FROM system_menu;
|
||||
|
||||
INSERT INTO system_menu(
|
||||
id, name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
) VALUES (
|
||||
v_menu_id, '帆软报表上传', '', 2, 0, v_parent_id,
|
||||
'fine-report-upload', 'ep:upload-filled', 'base/fineReportUpload/index', 0, 'FineReportUpload'
|
||||
);
|
||||
|
||||
-- 计算按钮 ID(非自增:再取最大值 + 1)
|
||||
SELECT COALESCE(MAX(id), 0) + 1 INTO v_button_id FROM system_menu;
|
||||
|
||||
INSERT INTO system_menu(
|
||||
id, name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
) VALUES (
|
||||
v_button_id, '帆软报表上传-上传', 'base:fine-report-template:upload', 3, 1, v_menu_id,
|
||||
'', '', '', 0
|
||||
);
|
||||
END;
|
||||
END;
|
||||
/
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.base.api.materialgradeext;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtPageReqDTO;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtRespDTO;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtSaveReqDTO;
|
||||
import com.zt.plat.module.base.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 物料牌号扩展")
|
||||
public interface MaterialGradeExtApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/material-grade-ext";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "创建物料牌号扩展")
|
||||
CommonResult<MaterialGradeExtRespDTO> create(@Valid @RequestBody MaterialGradeExtSaveReqDTO reqDTO);
|
||||
|
||||
@PutMapping(PREFIX + "/update")
|
||||
@Operation(summary = "更新物料牌号扩展")
|
||||
CommonResult<Boolean> update(@Valid @RequestBody MaterialGradeExtSaveReqDTO reqDTO);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete")
|
||||
@Operation(summary = "删除物料牌号扩展")
|
||||
CommonResult<Boolean> delete(@RequestParam("id") Long id);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete-list")
|
||||
@Operation(summary = "批量删除物料牌号扩展")
|
||||
CommonResult<Boolean> deleteList(@RequestBody List<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得物料牌号扩展")
|
||||
CommonResult<MaterialGradeExtRespDTO> get(@RequestParam("id") Long id);
|
||||
|
||||
@PostMapping(PREFIX + "/page")
|
||||
@Operation(summary = "获得物料牌号扩展分页")
|
||||
CommonResult<PageResult<MaterialGradeExtRespDTO>> getPage(@Valid @RequestBody MaterialGradeExtPageReqDTO pageReqDTO);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.base.api.materialgradeext.dto;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Data
|
||||
public class MaterialGradeExtPageReqDTO extends PageParam {
|
||||
|
||||
private String companyCode;
|
||||
private String companyName;
|
||||
private String materialCode;
|
||||
private String materialName;
|
||||
private String chineseBrand;
|
||||
private String englishBrand;
|
||||
private String specificationModel;
|
||||
private String lineType;
|
||||
private String packageDesc;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zt.plat.module.base.api.materialgradeext.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class MaterialGradeExtRespDTO {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
private String companyCode;
|
||||
private String companyName;
|
||||
private String materialCode;
|
||||
private String materialName;
|
||||
private String chineseBrand;
|
||||
private String englishBrand;
|
||||
private String specificationModel;
|
||||
private String lineType;
|
||||
private String packageDesc;
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.zt.plat.module.base.api.materialgradeext.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MaterialGradeExtSaveReqDTO {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公司编码")
|
||||
private String companyCode;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "中文牌号")
|
||||
private String chineseBrand;
|
||||
|
||||
@Schema(description = "英文牌号")
|
||||
private String englishBrand;
|
||||
|
||||
@Schema(description = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
@Schema(description = "线别")
|
||||
private String lineType;
|
||||
|
||||
@Schema(description = "包装描述")
|
||||
private String packageDesc;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zt.plat.module.base.api.materialgradeext;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtPageReqDTO;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtRespDTO;
|
||||
import com.zt.plat.module.base.api.materialgradeext.dto.MaterialGradeExtSaveReqDTO;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtSaveReqVO;
|
||||
import com.zt.plat.module.base.service.materialgradeext.MaterialGradeExtService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class MaterialGradeExtApiImpl implements MaterialGradeExtApi {
|
||||
|
||||
@Resource
|
||||
private MaterialGradeExtService materialGradeExtService;
|
||||
|
||||
@Override
|
||||
public CommonResult<MaterialGradeExtRespDTO> create(MaterialGradeExtSaveReqDTO reqDTO) {
|
||||
MaterialGradeExtRespVO respVO = materialGradeExtService.create(BeanUtils.toBean(reqDTO, MaterialGradeExtSaveReqVO.class));
|
||||
return success(BeanUtils.toBean(respVO, MaterialGradeExtRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> update(MaterialGradeExtSaveReqDTO reqDTO) {
|
||||
materialGradeExtService.update(BeanUtils.toBean(reqDTO, MaterialGradeExtSaveReqVO.class));
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> delete(Long id) {
|
||||
materialGradeExtService.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteList(List<Long> ids) {
|
||||
materialGradeExtService.deleteByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<MaterialGradeExtRespDTO> get(Long id) {
|
||||
MaterialGradeExtRespVO respVO = materialGradeExtService.get(id);
|
||||
return success(BeanUtils.toBean(respVO, MaterialGradeExtRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<MaterialGradeExtRespDTO>> getPage(@RequestBody MaterialGradeExtPageReqDTO pageReqDTO) {
|
||||
MaterialGradeExtPageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, MaterialGradeExtPageReqVO.class);
|
||||
PageResult<MaterialGradeExtRespVO> pageResult = materialGradeExtService.getPage(pageReqVO);
|
||||
PageResult<MaterialGradeExtRespDTO> dtoResult = BeanUtils.toBean(pageResult, MaterialGradeExtRespDTO.class);
|
||||
return success(dtoResult);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zt.plat.module.base.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 帆软上传配置
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "finereport.upload")
|
||||
public class FineReportUploadProperties {
|
||||
|
||||
/**
|
||||
* 上传目标地址(sidecar 内部 Service),默认指向集群内 fine-report-upload 服务
|
||||
*/
|
||||
private String url = "http://fine-report-upload.ns-f16a3067ca7b434aad127d15eac82503.svc.cluster.local:8081/upload";
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
package com.zt.plat.module.base.controller.admin.finereport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FineReportUploadRespVO {
|
||||
|
||||
@Schema(description = "文件名")
|
||||
private String filename;
|
||||
|
||||
@Schema(description = "上传字节数")
|
||||
private Long bytes;
|
||||
|
||||
@Schema(description = "目标路径")
|
||||
private String targetPath;
|
||||
|
||||
@Schema(description = "sidecar 返回的状态")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.zt.plat.module.base.controller.admin.materialgradeext;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.datapermission.core.annotation.CompanyDataPermissionIgnore;
|
||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialgradeext.vo.MaterialGradeExtSaveReqVO;
|
||||
import com.zt.plat.module.base.service.materialgradeext.MaterialGradeExtService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 物料牌号扩展")
|
||||
@RestController
|
||||
@RequestMapping("/base/material-grade-ext")
|
||||
@Validated
|
||||
@CompanyDataPermissionIgnore
|
||||
@DeptDataPermissionIgnore
|
||||
public class MaterialGradeExtController {
|
||||
|
||||
@Resource
|
||||
private MaterialGradeExtService materialGradeExtService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料牌号扩展")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:create')")
|
||||
public CommonResult<MaterialGradeExtRespVO> create(@Valid @RequestBody MaterialGradeExtSaveReqVO reqVO) {
|
||||
return success(materialGradeExtService.create(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料牌号扩展")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody MaterialGradeExtSaveReqVO reqVO) {
|
||||
materialGradeExtService.update(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料牌号扩展")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
materialGradeExtService.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除物料牌号扩展")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:delete')")
|
||||
public CommonResult<Boolean> deleteList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialGradeExtService.deleteByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料牌号扩展")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:query')")
|
||||
public CommonResult<MaterialGradeExtRespVO> get(@RequestParam("id") Long id) {
|
||||
return success(materialGradeExtService.get(id));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/page", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@Operation(summary = "获得物料牌号扩展分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-grade-ext:query')")
|
||||
public CommonResult<PageResult<MaterialGradeExtRespVO>> getPage(@Valid @RequestBody(required = false) MaterialGradeExtPageReqVO pageReqVO) {
|
||||
if (pageReqVO == null) {
|
||||
pageReqVO = new MaterialGradeExtPageReqVO();
|
||||
}
|
||||
return success(materialGradeExtService.getPage(pageReqVO));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user