Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -101,4 +101,12 @@ public class AccountController {
|
|||||||
BeanUtils.toBean(list, AccountRespVO.class));
|
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;
|
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 org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -86,22 +87,9 @@ public class CompanyRelativityController {
|
|||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得公司关系分页")
|
@Operation(summary = "获得公司关系分页")
|
||||||
@PreAuthorize("@ss.hasPermission('base:company-relativity:query')")
|
@PreAuthorize("@ss.hasPermission('base:company-relativity:query')")
|
||||||
public CommonResult<PageResult<CompanyRelativityRespVO>> getCompanyRelativityPage(@Valid CompanyRelativityPageReqVO pageReqVO) {
|
public CommonResult<PageResult<CompanyRelaDeptDO>> getCompanyRelativityPage(@Valid CompanyRelativityPageReqVO pageReqVO) {
|
||||||
PageResult<CompanyRelativityDO> pageResult = companyRelativityService.getCompanyRelativityPage(pageReqVO);
|
PageResult<CompanyRelaDeptDO> pageResult = companyRelativityService.getCompanyRelativityPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, CompanyRelativityRespVO.class));
|
return success(BeanUtils.toBean(pageResult, CompanyRelaDeptDO.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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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.pojo.vo.BatchDeleteReqVO;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
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.ContactPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactRespVO;
|
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.controller.admin.base.vo.ContactSaveReqVO;
|
||||||
@@ -101,4 +102,11 @@ public class ContactController {
|
|||||||
BeanUtils.toBean(list, ContactRespVO.class));
|
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.pojo.vo.BatchDeleteReqVO;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
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.ElementPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
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.controller.admin.base.vo.ElementSaveReqVO;
|
||||||
@@ -101,4 +102,11 @@ public class ElementController {
|
|||||||
BeanUtils.toBean(list, ElementRespVO.class));
|
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.pojo.vo.BatchDeleteReqVO;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
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.FactoryPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.FactoryRespVO;
|
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.controller.admin.base.vo.FactorySaveReqVO;
|
||||||
@@ -101,4 +102,11 @@ public class FactoryController {
|
|||||||
BeanUtils.toBean(list, FactoryRespVO.class));
|
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));
|
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));
|
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));
|
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)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称")
|
||||||
|
private String erpName;
|
||||||
|
|
||||||
@Schema(description = "负责人")
|
@Schema(description = "负责人")
|
||||||
private String manager;
|
private String manager;
|
||||||
|
|
||||||
|
|||||||
@@ -19,22 +19,4 @@ public class CompanyRelativitySaveReqVO {
|
|||||||
@Schema(description = "供应链公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "供应链公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "供应链公司编码不能为空")
|
@NotEmpty(message = "供应链公司编码不能为空")
|
||||||
private String number;
|
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 = "返产品物料编码")
|
@Schema(description = "返产品物料编码")
|
||||||
private String downNumber;
|
private String downNumber;
|
||||||
|
|
||||||
|
@Schema(description = "原料物料名称")
|
||||||
|
private String upName;
|
||||||
|
|
||||||
|
@Schema(description = "返产品物料名称")
|
||||||
|
private String downName;
|
||||||
|
|
||||||
@Schema(description = "回收率")
|
@Schema(description = "回收率")
|
||||||
private BigDecimal ratio;
|
private BigDecimal ratio;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ public class MaterialDestroyRespVO {
|
|||||||
@ExcelProperty("返产品物料编码")
|
@ExcelProperty("返产品物料编码")
|
||||||
private String downNumber;
|
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)
|
@Schema(description = "回收率", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("回收率")
|
@ExcelProperty("回收率")
|
||||||
private BigDecimal ratio;
|
private BigDecimal ratio;
|
||||||
|
|||||||
@@ -22,6 +22,14 @@ public class MaterialDestroySaveReqVO {
|
|||||||
@NotEmpty(message = "返产品物料编码不能为空")
|
@NotEmpty(message = "返产品物料编码不能为空")
|
||||||
private String downNumber;
|
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)
|
@Schema(description = "回收率", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "回收率不能为空")
|
@NotNull(message = "回收率不能为空")
|
||||||
private BigDecimal ratio;
|
private BigDecimal ratio;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 账户条款 DO
|
* 账户条款 DO
|
||||||
@@ -19,7 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 公司关系 DO
|
* 公司关系 DO
|
||||||
@@ -19,9 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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")
|
@TableField("ERP_NUM")
|
||||||
private String erpNumber;
|
private String erpNumber;
|
||||||
|
|
||||||
// erp名称
|
|
||||||
private String erpName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应链公司编码
|
* 供应链公司编码
|
||||||
*/
|
*/
|
||||||
@@ -53,20 +49,6 @@ public class CompanyRelativityDO extends BaseDO {
|
|||||||
@TableField("COMPANY_NAME")
|
@TableField("COMPANY_NAME")
|
||||||
private String companyName;
|
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")
|
@TableField("UPDATER_NAME")
|
||||||
private String updaterName;
|
private String updaterName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 联系人信息 DO
|
* 联系人信息 DO
|
||||||
@@ -19,7 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 工厂 DO
|
* 工厂 DO
|
||||||
@@ -19,7 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -21,9 +22,7 @@ import java.math.BigDecimal;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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")
|
@TableField("DOWN_NUM")
|
||||||
private String downNumber;
|
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.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 物料拓展数据 DO
|
* 物料拓展数据 DO
|
||||||
@@ -19,7 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 仓库 DO
|
* 仓库 DO
|
||||||
@@ -19,7 +20,7 @@ import lombok.*;
|
|||||||
/**
|
/**
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
* 支持业务基类继承: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.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
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.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 com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@@ -25,5 +26,5 @@ public interface CompanyRelativityMapper extends BaseMapperX<CompanyRelativityDO
|
|||||||
.orderByDesc(CompanyRelativityDO::getId));
|
.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);
|
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.dataobject.base.AccountDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.AccountMapper;
|
import com.zt.plat.module.base.dal.mysql.base.AccountMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@@ -86,4 +87,13 @@ public class AccountServiceImpl implements AccountService {
|
|||||||
return accountMapper.selectPage(pageReqVO);
|
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.CompanyRelativityPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityRespVO;
|
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.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.dataobject.base.CompanyRelativityDO;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
@@ -59,6 +60,6 @@ public interface CompanyRelativityService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 公司关系分页
|
* @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.CompanyRelativityPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityRespVO;
|
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.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.dataobject.base.CompanyRelativityDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.CompanyRelativityMapper;
|
import com.zt.plat.module.base.dal.mysql.base.CompanyRelativityMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
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.COMPANY_RELATIVITY_NOT_EXISTS;
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.COMPANY_RELATIVITY_NOT_EXISTS;
|
||||||
@@ -82,12 +86,65 @@ public class CompanyRelativityServiceImpl implements CompanyRelativityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<CompanyRelativityDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO) {
|
public PageResult<CompanyRelaDeptDO> getCompanyRelativityPage(CompanyRelativityPageReqVO pageReqVO) {
|
||||||
List<CompanyRelativityDO> list = companyRelativityMapper.getPageByReq(pageReqVO);
|
// 获取分页数据
|
||||||
|
List<CompanyRelaDeptDO> list = companyRelativityMapper.getPageByReq(pageReqVO);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = CollUtil.newArrayList();
|
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);
|
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.ContactRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.ContactSaveReqVO;
|
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.ContactDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.ContactMapper;
|
import com.zt.plat.module.base.dal.mysql.base.ContactMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.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.CONTACT_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系人信息 Service 实现类
|
* 联系人信息 Service 实现类
|
||||||
@@ -86,4 +89,13 @@ public class ContactServiceImpl implements ContactService {
|
|||||||
return contactMapper.selectPage(pageReqVO);
|
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);
|
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.ElementRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
|
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.ElementDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.ElementMapper;
|
import com.zt.plat.module.base.dal.mysql.base.ElementMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.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.ELEMENT_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 金属元素 Service 实现类
|
* 金属元素 Service 实现类
|
||||||
@@ -97,4 +100,13 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
return elementMapper.selectPage(pageReqVO);
|
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);
|
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.FactoryRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.FactorySaveReqVO;
|
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.FactoryDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.FactoryMapper;
|
import com.zt.plat.module.base.dal.mysql.base.FactoryMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.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.FACTORY_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂 Service 实现类
|
* 工厂 Service 实现类
|
||||||
@@ -86,4 +89,13 @@ public class FactoryServiceImpl implements FactoryService {
|
|||||||
return factoryMapper.selectPage(pageReqVO);
|
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);
|
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.MaterialDestroyRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialDestroySaveReqVO;
|
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.MaterialDestroyDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.MaterialDestroyMapper;
|
import com.zt.plat.module.base.dal.mysql.base.MaterialDestroyMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.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_DESTROY_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.MATERIAL_OTHER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料回收率 Service 实现类
|
* 物料回收率 Service 实现类
|
||||||
@@ -86,4 +89,13 @@ public class MaterialDestroyServiceImpl implements MaterialDestroyService {
|
|||||||
return materialDestroyMapper.selectPage(pageReqVO);
|
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);
|
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.MaterialOtherRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherSaveReqVO;
|
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.MaterialOtherDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.WarehouseDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.MaterialOtherMapper;
|
import com.zt.plat.module.base.dal.mysql.base.MaterialOtherMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.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.MATERIAL_OTHER_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.WAREHOUSE_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料拓展数据 Service 实现类
|
* 物料拓展数据 Service 实现类
|
||||||
@@ -86,4 +89,13 @@ public class MaterialOtherServiceImpl implements MaterialOtherService {
|
|||||||
return materialOtherMapper.selectPage(pageReqVO);
|
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);
|
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.WarehousePageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.WarehouseRespVO;
|
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.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.dataobject.base.WarehouseDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.WarehouseMapper;
|
import com.zt.plat.module.base.dal.mysql.base.WarehouseMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.ibatis.executor.BatchResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.ACCOUNT_NOT_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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,4 +89,13 @@ public class WarehouseServiceImpl implements WarehouseService {
|
|||||||
return warehouseMapper.selectPage(pageReqVO);
|
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/
|
文档可见: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
|
select
|
||||||
|
d.ID as id,
|
||||||
|
d.PARENT_ID as parentId,
|
||||||
|
r.ID as relId,
|
||||||
c.NUM as erpNumber,
|
c.NUM as erpNumber,
|
||||||
c.NAME as erpName,
|
c.NAME as erpName,
|
||||||
d.NAME as companyName,
|
d.NAME as companyName,
|
||||||
d.ID as deptId,
|
d.CODE as deptId,
|
||||||
d.LEADER_USER_ID as leaderUserId,
|
d.LEADER_USER_ID as leaderUserId,
|
||||||
d.IS_COMPANY,
|
d.IS_COMPANY as isCompany ,
|
||||||
d.IS_GROUP,
|
d.IS_GROUP as isGroup,
|
||||||
d.PHONE,
|
d.PHONE as phone,
|
||||||
d.EMAIL,
|
d.EMAIL as email,
|
||||||
d.STATUS,
|
d.STATUS as status,
|
||||||
d.CREATOR
|
d.CREATOR as creator
|
||||||
from
|
from SYSTEM_DEPT d
|
||||||
SPLY_CPN_REL r
|
left join SPLY_CPN_REL r on r.NUM = d.CODE
|
||||||
left join SYSTEM_DEPT d on r.COMPANY_ID = d.ID
|
|
||||||
left join SPLY_ERP_CPN c on r.ERP_NUM = c.NUM
|
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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.zt.plat.module.contractorder.enums.contract;
|
package com.zt.plat.module.contractorder.enums;
|
||||||
|
|
||||||
public class DateConstants {
|
public class DateConstants {
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.zt.plat.module.contractorder.enums.contract;
|
package com.zt.plat.module.contractorder.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同字典类型常量
|
* 合同字典类型常量
|
||||||
*
|
*
|
||||||
* @author ZT
|
* @author ZT
|
||||||
*/
|
*/
|
||||||
public class ContractDictTypeConstants {
|
public class DictTypeConstants {
|
||||||
|
|
||||||
// 合同状态
|
// 合同状态
|
||||||
public static String BSE_CTRT_STS = "BSE_CTRT_STS";
|
public static String BSE_CTRT_STS = "BSE_CTRT_STS";
|
||||||
@@ -16,4 +16,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONTRACT_NAME_EXISTS = new ErrorCode(1_027_000_001, "合同名已存在");
|
ErrorCode CONTRACT_NAME_EXISTS = new ErrorCode(1_027_000_001, "合同名已存在");
|
||||||
ErrorCode CONTRACT_PAPER_NUMBER_EXISTS = new ErrorCode(1_027_000_002, "合同编号已存在");
|
ErrorCode CONTRACT_PAPER_NUMBER_EXISTS = new ErrorCode(1_027_000_002, "合同编号已存在");
|
||||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_027_000_003, "合同不存在");
|
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_027_000_003, "合同不存在");
|
||||||
|
ErrorCode CONTRACT_ID_NOT_EXISTS = new ErrorCode(1_027_000_004, "合同主键为空");
|
||||||
|
ErrorCode CONTRACT_STATUS_NOT_UPDATE = new ErrorCode(1_027_000_004, "{}合同不允许修改");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.zt.plat.module.contractorder.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表字段常量
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
public class TableFieldConstants {
|
||||||
|
|
||||||
|
// 表主键
|
||||||
|
public static final String ID = "ID";
|
||||||
|
|
||||||
|
/* 合同主信息表 */
|
||||||
|
// 合同名称;与ERP(HTMC)对应,校验唯一
|
||||||
|
public static final String BSE_CTRT_MAIN_CTRT_NAME = "CTRT_NAME";
|
||||||
|
// 合同编号;与ERP(HTBH)对应,校验唯一
|
||||||
|
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM = "CTRT_PPR_NUM";
|
||||||
|
|
||||||
|
/* 合同明细表 */
|
||||||
|
// 合同主信息主键
|
||||||
|
public static final String BSE_CTRT_DTL_CTRT_MAIN_ID = "CTRT_MAIN_ID";
|
||||||
|
|
||||||
|
/* 交货计划条款表 */
|
||||||
|
// 合同明细主键
|
||||||
|
public static final String BSE_CTRT_PLN_CTRT_DTL_ID = "CTRT_DTL_ID";
|
||||||
|
|
||||||
|
/* 价款结算条款表 */
|
||||||
|
// 合同明细主键
|
||||||
|
public static final String BSE_CTRT_FMU_CTRT_DTL_ID = "CTRT_DTL_ID";
|
||||||
|
|
||||||
|
/* 基础系数配置表 */
|
||||||
|
// 条款主键
|
||||||
|
public static final String BSE_CTRT_COEF_FMU_ID = "FMU_ID";
|
||||||
|
|
||||||
|
/* 品位等级价配置表 */
|
||||||
|
// 条款主键
|
||||||
|
public static final String BSE_CTRT_GRD_FMU_ID = "FMU_ID";
|
||||||
|
|
||||||
|
/* 调整价配置表 */
|
||||||
|
// 条款主键
|
||||||
|
public static final String BSE_CTRT_DDCT_FMU_ID = "FMU_ID";
|
||||||
|
|
||||||
|
/* 市场价配置表 */
|
||||||
|
// 条款主键
|
||||||
|
public static final String BSE_CTRT_PRC_FMU_ID = "FMU_ID";
|
||||||
|
|
||||||
|
/* 品位不计价配置表 */
|
||||||
|
// 条款主键
|
||||||
|
public static final String BSE_CTRT_NT_FMU_ID = "FMU_ID";
|
||||||
|
|
||||||
|
/* 实例字段值表 */
|
||||||
|
// 关联实例主键
|
||||||
|
public static final String BSE_TMPL_INSC_DAT_INSC_ID = "INSC_ID";
|
||||||
|
|
||||||
|
/* 实例条款值表 */
|
||||||
|
// 关联实例主键
|
||||||
|
public static final String BSE_TMPL_INSC_ITM_INSC_ID = "INSC_ID";
|
||||||
|
}
|
||||||
@@ -57,12 +57,11 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
return success(contractViewRespVO);
|
return success(contractViewRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
@PutMapping("update")
|
@PutMapping("update")
|
||||||
@Operation(summary = "修改合同")
|
@Operation(summary = "修改合同")
|
||||||
@PreAuthorize("@ss.hasPermission('system:contract:update')")
|
@PreAuthorize("@ss.hasPermission('system:contract:update')")
|
||||||
public CommonResult<Boolean> update(@Valid @RequestBody ContractSaveReqVO reqVO) {
|
public CommonResult<Boolean> update(@Valid @RequestBody ContractSaveReqVO reqVO) {
|
||||||
return success(true);
|
return success(contractService.update(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class ContractFormulaSaveReqVO {
|
|||||||
private String materialNumber;
|
private String materialNumber;
|
||||||
|
|
||||||
@Schema(description = "计算小数位")
|
@Schema(description = "计算小数位")
|
||||||
private Long decimalBit;
|
private Long decimalPoint;
|
||||||
|
|
||||||
@Schema(description = "金属元素编码")
|
@Schema(description = "金属元素编码")
|
||||||
private String elementNumber;
|
private String elementNumber;
|
||||||
@@ -44,6 +44,9 @@ public class ContractFormulaSaveReqVO {
|
|||||||
@Schema(description = "金属元素名称", example = "金属元素名称")
|
@Schema(description = "金属元素名称", example = "金属元素名称")
|
||||||
private String elementName;
|
private String elementName;
|
||||||
|
|
||||||
|
@Schema(description = "结算类型,多条使用逗号分隔(字典:PRCH_STLM_TP)", example = "LST")
|
||||||
|
private String settlementType;
|
||||||
|
|
||||||
// 基础系数配置
|
// 基础系数配置
|
||||||
private List<ContractCoefficientSaveReqVO> coefficients;
|
private List<ContractCoefficientSaveReqVO> coefficients;
|
||||||
// 品位等级价配置
|
// 品位等级价配置
|
||||||
|
|||||||
@@ -49,5 +49,5 @@ public class ContractPriceSaveReqVO {
|
|||||||
private String averageType;
|
private String averageType;
|
||||||
|
|
||||||
@Schema(description = "网价小数位")
|
@Schema(description = "网价小数位")
|
||||||
private BigDecimal decimalBit;
|
private BigDecimal decimalPoint;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class ContractSaveReqVO {
|
public class ContractSaveReqVO {
|
||||||
|
|
||||||
@Schema(description = "主键")
|
@Schema(description = "主键,新增时为空,修改时需要有值")
|
||||||
@ExcelProperty("主键")
|
@ExcelProperty("主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ContractViewFormulaRespVO {
|
|||||||
private String materialNumber;
|
private String materialNumber;
|
||||||
|
|
||||||
@Schema(description = "计算小数位")
|
@Schema(description = "计算小数位")
|
||||||
private Long decimalBit;
|
private Long decimalPoint;
|
||||||
|
|
||||||
@Schema(description = "金属元素编码")
|
@Schema(description = "金属元素编码")
|
||||||
private String elementNumber;
|
private String elementNumber;
|
||||||
|
|||||||
@@ -49,5 +49,5 @@ public class ContractViewPriceRespVO {
|
|||||||
private String averageType;
|
private String averageType;
|
||||||
|
|
||||||
@Schema(description = "网价小数位")
|
@Schema(description = "网价小数位")
|
||||||
private BigDecimal decimalBit;
|
private BigDecimal decimalPoint;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ public class ContractFormulaDO extends BusinessBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 计算小数位
|
* 计算小数位
|
||||||
*/
|
*/
|
||||||
@TableField("DEC")
|
@TableField("DEC_PNT")
|
||||||
private Long decimalBit;
|
private Long decimalPoint;
|
||||||
/**
|
/**
|
||||||
* 金属元素编码
|
* 金属元素编码
|
||||||
*/
|
*/
|
||||||
@@ -77,4 +77,9 @@ public class ContractFormulaDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("ELEM_NAME")
|
@TableField("ELEM_NAME")
|
||||||
private String elementName;
|
private String elementName;
|
||||||
|
/**
|
||||||
|
* 结算类型,多条使用逗号分隔(字典:PRCH_STLM_TP)
|
||||||
|
*/
|
||||||
|
@TableField("STLM_TP")
|
||||||
|
private String settlementType;
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,6 @@ public class ContractPriceDO extends BusinessBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 网价小数位
|
* 网价小数位
|
||||||
*/
|
*/
|
||||||
@TableField("DEC")
|
@TableField("DEC_PNT")
|
||||||
private BigDecimal decimalBit;
|
private BigDecimal decimalPoint;
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public interface ContractService {
|
|||||||
/**
|
/**
|
||||||
* 新增合同
|
* 新增合同
|
||||||
*
|
*
|
||||||
* @param reqVO 用户信息
|
* @param reqVO 合同信息
|
||||||
* @return 合同ID
|
* @return 合同ID
|
||||||
*/
|
*/
|
||||||
Long createContract(@Valid ContractSaveReqVO reqVO);
|
Long createContract(@Valid ContractSaveReqVO reqVO);
|
||||||
@@ -37,4 +37,12 @@ public interface ContractService {
|
|||||||
* @return 合同信息
|
* @return 合同信息
|
||||||
*/
|
*/
|
||||||
ContractViewRespVO get(Long id);
|
ContractViewRespVO get(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改合同
|
||||||
|
*
|
||||||
|
* @param reqVO 合同信息
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
Boolean update(@Valid ContractSaveReqVO reqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ import com.zt.plat.module.base.service.tmpltp.TemplateInstanceDataService;
|
|||||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
||||||
|
import com.zt.plat.module.contractorder.enums.TableFieldConstants;
|
||||||
import com.zt.plat.module.contractorder.enums.contract.ContractStatusEnum;
|
import com.zt.plat.module.contractorder.enums.contract.ContractStatusEnum;
|
||||||
import com.zt.plat.module.contractorder.enums.contract.DateConstants;
|
import com.zt.plat.module.contractorder.enums.DateConstants;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -74,14 +75,16 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
public Long createContract(ContractSaveReqVO reqVO) {
|
public Long createContract(ContractSaveReqVO reqVO) {
|
||||||
|
|
||||||
// 校验合同名称是否存在
|
// 校验合同名称是否存在
|
||||||
ContractMainDO contract = contractMainMapper.selectOne("CTRT_NAME", reqVO.getContractName());
|
ContractMainDO contract = contractMainMapper
|
||||||
|
.selectOne(TableFieldConstants.BSE_CTRT_MAIN_CTRT_NAME, reqVO.getContractName());
|
||||||
if (contract != null) {
|
if (contract != null) {
|
||||||
throw exception(CONTRACT_NAME_EXISTS);
|
throw exception(CONTRACT_NAME_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(reqVO.getContractPaperNumber())) {
|
if (StringUtils.isNotEmpty(reqVO.getContractPaperNumber())) {
|
||||||
// 校验合同编号是否存在
|
// 校验合同编号是否存在
|
||||||
contract = contractMainMapper.selectOne("CTRT_PPR_NUM", reqVO.getContractPaperNumber());
|
contract = contractMainMapper
|
||||||
|
.selectOne(TableFieldConstants.BSE_CTRT_MAIN_CTRT_PPR_NUM, reqVO.getContractPaperNumber());
|
||||||
if (contract != null) {
|
if (contract != null) {
|
||||||
throw exception(CONTRACT_PAPER_NUMBER_EXISTS);
|
throw exception(CONTRACT_PAPER_NUMBER_EXISTS);
|
||||||
}
|
}
|
||||||
@@ -228,20 +231,21 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 查询并设置物料信息
|
// 查询并设置物料信息
|
||||||
List<ContractDetailDO> detailDOS = contractDetailMapper
|
List<ContractDetailDO> detailDOS = contractDetailMapper
|
||||||
.selectList("CTRT_MAIN_ID", contractMainDO.getId());
|
.selectList(TableFieldConstants.BSE_CTRT_DTL_CTRT_MAIN_ID, contractMainDO.getId());
|
||||||
if (detailDOS != null && !detailDOS.isEmpty()) {
|
if (detailDOS != null && !detailDOS.isEmpty()) {
|
||||||
respVO.setDetail(BeanUtils.toBean(detailDOS, ContractViewDetailRespVO.class));
|
respVO.setDetail(BeanUtils.toBean(detailDOS, ContractViewDetailRespVO.class));
|
||||||
respVO.getDetail().forEach(detail -> {
|
respVO.getDetail().forEach(detail -> {
|
||||||
|
|
||||||
// 查询并设置交货计划
|
// 查询并设置交货计划
|
||||||
List<ContractPlanDO> planDOS = contractPlanMapper.selectList("CTRT_DTL_ID", detail.getId());
|
List<ContractPlanDO> planDOS = contractPlanMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_PLN_CTRT_DTL_ID, detail.getId());
|
||||||
if (planDOS != null && !planDOS.isEmpty()) {
|
if (planDOS != null && !planDOS.isEmpty()) {
|
||||||
detail.setPlans(BeanUtils.toBean(planDOS, ContractViewPlanRespVO.class));
|
detail.setPlans(BeanUtils.toBean(planDOS, ContractViewPlanRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询并设置价款结算条款
|
// 查询并设置价款结算条款
|
||||||
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
|
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
|
||||||
.selectList("CTRT_DTL_ID", detail.getId());
|
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_DTL_ID, detail.getId());
|
||||||
if (formulaDOS != null && !formulaDOS.isEmpty()) {
|
if (formulaDOS != null && !formulaDOS.isEmpty()) {
|
||||||
detail.setFormulas(BeanUtils.toBean(formulaDOS, ContractViewFormulaRespVO.class));
|
detail.setFormulas(BeanUtils.toBean(formulaDOS, ContractViewFormulaRespVO.class));
|
||||||
|
|
||||||
@@ -249,27 +253,31 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 查询并设置基础系数配置
|
// 查询并设置基础系数配置
|
||||||
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
|
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
|
||||||
.selectList("FMU_ID", formula.getId());
|
.selectList(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formula.getId());
|
||||||
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
|
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
|
||||||
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractViewCoefficientRespVO.class));
|
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractViewCoefficientRespVO.class));
|
||||||
}
|
}
|
||||||
// 查询并设置品位等级价配置
|
// 查询并设置品位等级价配置
|
||||||
List<ContractGradeDO> gradeDOS = contractGradeMapper.selectList("FMU_ID", formula.getId());
|
List<ContractGradeDO> gradeDOS = contractGradeMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formula.getId());
|
||||||
if (gradeDOS != null && !gradeDOS.isEmpty()) {
|
if (gradeDOS != null && !gradeDOS.isEmpty()) {
|
||||||
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractViewGradeRespVO.class));
|
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractViewGradeRespVO.class));
|
||||||
}
|
}
|
||||||
// 查询并设置调整价配置
|
// 查询并设置调整价配置
|
||||||
List<ContractDeductDO> deductDOS = contractDeductMapper.selectList("FMU_ID", formula.getId());
|
List<ContractDeductDO> deductDOS = contractDeductMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formula.getId());
|
||||||
if (deductDOS != null && !deductDOS.isEmpty()) {
|
if (deductDOS != null && !deductDOS.isEmpty()) {
|
||||||
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractViewDeductRespVO.class));
|
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractViewDeductRespVO.class));
|
||||||
}
|
}
|
||||||
// 查询并设置市场价配置
|
// 查询并设置市场价配置
|
||||||
List<ContractPriceDO> priceDOS = contractPriceMapper.selectList("FMU_ID", formula.getId());
|
List<ContractPriceDO> priceDOS = contractPriceMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formula.getId());
|
||||||
if (priceDOS != null && !priceDOS.isEmpty()) {
|
if (priceDOS != null && !priceDOS.isEmpty()) {
|
||||||
formula.setPrices(BeanUtils.toBean(priceDOS, ContractViewPriceRespVO.class));
|
formula.setPrices(BeanUtils.toBean(priceDOS, ContractViewPriceRespVO.class));
|
||||||
}
|
}
|
||||||
// 查询并设置品位不计价配置
|
// 查询并设置品位不计价配置
|
||||||
List<ContractNotDO> notDOS = contractNotMapper.selectList("FMU_ID", formula.getId());
|
List<ContractNotDO> notDOS = contractNotMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_NT_FMU_ID, formula.getId());
|
||||||
if (notDOS != null && !notDOS.isEmpty()) {
|
if (notDOS != null && !notDOS.isEmpty()) {
|
||||||
formula.setNots(BeanUtils.toBean(notDOS, ContractViewNotRespVO.class));
|
formula.setNots(BeanUtils.toBean(notDOS, ContractViewNotRespVO.class));
|
||||||
}
|
}
|
||||||
@@ -280,14 +288,14 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 查询并设置合同动态表单
|
// 查询并设置合同动态表单
|
||||||
List<TemplateInstanceDataDO> templateInstanceDataDOS = templateInstanceDataMapper
|
List<TemplateInstanceDataDO> templateInstanceDataDOS = templateInstanceDataMapper
|
||||||
.selectList("INSC_ID", contractMainDO.getInstanceId());
|
.selectList(TableFieldConstants.BSE_TMPL_INSC_DAT_INSC_ID, contractMainDO.getInstanceId());
|
||||||
if (templateInstanceDataDOS != null && !templateInstanceDataDOS.isEmpty()) {
|
if (templateInstanceDataDOS != null && !templateInstanceDataDOS.isEmpty()) {
|
||||||
respVO.setDynamicsFields(BeanUtils.toBean(templateInstanceDataDOS, TemplateInstanceDataRespVO.class));
|
respVO.setDynamicsFields(BeanUtils.toBean(templateInstanceDataDOS, TemplateInstanceDataRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询并设置合同动态条款
|
// 查询并设置合同动态条款
|
||||||
List<TemplateInstanceItemDO> templateInstanceItemDOS = templateInstanceItemMapper
|
List<TemplateInstanceItemDO> templateInstanceItemDOS = templateInstanceItemMapper
|
||||||
.selectList("INSC_ID", contractMainDO.getInstanceId());
|
.selectList(TableFieldConstants.BSE_TMPL_INSC_ITM_INSC_ID, contractMainDO.getInstanceId());
|
||||||
if (templateInstanceItemDOS != null && !templateInstanceItemDOS.isEmpty()) {
|
if (templateInstanceItemDOS != null && !templateInstanceItemDOS.isEmpty()) {
|
||||||
respVO.setDynamicsItems(BeanUtils.toBean(templateInstanceItemDOS, TemplateInstanceItemRespVO.class));
|
respVO.setDynamicsItems(BeanUtils.toBean(templateInstanceItemDOS, TemplateInstanceItemRespVO.class));
|
||||||
}
|
}
|
||||||
@@ -295,6 +303,215 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return respVO;
|
return respVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public Boolean update(ContractSaveReqVO reqVO) {
|
||||||
|
|
||||||
|
// 校验合同主键是否存在
|
||||||
|
Long id = reqVO.getId();
|
||||||
|
if (id == null) {
|
||||||
|
throw exception(CONTRACT_ID_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询合同是否存在
|
||||||
|
ContractMainDO oldContractMainDO = contractMainMapper.selectById(id);
|
||||||
|
if (contractMainMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验合同名称是否重复
|
||||||
|
ContractMainDO contract = contractMainMapper.selectOne(new QueryWrapper<ContractMainDO>()
|
||||||
|
.eq(TableFieldConstants.BSE_CTRT_MAIN_CTRT_NAME, reqVO.getContractName())
|
||||||
|
.ne(TableFieldConstants.ID, id));
|
||||||
|
if (contract != null) {
|
||||||
|
throw exception(CONTRACT_NAME_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(reqVO.getContractPaperNumber())) {
|
||||||
|
// 校验合同编号是否存在
|
||||||
|
contract = contractMainMapper.selectOne(new QueryWrapper<ContractMainDO>()
|
||||||
|
.eq(TableFieldConstants.BSE_CTRT_MAIN_CTRT_PPR_NUM, reqVO.getContractPaperNumber())
|
||||||
|
.ne(TableFieldConstants.ID, id));
|
||||||
|
if (contract != null) {
|
||||||
|
throw exception(CONTRACT_PAPER_NUMBER_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同状态校验
|
||||||
|
if (ContractStatusEnum.DELETED.getCode().equals(oldContractMainDO.getStatus())
|
||||||
|
|| ContractStatusEnum.ARCHIVED.getCode().equals(oldContractMainDO.getStatus())
|
||||||
|
|| ContractStatusEnum.TERMINATED.getCode().equals(oldContractMainDO.getStatus())
|
||||||
|
|| ContractStatusEnum.IN_PROGRESS.getCode().equals(oldContractMainDO.getStatus())
|
||||||
|
|| ContractStatusEnum.UNDER_REVIEW.getCode().equals(oldContractMainDO.getStatus())) {
|
||||||
|
|
||||||
|
throw exception(CONTRACT_STATUS_NOT_UPDATE,
|
||||||
|
ContractStatusEnum.valueOf(oldContractMainDO.getStatus()).getLabel());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 请求更新的合同信息
|
||||||
|
ContractMainDO newContractMainDO = BeanUtils.toBean(reqVO, ContractMainDO.class);
|
||||||
|
|
||||||
|
// 删除关联信息
|
||||||
|
// 查询合同明细
|
||||||
|
List<ContractDetailDO> detailDOS = contractDetailMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_DTL_CTRT_MAIN_ID, id);
|
||||||
|
if (detailDOS != null && !detailDOS.isEmpty()) {
|
||||||
|
detailDOS.forEach(detailDO -> {
|
||||||
|
Long detailDOId = detailDO.getId();
|
||||||
|
|
||||||
|
// 删除交货计划
|
||||||
|
contractPlanMapper.delete(TableFieldConstants.BSE_CTRT_PLN_CTRT_DTL_ID, detailDOId.toString());
|
||||||
|
|
||||||
|
// 查询价款结算条款
|
||||||
|
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
|
||||||
|
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_DTL_ID, detailDOId.toString());
|
||||||
|
if (formulaDOS != null && !formulaDOS.isEmpty()) {
|
||||||
|
formulaDOS.forEach(formulaDO -> {
|
||||||
|
|
||||||
|
// 价款结算条款ID
|
||||||
|
Long formulaDOId = formulaDO.getId();
|
||||||
|
|
||||||
|
// 删除基础系数配置
|
||||||
|
contractCoefficientMapper.delete(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formulaDOId.toString());
|
||||||
|
// 删除品位等级价配置
|
||||||
|
contractGradeMapper.delete(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formulaDOId.toString());
|
||||||
|
// 删除调整价配置
|
||||||
|
contractDeductMapper.delete(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formulaDOId.toString());
|
||||||
|
// 删除市场价配置
|
||||||
|
contractPriceMapper.delete(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formulaDOId.toString());
|
||||||
|
// 删除品位不计价配置
|
||||||
|
contractNotMapper.delete(TableFieldConstants.BSE_CTRT_NT_FMU_ID, formulaDOId.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除价款结算条款
|
||||||
|
contractFormulaMapper.delete(TableFieldConstants.BSE_CTRT_FMU_CTRT_DTL_ID, detailDOId.toString());
|
||||||
|
});
|
||||||
|
|
||||||
|
// 删除合同明细
|
||||||
|
contractDetailMapper.delete(TableFieldConstants.BSE_CTRT_DTL_CTRT_MAIN_ID, id.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重新插入关联信息
|
||||||
|
if (reqVO.getDetail() != null && !reqVO.getDetail().isEmpty()) {
|
||||||
|
reqVO.getDetail().forEach(detail -> {
|
||||||
|
// 合同明细DO
|
||||||
|
ContractDetailDO detailDO = BeanUtils.toBean(detail, ContractDetailDO.class);
|
||||||
|
// 设置合同主信息ID
|
||||||
|
detailDO.setContractMainId(id);
|
||||||
|
// 保存合同明细
|
||||||
|
contractDetailMapper.insert(detailDO);
|
||||||
|
|
||||||
|
// 合同明细ID
|
||||||
|
Long detailDOId = detailDO.getId();
|
||||||
|
// 交货计划
|
||||||
|
if (detail.getPlans() != null && !detail.getPlans().isEmpty()) {
|
||||||
|
detail.getPlans().forEach(plan -> {
|
||||||
|
// 交货计划DO
|
||||||
|
ContractPlanDO planDO = BeanUtils.toBean(plan, ContractPlanDO.class);
|
||||||
|
// 合同明细主键
|
||||||
|
planDO.setContractDetailId(detailDOId);
|
||||||
|
// 保存交货计划
|
||||||
|
contractPlanMapper.insert(planDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 价款结算条款
|
||||||
|
if (detail.getFormulas() != null && !detail.getFormulas().isEmpty()) {
|
||||||
|
detail.getFormulas().forEach(formula -> {
|
||||||
|
// 价款结算条款DO
|
||||||
|
ContractFormulaDO formulaDO = BeanUtils.toBean(formula, ContractFormulaDO.class);
|
||||||
|
// 合同明细主键
|
||||||
|
formulaDO.setContractDetailId(detailDOId);
|
||||||
|
// 保存价款结算条款
|
||||||
|
contractFormulaMapper.insert(formulaDO);
|
||||||
|
|
||||||
|
// 价款结算条款ID
|
||||||
|
Long formulaDOId = formulaDO.getId();
|
||||||
|
// 基础系数配置
|
||||||
|
if (formula.getCoefficients() != null && !formula.getCoefficients().isEmpty()) {
|
||||||
|
formula.getCoefficients().forEach(coefficient -> {
|
||||||
|
// 基础系数配置DO
|
||||||
|
ContractCoefficientDO coefficientDO = BeanUtils.toBean(coefficient, ContractCoefficientDO.class);
|
||||||
|
// 条款主键
|
||||||
|
coefficientDO.setFormulaId(formulaDOId);
|
||||||
|
// 保存基础系数配置
|
||||||
|
contractCoefficientMapper.insert(coefficientDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 品位等级价配置
|
||||||
|
if (formula.getGrades() != null && !formula.getGrades().isEmpty()) {
|
||||||
|
formula.getGrades().forEach(grade -> {
|
||||||
|
// 品位等级价配置DO
|
||||||
|
ContractGradeDO gradeDO = BeanUtils.toBean(grade, ContractGradeDO.class);
|
||||||
|
// 条款主键
|
||||||
|
gradeDO.setFormulaId(formulaDOId);
|
||||||
|
// 保存品位等级价配置
|
||||||
|
contractGradeMapper.insert(gradeDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 调整价配置
|
||||||
|
if (formula.getDeducts() != null && !formula.getDeducts().isEmpty()) {
|
||||||
|
formula.getDeducts().forEach(deduct -> {
|
||||||
|
// 调整价配置DO
|
||||||
|
ContractDeductDO deductDO = BeanUtils.toBean(deduct, ContractDeductDO.class);
|
||||||
|
// 条款主键
|
||||||
|
deductDO.setFormulaId(formulaDOId);
|
||||||
|
// 保存品位等级价配置
|
||||||
|
contractDeductMapper.insert(deductDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 市场价配置
|
||||||
|
if (formula.getPrices()!= null && !formula.getPrices().isEmpty()) {
|
||||||
|
formula.getPrices().forEach(price -> {
|
||||||
|
// 市场价配置DO
|
||||||
|
ContractPriceDO priceDO = BeanUtils.toBean(price, ContractPriceDO.class);
|
||||||
|
// 条款主键
|
||||||
|
priceDO.setFormulaId(formulaDOId);
|
||||||
|
// 保存市场价配置
|
||||||
|
contractPriceMapper.insert(priceDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 品位不计价配置
|
||||||
|
if (formula.getNots() != null && !formula.getNots().isEmpty()) {
|
||||||
|
formula.getNots().forEach(not -> {
|
||||||
|
// 品位不计价配置DO
|
||||||
|
ContractNotDO notDO = BeanUtils.toBean(not, ContractNotDO.class);
|
||||||
|
// 条款主键
|
||||||
|
notDO.setFormulaId(formulaDOId);
|
||||||
|
// 保存品位不计价配置
|
||||||
|
contractNotMapper.insert(notDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同动态表单
|
||||||
|
List<TemplateInstanceDataDO> templateInstanceDataDOS = new ArrayList<>();
|
||||||
|
if (reqVO.getDynamicsFields() != null && !reqVO.getDynamicsFields().isEmpty()) {
|
||||||
|
reqVO.getDynamicsFields().forEach(dynamicsField -> {
|
||||||
|
TemplateInstanceDataDO templateInstanceDataDO = new TemplateInstanceDataDO();
|
||||||
|
BeanUtils.copyProperties(dynamicsField, templateInstanceDataDO);
|
||||||
|
templateInstanceDataDO.setInscId(reqVO.getInstanceId().toString());
|
||||||
|
templateInstanceDataDOS.add(templateInstanceDataDO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 更新合同动态表单值
|
||||||
|
if (!templateInstanceDataDOS.isEmpty()) {
|
||||||
|
templateInstanceDataService.setTemplateInstanceData(templateInstanceDataDOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新合同主信息
|
||||||
|
int updateNum = contractMainMapper.updateById(newContractMainDO);
|
||||||
|
if (updateNum > 0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成系统合同编号
|
* 生成系统合同编号
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
||||||
|
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
@Tag(name = "RPC 服务 - ERP")
|
||||||
|
public interface ErpBillMainApi {
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/erp-external";
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/submit-bill-main")
|
||||||
|
@Operation(summary = "erp数据提交")
|
||||||
|
String submitBillMainToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/submit-bill-main-reverse")
|
||||||
|
@Operation(summary = "冲销")
|
||||||
|
String submitBillMainReverseToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.erp.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发货单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpBillMainSaveReqDTO {
|
||||||
|
|
||||||
|
@Schema(description = "收货单号;自动生成")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@Schema(description = "过账日期")
|
||||||
|
private LocalDateTime postingDate;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料编码")
|
||||||
|
private String materialCoding;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "实物收发货数量")
|
||||||
|
private BigDecimal materialQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "实物计量单位")
|
||||||
|
private String materialUom;
|
||||||
|
|
||||||
|
@Schema(description = "批次")
|
||||||
|
private String batch;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "采购订单行号")
|
||||||
|
private String poItem;
|
||||||
|
|
||||||
|
@Schema(description = "客商编号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private String creatorId;
|
||||||
|
|
||||||
|
@Schema(description = "用户名称")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Validated
|
||||||
|
public class ErpBillMainApiImpl implements ErpBillMainApi{
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpBillMainService erpBillMainService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainToErp(ErpBillMainSaveReqDTO reqDTO) {
|
||||||
|
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
||||||
|
return erpBillMainService.submitBillMainToErp(erpBillMainSaveReqDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainReverseToErp(ErpBillMainSaveReqDTO reqDTO) {
|
||||||
|
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
||||||
|
return erpBillMainService.submitBillMainReverseToErp(erpBillMainSaveReqDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP收货订单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/bill-main")
|
||||||
|
@Validated
|
||||||
|
public class ErpBillMainController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpBillMainService erpBillMainService;
|
||||||
|
|
||||||
|
@PostMapping("/submitBillMainToErp")
|
||||||
|
@Operation(summary = "ERP收货订单推送")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
||||||
|
public String submitBillMainToErp(ErpBillMainSaveReqVO createVo) {
|
||||||
|
return erpBillMainService.submitBillMainToErp(createVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发货单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpBillMainSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "收货单号;自动生成")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@Schema(description = "过账日期")
|
||||||
|
private LocalDateTime postingDate;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料编码")
|
||||||
|
private String materialCoding;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "实物收发货数量")
|
||||||
|
private BigDecimal materialQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "实物计量单位")
|
||||||
|
private String materialUom;
|
||||||
|
|
||||||
|
@Schema(description = "批次")
|
||||||
|
private String batch;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "采购订单行号")
|
||||||
|
private String poItem;
|
||||||
|
|
||||||
|
@Schema(description = "客商编号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private String creatorId;
|
||||||
|
|
||||||
|
@Schema(description = "用户名称")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
|
||||||
|
public interface ErpBillMainService {
|
||||||
|
String submitBillMainToErp(ErpBillMainSaveReqVO createVo);
|
||||||
|
String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.api.ErpExternalApi;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ErpBillMainServiceImpl implements ErpBillMainService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
public ErpExternalApi erpExternalApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainToErp(ErpBillMainSaveReqVO createVo) {
|
||||||
|
ErpSubmitReqDTO reqDTO = buildBaseReqDTO(createVo, "071");
|
||||||
|
|
||||||
|
Map<String, Object> req = new HashMap<>();
|
||||||
|
Map<String, Object> head = new HashMap<>();
|
||||||
|
head.put("pstng_date", createVo.getPostingDate());
|
||||||
|
head.put("doc_date", createVo.getPostingDate());
|
||||||
|
head.put("header_txt", createVo.getRemark());
|
||||||
|
head.put("bill_of_lading", "");
|
||||||
|
req.put("head", head);
|
||||||
|
|
||||||
|
List<Map<String, Object>> items = getMaps(createVo);
|
||||||
|
req.put("item", items);
|
||||||
|
reqDTO.setReq(req);
|
||||||
|
|
||||||
|
return submitToErp(reqDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo) {
|
||||||
|
ErpSubmitReqDTO reqDTO = buildBaseReqDTO(createVo, "079");
|
||||||
|
|
||||||
|
Map<String, Object> req = new HashMap<>();
|
||||||
|
Map<String, Object> head = new HashMap<>();
|
||||||
|
head.put("pstng_date", createVo.getPostingDate());
|
||||||
|
head.put("mat_doc", createVo.getMaterialCoding());
|
||||||
|
head.put("doc_year", "");
|
||||||
|
head.put("header_txt", "");
|
||||||
|
req.put("head", head);
|
||||||
|
|
||||||
|
List<Map<String, Object>> items = new ArrayList<>();
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("matdoc_item", createVo.getPoItem());
|
||||||
|
item.put("line_id", "");
|
||||||
|
items.add(item);
|
||||||
|
req.put("item", items);
|
||||||
|
reqDTO.setReq(req);
|
||||||
|
|
||||||
|
return submitToErp(reqDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抽取重复代码:构建基础 ErpSubmitReqDTO
|
||||||
|
private ErpSubmitReqDTO buildBaseReqDTO(ErpBillMainSaveReqVO vo, String funcnr) {
|
||||||
|
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||||
|
reqDTO.setFuncnr(funcnr);
|
||||||
|
reqDTO.setBskey(vo.getBillNumber());
|
||||||
|
reqDTO.setUsrid(vo.getCreatorId());
|
||||||
|
reqDTO.setUsrnm(vo.getCreatorName());
|
||||||
|
return reqDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抽取重复代码:提交 ERP 并记录日志
|
||||||
|
private String submitToErp(ErpSubmitReqDTO reqDTO) {
|
||||||
|
HashMap<String, String> response = erpExternalApi.submitDataToErp(reqDTO);
|
||||||
|
return response.get("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static List<Map<String, Object>> getMaps(ErpBillMainSaveReqVO createVo) {
|
||||||
|
List<Map<String, Object>> items = new ArrayList<>();
|
||||||
|
Map<String, Object> item = new HashMap<>();
|
||||||
|
item.put("material", createVo.getMaterialCoding());
|
||||||
|
item.put("plant", createVo.getFactoryNumber());
|
||||||
|
item.put("stge_loc", createVo.getWarehouseNumber());
|
||||||
|
item.put("batch", createVo.getBatch());
|
||||||
|
item.put("entry_qnt", createVo.getMaterialQuantity());
|
||||||
|
item.put("entry_uom", createVo.getMaterialUom());
|
||||||
|
item.put("po_number", createVo.getOrderNo());
|
||||||
|
item.put("po_item", createVo.getPoItem());
|
||||||
|
item.put("customer", createVo.getCustomerNumber());
|
||||||
|
item.put("sales_ord", "");
|
||||||
|
item.put("s_ord_item", "");
|
||||||
|
item.put("consume_ant", "");
|
||||||
|
item.put("item_text", createVo.getRemark());
|
||||||
|
item.put("ref_doc_yr", "");
|
||||||
|
item.put("ref_doc", "");
|
||||||
|
item.put("ref_doc_it", "");
|
||||||
|
item.put("unload_pt", "");
|
||||||
|
items.add(item);
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user