erp工厂新增、编辑、批量更新、定时任务、分页查询优化
This commit is contained in:
@@ -27,6 +27,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_008_000_001, "ERP工厂数据不存在");
|
||||
ErrorCode ERP_FACTORY_REDIS_NOT_EXISTS = new ErrorCode(1_008_000_002, "ERP工厂redis数据不存在");
|
||||
ErrorCode ERP_FACTORY_NOT_ALLOW_UPDATE = new ErrorCode(1_008_000_003, "类型为ERP的数据或启用的数据不允许编辑");
|
||||
|
||||
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_009_000_001, "ERP成本中心数据不存在");
|
||||
|
||||
|
||||
@@ -88,6 +88,14 @@ public class ErpFactoryController {
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/pageByCpn")
|
||||
@Operation(summary = "获得ERP工厂分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:query')")
|
||||
public CommonResult<PageResult<ErpFactoryRespVO>> getErpFactoryPageByCpn(@Valid ErpFactoryPageReqVO pageReqVO) {
|
||||
PageResult<ErpFactoryDO> pageResult = erpFactoryService.getErpFactoryPageByCpn(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP工厂 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')")
|
||||
@@ -101,6 +109,14 @@ public class ErpFactoryController {
|
||||
BeanUtils.toBean(list, ErpFactoryRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:update')")
|
||||
public CommonResult<Boolean> enableFactoryList(@RequestBody List<ErpFactoryRespVO> saveReqVOS) {
|
||||
erpFactoryService.enableFactoryList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/getErpFactoryTask")
|
||||
@Operation(summary = "定时获得erp工厂数据")
|
||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:create')")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -14,4 +15,13 @@ public class ErpFactoryPageReqVO extends PageParam {
|
||||
@Schema(description = "工厂编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -22,4 +22,18 @@ public class ErpFactoryRespVO {
|
||||
@ExcelProperty("工厂编码")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定工厂名")
|
||||
private String relName;
|
||||
|
||||
@Schema(description = "绑定工厂编码")
|
||||
private String relnumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
}
|
||||
@@ -19,4 +19,21 @@ public class ErpFactorySaveReqVO {
|
||||
@NotEmpty(message = "工厂编码不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyNumber;
|
||||
|
||||
@Schema(description = "公司编号")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "绑定工厂名")
|
||||
private String relName;
|
||||
|
||||
@Schema(description = "绑定工厂编码")
|
||||
private String relnumber;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private String isEnable;
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.zt.plat.module.erp.dal.dataobject.erp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* ERP工厂 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
* ERP工厂 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("sply_erp_fact")
|
||||
@KeySequence("sply_erp_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@@ -16,11 +18,9 @@ import lombok.*;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpFactoryDO {
|
||||
|
||||
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ErpFactoryDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -41,6 +41,35 @@ public class ErpFactoryDO {
|
||||
* 公司编号
|
||||
*/
|
||||
@TableField("CPN_ID")
|
||||
private String companyId;
|
||||
private String companyNumber;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 绑定工厂名
|
||||
*/
|
||||
@TableField("REL_NAME")
|
||||
private String relName;
|
||||
|
||||
/**
|
||||
* 绑定工厂编码
|
||||
*/
|
||||
@TableField("REL_NUM")
|
||||
private String relnumber;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("IS_ENB")
|
||||
private String isEnable;
|
||||
}
|
||||
@@ -41,4 +41,10 @@ public class ErpWarehouseDO {
|
||||
@TableField("NUM")
|
||||
private String number;
|
||||
|
||||
/**
|
||||
* 类别
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -25,6 +25,4 @@ public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
|
||||
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
||||
.orderByDesc(ErpBomDO::getId));
|
||||
}
|
||||
|
||||
Long insertGetId(ErpBomDO aDo);
|
||||
}
|
||||
@@ -29,6 +29,4 @@ public interface ErpCostcenterMapper extends BaseMapperX<ErpCostcenterDO> {
|
||||
.betweenIfPresent(ErpCostcenterDO::getEndDate, reqVO.getEndDate())
|
||||
.orderByDesc(ErpCostcenterDO::getId));
|
||||
}
|
||||
|
||||
void updateBatchByNumber(@Param("list") List<ErpCostcenterDO> toUpdate);
|
||||
}
|
||||
@@ -22,9 +22,11 @@ public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
|
||||
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(ErpFactoryDO::getType, reqVO.getType())
|
||||
.orderByDesc(ErpFactoryDO::getId));
|
||||
}
|
||||
|
||||
void updateBatch(@Param("toUpdate") List<ErpFactoryDO> toUpdate);
|
||||
String selectMaxCode();
|
||||
|
||||
List<ErpFactoryDO> getPageByReq(ErpFactoryPageReqVO pageReqVO);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user