新增物料查询接口
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.base.api.internalsupplyfactory;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.api.InternalSupplyFactoryApi;
|
||||
import com.zt.plat.module.api.dto.internalsupplyfactory.InternalSupplyFactoryDTO;
|
||||
import com.zt.plat.module.base.dal.dataobject.internalsupplyfactory.InternalSupplyFactoryDO;
|
||||
import com.zt.plat.module.base.service.internalsupplyfactory.InternalSupplyFactoryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class InternalSupplyFactoryImpl implements InternalSupplyFactoryApi {
|
||||
@Resource
|
||||
private InternalSupplyFactoryService internalSupplyFactoryService;
|
||||
@Override
|
||||
public CommonResult<List<InternalSupplyFactoryDTO>> batchCreate(List<InternalSupplyFactoryDTO> reqVOS) {
|
||||
List<InternalSupplyFactoryDO> factoryDOS =new ArrayList<>();
|
||||
for (InternalSupplyFactoryDTO reqVO : reqVOS) {
|
||||
InternalSupplyFactoryDO factoryDO = BeanUtils.toBean(reqVO, InternalSupplyFactoryDO.class);
|
||||
factoryDO.setCompanyIdCustom(reqVO.getErpCompanyNumber());
|
||||
factoryDO.setCompanyNameCustom(reqVO.getErpCompanyName());
|
||||
factoryDOS.add(factoryDO);
|
||||
}
|
||||
internalSupplyFactoryService.bindFactory(factoryDOS);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 供应链内部工厂分页 Request VO")
|
||||
@Data
|
||||
public class InternalSupplyFactoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工厂编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类型;数据字典(SPLY_FACT_TP)", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定工厂名称", example = "赵六")
|
||||
private String relativityName;
|
||||
|
||||
@Schema(description = "绑定工厂编码")
|
||||
private String relativityNumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "操作类型", example = "2")
|
||||
private String operationType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应链内部工厂 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class InternalSupplyFactoryRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25522")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("工厂名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("工厂编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类型;数据字典(SPLY_FACT_TP)", example = "2")
|
||||
@ExcelProperty("类型;数据字典(SPLY_FACT_TP)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定工厂名称", example = "赵六")
|
||||
@ExcelProperty("绑定工厂名称")
|
||||
private String relativityName;
|
||||
|
||||
@Schema(description = "绑定工厂编码")
|
||||
@ExcelProperty("绑定工厂编码")
|
||||
private String relativityNumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
@ExcelProperty("是否启用")
|
||||
private String isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "操作类型", example = "2")
|
||||
@ExcelProperty("操作类型")
|
||||
private String operationType;
|
||||
|
||||
@Schema(description = "公司名称-业务")
|
||||
private String companyNameCustom;
|
||||
@Schema(description = "公司编号-业务")
|
||||
private String companyIdCustom;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应链内部工厂新增/修改 Request VO")
|
||||
@Data
|
||||
public class InternalSupplyFactorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25522")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "工厂名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "工厂编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工厂编码不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "类型;数据字典(SPLY_FACT_TP)", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定工厂名称", example = "赵六")
|
||||
private String relativityName;
|
||||
|
||||
@Schema(description = "绑定工厂编码")
|
||||
private String relativityNumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
|
||||
@Schema(description = "操作类型", example = "2")
|
||||
private String operationType;
|
||||
@Schema(description = "公司名称-业务")
|
||||
private String companyNameCustom;
|
||||
@Schema(description = "公司编号-业务")
|
||||
private String companyIdCustom;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.base.dal.dao.internalsupplyfactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo.InternalSupplyFactoryPageReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.internalsupplyfactory.InternalSupplyFactoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 供应链内部工厂 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface InternalSupplyFactoryMapper extends BaseMapperX<InternalSupplyFactoryDO> {
|
||||
|
||||
default PageResult<InternalSupplyFactoryDO> selectPage(InternalSupplyFactoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<InternalSupplyFactoryDO>()
|
||||
.likeIfPresent(InternalSupplyFactoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(InternalSupplyFactoryDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(InternalSupplyFactoryDO::getType, reqVO.getType())
|
||||
.likeIfPresent(InternalSupplyFactoryDO::getRelativityName, reqVO.getRelativityName())
|
||||
.eqIfPresent(InternalSupplyFactoryDO::getRelativityNumber, reqVO.getRelativityNumber())
|
||||
.eqIfPresent(InternalSupplyFactoryDO::getIsEnable, reqVO.getIsEnable())
|
||||
.betweenIfPresent(InternalSupplyFactoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(InternalSupplyFactoryDO::getOperationType, reqVO.getOperationType())
|
||||
.orderByDesc(InternalSupplyFactoryDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,8 +47,8 @@ public class ElementDO extends BaseDO {
|
||||
/**
|
||||
* 小数位数
|
||||
*/
|
||||
@TableField("DEC")
|
||||
private Long decimalValue;
|
||||
// @TableField("DEC")
|
||||
// private Long decimalValue;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.internalsupplyfactory;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 供应链内部工厂 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_intl_sply_fact")
|
||||
@KeySequence("bse_intl_sply_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class InternalSupplyFactoryDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
/**
|
||||
* 类型;数据字典(SPLY_FACT_TP)
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
/**
|
||||
* 绑定工厂名称
|
||||
*/
|
||||
@TableField("REL_NAME")
|
||||
private String relativityName;
|
||||
/**
|
||||
* 绑定工厂编码
|
||||
*/
|
||||
@TableField("REL_NUM")
|
||||
private String relativityNumber;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField("IS_ENB")
|
||||
private String isEnable;
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
@TableField("OPTN_TP")
|
||||
private String operationType;
|
||||
/**
|
||||
* 业务公司名称
|
||||
* COMPANY_NAME_CST
|
||||
*/
|
||||
@TableField("COMPANY_NAME_CST")
|
||||
private String companyNameCustom;
|
||||
|
||||
/**
|
||||
* 业务公司编码
|
||||
* COMPANY_NAME_CST
|
||||
*/
|
||||
@TableField("COMPANY_ID_CST")
|
||||
private String companyIdCustom;
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public interface ElementMapper extends BaseMapperX<ElementDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ElementDO>()
|
||||
.likeIfPresent(ElementDO::getAbbreviation, reqVO.getAbbreviation())
|
||||
.likeIfPresent(ElementDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ElementDO::getDecimalValue, reqVO.getDecimalValue())
|
||||
// .eqIfPresent(ElementDO::getDecimalValue, reqVO.getDecimalValue())
|
||||
.eqIfPresent(ElementDO::getIsEnable, reqVO.getIsEnable())
|
||||
.likeIfPresent(ElementDO::getCoding, reqVO.getCoding())
|
||||
.eqIfPresent(ElementDO::getGradeUnit, reqVO.getGradeUnit())
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.zt.plat.module.base.service.internalsupplyfactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo.InternalSupplyFactoryPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo.InternalSupplyFactoryRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.internalsupplyfactory.vo.InternalSupplyFactorySaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.internalsupplyfactory.InternalSupplyFactoryDO;
|
||||
import jakarta.validation.*;
|
||||
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 供应链内部工厂 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface InternalSupplyFactoryService {
|
||||
|
||||
/**
|
||||
* 创建供应链内部工厂
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
InternalSupplyFactoryRespVO createInternalSupplyFactory(@Valid InternalSupplyFactorySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应链内部工厂
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateInternalSupplyFactory(@Valid InternalSupplyFactorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应链内部工厂
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteInternalSupplyFactory(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应链内部工厂
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteInternalSupplyFactoryListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得供应链内部工厂
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应链内部工厂
|
||||
*/
|
||||
InternalSupplyFactoryDO getInternalSupplyFactory(Long id);
|
||||
|
||||
/**
|
||||
* 获得供应链内部工厂分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应链内部工厂分页
|
||||
*/
|
||||
PageResult<InternalSupplyFactoryDO> getInternalSupplyFactoryPage(InternalSupplyFactoryPageReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 绑定工厂
|
||||
*
|
||||
* @param bindFactoryList 请求参数
|
||||
*
|
||||
*/
|
||||
void bindFactory(List<InternalSupplyFactoryDO> bindFactoryList);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user