Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -8,4 +8,11 @@ public interface ErrorCodeConstants {
|
||||
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物料数据不存在");
|
||||
ErrorCode ERP_BOM_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_BOM_DETAIL_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_PROCESS_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_PROCESS_DETAIL_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
ErrorCode ERP_PRODUCTIVE_VERSION_NOT_EXISTS = new ErrorCode(1_001_000_003, "ERP物料数据不存在");
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.erp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* ContractOrder 模块的启动类
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package cn.iocoder.yudao.module.erp.common.conf;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
@Configuration
|
||||
public class ErpConfig {
|
||||
|
||||
@Value("${erp.address}")
|
||||
private String erpAddress;
|
||||
|
||||
@Value("${erp.sapsys}")
|
||||
private String sapsys;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
|
||||
/**
|
||||
* 调用ERP接口获取公司数据
|
||||
*/
|
||||
public JSONArray fetchDataFromERP(String funcnr, Map<String, Object> req) {
|
||||
// 构建完整URL
|
||||
String url = "http://" + erpAddress + "/api/rfc/get";
|
||||
// 构建请求参数
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("sapsys", sapsys);
|
||||
requestBody.put("funcnr", funcnr); // 获取枚举值
|
||||
if (req != null) {
|
||||
requestBody.put("req", req);
|
||||
}
|
||||
|
||||
// 设置请求头
|
||||
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);
|
||||
|
||||
// 解析响应结果
|
||||
String responseBody = response.getBody();
|
||||
if (responseBody == null) {
|
||||
log.warn("ERP接口返回空响应");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject jsonResponse = JSON.parseObject(responseBody);
|
||||
if (jsonResponse == null) {
|
||||
log.warn("ERP接口响应无法解析为JSON");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 正确获取E_DATA数组
|
||||
JSONObject dataObject = jsonResponse.getJSONObject("data");
|
||||
if (dataObject != null && "S".equals(dataObject.getString("E_FLAG"))) {
|
||||
return dataObject.getJSONArray("E_DATA");
|
||||
} else {
|
||||
log.warn("ERP接口调用失败或返回错误标志");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Map<String, List<String>> numbers(JSONArray dataArray, String key,String dataKey) {
|
||||
// 使用 Redis 获取缓存数据
|
||||
Map<String, List<String>> numbers = new HashMap<>();
|
||||
List<String> cachedNumbers = (List<String>) redisTemplate.opsForValue().get(key);
|
||||
if (cachedNumbers == null) {
|
||||
cachedNumbers = new ArrayList<>();
|
||||
}
|
||||
|
||||
// 提取有效的 BUKRS 编号
|
||||
List<String> existingNumbers = new ArrayList<>();
|
||||
if (dataArray != null) {
|
||||
existingNumbers = dataArray.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(dataJson -> ((JSONObject) dataJson).getString(dataKey))
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::trim) // 去除字符串首尾空格
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 找出共同存在的编号
|
||||
Set<String> cachedNumberSet = new HashSet<>(cachedNumbers != null ? cachedNumbers : new ArrayList<>());
|
||||
List<String> commonNumbers = existingNumbers.stream()
|
||||
.filter(cachedNumberSet::contains)
|
||||
.collect(Collectors.toList());
|
||||
numbers.put("com", commonNumbers);
|
||||
|
||||
List<String> newNumbers = existingNumbers.stream()
|
||||
.filter(num -> !cachedNumberSet.contains(num))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 合并所有编号
|
||||
List<String> allNumbers = new ArrayList<>(cachedNumbers);
|
||||
allNumbers.addAll(newNumbers);
|
||||
numbers.put("all", allNumbers);
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void updateRedisCache(String key, List<String> allnumbers) {
|
||||
// 使用 Redis 更新缓存数据
|
||||
redisTemplate.opsForValue().set(key, allnumbers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package cn.iocoder.yudao.module.erp.common.conf;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
//import redis.clients.jedis.JedisPoolConfig;
|
||||
|
||||
|
||||
/**
|
||||
* @author wuxz
|
||||
* @create 2022-06-07 20:54
|
||||
*/
|
||||
@Primary
|
||||
@Configuration
|
||||
public class MyRedisConfig {
|
||||
|
||||
/*
|
||||
@Value("${spring.redis.database}")
|
||||
private Integer database;
|
||||
|
||||
@Value("${spring.redis.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${spring.redis.port}")
|
||||
private Integer port;
|
||||
|
||||
@Value("${spring.redis.password}")
|
||||
private String password;
|
||||
|
||||
@Value("${spring.redis.jedis.pool.max-idle}")
|
||||
private Integer max_idle;
|
||||
|
||||
@Value("${spring.redis.jedis.pool.min-idle}")
|
||||
private Integer min_idle;
|
||||
|
||||
@Value("${spring.redis.jedis.pool.max-active}")
|
||||
private Integer max_active;
|
||||
|
||||
@Value("${spring.redis.jedis.pool.max-wait}")
|
||||
private Integer max_wait;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Bean(value = "MyRedisTemplate")
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
||||
|
||||
// 通过 Jackson 组件进行序列化
|
||||
RedisSerializer<Object> serializer = redisSerializer();
|
||||
|
||||
// key 和 value
|
||||
// 一般来说, redis-key采用字符串序列化;
|
||||
// redis-value采用json序列化, json的体积小,可读性高,不需要实现serializer接口。
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setValueSerializer(serializer);
|
||||
|
||||
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashValueSerializer(serializer);
|
||||
|
||||
redisTemplate.afterPropertiesSet();
|
||||
return redisTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public RedisSerializer<Object> redisSerializer() {
|
||||
//创建JSON序列化器
|
||||
Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<>(Object.class);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
// objectMapper.enableDefaultTyping()被弃用
|
||||
objectMapper.activateDefaultTyping(
|
||||
LaissezFaireSubTypeValidator.instance,
|
||||
ObjectMapper.DefaultTyping.NON_FINAL,
|
||||
JsonTypeInfo.As.WRAPPER_ARRAY);
|
||||
serializer.setObjectMapper(objectMapper);
|
||||
return serializer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// @Bean
|
||||
// public JedisPoolConfig jedisPoolConfig() {
|
||||
// JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
|
||||
// //最小空闲连接数
|
||||
// jedisPoolConfig.setMinIdle(min_idle);
|
||||
// jedisPoolConfig.setMaxIdle(max_idle);
|
||||
// jedisPoolConfig.setMaxTotal(max_active);
|
||||
// //当池内没有可用的连接时,最大等待时间
|
||||
// jedisPoolConfig.setMaxWaitMillis(max_wait);
|
||||
// //------其他属性根据需要自行添加-------------
|
||||
// return jedisPoolConfig;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * jedis连接工厂
|
||||
// * @param jedisPoolConfig
|
||||
// * @return
|
||||
// */
|
||||
// @Bean
|
||||
// public RedisConnectionFactory redisConnectionFactory(JedisPoolConfig jedisPoolConfig) {
|
||||
// //单机版jedis
|
||||
// RedisStandaloneConfiguration redisStandaloneConfiguration =
|
||||
// new RedisStandaloneConfiguration();
|
||||
// //设置redis服务器的host或者ip地址
|
||||
// redisStandaloneConfiguration.setHostName(host);
|
||||
// //设置默认使用的数据库
|
||||
// redisStandaloneConfiguration.setDatabase(database);
|
||||
// //设置密码
|
||||
// redisStandaloneConfiguration.setPassword(password);
|
||||
// //设置redis的服务的端口号
|
||||
// redisStandaloneConfiguration.setPort(port);
|
||||
// //获得默认的连接池构造器
|
||||
// JedisClientConfiguration.JedisPoolingClientConfigurationBuilder jc =
|
||||
// (JedisClientConfiguration.JedisPoolingClientConfigurationBuilder)JedisClientConfiguration.builder();
|
||||
// //指定jedisPoolConifig
|
||||
// jc.poolConfig(jedisPoolConfig);
|
||||
// //通过构造器来构造jedis客户端配置
|
||||
// JedisClientConfiguration jedisClientConfiguration = jc.build();
|
||||
// return new JedisConnectionFactory(redisStandaloneConfiguration, jedisClientConfiguration);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Bean
|
||||
// @ConditionalOnMissingBean(name = {"redisTemplate"})
|
||||
// public RedisTemplate<String, Serializable> redisTemplate(JedisConnectionFactory jedisConnectionFactory){
|
||||
// RedisTemplate<String, Serializable> redisTemplate = new RedisTemplate<>();
|
||||
// redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
// redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
|
||||
// redisTemplate.setConnectionFactory(jedisConnectionFactory);
|
||||
// return redisTemplate;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 序列化乱码问题解决
|
||||
*/
|
||||
// @Bean
|
||||
// public RedisTemplate<String, Serializable> redisTemplate(JedisConnectionFactory jedisConnectionFactory){
|
||||
// RedisTemplate<String, Serializable> redisTemplate = new RedisTemplate<>();
|
||||
// redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
// redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
|
||||
// redisTemplate.setConnectionFactory(jedisConnectionFactory);
|
||||
// return redisTemplate;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -13,32 +13,60 @@ 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");
|
||||
公司代码("001", "BUKRS", ""),
|
||||
工厂信息("002", "", ""),
|
||||
客商信息("003", "PARTNER", "DATUM"),
|
||||
成本中心("004", "", ""),
|
||||
内部订单("005", "", ""),
|
||||
库位信息("006", "", ""),
|
||||
采购组织("007", "", ""),
|
||||
销售组织("008", "", ""),
|
||||
合同信息("009", "", ""),
|
||||
资产卡片("010", "", ""),
|
||||
库存信息("011", "", ""),
|
||||
辅组编码("012", "", ""),
|
||||
生产订单("013", "", ""),
|
||||
BOM清单("014", "", ""),
|
||||
工艺路线("015", "", ""),
|
||||
生产版本("016", "", ""),
|
||||
生产投料("017", "", ""),
|
||||
生产订单明细("018", "", ""),
|
||||
库存明细("019", "", ""),
|
||||
发票状态("020", "", ""),
|
||||
物料数据("021", "", "ERSDA");
|
||||
|
||||
public String funcnr = null;
|
||||
private final String funcnr;
|
||||
private final String datakey;
|
||||
private final String datekey;
|
||||
|
||||
FuncnrEnum(String funcnr) {
|
||||
FuncnrEnum(String funcnr, String datakey,String datekey) {
|
||||
this.funcnr = funcnr;
|
||||
this.datakey = datakey;
|
||||
this.datekey = datekey;
|
||||
}
|
||||
|
||||
public String getFuncnr() {
|
||||
return funcnr;
|
||||
}
|
||||
|
||||
public String getDatakey() {
|
||||
return datakey;
|
||||
}
|
||||
|
||||
public String getDatekey() {
|
||||
return datekey;
|
||||
}
|
||||
}
|
||||
|
||||
//接口编号枚举
|
||||
public enum ModeTypeEnum {
|
||||
供应商("K"),
|
||||
客户("D");
|
||||
|
||||
public String modetype = null;
|
||||
|
||||
ModeTypeEnum(String modetype) {
|
||||
this.modetype = modetype;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
**/
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class statisticsTask {
|
||||
public class statisticstask {
|
||||
|
||||
@Resource
|
||||
private ErpCompanyService erpCompanyService;
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpBomService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料清单(BOM)")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-bom")
|
||||
@Validated
|
||||
public class ErpBomController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpBomService erpBomService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP物料清单(BOM)")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
||||
public CommonResult<ErpBomRespVO> createErpBom(@Valid @RequestBody ErpBomSaveReqVO createReqVO) {
|
||||
return success(erpBomService.createErpBom(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP物料清单(BOM)")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:update')")
|
||||
public CommonResult<Boolean> updateErpBom(@Valid @RequestBody ErpBomSaveReqVO updateReqVO) {
|
||||
erpBomService.updateErpBom(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP物料清单(BOM)")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:delete')")
|
||||
public CommonResult<Boolean> deleteErpBom(@RequestParam("id") Long id) {
|
||||
erpBomService.deleteErpBom(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP物料清单(BOM)")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:delete')")
|
||||
public CommonResult<Boolean> deleteErpBomList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpBomService.deleteErpBomListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP物料清单(BOM)")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:query')")
|
||||
public CommonResult<ErpBomRespVO> getErpBom(@RequestParam("id") Long id) {
|
||||
ErpBomDO erpBom = erpBomService.getErpBom(id);
|
||||
return success(BeanUtils.toBean(erpBom, ErpBomRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP物料清单(BOM)分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:query')")
|
||||
public CommonResult<PageResult<ErpBomRespVO>> getErpBomPage(@Valid ErpBomPageReqVO pageReqVO) {
|
||||
PageResult<ErpBomDO> pageResult = erpBomService.getErpBomPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpBomRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP物料清单(BOM) Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpBomExcel(@Valid ErpBomPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpBomDO> list = erpBomService.getErpBomPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP物料清单(BOM).xls", "数据", ErpBomRespVO.class,
|
||||
BeanUtils.toBean(list, ErpBomRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpBomDetailService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料清单(BOM)明细")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-bom-detail")
|
||||
@Validated
|
||||
public class ErpBomDetailController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpBomDetailService erpBomDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP物料清单(BOM)明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:create')")
|
||||
public CommonResult<ErpBomDetailRespVO> createErpBomDetail(@Valid @RequestBody ErpBomDetailSaveReqVO createReqVO) {
|
||||
return success(erpBomDetailService.createErpBomDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP物料清单(BOM)明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:update')")
|
||||
public CommonResult<Boolean> updateErpBomDetail(@Valid @RequestBody ErpBomDetailSaveReqVO updateReqVO) {
|
||||
erpBomDetailService.updateErpBomDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP物料清单(BOM)明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:delete')")
|
||||
public CommonResult<Boolean> deleteErpBomDetail(@RequestParam("id") Long id) {
|
||||
erpBomDetailService.deleteErpBomDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP物料清单(BOM)明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:delete')")
|
||||
public CommonResult<Boolean> deleteErpBomDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpBomDetailService.deleteErpBomDetailListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP物料清单(BOM)明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:query')")
|
||||
public CommonResult<ErpBomDetailRespVO> getErpBomDetail(@RequestParam("id") Long id) {
|
||||
ErpBomDetailDO erpBomDetail = erpBomDetailService.getErpBomDetail(id);
|
||||
return success(BeanUtils.toBean(erpBomDetail, ErpBomDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP物料清单(BOM)明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:query')")
|
||||
public CommonResult<PageResult<ErpBomDetailRespVO>> getErpBomDetailPage(@Valid ErpBomDetailPageReqVO pageReqVO) {
|
||||
PageResult<ErpBomDetailDO> pageResult = erpBomDetailService.getErpBomDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpBomDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP物料清单(BOM)明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpBomDetailExcel(@Valid ErpBomDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpBomDetailDO> list = erpBomDetailService.getErpBomDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP物料清单(BOM)明细.xls", "数据", ErpBomDetailRespVO.class,
|
||||
BeanUtils.toBean(list, ErpBomDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
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 io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
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.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
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")
|
||||
@RequestMapping("/sply/erp-company")
|
||||
@Validated
|
||||
public class ErpCompanyController {
|
||||
|
||||
@@ -104,10 +101,10 @@ public class ErpCompanyController {
|
||||
BeanUtils.toBean(list, ErpCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/callErpRfcInterface")
|
||||
@PostMapping("/getErpCompanyTask")
|
||||
@Operation(summary = "定时获得erp更新公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:query')")
|
||||
public void callErpRfcInterface() {
|
||||
public void getErpCompanyTask() {
|
||||
erpCompanyService.callErpRfcInterface();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCostcenterDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpCostcenterService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP成本中心")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-costcenter")
|
||||
@Validated
|
||||
public class ErpCostcenterController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpCostcenterService erpCostcenterService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP成本中心")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:create')")
|
||||
public CommonResult<ErpCostcenterRespVO> createErpCostcenter(@Valid @RequestBody ErpCostcenterSaveReqVO createReqVO) {
|
||||
return success(erpCostcenterService.createErpCostcenter(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP成本中心")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:update')")
|
||||
public CommonResult<Boolean> updateErpCostcenter(@Valid @RequestBody ErpCostcenterSaveReqVO updateReqVO) {
|
||||
erpCostcenterService.updateErpCostcenter(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP成本中心")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:delete')")
|
||||
public CommonResult<Boolean> deleteErpCostcenter(@RequestParam("id") Long id) {
|
||||
erpCostcenterService.deleteErpCostcenter(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP成本中心")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:delete')")
|
||||
public CommonResult<Boolean> deleteErpCostcenterList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpCostcenterService.deleteErpCostcenterListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP成本中心")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:query')")
|
||||
public CommonResult<ErpCostcenterRespVO> getErpCostcenter(@RequestParam("id") Long id) {
|
||||
ErpCostcenterDO erpCostcenter = erpCostcenterService.getErpCostcenter(id);
|
||||
return success(BeanUtils.toBean(erpCostcenter, ErpCostcenterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP成本中心分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:query')")
|
||||
public CommonResult<PageResult<ErpCostcenterRespVO>> getErpCostcenterPage(@Valid ErpCostcenterPageReqVO pageReqVO) {
|
||||
PageResult<ErpCostcenterDO> pageResult = erpCostcenterService.getErpCostcenterPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpCostcenterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP成本中心 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpCostcenterExcel(@Valid ErpCostcenterPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpCostcenterDO> list = erpCostcenterService.getErpCostcenterPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP成本中心.xls", "数据", ErpCostcenterRespVO.class,
|
||||
BeanUtils.toBean(list, ErpCostcenterRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
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 cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpCustomerService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
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")
|
||||
@RequestMapping("/sply/erp-customer")
|
||||
@Validated
|
||||
public class ErpCustomerController {
|
||||
|
||||
@@ -104,4 +101,18 @@ public class ErpCustomerController {
|
||||
BeanUtils.toBean(list, ErpCustomerRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/getErpCustomerTask")
|
||||
@Operation(summary = "定时获得erp更新客商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
||||
public void getErpCustomerTask() {
|
||||
erpCustomerService.callErpRfcInterface();
|
||||
}
|
||||
|
||||
@PostMapping("/initialize")
|
||||
@Operation(summary = "把数据库数据number搞到redis")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
||||
public void initialize() {
|
||||
erpCustomerService.initialize();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpFactoryDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpFactoryService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工厂")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-factory")
|
||||
@Validated
|
||||
public class ErpFactoryController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpFactoryService erpFactoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP工厂")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:create')")
|
||||
public CommonResult<ErpFactoryRespVO> createErpFactory(@Valid @RequestBody ErpFactorySaveReqVO createReqVO) {
|
||||
return success(erpFactoryService.createErpFactory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP工厂")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:update')")
|
||||
public CommonResult<Boolean> updateErpFactory(@Valid @RequestBody ErpFactorySaveReqVO updateReqVO) {
|
||||
erpFactoryService.updateErpFactory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP工厂")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:delete')")
|
||||
public CommonResult<Boolean> deleteErpFactory(@RequestParam("id") Long id) {
|
||||
erpFactoryService.deleteErpFactory(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP工厂")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:delete')")
|
||||
public CommonResult<Boolean> deleteErpFactoryList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpFactoryService.deleteErpFactoryListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP工厂")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:query')")
|
||||
public CommonResult<ErpFactoryRespVO> getErpFactory(@RequestParam("id") Long id) {
|
||||
ErpFactoryDO erpFactory = erpFactoryService.getErpFactory(id);
|
||||
return success(BeanUtils.toBean(erpFactory, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP工厂分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:query')")
|
||||
public CommonResult<PageResult<ErpFactoryRespVO>> getErpFactoryPage(@Valid ErpFactoryPageReqVO pageReqVO) {
|
||||
PageResult<ErpFactoryDO> pageResult = erpFactoryService.getErpFactoryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工厂 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpFactoryExcel(@Valid ErpFactoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpFactoryDO> list = erpFactoryService.getErpFactoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP工厂.xls", "数据", ErpFactoryRespVO.class,
|
||||
BeanUtils.toBean(list, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +1,36 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
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 io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
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.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
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")
|
||||
@RequestMapping("/sply/erp-material")
|
||||
@Validated
|
||||
public class ErpMaterialController {
|
||||
|
||||
@@ -104,4 +101,18 @@ public class ErpMaterialController {
|
||||
BeanUtils.toBean(list, ErpMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/getErpMaterialTask")
|
||||
@Operation(summary = "定时获得erp更新公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
||||
public void getErpMaterialTask() {
|
||||
erpMaterialService.callErpRfcInterface();
|
||||
}
|
||||
|
||||
@PostMapping("/initialize")
|
||||
@Operation(summary = "把数据库数据number搞到redis")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
||||
public void initialize() {
|
||||
erpMaterialService.initialize();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpProcessService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工艺路线")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-process")
|
||||
@Validated
|
||||
public class ErpProcessController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpProcessService erpProcessService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP工艺路线")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:create')")
|
||||
public CommonResult<ErpProcessRespVO> createErpProcess(@Valid @RequestBody ErpProcessSaveReqVO createReqVO) {
|
||||
return success(erpProcessService.createErpProcess(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP工艺路线")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:update')")
|
||||
public CommonResult<Boolean> updateErpProcess(@Valid @RequestBody ErpProcessSaveReqVO updateReqVO) {
|
||||
erpProcessService.updateErpProcess(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP工艺路线")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:delete')")
|
||||
public CommonResult<Boolean> deleteErpProcess(@RequestParam("id") Long id) {
|
||||
erpProcessService.deleteErpProcess(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP工艺路线")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:delete')")
|
||||
public CommonResult<Boolean> deleteErpProcessList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpProcessService.deleteErpProcessListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP工艺路线")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:query')")
|
||||
public CommonResult<ErpProcessRespVO> getErpProcess(@RequestParam("id") Long id) {
|
||||
ErpProcessDO erpProcess = erpProcessService.getErpProcess(id);
|
||||
return success(BeanUtils.toBean(erpProcess, ErpProcessRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP工艺路线分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:query')")
|
||||
public CommonResult<PageResult<ErpProcessRespVO>> getErpProcessPage(@Valid ErpProcessPageReqVO pageReqVO) {
|
||||
PageResult<ErpProcessDO> pageResult = erpProcessService.getErpProcessPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpProcessRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工艺路线 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpProcessExcel(@Valid ErpProcessPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpProcessDO> list = erpProcessService.getErpProcessPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP工艺路线.xls", "数据", ErpProcessRespVO.class,
|
||||
BeanUtils.toBean(list, ErpProcessRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDetailDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpProcessDetailService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工艺路线明细")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-process-detail")
|
||||
@Validated
|
||||
public class ErpProcessDetailController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpProcessDetailService erpProcessDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP工艺路线明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:create')")
|
||||
public CommonResult<ErpProcessDetailRespVO> createErpProcessDetail(@Valid @RequestBody ErpProcessDetailSaveReqVO createReqVO) {
|
||||
return success(erpProcessDetailService.createErpProcessDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP工艺路线明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:update')")
|
||||
public CommonResult<Boolean> updateErpProcessDetail(@Valid @RequestBody ErpProcessDetailSaveReqVO updateReqVO) {
|
||||
erpProcessDetailService.updateErpProcessDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP工艺路线明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:delete')")
|
||||
public CommonResult<Boolean> deleteErpProcessDetail(@RequestParam("id") Long id) {
|
||||
erpProcessDetailService.deleteErpProcessDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP工艺路线明细")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:delete')")
|
||||
public CommonResult<Boolean> deleteErpProcessDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpProcessDetailService.deleteErpProcessDetailListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP工艺路线明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:query')")
|
||||
public CommonResult<ErpProcessDetailRespVO> getErpProcessDetail(@RequestParam("id") Long id) {
|
||||
ErpProcessDetailDO erpProcessDetail = erpProcessDetailService.getErpProcessDetail(id);
|
||||
return success(BeanUtils.toBean(erpProcessDetail, ErpProcessDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP工艺路线明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:query')")
|
||||
public CommonResult<PageResult<ErpProcessDetailRespVO>> getErpProcessDetailPage(@Valid ErpProcessDetailPageReqVO pageReqVO) {
|
||||
PageResult<ErpProcessDetailDO> pageResult = erpProcessDetailService.getErpProcessDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpProcessDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工艺路线明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpProcessDetailExcel(@Valid ErpProcessDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpProcessDetailDO> list = erpProcessDetailService.getErpProcessDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP工艺路线明细.xls", "数据", ErpProcessDetailRespVO.class,
|
||||
BeanUtils.toBean(list, ErpProcessDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
||||
import cn.iocoder.yudao.module.erp.service.erp.ErpProductiveVersionService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
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.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP生产版本")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-productive-version")
|
||||
@Validated
|
||||
public class ErpProductiveVersionController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ErpProductiveVersionService erpProductiveVersionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP生产版本")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:create')")
|
||||
public CommonResult<ErpProductiveVersionRespVO> createErpProductiveVersion(@Valid @RequestBody ErpProductiveVersionSaveReqVO createReqVO) {
|
||||
return success(erpProductiveVersionService.createErpProductiveVersion(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP生产版本")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:update')")
|
||||
public CommonResult<Boolean> updateErpProductiveVersion(@Valid @RequestBody ErpProductiveVersionSaveReqVO updateReqVO) {
|
||||
erpProductiveVersionService.updateErpProductiveVersion(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP生产版本")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:delete')")
|
||||
public CommonResult<Boolean> deleteErpProductiveVersion(@RequestParam("id") Long id) {
|
||||
erpProductiveVersionService.deleteErpProductiveVersion(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除ERP生产版本")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:delete')")
|
||||
public CommonResult<Boolean> deleteErpProductiveVersionList(@RequestBody BatchDeleteReqVO req) {
|
||||
erpProductiveVersionService.deleteErpProductiveVersionListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP生产版本")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:query')")
|
||||
public CommonResult<ErpProductiveVersionRespVO> getErpProductiveVersion(@RequestParam("id") Long id) {
|
||||
ErpProductiveVersionDO erpProductiveVersion = erpProductiveVersionService.getErpProductiveVersion(id);
|
||||
return success(BeanUtils.toBean(erpProductiveVersion, ErpProductiveVersionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP生产版本分页")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:query')")
|
||||
public CommonResult<PageResult<ErpProductiveVersionRespVO>> getErpProductiveVersionPage(@Valid ErpProductiveVersionPageReqVO pageReqVO) {
|
||||
PageResult<ErpProductiveVersionDO> pageResult = erpProductiveVersionService.getErpProductiveVersionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpProductiveVersionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP生产版本 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportErpProductiveVersionExcel(@Valid ErpProductiveVersionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ErpProductiveVersionDO> list = erpProductiveVersionService.getErpProductiveVersionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP生产版本.xls", "数据", ErpProductiveVersionRespVO.class,
|
||||
BeanUtils.toBean(list, ErpProductiveVersionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM)明细分页 Request VO")
|
||||
@Data
|
||||
public class ErpBomDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "BOM主键", example = "24876")
|
||||
private String bomId;
|
||||
|
||||
@Schema(description = "ERP物料清单主键", example = "14731")
|
||||
private String erpBomId;
|
||||
|
||||
@Schema(description = "子项物料编码")
|
||||
private String childMaterialNumber;
|
||||
|
||||
@Schema(description = "子项物料描述")
|
||||
private BigDecimal childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "基本数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "物料标识", example = "2")
|
||||
private String identificationType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM)明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpBomDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2110")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "BOM主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24876")
|
||||
@ExcelProperty("BOM主键")
|
||||
private String bomId;
|
||||
|
||||
@Schema(description = "ERP物料清单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14731")
|
||||
@ExcelProperty("ERP物料清单主键")
|
||||
private String erpBomId;
|
||||
|
||||
@Schema(description = "子项物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子项物料编码")
|
||||
private String childMaterialNumber;
|
||||
|
||||
@Schema(description = "子项物料描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子项物料描述")
|
||||
private BigDecimal childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子项类别")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "基本数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("基本数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("基本单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "物料标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("物料标识")
|
||||
private String identificationType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM)明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpBomDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2110")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "BOM主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24876")
|
||||
@NotEmpty(message = "BOM主键不能为空")
|
||||
private String bomId;
|
||||
|
||||
@Schema(description = "ERP物料清单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14731")
|
||||
@NotEmpty(message = "ERP物料清单主键不能为空")
|
||||
private String erpBomId;
|
||||
|
||||
@Schema(description = "子项物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "子项物料编码不能为空")
|
||||
private String childMaterialNumber;
|
||||
|
||||
@Schema(description = "子项物料描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "子项物料描述不能为空")
|
||||
private BigDecimal childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "子项类别不能为空")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "基本数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "基本数量不能为空")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "基本单位不能为空")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "物料标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "物料标识不能为空")
|
||||
private String identificationType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM)分页 Request VO")
|
||||
@Data
|
||||
public class ErpBomPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "顶层物料编码")
|
||||
private String upMaterial;
|
||||
|
||||
@Schema(description = "可选BOM")
|
||||
private String useItem;
|
||||
|
||||
@Schema(description = "物料描述")
|
||||
private String materialDescription;
|
||||
|
||||
@Schema(description = "基本数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM) Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpBomRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31348")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "顶层物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("顶层物料编码")
|
||||
private String upMaterial;
|
||||
|
||||
@Schema(description = "可选BOM", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("可选BOM")
|
||||
private String useItem;
|
||||
|
||||
@Schema(description = "物料描述")
|
||||
@ExcelProperty("物料描述")
|
||||
private String materialDescription;
|
||||
|
||||
@Schema(description = "基本数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("基本数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("基本单位")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料清单(BOM)新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpBomSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31348")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工厂编码不能为空")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "顶层物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "顶层物料编码不能为空")
|
||||
private String upMaterial;
|
||||
|
||||
@Schema(description = "可选BOM", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "可选BOM不能为空")
|
||||
private String useItem;
|
||||
|
||||
@Schema(description = "物料描述")
|
||||
private String materialDescription;
|
||||
|
||||
@Schema(description = "基本数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "基本数量不能为空")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "基本单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "基本单位不能为空")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司分页 Request VO")
|
||||
@Data
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司 Response VO")
|
||||
@Data
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
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 jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP公司新增/修改 Request VO")
|
||||
@Data
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.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 cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP成本中心分页 Request VO")
|
||||
@Data
|
||||
public class ErpCostcenterPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "成本中心编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "成本中心描述", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工区必填;使用这个基础数据是,如果为X时必须和工区使用")
|
||||
private String isUse;
|
||||
|
||||
@Schema(description = "功能范围")
|
||||
private String scopeNumber;
|
||||
|
||||
@Schema(description = "功能范围描述", example = "赵六")
|
||||
private String scopeName;
|
||||
|
||||
@Schema(description = "起始日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startDate;
|
||||
|
||||
@Schema(description = "截止日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP成本中心 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpCostcenterRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23318")
|
||||
@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 = "工区必填;使用这个基础数据是,如果为X时必须和工区使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工区必填;使用这个基础数据是,如果为X时必须和工区使用")
|
||||
private String isUse;
|
||||
|
||||
@Schema(description = "功能范围", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("功能范围")
|
||||
private String scopeNumber;
|
||||
|
||||
@Schema(description = "功能范围描述", example = "赵六")
|
||||
@ExcelProperty("功能范围描述")
|
||||
private String scopeName;
|
||||
|
||||
@Schema(description = "起始日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("起始日期")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "截止日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("截止日期")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP成本中心新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpCostcenterSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23318")
|
||||
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 = "工区必填;使用这个基础数据是,如果为X时必须和工区使用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工区必填;使用这个基础数据是,如果为X时必须和工区使用不能为空")
|
||||
private String isUse;
|
||||
|
||||
@Schema(description = "功能范围", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "功能范围不能为空")
|
||||
private String scopeNumber;
|
||||
|
||||
@Schema(description = "功能范围描述", example = "赵六")
|
||||
private String scopeName;
|
||||
|
||||
@Schema(description = "起始日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "起始日期不能为空")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "截止日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "截止日期不能为空")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
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;
|
||||
@@ -41,7 +42,4 @@ public class ErpCustomerPageReqVO extends PageParam {
|
||||
@Schema(description = "冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", example = "2")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP客商主数据 Response VO")
|
||||
@Data
|
||||
@@ -51,8 +52,4 @@ public class ErpCustomerRespVO {
|
||||
@ExcelProperty("冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
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 jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -45,8 +46,4 @@ public class ErpCustomerSaveReqVO {
|
||||
@Schema(description = "冻结标识")
|
||||
private String isProvisional;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工厂分页 Request VO")
|
||||
@Data
|
||||
public class ErpFactoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工厂编码")
|
||||
private String number;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工厂 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpFactoryRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9235")
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工厂新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpFactorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9235")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
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;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料数据 Response VO")
|
||||
@Data
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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 jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - ERP物料数据新增/修改 Request VO")
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线明细分页 Request VO")
|
||||
@Data
|
||||
public class ErpProcessDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "ERP工艺路线主键", example = "30589")
|
||||
private String processId;
|
||||
|
||||
@Schema(description = "工序编码")
|
||||
private BigDecimal processingNumber;
|
||||
|
||||
@Schema(description = "工序描述", example = "李四")
|
||||
private String processingName;
|
||||
|
||||
@Schema(description = "作业的计量单位")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "工作中心编号")
|
||||
private String workCenterNumber;
|
||||
|
||||
@Schema(description = "工作中心描述", example = "张三")
|
||||
private String workCenterName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpProcessDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5707")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "ERP工艺路线主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30589")
|
||||
@ExcelProperty("ERP工艺路线主键")
|
||||
private String processId;
|
||||
|
||||
@Schema(description = "工序编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工序编码")
|
||||
private BigDecimal processingNumber;
|
||||
|
||||
@Schema(description = "工序描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("工序描述")
|
||||
private String processingName;
|
||||
|
||||
@Schema(description = "作业的计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("作业的计量单位")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "工作中心编号")
|
||||
@ExcelProperty("工作中心编号")
|
||||
private String workCenterNumber;
|
||||
|
||||
@Schema(description = "工作中心描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("工作中心描述")
|
||||
private String workCenterName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpProcessDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5707")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "ERP工艺路线主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30589")
|
||||
@NotEmpty(message = "ERP工艺路线主键不能为空")
|
||||
private String processId;
|
||||
|
||||
@Schema(description = "工序编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工序编码不能为空")
|
||||
private BigDecimal processingNumber;
|
||||
|
||||
@Schema(description = "工序描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "工序描述不能为空")
|
||||
private String processingName;
|
||||
|
||||
@Schema(description = "作业的计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "作业的计量单位不能为空")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "工作中心编号")
|
||||
private String workCenterNumber;
|
||||
|
||||
@Schema(description = "工作中心描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "工作中心描述不能为空")
|
||||
private String workCenterName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线分页 Request VO")
|
||||
@Data
|
||||
public class ErpProcessPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料描述", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "工艺路线组")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", example = "27504")
|
||||
private Long groupCount;
|
||||
|
||||
@Schema(description = "工艺路线描述")
|
||||
private String blineDescription;
|
||||
|
||||
@Schema(description = "计量单位")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "用途")
|
||||
private String useDescription;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpProcessRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13200")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料描述", example = "李四")
|
||||
@ExcelProperty("物料描述")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "工艺路线组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工艺路线组")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", requiredMode = Schema.RequiredMode.REQUIRED, example = "27504")
|
||||
@ExcelProperty("组计数器")
|
||||
private Long groupCount;
|
||||
|
||||
@Schema(description = "工艺路线描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工艺路线描述")
|
||||
private String blineDescription;
|
||||
|
||||
@Schema(description = "计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计量单位")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "用途")
|
||||
@ExcelProperty("用途")
|
||||
private String useDescription;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP工艺路线新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpProcessSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13200")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工厂编码不能为空")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料编码不能为空")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "物料描述", example = "李四")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "工艺路线组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工艺路线组不能为空")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", requiredMode = Schema.RequiredMode.REQUIRED, example = "27504")
|
||||
@NotNull(message = "组计数器不能为空")
|
||||
private Long groupCount;
|
||||
|
||||
@Schema(description = "工艺路线描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工艺路线描述不能为空")
|
||||
private String blineDescription;
|
||||
|
||||
@Schema(description = "计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "计量单位不能为空")
|
||||
private String uom;
|
||||
|
||||
@Schema(description = "用途")
|
||||
private String useDescription;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "状态不能为空")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP生产版本分页 Request VO")
|
||||
@Data
|
||||
public class ErpProductiveVersionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "生产版本编码")
|
||||
private String productiveVersionNumber;
|
||||
|
||||
@Schema(description = "生产版本描述", example = "赵六")
|
||||
private String productiveVersionName;
|
||||
|
||||
@Schema(description = "备选BOM编号")
|
||||
private String bomNumber;
|
||||
|
||||
@Schema(description = "工艺路线组")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", example = "15610")
|
||||
private Long groupCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP生产版本 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpProductiveVersionRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27745")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工厂编码")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "生产版本编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产版本编码")
|
||||
private String productiveVersionNumber;
|
||||
|
||||
@Schema(description = "生产版本描述", example = "赵六")
|
||||
@ExcelProperty("生产版本描述")
|
||||
private String productiveVersionName;
|
||||
|
||||
@Schema(description = "备选BOM编号")
|
||||
@ExcelProperty("备选BOM编号")
|
||||
private String bomNumber;
|
||||
|
||||
@Schema(description = "工艺路线组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工艺路线组")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", requiredMode = Schema.RequiredMode.REQUIRED, example = "15610")
|
||||
@ExcelProperty("组计数器")
|
||||
private Long groupCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP生产版本新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpProductiveVersionSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27745")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "工厂编码不能为空")
|
||||
private BigDecimal factoryNumber;
|
||||
|
||||
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料编码不能为空")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "生产版本编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产版本编码不能为空")
|
||||
private String productiveVersionNumber;
|
||||
|
||||
@Schema(description = "生产版本描述", example = "赵六")
|
||||
private String productiveVersionName;
|
||||
|
||||
@Schema(description = "备选BOM编号")
|
||||
private String bomNumber;
|
||||
|
||||
@Schema(description = "工艺路线组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工艺路线组不能为空")
|
||||
private String blineGroup;
|
||||
|
||||
@Schema(description = "组计数器", requiredMode = Schema.RequiredMode.REQUIRED, example = "15610")
|
||||
@NotNull(message = "组计数器不能为空")
|
||||
private Long groupCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* ERP物料清单(BOM) DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_bm")
|
||||
@KeySequence("sply_erp_bm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpBomDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@TableField("FACT_NUM")
|
||||
private BigDecimal factoryNumber;
|
||||
/**
|
||||
* 顶层物料编码
|
||||
*/
|
||||
@TableField("UP_MTRL")
|
||||
private String upMaterial;
|
||||
/**
|
||||
* 可选BOM
|
||||
*/
|
||||
@TableField("USE_ITM")
|
||||
private String useItem;
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@TableField("MTRL_DSP")
|
||||
private String materialDescription;
|
||||
/**
|
||||
* 基本数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 基本单位
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* ERP物料清单(BOM)明细 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_bm_dtl")
|
||||
@KeySequence("sply_erp_bm_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpBomDetailDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* BOM主键
|
||||
*/
|
||||
@TableField("BM_ID")
|
||||
private String bomId;
|
||||
/**
|
||||
* ERP物料清单主键
|
||||
*/
|
||||
@TableField("ERP_BM_ID")
|
||||
private String erpBomId;
|
||||
/**
|
||||
* 子项物料编码
|
||||
*/
|
||||
@TableField("CHD_MTRL_NUM")
|
||||
private String childMaterialNumber;
|
||||
/**
|
||||
* 子项物料描述
|
||||
*/
|
||||
@TableField("CHD_MTRL_DSP")
|
||||
private BigDecimal childMaterialDescription;
|
||||
/**
|
||||
* 子项类别
|
||||
*/
|
||||
@TableField("CTGR")
|
||||
private String category;
|
||||
/**
|
||||
* 基本数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 基本单位
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
@TableField("IDE_TP")
|
||||
private String identificationType;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
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;
|
||||
import lombok.*;
|
||||
/**
|
||||
* ERP公司 DO
|
||||
*
|
||||
@@ -12,7 +10,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
@TableName("sply_erp_cpn")
|
||||
@KeySequence("sply_erp_cpn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
@EqualsAndHashCode
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@@ -20,9 +19,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpCompanyDO extends BaseDO {
|
||||
|
||||
|
||||
//public class ErpCompanyDO extends BaseDO {
|
||||
public class ErpCompanyDO{
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -45,4 +43,7 @@ public class ErpCompanyDO extends BaseDO {
|
||||
@TableField("CUR")
|
||||
private String currency;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer TENANT_ID;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* ERP成本中心 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_cctr")
|
||||
@KeySequence("sply_erp_cctr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpCostcenterDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 成本中心编码
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
/**
|
||||
* 成本中心描述
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 工区必填;使用这个基础数据是,如果为X时必须和工区使用
|
||||
*/
|
||||
@TableField("IS_USE")
|
||||
private String isUse;
|
||||
/**
|
||||
* 功能范围
|
||||
*/
|
||||
@TableField("SCO_NUM")
|
||||
private String scopeNumber;
|
||||
/**
|
||||
* 功能范围描述
|
||||
*/
|
||||
@TableField("SCO_NAME")
|
||||
private String scopeName;
|
||||
/**
|
||||
* 起始日期
|
||||
*/
|
||||
@TableField("STRT_DT")
|
||||
private LocalDateTime startDate;
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
@TableField("END_DT")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
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;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* ERP客商主数据 DO
|
||||
*
|
||||
@@ -14,7 +12,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
@TableName("sply_erp_cstm")
|
||||
@KeySequence("sply_erp_cstm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
@EqualsAndHashCode
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@@ -22,7 +21,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpCustomerDO extends BaseDO {
|
||||
//public class ErpCustomerDO extends BaseDO {
|
||||
public class ErpCustomerDO{
|
||||
|
||||
|
||||
|
||||
@@ -76,10 +76,8 @@ public class ErpCustomerDO extends BaseDO {
|
||||
*/
|
||||
@TableField("IS_PRVS")
|
||||
private String isProvisional;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer TENANT_ID;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
/**
|
||||
* ERP工厂 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_fact")
|
||||
@KeySequence("sply_erp_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpFactoryDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
/**
|
||||
* 公司编号
|
||||
*/
|
||||
@TableField("CPN_ID")
|
||||
private Long companyId;
|
||||
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
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;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* ERP物料数据 DO
|
||||
*
|
||||
@@ -13,7 +12,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
@TableName("sply_erp_mtrl")
|
||||
@KeySequence("sply_erp_mtrl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
@EqualsAndHashCode
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@@ -21,7 +21,8 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpMaterialDO extends BaseDO {
|
||||
//public class ErpMaterialDO extends BaseDO {
|
||||
public class ErpMaterialDO {
|
||||
|
||||
|
||||
|
||||
@@ -96,4 +97,7 @@ public class ErpMaterialDO extends BaseDO {
|
||||
@TableField("MTRL_LEN_DSP")
|
||||
private String materialLengthDescription;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer TENANT_ID;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* ERP工艺路线 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_prcs")
|
||||
@KeySequence("sply_erp_prcs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpProcessDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@TableField("FACT_NUM")
|
||||
private BigDecimal factoryNumber;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField("MTRL_NUM")
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 工艺路线组
|
||||
*/
|
||||
@TableField("BLN_GRP")
|
||||
private String blineGroup;
|
||||
/**
|
||||
* 组计数器
|
||||
*/
|
||||
@TableField("GRP_CNT")
|
||||
private Long groupCount;
|
||||
/**
|
||||
* 工艺路线描述
|
||||
*/
|
||||
@TableField("BLN_DSP")
|
||||
private String blineDescription;
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
@TableField("UOM")
|
||||
private String uom;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@TableField("USE_DSP")
|
||||
private String useDescription;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("STS")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* ERP工艺路线明细 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_prcs_dtl")
|
||||
@KeySequence("sply_erp_prcs_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpProcessDetailDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* ERP工艺路线主键
|
||||
*/
|
||||
@TableField("PRCS_ID")
|
||||
private String processId;
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
@TableField("PROC_NUM")
|
||||
private BigDecimal processingNumber;
|
||||
/**
|
||||
* 工序描述
|
||||
*/
|
||||
@TableField("PROC_NAME")
|
||||
private String processingName;
|
||||
/**
|
||||
* 作业的计量单位
|
||||
*/
|
||||
@TableField("UOM")
|
||||
private String uom;
|
||||
/**
|
||||
* 工作中心编号
|
||||
*/
|
||||
@TableField("WRK_CTR_NUM")
|
||||
private String workCenterNumber;
|
||||
/**
|
||||
* 工作中心描述
|
||||
*/
|
||||
@TableField("WRK_CTR_NAME")
|
||||
private String workCenterName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
/**
|
||||
* ERP生产版本 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_pdtv_ver")
|
||||
@KeySequence("sply_erp_pdtv_ver_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpProductiveVersionDO extends BaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@TableField("FACT_NUM")
|
||||
private BigDecimal factoryNumber;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField("MTRL_NUM")
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 生产版本编码
|
||||
*/
|
||||
@TableField("PDTV_VER_NUM")
|
||||
private String productiveVersionNumber;
|
||||
/**
|
||||
* 生产版本描述
|
||||
*/
|
||||
@TableField("PDTV_VER_NAME")
|
||||
private String productiveVersionName;
|
||||
/**
|
||||
* 备选BOM编号
|
||||
*/
|
||||
@TableField("BM_NUM")
|
||||
private String bomNumber;
|
||||
/**
|
||||
* 工艺路线组
|
||||
*/
|
||||
@TableField("BLN_GRP")
|
||||
private String blineGroup;
|
||||
/**
|
||||
* 组计数器
|
||||
*/
|
||||
@TableField("GRP_CNT")
|
||||
private Long groupCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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.ErpBomDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM)明细 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpBomDetailMapper extends BaseMapperX<ErpBomDetailDO> {
|
||||
|
||||
default PageResult<ErpBomDetailDO> selectPage(ErpBomDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpBomDetailDO>()
|
||||
.eqIfPresent(ErpBomDetailDO::getBomId, reqVO.getBomId())
|
||||
.eqIfPresent(ErpBomDetailDO::getErpBomId, reqVO.getErpBomId())
|
||||
.eqIfPresent(ErpBomDetailDO::getChildMaterialNumber, reqVO.getChildMaterialNumber())
|
||||
.eqIfPresent(ErpBomDetailDO::getChildMaterialDescription, reqVO.getChildMaterialDescription())
|
||||
.eqIfPresent(ErpBomDetailDO::getCategory, reqVO.getCategory())
|
||||
.eqIfPresent(ErpBomDetailDO::getQuantity, reqVO.getQuantity())
|
||||
.eqIfPresent(ErpBomDetailDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(ErpBomDetailDO::getIdentificationType, reqVO.getIdentificationType())
|
||||
.orderByDesc(ErpBomDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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.ErpBomPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM) Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
|
||||
|
||||
default PageResult<ErpBomDO> selectPage(ErpBomPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpBomDO>()
|
||||
.eqIfPresent(ErpBomDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||
.eqIfPresent(ErpBomDO::getUpMaterial, reqVO.getUpMaterial())
|
||||
.eqIfPresent(ErpBomDO::getUseItem, reqVO.getUseItem())
|
||||
.eqIfPresent(ErpBomDO::getMaterialDescription, reqVO.getMaterialDescription())
|
||||
.eqIfPresent(ErpBomDO::getQuantity, reqVO.getQuantity())
|
||||
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
||||
.orderByDesc(ErpBomDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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.ErpCostcenterPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCostcenterDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP成本中心 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpCostcenterMapper extends BaseMapperX<ErpCostcenterDO> {
|
||||
|
||||
default PageResult<ErpCostcenterDO> selectPage(ErpCostcenterPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCostcenterDO>()
|
||||
.eqIfPresent(ErpCostcenterDO::getNumber, reqVO.getNumber())
|
||||
.likeIfPresent(ErpCostcenterDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpCostcenterDO::getIsUse, reqVO.getIsUse())
|
||||
.eqIfPresent(ErpCostcenterDO::getScopeNumber, reqVO.getScopeNumber())
|
||||
.likeIfPresent(ErpCostcenterDO::getScopeName, reqVO.getScopeName())
|
||||
.betweenIfPresent(ErpCostcenterDO::getStartDate, reqVO.getStartDate())
|
||||
.betweenIfPresent(ErpCostcenterDO::getEndDate, reqVO.getEndDate())
|
||||
.orderByDesc(ErpCostcenterDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,8 @@ 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 cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,6 @@ public interface ErpCustomerMapper extends BaseMapperX<ErpCustomerDO> {
|
||||
.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,25 @@
|
||||
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.ErpFactoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpFactoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP工厂 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> {
|
||||
|
||||
default PageResult<ErpFactoryDO> selectPage(ErpFactoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
|
||||
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
|
||||
.orderByDesc(ErpFactoryDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
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.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
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;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
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.ErpProcessDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP工艺路线明细 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpProcessDetailMapper extends BaseMapperX<ErpProcessDetailDO> {
|
||||
|
||||
default PageResult<ErpProcessDetailDO> selectPage(ErpProcessDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDetailDO>()
|
||||
.eqIfPresent(ErpProcessDetailDO::getProcessId, reqVO.getProcessId())
|
||||
.eqIfPresent(ErpProcessDetailDO::getProcessingNumber, reqVO.getProcessingNumber())
|
||||
.likeIfPresent(ErpProcessDetailDO::getProcessingName, reqVO.getProcessingName())
|
||||
.eqIfPresent(ErpProcessDetailDO::getUom, reqVO.getUom())
|
||||
.eqIfPresent(ErpProcessDetailDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
|
||||
.likeIfPresent(ErpProcessDetailDO::getWorkCenterName, reqVO.getWorkCenterName())
|
||||
.orderByDesc(ErpProcessDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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.ErpProcessPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP工艺路线 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpProcessMapper extends BaseMapperX<ErpProcessDO> {
|
||||
|
||||
default PageResult<ErpProcessDO> selectPage(ErpProcessPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDO>()
|
||||
.eqIfPresent(ErpProcessDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||
.eqIfPresent(ErpProcessDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||
.likeIfPresent(ErpProcessDO::getMaterialName, reqVO.getMaterialName())
|
||||
.eqIfPresent(ErpProcessDO::getBlineGroup, reqVO.getBlineGroup())
|
||||
.eqIfPresent(ErpProcessDO::getGroupCount, reqVO.getGroupCount())
|
||||
.eqIfPresent(ErpProcessDO::getBlineDescription, reqVO.getBlineDescription())
|
||||
.eqIfPresent(ErpProcessDO::getUom, reqVO.getUom())
|
||||
.eqIfPresent(ErpProcessDO::getUseDescription, reqVO.getUseDescription())
|
||||
.eqIfPresent(ErpProcessDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(ErpProcessDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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.ErpProductiveVersionPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP生产版本 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpProductiveVersionMapper extends BaseMapperX<ErpProductiveVersionDO> {
|
||||
|
||||
default PageResult<ErpProductiveVersionDO> selectPage(ErpProductiveVersionPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductiveVersionDO>()
|
||||
.eqIfPresent(ErpProductiveVersionDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||
.eqIfPresent(ErpProductiveVersionDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||
.eqIfPresent(ErpProductiveVersionDO::getProductiveVersionNumber, reqVO.getProductiveVersionNumber())
|
||||
.likeIfPresent(ErpProductiveVersionDO::getProductiveVersionName, reqVO.getProductiveVersionName())
|
||||
.eqIfPresent(ErpProductiveVersionDO::getBomNumber, reqVO.getBomNumber())
|
||||
.eqIfPresent(ErpProductiveVersionDO::getBlineGroup, reqVO.getBlineGroup())
|
||||
.eqIfPresent(ErpProductiveVersionDO::getGroupCount, reqVO.getGroupCount())
|
||||
.orderByDesc(ErpProductiveVersionDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM)明细 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpBomDetailService {
|
||||
|
||||
/**
|
||||
* 创建ERP物料清单(BOM)明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpBomDetailRespVO createErpBomDetail(@Valid ErpBomDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP物料清单(BOM)明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpBomDetail(@Valid ErpBomDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP物料清单(BOM)明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpBomDetail(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP物料清单(BOM)明细
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpBomDetailListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP物料清单(BOM)明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP物料清单(BOM)明细
|
||||
*/
|
||||
ErpBomDetailDO getErpBomDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP物料清单(BOM)明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP物料清单(BOM)明细分页
|
||||
*/
|
||||
PageResult<ErpBomDetailDO> getErpBomDetailPage(ErpBomDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpBomDetailMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_BOM_DETAIL_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM)明细 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpBomDetailServiceImpl implements ErpBomDetailService {
|
||||
|
||||
@Resource
|
||||
private ErpBomDetailMapper erpBomDetailMapper;
|
||||
|
||||
@Override
|
||||
public ErpBomDetailRespVO createErpBomDetail(ErpBomDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpBomDetailDO erpBomDetail = BeanUtils.toBean(createReqVO, ErpBomDetailDO.class);
|
||||
erpBomDetailMapper.insert(erpBomDetail);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpBomDetail, ErpBomDetailRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpBomDetail(ErpBomDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpBomDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpBomDetailDO updateObj = BeanUtils.toBean(updateReqVO, ErpBomDetailDO.class);
|
||||
erpBomDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpBomDetail(Long id) {
|
||||
// 校验存在
|
||||
validateErpBomDetailExists(id);
|
||||
// 删除
|
||||
erpBomDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpBomDetailListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpBomDetailExists(ids);
|
||||
// 删除
|
||||
erpBomDetailMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpBomDetailExists(List<Long> ids) {
|
||||
List<ErpBomDetailDO> list = erpBomDetailMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_BOM_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpBomDetailExists(Long id) {
|
||||
if (erpBomDetailMapper.selectById(id) == null) {
|
||||
throw exception(ERP_BOM_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpBomDetailDO getErpBomDetail(Long id) {
|
||||
return erpBomDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpBomDetailDO> getErpBomDetailPage(ErpBomDetailPageReqVO pageReqVO) {
|
||||
return erpBomDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM) Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpBomService {
|
||||
|
||||
/**
|
||||
* 创建ERP物料清单(BOM)
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpBomRespVO createErpBom(@Valid ErpBomSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP物料清单(BOM)
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpBom(@Valid ErpBomSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP物料清单(BOM)
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpBom(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP物料清单(BOM)
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpBomListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP物料清单(BOM)
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP物料清单(BOM)
|
||||
*/
|
||||
ErpBomDO getErpBom(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP物料清单(BOM)分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP物料清单(BOM)分页
|
||||
*/
|
||||
PageResult<ErpBomDO> getErpBomPage(ErpBomPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpBomSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpBomMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_BOM_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP物料清单(BOM) Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpBomServiceImpl implements ErpBomService {
|
||||
|
||||
@Resource
|
||||
private ErpBomMapper erpBomMapper;
|
||||
|
||||
@Override
|
||||
public ErpBomRespVO createErpBom(ErpBomSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpBomDO erpBom = BeanUtils.toBean(createReqVO, ErpBomDO.class);
|
||||
erpBomMapper.insert(erpBom);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpBom, ErpBomRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpBom(ErpBomSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpBomExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpBomDO updateObj = BeanUtils.toBean(updateReqVO, ErpBomDO.class);
|
||||
erpBomMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpBom(Long id) {
|
||||
// 校验存在
|
||||
validateErpBomExists(id);
|
||||
// 删除
|
||||
erpBomMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpBomListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpBomExists(ids);
|
||||
// 删除
|
||||
erpBomMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpBomExists(List<Long> ids) {
|
||||
List<ErpBomDO> list = erpBomMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_BOM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpBomExists(Long id) {
|
||||
if (erpBomMapper.selectById(id) == null) {
|
||||
throw exception(ERP_BOM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpBomDO getErpBom(Long id) {
|
||||
return erpBomMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpBomDO> getErpBomPage(ErpBomPageReqVO pageReqVO) {
|
||||
return erpBomMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
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.*;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP公司 Service 接口
|
||||
|
||||
@@ -2,28 +2,24 @@ 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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.common.conf.ErpConfig;
|
||||
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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_COMPANY_NOT_EXISTS;
|
||||
@@ -38,15 +34,12 @@ import static dm.jdbc.util.DriverUtil.log;
|
||||
@Validated
|
||||
public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
|
||||
@Value("${erp.address}")
|
||||
private String erpAddress;
|
||||
|
||||
@Value("${erp.sapsys}")
|
||||
private String sapsys;
|
||||
|
||||
@Resource
|
||||
private ErpCompanyMapper erpCompanyMapper;
|
||||
|
||||
@Resource
|
||||
private ErpConfig erpConfig;
|
||||
|
||||
@Override
|
||||
public ErpCompanyRespVO createErpCompany(ErpCompanySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -105,61 +98,91 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
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接口调用失败或返回错误标志");
|
||||
OftenEnum.FuncnrEnum funcnrEnum =OftenEnum.FuncnrEnum.公司代码;
|
||||
String funcnr = funcnrEnum.getFuncnr();
|
||||
// 1. 调用ERP接口获取数据
|
||||
JSONArray dataArray = erpConfig.fetchDataFromERP(funcnr, null);
|
||||
if (dataArray == null || dataArray.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 处理公司数据,区分新增和更新
|
||||
ProcessingResult result = processData(dataArray,funcnrEnum);
|
||||
|
||||
// 3. 批量保存数据
|
||||
saveData(result);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("调用ERP RFC接口失败: {}", e);
|
||||
throw new RuntimeException("调用ERP RFC接口失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据,区分新增和更新
|
||||
*/
|
||||
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnr) {
|
||||
String key = "erp" + funcnr.getFuncnr();
|
||||
Map<String,List<String>> numbers = erpConfig.numbers(dataArray, key,funcnr.getDatakey());
|
||||
List<String> allnumbers = numbers.get("all");
|
||||
List<String> comnumbers = numbers.get("com");
|
||||
List<ErpCompanyDO> toUpdate = new ArrayList<>();
|
||||
List<ErpCompanyDO> toInsert = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject dataJson = dataArray.getJSONObject(i);
|
||||
if (dataJson != null) {
|
||||
String number = dataJson.getString("BUKRS").trim();
|
||||
if (number != null) {
|
||||
ErpCompanyDO DO = new ErpCompanyDO();
|
||||
DO.setName(dataJson.getString("BUTXT"));
|
||||
DO.setNumber(number);
|
||||
DO.setCurrency(dataJson.getString("WAERS"));
|
||||
if (comnumbers.contains(number)) {
|
||||
// 更新
|
||||
toUpdate.add(DO);
|
||||
} else {
|
||||
// 新增
|
||||
toInsert.add(DO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, toInsert,key,allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
*/
|
||||
private void saveData(ProcessingResult result) {
|
||||
// 批量新增和更新
|
||||
if (!result.toInsert.isEmpty()) {
|
||||
erpCompanyMapper.insertBatch(result.toInsert);
|
||||
}
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpCompanyMapper.updateBatch(result.toUpdate);
|
||||
}
|
||||
erpConfig.updateRedisCache(result.key,result.allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据处理结果封装类
|
||||
*/
|
||||
private static class ProcessingResult {
|
||||
private final List<ErpCompanyDO> toUpdate;
|
||||
private final List<ErpCompanyDO> toInsert;
|
||||
private final String key;
|
||||
private final List<String> allnumbers;
|
||||
|
||||
public ProcessingResult(List<ErpCompanyDO> toUpdate, List<ErpCompanyDO> toInsert,String key,List<String> allnumbers) {
|
||||
this.toUpdate = toUpdate;
|
||||
this.toInsert = toInsert;
|
||||
this.key = key;
|
||||
this.allnumbers = allnumbers;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCostcenterDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP成本中心 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpCostcenterService {
|
||||
|
||||
/**
|
||||
* 创建ERP成本中心
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpCostcenterRespVO createErpCostcenter(@Valid ErpCostcenterSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP成本中心
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpCostcenter(@Valid ErpCostcenterSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP成本中心
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpCostcenter(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP成本中心
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpCostcenterListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP成本中心
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP成本中心
|
||||
*/
|
||||
ErpCostcenterDO getErpCostcenter(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP成本中心分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP成本中心分页
|
||||
*/
|
||||
PageResult<ErpCostcenterDO> getErpCostcenterPage(ErpCostcenterPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpCostcenterSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCostcenterDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCostcenterMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_COSTCENTER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP成本中心 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpCostcenterServiceImpl implements ErpCostcenterService {
|
||||
|
||||
@Resource
|
||||
private ErpCostcenterMapper erpCostcenterMapper;
|
||||
|
||||
@Override
|
||||
public ErpCostcenterRespVO createErpCostcenter(ErpCostcenterSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpCostcenterDO erpCostcenter = BeanUtils.toBean(createReqVO, ErpCostcenterDO.class);
|
||||
erpCostcenterMapper.insert(erpCostcenter);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpCostcenter, ErpCostcenterRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpCostcenter(ErpCostcenterSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpCostcenterExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpCostcenterDO updateObj = BeanUtils.toBean(updateReqVO, ErpCostcenterDO.class);
|
||||
erpCostcenterMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCostcenter(Long id) {
|
||||
// 校验存在
|
||||
validateErpCostcenterExists(id);
|
||||
// 删除
|
||||
erpCostcenterMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpCostcenterListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpCostcenterExists(ids);
|
||||
// 删除
|
||||
erpCostcenterMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpCostcenterExists(List<Long> ids) {
|
||||
List<ErpCostcenterDO> list = erpCostcenterMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_COSTCENTER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpCostcenterExists(Long id) {
|
||||
if (erpCostcenterMapper.selectById(id) == null) {
|
||||
throw exception(ERP_COSTCENTER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpCostcenterDO getErpCostcenter(Long id) {
|
||||
return erpCostcenterMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpCostcenterDO> getErpCostcenterPage(ErpCostcenterPageReqVO pageReqVO) {
|
||||
return erpCostcenterMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
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.framework.common.pojo.PageResult;
|
||||
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;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP客商主数据 Service 接口
|
||||
@@ -61,4 +61,7 @@ public interface ErpCustomerService {
|
||||
*/
|
||||
PageResult<ErpCustomerDO> getErpCustomerPage(ErpCustomerPageReqVO pageReqVO);
|
||||
|
||||
void callErpRfcInterface();
|
||||
|
||||
void initialize();
|
||||
}
|
||||
@@ -1,22 +1,35 @@
|
||||
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.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.common.conf.ErpConfig;
|
||||
import cn.iocoder.yudao.module.erp.common.enums.OftenEnum;
|
||||
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 cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpCustomerDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpCustomerMapper;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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 java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
/**
|
||||
* ERP客商主数据 Service 实现类
|
||||
@@ -27,6 +40,12 @@ import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_CUSTOMER_
|
||||
@Validated
|
||||
public class ErpCustomerServiceImpl implements ErpCustomerService {
|
||||
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
@Resource
|
||||
private ErpConfig erpConfig;
|
||||
|
||||
@Resource
|
||||
private ErpCustomerMapper erpCustomerMapper;
|
||||
|
||||
@@ -87,4 +106,129 @@ public class ErpCustomerServiceImpl implements ErpCustomerService {
|
||||
return erpCustomerMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void callErpRfcInterface() {
|
||||
try {
|
||||
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.客商信息;
|
||||
String funcnr = funcnrEnum.getFuncnr();
|
||||
// 构建req参数
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
List<Map<String, String>> datumList = new ArrayList<>();
|
||||
Map<String, String> datumEntry = new HashMap<>();
|
||||
// 构建datum参数数组
|
||||
datumEntry.put("sign", "I");
|
||||
datumEntry.put("option", "EQ");
|
||||
datumEntry.put("low", LocalDate.now().toString());
|
||||
// datumEntry.put("low", "2021-05-17");
|
||||
datumList.add(datumEntry);
|
||||
req.put(funcnrEnum.getDatekey(), datumList);
|
||||
// req.put("BUKRS", "3001");
|
||||
|
||||
// 1. 调用ERP接口获取数据
|
||||
for (OftenEnum.ModeTypeEnum type : OftenEnum.ModeTypeEnum.values()) {
|
||||
req.put("mode", type.modetype);
|
||||
JSONArray dataArray = erpConfig.fetchDataFromERP(funcnr, req);
|
||||
if (dataArray == null || dataArray.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2. 处理数据,区分新增和更新
|
||||
ProcessingResult result = processData(dataArray, funcnrEnum);
|
||||
|
||||
// 3. 批量保存数据
|
||||
saveData(result);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("调用ERP RFC接口失败: {}", e);
|
||||
throw new RuntimeException("调用ERP RFC接口失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据,区分新增和更新
|
||||
*/
|
||||
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnrEnum) {
|
||||
String key = "erp" + funcnrEnum.getFuncnr();
|
||||
Map<String, List<String>> numbers = erpConfig.numbers(dataArray, key, funcnrEnum.getDatakey());
|
||||
List<String> allnumbers = numbers.get("all");
|
||||
List<String> comnumbers = numbers.get("com");
|
||||
|
||||
List<ErpCustomerDO> toUpdate = new ArrayList<>();
|
||||
List<ErpCustomerDO> toInsert = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject dataJson = dataArray.getJSONObject(i);
|
||||
if (dataJson != null) {
|
||||
String number = dataJson.getString("PARTNER").trim();
|
||||
if (number != null) {
|
||||
ErpCustomerDO DO = new ErpCustomerDO();
|
||||
DO.setName(dataJson.getString("NAME_ORG1"));
|
||||
DO.setNumber(number);
|
||||
DO.setAccountGroup(dataJson.getString("BU_GROUP"));
|
||||
DO.setDescription(dataJson.getString("BU_SORT1"));
|
||||
DO.setCenterNumber(dataJson.getString("BU_SORT2"));
|
||||
DO.setCreateDate(LocalDateTime.parse(dataJson.getString("CRDAT")+"T00:00:00"));
|
||||
DO.setRepairDate(LocalDateTime.parse(dataJson.getString("CHDAT")+"T00:00:00"));
|
||||
DO.setIsGiveback(dataJson.getString("XDELE"));
|
||||
DO.setIsProvisional(dataJson.getString("XBLCK"));
|
||||
// DO.setType(type.modetype);
|
||||
|
||||
// 使用 Map 优化查找效率,避免每次遍历 comnumbers 列表
|
||||
if (comnumbers.contains(number)) {
|
||||
// 更新
|
||||
toUpdate.add(DO);
|
||||
} else {
|
||||
// 新增
|
||||
toInsert.add(DO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, toInsert, key, allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
*/
|
||||
private void saveData(ProcessingResult result) {
|
||||
// 批量新增和更新
|
||||
if (!result.toInsert.isEmpty()) {
|
||||
erpCustomerMapper.insertBatch(result.toInsert);
|
||||
}
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpCustomerMapper.updateBatch(result.toUpdate);
|
||||
}
|
||||
erpConfig.updateRedisCache(result.key, result.allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据处理结果封装类
|
||||
*/
|
||||
private static class ProcessingResult {
|
||||
private final List<ErpCustomerDO> toUpdate;
|
||||
private final List<ErpCustomerDO> toInsert;
|
||||
private final String key;
|
||||
private final List<String> allnumbers;
|
||||
|
||||
public ProcessingResult(List<ErpCustomerDO> toUpdate, List<ErpCustomerDO> toInsert, String key, List<String> allnumbers) {
|
||||
this.toUpdate = toUpdate;
|
||||
this.toInsert = toInsert;
|
||||
this.key = key;
|
||||
this.allnumbers = allnumbers;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
List<String> existingNumbers = erpCustomerMapper.selectList(new LambdaQueryWrapperX<ErpCustomerDO>())
|
||||
.stream()
|
||||
.map(ErpCustomerDO::getNumber)
|
||||
.collect(Collectors.toList());
|
||||
String key = "erp" + OftenEnum.FuncnrEnum.客商信息.getFuncnr();
|
||||
redisTemplate.opsForValue().set(key, existingNumbers);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpFactoryDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP工厂 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpFactoryService {
|
||||
|
||||
/**
|
||||
* 创建ERP工厂
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpFactoryRespVO createErpFactory(@Valid ErpFactorySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP工厂
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpFactory(@Valid ErpFactorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP工厂
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpFactory(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP工厂
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpFactoryListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP工厂
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP工厂
|
||||
*/
|
||||
ErpFactoryDO getErpFactory(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP工厂分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP工厂分页
|
||||
*/
|
||||
PageResult<ErpFactoryDO> getErpFactoryPage(ErpFactoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactoryRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpFactorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpFactoryDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpFactoryMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_FACTORY_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP工厂 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpFactoryServiceImpl implements ErpFactoryService {
|
||||
|
||||
@Resource
|
||||
private ErpFactoryMapper erpFactoryMapper;
|
||||
|
||||
@Override
|
||||
public ErpFactoryRespVO createErpFactory(ErpFactorySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpFactoryDO erpFactory = BeanUtils.toBean(createReqVO, ErpFactoryDO.class);
|
||||
erpFactoryMapper.insert(erpFactory);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpFactory, ErpFactoryRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpFactory(ErpFactorySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpFactoryExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpFactoryDO updateObj = BeanUtils.toBean(updateReqVO, ErpFactoryDO.class);
|
||||
erpFactoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpFactory(Long id) {
|
||||
// 校验存在
|
||||
validateErpFactoryExists(id);
|
||||
// 删除
|
||||
erpFactoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpFactoryListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpFactoryExists(ids);
|
||||
// 删除
|
||||
erpFactoryMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpFactoryExists(List<Long> ids) {
|
||||
List<ErpFactoryDO> list = erpFactoryMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_FACTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpFactoryExists(Long id) {
|
||||
if (erpFactoryMapper.selectById(id) == null) {
|
||||
throw exception(ERP_FACTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpFactoryDO getErpFactory(Long id) {
|
||||
return erpFactoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpFactoryDO> getErpFactoryPage(ErpFactoryPageReqVO pageReqVO) {
|
||||
return erpFactoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
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.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;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP物料数据 Service 接口
|
||||
@@ -61,4 +61,7 @@ public interface ErpMaterialService {
|
||||
*/
|
||||
PageResult<ErpMaterialDO> getErpMaterialPage(ErpMaterialPageReqVO pageReqVO);
|
||||
|
||||
void callErpRfcInterface();
|
||||
|
||||
void initialize();
|
||||
}
|
||||
@@ -1,22 +1,33 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.common.conf.ErpConfig;
|
||||
import cn.iocoder.yudao.module.erp.common.enums.OftenEnum;
|
||||
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 com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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 java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_MATERIAL_NOT_EXISTS;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
/**
|
||||
* ERP物料数据 Service 实现类
|
||||
@@ -29,6 +40,8 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
|
||||
@Resource
|
||||
private ErpMaterialMapper erpMaterialMapper;
|
||||
@Resource
|
||||
private ErpConfig erpConfig;
|
||||
|
||||
@Override
|
||||
public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) {
|
||||
@@ -87,4 +100,124 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
return erpMaterialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void callErpRfcInterface() {
|
||||
try {
|
||||
OftenEnum.FuncnrEnum funcnrEnum =OftenEnum.FuncnrEnum.物料数据;
|
||||
String funcnr = funcnrEnum.getFuncnr();
|
||||
// 构建req参数
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
List<Map<String, String>> datumList = new ArrayList<>();
|
||||
Map<String, String> datumEntry = new HashMap<>();
|
||||
datumEntry.put("sign", "I");
|
||||
datumEntry.put("option", "EQ");
|
||||
datumEntry.put("low", "2021-05-16");
|
||||
// datumEntry.put("low", LocalDate.now().toString());
|
||||
datumList.add(datumEntry);
|
||||
req.put(funcnrEnum.getDatakey(), datumList);
|
||||
|
||||
// 1. 调用ERP接口获取数据
|
||||
JSONArray dataArray = erpConfig.fetchDataFromERP(funcnr, req);
|
||||
if (dataArray == null || dataArray.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 处理公司数据,区分新增和更新
|
||||
ProcessingResult result = processData(dataArray,funcnrEnum);
|
||||
|
||||
// 3. 批量保存数据
|
||||
saveData(result);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("调用ERP RFC接口失败: {}", e);
|
||||
throw new RuntimeException("调用ERP RFC接口失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据,区分新增和更新
|
||||
*/
|
||||
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnr) {
|
||||
String key = "erp" + funcnr.getFuncnr();
|
||||
Map<String,List<String>> numbers = erpConfig.numbers(dataArray, key,funcnr.getDatakey());
|
||||
List<String> allnumbers = numbers.get("all");
|
||||
List<String> comnumbers = numbers.get("com");
|
||||
List<ErpMaterialDO> toUpdate = new ArrayList<>();
|
||||
List<ErpMaterialDO> toInsert = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject dataJson = dataArray.getJSONObject(i);
|
||||
if (dataJson != null) {
|
||||
String number = dataJson.getString("MATNR").trim();
|
||||
if (number != null) {
|
||||
ErpMaterialDO DO = new ErpMaterialDO();
|
||||
DO.setDownCenterNumber(number);
|
||||
DO.setCenterNumber(dataJson.getString("BISMT"));
|
||||
DO.setCreateDate(LocalDateTime.parse(dataJson.getString("ERSDA")));
|
||||
DO.setMaterialType(dataJson.getString("MTART"));
|
||||
DO.setMaterialGroupDate(dataJson.getString("MATKL"));
|
||||
DO.setExternalMaterialGroupDate(dataJson.getString("EXTWG"));
|
||||
DO.setUnit(dataJson.getString("MEINS"));
|
||||
DO.setUnitDescription(dataJson.getString("MSEHT"));
|
||||
DO.setMaterialTypeDescription(dataJson.getString("MTBEZ"));
|
||||
DO.setMaterialGroupDescription(dataJson.getString("WGBEZ"));
|
||||
DO.setExternalMaterialGroupDescription(dataJson.getString("EWBEZ"));
|
||||
DO.setMaterialName(dataJson.getString("MAKTX"));
|
||||
DO.setMaterialLengthDescription(dataJson.getString("LDESC"));
|
||||
|
||||
if (comnumbers.contains(number)) {
|
||||
// 更新
|
||||
toUpdate.add(DO);
|
||||
} else {
|
||||
// 新增
|
||||
toInsert.add(DO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, toInsert,key,allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
*/
|
||||
private void saveData(ProcessingResult result) {
|
||||
// 批量新增和更新
|
||||
if (!result.toInsert.isEmpty()) {
|
||||
erpMaterialMapper.insertBatch(result.toInsert);
|
||||
}
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpMaterialMapper.updateBatch(result.toUpdate);
|
||||
}
|
||||
erpConfig.updateRedisCache(result.key,result.allnumbers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据处理结果封装类
|
||||
*/
|
||||
private static class ProcessingResult {
|
||||
private final List<ErpMaterialDO> toUpdate;
|
||||
private final List<ErpMaterialDO> toInsert;
|
||||
private final String key;
|
||||
private final List<String> allnumbers;
|
||||
|
||||
public ProcessingResult(List<ErpMaterialDO> toUpdate, List<ErpMaterialDO> toInsert,String key,List<String> allnumbers) {
|
||||
this.toUpdate = toUpdate;
|
||||
this.toInsert = toInsert;
|
||||
this.key = key;
|
||||
this.allnumbers = allnumbers;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
List<String> existingNumbers = erpMaterialMapper.selectList(new LambdaQueryWrapperX<ErpMaterialDO>())
|
||||
.stream()
|
||||
.map(ErpMaterialDO::getDownCenterNumber)
|
||||
.collect(Collectors.toList());
|
||||
String key = "erp" + OftenEnum.FuncnrEnum.物料数据.getFuncnr();
|
||||
erpConfig.updateRedisCache(key, existingNumbers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDetailDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP工艺路线明细 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpProcessDetailService {
|
||||
|
||||
/**
|
||||
* 创建ERP工艺路线明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpProcessDetailRespVO createErpProcessDetail(@Valid ErpProcessDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP工艺路线明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpProcessDetail(@Valid ErpProcessDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP工艺路线明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpProcessDetail(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP工艺路线明细
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpProcessDetailListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP工艺路线明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP工艺路线明细
|
||||
*/
|
||||
ErpProcessDetailDO getErpProcessDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP工艺路线明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP工艺路线明细分页
|
||||
*/
|
||||
PageResult<ErpProcessDetailDO> getErpProcessDetailPage(ErpProcessDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessDetailSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDetailDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpProcessDetailMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_PROCESS_DETAIL_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP工艺路线明细 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpProcessDetailServiceImpl implements ErpProcessDetailService {
|
||||
|
||||
@Resource
|
||||
private ErpProcessDetailMapper erpProcessDetailMapper;
|
||||
|
||||
@Override
|
||||
public ErpProcessDetailRespVO createErpProcessDetail(ErpProcessDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpProcessDetailDO erpProcessDetail = BeanUtils.toBean(createReqVO, ErpProcessDetailDO.class);
|
||||
erpProcessDetailMapper.insert(erpProcessDetail);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpProcessDetail, ErpProcessDetailRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpProcessDetail(ErpProcessDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpProcessDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpProcessDetailDO updateObj = BeanUtils.toBean(updateReqVO, ErpProcessDetailDO.class);
|
||||
erpProcessDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProcessDetail(Long id) {
|
||||
// 校验存在
|
||||
validateErpProcessDetailExists(id);
|
||||
// 删除
|
||||
erpProcessDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProcessDetailListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpProcessDetailExists(ids);
|
||||
// 删除
|
||||
erpProcessDetailMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpProcessDetailExists(List<Long> ids) {
|
||||
List<ErpProcessDetailDO> list = erpProcessDetailMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_PROCESS_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpProcessDetailExists(Long id) {
|
||||
if (erpProcessDetailMapper.selectById(id) == null) {
|
||||
throw exception(ERP_PROCESS_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpProcessDetailDO getErpProcessDetail(Long id) {
|
||||
return erpProcessDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpProcessDetailDO> getErpProcessDetailPage(ErpProcessDetailPageReqVO pageReqVO) {
|
||||
return erpProcessDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP工艺路线 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpProcessService {
|
||||
|
||||
/**
|
||||
* 创建ERP工艺路线
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpProcessRespVO createErpProcess(@Valid ErpProcessSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP工艺路线
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpProcess(@Valid ErpProcessSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP工艺路线
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpProcess(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP工艺路线
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpProcessListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP工艺路线
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP工艺路线
|
||||
*/
|
||||
ErpProcessDO getErpProcess(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP工艺路线分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP工艺路线分页
|
||||
*/
|
||||
PageResult<ErpProcessDO> getErpProcessPage(ErpProcessPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProcessSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProcessDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpProcessMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_PROCESS_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP工艺路线 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpProcessServiceImpl implements ErpProcessService {
|
||||
|
||||
@Resource
|
||||
private ErpProcessMapper erpProcessMapper;
|
||||
|
||||
@Override
|
||||
public ErpProcessRespVO createErpProcess(ErpProcessSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpProcessDO erpProcess = BeanUtils.toBean(createReqVO, ErpProcessDO.class);
|
||||
erpProcessMapper.insert(erpProcess);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpProcess, ErpProcessRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpProcess(ErpProcessSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpProcessExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpProcessDO updateObj = BeanUtils.toBean(updateReqVO, ErpProcessDO.class);
|
||||
erpProcessMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProcess(Long id) {
|
||||
// 校验存在
|
||||
validateErpProcessExists(id);
|
||||
// 删除
|
||||
erpProcessMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProcessListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpProcessExists(ids);
|
||||
// 删除
|
||||
erpProcessMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpProcessExists(List<Long> ids) {
|
||||
List<ErpProcessDO> list = erpProcessMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_PROCESS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpProcessExists(Long id) {
|
||||
if (erpProcessMapper.selectById(id) == null) {
|
||||
throw exception(ERP_PROCESS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpProcessDO getErpProcess(Long id) {
|
||||
return erpProcessMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpProcessDO> getErpProcessPage(ErpProcessPageReqVO pageReqVO) {
|
||||
return erpProcessMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.erp.service.erp;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP生产版本 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ErpProductiveVersionService {
|
||||
|
||||
/**
|
||||
* 创建ERP生产版本
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ErpProductiveVersionRespVO createErpProductiveVersion(@Valid ErpProductiveVersionSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP生产版本
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateErpProductiveVersion(@Valid ErpProductiveVersionSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP生产版本
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteErpProductiveVersion(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除ERP生产版本
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteErpProductiveVersionListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得ERP生产版本
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP生产版本
|
||||
*/
|
||||
ErpProductiveVersionDO getErpProductiveVersion(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP生产版本分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP生产版本分页
|
||||
*/
|
||||
PageResult<ErpProductiveVersionDO> getErpProductiveVersionPage(ErpProductiveVersionPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionRespVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.erp.vo.ErpProductiveVersionSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.erp.ErpProductiveVersionDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.erp.ErpProductiveVersionMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.ERP_PRODUCTIVE_VERSION_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* ERP生产版本 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ErpProductiveVersionServiceImpl implements ErpProductiveVersionService {
|
||||
|
||||
@Resource
|
||||
private ErpProductiveVersionMapper erpProductiveVersionMapper;
|
||||
|
||||
@Override
|
||||
public ErpProductiveVersionRespVO createErpProductiveVersion(ErpProductiveVersionSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ErpProductiveVersionDO erpProductiveVersion = BeanUtils.toBean(createReqVO, ErpProductiveVersionDO.class);
|
||||
erpProductiveVersionMapper.insert(erpProductiveVersion);
|
||||
// 返回
|
||||
return BeanUtils.toBean(erpProductiveVersion, ErpProductiveVersionRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateErpProductiveVersion(ErpProductiveVersionSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateErpProductiveVersionExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ErpProductiveVersionDO updateObj = BeanUtils.toBean(updateReqVO, ErpProductiveVersionDO.class);
|
||||
erpProductiveVersionMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProductiveVersion(Long id) {
|
||||
// 校验存在
|
||||
validateErpProductiveVersionExists(id);
|
||||
// 删除
|
||||
erpProductiveVersionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpProductiveVersionListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpProductiveVersionExists(ids);
|
||||
// 删除
|
||||
erpProductiveVersionMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateErpProductiveVersionExists(List<Long> ids) {
|
||||
List<ErpProductiveVersionDO> list = erpProductiveVersionMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(ERP_PRODUCTIVE_VERSION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpProductiveVersionExists(Long id) {
|
||||
if (erpProductiveVersionMapper.selectById(id) == null) {
|
||||
throw exception(ERP_PRODUCTIVE_VERSION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpProductiveVersionDO getErpProductiveVersion(Long id) {
|
||||
return erpProductiveVersionMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpProductiveVersionDO> getErpProductiveVersionPage(ErpProductiveVersionPageReqVO pageReqVO) {
|
||||
return erpProductiveVersionMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.ErpBomDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpBomMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpCostcenterMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpFactoryMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpProcessDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpProcessMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.ErpProductiveVersionMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user