Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
package com.zt.plat.module.erp.api;
|
||||
|
||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||
import com.zt.plat.module.erp.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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - ERP")
|
||||
@@ -21,4 +24,8 @@ public interface ErpExternalApi {
|
||||
@Operation(summary = "erp数据提交")
|
||||
HashMap<String, String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/query")
|
||||
@Operation(summary = "erp数据查询")
|
||||
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zt.plat.module.erp.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 查询 ERP DTO")
|
||||
@Data
|
||||
public class ErpQueryReqDTO {
|
||||
/**
|
||||
* 调用ERP接口查询erp数据
|
||||
*
|
||||
* 请求参数说明:
|
||||
* "funcnr": 接口编号,必须,参见RFC功能列表,可调用接口编号范围001-021
|
||||
* "req": {具体参数,参见RFC功能列表}
|
||||
*/
|
||||
private String funcnr;
|
||||
private Map<String, Object> req;
|
||||
|
||||
}
|
||||
@@ -13,6 +13,10 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在");
|
||||
|
||||
ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_002_000_001, "ERP物料数据不存在");
|
||||
ErrorCode ERP_MATERIAL_NOT_ALLOW_UPDATE = new ErrorCode(1_002_000_002, "只允许编辑状态为“供应链”的数据");
|
||||
ErrorCode ERP_MATERIAL_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_003, "不允许删除状态为“ERP”的数据");
|
||||
ErrorCode ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_004, "只允许删除不存在配置关系的数据");
|
||||
ErrorCode ERP_MATERIAL_EXISTS = new ErrorCode(1_002_000_005, "已存在相同中铜编码的物料数据");
|
||||
|
||||
ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_003_000_001, "ERP公司数据不存在");
|
||||
ErrorCode ERP_COMPANY_REDIS_NOT_EXISTS = new ErrorCode(1_003_000_002, "ERP公司代码缓存数据丢失,请重新同步公司代码");
|
||||
@@ -28,6 +32,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_008_000_001, "ERP工厂数据不存在");
|
||||
ErrorCode ERP_FACTORY_REDIS_NOT_EXISTS = new ErrorCode(1_008_000_002, "ERP工厂redis数据不存在");
|
||||
ErrorCode ERP_FACTORY_NOT_ALLOW_UPDATE = new ErrorCode(1_008_000_003, "类型为ERP的数据或启用的数据不允许编辑");
|
||||
ErrorCode ERP_FACTORY_EXISTS = new ErrorCode(1_008_000_004, "工厂编码重复,数据已存在");
|
||||
|
||||
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_009_000_001, "ERP成本中心数据不存在");
|
||||
|
||||
@@ -40,6 +45,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_013_000_001, "ERP销售组织数据不存在");
|
||||
|
||||
ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_014_000_001, "ERP库位数据不存在");
|
||||
ErrorCode ERP_WAREHOUSE_NOT_ALLOW_UPDATE = new ErrorCode(1_014_000_002, "只允许状态为“供应链”,且“禁用”的数据编辑");
|
||||
ErrorCode ERP_WAREHOUSE_EXISTS = new ErrorCode(1_014_000_003, "已存在相同库位编码和工厂编码的记录");
|
||||
|
||||
ErrorCode ERP_ASSET_NOT_EXISTS = new ErrorCode(1_015_000_001, "ERP资产卡片数据不存在");
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.erp.api;
|
||||
|
||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -7,6 +8,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ERP Api 实现类
|
||||
@@ -25,4 +27,11 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
||||
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
||||
return erpConfig.pushDataToErp(reqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> queryDataToErp(ErpQueryReqDTO reqDTO) {
|
||||
String funcnr = reqDTO.getFuncnr();
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
return erpConfig.fetchDataFromERP(funcnr, req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,14 +88,6 @@ public class ErpFactoryController {
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/pageByCpn")
|
||||
@Operation(summary = "获得ERP工厂分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:query')")
|
||||
public CommonResult<PageResult<ErpFactoryRespVO>> getErpFactoryPageByCpn(@Valid ErpFactoryPageReqVO pageReqVO) {
|
||||
PageResult<ErpFactoryDO> pageResult = erpFactoryService.getErpFactoryPageByCpn(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工厂 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')")
|
||||
|
||||
@@ -101,6 +101,14 @@ public class ErpWarehouseController {
|
||||
BeanUtils.toBean(list, ErpWarehouseRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:warehouse:update')")
|
||||
public CommonResult<Boolean> enableWarehouseList(@RequestBody List<ErpWarehouseSaveReqVO> saveReqVOS) {
|
||||
erpWarehouseService.enableWarehouseList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/getErpWarehouseTask")
|
||||
@Operation(summary = "定时获得erp更新库位")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
||||
|
||||
@@ -16,10 +16,10 @@ public class ErpFactoryPageReqVO extends PageParam {
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
private String erpCompanyNumber;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
private String erpCompanyName;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@@ -23,7 +23,10 @@ public class ErpFactoryRespVO {
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
private String erpCompanyNumber;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String erpCompanyName;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@@ -20,10 +20,7 @@ public class ErpFactorySaveReqVO {
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyName;
|
||||
private String erpCompanyNumber;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@@ -8,6 +8,9 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ErpWarehousePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "工厂编码;将查询参数存入")
|
||||
private String factoryNumber;
|
||||
|
||||
@@ -17,4 +20,8 @@ public class ErpWarehousePageReqVO extends PageParam {
|
||||
@Schema(description = "库位编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user