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_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_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成本中心数据不存在");
|
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));
|
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")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出ERP工厂 Excel")
|
@Operation(summary = "导出ERP工厂 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')")
|
@PreAuthorize("@ss.hasPermission('base:erp-factory:export')")
|
||||||
@@ -101,6 +109,14 @@ public class ErpFactoryController {
|
|||||||
BeanUtils.toBean(list, ErpFactoryRespVO.class));
|
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")
|
@PostMapping("/getErpFactoryTask")
|
||||||
@Operation(summary = "定时获得erp工厂数据")
|
@Operation(summary = "定时获得erp工厂数据")
|
||||||
@PreAuthorize("@ss.hasPermission('base:erp-factory:create')")
|
@PreAuthorize("@ss.hasPermission('base:erp-factory:create')")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
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 com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -14,4 +15,13 @@ public class ErpFactoryPageReqVO extends PageParam {
|
|||||||
@Schema(description = "工厂编码")
|
@Schema(description = "工厂编码")
|
||||||
private String number;
|
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("工厂编码")
|
@ExcelProperty("工厂编码")
|
||||||
private String number;
|
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 = "工厂编码不能为空")
|
@NotEmpty(message = "工厂编码不能为空")
|
||||||
private String number;
|
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;
|
package com.zt.plat.module.erp.dal.dataobject.erp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERP工厂 DO
|
* ERP工厂 DO
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
@TableName("sply_erp_fact")
|
@TableName("sply_erp_fact")
|
||||||
@KeySequence("sply_erp_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
@KeySequence("sply_erp_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
@Data
|
@Data
|
||||||
@@ -16,31 +18,58 @@ import lombok.*;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
*/
|
*/
|
||||||
public class ErpFactoryDO {
|
public class ErpFactoryDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 工厂名称
|
* 工厂名称
|
||||||
*/
|
*/
|
||||||
@TableField("NAME")
|
@TableField("NAME")
|
||||||
private String name;
|
private String name;
|
||||||
/**
|
/**
|
||||||
* 工厂编码
|
* 工厂编码
|
||||||
*/
|
*/
|
||||||
@TableField("NUM")
|
@TableField("NUM")
|
||||||
private String number;
|
private String number;
|
||||||
/**
|
/**
|
||||||
* 公司编号
|
* 公司编号
|
||||||
*/
|
*/
|
||||||
@TableField("CPN_ID")
|
@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")
|
@TableField("NUM")
|
||||||
private String number;
|
private String number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类别
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,4 @@ public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
|
|||||||
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
||||||
.orderByDesc(ErpBomDO::getId));
|
.orderByDesc(ErpBomDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
Long insertGetId(ErpBomDO aDo);
|
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,4 @@ public interface ErpCostcenterMapper extends BaseMapperX<ErpCostcenterDO> {
|
|||||||
.betweenIfPresent(ErpCostcenterDO::getEndDate, reqVO.getEndDate())
|
.betweenIfPresent(ErpCostcenterDO::getEndDate, reqVO.getEndDate())
|
||||||
.orderByDesc(ErpCostcenterDO::getId));
|
.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>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
|
||||||
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
|
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
|
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
|
||||||
|
.eqIfPresent(ErpFactoryDO::getType, reqVO.getType())
|
||||||
.orderByDesc(ErpFactoryDO::getId));
|
.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