基础数据批量更新接口
This commit is contained in:
@@ -101,4 +101,12 @@ public class AccountController {
|
||||
BeanUtils.toBean(list, AccountRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新账户条款")
|
||||
@PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||
public CommonResult<Boolean> enableAccountList(@RequestBody List<AccountSaveReqVO> saveReqVOS) {
|
||||
accountService.enableAccountList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.base.controller.admin.base;
|
||||
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -86,22 +87,9 @@ public class CompanyRelativityController {
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得公司关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:company-relativity:query')")
|
||||
public CommonResult<PageResult<CompanyRelativityRespVO>> getCompanyRelativityPage(@Valid CompanyRelativityPageReqVO pageReqVO) {
|
||||
PageResult<CompanyRelativityDO> pageResult = companyRelativityService.getCompanyRelativityPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CompanyRelativityRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出公司关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('base:company-relativity:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCompanyRelativityExcel(@Valid CompanyRelativityPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CompanyRelativityDO> list = companyRelativityService.getCompanyRelativityPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "公司关系.xls", "数据", CompanyRelativityRespVO.class,
|
||||
BeanUtils.toBean(list, CompanyRelativityRespVO.class));
|
||||
public CommonResult<PageResult<CompanyRelaDeptDO>> getCompanyRelativityPage(@Valid CompanyRelativityPageReqVO pageReqVO) {
|
||||
PageResult<CompanyRelaDeptDO> pageResult = companyRelativityService.getCompanyRelativityPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CompanyRelaDeptDO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactSaveReqVO;
|
||||
@@ -101,4 +102,11 @@ public class ContactController {
|
||||
BeanUtils.toBean(list, ContactRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:contact:update')")
|
||||
public CommonResult<Boolean> enableContactList(@RequestBody List<ContactSaveReqVO> saveReqVOS) {
|
||||
contactService.enableContactList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactSaveReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
|
||||
@@ -101,4 +102,11 @@ public class ElementController {
|
||||
BeanUtils.toBean(list, ElementRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:element:update')")
|
||||
public CommonResult<Boolean> enableElementList(@RequestBody List<ElementRespVO> saveReqVOS) {
|
||||
elementService.enableElementList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactSaveReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.FactoryPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.FactoryRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.FactorySaveReqVO;
|
||||
@@ -101,4 +102,11 @@ public class FactoryController {
|
||||
BeanUtils.toBean(list, FactoryRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:factory:update')")
|
||||
public CommonResult<Boolean> enableFactoryList(@RequestBody List<FactoryRespVO> saveReqVOS) {
|
||||
factoryService.enableFactoryList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -104,4 +104,11 @@ public class MaterialDestroyController {
|
||||
BeanUtils.toBean(list, MaterialDestroyRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-destroy:update')")
|
||||
public CommonResult<Boolean> enableMaterialDestroyList(@RequestBody List<MaterialDestroyRespVO> saveReqVOS) {
|
||||
materialDestroyService.enableMaterialDestroyList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -104,4 +104,12 @@ public class MaterialOtherController {
|
||||
BeanUtils.toBean(list, MaterialOtherRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:material-other:update')")
|
||||
public CommonResult<Boolean> enableMaterialOtherList(@RequestBody List<MaterialOtherRespVO> saveReqVOS) {
|
||||
materialOtherService.enableMaterialOtherList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,4 +104,12 @@ public class WarehouseController {
|
||||
BeanUtils.toBean(list, WarehouseRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新")
|
||||
@PreAuthorize("@ss.hasPermission('base:warehouse:update')")
|
||||
public CommonResult<Boolean> enableWarehouseList(@RequestBody List<WarehouseRespVO> saveReqVOS) {
|
||||
warehouseService.enableWarehouseList(saveReqVOS);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,12 @@ public class CompanyRelativityPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "ERP公司名称")
|
||||
private String erpName;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
private String manager;
|
||||
|
||||
|
||||
@@ -19,22 +19,4 @@ public class CompanyRelativitySaveReqVO {
|
||||
@Schema(description = "供应链公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应链公司编码不能为空")
|
||||
private String number;
|
||||
|
||||
@Schema(description = "供应链公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应链公司编号不能为空")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "供应链公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应链公司名称不能为空")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "供应链部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应链部门名称不能为空")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "供应链部门名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "供应链部门名称不能为空")
|
||||
private String deptName;
|
||||
|
||||
|
||||
}
|
||||
@@ -20,6 +20,12 @@ public class MaterialDestroyPageReqVO extends PageParam {
|
||||
@Schema(description = "返产品物料编码")
|
||||
private String downNumber;
|
||||
|
||||
@Schema(description = "原料物料名称")
|
||||
private String upName;
|
||||
|
||||
@Schema(description = "返产品物料名称")
|
||||
private String downName;
|
||||
|
||||
@Schema(description = "回收率")
|
||||
private BigDecimal ratio;
|
||||
|
||||
|
||||
@@ -25,6 +25,14 @@ public class MaterialDestroyRespVO {
|
||||
@ExcelProperty("返产品物料编码")
|
||||
private String downNumber;
|
||||
|
||||
@Schema(description = "原料物料名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("原料物料名称")
|
||||
private String upName;
|
||||
|
||||
@Schema(description = "返产品物料名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("返产品物料名称")
|
||||
private String downName;
|
||||
|
||||
@Schema(description = "回收率", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("回收率")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@@ -22,6 +22,14 @@ public class MaterialDestroySaveReqVO {
|
||||
@NotEmpty(message = "返产品物料编码不能为空")
|
||||
private String downNumber;
|
||||
|
||||
@Schema(description = "原料物料名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "原料物料名称不能为空")
|
||||
private String upName;
|
||||
|
||||
@Schema(description = "返产品物料名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "返产品物料名称不能为空")
|
||||
private String downName;
|
||||
|
||||
@Schema(description = "回收率", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "回收率不能为空")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 账户条款 DO
|
||||
@@ -19,7 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class AccountDO extends BaseDO {
|
||||
public class AccountDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司关系 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class CompanyRelaDeptDO {
|
||||
|
||||
private Long id;
|
||||
//父id
|
||||
private Long parentId;
|
||||
//关联id
|
||||
private Long relId;
|
||||
// erp 编码
|
||||
private String erpNumber;
|
||||
// erp名称
|
||||
private String erpName;
|
||||
// 公司名称
|
||||
private String companyName;
|
||||
// 部门编码
|
||||
private String deptNumber;
|
||||
// 负责人id
|
||||
private String leaderUserId;
|
||||
// 是否公司
|
||||
private String isCompany;
|
||||
// 是否集团
|
||||
private String isGroup;
|
||||
//电话
|
||||
private String phone;
|
||||
//邮箱
|
||||
private String email;
|
||||
//部门状态
|
||||
private String status;
|
||||
//创建人
|
||||
private String creator;
|
||||
|
||||
private List<CompanyRelaDeptDO> childrens;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 公司关系 DO
|
||||
@@ -19,9 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class CompanyRelativityDO extends BaseDO {
|
||||
|
||||
|
||||
public class CompanyRelativityDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -34,9 +33,6 @@ public class CompanyRelativityDO extends BaseDO {
|
||||
@TableField("ERP_NUM")
|
||||
private String erpNumber;
|
||||
|
||||
// erp名称
|
||||
private String erpName;
|
||||
|
||||
/**
|
||||
* 供应链公司编码
|
||||
*/
|
||||
@@ -53,20 +49,6 @@ public class CompanyRelativityDO extends BaseDO {
|
||||
@TableField("COMPANY_NAME")
|
||||
private String companyName;
|
||||
|
||||
// 负责人id
|
||||
private String leaderUserId;
|
||||
// 是否公司
|
||||
private String isCompany;
|
||||
//是否集团
|
||||
private String isGroup;
|
||||
//电话
|
||||
private String phone;
|
||||
//邮箱
|
||||
private String email;
|
||||
//部门状态
|
||||
private String status;
|
||||
//创建人
|
||||
private String creator;
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@@ -92,5 +74,4 @@ public class CompanyRelativityDO extends BaseDO {
|
||||
*/
|
||||
@TableField("UPDATER_NAME")
|
||||
private String updaterName;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 联系人信息 DO
|
||||
@@ -19,7 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContactDO extends BaseDO {
|
||||
public class ContactDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 工厂 DO
|
||||
@@ -19,7 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class FactoryDO extends BaseDO {
|
||||
public class FactoryDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -21,9 +22,7 @@ import java.math.BigDecimal;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialDestroyDO extends BaseDO {
|
||||
|
||||
|
||||
public class MaterialDestroyDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -40,6 +39,16 @@ public class MaterialDestroyDO extends BaseDO {
|
||||
*/
|
||||
@TableField("DOWN_NUM")
|
||||
private String downNumber;
|
||||
/**
|
||||
* 原料物料编码
|
||||
*/
|
||||
@TableField("UP_NAME")
|
||||
private String upName;
|
||||
/**
|
||||
* 返产品物料编码
|
||||
*/
|
||||
@TableField("DOWN_NAME")
|
||||
private String downName;
|
||||
/**
|
||||
* 回收率
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 物料拓展数据 DO
|
||||
@@ -19,7 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialOtherDO extends BaseDO {
|
||||
public class MaterialOtherDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 仓库 DO
|
||||
@@ -19,7 +20,7 @@ import lombok.*;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class WarehouseDO extends BaseDO {
|
||||
public class WarehouseDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityPageReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -25,5 +26,5 @@ public interface CompanyRelativityMapper extends BaseMapperX<CompanyRelativityDO
|
||||
.orderByDesc(CompanyRelativityDO::getId));
|
||||
}
|
||||
|
||||
List<CompanyRelativityDO> getPageByReq(CompanyRelativityPageReqVO pageReqVO);
|
||||
List<CompanyRelaDeptDO> getPageByReq(CompanyRelativityPageReqVO pageReqVO);
|
||||
}
|
||||
@@ -61,4 +61,10 @@ public interface AccountService {
|
||||
*/
|
||||
PageResult<AccountDO> getAccountPage(AccountPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 批量更新账户条款
|
||||
*
|
||||
* @param saveReqVOS 账户条款
|
||||
*/
|
||||
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.AccountMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -86,4 +87,13 @@ public class AccountServiceImpl implements AccountService {
|
||||
return accountMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableAccountList(List<AccountSaveReqVO> entityList) {
|
||||
List<AccountDO> updateObj = BeanUtils.toBean(entityList, AccountDO.class);
|
||||
List<BatchResult> count = accountMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(ACCOUNT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativitySaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@@ -59,6 +60,6 @@ public interface CompanyRelativityService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 公司关系分页
|
||||
*/
|
||||
PageResult<CompanyRelativityDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO);
|
||||
PageResult<CompanyRelaDeptDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -6,13 +6,17 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativitySaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.CompanyRelativityMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.COMPANY_RELATIVITY_NOT_EXISTS;
|
||||
@@ -82,12 +86,65 @@ public class CompanyRelativityServiceImpl implements CompanyRelativityService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CompanyRelativityDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO) {
|
||||
List<CompanyRelativityDO> list = companyRelativityMapper.getPageByReq(pageReqVO);
|
||||
public PageResult<CompanyRelaDeptDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO) {
|
||||
// 获取分页数据
|
||||
List<CompanyRelaDeptDO> list = companyRelativityMapper.getPageByReq(pageReqVO);
|
||||
if (list == null) {
|
||||
list = CollUtil.newArrayList();
|
||||
}
|
||||
return new PageResult<>(list, (long) list.size());
|
||||
|
||||
// 构建树形结构
|
||||
// List<CompanyRelaDeptDO> treeList = buildTree(list);
|
||||
|
||||
// 分页处理
|
||||
int pageNo = pageReqVO.getPageNo();
|
||||
int pageSize = pageReqVO.getPageSize();
|
||||
int total = list.size();
|
||||
|
||||
// 计算分页起始和结束位置
|
||||
int fromIndex = (pageNo - 1) * pageSize;
|
||||
int toIndex = Math.min(fromIndex + pageSize, total);
|
||||
|
||||
// 如果起始位置超出范围,则返回空列表
|
||||
if (fromIndex >= total) {
|
||||
return new PageResult<>(new ArrayList<>(), (long) total);
|
||||
}
|
||||
|
||||
// 截取当前页数据
|
||||
List<CompanyRelaDeptDO> pageList = list.subList(fromIndex, toIndex);
|
||||
|
||||
return new PageResult<>(pageList, (long) total);
|
||||
}
|
||||
|
||||
private List<CompanyRelaDeptDO> buildTree(List<CompanyRelaDeptDO> list) {
|
||||
// 创建一个map用于存储所有节点,key为id,value为节点对象
|
||||
Map<Long, CompanyRelaDeptDO> nodeMap = new HashMap<>();
|
||||
for (CompanyRelaDeptDO node : list) {
|
||||
nodeMap.put(node.getId(), node);
|
||||
}
|
||||
|
||||
// 创建结果列表
|
||||
List<CompanyRelaDeptDO> result = new ArrayList<>();
|
||||
|
||||
// 遍历所有节点,建立父子关系
|
||||
for (CompanyRelaDeptDO node : list) {
|
||||
Long parentId = node.getParentId();
|
||||
if (parentId == null || parentId == 0) {
|
||||
// 如果没有父节点或者父节点为0,则为根节点
|
||||
result.add(node);
|
||||
} else {
|
||||
// 如果有父节点,则将其添加到父节点的子节点列表中
|
||||
CompanyRelaDeptDO parent = nodeMap.get(parentId);
|
||||
if (parent != null) {
|
||||
if (parent.getChildrens() == null) {
|
||||
parent.setChildrens(new ArrayList<>());
|
||||
}
|
||||
parent.getChildrens().add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface ContactService {
|
||||
*/
|
||||
PageResult<ContactDO> getContactPage(ContactPageReqVO pageReqVO);
|
||||
|
||||
void enableContactList(List<ContactSaveReqVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.base.controller.admin.base.vo.ContactPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.ContactDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.ContactMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,6 +18,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.CONTACT_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 联系人信息 Service 实现类
|
||||
@@ -86,4 +89,13 @@ public class ContactServiceImpl implements ContactService {
|
||||
return contactMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableContactList(List<ContactSaveReqVO> saveReqVOS) {
|
||||
List<ContactDO> updateObj = BeanUtils.toBean(saveReqVOS, ContactDO.class);
|
||||
List<BatchResult> count = contactMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(CONTACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface ElementService {
|
||||
*/
|
||||
PageResult<ElementDO> getElementPage(ElementPageReqVO pageReqVO);
|
||||
|
||||
void enableElementList(List<ElementRespVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.ElementDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.ElementMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,6 +18,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ELEMENT_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 金属元素 Service 实现类
|
||||
@@ -97,4 +100,13 @@ public class ElementServiceImpl implements ElementService {
|
||||
return elementMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableElementList(List<ElementRespVO> saveReqVOS) {
|
||||
List<ElementDO> updateObj = BeanUtils.toBean(saveReqVOS, ElementDO.class);
|
||||
List<BatchResult> count = elementMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(ELEMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface FactoryService {
|
||||
*/
|
||||
PageResult<FactoryDO> getFactoryPage(FactoryPageReqVO pageReqVO);
|
||||
|
||||
void enableFactoryList(List<FactoryRespVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.base.controller.admin.base.vo.FactoryPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.FactoryRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.FactorySaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.FactoryDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.FactoryMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,6 +18,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.FACTORY_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 工厂 Service 实现类
|
||||
@@ -86,4 +89,13 @@ public class FactoryServiceImpl implements FactoryService {
|
||||
return factoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableFactoryList(List<FactoryRespVO> saveReqVOS) {
|
||||
List<FactoryDO> updateObj = BeanUtils.toBean(saveReqVOS, FactoryDO.class);
|
||||
List<BatchResult> count = factoryMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(FACTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface MaterialDestroyService {
|
||||
*/
|
||||
PageResult<MaterialDestroyDO> getMaterialDestroyPage(MaterialDestroyPageReqVO pageReqVO);
|
||||
|
||||
void enableMaterialDestroyList(List<MaterialDestroyRespVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.base.controller.admin.base.vo.MaterialDestroyPageReqVO
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialDestroyRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialDestroySaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialDestroyDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.MaterialDestroyMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,6 +18,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_DESTROY_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 物料回收率 Service 实现类
|
||||
@@ -86,4 +89,13 @@ public class MaterialDestroyServiceImpl implements MaterialDestroyService {
|
||||
return materialDestroyMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableMaterialDestroyList(List<MaterialDestroyRespVO> saveReqVOS) {
|
||||
List<MaterialDestroyDO> updateObj = BeanUtils.toBean(saveReqVOS, MaterialDestroyDO.class);
|
||||
List<BatchResult> count = materialDestroyMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(MATERIAL_DESTROY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface MaterialOtherService {
|
||||
*/
|
||||
PageResult<MaterialOtherDO> getMaterialOtherPage(MaterialOtherPageReqVO pageReqVO);
|
||||
|
||||
void enableMaterialOtherList(List<MaterialOtherRespVO> saveReqVOS);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.WarehouseDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.MaterialOtherMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,6 +18,7 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 物料拓展数据 Service 实现类
|
||||
@@ -86,4 +89,13 @@ public class MaterialOtherServiceImpl implements MaterialOtherService {
|
||||
return materialOtherMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableMaterialOtherList(List<MaterialOtherRespVO> saveReqVOS) {
|
||||
List<MaterialOtherDO> updateObj = BeanUtils.toBean(saveReqVOS, MaterialOtherDO.class);
|
||||
List<BatchResult> count = materialOtherMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(MATERIAL_OTHER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface WarehouseService {
|
||||
*/
|
||||
PageResult<WarehouseDO> getWarehousePage(WarehousePageReqVO pageReqVO);
|
||||
|
||||
void enableWarehouseList(List<WarehouseRespVO> saveReqVOS);
|
||||
}
|
||||
@@ -6,15 +6,18 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.WarehousePageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.WarehouseRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.WarehouseSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.WarehouseDO;
|
||||
import com.zt.plat.module.base.dal.mysql.base.WarehouseMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.ibatis.executor.BatchResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.ACCOUNT_NOT_EXISTS;
|
||||
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -86,4 +89,13 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
return warehouseMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableWarehouseList(List<WarehouseRespVO> saveReqVOS) {
|
||||
List<WarehouseDO> updateObj = BeanUtils.toBean(saveReqVOS, WarehouseDO.class);
|
||||
List<BatchResult> count = warehouseMapper.updateById(updateObj);
|
||||
if (CollUtil.isEmpty(count)) {
|
||||
throw exception(WAREHOUSE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,23 +9,37 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="getPageByReq" resultType="com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO">
|
||||
<select id="getPageByReq" resultType="com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO">
|
||||
select
|
||||
d.ID as id,
|
||||
d.PARENT_ID as parentId,
|
||||
r.ID as relId,
|
||||
c.NUM as erpNumber,
|
||||
c.NAME as erpName,
|
||||
d.NAME as companyName,
|
||||
d.ID as deptId,
|
||||
d.CODE as deptId,
|
||||
d.LEADER_USER_ID as leaderUserId,
|
||||
d.IS_COMPANY,
|
||||
d.IS_GROUP,
|
||||
d.PHONE,
|
||||
d.EMAIL,
|
||||
d.STATUS,
|
||||
d.CREATOR
|
||||
from
|
||||
SPLY_CPN_REL r
|
||||
left join SYSTEM_DEPT d on r.COMPANY_ID = d.ID
|
||||
d.IS_COMPANY as isCompany ,
|
||||
d.IS_GROUP as isGroup,
|
||||
d.PHONE as phone,
|
||||
d.EMAIL as email,
|
||||
d.STATUS as status,
|
||||
d.CREATOR as creator
|
||||
from SYSTEM_DEPT d
|
||||
left join SPLY_CPN_REL r on r.NUM = d.CODE
|
||||
left join SPLY_ERP_CPN c on r.ERP_NUM = c.NUM
|
||||
where r.DELETED = 0
|
||||
where d.DELETED = 0
|
||||
<if test="name != null">
|
||||
and d.NAME = #{name}
|
||||
</if>
|
||||
<if test="erpName != null">
|
||||
and c.NAME = #{erpName}
|
||||
</if>
|
||||
<if test="manager != null">
|
||||
and d.LEADER_USER_ID = #{manager}
|
||||
</if>
|
||||
<if test="departmentSource != null">
|
||||
and d.DEPT_SOURCE = #{departmentSource}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user