Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -10,16 +10,17 @@ import com.zt.plat.framework.common.exception.ErrorCode;
|
|||||||
public interface ErrorCodeConstants {
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
// ========== 示例模块 1-001-000-000 ==========
|
// ========== 示例模块 1-001-000-000 ==========
|
||||||
ErrorCode MATERIAL_OTHER_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode MATERIAL_OTHER_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料不存在");
|
||||||
ErrorCode ELEMENT_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode ELEMENT_NOT_EXISTS = new ErrorCode(1_001_000_001, "金属元素不存在");
|
||||||
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_001_000_001, "联系人不存在");
|
||||||
ErrorCode ACCOUNT_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode ACCOUNT_NOT_EXISTS = new ErrorCode(1_001_000_001, "账户条款不存在");
|
||||||
ErrorCode MATERIAL_DESTROY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode MATERIAL_DESTROY_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料回收率不存在");
|
||||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_001_000_001, "物料信息不存在");
|
||||||
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "公司关系不存在");
|
||||||
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "库位不存在");
|
||||||
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode WAREHOUSE_CODE_EXISTS = new ErrorCode(1_001_000_002, "库位编码已存在");
|
||||||
ErrorCode TAX_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "工厂不存在");
|
||||||
|
ErrorCode TAX_NOT_EXISTS = new ErrorCode(1_001_000_001, "公司关系不存在");
|
||||||
|
|
||||||
|
|
||||||
ErrorCode BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_027_100_001, "规则模型不存在");
|
ErrorCode BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_027_100_001, "规则模型不存在");
|
||||||
|
|||||||
@@ -33,4 +33,10 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String selectMaxCode();
|
String selectMaxCode();
|
||||||
|
|
||||||
|
default WarehouseDO selectByCode(String code){
|
||||||
|
return selectOne(new LambdaQueryWrapperX<WarehouseDO>()
|
||||||
|
.eq(WarehouseDO::getCoding, code)
|
||||||
|
.last("LIMIT 1"));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_CODE_EXISTS;
|
||||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_NOT_EXISTS;
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,16 +36,17 @@ public class WarehouseServiceImpl implements WarehouseService {
|
|||||||
// 插入
|
// 插入
|
||||||
WarehouseDO warehouse = BeanUtils.toBean(createReqVO, WarehouseDO.class);
|
WarehouseDO warehouse = BeanUtils.toBean(createReqVO, WarehouseDO.class);
|
||||||
// 库位编码自动生成,格式 KW-0001,依次新增
|
// 库位编码自动生成,格式 KW-0001,依次新增
|
||||||
String maxCode = warehouseMapper.selectMaxCode();
|
// String maxCode = warehouseMapper.selectMaxCode();
|
||||||
if (maxCode == null) {
|
// if (maxCode == null) {
|
||||||
warehouse.setCoding("KW-0001");
|
// warehouse.setCoding("KW-0001");
|
||||||
} else {
|
// } else {
|
||||||
String prefix = "KW-";
|
// String prefix = "KW-";
|
||||||
String numberPart = maxCode.substring(prefix.length());
|
// String numberPart = maxCode.substring(prefix.length());
|
||||||
int nextNumber = Integer.parseInt(numberPart) + 1;
|
// int nextNumber = Integer.parseInt(numberPart) + 1;
|
||||||
String nextCode = prefix + String.format("%04d", nextNumber);
|
// String nextCode = prefix + String.format("%04d", nextNumber);
|
||||||
warehouse.setCoding(nextCode);
|
// warehouse.setCoding(nextCode);
|
||||||
}
|
// }
|
||||||
|
validateWarehouseCodeExists(warehouse.getCoding());
|
||||||
warehouseMapper.insert(warehouse);
|
warehouseMapper.insert(warehouse);
|
||||||
// 返回
|
// 返回
|
||||||
return BeanUtils.toBean(warehouse, WarehouseRespVO.class);
|
return BeanUtils.toBean(warehouse, WarehouseRespVO.class);
|
||||||
@@ -68,12 +70,12 @@ public class WarehouseServiceImpl implements WarehouseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteWarehouseListByIds(List<Long> ids) {
|
public void deleteWarehouseListByIds(List<Long> ids) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateWarehouseExists(ids);
|
validateWarehouseExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
warehouseMapper.deleteByIds(ids);
|
warehouseMapper.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateWarehouseExists(List<Long> ids) {
|
private void validateWarehouseExists(List<Long> ids) {
|
||||||
List<WarehouseDO> list = warehouseMapper.selectByIds(ids);
|
List<WarehouseDO> list = warehouseMapper.selectByIds(ids);
|
||||||
@@ -88,6 +90,13 @@ public class WarehouseServiceImpl implements WarehouseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void validateWarehouseCodeExists(String code) {
|
||||||
|
WarehouseDO warehouse = warehouseMapper.selectByCode(code);
|
||||||
|
if (warehouse != null) {
|
||||||
|
throw exception(WAREHOUSE_CODE_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WarehouseDO getWarehouse(Long id) {
|
public WarehouseDO getWarehouse(Long id) {
|
||||||
return warehouseMapper.selectById(id);
|
return warehouseMapper.selectById(id);
|
||||||
@@ -101,7 +110,7 @@ public class WarehouseServiceImpl implements WarehouseService {
|
|||||||
@Override
|
@Override
|
||||||
public void enableWarehouseList(List<WarehouseRespVO> saveReqVOS) {
|
public void enableWarehouseList(List<WarehouseRespVO> saveReqVOS) {
|
||||||
List<WarehouseDO> updateObj = BeanUtils.toBean(saveReqVOS, WarehouseDO.class);
|
List<WarehouseDO> updateObj = BeanUtils.toBean(saveReqVOS, WarehouseDO.class);
|
||||||
List<BatchResult> count = warehouseMapper.updateById(updateObj);
|
List<BatchResult> count = warehouseMapper.updateById(updateObj);
|
||||||
if (CollUtil.isEmpty(count)) {
|
if (CollUtil.isEmpty(count)) {
|
||||||
throw exception(WAREHOUSE_NOT_EXISTS);
|
throw exception(WAREHOUSE_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,24 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class IntContractPageReq extends PageParam {
|
public class IntContractPageReq extends PageParam {
|
||||||
@Schema(description = "合同编号")
|
|
||||||
private String contractCode;
|
// 合同名称:模糊搜索
|
||||||
@Schema(description = "合同名称")
|
@Schema(description = "合同名称")
|
||||||
private String contractName;
|
private String contractName;
|
||||||
|
// 合同有效期起:日期选择
|
||||||
|
@Schema(description = "合同有效期起")
|
||||||
|
private String contractStartDate;
|
||||||
|
// 合同有效期止:日期选择
|
||||||
|
@Schema(description = "合同有效期止")
|
||||||
|
private String contractEndDate;
|
||||||
|
// 合同版本号:精确搜索 TODO 不确定
|
||||||
|
// 签约地:模糊搜索
|
||||||
|
@Schema(description = "签约地")
|
||||||
|
private String signSite;
|
||||||
|
// 经办人姓名:模糊搜索
|
||||||
|
@Schema(description = "经办人姓名")
|
||||||
|
private String createdUserName;
|
||||||
|
// 签约日期: 模糊搜索
|
||||||
|
@Schema(description = "签约日期")
|
||||||
|
private String signDate;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpMaterialDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
@@ -12,6 +13,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -30,7 +32,11 @@ public interface ErpExternalApi {
|
|||||||
@Operation(summary = "erp数据查询")
|
@Operation(summary = "erp数据查询")
|
||||||
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
||||||
|
|
||||||
@GetMapping(PREFIX + "/queryProductiveVersion")
|
@PostMapping(PREFIX + "/queryProductiveVersion")
|
||||||
@Operation(summary = "生产版本数据查询")
|
@Operation(summary = "生产版本数据查询")
|
||||||
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
|
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getMaterialUnit")
|
||||||
|
@Operation(summary = "根据物料编码查询对应计量单位")
|
||||||
|
CommonResult<String> getMaterialUnit(@RequestParam("downCenterNumber") String downCenterNumber);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.zt.plat.module.erp.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP物料数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class ErpMaterialDTO {
|
||||||
|
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "中铜物料编码;系统使用时使用该编码")
|
||||||
|
private String downCenterNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "中铝物料编码")
|
||||||
|
private String centerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private LocalDateTime createDate;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型", example = "2")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类组")
|
||||||
|
private String materialGroupDate;
|
||||||
|
|
||||||
|
@Schema(description = "外部物料小类组")
|
||||||
|
private String externalMaterialGroupDate;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位编码")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位描述")
|
||||||
|
private String unitDescription;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型描述")
|
||||||
|
private String materialTypeDescription;
|
||||||
|
|
||||||
|
@Schema(description = "物料组描述")
|
||||||
|
private String materialGroupDescription;
|
||||||
|
|
||||||
|
@Schema(description = "外部物料小类组描述")
|
||||||
|
private String externalMaterialGroupDescription;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "李四")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "物料长描述")
|
||||||
|
private String materialLengthDescription;
|
||||||
|
|
||||||
|
@Schema(description = "类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素缩写")
|
||||||
|
private String abbreviation;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素编码")
|
||||||
|
private String coding;
|
||||||
|
|
||||||
|
@Schema(description = "品位单位")
|
||||||
|
private String gradeUnit;
|
||||||
|
|
||||||
|
@Schema(description = "小数位数")
|
||||||
|
private Long decimalValue;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,9 +2,12 @@ package com.zt.plat.module.erp.api;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpMaterialDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpMaterialRespVO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpMaterialService;
|
||||||
import com.zt.plat.module.erp.service.erp.ErpProductiveVersionService;
|
import com.zt.plat.module.erp.service.erp.ErpProductiveVersionService;
|
||||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -34,6 +37,9 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
private ErpConfig erpConfig;
|
private ErpConfig erpConfig;
|
||||||
@Resource
|
@Resource
|
||||||
private ErpProductiveVersionService erpProductiveVersionService;
|
private ErpProductiveVersionService erpProductiveVersionService;
|
||||||
|
@Resource
|
||||||
|
private ErpMaterialService erpMaterialService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
||||||
@@ -52,4 +58,10 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
String productiveVersionNumber = erpProductiveVersionService.getErpProductiveVersionByFM(reqDTO);
|
String productiveVersionNumber = erpProductiveVersionService.getErpProductiveVersionByFM(reqDTO);
|
||||||
return success(productiveVersionNumber);
|
return success(productiveVersionNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<String> getMaterialUnit(String materialNumber) {
|
||||||
|
String materialUnit = erpMaterialService.getMaterialUnit(materialNumber);
|
||||||
|
return success(materialUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.erp.controller.admin.erp.vo;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
@@ -14,9 +15,11 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
|||||||
public class ErpProductiveOrderPageReqVO extends PageParam {
|
public class ErpProductiveOrderPageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "公司编号")
|
@Schema(description = "公司编号")
|
||||||
|
@NotEmpty(message = "公司编号不能为空")
|
||||||
private String companyNumber;
|
private String companyNumber;
|
||||||
|
|
||||||
@Schema(description = "工厂编码")
|
@Schema(description = "工厂编码")
|
||||||
|
@NotEmpty(message = "公司编号不能为空")
|
||||||
private String factoryNumber;
|
private String factoryNumber;
|
||||||
|
|
||||||
@Schema(description = "工厂名称", example = "赵六")
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
@@ -27,10 +30,12 @@ public class ErpProductiveOrderPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "基本开始日期")
|
@Schema(description = "基本开始日期")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@NotEmpty(message = "公司编号不能为空")
|
||||||
private LocalDateTime[] startDate;
|
private LocalDateTime[] startDate;
|
||||||
|
|
||||||
@Schema(description = "基本完成日期")
|
@Schema(description = "基本完成日期")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@NotEmpty(message = "公司编号不能为空")
|
||||||
private LocalDateTime[] endDate;
|
private LocalDateTime[] endDate;
|
||||||
|
|
||||||
@Schema(description = "主产品物料编号")
|
@Schema(description = "主产品物料编号")
|
||||||
|
|||||||
@@ -40,5 +40,11 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
|
|||||||
|
|
||||||
String selectMaxCode();
|
String selectMaxCode();
|
||||||
|
|
||||||
Integer selectByErpMNumbers(List<String> erpMNumber);
|
Integer countByErpMNumbers(List<String> erpMNumber);
|
||||||
|
|
||||||
|
default String getMaterialUnit(String downCenterNumber) {
|
||||||
|
return selectOne(new LambdaQueryWrapperX<ErpMaterialDO>()
|
||||||
|
.eq(ErpMaterialDO::getDownCenterNumber, downCenterNumber)
|
||||||
|
.last("limit 1")).getUnit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user