erp公司、物料、客商代码生成
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
<artifactId>yudao-module-contract-order-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-erp-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
|
||||
@@ -105,3 +105,7 @@ justauth:
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
|
||||
erp:
|
||||
address: hana-dev.yncic.com
|
||||
sapsys: ZTDEV203
|
||||
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -147,7 +147,7 @@
|
||||
<name>中铜 ZStack 私服</name>
|
||||
<url>http://172.16.46.63:30708/repository/test/</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
@@ -206,9 +206,9 @@
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>chenbowen</id>
|
||||
<id>liss</id>
|
||||
<properties>
|
||||
<config.namespace>chenbowen</config.namespace>
|
||||
<config.namespace>liss</config.namespace>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.erp.enums;
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;// TODO 待办:请将下面的错误码复制到 yudao-module-sply 模块的 ErrorCodeConstants 类中。注意,请给“TODO 补充编号”设置一个错误码编号!!!
|
||||
// ========== ERP客商主数据 TODO 补充编号 ==========
|
||||
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 示例模块 1-001-000-000 ==========
|
||||
ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在");
|
||||
ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_001_000_002, "ERP物料数据不存在");
|
||||
ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.erp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* ContractOrder 模块的启动类
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
//@SpringBootApplication
|
||||
public class ErpServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ErpServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.erp.common.enums;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName oftenEnum
|
||||
* @Description TODO
|
||||
* @Author chen
|
||||
* @Date 2023/9/5
|
||||
**/
|
||||
@Data
|
||||
public class OftenEnum {
|
||||
|
||||
//接口编号枚举
|
||||
public enum FuncnrEnum {
|
||||
公司代码("001"),
|
||||
工厂信息("002"),
|
||||
客商信息("003"),
|
||||
成本中心("004"),
|
||||
内部订单("005"),
|
||||
库位信息("006"),
|
||||
采购组织("007"),
|
||||
销售组织("008"),
|
||||
合同信息("009"),
|
||||
资产卡片("010"),
|
||||
库存信息("011"),
|
||||
辅组编码("012"),
|
||||
生产订单("013"),
|
||||
BOM清单("014"),
|
||||
工艺路线("015"),
|
||||
生产版本("016"),
|
||||
生产投料("017"),
|
||||
生产订单明细("018"),
|
||||
库存明细("019"),
|
||||
发票状态("020"),
|
||||
物料数据("021");
|
||||
|
||||
public String funcnr = null;
|
||||
|
||||
FuncnrEnum(String funcnr) {
|
||||
this.funcnr = funcnr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.erp.common.task;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpCompanyService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @ClassName energyTask
|
||||
* @Description TODO
|
||||
* @Author chen
|
||||
* @Date 2023/9/25
|
||||
**/
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class statisticsTask {
|
||||
|
||||
@Resource
|
||||
private ErpCompanyService erpCompanyService;
|
||||
|
||||
//能源定时每日获取成本配置机台水电数据
|
||||
@Scheduled(cron = "0 0 12 * * ?")
|
||||
@Transactional
|
||||
public void erpCompany(){
|
||||
erpCompanyService.callErpRfcInterface();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCompanyDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpCompanyService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - ERP公司")
|
||||
@RestController
|
||||
@RequestMapping("/admin/erp/company")
|
||||
@Validated
|
||||
public class ErpCompanyController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpCompanyService erpCompanyService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:create')")
|
||||
public CommonResult<ErpCompanyRespVO> createErpCompany(@Valid @RequestBody ErpCompanySaveReqVO createReqVO) {
|
||||
return success(erpCompanyService.createErpCompany(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:update')")
|
||||
public CommonResult<Boolean> updateErpCompany(@Valid @RequestBody ErpCompanySaveReqVO updateReqVO) {
|
||||
erpCompanyService.updateErpCompany(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP公司")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:delete')")
|
||||
public CommonResult<Boolean> deleteErpCompany(@RequestParam("id") Long id) {
|
||||
erpCompanyService.deleteErpCompany(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:delete')")
|
||||
public CommonResult<Boolean> deleteErpCompanyList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpCompanyService.deleteErpCompanyListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP公司")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:query')")
|
||||
public CommonResult<ErpCompanyRespVO> getErpCompany(@RequestParam("id") Long id) {
|
||||
ErpCompanyDO erpCompany = erpCompanyService.getErpCompany(id);
|
||||
return success(BeanUtils.toBean(erpCompany, ErpCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP公司分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:query')")
|
||||
public CommonResult<PageResult<ErpCompanyRespVO>> getErpCompanyPage(@Valid ErpCompanyPageReqVO pageReqVO) {
|
||||
PageResult<ErpCompanyDO> pageResult = erpCompanyService.getErpCompanyPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP公司 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpCompanyExcel(@Valid ErpCompanyPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpCompanyDO> list = erpCompanyService.getErpCompanyPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP公司.xls", "数据", ErpCompanyRespVO.class,
|
||||
BeanUtils.toBean(list, ErpCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/callErpRfcInterface")
|
||||
@Operation(summary = "定时获得erp更新公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:query')")
|
||||
public void callErpRfcInterface() {
|
||||
erpCompanyService.callErpRfcInterface();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* ERP 控制器
|
||||
*
|
||||
* @author ERP Module
|
||||
*/
|
||||
@Tag(name = "管理后台 - ERP")
|
||||
@RestController
|
||||
@RequestMapping("/admin/erp/erp")
|
||||
public class ErpController {
|
||||
|
||||
@GetMapping("/hello")
|
||||
@Operation(summary = "Hello ERP")
|
||||
public CommonResult<String> hello() {
|
||||
return success("Hello, ERP!");
|
||||
}
|
||||
|
||||
@GetMapping("/info")
|
||||
@Operation(summary = "ERP 模块信息")
|
||||
public CommonResult<String> info() {
|
||||
return success("ERP 模块已成功创建并运行");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpCustomerService;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - ERP客商信息")
|
||||
@RestController
|
||||
@RequestMapping("/erp/customer")
|
||||
@Validated
|
||||
public class ErpCustomerController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpCustomerService erpCustomerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP客商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
||||
public CommonResult<ErpCustomerRespVO> createErpCustomer(@Valid @RequestBody ErpCustomerSaveReqVO createReqVO) {
|
||||
return success(erpCustomerService.createErpCustomer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP客商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:update')")
|
||||
public CommonResult<Boolean> updateErpCustomer(@Valid @RequestBody ErpCustomerSaveReqVO updateReqVO) {
|
||||
erpCustomerService.updateErpCustomer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP客商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:delete')")
|
||||
public CommonResult<Boolean> deleteErpCustomer(@RequestParam("id") Long id) {
|
||||
erpCustomerService.deleteErpCustomer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP客商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:delete')")
|
||||
public CommonResult<Boolean> deleteErpCustomerList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpCustomerService.deleteErpCustomerListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP客商主数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:query')")
|
||||
public CommonResult<ErpCustomerRespVO> getErpCustomer(@RequestParam("id") Long id) {
|
||||
ErpCustomerDO erpCustomer = erpCustomerService.getErpCustomer(id);
|
||||
return success(BeanUtils.toBean(erpCustomer, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP客商主数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:query')")
|
||||
public CommonResult<PageResult<ErpCustomerRespVO>> getErpCustomerPage(@Valid ErpCustomerPageReqVO pageReqVO) {
|
||||
PageResult<ErpCustomerDO> pageResult = erpCustomerService.getErpCustomerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP客商主数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpCustomerExcel(@Valid ErpCustomerPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpCustomerDO> list = erpCustomerService.getErpCustomerPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP客商主数据.xls", "数据", ErpCustomerRespVO.class,
|
||||
BeanUtils.toBean(list, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpMaterialService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料信息")
|
||||
@RestController
|
||||
@RequestMapping("/erp/material")
|
||||
@Validated
|
||||
public class ErpMaterialController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpMaterialService erpMaterialService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP物料数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
||||
public CommonResult<ErpMaterialRespVO> createErpMaterial(@Valid @RequestBody ErpMaterialSaveReqVO createReqVO) {
|
||||
return success(erpMaterialService.createErpMaterial(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP物料数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:update')")
|
||||
public CommonResult<Boolean> updateErpMaterial(@Valid @RequestBody ErpMaterialSaveReqVO updateReqVO) {
|
||||
erpMaterialService.updateErpMaterial(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP物料数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:delete')")
|
||||
public CommonResult<Boolean> deleteErpMaterial(@RequestParam("id") Long id) {
|
||||
erpMaterialService.deleteErpMaterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP物料数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:delete')")
|
||||
public CommonResult<Boolean> deleteErpMaterialList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpMaterialService.deleteErpMaterialListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP物料数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:query')")
|
||||
public CommonResult<ErpMaterialRespVO> getErpMaterial(@RequestParam("id") Long id) {
|
||||
ErpMaterialDO erpMaterial = erpMaterialService.getErpMaterial(id);
|
||||
return success(BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP物料数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:query')")
|
||||
public CommonResult<PageResult<ErpMaterialRespVO>> getErpMaterialPage(@Valid ErpMaterialPageReqVO pageReqVO) {
|
||||
PageResult<ErpMaterialDO> pageResult = erpMaterialService.getErpMaterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP物料数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpMaterialExcel(@Valid ErpMaterialPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpMaterialDO> list = erpMaterialService.getErpMaterialPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP物料数据.xls", "数据", ErpMaterialRespVO.class,
|
||||
BeanUtils.toBean(list, ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司分页 Request VO")
|
||||
@Data
|
||||
public class ErpCompanyPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "公司名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "公司编码;唯一")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "本位币")
|
||||
private String currency;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpCompanyRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4807")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("公司名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "公司编码;唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("公司编码;唯一")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "本位币", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("本位币")
|
||||
private String currency;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpCompanySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4807")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "公司名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "公司编码;唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "公司编码;唯一不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "本位币", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "本位币不能为空")
|
||||
private String currency;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP客商主数据分页 Request VO")
|
||||
@Data
|
||||
public class ErpCustomerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "账户组")
|
||||
private String accountGroup;
|
||||
|
||||
@Schema(description = "简称")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "中铝编号")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createDate;
|
||||
|
||||
@Schema(description = "修改日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] repairDate;
|
||||
|
||||
@Schema(description = "归档标识")
|
||||
private String isGiveback;
|
||||
|
||||
@Schema(description = "冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", example = "2")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP客商主数据 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpCustomerRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30882")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "账户组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("账户组")
|
||||
private String accountGroup;
|
||||
|
||||
@Schema(description = "简称")
|
||||
@ExcelProperty("简称")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "中铝编号")
|
||||
@ExcelProperty("中铝编号")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@Schema(description = "修改日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("修改日期")
|
||||
private LocalDateTime repairDate;
|
||||
|
||||
@Schema(description = "归档标识")
|
||||
@ExcelProperty("归档标识")
|
||||
private String isGiveback;
|
||||
|
||||
@Schema(description = "冻结标识")
|
||||
@ExcelProperty("冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP客商主数据新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpCustomerSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30882")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "编码不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "账户组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "账户组不能为空")
|
||||
private String accountGroup;
|
||||
|
||||
@Schema(description = "简称")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "中铝编号")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建日期不能为空")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@Schema(description = "修改日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "修改日期不能为空")
|
||||
private LocalDateTime repairDate;
|
||||
|
||||
@Schema(description = "归档标识")
|
||||
private String isGiveback;
|
||||
|
||||
@Schema(description = "冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料数据分页 Request VO")
|
||||
@Data
|
||||
public class ErpMaterialPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "中铜物料编码;系统使用时使用该编码")
|
||||
private String downCenterNumber;
|
||||
|
||||
@Schema(description = "中铝物料编码")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createDate;
|
||||
|
||||
@Schema(description = "物料类型", example = "2")
|
||||
private String materialType;
|
||||
|
||||
@Schema(description = "物料大类组")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] materialGroupDate;
|
||||
|
||||
@Schema(description = "外部物料小类组")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] externalMaterialGroupDate;
|
||||
|
||||
@Schema(description = "计量单位编码")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计量单位描述")
|
||||
private String unitDescription;
|
||||
|
||||
@Schema(description = "物料类型描述")
|
||||
private String materialTypeDescription;
|
||||
|
||||
@Schema(description = "物料组描述")
|
||||
private String materialGroupDescription;
|
||||
|
||||
@Schema(description = "外部物料小类组描述")
|
||||
private String externalMaterialGroupDescription;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料长描述")
|
||||
private String materialLengthDescription;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料数据 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpMaterialRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2038")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "中铜物料编码;系统使用时使用该编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("中铜物料编码;系统使用时使用该编码")
|
||||
private String downCenterNumber;
|
||||
|
||||
@Schema(description = "中铝物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("中铝物料编码")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@Schema(description = "物料类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("物料类型")
|
||||
private String materialType;
|
||||
|
||||
@Schema(description = "物料大类组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料大类组")
|
||||
private String materialGroupDate;
|
||||
|
||||
@Schema(description = "外部物料小类组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("外部物料小类组")
|
||||
private String externalMaterialGroupDate;
|
||||
|
||||
@Schema(description = "计量单位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计量单位编码")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计量单位描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计量单位描述")
|
||||
private String unitDescription;
|
||||
|
||||
@Schema(description = "物料类型描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料类型描述")
|
||||
private String materialTypeDescription;
|
||||
|
||||
@Schema(description = "物料组描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料组描述")
|
||||
private String materialGroupDescription;
|
||||
|
||||
@Schema(description = "外部物料小类组描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("外部物料小类组描述")
|
||||
private String externalMaterialGroupDescription;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
@ExcelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料长描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料长描述")
|
||||
private String materialLengthDescription;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料数据新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpMaterialSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2038")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "中铜物料编码;系统使用时使用该编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "中铜物料编码;系统使用时使用该编码不能为空")
|
||||
private String downCenterNumber;
|
||||
|
||||
@Schema(description = "中铝物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "中铝物料编码不能为空")
|
||||
private String centerNumber;
|
||||
|
||||
@Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建日期不能为空")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
@Schema(description = "物料类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "物料类型不能为空")
|
||||
private String materialType;
|
||||
|
||||
@Schema(description = "物料大类组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料大类组不能为空")
|
||||
private String materialGroupDate;
|
||||
|
||||
@Schema(description = "外部物料小类组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "外部物料小类组不能为空")
|
||||
private String externalMaterialGroupDate;
|
||||
|
||||
@Schema(description = "计量单位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "计量单位编码不能为空")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "计量单位描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "计量单位描述不能为空")
|
||||
private String unitDescription;
|
||||
|
||||
@Schema(description = "物料类型描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料类型描述不能为空")
|
||||
private String materialTypeDescription;
|
||||
|
||||
@Schema(description = "物料组描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料组描述不能为空")
|
||||
private String materialGroupDescription;
|
||||
|
||||
@Schema(description = "外部物料小类组描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "外部物料小类组描述不能为空")
|
||||
private String externalMaterialGroupDescription;
|
||||
|
||||
@Schema(description = "物料名称", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料长描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料长描述不能为空")
|
||||
private String materialLengthDescription;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* ERP公司 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_cpn")
|
||||
@KeySequence("sply_erp_cpn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpCompanyDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 公司编码;唯一
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
/**
|
||||
* 本位币
|
||||
*/
|
||||
@TableField("CUR")
|
||||
private String currency;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* ERP客商主数据 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_cstm")
|
||||
@KeySequence("sply_erp_cstm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpCustomerDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 账户组
|
||||
*/
|
||||
@TableField("ACCT_GRP")
|
||||
private String accountGroup;
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
@TableField("DSP")
|
||||
private String description;
|
||||
/**
|
||||
* 中铝编号
|
||||
*/
|
||||
@TableField("CTR_NUM")
|
||||
private String centerNumber;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@TableField("CRT_DT")
|
||||
private LocalDateTime createDate;
|
||||
/**
|
||||
* 修改日期
|
||||
*/
|
||||
@TableField("RPR_DT")
|
||||
private LocalDateTime repairDate;
|
||||
/**
|
||||
* 归档标识
|
||||
*/
|
||||
@TableField("IS_GIV")
|
||||
private String isGiveback;
|
||||
/**
|
||||
* 冻结标识
|
||||
*/
|
||||
@TableField("IS_PRVS")
|
||||
private String isProvisional;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* ERP物料数据 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_mtrl")
|
||||
@KeySequence("sply_erp_mtrl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpMaterialDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 中铜物料编码;系统使用时使用该编码
|
||||
*/
|
||||
@TableField("DOWN_CTR_NUM")
|
||||
private String downCenterNumber;
|
||||
/**
|
||||
* 中铝物料编码
|
||||
*/
|
||||
@TableField("CTR_NUM")
|
||||
private String centerNumber;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@TableField("CRT_DT")
|
||||
private LocalDateTime createDate;
|
||||
/**
|
||||
* 物料类型
|
||||
*/
|
||||
@TableField("MTRL_TP")
|
||||
private String materialType;
|
||||
/**
|
||||
* 物料大类组
|
||||
*/
|
||||
@TableField("MTRL_GRP_DT")
|
||||
private String materialGroupDate;
|
||||
/**
|
||||
* 外部物料小类组
|
||||
*/
|
||||
@TableField("EXT_MTRL_GRP_DT")
|
||||
private String externalMaterialGroupDate;
|
||||
/**
|
||||
* 计量单位编码
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
/**
|
||||
* 计量单位描述
|
||||
*/
|
||||
@TableField("UNT_DSP")
|
||||
private String unitDescription;
|
||||
/**
|
||||
* 物料类型描述
|
||||
*/
|
||||
@TableField("MTRL_TP_DSP")
|
||||
private String materialTypeDescription;
|
||||
/**
|
||||
* 物料组描述
|
||||
*/
|
||||
@TableField("MTRL_GRP_DSP")
|
||||
private String materialGroupDescription;
|
||||
/**
|
||||
* 外部物料小类组描述
|
||||
*/
|
||||
@TableField("EXT_MTRL_GRP_DSP")
|
||||
private String externalMaterialGroupDescription;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 物料长描述
|
||||
*/
|
||||
@TableField("MTRL_LEN_DSP")
|
||||
private String materialLengthDescription;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCompanyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP公司 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpCompanyMapper extends BaseMapperX<ErpCompanyDO> {
|
||||
|
||||
default PageResult<ErpCompanyDO> selectPage(ErpCompanyPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCompanyDO>()
|
||||
.likeIfPresent(ErpCompanyDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpCompanyDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(ErpCompanyDO::getCurrency, reqVO.getCurrency())
|
||||
.orderByDesc(ErpCompanyDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP客商主数据 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpCustomerMapper extends BaseMapperX<ErpCustomerDO> {
|
||||
|
||||
default PageResult<ErpCustomerDO> selectPage(ErpCustomerPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCustomerDO>()
|
||||
.eqIfPresent(ErpCustomerDO::getNumber, reqVO.getNumber())
|
||||
.likeIfPresent(ErpCustomerDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpCustomerDO::getAccountGroup, reqVO.getAccountGroup())
|
||||
.eqIfPresent(ErpCustomerDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(ErpCustomerDO::getCenterNumber, reqVO.getCenterNumber())
|
||||
.betweenIfPresent(ErpCustomerDO::getCreateDate, reqVO.getCreateDate())
|
||||
.betweenIfPresent(ErpCustomerDO::getRepairDate, reqVO.getRepairDate())
|
||||
.eqIfPresent(ErpCustomerDO::getIsGiveback, reqVO.getIsGiveback())
|
||||
.eqIfPresent(ErpCustomerDO::getIsProvisional, reqVO.getIsProvisional())
|
||||
.eqIfPresent(ErpCustomerDO::getType, reqVO.getType())
|
||||
.orderByDesc(ErpCustomerDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP物料数据 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
|
||||
|
||||
default PageResult<ErpMaterialDO> selectPage(ErpMaterialPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpMaterialDO>()
|
||||
.eqIfPresent(ErpMaterialDO::getDownCenterNumber, reqVO.getDownCenterNumber())
|
||||
.eqIfPresent(ErpMaterialDO::getCenterNumber, reqVO.getCenterNumber())
|
||||
.betweenIfPresent(ErpMaterialDO::getCreateDate, reqVO.getCreateDate())
|
||||
.eqIfPresent(ErpMaterialDO::getMaterialType, reqVO.getMaterialType())
|
||||
.betweenIfPresent(ErpMaterialDO::getMaterialGroupDate, reqVO.getMaterialGroupDate())
|
||||
.betweenIfPresent(ErpMaterialDO::getExternalMaterialGroupDate, reqVO.getExternalMaterialGroupDate())
|
||||
.eqIfPresent(ErpMaterialDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(ErpMaterialDO::getUnitDescription, reqVO.getUnitDescription())
|
||||
.eqIfPresent(ErpMaterialDO::getMaterialTypeDescription, reqVO.getMaterialTypeDescription())
|
||||
.eqIfPresent(ErpMaterialDO::getMaterialGroupDescription, reqVO.getMaterialGroupDescription())
|
||||
.eqIfPresent(ErpMaterialDO::getExternalMaterialGroupDescription, reqVO.getExternalMaterialGroupDescription())
|
||||
.likeIfPresent(ErpMaterialDO::getMaterialName, reqVO.getMaterialName())
|
||||
.eqIfPresent(ErpMaterialDO::getMaterialLengthDescription, reqVO.getMaterialLengthDescription())
|
||||
.orderByDesc(ErpMaterialDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.erp.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import cn.iocoder.yudao.module.infra.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
|
||||
/**
|
||||
* Template 模块的 Security 配置
|
||||
*/
|
||||
@Configuration("erpSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/webjars/**").permitAll()
|
||||
.requestMatchers("/swagger-ui").permitAll()
|
||||
.requestMatchers("/swagger-ui/**").permitAll();
|
||||
// Druid 监控
|
||||
registry.requestMatchers("/druid/**").permitAll();
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.requestMatchers("/actuator").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll();
|
||||
// RPC 服务的安全配置
|
||||
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCompanyDO;
|
||||
import jakarta.validation.*;
|
||||
|
||||
/**
|
||||
* ERP公司 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpCompanyService {
|
||||
|
||||
/**
|
||||
* 创建ERP公司
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpCompanyRespVO createErpCompany(@Valid ErpCompanySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP公司
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpCompany(@Valid ErpCompanySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP公司
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpCompany(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP公司
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpCompanyListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP公司
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP公司
|
||||
*/
|
||||
ErpCompanyDO getErpCompany(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP公司分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP公司分页
|
||||
*/
|
||||
PageResult<ErpCompanyDO> getErpCompanyPage(ErpCompanyPageReqVO pageReqVO);
|
||||
|
||||
void callErpRfcInterface();
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.common.enums.OftenEnum;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCompanyDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCompanyMapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_COMPANY_NOT_EXISTS;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
/**
|
||||
* ERP公司 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
|
||||
@Value("${erp.address}")
|
||||
private String erpAddress;
|
||||
|
||||
@Value("${erp.sapsys}")
|
||||
private String sapsys;
|
||||
|
||||
@Resource
|
||||
private ErpCompanyMapper erpCompanyMapper;
|
||||
|
||||
@Override
|
||||
public ErpCompanyRespVO createErpCompany(ErpCompanySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpCompanyDO erpCompany = BeanUtils.toBean(createReqVO, ErpCompanyDO.class);
|
||||
erpCompanyMapper.insert(erpCompany);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpCompany, ErpCompanyRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpCompany(ErpCompanySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpCompanyExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpCompanyDO updateObj = BeanUtils.toBean(updateReqVO, ErpCompanyDO.class);
|
||||
erpCompanyMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCompany(Long id) {
|
||||
// 校验存在
|
||||
validateErpCompanyExists(id);
|
||||
// 删除
|
||||
erpCompanyMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCompanyListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpCompanyExists(ids);
|
||||
// 删除
|
||||
erpCompanyMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpCompanyExists(List<Long> ids) {
|
||||
List<ErpCompanyDO> list = erpCompanyMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_COMPANY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpCompanyExists(Long id) {
|
||||
if (erpCompanyMapper.selectById(id) == null) {
|
||||
throw exception(ERP_COMPANY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpCompanyDO getErpCompany(Long id) {
|
||||
return erpCompanyMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpCompanyDO> getErpCompanyPage(ErpCompanyPageReqVO pageReqVO) {
|
||||
return erpCompanyMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callErpRfcInterface() {
|
||||
try {
|
||||
// 构建完整URL
|
||||
String url = "http://" + erpAddress + "/api/rfc/get";
|
||||
// 构建请求参数
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("sapsys", sapsys);
|
||||
requestBody.put("funcnr", OftenEnum.FuncnrEnum.公司代码.funcnr); // 获取枚举值
|
||||
|
||||
// 设置请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
// 创建HTTP请求实体
|
||||
HttpEntity<String> requestEntity = new HttpEntity<>(requestBody.toJSONString(), headers);
|
||||
|
||||
// 发送POST请求
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
|
||||
|
||||
// 解析响应结果
|
||||
JSONObject jsonResponse = JSON.parseObject(response.getBody());
|
||||
|
||||
// 正确获取E_DATA数组
|
||||
JSONObject dataObject = jsonResponse.getJSONObject("data");
|
||||
if (dataObject != null && "S".equals(dataObject.getString("E_FLAG"))) {
|
||||
JSONArray companyArray = dataObject.getJSONArray("E_DATA");
|
||||
|
||||
// 批量插入公司数据
|
||||
if (companyArray != null && !companyArray.isEmpty()) {
|
||||
List<ErpCompanyDO> erpCompanyDOS = new ArrayList<>();
|
||||
for (int i = 0; i < companyArray.size(); i++) {
|
||||
JSONObject companyJson = companyArray.getJSONObject(i);
|
||||
if (companyJson != null) {
|
||||
ErpCompanyDO companyDO = new ErpCompanyDO();
|
||||
companyDO.setName(companyJson.getString("BUTXT"));
|
||||
companyDO.setNumber(companyJson.getString("BUKRS"));
|
||||
companyDO.setCurrency(companyJson.getString("WAERS"));
|
||||
erpCompanyDOS.add(companyDO);
|
||||
}
|
||||
}
|
||||
// 批量插入数据库
|
||||
if (!erpCompanyDOS.isEmpty()) {
|
||||
erpCompanyMapper.insertBatch(erpCompanyDOS);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.warn("ERP接口调用失败或返回错误标志");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("调用ERP RFC接口失败: {}", e);
|
||||
throw new RuntimeException("调用ERP RFC接口失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* ERP客商主数据 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpCustomerService {
|
||||
|
||||
/**
|
||||
* 创建ERP客商主数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpCustomerRespVO createErpCustomer(@Valid ErpCustomerSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP客商主数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpCustomer(@Valid ErpCustomerSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP客商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpCustomer(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP客商主数据
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpCustomerListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP客商主数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP客商主数据
|
||||
*/
|
||||
ErpCustomerDO getErpCustomer(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP客商主数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP客商主数据分页
|
||||
*/
|
||||
PageResult<ErpCustomerDO> getErpCustomerPage(ErpCustomerPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCustomerMapper;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCustomerSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_CUSTOMER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP客商主数据 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpCustomerServiceImpl implements ErpCustomerService {
|
||||
|
||||
@Resource
|
||||
private ErpCustomerMapper erpCustomerMapper;
|
||||
|
||||
@Override
|
||||
public ErpCustomerRespVO createErpCustomer(ErpCustomerSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpCustomerDO erpCustomer = BeanUtils.toBean(createReqVO, ErpCustomerDO.class);
|
||||
erpCustomerMapper.insert(erpCustomer);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpCustomer, ErpCustomerRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpCustomer(ErpCustomerSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpCustomerExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpCustomerDO updateObj = BeanUtils.toBean(updateReqVO, ErpCustomerDO.class);
|
||||
erpCustomerMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCustomer(Long id) {
|
||||
// 校验存在
|
||||
validateErpCustomerExists(id);
|
||||
// 删除
|
||||
erpCustomerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCustomerListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpCustomerExists(ids);
|
||||
// 删除
|
||||
erpCustomerMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpCustomerExists(List<Long> ids) {
|
||||
List<ErpCustomerDO> list = erpCustomerMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_CUSTOMER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpCustomerExists(Long id) {
|
||||
if (erpCustomerMapper.selectById(id) == null) {
|
||||
throw exception(ERP_CUSTOMER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpCustomerDO getErpCustomer(Long id) {
|
||||
return erpCustomerMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpCustomerDO> getErpCustomerPage(ErpCustomerPageReqVO pageReqVO) {
|
||||
return erpCustomerMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* ERP物料数据 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpMaterialService {
|
||||
|
||||
/**
|
||||
* 创建ERP物料数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpMaterialRespVO createErpMaterial(@Valid ErpMaterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP物料数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpMaterial(@Valid ErpMaterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP物料数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP物料数据
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpMaterialListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP物料数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP物料数据
|
||||
*/
|
||||
ErpMaterialDO getErpMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP物料数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP物料数据分页
|
||||
*/
|
||||
PageResult<ErpMaterialDO> getErpMaterialPage(ErpMaterialPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpMaterialSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpMaterialMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_MATERIAL_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP物料数据 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
|
||||
@Resource
|
||||
private ErpMaterialMapper erpMaterialMapper;
|
||||
|
||||
@Override
|
||||
public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpMaterialDO erpMaterial = BeanUtils.toBean(createReqVO, ErpMaterialDO.class);
|
||||
erpMaterialMapper.insert(erpMaterial);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpMaterial(ErpMaterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpMaterialDO updateObj = BeanUtils.toBean(updateReqVO, ErpMaterialDO.class);
|
||||
erpMaterialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpMaterial(Long id) {
|
||||
// 校验存在
|
||||
validateErpMaterialExists(id);
|
||||
// 删除
|
||||
erpMaterialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpMaterialListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpMaterialExists(ids);
|
||||
// 删除
|
||||
erpMaterialMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpMaterialExists(List<Long> ids) {
|
||||
List<ErpMaterialDO> list = erpMaterialMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpMaterialExists(Long id) {
|
||||
if (erpMaterialMapper.selectById(id) == null) {
|
||||
throw exception(ERP_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpMaterialDO getErpMaterial(Long id) {
|
||||
return erpMaterialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpMaterialDO> getErpMaterialPage(ErpMaterialPageReqVO pageReqVO) {
|
||||
return erpMaterialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
exclude:
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 5 # 初始连接数
|
||||
min-idle: 10 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||
|
||||
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
DINGTALK: # 钉钉
|
||||
client-id: dingvrnreaje3yqvzhxg
|
||||
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
|
||||
ignore-check-redirect-uri: true
|
||||
WECHAT_ENTERPRISE: # 企业微信
|
||||
client-id: wwd411c69a39ad2e54
|
||||
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
|
||||
agent-id: 1000004
|
||||
ignore-check-redirect-uri: true
|
||||
# noinspection SpringBootApplicationYaml
|
||||
WECHAT_MINI_PROGRAM: # 微信小程序
|
||||
client-id: ${dollar}{wx.miniapp.appid}
|
||||
client-secret: ${dollar}{wx.miniapp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
|
||||
WECHAT_MP: # 微信公众号
|
||||
client-id: ${dollar}{wx.mp.app-id}
|
||||
client-secret: ${dollar}{wx.mp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
cache:
|
||||
type: REDIS
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
# noinspection SpringBootApplicationYaml
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 1 # 初始连接数
|
||||
min-idle: 1 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
# 配置自己写的 MyBatis Mapper 打印日志
|
||||
cn.iocoder.yudao.module.base.dal.mysql: debug
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
yudao:
|
||||
env: # 多环境的配置项
|
||||
tag: ${HOSTNAME}
|
||||
security:
|
||||
mock-enable: true
|
||||
access-log: # 访问日志的配置项
|
||||
enable: true
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
spring:
|
||||
application:
|
||||
name: base-server
|
||||
|
||||
profiles:
|
||||
active: ${env.name}
|
||||
#统一nacos配置,使用 profile 管理
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${config.server-addr} # Nacos 服务器地址
|
||||
username: ${config.username} # Nacos 账号
|
||||
password: ${config.password} # Nacos 密码
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: ${config.group} # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: ${config.group} # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||
|
||||
config:
|
||||
import:
|
||||
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||
|
||||
# Servlet 配置
|
||||
servlet:
|
||||
# 文件上传相关配置项
|
||||
multipart:
|
||||
max-file-size: 16MB # 单个文件大小
|
||||
max-request-size: 32MB # 设置总上传的文件大小
|
||||
|
||||
# Jackson 配置项
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
||||
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
||||
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
||||
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
||||
time-zone: Asia/Shanghai
|
||||
|
||||
# Cache 配置项
|
||||
cache:
|
||||
type: REDIS
|
||||
redis:
|
||||
time-to-live: 1h # 设置过期时间为 1 小时
|
||||
|
||||
server:
|
||||
port: 48100
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
||||
path: /swagger-ui.html
|
||||
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
||||
|
||||
knife4j:
|
||||
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
|
||||
setting:
|
||||
language: zh_cn
|
||||
|
||||
# MyBatis Plus 的配置项
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
type-aliases-package: cn.iocoder.yudao.module.*.dal.dataobject
|
||||
encryptor:
|
||||
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
||||
|
||||
mybatis-plus-join:
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
|
||||
# VO 转换(数据翻译)相关
|
||||
easy-trans:
|
||||
is-enable-global: false # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
|
||||
|
||||
xxl:
|
||||
job:
|
||||
executor:
|
||||
appname: ${spring.application.name} # 执行器 AppName
|
||||
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
|
||||
accessToken: default_token # 执行器通讯TOKEN
|
||||
|
||||
yudao:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.yudao.module.base
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
xss:
|
||||
enable: false
|
||||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||
swagger:
|
||||
title: 管理后台
|
||||
description: 提供管理员管理的所有功能
|
||||
version: ${yudao.info.version}
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
|
||||
debug: false
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCompanyMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCustomerMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpMaterialMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user