Compare commits
2 Commits
7d6957165d
...
test.X
| Author | SHA1 | Date | |
|---|---|---|---|
| 75a2623d8b | |||
| 5d046be15b |
@@ -11,7 +11,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
||||
*/
|
||||
|
||||
//@SpringBootApplication
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(exclude = org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.class)
|
||||
public class KLPApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -130,6 +130,10 @@ spring:
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
|
||||
flyway:
|
||||
baseline-on-migrate: true # 第一次运行时建立记录,不执行历史脚本
|
||||
clean-disabled: true # 禁止清空库
|
||||
|
||||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring:
|
||||
redis:
|
||||
|
||||
@@ -124,6 +124,10 @@ spring:
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
|
||||
flyway:
|
||||
baseline-on-migrate: true # 第一次运行时建立记录,不执行历史脚本
|
||||
clean-disabled: true # 禁止清空库
|
||||
|
||||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring:
|
||||
redis:
|
||||
|
||||
@@ -101,6 +101,11 @@ spring:
|
||||
deserialization:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
# 实时更新数据库结构
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
table: flyway_schema_history
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
@@ -337,9 +342,3 @@ stamp:
|
||||
base-url: http://python-stamp-service.example.com # 替换为实际地址
|
||||
api-key: changeme # 替换为实际鉴权信息
|
||||
timeout-ms: 5000 # 可按需调整
|
||||
|
||||
# OEE配置
|
||||
oee:
|
||||
acid:
|
||||
# 酸轧入场卷创建人(wms_material_coil.create_by)
|
||||
coil-create-by: suanzhakuguan
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS aps_quick_sheet (
|
||||
quick_sheet_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
plan_date DATE NOT NULL COMMENT '计划日期',
|
||||
line_id BIGINT NULL COMMENT '产线ID',
|
||||
line_name VARCHAR(120) NULL COMMENT '产线名称',
|
||||
plan_code VARCHAR(60) NOT NULL COMMENT '计划号',
|
||||
order_code VARCHAR(80) NULL COMMENT '订单号',
|
||||
customer_name VARCHAR(120) NULL COMMENT '客户',
|
||||
salesman VARCHAR(60) NULL COMMENT '业务员',
|
||||
product_name VARCHAR(120) NULL COMMENT '产品',
|
||||
raw_material_id VARCHAR(64) NULL COMMENT '原料钢卷',
|
||||
raw_coil_nos VARCHAR(255) NULL COMMENT '原料卷号',
|
||||
raw_location VARCHAR(120) NULL COMMENT '钢卷位置',
|
||||
raw_packaging VARCHAR(120) NULL COMMENT '包装要求',
|
||||
raw_edge_req VARCHAR(120) NULL COMMENT '切边要求',
|
||||
raw_coating_type VARCHAR(120) NULL COMMENT '镀层种类',
|
||||
raw_net_weight DECIMAL(18, 3) NULL COMMENT '原料净重',
|
||||
plan_qty DECIMAL(18, 3) NULL COMMENT '计划数量',
|
||||
start_time DATETIME NULL COMMENT '开始时间',
|
||||
end_time DATETIME NULL COMMENT '结束时间',
|
||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||
create_by VARCHAR(64) NULL,
|
||||
update_by VARCHAR(64) NULL,
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
INDEX idx_aps_quick_sheet_plan_date (plan_date),
|
||||
INDEX idx_aps_quick_sheet_line_id (line_id)
|
||||
) COMMENT = '快速排产表(Excel样式)';
|
||||
@@ -1,47 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS wms_furnace (
|
||||
furnace_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
furnace_code VARCHAR(50) NOT NULL COMMENT '炉编号',
|
||||
furnace_name VARCHAR(100) NOT NULL COMMENT '名称',
|
||||
busy_flag TINYINT DEFAULT 0 COMMENT '是否忙碌(0否1是)',
|
||||
status TINYINT DEFAULT 1 COMMENT '状态(0停用1启用)',
|
||||
remark VARCHAR(500) NULL COMMENT '备注',
|
||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||
create_by VARCHAR(64) NULL,
|
||||
update_by VARCHAR(64) NULL,
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uk_wms_furnace_code (furnace_code)
|
||||
) COMMENT = '退火炉信息表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS wms_furnace_plan (
|
||||
plan_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
plan_no VARCHAR(60) NOT NULL COMMENT '计划号',
|
||||
plan_start_time DATETIME NULL COMMENT '计划开始时间',
|
||||
actual_start_time DATETIME NULL COMMENT '实际开始时间',
|
||||
end_time DATETIME NULL COMMENT '结束时间',
|
||||
target_furnace_id BIGINT NOT NULL COMMENT '目标炉子ID',
|
||||
status TINYINT DEFAULT 0 COMMENT '计划状态(0未开始 1进行中 2已完成)',
|
||||
remark VARCHAR(500) NULL COMMENT '备注',
|
||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||
create_by VARCHAR(64) NULL,
|
||||
update_by VARCHAR(64) NULL,
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uk_wms_furnace_plan_no (plan_no),
|
||||
INDEX idx_wms_furnace_plan_furnace (target_furnace_id),
|
||||
INDEX idx_wms_furnace_plan_status (status)
|
||||
) COMMENT = '退火计划表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS wms_furnace_plan_coil (
|
||||
plan_coil_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
plan_id BIGINT NOT NULL COMMENT '计划ID',
|
||||
coil_id BIGINT NOT NULL COMMENT '钢卷ID',
|
||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||
create_by VARCHAR(64) NULL,
|
||||
update_by VARCHAR(64) NULL,
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uk_wms_furnace_plan_coil (plan_id, coil_id),
|
||||
INDEX idx_wms_furnace_plan_coil_plan (plan_id),
|
||||
INDEX idx_wms_furnace_plan_coil_coil (coil_id)
|
||||
) COMMENT = '退火计划钢卷关系表';
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.klp.aps.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产单明细
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/planDetail")
|
||||
public class ApsPlanDetailController extends BaseController {
|
||||
|
||||
private final IApsPlanDetailService iApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApsPlanDetailVo> list(ApsPlanDetailBo bo, PageQuery pageQuery) {
|
||||
return iApsPlanDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产单明细列表
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApsPlanDetailBo bo, HttpServletResponse response) {
|
||||
List<ApsPlanDetailVo> list = iApsPlanDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单明细", ApsPlanDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产单明细详细信息
|
||||
*
|
||||
* @param planDetailId 主键
|
||||
*/
|
||||
@GetMapping("/{planDetailId}")
|
||||
public R<ApsPlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planDetailId) {
|
||||
return R.ok(iApsPlanDetailService.queryById(planDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单明细
|
||||
*
|
||||
* @param planDetailIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planDetailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planDetailIds) {
|
||||
return toAjax(iApsPlanDetailService.deleteWithValidByIds(Arrays.asList(planDetailIds), true));
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.klp.aps.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsPlanSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产单主
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/planSheet")
|
||||
public class ApsPlanSheetController extends BaseController {
|
||||
|
||||
private final IApsPlanSheetService iApsPlanSheetService;
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApsPlanSheetVo> list(ApsPlanSheetBo bo, PageQuery pageQuery) {
|
||||
return iApsPlanSheetService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产单主列表
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApsPlanSheetBo bo, HttpServletResponse response) {
|
||||
List<ApsPlanSheetVo> list = iApsPlanSheetService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单主", ApsPlanSheetVo.class, response);
|
||||
}
|
||||
|
||||
@PostMapping("/exportAll")
|
||||
public void export(@Validated ApsPlanSheetQueryReq req, javax.servlet.http.HttpServletResponse response) {
|
||||
iApsPlanSheetService.exportExcel(req, response);
|
||||
}
|
||||
/**
|
||||
* 获取排产单主详细信息
|
||||
*
|
||||
* @param planSheetId 主键
|
||||
*/
|
||||
@GetMapping("/{planSheetId}")
|
||||
public R<ApsPlanSheetVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planSheetId) {
|
||||
return R.ok(iApsPlanSheetService.queryById(planSheetId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单主
|
||||
*
|
||||
* @param planSheetIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planSheetIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planSheetIds) {
|
||||
return toAjax(iApsPlanSheetService.deleteWithValidByIds(Arrays.asList(planSheetIds), true));
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.klp.aps.controller;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetSaveReq;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
import com.klp.aps.service.ApsQuickSheetService;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/quick-sheet")
|
||||
public class ApsQuickSheetController extends BaseController {
|
||||
|
||||
private final ApsQuickSheetService quickSheetService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<List<ApsQuickSheetRowVo>> list(@Validated ApsQuickSheetQueryReq req) {
|
||||
return R.ok(quickSheetService.queryList(req));
|
||||
}
|
||||
|
||||
@GetMapping("/preset")
|
||||
public R<List<ApsQuickSheetRowVo>> preset(@RequestParam(value = "lineId", required = false) Long lineId) {
|
||||
String salesman = LoginHelper.getNickName();
|
||||
return R.ok(quickSheetService.buildPresetRows(lineId, salesman));
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public R<Void> save(@Validated @RequestBody ApsQuickSheetSaveReq req) {
|
||||
quickSheetService.saveRows(req, getUsername());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
public void export(@Validated ApsQuickSheetQueryReq req, javax.servlet.http.HttpServletResponse response) {
|
||||
quickSheetService.exportExcel(req, response);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public R<Void> delete(@RequestParam("quickSheetId") Long quickSheetId) {
|
||||
quickSheetService.deleteById(quickSheetId, getUsername());
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
package com.klp.aps.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 排产单明细业务对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ApsPlanDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
private Long planDetailId;
|
||||
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
private String bizSeqNo;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
private String salesman;
|
||||
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
private String rawManufacturer;
|
||||
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
private String rawMaterial;
|
||||
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
private BigDecimal rawThick;
|
||||
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
private BigDecimal rawWidth;
|
||||
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
private Long rawMaterialId;
|
||||
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
private String rawCoilNos;
|
||||
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
private String rawLocation;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String rawPackaging;
|
||||
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
private String rawEdgeReq;
|
||||
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
private String rawCoatingType;
|
||||
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
private BigDecimal rawNetWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
private String productMaterial;
|
||||
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
private BigDecimal coatingG;
|
||||
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
private BigDecimal productWidth;
|
||||
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
private BigDecimal rollingThick;
|
||||
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
private BigDecimal markCoatThick;
|
||||
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
private String tonSteelLengthRange;
|
||||
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
private BigDecimal planWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
private String widthReq;
|
||||
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
private String productPackaging;
|
||||
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
private String productEdgeReq;
|
||||
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
private String usageReq;
|
||||
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
private String postProcess;
|
||||
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
private String nextProcess;
|
||||
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
private String sampleReq;
|
||||
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.klp.aps.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 排产单主业务对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ApsPlanSheetBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
private String scheduler;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.klp.aps.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class ApsPlanSheetQueryReq {
|
||||
|
||||
// planSheetId
|
||||
private Long planSheetId;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.klp.aps.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ApsPlanSheetSaveReq {
|
||||
@NotEmpty(message = "rows 不能为空")
|
||||
private List<ApsQuickSheetSaveReq.Row> rows;
|
||||
|
||||
@Data
|
||||
public static class Row {
|
||||
private Long quickSheetId;
|
||||
private Long lineId;
|
||||
private String lineName;
|
||||
private String planCode;
|
||||
private String planType;
|
||||
private String scheduler;
|
||||
private String remark;
|
||||
|
||||
private String bizSeqNo;
|
||||
private String orderCode;
|
||||
private String contractCode;
|
||||
private String customerName;
|
||||
private String salesman;
|
||||
|
||||
private String productName;
|
||||
private String productMaterial;
|
||||
private String coatingG;
|
||||
private String productWidth;
|
||||
private String rollingThick;
|
||||
private String markCoatThick;
|
||||
private String tonSteelLengthRange;
|
||||
private String planQty;
|
||||
private String planWeight;
|
||||
private String surfaceTreatment;
|
||||
private String widthReq;
|
||||
private String usageReq;
|
||||
private String postProcess;
|
||||
private String nextProcess;
|
||||
private String sampleReq;
|
||||
|
||||
private String rawManufacturer;
|
||||
private String rawMaterial;
|
||||
private String rawThick;
|
||||
private String rawWidth;
|
||||
private String rawMaterialId;
|
||||
private String rawCoilNos;
|
||||
private String rawLocation;
|
||||
private String rawPackaging;
|
||||
private String rawEdgeReq;
|
||||
private String rawCoatingType;
|
||||
private String rawNetWeight;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.klp.aps.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class ApsQuickSheetQueryReq {
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate startDate;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate endDate;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private String customerName;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.klp.aps.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ApsQuickSheetSaveReq {
|
||||
|
||||
@NotEmpty(message = "rows 不能为空")
|
||||
private List<Row> rows;
|
||||
|
||||
@Data
|
||||
public static class Row {
|
||||
private Long quickSheetId;
|
||||
private Long lineId;
|
||||
private String lineName;
|
||||
private String planCode;
|
||||
private String planType;
|
||||
private String scheduler;
|
||||
private String remark;
|
||||
|
||||
private String bizSeqNo;
|
||||
private String orderCode;
|
||||
private String contractCode;
|
||||
private String customerName;
|
||||
private String salesman;
|
||||
|
||||
private String productName;
|
||||
private String productMaterial;
|
||||
private String coatingG;
|
||||
private String productWidth;
|
||||
private String rollingThick;
|
||||
private String markCoatThick;
|
||||
private String tonSteelLengthRange;
|
||||
private String planQty;
|
||||
private String planWeight;
|
||||
private String surfaceTreatment;
|
||||
private String widthReq;
|
||||
private String usageReq;
|
||||
private String postProcess;
|
||||
private String nextProcess;
|
||||
private String sampleReq;
|
||||
|
||||
private String rawManufacturer;
|
||||
private String rawMaterial;
|
||||
private String rawThick;
|
||||
private String rawWidth;
|
||||
private String rawMaterialId;
|
||||
private String rawCoilNos;
|
||||
private String rawLocation;
|
||||
private String rawPackaging;
|
||||
private String rawEdgeReq;
|
||||
private String rawCoatingType;
|
||||
private String rawNetWeight;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
package com.klp.aps.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 排产单明细对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("aps_plan_detail")
|
||||
public class ApsPlanDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
@TableId(value = "plan_detail_id")
|
||||
private Long planDetailId;
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
private String bizSeqNo;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
private String customerName;
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
private String salesman;
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
private String rawManufacturer;
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
private String rawMaterial;
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
private BigDecimal rawThick;
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
private BigDecimal rawWidth;
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
private Long rawMaterialId;
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
private String rawCoilNos;
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
private String rawLocation;
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String rawPackaging;
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
private String rawEdgeReq;
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
private String rawCoatingType;
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
private BigDecimal rawNetWeight;
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
private String productMaterial;
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
private BigDecimal coatingG;
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
private BigDecimal productWidth;
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
private BigDecimal rollingThick;
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
private BigDecimal markCoatThick;
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
private String tonSteelLengthRange;
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
private BigDecimal planWeight;
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
private String widthReq;
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
private String productPackaging;
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
private String productEdgeReq;
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
private String usageReq;
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
private String postProcess;
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
private String nextProcess;
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
private String sampleReq;
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标记(0正常 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.klp.aps.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 排产单主对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("aps_plan_sheet")
|
||||
public class ApsPlanSheet extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
@TableId(value = "plan_sheet_id")
|
||||
private Long planSheetId;
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date planDate;
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
private Long lineId;
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
private String planCode;
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
private String planType;
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
private String scheduler;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标记(0正常 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.klp.aps.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ApsQuickSheetEntity {
|
||||
private Long quickSheetId;
|
||||
private LocalDate planDate;
|
||||
private Long lineId;
|
||||
private String lineName;
|
||||
private String planCode;
|
||||
private String planType;
|
||||
private String scheduler;
|
||||
private String remark;
|
||||
|
||||
private String bizSeqNo;
|
||||
private String orderCode;
|
||||
private String contractCode;
|
||||
private String customerName;
|
||||
private String salesman;
|
||||
|
||||
private String productName;
|
||||
private String productMaterial;
|
||||
private BigDecimal coatingG;
|
||||
private BigDecimal productWidth;
|
||||
private BigDecimal rollingThick;
|
||||
private BigDecimal markCoatThick;
|
||||
private String tonSteelLengthRange;
|
||||
private BigDecimal planQty;
|
||||
private BigDecimal planWeight;
|
||||
private String surfaceTreatment;
|
||||
private String widthReq;
|
||||
private String usageReq;
|
||||
private String postProcess;
|
||||
private String nextProcess;
|
||||
private String sampleReq;
|
||||
|
||||
private String rawManufacturer;
|
||||
private String rawMaterial;
|
||||
private BigDecimal rawThick;
|
||||
private BigDecimal rawWidth;
|
||||
private String rawMaterialId;
|
||||
private String rawCoilNos;
|
||||
private String rawLocation;
|
||||
private String rawPackaging;
|
||||
private String rawEdgeReq;
|
||||
private String rawCoatingType;
|
||||
private BigDecimal rawNetWeight;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private String createBy;
|
||||
private String updateBy;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -1,271 +0,0 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 排产单明细视图对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApsPlanDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "排产明细主键ID")
|
||||
private Long planDetailId;
|
||||
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联排产单ID")
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
@ExcelProperty(value = "内容序号")
|
||||
private String bizSeqNo;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@ExcelProperty(value = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:订单号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:订单合同号")
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:客户")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:业务员")
|
||||
private String salesman;
|
||||
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:厂家")
|
||||
private String rawManufacturer;
|
||||
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:材质")
|
||||
private String rawMaterial;
|
||||
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:厚度mm")
|
||||
private BigDecimal rawThick;
|
||||
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:宽度mm")
|
||||
private BigDecimal rawWidth;
|
||||
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
@ExcelProperty(value = "原料钢卷ID")
|
||||
private Long rawMaterialId;
|
||||
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
@ExcelProperty(value = "原料卷号")
|
||||
private String rawCoilNos;
|
||||
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
@ExcelProperty(value = "钢卷位置")
|
||||
private String rawLocation;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String rawPackaging;
|
||||
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
@ExcelProperty(value = "宽度要求")
|
||||
private String rawEdgeReq;
|
||||
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
@ExcelProperty(value = "镀层种类")
|
||||
private String rawCoatingType;
|
||||
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
@ExcelProperty(value = "原料净重")
|
||||
private BigDecimal rawNetWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:成品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:材质")
|
||||
private String productMaterial;
|
||||
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:镀层g")
|
||||
private BigDecimal coatingG;
|
||||
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:成品宽度")
|
||||
private BigDecimal productWidth;
|
||||
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:轧制厚度")
|
||||
private BigDecimal rollingThick;
|
||||
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:标签厚度")
|
||||
private BigDecimal markCoatThick;
|
||||
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:吨钢长度区间m")
|
||||
private String tonSteelLengthRange;
|
||||
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:重量")
|
||||
private BigDecimal planWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:切边要求")
|
||||
private String widthReq;
|
||||
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:包装要求")
|
||||
private String productPackaging;
|
||||
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:宽度要求")
|
||||
private String productEdgeReq;
|
||||
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:用途")
|
||||
private String usageReq;
|
||||
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
@ExcelProperty(value = "后处理")
|
||||
private String postProcess;
|
||||
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
@ExcelProperty(value = "下工序")
|
||||
private String nextProcess;
|
||||
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
@ExcelProperty(value = "取样")
|
||||
private String sampleReq;
|
||||
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "生产开始时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "生产结束时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
@ExcelProperty(value = "技术附件")
|
||||
private String techAnnex;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ApsPlanSheetRowVo {
|
||||
private Long detailSheetId;
|
||||
private java.time.LocalDate planDate;
|
||||
private Long lineId;
|
||||
private String lineName;
|
||||
private String planCode;
|
||||
private String planType;
|
||||
private String scheduler;
|
||||
private String masterRemark;
|
||||
private String updateBy;
|
||||
|
||||
private String bizSeqNo;
|
||||
private String orderCode;
|
||||
private String contractCode;
|
||||
private String customerName;
|
||||
private String salesman;
|
||||
|
||||
private String productName;
|
||||
private String productMaterial;
|
||||
private BigDecimal coatingG;
|
||||
private BigDecimal productWidth;
|
||||
private BigDecimal rollingThick;
|
||||
private BigDecimal markCoatThick;
|
||||
private String tonSteelLengthRange;
|
||||
private BigDecimal planQty;
|
||||
private BigDecimal planWeight;
|
||||
private String surfaceTreatment;
|
||||
private String widthReq;
|
||||
private String usageReq;
|
||||
private String postProcess;
|
||||
private String nextProcess;
|
||||
private String sampleReq;
|
||||
|
||||
private String rawManufacturer;
|
||||
private String rawMaterial;
|
||||
private BigDecimal rawThick;
|
||||
private BigDecimal rawWidth;
|
||||
private String rawMaterialId;
|
||||
private String rawCoilNos;
|
||||
private String rawLocation;
|
||||
private String rawPackaging;
|
||||
private String rawEdgeReq;
|
||||
private String rawCoatingType;
|
||||
private BigDecimal rawNetWeight;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private String detailRemark;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 排产单主视图对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApsPlanSheetVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "排产单主键ID")
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
@ExcelProperty(value = "排产日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
@ExcelProperty(value = "产线ID")
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
@ExcelProperty(value = "产线名称")
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
@ExcelProperty(value = "排产单号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
@ExcelProperty(value = "排产类型")
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
@ExcelProperty(value = "排产人")
|
||||
private String scheduler;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ApsQuickSheetRowVo {
|
||||
private Long quickSheetId;
|
||||
private java.time.LocalDate planDate;
|
||||
private Long lineId;
|
||||
private String lineName;
|
||||
private String planCode;
|
||||
private String planType;
|
||||
private String scheduler;
|
||||
private String remark;
|
||||
|
||||
private String bizSeqNo;
|
||||
private String orderCode;
|
||||
private String contractCode;
|
||||
private String customerName;
|
||||
private String salesman;
|
||||
|
||||
private String productName;
|
||||
private String productMaterial;
|
||||
private BigDecimal coatingG;
|
||||
private BigDecimal productWidth;
|
||||
private BigDecimal rollingThick;
|
||||
private BigDecimal markCoatThick;
|
||||
private String tonSteelLengthRange;
|
||||
private BigDecimal planQty;
|
||||
private BigDecimal planWeight;
|
||||
private String surfaceTreatment;
|
||||
private String widthReq;
|
||||
private String usageReq;
|
||||
private String postProcess;
|
||||
private String nextProcess;
|
||||
private String sampleReq;
|
||||
|
||||
private String rawManufacturer;
|
||||
private String rawMaterial;
|
||||
private BigDecimal rawThick;
|
||||
private BigDecimal rawWidth;
|
||||
private String rawMaterialId;
|
||||
private String rawCoilNos;
|
||||
private String rawLocation;
|
||||
private String rawPackaging;
|
||||
private String rawEdgeReq;
|
||||
private String rawCoatingType;
|
||||
private BigDecimal rawNetWeight;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.klp.aps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.aps.domain.entity.ApsPlanDetail;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 排产单明细Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface ApsPlanDetailMapper extends BaseMapperPlus<ApsPlanDetailMapper, ApsPlanDetail, ApsPlanDetailVo> {
|
||||
|
||||
int deleteByPlanSheetIds(Collection<Long> planSheetIds);
|
||||
|
||||
Page<ApsPlanDetailVo> selectVoPagePlus(Page<ApsPlanDetailVo> page, @Param("ew") QueryWrapper<ApsPlanDetail> queryWrapper);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.klp.aps.mapper;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsPlanSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.entity.ApsPlanSheet;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetRowVo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排产单主Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface ApsPlanSheetMapper extends BaseMapperPlus<ApsPlanSheetMapper, ApsPlanSheet, ApsPlanSheetVo> {
|
||||
|
||||
List<ApsPlanSheetRowVo> selectList(ApsPlanSheetQueryReq req);
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package com.klp.aps.mapper;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public interface ApsQuickSheetMapper {
|
||||
|
||||
List<ApsQuickSheetRowVo> selectList(ApsQuickSheetQueryReq req);
|
||||
|
||||
int countToday(@Param("planDate") LocalDate planDate);
|
||||
|
||||
Long selectIdByPlanCode(@Param("planCode") String planCode);
|
||||
|
||||
int insertRow(@Param("lineId") Long lineId,
|
||||
@Param("lineName") String lineName,
|
||||
@Param("planDate") LocalDate planDate,
|
||||
@Param("planCode") String planCode,
|
||||
@Param("planType") String planType,
|
||||
@Param("scheduler") String scheduler,
|
||||
@Param("remark") String remark,
|
||||
@Param("bizSeqNo") String bizSeqNo,
|
||||
@Param("orderCode") String orderCode,
|
||||
@Param("contractCode") String contractCode,
|
||||
@Param("customerName") String customerName,
|
||||
@Param("salesman") String salesman,
|
||||
@Param("productName") String productName,
|
||||
@Param("productMaterial") String productMaterial,
|
||||
@Param("coatingG") BigDecimal coatingG,
|
||||
@Param("productWidth") BigDecimal productWidth,
|
||||
@Param("rollingThick") BigDecimal rollingThick,
|
||||
@Param("markCoatThick") BigDecimal markCoatThick,
|
||||
@Param("tonSteelLengthRange") String tonSteelLengthRange,
|
||||
@Param("planQty") BigDecimal planQty,
|
||||
@Param("planWeight") BigDecimal planWeight,
|
||||
@Param("surfaceTreatment") String surfaceTreatment,
|
||||
@Param("widthReq") String widthReq,
|
||||
@Param("usageReq") String usageReq,
|
||||
@Param("postProcess") String postProcess,
|
||||
@Param("nextProcess") String nextProcess,
|
||||
@Param("sampleReq") String sampleReq,
|
||||
@Param("rawManufacturer") String rawManufacturer,
|
||||
@Param("rawMaterial") String rawMaterial,
|
||||
@Param("rawThick") BigDecimal rawThick,
|
||||
@Param("rawWidth") BigDecimal rawWidth,
|
||||
@Param("rawMaterialId") String rawMaterialId,
|
||||
@Param("rawCoilNos") String rawCoilNos,
|
||||
@Param("rawLocation") String rawLocation,
|
||||
@Param("rawPackaging") String rawPackaging,
|
||||
@Param("rawEdgeReq") String rawEdgeReq,
|
||||
@Param("rawCoatingType") String rawCoatingType,
|
||||
@Param("rawNetWeight") BigDecimal rawNetWeight,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime,
|
||||
@Param("createBy") String createBy,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
int updateRow(@Param("id") Long id,
|
||||
@Param("lineId") Long lineId,
|
||||
@Param("lineName") String lineName,
|
||||
@Param("planCode") String planCode,
|
||||
@Param("planType") String planType,
|
||||
@Param("scheduler") String scheduler,
|
||||
@Param("remark") String remark,
|
||||
@Param("bizSeqNo") String bizSeqNo,
|
||||
@Param("orderCode") String orderCode,
|
||||
@Param("contractCode") String contractCode,
|
||||
@Param("customerName") String customerName,
|
||||
@Param("salesman") String salesman,
|
||||
@Param("productName") String productName,
|
||||
@Param("productMaterial") String productMaterial,
|
||||
@Param("coatingG") BigDecimal coatingG,
|
||||
@Param("productWidth") BigDecimal productWidth,
|
||||
@Param("rollingThick") BigDecimal rollingThick,
|
||||
@Param("markCoatThick") BigDecimal markCoatThick,
|
||||
@Param("tonSteelLengthRange") String tonSteelLengthRange,
|
||||
@Param("planQty") BigDecimal planQty,
|
||||
@Param("planWeight") BigDecimal planWeight,
|
||||
@Param("surfaceTreatment") String surfaceTreatment,
|
||||
@Param("widthReq") String widthReq,
|
||||
@Param("usageReq") String usageReq,
|
||||
@Param("postProcess") String postProcess,
|
||||
@Param("nextProcess") String nextProcess,
|
||||
@Param("sampleReq") String sampleReq,
|
||||
@Param("rawManufacturer") String rawManufacturer,
|
||||
@Param("rawMaterial") String rawMaterial,
|
||||
@Param("rawThick") BigDecimal rawThick,
|
||||
@Param("rawWidth") BigDecimal rawWidth,
|
||||
@Param("rawMaterialId") String rawMaterialId,
|
||||
@Param("rawCoilNos") String rawCoilNos,
|
||||
@Param("rawLocation") String rawLocation,
|
||||
@Param("rawPackaging") String rawPackaging,
|
||||
@Param("rawEdgeReq") String rawEdgeReq,
|
||||
@Param("rawCoatingType") String rawCoatingType,
|
||||
@Param("rawNetWeight") BigDecimal rawNetWeight,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
int deleteRow(@Param("id") Long id, @Param("updateBy") String updateBy);
|
||||
|
||||
int softDelete(@Param("id") Long id,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
int deleteById(@Param("id") Long id, @Param("updateBy") String updateBy);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.klp.aps.service;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetSaveReq;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
public interface ApsQuickSheetService {
|
||||
List<ApsQuickSheetRowVo> queryList(ApsQuickSheetQueryReq req);
|
||||
|
||||
void saveRows(ApsQuickSheetSaveReq req, String operator);
|
||||
|
||||
List<ApsQuickSheetRowVo> buildPresetRows(Long lineId, String salesman);
|
||||
|
||||
void exportExcel(ApsQuickSheetQueryReq req, HttpServletResponse response);
|
||||
|
||||
void deleteById(Long id, String operator);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.klp.aps.service;
|
||||
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排产单明细Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface IApsPlanDetailService {
|
||||
|
||||
/**
|
||||
* 查询排产单明细
|
||||
*/
|
||||
ApsPlanDetailVo queryById(Long planDetailId);
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
TableDataInfo<ApsPlanDetailVo> queryPageList(ApsPlanDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
List<ApsPlanDetailVo> queryList(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
Boolean updateByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除排产单明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据排产单ID删除明细
|
||||
*/
|
||||
int deleteByPlanSheetIds(Collection<Long> planSheetIds);
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.klp.aps.service;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsPlanSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排产单主Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface IApsPlanSheetService {
|
||||
|
||||
/**
|
||||
* 查询排产单主
|
||||
*/
|
||||
ApsPlanSheetVo queryById(Long planSheetId);
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
TableDataInfo<ApsPlanSheetVo> queryPageList(ApsPlanSheetBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
List<ApsPlanSheetVo> queryList(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
Boolean updateByBo(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除排产单主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
|
||||
void exportExcel(ApsPlanSheetQueryReq req, HttpServletResponse response);
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
package com.klp.aps.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.entity.ApsPlanDetail;
|
||||
import com.klp.aps.mapper.ApsPlanDetailMapper;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 排产单明细Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
|
||||
private final ApsPlanDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询排产单明细
|
||||
*/
|
||||
@Override
|
||||
public ApsPlanDetailVo queryById(Long planDetailId){
|
||||
return baseMapper.selectVoById(planDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ApsPlanDetailVo> queryPageList(ApsPlanDetailBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<ApsPlanDetail> qw = buildQueryWrapperPlus(bo);
|
||||
Page<ApsPlanDetailVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), qw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<ApsPlanDetail> buildQueryWrapperPlus(ApsPlanDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<ApsPlanDetail> qw = new QueryWrapper<>();
|
||||
qw.eq("d.del_flag", 0);
|
||||
qw.eq(bo.getPlanSheetId() != null, "d.plan_sheet_id", bo.getPlanSheetId());
|
||||
qw.eq(bo.getOrderId() != null, "d.order_id", bo.getOrderId());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getBizSeqNo()), "d.biz_seq_no", bo.getBizSeqNo());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getOrderCode()), "d.order_code", bo.getOrderCode());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getContractCode()), "d.contract_code", bo.getContractCode());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerName()), "d.customer_name", bo.getCustomerName());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSalesman()), "d.salesman", bo.getSalesman());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawManufacturer()), "d.raw_manufacturer", bo.getRawManufacturer());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawMaterial()), "d.raw_material", bo.getRawMaterial());
|
||||
qw.eq(bo.getRawThick() != null, "d.raw_thick", bo.getRawThick());
|
||||
qw.eq(bo.getRawWidth() != null, "d.raw_width", bo.getRawWidth());
|
||||
qw.eq(bo.getRawMaterialId() != null, "d.raw_material_id", bo.getRawMaterialId());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawCoilNos()), "d.raw_coil_nos", bo.getRawCoilNos());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawLocation()), "d.raw_location", bo.getRawLocation());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawPackaging()), "d.raw_packaging", bo.getRawPackaging());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawEdgeReq()), "d.raw_edge_req", bo.getRawEdgeReq());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getRawCoatingType()), "d.raw_coating_type", bo.getRawCoatingType());
|
||||
qw.eq(bo.getRawNetWeight() != null, "d.raw_net_weight", bo.getRawNetWeight());
|
||||
qw.like(StringUtils.isNotBlank(bo.getProductName()), "d.product_name", bo.getProductName());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getProductMaterial()), "d.product_material", bo.getProductMaterial());
|
||||
qw.eq(bo.getCoatingG() != null, "d.coating_g", bo.getCoatingG());
|
||||
qw.eq(bo.getProductWidth() != null, "d.product_width", bo.getProductWidth());
|
||||
qw.eq(bo.getRollingThick() != null, "d.rolling_thick", bo.getRollingThick());
|
||||
qw.eq(bo.getMarkCoatThick() != null, "d.mark_coat_thick", bo.getMarkCoatThick());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getTonSteelLengthRange()), "d.ton_steel_length_range", bo.getTonSteelLengthRange());
|
||||
qw.eq(bo.getPlanQty() != null, "d.plan_qty", bo.getPlanQty());
|
||||
qw.eq(bo.getPlanWeight() != null, "d.plan_weight", bo.getPlanWeight());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), "d.surface_treatment", bo.getSurfaceTreatment());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getWidthReq()), "d.width_req", bo.getWidthReq());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getProductPackaging()), "d.product_packaging", bo.getProductPackaging());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getProductEdgeReq()), "d.product_edge_req", bo.getProductEdgeReq());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getUsageReq()), "d.usage_req", bo.getUsageReq());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getPostProcess()), "d.post_process", bo.getPostProcess());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getNextProcess()), "d.next_process", bo.getNextProcess());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSampleReq()), "d.sample_req", bo.getSampleReq());
|
||||
qw.eq(bo.getStartTime() != null, "d.start_time", bo.getStartTime());
|
||||
qw.eq(bo.getEndTime() != null, "d.end_time", bo.getEndTime());
|
||||
//根据创建时间倒叙
|
||||
qw.orderByDesc("d.create_time");
|
||||
return qw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanDetailVo> queryList(ApsPlanDetailBo bo) {
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApsPlanDetail> buildQueryWrapper(ApsPlanDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getPlanSheetId() != null, ApsPlanDetail::getPlanSheetId, bo.getPlanSheetId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBizSeqNo()), ApsPlanDetail::getBizSeqNo, bo.getBizSeqNo());
|
||||
lqw.eq(bo.getOrderId() != null, ApsPlanDetail::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderCode()), ApsPlanDetail::getOrderCode, bo.getOrderCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), ApsPlanDetail::getContractCode, bo.getContractCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), ApsPlanDetail::getCustomerName, bo.getCustomerName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSalesman()), ApsPlanDetail::getSalesman, bo.getSalesman());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawManufacturer()), ApsPlanDetail::getRawManufacturer, bo.getRawManufacturer());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawMaterial()), ApsPlanDetail::getRawMaterial, bo.getRawMaterial());
|
||||
lqw.eq(bo.getRawThick() != null, ApsPlanDetail::getRawThick, bo.getRawThick());
|
||||
lqw.eq(bo.getRawWidth() != null, ApsPlanDetail::getRawWidth, bo.getRawWidth());
|
||||
lqw.eq(bo.getRawMaterialId() != null, ApsPlanDetail::getRawMaterialId, bo.getRawMaterialId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawCoilNos()), ApsPlanDetail::getRawCoilNos, bo.getRawCoilNos());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawLocation()), ApsPlanDetail::getRawLocation, bo.getRawLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawPackaging()), ApsPlanDetail::getRawPackaging, bo.getRawPackaging());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawEdgeReq()), ApsPlanDetail::getRawEdgeReq, bo.getRawEdgeReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawCoatingType()), ApsPlanDetail::getRawCoatingType, bo.getRawCoatingType());
|
||||
lqw.eq(bo.getRawNetWeight() != null, ApsPlanDetail::getRawNetWeight, bo.getRawNetWeight());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductName()), ApsPlanDetail::getProductName, bo.getProductName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductMaterial()), ApsPlanDetail::getProductMaterial, bo.getProductMaterial());
|
||||
lqw.eq(bo.getCoatingG() != null, ApsPlanDetail::getCoatingG, bo.getCoatingG());
|
||||
lqw.eq(bo.getProductWidth() != null, ApsPlanDetail::getProductWidth, bo.getProductWidth());
|
||||
lqw.eq(bo.getRollingThick() != null, ApsPlanDetail::getRollingThick, bo.getRollingThick());
|
||||
lqw.eq(bo.getMarkCoatThick() != null, ApsPlanDetail::getMarkCoatThick, bo.getMarkCoatThick());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTonSteelLengthRange()), ApsPlanDetail::getTonSteelLengthRange, bo.getTonSteelLengthRange());
|
||||
lqw.eq(bo.getPlanQty() != null, ApsPlanDetail::getPlanQty, bo.getPlanQty());
|
||||
lqw.eq(bo.getPlanWeight() != null, ApsPlanDetail::getPlanWeight, bo.getPlanWeight());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), ApsPlanDetail::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWidthReq()), ApsPlanDetail::getWidthReq, bo.getWidthReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductPackaging()), ApsPlanDetail::getProductPackaging, bo.getProductPackaging());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductEdgeReq()), ApsPlanDetail::getProductEdgeReq, bo.getProductEdgeReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUsageReq()), ApsPlanDetail::getUsageReq, bo.getUsageReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPostProcess()), ApsPlanDetail::getPostProcess, bo.getPostProcess());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNextProcess()), ApsPlanDetail::getNextProcess, bo.getNextProcess());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSampleReq()), ApsPlanDetail::getSampleReq, bo.getSampleReq());
|
||||
lqw.eq(bo.getStartTime() != null, ApsPlanDetail::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, ApsPlanDetail::getEndTime, bo.getEndTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ApsPlanDetailBo bo) {
|
||||
ApsPlanDetail add = BeanUtil.toBean(bo, ApsPlanDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanDetailId(add.getPlanDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApsPlanDetailBo bo) {
|
||||
ApsPlanDetail update = BeanUtil.toBean(bo, ApsPlanDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ApsPlanDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanSheetIds(Collection<Long> planSheetIds) {
|
||||
return baseMapper.deleteByPlanSheetIds(planSheetIds);
|
||||
}
|
||||
}
|
||||
@@ -1,329 +0,0 @@
|
||||
package com.klp.aps.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.aps.domain.dto.ApsPlanSheetQueryReq;
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetQueryReq;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetRowVo;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.exception.ServiceException;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFFont;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.entity.ApsPlanSheet;
|
||||
import com.klp.aps.mapper.ApsPlanSheetMapper;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 排产单主Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
|
||||
private final ApsPlanSheetMapper baseMapper;
|
||||
private final IApsPlanDetailService planDetailService;
|
||||
|
||||
/**
|
||||
* 查询排产单主
|
||||
*/
|
||||
@Override
|
||||
public ApsPlanSheetVo queryById(Long planSheetId) {
|
||||
return baseMapper.selectVoById(planSheetId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ApsPlanSheetVo> queryPageList(ApsPlanSheetBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = buildQueryWrapper(bo);
|
||||
Page<ApsPlanSheetVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanSheetVo> queryList(ApsPlanSheetBo bo) {
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApsPlanSheet> buildQueryWrapper(ApsPlanSheetBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getPlanDate() != null, ApsPlanSheet::getPlanDate, bo.getPlanDate());
|
||||
lqw.eq(bo.getLineId() != null, ApsPlanSheet::getLineId, bo.getLineId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLineName()), ApsPlanSheet::getLineName, bo.getLineName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlanCode()), ApsPlanSheet::getPlanCode, bo.getPlanCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlanType()), ApsPlanSheet::getPlanType, bo.getPlanType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getScheduler()), ApsPlanSheet::getScheduler, bo.getScheduler());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ApsPlanSheetBo bo) {
|
||||
ApsPlanSheet add = BeanUtil.toBean(bo, ApsPlanSheet.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanSheetId(add.getPlanSheetId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApsPlanSheetBo bo) {
|
||||
ApsPlanSheet update = BeanUtil.toBean(bo, ApsPlanSheet.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ApsPlanSheet entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
planDetailService.deleteByPlanSheetIds(ids);
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportExcel(ApsPlanSheetQueryReq req, HttpServletResponse response) {
|
||||
List<ApsPlanSheetRowVo> rows = queryListAll(req);
|
||||
try (Workbook wb = new XSSFWorkbook()) {
|
||||
Sheet sheet = wb.createSheet("快速排产表");
|
||||
|
||||
int r = 0;
|
||||
Row title = sheet.createRow(r++);
|
||||
title.setHeightInPoints(36f);
|
||||
Cell t0 = title.createCell(0);
|
||||
Long planSheetId = req.getPlanSheetId();
|
||||
if (planSheetId != null) {
|
||||
ApsPlanSheetVo planSheet = queryById(planSheetId);
|
||||
// 格式化日期
|
||||
String dateStr = "";
|
||||
if (planSheet.getPlanDate() != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
dateStr = sdf.format(planSheet.getPlanDate());
|
||||
}
|
||||
t0.setCellValue(dateStr + "————" + planSheet.getLineName() + "————" + planSheet.getPlanCode());
|
||||
} else {
|
||||
t0.setCellValue("快速排产表");
|
||||
}
|
||||
// 1. 先创建标题样式
|
||||
CellStyle titleStyle = wb.createCellStyle();
|
||||
titleStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
XSSFFont titleFont = ((XSSFWorkbook) wb).createFont();
|
||||
titleFont.setBold(true);
|
||||
titleFont.setFontHeightInPoints((short) 15);
|
||||
titleStyle.setFont(titleFont);
|
||||
|
||||
// 2. 合并区域
|
||||
CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 40);
|
||||
sheet.addMergedRegion(titleRegion);
|
||||
|
||||
// 3. 给【整个合并区域】设置样式
|
||||
for (int i = titleRegion.getFirstColumn(); i <= titleRegion.getLastColumn(); i++) {
|
||||
Cell cell = title.getCell(i);
|
||||
if (cell == null) {
|
||||
cell = title.createCell(i);
|
||||
}
|
||||
cell.setCellStyle(titleStyle);
|
||||
}
|
||||
|
||||
String[] headers = new String[]{
|
||||
"产线", "排产日期", "排产单号", "排产类型", "排产人", "修改人", "计划备注",
|
||||
"内容序号", "销售内容", "订单合同号", "客户", "业务员",
|
||||
"成品名称", "材质", "镀层g", "成品宽度", "轧制厚度", "标丝厚度", "吨钢长度区间m",
|
||||
"数量", "重量", "表面处理", "切边要求", "宽度要求", "用途", "后处理", "下工序", "取样",
|
||||
"厂家", "原料信息", "原料厚度mm", "宽度mm", "原料钢卷", "原料卷号", "钢卷位置", "包装要求", "镀层种类", "原料净重",
|
||||
"开始时间", "结束时间", "明细备注"
|
||||
};
|
||||
|
||||
// ===================== 【绝对不报错】表头样式 =====================
|
||||
org.apache.poi.ss.usermodel.CellStyle headStyle = wb.createCellStyle();
|
||||
org.apache.poi.ss.usermodel.Font headFont = wb.createFont();
|
||||
|
||||
// 1. 字体加粗
|
||||
headFont.setBold(true);
|
||||
headStyle.setFont(headFont);
|
||||
|
||||
// 2. 居中
|
||||
headStyle.setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER);
|
||||
headStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
|
||||
|
||||
// 3. 背景颜色(浅蓝色)
|
||||
headStyle.setFillPattern(org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND);
|
||||
headStyle.setFillForegroundColor(org.apache.poi.ss.usermodel.IndexedColors.PALE_BLUE.getIndex());
|
||||
|
||||
// 4. 自动换行
|
||||
headStyle.setWrapText(true);
|
||||
|
||||
// 创建表头行
|
||||
org.apache.poi.ss.usermodel.Row head = sheet.createRow(r++);
|
||||
head.setHeightInPoints(24);
|
||||
|
||||
// 设置表头内容 + 样式
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
org.apache.poi.ss.usermodel.Cell cell = head.createCell(i);
|
||||
cell.setCellValue(headers[i]);
|
||||
cell.setCellStyle(headStyle);
|
||||
}
|
||||
|
||||
// ================== 【统一样式:前7列居中】 ==================
|
||||
CellStyle centerStyle = wb.createCellStyle();
|
||||
centerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
centerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
// ================== 数据行 ==================
|
||||
int dataStartRow = r;
|
||||
if (rows != null && !rows.isEmpty()) {
|
||||
for (ApsPlanSheetRowVo row : rows) {
|
||||
Row rr = sheet.createRow(r++);
|
||||
int cc = 0;
|
||||
|
||||
// ====== 前7列:相同内容,需要居中 + 后续合并 ======
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getLineName(), row.getLineId()));
|
||||
rr.createCell(cc++).setCellValue(row.getPlanDate() == null ? "" : row.getPlanDate().toString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPlanCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPlanType(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getScheduler(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getUpdateBy(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getMasterRemark(), ""));
|
||||
|
||||
// 前7列设置居中
|
||||
for (int i = 0; i < 7; i++) {
|
||||
rr.getCell(i).setCellStyle(centerStyle);
|
||||
}
|
||||
|
||||
// ====== 后面列不变 ======
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getBizSeqNo(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getOrderCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getContractCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getCustomerName(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSalesman(), ""));
|
||||
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getProductName(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getProductMaterial(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getCoatingG() == null ? "" : row.getCoatingG().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getProductWidth() == null ? "" : row.getProductWidth().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getRollingThick() == null ? "" : row.getRollingThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getMarkCoatThick() == null ? "" : row.getMarkCoatThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getTonSteelLengthRange(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getPlanQty() == null ? "" : row.getPlanQty().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getPlanWeight() == null ? "" : row.getPlanWeight().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSurfaceTreatment(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getWidthReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawEdgeReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getUsageReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPostProcess(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getNextProcess(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSampleReq(), ""));
|
||||
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawManufacturer(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterial(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getRawThick() == null ? "" : row.getRawThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getRawWidth() == null ? "" : row.getRawWidth().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterialId(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawCoilNos(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawLocation(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawPackaging(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawCoatingType(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getRawNetWeight() == null ? "" : row.getRawNetWeight().toPlainString());
|
||||
|
||||
rr.createCell(cc++).setCellValue(row.getStartTime() == null ? "" : row.getStartTime().toString());
|
||||
rr.createCell(cc++).setCellValue(row.getEndTime() == null ? "" : row.getEndTime().toString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getDetailRemark(), ""));
|
||||
}
|
||||
}
|
||||
|
||||
// ================== 【核心:前7列自动合并】 ==================
|
||||
int dataEndRow = r - 1;
|
||||
if (dataStartRow <= dataEndRow) {
|
||||
for (int col = 0; col < 7; col++) { // 0~6 共7列
|
||||
CellRangeAddress region = new CellRangeAddress(
|
||||
dataStartRow,
|
||||
dataEndRow,
|
||||
col,
|
||||
col
|
||||
);
|
||||
sheet.addMergedRegion(region);
|
||||
}
|
||||
}
|
||||
|
||||
// 自适应列宽
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
sheet.autoSizeColumn(i, true);
|
||||
int w = sheet.getColumnWidth(i);
|
||||
sheet.setColumnWidth(i, Math.min(Math.max(w, 3000), 12000));
|
||||
}
|
||||
|
||||
String filename = "aps_quick_sheet_" + System.currentTimeMillis() + ".xlsx";
|
||||
String encoded = URLEncoder.encode(filename, StandardCharsets.UTF_8.name());
|
||||
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + encoded);
|
||||
|
||||
try (ServletOutputStream os = response.getOutputStream()) {
|
||||
wb.write(os);
|
||||
os.flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("导出失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private List<ApsPlanSheetRowVo> queryListAll(ApsPlanSheetQueryReq req) {
|
||||
return baseMapper.selectList(req);
|
||||
}
|
||||
|
||||
private String nvl(Object v, Object fallback) {
|
||||
if (v == null) return String.valueOf(fallback);
|
||||
String s = String.valueOf(v);
|
||||
return s == null ? String.valueOf(fallback) : s;
|
||||
}
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
package com.klp.aps.service.impl;
|
||||
|
||||
import com.klp.aps.domain.dto.ApsQuickSheetSaveReq;
|
||||
import com.klp.aps.domain.vo.ApsQuickSheetRowVo;
|
||||
import com.klp.aps.mapper.ApsQuickSheetMapper;
|
||||
import com.klp.aps.service.ApsQuickSheetService;
|
||||
import com.klp.common.exception.ServiceException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
|
||||
|
||||
private final ApsQuickSheetMapper quickSheetMapper;
|
||||
|
||||
private static final DateTimeFormatter DATE_CODE = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
|
||||
@Override
|
||||
public List<ApsQuickSheetRowVo> queryList(com.klp.aps.domain.dto.ApsQuickSheetQueryReq req) {
|
||||
return quickSheetMapper.selectList(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRows(ApsQuickSheetSaveReq req, String operator) {
|
||||
if (req == null || req.getRows() == null) {
|
||||
throw new ServiceException("保存数据不能为空");
|
||||
}
|
||||
for (ApsQuickSheetSaveReq.Row row : req.getRows()) {
|
||||
if (row == null) continue;
|
||||
Long id = row.getQuickSheetId();
|
||||
Long lineId = row.getLineId();
|
||||
String lineName = row.getLineName();
|
||||
String planCode = row.getPlanCode();
|
||||
String planType = row.getPlanType();
|
||||
String scheduler = row.getScheduler();
|
||||
String remark = row.getRemark();
|
||||
|
||||
String bizSeqNo = row.getBizSeqNo();
|
||||
String orderCode = row.getOrderCode();
|
||||
String contractCode = row.getContractCode();
|
||||
String customerName = row.getCustomerName();
|
||||
String salesman = row.getSalesman();
|
||||
|
||||
String productName = row.getProductName();
|
||||
String productMaterial = row.getProductMaterial();
|
||||
BigDecimal coatingG = parseQty(row.getCoatingG());
|
||||
BigDecimal productWidth = parseQty(row.getProductWidth());
|
||||
BigDecimal rollingThick = parseQty(row.getRollingThick());
|
||||
BigDecimal markCoatThick = parseQty(row.getMarkCoatThick());
|
||||
String tonSteelLengthRange = row.getTonSteelLengthRange();
|
||||
BigDecimal planQty = parseQty(row.getPlanQty());
|
||||
BigDecimal planWeight = parseQty(row.getPlanWeight());
|
||||
String surfaceTreatment = row.getSurfaceTreatment();
|
||||
String widthReq = row.getWidthReq();
|
||||
String usageReq = row.getUsageReq();
|
||||
String postProcess = row.getPostProcess();
|
||||
String nextProcess = row.getNextProcess();
|
||||
String sampleReq = row.getSampleReq();
|
||||
|
||||
String rawManufacturer = row.getRawManufacturer();
|
||||
String rawMaterial = row.getRawMaterial();
|
||||
BigDecimal rawThick = parseQty(row.getRawThick());
|
||||
BigDecimal rawWidth = parseQty(row.getRawWidth());
|
||||
String rawMaterialId = row.getRawMaterialId();
|
||||
String rawCoilNos = row.getRawCoilNos();
|
||||
String rawLocation = row.getRawLocation();
|
||||
String rawPackaging = row.getRawPackaging();
|
||||
String rawEdgeReq = row.getRawEdgeReq();
|
||||
String rawCoatingType = row.getRawCoatingType();
|
||||
BigDecimal rawNetWeight = parseQty(row.getRawNetWeight());
|
||||
LocalDateTime startTime = parseTime(row.getStartTime());
|
||||
LocalDateTime endTime = parseTime(row.getEndTime());
|
||||
|
||||
boolean hasAny = lineId != null || isNotBlank(lineName) || isNotBlank(planCode) || isNotBlank(planType)
|
||||
|| isNotBlank(scheduler) || isNotBlank(remark)
|
||||
|| isNotBlank(bizSeqNo) || isNotBlank(orderCode) || isNotBlank(contractCode)
|
||||
|| isNotBlank(customerName) || isNotBlank(salesman)
|
||||
|| isNotBlank(productName) || isNotBlank(productMaterial)
|
||||
|| coatingG != null || productWidth != null || rollingThick != null || markCoatThick != null
|
||||
|| isNotBlank(tonSteelLengthRange) || planQty != null || planWeight != null
|
||||
|| isNotBlank(surfaceTreatment) || isNotBlank(widthReq) || isNotBlank(usageReq)
|
||||
|| isNotBlank(postProcess) || isNotBlank(nextProcess) || isNotBlank(sampleReq)
|
||||
|| isNotBlank(rawManufacturer) || isNotBlank(rawMaterial)
|
||||
|| rawThick != null || rawWidth != null
|
||||
|| isNotBlank(rawMaterialId) || isNotBlank(rawCoilNos) || isNotBlank(rawLocation)
|
||||
|| isNotBlank(rawPackaging) || isNotBlank(rawEdgeReq) || isNotBlank(rawCoatingType)
|
||||
|| rawNetWeight != null || startTime != null || endTime != null;
|
||||
if (!hasAny) {
|
||||
continue;
|
||||
}
|
||||
if (id == null) {
|
||||
if (!isNotBlank(planCode)) {
|
||||
planCode = buildPlanCode();
|
||||
}
|
||||
quickSheetMapper.insertRow(lineId, lineName, LocalDate.now(), planCode, planType, scheduler, remark,
|
||||
bizSeqNo, orderCode, contractCode, customerName, salesman,
|
||||
productName, productMaterial, coatingG, productWidth, rollingThick, markCoatThick,
|
||||
tonSteelLengthRange, planQty, planWeight, surfaceTreatment, widthReq, usageReq,
|
||||
postProcess, nextProcess, sampleReq,
|
||||
rawManufacturer, rawMaterial, rawThick, rawWidth, rawMaterialId, rawCoilNos,
|
||||
rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight,
|
||||
startTime, endTime, operator, operator);
|
||||
} else {
|
||||
quickSheetMapper.updateRow(id, lineId, lineName, planCode, planType, scheduler, remark,
|
||||
bizSeqNo, orderCode, contractCode, customerName, salesman,
|
||||
productName, productMaterial, coatingG, productWidth, rollingThick, markCoatThick,
|
||||
tonSteelLengthRange, planQty, planWeight, surfaceTreatment, widthReq, usageReq,
|
||||
postProcess, nextProcess, sampleReq,
|
||||
rawManufacturer, rawMaterial, rawThick, rawWidth, rawMaterialId, rawCoilNos,
|
||||
rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight,
|
||||
startTime, endTime, operator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApsQuickSheetRowVo> buildPresetRows(Long lineId, String salesman) {
|
||||
List<ApsQuickSheetRowVo> rows = new ArrayList<>();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime end = now.plusHours(1);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ApsQuickSheetRowVo row = new ApsQuickSheetRowVo();
|
||||
row.setLineId(lineId);
|
||||
row.setLineName(lineId == null ? null : ("产线" + lineId));
|
||||
row.setSalesman(salesman);
|
||||
row.setPlanQty(BigDecimal.ZERO);
|
||||
row.setStartTime(now);
|
||||
row.setEndTime(end);
|
||||
row.setPlanCode(buildPlanCode());
|
||||
rows.add(row);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportExcel(com.klp.aps.domain.dto.ApsQuickSheetQueryReq req, javax.servlet.http.HttpServletResponse response) {
|
||||
List<ApsQuickSheetRowVo> rows = queryList(req);
|
||||
try (org.apache.poi.ss.usermodel.Workbook wb = new org.apache.poi.xssf.usermodel.XSSFWorkbook()) {
|
||||
org.apache.poi.ss.usermodel.Sheet sheet = wb.createSheet("快速排产表");
|
||||
|
||||
int r = 0;
|
||||
org.apache.poi.ss.usermodel.Row title = sheet.createRow(r++);
|
||||
title.setHeightInPoints(36f);
|
||||
org.apache.poi.ss.usermodel.Cell t0 = title.createCell(0);
|
||||
t0.setCellValue("快速排产表(Excel录入)");
|
||||
sheet.addMergedRegion(new org.apache.poi.ss.util.CellRangeAddress(0, 0, 0, 39));
|
||||
|
||||
org.apache.poi.ss.usermodel.CellStyle titleStyle = wb.createCellStyle();
|
||||
titleStyle.setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER);
|
||||
titleStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
|
||||
org.apache.poi.xssf.usermodel.XSSFFont titleFont = ((org.apache.poi.xssf.usermodel.XSSFWorkbook) wb).createFont();
|
||||
titleFont.setBold(true);
|
||||
titleFont.setFontHeightInPoints((short) 15);
|
||||
titleStyle.setFont(titleFont);
|
||||
t0.setCellStyle(titleStyle);
|
||||
|
||||
String[] headers = new String[]{
|
||||
"产线", "排产日期", "排产单号", "排产类型", "排产人", "修改人", "备注",
|
||||
"内容序号", "销售内容", "订单合同号", "客户", "业务员",
|
||||
"成品名称", "材质", "镀层g", "成品宽度", "轧制厚度", "标丝厚度", "吨钢长度区间m",
|
||||
"数量", "重量", "表面处理", "切边要求", "宽度要求", "用途", "后处理", "下工序", "取样",
|
||||
"厂家", "原料信息", "原料厚度mm", "宽度mm", "原料钢卷", "原料卷号", "钢卷位置", "包装要求", "镀层种类", "原料净重",
|
||||
"开始时间", "结束时间"
|
||||
};
|
||||
org.apache.poi.ss.usermodel.Row head = sheet.createRow(r++);
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
head.createCell(i).setCellValue(headers[i]);
|
||||
}
|
||||
|
||||
if (rows != null) {
|
||||
for (ApsQuickSheetRowVo row : rows) {
|
||||
org.apache.poi.ss.usermodel.Row rr = sheet.createRow(r++);
|
||||
int cc = 0;
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getLineName(), row.getLineId()));
|
||||
rr.createCell(cc++).setCellValue(row.getPlanDate() == null ? "" : row.getPlanDate().toString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPlanCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPlanType(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getScheduler(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRemark(), ""));
|
||||
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getBizSeqNo(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getOrderCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getContractCode(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getCustomerName(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSalesman(), ""));
|
||||
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getProductName(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getProductMaterial(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getCoatingG() == null ? "" : row.getCoatingG().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getProductWidth() == null ? "" : row.getProductWidth().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getRollingThick() == null ? "" : row.getRollingThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getMarkCoatThick() == null ? "" : row.getMarkCoatThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getTonSteelLengthRange(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getPlanQty() == null ? "" : row.getPlanQty().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getPlanWeight() == null ? "" : row.getPlanWeight().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSurfaceTreatment(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getWidthReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawEdgeReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getUsageReq(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getPostProcess(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getNextProcess(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getSampleReq(), ""));
|
||||
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawManufacturer(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterial(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getRawThick() == null ? "" : row.getRawThick().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(row.getRawWidth() == null ? "" : row.getRawWidth().toPlainString());
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterialId(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawCoilNos(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawLocation(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawPackaging(), ""));
|
||||
rr.createCell(cc++).setCellValue(nvl(row.getRawCoatingType(), ""));
|
||||
rr.createCell(cc++).setCellValue(row.getRawNetWeight() == null ? "" : row.getRawNetWeight().toPlainString());
|
||||
|
||||
rr.createCell(cc++).setCellValue(row.getStartTime() == null ? "" : row.getStartTime().toString());
|
||||
rr.createCell(cc++).setCellValue(row.getEndTime() == null ? "" : row.getEndTime().toString());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
sheet.autoSizeColumn(i, true);
|
||||
int w = sheet.getColumnWidth(i);
|
||||
sheet.setColumnWidth(i, Math.min(Math.max(w, 3000), 12000));
|
||||
}
|
||||
|
||||
String filename = "aps_quick_sheet_" + System.currentTimeMillis() + ".xlsx";
|
||||
String encoded = java.net.URLEncoder.encode(filename, java.nio.charset.StandardCharsets.UTF_8.name());
|
||||
response.setCharacterEncoding(java.nio.charset.StandardCharsets.UTF_8.name());
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + encoded);
|
||||
|
||||
try (javax.servlet.ServletOutputStream os = response.getOutputStream()) {
|
||||
wb.write(os);
|
||||
os.flush();
|
||||
}
|
||||
} catch (java.io.IOException e) {
|
||||
throw new ServiceException("导出失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String buildPlanCode() {
|
||||
LocalDate today = LocalDate.now();
|
||||
int seq = quickSheetMapper.countToday(today) + 1;
|
||||
return today.format(DATE_CODE) + String.format("%03d", seq);
|
||||
}
|
||||
|
||||
private String nvl(Object v, Object fallback) {
|
||||
if (v == null) return String.valueOf(fallback);
|
||||
String s = String.valueOf(v);
|
||||
return s == null ? String.valueOf(fallback) : s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(Long id, String operator) {
|
||||
if (id == null) return;
|
||||
quickSheetMapper.deleteRow(id, operator);
|
||||
}
|
||||
|
||||
private BigDecimal parseQty(String val) {
|
||||
if (val == null || val.trim().isEmpty()) return null;
|
||||
try {
|
||||
return new BigDecimal(val.trim());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isNotBlank(String val) {
|
||||
return val != null && !val.trim().isEmpty();
|
||||
}
|
||||
|
||||
private LocalDateTime parseTime(String val) {
|
||||
if (val == null || val.trim().isEmpty()) return null;
|
||||
String v = val.trim();
|
||||
if (v.length() == 16) v = v + ":00";
|
||||
try {
|
||||
return LocalDateTime.parse(v, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.aps.mapper.ApsPlanDetailMapper">
|
||||
|
||||
<resultMap type="com.klp.aps.domain.entity.ApsPlanDetail" id="ApsPlanDetailResult">
|
||||
<result property="planDetailId" column="plan_detail_id"/>
|
||||
<result property="planSheetId" column="plan_sheet_id"/>
|
||||
<result property="bizSeqNo" column="biz_seq_no"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="orderCode" column="order_code"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="customerName" column="customer_name"/>
|
||||
<result property="salesman" column="salesman"/>
|
||||
<result property="rawManufacturer" column="raw_manufacturer"/>
|
||||
<result property="rawMaterial" column="raw_material"/>
|
||||
<result property="rawThick" column="raw_thick"/>
|
||||
<result property="rawWidth" column="raw_width"/>
|
||||
<result property="rawMaterialId" column="raw_material_id"/>
|
||||
<result property="rawCoilNos" column="raw_coil_nos"/>
|
||||
<result property="rawLocation" column="raw_location"/>
|
||||
<result property="rawPackaging" column="raw_packaging"/>
|
||||
<result property="rawEdgeReq" column="raw_edge_req"/>
|
||||
<result property="rawCoatingType" column="raw_coating_type"/>
|
||||
<result property="rawNetWeight" column="raw_net_weight"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="productMaterial" column="product_material"/>
|
||||
<result property="coatingG" column="coating_g"/>
|
||||
<result property="productWidth" column="product_width"/>
|
||||
<result property="rollingThick" column="rolling_thick"/>
|
||||
<result property="markCoatThick" column="mark_coat_thick"/>
|
||||
<result property="tonSteelLengthRange" column="ton_steel_length_range"/>
|
||||
<result property="planQty" column="plan_qty"/>
|
||||
<result property="planWeight" column="plan_weight"/>
|
||||
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||
<result property="widthReq" column="width_req"/>
|
||||
<result property="productPackaging" column="product_packaging"/>
|
||||
<result property="productEdgeReq" column="product_edge_req"/>
|
||||
<result property="usageReq" column="usage_req"/>
|
||||
<result property="postProcess" column="post_process"/>
|
||||
<result property="nextProcess" column="next_process"/>
|
||||
<result property="sampleReq" column="sample_req"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteByPlanSheetIds">
|
||||
UPDATE aps_plan_detail SET del_flag = 2 WHERE plan_sheet_id IN
|
||||
<foreach collection="collection" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.klp.aps.domain.vo.ApsPlanDetailVo">
|
||||
SELECT
|
||||
d.*,
|
||||
c.tech_annex AS techAnnex
|
||||
FROM aps_plan_detail d
|
||||
LEFT JOIN crm_order o ON d.order_id = o.order_id AND o.del_flag = 0
|
||||
LEFT JOIN crm_contract c ON o.contract_id = c.contract_id AND c.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.aps.mapper.ApsPlanSheetMapper">
|
||||
|
||||
<resultMap type="com.klp.aps.domain.entity.ApsPlanSheet" id="ApsPlanSheetResult">
|
||||
<result property="planSheetId" column="plan_sheet_id"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
<result property="lineId" column="line_id"/>
|
||||
<result property="lineName" column="line_name"/>
|
||||
<result property="planCode" column="plan_code"/>
|
||||
<result property="planType" column="plan_type"/>
|
||||
<result property="scheduler" column="scheduler"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
<select id="selectList" parameterType="com.klp.aps.domain.dto.ApsPlanSheetQueryReq" resultType="com.klp.aps.domain.vo.ApsPlanSheetRowVo">
|
||||
SELECT
|
||||
d.plan_detail_id AS detailSheetId,
|
||||
s.plan_date AS planDate,
|
||||
s.line_id AS lineId,
|
||||
s.line_name AS lineName,
|
||||
s.plan_code AS planCode,
|
||||
s.plan_type AS planType,
|
||||
s.scheduler AS scheduler,
|
||||
s.remark AS masterRemark,
|
||||
d.remark AS detailRemark,
|
||||
s.update_by AS updateBy,
|
||||
d.biz_seq_no AS bizSeqNo,
|
||||
d.order_code AS orderCode,
|
||||
d.contract_code AS contractCode,
|
||||
d.customer_name AS customerName,
|
||||
d.salesman AS salesman,
|
||||
d.product_name AS productName,
|
||||
d.product_material AS productMaterial,
|
||||
d.coating_g AS coatingG,
|
||||
d.product_width AS productWidth,
|
||||
d.rolling_thick AS rollingThick,
|
||||
d.mark_coat_thick AS markCoatThick,
|
||||
d.ton_steel_length_range AS tonSteelLengthRange,
|
||||
d.plan_qty AS planQty,
|
||||
d.plan_weight AS planWeight,
|
||||
d.surface_treatment AS surfaceTreatment,
|
||||
d.width_req AS widthReq,
|
||||
d.usage_req AS usageReq,
|
||||
d.post_process AS postProcess,
|
||||
d.next_process AS nextProcess,
|
||||
d.sample_req AS sampleReq,
|
||||
d.raw_manufacturer AS rawManufacturer,
|
||||
d.raw_material AS rawMaterial,
|
||||
d.raw_thick AS rawThick,
|
||||
d.raw_width AS rawWidth,
|
||||
CAST(d.raw_material_id AS CHAR) AS rawMaterialId,
|
||||
d.raw_coil_nos AS rawCoilNos,
|
||||
d.raw_location AS rawLocation,
|
||||
d.raw_packaging AS rawPackaging,
|
||||
d.raw_edge_req AS rawEdgeReq,
|
||||
d.raw_coating_type AS rawCoatingType,
|
||||
d.raw_net_weight AS rawNetWeight,
|
||||
d.start_time AS startTime,
|
||||
d.end_time AS endTime
|
||||
FROM aps_plan_sheet s
|
||||
INNER JOIN aps_plan_detail d ON d.plan_sheet_id = s.plan_sheet_id AND d.del_flag = 0
|
||||
WHERE s.del_flag = 0
|
||||
<if test="planSheetId != null">
|
||||
AND s.plan_sheet_id = #{planSheetId}
|
||||
</if>
|
||||
ORDER BY CAST(d.biz_seq_no AS UNSIGNED) ASC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,176 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.aps.mapper.ApsQuickSheetMapper">
|
||||
|
||||
<select id="selectList" parameterType="com.klp.aps.domain.dto.ApsQuickSheetQueryReq" resultType="com.klp.aps.domain.vo.ApsQuickSheetRowVo">
|
||||
SELECT
|
||||
quick_sheet_id AS quickSheetId,
|
||||
plan_date AS planDate,
|
||||
line_id AS lineId,
|
||||
line_name AS lineName,
|
||||
plan_code AS planCode,
|
||||
plan_type AS planType,
|
||||
scheduler,
|
||||
remark,
|
||||
biz_seq_no AS bizSeqNo,
|
||||
order_code AS orderCode,
|
||||
contract_code AS contractCode,
|
||||
customer_name AS customerName,
|
||||
salesman,
|
||||
product_name AS productName,
|
||||
product_material AS productMaterial,
|
||||
coating_g AS coatingG,
|
||||
product_width AS productWidth,
|
||||
rolling_thick AS rollingThick,
|
||||
mark_coat_thick AS markCoatThick,
|
||||
ton_steel_length_range AS tonSteelLengthRange,
|
||||
plan_qty AS planQty,
|
||||
plan_weight AS planWeight,
|
||||
surface_treatment AS surfaceTreatment,
|
||||
width_req AS widthReq,
|
||||
usage_req AS usageReq,
|
||||
post_process AS postProcess,
|
||||
next_process AS nextProcess,
|
||||
sample_req AS sampleReq,
|
||||
raw_manufacturer AS rawManufacturer,
|
||||
raw_material AS rawMaterial,
|
||||
raw_thick AS rawThick,
|
||||
raw_width AS rawWidth,
|
||||
raw_material_id AS rawMaterialId,
|
||||
raw_coil_nos AS rawCoilNos,
|
||||
raw_location AS rawLocation,
|
||||
raw_packaging AS rawPackaging,
|
||||
raw_edge_req AS rawEdgeReq,
|
||||
raw_coating_type AS rawCoatingType,
|
||||
raw_net_weight AS rawNetWeight,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime
|
||||
FROM aps_quick_sheet
|
||||
WHERE del_flag = 0
|
||||
<if test="startDate != null">
|
||||
AND start_time <![CDATA[>=]]> CONCAT(#{startDate}, ' 00:00:00')
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND start_time <![CDATA[<=]]> CONCAT(#{endDate}, ' 23:59:59')
|
||||
</if>
|
||||
<if test="lineId != null">
|
||||
AND line_id = #{lineId}
|
||||
</if>
|
||||
<if test="customerName != null and customerName != ''">
|
||||
AND customer_name LIKE CONCAT('%', #{customerName}, '%')
|
||||
</if>
|
||||
ORDER BY quick_sheet_id DESC
|
||||
</select>
|
||||
|
||||
<select id="countToday" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM aps_quick_sheet
|
||||
WHERE del_flag = 0
|
||||
AND plan_date = #{planDate}
|
||||
</select>
|
||||
|
||||
<select id="selectIdByPlanCode" resultType="long">
|
||||
SELECT quick_sheet_id
|
||||
FROM aps_quick_sheet
|
||||
WHERE plan_code = #{planCode}
|
||||
AND del_flag = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRow">
|
||||
INSERT INTO aps_quick_sheet (
|
||||
line_id, line_name, plan_date, plan_code, plan_type, scheduler, remark,
|
||||
biz_seq_no, order_code, contract_code, customer_name, salesman,
|
||||
product_name, product_material, coating_g, product_width, rolling_thick, mark_coat_thick,
|
||||
ton_steel_length_range, plan_qty, plan_weight, surface_treatment, width_req, usage_req,
|
||||
post_process, next_process, sample_req,
|
||||
raw_manufacturer, raw_material, raw_thick, raw_width, raw_material_id, raw_coil_nos,
|
||||
raw_location, raw_packaging, raw_edge_req, raw_coating_type, raw_net_weight,
|
||||
start_time, end_time,
|
||||
create_by, update_by, create_time, update_time, del_flag
|
||||
) VALUES (
|
||||
#{lineId}, #{lineName}, #{planDate}, #{planCode}, #{planType}, #{scheduler}, #{remark},
|
||||
#{bizSeqNo}, #{orderCode}, #{contractCode}, #{customerName}, #{salesman},
|
||||
#{productName}, #{productMaterial}, #{coatingG}, #{productWidth}, #{rollingThick}, #{markCoatThick},
|
||||
#{tonSteelLengthRange}, #{planQty}, #{planWeight}, #{surfaceTreatment}, #{widthReq}, #{usageReq},
|
||||
#{postProcess}, #{nextProcess}, #{sampleReq},
|
||||
#{rawManufacturer}, #{rawMaterial}, #{rawThick}, #{rawWidth}, #{rawMaterialId}, #{rawCoilNos},
|
||||
#{rawLocation}, #{rawPackaging}, #{rawEdgeReq}, #{rawCoatingType}, #{rawNetWeight},
|
||||
#{startTime}, #{endTime},
|
||||
#{createBy}, #{updateBy}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRow">
|
||||
UPDATE aps_quick_sheet
|
||||
SET line_id = #{lineId},
|
||||
line_name = #{lineName},
|
||||
plan_code = #{planCode},
|
||||
plan_type = #{planType},
|
||||
scheduler = #{scheduler},
|
||||
remark = #{remark},
|
||||
biz_seq_no = #{bizSeqNo},
|
||||
order_code = #{orderCode},
|
||||
contract_code = #{contractCode},
|
||||
customer_name = #{customerName},
|
||||
salesman = #{salesman},
|
||||
product_name = #{productName},
|
||||
product_material = #{productMaterial},
|
||||
coating_g = #{coatingG},
|
||||
product_width = #{productWidth},
|
||||
rolling_thick = #{rollingThick},
|
||||
mark_coat_thick = #{markCoatThick},
|
||||
ton_steel_length_range = #{tonSteelLengthRange},
|
||||
plan_qty = #{planQty},
|
||||
plan_weight = #{planWeight},
|
||||
surface_treatment = #{surfaceTreatment},
|
||||
width_req = #{widthReq},
|
||||
usage_req = #{usageReq},
|
||||
post_process = #{postProcess},
|
||||
next_process = #{nextProcess},
|
||||
sample_req = #{sampleReq},
|
||||
raw_manufacturer = #{rawManufacturer},
|
||||
raw_material = #{rawMaterial},
|
||||
raw_thick = #{rawThick},
|
||||
raw_width = #{rawWidth},
|
||||
raw_material_id = #{rawMaterialId},
|
||||
raw_coil_nos = #{rawCoilNos},
|
||||
raw_location = #{rawLocation},
|
||||
raw_packaging = #{rawPackaging},
|
||||
raw_edge_req = #{rawEdgeReq},
|
||||
raw_coating_type = #{rawCoatingType},
|
||||
raw_net_weight = #{rawNetWeight},
|
||||
start_time = #{startTime},
|
||||
end_time = #{endTime},
|
||||
update_by = #{updateBy},
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE quick_sheet_id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteRow">
|
||||
UPDATE aps_quick_sheet
|
||||
SET del_flag = 1,
|
||||
update_by = #{updateBy},
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE quick_sheet_id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="softDelete">
|
||||
UPDATE aps_quick_sheet
|
||||
SET del_flag = 1,
|
||||
update_by = #{updateBy},
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE quick_sheet_id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE aps_quick_sheet
|
||||
SET del_flag = 1,
|
||||
update_by = #{updateBy},
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE quick_sheet_id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -170,6 +170,16 @@
|
||||
<artifactId>ip2region</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 引入flyway -->
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
</dependency>
|
||||
<!-- 动态数据源依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.klp.common.config;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.output.MigrateResult;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class FlywayConfig {
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
|
||||
@Value("${spring.flyway.baseline-on-migrate}")
|
||||
private boolean baselineOnMigrate;
|
||||
|
||||
@Value("${spring.flyway.locations}")
|
||||
private String locations;
|
||||
|
||||
@Value("${spring.flyway.table}")
|
||||
private String table;
|
||||
|
||||
@Resource
|
||||
private DataSource dataSource;
|
||||
|
||||
@Bean
|
||||
public Flyway flyway() {
|
||||
DataSource masterDataSource = ((DynamicRoutingDataSource) dataSource).getDataSource("master");
|
||||
System.out.println("masterDataSource class: " + masterDataSource.getClass().getName());
|
||||
|
||||
// // 如果想显式拿底层 HikariDataSource
|
||||
// if (masterDataSource instanceof ItemDataSource) {
|
||||
// masterDataSource = ((ItemDataSource) masterDataSource).getRealDataSource();
|
||||
// }
|
||||
|
||||
System.out.println("masterDataSource class: " + masterDataSource.getClass().getName());
|
||||
return Flyway.configure()
|
||||
.dataSource(masterDataSource) // 注意这里是真实主库 DataSource
|
||||
.baselineOnMigrate(baselineOnMigrate)
|
||||
.locations(locations)
|
||||
.table(table)
|
||||
.load();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner flywayRunner(Flyway flyway) {
|
||||
return args -> {
|
||||
System.out.println("========== 当前环境: " + activeProfile + " ==========");
|
||||
System.out.println("========== 开始执行 Flyway 数据库迁移 ==========");
|
||||
|
||||
MigrateResult result = flyway.migrate();
|
||||
System.out.println("迁移成功版本数: " + result.migrationsExecuted);
|
||||
|
||||
result.migrations.forEach(m -> {
|
||||
System.out.println("执行版本: " + m.version + ",描述: " + m.description);
|
||||
});
|
||||
|
||||
System.out.println("========== Flyway 数据库迁移完成 ==========");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.crm.domain.vo.CrmContractVo;
|
||||
import com.klp.crm.domain.bo.CrmContractBo;
|
||||
import com.klp.crm.service.ICrmContractService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 合同信息
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/contract")
|
||||
public class CrmContractController extends BaseController {
|
||||
|
||||
private final ICrmContractService iCrmContractService;
|
||||
|
||||
/**
|
||||
* 查询合同信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmContractVo> list(CrmContractBo bo, PageQuery pageQuery) {
|
||||
return iCrmContractService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出合同信息列表
|
||||
*/
|
||||
@Log(title = "合同信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmContractBo bo, HttpServletResponse response) {
|
||||
List<CrmContractVo> list = iCrmContractService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "合同信息", CrmContractVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同信息详细信息
|
||||
*
|
||||
* @param contractId 主键
|
||||
*/
|
||||
@GetMapping("/{contractId}")
|
||||
public R<CrmContractVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long contractId) {
|
||||
return R.ok(iCrmContractService.queryById(contractId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同信息
|
||||
*/
|
||||
@Log(title = "合同信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmContractBo bo) {
|
||||
return toAjax(iCrmContractService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同信息
|
||||
*/
|
||||
@Log(title = "合同信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmContractBo bo) {
|
||||
return toAjax(iCrmContractService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同信息
|
||||
*
|
||||
* @param contractIds 主键串
|
||||
*/
|
||||
@Log(title = "合同信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contractIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] contractIds) {
|
||||
return toAjax(iCrmContractService.deleteWithValidByIds(Arrays.asList(contractIds), true));
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.crm.domain.vo.CrmContractProductVo;
|
||||
import com.klp.crm.domain.bo.CrmContractProductBo;
|
||||
import com.klp.crm.service.ICrmContractProductService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 合同产品明细
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/contractProduct")
|
||||
public class CrmContractProductController extends BaseController {
|
||||
|
||||
private final ICrmContractProductService iCrmContractProductService;
|
||||
|
||||
/**
|
||||
* 查询合同产品明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmContractProductVo> list(CrmContractProductBo bo, PageQuery pageQuery) {
|
||||
return iCrmContractProductService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出合同产品明细列表
|
||||
*/
|
||||
@Log(title = "合同产品明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmContractProductBo bo, HttpServletResponse response) {
|
||||
List<CrmContractProductVo> list = iCrmContractProductService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "合同产品明细", CrmContractProductVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同产品明细详细信息
|
||||
*
|
||||
* @param contractProductId 主键
|
||||
*/
|
||||
@GetMapping("/{contractProductId}")
|
||||
public R<CrmContractProductVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long contractProductId) {
|
||||
return R.ok(iCrmContractProductService.queryById(contractProductId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同产品明细
|
||||
*/
|
||||
@Log(title = "合同产品明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmContractProductBo bo) {
|
||||
return toAjax(iCrmContractProductService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同产品明细
|
||||
*/
|
||||
@Log(title = "合同产品明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmContractProductBo bo) {
|
||||
return toAjax(iCrmContractProductService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同产品明细
|
||||
*
|
||||
* @param contractProductIds 主键串
|
||||
*/
|
||||
@Log(title = "合同产品明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contractProductIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] contractProductIds) {
|
||||
return toAjax(iCrmContractProductService.deleteWithValidByIds(Arrays.asList(contractProductIds), true));
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,8 @@ import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemVo;
|
||||
import com.klp.crm.domain.vo.CrmContractOrderFinanceVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderItemBo;
|
||||
import com.klp.crm.service.ICrmOrderItemService;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
@@ -98,38 +96,4 @@ public class CrmOrderItemController extends BaseController {
|
||||
@PathVariable String[] itemIds) {
|
||||
return toAjax(iCrmOrderItemService.deleteWithValidByIds(Arrays.asList(itemIds), true));
|
||||
}
|
||||
|
||||
// 根据合同id查询该合同下属订单关联的异议和财务信息。。
|
||||
@GetMapping("/contractFinance/{contractId}")
|
||||
public R<CrmContractOrderFinanceVo> getContractFinance(@NotNull(message = "合同ID不能为空")
|
||||
@PathVariable Long contractId) {
|
||||
return R.ok(iCrmOrderItemService.queryFinanceAndObjectionByContractId(contractId));
|
||||
}
|
||||
// 根据订单id查询发货单据中的配卷。
|
||||
@GetMapping("/coils/order/{orderId}")
|
||||
public R<List<WmsMaterialCoilVo>> getCoilsByOrderId(@NotNull(message = "订单ID不能为空")
|
||||
@PathVariable Long orderId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByOrderId(orderId));
|
||||
}
|
||||
|
||||
// 根据合同id查询发货单据中的配卷。
|
||||
@GetMapping("/coils/contract/{contractId}")
|
||||
public R<List<WmsMaterialCoilVo>> getCoilsByContractId(@NotNull(message = "合同ID不能为空")
|
||||
@PathVariable Long contractId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByContractId(contractId));
|
||||
}
|
||||
|
||||
// 根据客户id查询该客户下属订单关联的异议和财务信息。
|
||||
@GetMapping("/customerFinance/{customerId}")
|
||||
public R<CrmContractOrderFinanceVo> getCustomerFinance(@NotNull(message = "客户ID不能为空")
|
||||
@PathVariable String customerId) {
|
||||
return R.ok(iCrmOrderItemService.queryFinanceAndObjectionByCustomerId(customerId));
|
||||
}
|
||||
|
||||
// 根据客户id查询发货单据中的配卷。
|
||||
@GetMapping("/coils/customer/{customerId}")
|
||||
public R<List<WmsMaterialCoilVo>> getCoilsByCustomerId(@NotNull(message = "客户ID不能为空")
|
||||
@PathVariable String customerId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByCustomerId(customerId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
package com.klp.crm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 合同信息对象 crm_contract
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("crm_contract")
|
||||
public class CrmContract extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 合同主键ID
|
||||
*/
|
||||
@TableId(value = "contract_id")
|
||||
private Long contractId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNo;
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private Long customerId;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private Date signTime;
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
private Date deliveryDate;
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package com.klp.crm.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 合同产品明细对象 crm_contract_product
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("crm_contract_product")
|
||||
public class CrmContractProduct extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 合同产品主键ID
|
||||
*/
|
||||
@TableId(value = "contract_product_id")
|
||||
private Long contractProductId;
|
||||
/**
|
||||
* 关联合同ID(绑定wms_contract表主键)
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 规格最小值(mm)
|
||||
*/
|
||||
private BigDecimal specMin;
|
||||
/**
|
||||
* 规格最大值(mm)
|
||||
*/
|
||||
private BigDecimal specMax;
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String material;
|
||||
/**
|
||||
* 数量(吨)
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 含税单价(元/吨)
|
||||
*/
|
||||
private BigDecimal taxInclusiveUnitPrice;
|
||||
/**
|
||||
* 不含税单价(元/吨)
|
||||
*/
|
||||
private BigDecimal exTaxUnitPrice;
|
||||
/**
|
||||
* 含税总额(元)
|
||||
*/
|
||||
private BigDecimal taxInclusiveAmount;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -56,10 +56,6 @@ public class CrmCustomer extends BaseEntity {
|
||||
* 银行信息(多条,需权限查看,JSON格式存储)
|
||||
*/
|
||||
private String bankInfo;
|
||||
/**
|
||||
* 纳税人识别号/税号
|
||||
*/
|
||||
private String taxNumber;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CrmOrder extends BaseEntity {
|
||||
* 订单ID(主键)
|
||||
*/
|
||||
@TableId(value = "order_id")
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@@ -85,141 +85,6 @@ public class CrmOrder extends BaseEntity {
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 附件(多个文件URL用逗号分隔)
|
||||
*/
|
||||
private String annexFiles;
|
||||
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
|
||||
@@ -24,11 +24,11 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 正式订单明细ID(主键)
|
||||
*/
|
||||
@TableId(value = "item_id")
|
||||
private Long itemId;
|
||||
private String itemId;
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@@ -69,14 +69,6 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
private BigDecimal widthTolerance;
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
private BigDecimal thicknessTolerance;
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -99,4 +91,4 @@ public class CrmOrderItem extends BaseEntity {
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
package com.klp.crm.domain.bo;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 合同信息业务对象 crm_contract
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CrmContractBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 合同主键ID
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*/
|
||||
private String keyword;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package com.klp.crm.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 合同产品明细业务对象 crm_contract_product
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CrmContractProductBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 合同产品主键ID
|
||||
*/
|
||||
private Long contractProductId;
|
||||
|
||||
/**
|
||||
* 关联合同ID(绑定wms_contract表主键)
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格最小值(mm)
|
||||
*/
|
||||
private BigDecimal specMin;
|
||||
|
||||
/**
|
||||
* 规格最大值(mm)
|
||||
*/
|
||||
private BigDecimal specMax;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 数量(吨)
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 含税单价(元/吨)
|
||||
*/
|
||||
private BigDecimal taxInclusiveUnitPrice;
|
||||
|
||||
/**
|
||||
* 不含税单价(元/吨)
|
||||
*/
|
||||
private BigDecimal exTaxUnitPrice;
|
||||
|
||||
/**
|
||||
* 含税总额(元)
|
||||
*/
|
||||
private BigDecimal taxInclusiveAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -62,20 +62,10 @@ public class CrmCustomerBo extends BaseEntity {
|
||||
*/
|
||||
private String bankInfo;
|
||||
|
||||
/**
|
||||
* 纳税人识别号/税号
|
||||
*/
|
||||
private String taxNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*/
|
||||
private String keyword;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 正式订单主业务对象 crm_order
|
||||
@@ -24,7 +23,7 @@ public class CrmOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 订单ID(主键)
|
||||
*/
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
@@ -54,8 +53,6 @@ public class CrmOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/**
|
||||
@@ -98,147 +95,5 @@ public class CrmOrderBo extends BaseEntity {
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 附件(多个文件URL用逗号分隔)
|
||||
*/
|
||||
private String annexFiles;
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*/
|
||||
private String keyword;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
/**
|
||||
* 正式订单明细ID(主键)
|
||||
*/
|
||||
private Long itemId;
|
||||
private String itemId;
|
||||
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 产品类型
|
||||
@@ -57,7 +57,7 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 成品规格
|
||||
*/
|
||||
@@ -78,16 +78,6 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
private BigDecimal widthTolerance;
|
||||
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
private BigDecimal thicknessTolerance;
|
||||
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -109,4 +99,4 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
private String productionBatch;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.klp.crm.domain.vo;
|
||||
|
||||
import com.klp.domain.vo.WmsDeliveryWaybillVo;
|
||||
import com.klp.domain.vo.WmsReceivableVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CrmContractOrderFinanceVo {
|
||||
|
||||
private List<CrmSalesObjectionVo> objectionList;
|
||||
|
||||
private List<WmsReceivableVo> receivableList;
|
||||
|
||||
// setWmsDeliveryWaybills
|
||||
private List<WmsDeliveryWaybillVo> wmsDeliveryWaybills;
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.klp.crm.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 合同产品明细视图对象 crm_contract_product
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CrmContractProductVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 合同产品主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "合同产品主键ID")
|
||||
private Long contractProductId;
|
||||
|
||||
/**
|
||||
* 关联合同ID(绑定wms_contract表主键)
|
||||
*/
|
||||
@ExcelProperty(value = "关联合同ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "绑=定wms_contract表主键")
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格最小值(mm)
|
||||
*/
|
||||
@ExcelProperty(value = "规格最小值(mm)")
|
||||
private BigDecimal specMin;
|
||||
|
||||
/**
|
||||
* 规格最大值(mm)
|
||||
*/
|
||||
@ExcelProperty(value = "规格最大值(mm)")
|
||||
private BigDecimal specMax;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 数量(吨)
|
||||
*/
|
||||
@ExcelProperty(value = "数量(吨)")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 含税单价(元/吨)
|
||||
*/
|
||||
@ExcelProperty(value = "含税单价(元/吨)")
|
||||
private BigDecimal taxInclusiveUnitPrice;
|
||||
|
||||
/**
|
||||
* 不含税单价(元/吨)
|
||||
*/
|
||||
@ExcelProperty(value = "不含税单价(元/吨)")
|
||||
private BigDecimal exTaxUnitPrice;
|
||||
|
||||
/**
|
||||
* 含税总额(元)
|
||||
*/
|
||||
@ExcelProperty(value = "含税总额(元)")
|
||||
private BigDecimal taxInclusiveAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
package com.klp.crm.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 合同信息视图对象 crm_contract
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CrmContractVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 合同主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "合同主键ID")
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@ExcelProperty(value = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@ExcelProperty(value = "合同编号")
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
@ExcelProperty(value = "供方")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
@ExcelProperty(value = "需方")
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
@ExcelProperty(value = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@ExcelProperty(value = "签订时间")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
@ExcelProperty(value = "交货日期")
|
||||
private Date deliveryDate;
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
@ExcelProperty(value = "签订地点")
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
@ExcelProperty(value = "产品内容")
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
@ExcelProperty(value = "合同内容")
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
@ExcelProperty(value = "供方地址")
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
@ExcelProperty(value = "供方电话")
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "供方开户行")
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
@ExcelProperty(value = "供方账号")
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
@ExcelProperty(value = "供方税号")
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
@ExcelProperty(value = "需方地址")
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
@ExcelProperty(value = "需方电话")
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "需方开户行")
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
@ExcelProperty(value = "需方账号")
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
@ExcelProperty(value = "需方税号")
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
@ExcelProperty(value = "技术附件")
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
@ExcelProperty(value = "商务附件")
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
@ExcelProperty(value = "排产函")
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
@ExcelProperty(value = "合同状态 0=草稿 1=生效 2=作废 3=已完成")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -78,12 +78,6 @@ public class CrmCustomerVo {
|
||||
@ExcelDictFormat(readConverterExp = "多=条,需权限查看,JSON格式存储")
|
||||
private String bankInfo;
|
||||
|
||||
/**
|
||||
* 纳税人识别号/税号
|
||||
*/
|
||||
@ExcelProperty(value = "纳税人识别号/税号")
|
||||
private String taxNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -25,14 +25,14 @@ public class CrmOrderItemVo {
|
||||
*/
|
||||
@ExcelProperty(value = "正式订单明细ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "主=键")
|
||||
private Long itemId;
|
||||
private String itemId;
|
||||
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
@ExcelProperty(value = "关联正式订单ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "外=键")
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 产品类型
|
||||
@@ -95,18 +95,6 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
@ExcelProperty(value = "宽度公差")
|
||||
private BigDecimal widthTolerance;
|
||||
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
@ExcelProperty(value = "厚度公差")
|
||||
private BigDecimal thicknessTolerance;
|
||||
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -132,4 +120,4 @@ public class CrmOrderItemVo {
|
||||
private String productionBatch;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class CrmOrderVo extends BaseEntity {
|
||||
*/
|
||||
@ExcelProperty(value = "订单ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "主=键")
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
@@ -114,168 +114,6 @@ public class CrmOrderVo extends BaseEntity {
|
||||
@ExcelProperty(value = "合同号")
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@ExcelProperty(value = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
@ExcelProperty(value = "供方")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
@ExcelProperty(value = "需方")
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@ExcelProperty(value = "签订时间")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
@ExcelProperty(value = "签订地点")
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
@ExcelProperty(value = "产品内容")
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
@ExcelProperty(value = "合同内容")
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
@ExcelProperty(value = "供方地址")
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
@ExcelProperty(value = "供方电话")
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "供方开户行")
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
@ExcelProperty(value = "供方账号")
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
@ExcelProperty(value = "供方税号")
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
@ExcelProperty(value = "需方地址")
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
@ExcelProperty(value = "需方电话")
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "需方开户行")
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
@ExcelProperty(value = "需方账号")
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
@ExcelProperty(value = "需方税号")
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
@ExcelProperty(value = "技术附件")
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
@ExcelProperty(value = "商务附件")
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
@ExcelProperty(value = "排产函")
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
@ExcelProperty(value = "算单价备注")
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
@ExcelProperty(value = "应付定金(万元)")
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
@ExcelProperty(value = "已付定金(万元)")
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
@ExcelProperty(value = "定金比例(%)")
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
@ExcelProperty(value = "合同状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
@ExcelProperty(value = "关联合同ID")
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 附件(多个文件URL用逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "附件")
|
||||
private String annexFiles;
|
||||
|
||||
|
||||
// @ExcelProperty(value = "客户编号")
|
||||
private String customerCode;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class CrmSalesReportVo {
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.klp.crm.mapper;
|
||||
|
||||
import com.klp.crm.domain.CrmContract;
|
||||
import com.klp.crm.domain.vo.CrmContractVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 合同信息Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
public interface CrmContractMapper extends BaseMapperPlus<CrmContractMapper, CrmContract, CrmContractVo> {
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.klp.crm.mapper;
|
||||
|
||||
import com.klp.crm.domain.CrmContractProduct;
|
||||
import com.klp.crm.domain.vo.CrmContractProductVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 合同产品明细Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
public interface CrmContractProductMapper extends BaseMapperPlus<CrmContractProductMapper, CrmContractProduct, CrmContractProductVo> {
|
||||
|
||||
}
|
||||
@@ -21,5 +21,5 @@ public interface CrmOrderItemMapper extends BaseMapperPlus<CrmOrderItemMapper, C
|
||||
* @param orderIds 订单ID列表
|
||||
* @return 订单明细列表
|
||||
*/
|
||||
List<CrmOrderItem> selectOrderItemsByOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
List<CrmOrderItem> selectOrderItemsByOrderIds(@Param("orderIds") List<String> orderIds);
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmContractProduct;
|
||||
import com.klp.crm.domain.vo.CrmContractProductVo;
|
||||
import com.klp.crm.domain.bo.CrmContractProductBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合同产品明细Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
public interface ICrmContractProductService {
|
||||
|
||||
/**
|
||||
* 查询合同产品明细
|
||||
*/
|
||||
CrmContractProductVo queryById(Long contractProductId);
|
||||
|
||||
/**
|
||||
* 查询合同产品明细列表
|
||||
*/
|
||||
TableDataInfo<CrmContractProductVo> queryPageList(CrmContractProductBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询合同产品明细列表
|
||||
*/
|
||||
List<CrmContractProductVo> queryList(CrmContractProductBo bo);
|
||||
|
||||
/**
|
||||
* 新增合同产品明细
|
||||
*/
|
||||
Boolean insertByBo(CrmContractProductBo bo);
|
||||
|
||||
/**
|
||||
* 修改合同产品明细
|
||||
*/
|
||||
Boolean updateByBo(CrmContractProductBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除合同产品明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmContract;
|
||||
import com.klp.crm.domain.vo.CrmContractVo;
|
||||
import com.klp.crm.domain.bo.CrmContractBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合同信息Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
public interface ICrmContractService {
|
||||
|
||||
/**
|
||||
* 查询合同信息
|
||||
*/
|
||||
CrmContractVo queryById(Long contractId);
|
||||
|
||||
/**
|
||||
* 查询合同信息列表
|
||||
*/
|
||||
TableDataInfo<CrmContractVo> queryPageList(CrmContractBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询合同信息列表
|
||||
*/
|
||||
List<CrmContractVo> queryList(CrmContractBo bo);
|
||||
|
||||
/**
|
||||
* 新增合同信息
|
||||
*/
|
||||
Boolean insertByBo(CrmContractBo bo);
|
||||
|
||||
/**
|
||||
* 修改合同信息
|
||||
*/
|
||||
Boolean updateByBo(CrmContractBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除合同信息信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -9,10 +9,6 @@ import com.klp.common.core.domain.PageQuery;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.klp.crm.domain.vo.CrmContractOrderFinanceVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 正式订单明细Service接口
|
||||
*
|
||||
@@ -50,29 +46,4 @@ public interface ICrmOrderItemService {
|
||||
* 校验并批量删除正式订单明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据合同ID查询下属订单的异议和财务信息
|
||||
*/
|
||||
CrmContractOrderFinanceVo queryFinanceAndObjectionByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 根据订单ID查询发货单配卷
|
||||
*/
|
||||
List<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 根据合同ID查询发货单配卷
|
||||
*/
|
||||
List<WmsMaterialCoilVo> queryCoilsByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询下属订单的异议和财务信息
|
||||
*/
|
||||
CrmContractOrderFinanceVo queryFinanceAndObjectionByCustomerId(String customerId);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询发货单配卷
|
||||
*/
|
||||
List<WmsMaterialCoilVo> queryCoilsByCustomerId(String customerId);
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmContractProductBo;
|
||||
import com.klp.crm.domain.vo.CrmContractProductVo;
|
||||
import com.klp.crm.domain.CrmContractProduct;
|
||||
import com.klp.crm.mapper.CrmContractProductMapper;
|
||||
import com.klp.crm.service.ICrmContractProductService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 合同产品明细Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmContractProductServiceImpl implements ICrmContractProductService {
|
||||
|
||||
private final CrmContractProductMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询合同产品明细
|
||||
*/
|
||||
@Override
|
||||
public CrmContractProductVo queryById(Long contractProductId){
|
||||
return baseMapper.selectVoById(contractProductId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同产品明细列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmContractProductVo> queryPageList(CrmContractProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmContractProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmContractProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同产品明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmContractProductVo> queryList(CrmContractProductBo bo) {
|
||||
LambdaQueryWrapper<CrmContractProduct> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmContractProduct> buildQueryWrapper(CrmContractProductBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmContractProduct> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getContractId() != null, CrmContractProduct::getContractId, bo.getContractId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductName()), CrmContractProduct::getProductName, bo.getProductName());
|
||||
lqw.eq(bo.getSpecMin() != null, CrmContractProduct::getSpecMin, bo.getSpecMin());
|
||||
lqw.eq(bo.getSpecMax() != null, CrmContractProduct::getSpecMax, bo.getSpecMax());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterial()), CrmContractProduct::getMaterial, bo.getMaterial());
|
||||
lqw.eq(bo.getQuantity() != null, CrmContractProduct::getQuantity, bo.getQuantity());
|
||||
lqw.eq(bo.getTaxInclusiveUnitPrice() != null, CrmContractProduct::getTaxInclusiveUnitPrice, bo.getTaxInclusiveUnitPrice());
|
||||
lqw.eq(bo.getExTaxUnitPrice() != null, CrmContractProduct::getExTaxUnitPrice, bo.getExTaxUnitPrice());
|
||||
lqw.eq(bo.getTaxInclusiveAmount() != null, CrmContractProduct::getTaxInclusiveAmount, bo.getTaxInclusiveAmount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同产品明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmContractProductBo bo) {
|
||||
CrmContractProduct add = BeanUtil.toBean(bo, CrmContractProduct.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setContractProductId(add.getContractProductId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同产品明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmContractProductBo bo) {
|
||||
CrmContractProduct update = BeanUtil.toBean(bo, CrmContractProduct.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmContractProduct entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同产品明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmContractBo;
|
||||
import com.klp.crm.domain.vo.CrmContractVo;
|
||||
import com.klp.crm.domain.CrmContract;
|
||||
import com.klp.crm.mapper.CrmContractMapper;
|
||||
import com.klp.crm.service.ICrmContractService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 合同信息Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmContractServiceImpl implements ICrmContractService {
|
||||
|
||||
private final CrmContractMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询合同信息
|
||||
*/
|
||||
@Override
|
||||
public CrmContractVo queryById(Long contractId){
|
||||
return baseMapper.selectVoById(contractId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同信息列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmContractVo> queryPageList(CrmContractBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmContract> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmContractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmContractVo> queryList(CrmContractBo bo) {
|
||||
LambdaQueryWrapper<CrmContract> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmContract> buildQueryWrapper(CrmContractBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmContract> lqw = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(bo.getKeyword())) {
|
||||
lqw.and(w -> w.like(CrmContract::getContractName, bo.getKeyword())
|
||||
.or().like(CrmContract::getContractNo, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplier, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomer, bo.getKeyword())
|
||||
.or().like(CrmContract::getSignLocation, bo.getKeyword())
|
||||
.or().like(CrmContract::getProductContent, bo.getKeyword())
|
||||
.or().like(CrmContract::getContractContent, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplierAddress, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplierPhone, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplierBank, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplierAccount, bo.getKeyword())
|
||||
.or().like(CrmContract::getSupplierTaxNo, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomerAddress, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomerPhone, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomerBank, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomerAccount, bo.getKeyword())
|
||||
.or().like(CrmContract::getCustomerTaxNo, bo.getKeyword())
|
||||
.or().like(CrmContract::getRemark, bo.getKeyword()));
|
||||
}
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractName()), CrmContract::getContractName, bo.getContractName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractNo()), CrmContract::getContractNo, bo.getContractNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplier()), CrmContract::getSupplier, bo.getSupplier());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomer()), CrmContract::getCustomer, bo.getCustomer());
|
||||
lqw.eq(bo.getCustomerId() != null, CrmContract::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(bo.getSignTime() != null, CrmContract::getSignTime, bo.getSignTime());
|
||||
lqw.eq(bo.getDeliveryDate() != null, CrmContract::getDeliveryDate, bo.getDeliveryDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSignLocation()), CrmContract::getSignLocation, bo.getSignLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductContent()), CrmContract::getProductContent, bo.getProductContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractContent()), CrmContract::getContractContent, bo.getContractContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierAddress()), CrmContract::getSupplierAddress, bo.getSupplierAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierPhone()), CrmContract::getSupplierPhone, bo.getSupplierPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierBank()), CrmContract::getSupplierBank, bo.getSupplierBank());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierAccount()), CrmContract::getSupplierAccount, bo.getSupplierAccount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplierTaxNo()), CrmContract::getSupplierTaxNo, bo.getSupplierTaxNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerAddress()), CrmContract::getCustomerAddress, bo.getCustomerAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerPhone()), CrmContract::getCustomerPhone, bo.getCustomerPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerBank()), CrmContract::getCustomerBank, bo.getCustomerBank());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerAccount()), CrmContract::getCustomerAccount, bo.getCustomerAccount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerTaxNo()), CrmContract::getCustomerTaxNo, bo.getCustomerTaxNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTechAnnex()), CrmContract::getTechAnnex, bo.getTechAnnex());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBusinessAnnex()), CrmContract::getBusinessAnnex, bo.getBusinessAnnex());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductionSchedule()), CrmContract::getProductionSchedule, bo.getProductionSchedule());
|
||||
lqw.eq(bo.getStatus() != null, CrmContract::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmContractBo bo) {
|
||||
CrmContract add = BeanUtil.toBean(bo, CrmContract.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setContractId(add.getContractId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmContractBo bo) {
|
||||
CrmContract update = BeanUtil.toBean(bo, CrmContract.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmContract entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -61,27 +61,14 @@ public class CrmCustomerServiceImpl implements ICrmCustomerService {
|
||||
private LambdaQueryWrapper<CrmCustomer> buildQueryWrapper(CrmCustomerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmCustomer> lqw = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(bo.getKeyword())) {
|
||||
lqw.and(w -> w.like(CrmCustomer::getCustomerCode, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getCompanyName, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getContactPerson, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getContactWay, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getIndustry, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getCustomerLevel, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getAddress, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getBankInfo, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getTaxNumber, bo.getKeyword())
|
||||
.or().like(CrmCustomer::getRemark, bo.getKeyword()));
|
||||
}
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerCode()), CrmCustomer::getCustomerCode, bo.getCustomerCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), CrmCustomer::getCompanyName, bo.getCompanyName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContactPerson()), CrmCustomer::getContactPerson, bo.getContactPerson());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContactWay()), CrmCustomer::getContactWay, bo.getContactWay());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactPerson()), CrmCustomer::getContactPerson, bo.getContactPerson());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactWay()), CrmCustomer::getContactWay, bo.getContactWay());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIndustry()), CrmCustomer::getIndustry, bo.getIndustry());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerLevel()), CrmCustomer::getCustomerLevel, bo.getCustomerLevel());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAddress()), CrmCustomer::getAddress, bo.getAddress());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBankInfo()), CrmCustomer::getBankInfo, bo.getBankInfo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTaxNumber()), CrmCustomer::getTaxNumber, bo.getTaxNumber());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAddress()), CrmCustomer::getAddress, bo.getAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBankInfo()), CrmCustomer::getBankInfo, bo.getBankInfo());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,35 +7,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.crm.domain.CrmSalesObjection;
|
||||
import com.klp.domain.WmsMaterialCoil;
|
||||
import com.klp.domain.WmsReceivable;
|
||||
import com.klp.domain.vo.WmsDeliveryWaybillVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmOrderItemBo;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemVo;
|
||||
import com.klp.crm.domain.vo.CrmContractOrderFinanceVo;
|
||||
import com.klp.crm.domain.vo.CrmSalesObjectionVo;
|
||||
import com.klp.domain.vo.WmsReceivableVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.crm.domain.CrmOrderItem;
|
||||
import com.klp.crm.domain.CrmOrder;
|
||||
import com.klp.domain.WmsDeliveryWaybill;
|
||||
import com.klp.domain.WmsDeliveryWaybillDetail;
|
||||
import com.klp.crm.mapper.CrmOrderItemMapper;
|
||||
import com.klp.crm.mapper.CrmOrderMapper;
|
||||
import com.klp.crm.mapper.CrmSalesObjectionMapper;
|
||||
import com.klp.crm.service.ICrmOrderItemService;
|
||||
import com.klp.mapper.WmsReceivableMapper;
|
||||
import com.klp.mapper.WmsDeliveryWaybillMapper;
|
||||
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 正式订单明细Service业务层处理
|
||||
@@ -48,18 +30,12 @@ import java.util.stream.Collectors;
|
||||
public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
|
||||
private final CrmOrderItemMapper baseMapper;
|
||||
private final CrmOrderMapper crmOrderMapper;
|
||||
private final CrmSalesObjectionMapper crmSalesObjectionMapper;
|
||||
private final WmsReceivableMapper wmsReceivableMapper;
|
||||
private final WmsDeliveryWaybillMapper wmsDeliveryWaybillMapper;
|
||||
private final WmsDeliveryWaybillDetailMapper wmsDeliveryWaybillDetailMapper;
|
||||
private final IWmsMaterialCoilService iWmsMaterialCoilService;
|
||||
|
||||
/**
|
||||
* 查询正式订单明细
|
||||
*/
|
||||
@Override
|
||||
public CrmOrderItemVo queryById(String itemId) {
|
||||
public CrmOrderItemVo queryById(String itemId){
|
||||
return baseMapper.selectVoById(itemId);
|
||||
}
|
||||
|
||||
@@ -85,7 +61,7 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
private LambdaQueryWrapper<CrmOrderItem> buildQueryWrapper(CrmOrderItemBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmOrderItem> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getOrderId() != null, CrmOrderItem::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderId()), CrmOrderItem::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductType()), CrmOrderItem::getProductType, bo.getProductType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawMaterialSpec()), CrmOrderItem::getRawMaterialSpec, bo.getRawMaterialSpec());
|
||||
lqw.eq(bo.getProductNum() != null, CrmOrderItem::getProductNum, bo.getProductNum());
|
||||
@@ -95,8 +71,6 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterial()), CrmOrderItem::getMaterial, bo.getMaterial());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGrade()), CrmOrderItem::getGrade, bo.getGrade());
|
||||
lqw.eq(bo.getWeight() != null, CrmOrderItem::getWeight, bo.getWeight());
|
||||
lqw.eq(bo.getWidthTolerance() != null, CrmOrderItem::getWidthTolerance, bo.getWidthTolerance());
|
||||
lqw.eq(bo.getThicknessTolerance() != null, CrmOrderItem::getThicknessTolerance, bo.getThicknessTolerance());
|
||||
lqw.eq(bo.getContractPrice() != null, CrmOrderItem::getContractPrice, bo.getContractPrice());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomizer()), CrmOrderItem::getCustomizer, bo.getCustomizer());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getShipper()), CrmOrderItem::getShipper, bo.getShipper());
|
||||
@@ -132,7 +106,7 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmOrderItem entity) {
|
||||
private void validEntityBeforeSave(CrmOrderItem entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@@ -141,198 +115,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrmContractOrderFinanceVo queryFinanceAndObjectionByContractId(Long contractId) {
|
||||
CrmContractOrderFinanceVo result = new CrmContractOrderFinanceVo();
|
||||
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<CrmSalesObjection> objectionWrapper = new LambdaQueryWrapper<>();
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, orderIds);
|
||||
List<CrmSalesObjectionVo> objectionList = crmSalesObjectionMapper.selectVoList(objectionWrapper);
|
||||
result.setObjectionList(objectionList);
|
||||
|
||||
LambdaQueryWrapper<com.klp.domain.WmsReceivable> receivableWrapper = new LambdaQueryWrapper<>();
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, orderIds);
|
||||
List<WmsReceivableVo> receivableList = wmsReceivableMapper.selectVoList(receivableWrapper);
|
||||
result.setReceivableList(receivableList);
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybillVo> wmsDeliveryWaybills = wmsDeliveryWaybillMapper.selectVoList(waybillWrapper);
|
||||
result.setWmsDeliveryWaybills(wmsDeliveryWaybills);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId) {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.eq(WmsDeliveryWaybill::getOrderId, orderId);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryList(coilBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByContractId(Long contractId) {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryList(coilBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrmContractOrderFinanceVo queryFinanceAndObjectionByCustomerId(String customerId) {
|
||||
CrmContractOrderFinanceVo result = new CrmContractOrderFinanceVo();
|
||||
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getCustomerId, customerId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<CrmSalesObjection> objectionWrapper = new LambdaQueryWrapper<>();
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, orderIds);
|
||||
List<CrmSalesObjectionVo> objectionList = crmSalesObjectionMapper.selectVoList(objectionWrapper);
|
||||
result.setObjectionList(objectionList);
|
||||
|
||||
LambdaQueryWrapper<com.klp.domain.WmsReceivable> receivableWrapper = new LambdaQueryWrapper<>();
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, orderIds);
|
||||
List<WmsReceivableVo> receivableList = wmsReceivableMapper.selectVoList(receivableWrapper);
|
||||
result.setReceivableList(receivableList);
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybillVo> wmsDeliveryWaybills = wmsDeliveryWaybillMapper.selectVoList(waybillWrapper);
|
||||
result.setWmsDeliveryWaybills(wmsDeliveryWaybills);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByCustomerId(String customerId) {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getCustomerId, customerId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryList(coilBo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,18 +82,6 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
private QueryWrapper<CrmOrder> buildQueryWrapperPlus(CrmOrderBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<CrmOrder> qw = Wrappers.query();
|
||||
if (StringUtils.isNotBlank(bo.getKeyword())) {
|
||||
qw.and(w -> w.like("co.order_code", bo.getKeyword())
|
||||
.or().like("co.customer_id", bo.getKeyword())
|
||||
.or().like("co.salesman", bo.getKeyword())
|
||||
.or().like("co.audit_user", bo.getKeyword())
|
||||
.or().like("co.contract_code", bo.getKeyword())
|
||||
.or().like("co.annex_files", bo.getKeyword())
|
||||
.or().like("co.remark", bo.getKeyword())
|
||||
.or().like("co.contract_name", bo.getKeyword())
|
||||
.or().like("co.supplier", bo.getKeyword())
|
||||
.or().like("co.customer", bo.getKeyword()));
|
||||
}
|
||||
qw.eq(StringUtils.isNotBlank(bo.getOrderCode()), "co.order_code", bo.getOrderCode());
|
||||
qw.eq(bo.getOrderType() != null, "co.order_type", bo.getOrderType());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getCustomerId()), "co.customer_id", bo.getCustomerId());
|
||||
@@ -107,33 +95,6 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
qw.eq(bo.getFinanceStatus() != null, "co.finance_status", bo.getFinanceStatus());
|
||||
qw.eq(bo.getUnpaidAmount() != null, "co.unpaid_amount", bo.getUnpaidAmount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getContractCode()), "co.contract_code", bo.getContractCode());
|
||||
qw.like(StringUtils.isNotBlank(bo.getContractName()), "co.contract_name", bo.getContractName());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplier()), "co.supplier", bo.getSupplier());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomer()), "co.customer", bo.getCustomer());
|
||||
qw.eq(bo.getSignTime() != null, "co.sign_time", bo.getSignTime());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSignLocation()), "co.sign_location", bo.getSignLocation());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getProductContent()), "co.product_content", bo.getProductContent());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getContractContent()), "co.contract_content", bo.getContractContent());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierAddress()), "co.supplier_address", bo.getSupplierAddress());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierPhone()), "co.supplier_phone", bo.getSupplierPhone());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierBank()), "co.supplier_bank", bo.getSupplierBank());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierAccount()), "co.supplier_account", bo.getSupplierAccount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierTaxNo()), "co.supplier_tax_no", bo.getSupplierTaxNo());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerAddress()), "co.customer_address", bo.getCustomerAddress());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerPhone()), "co.customer_phone", bo.getCustomerPhone());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerBank()), "co.customer_bank", bo.getCustomerBank());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerAccount()), "co.customer_account", bo.getCustomerAccount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerTaxNo()), "co.customer_tax_no", bo.getCustomerTaxNo());
|
||||
qw.like(StringUtils.isNotBlank(bo.getTechAnnex()), "co.tech_annex", bo.getTechAnnex());
|
||||
qw.like(StringUtils.isNotBlank(bo.getBusinessAnnex()), "co.business_annex", bo.getBusinessAnnex());
|
||||
qw.like(StringUtils.isNotBlank(bo.getProductionSchedule()), "co.production_schedule", bo.getProductionSchedule());
|
||||
qw.like(StringUtils.isNotBlank(bo.getUnitPriceRemark()), "co.unit_price_remark", bo.getUnitPriceRemark());
|
||||
qw.eq(bo.getDepositPayable() != null, "co.deposit_payable", bo.getDepositPayable());
|
||||
qw.eq(bo.getDepositPaid() != null, "co.deposit_paid", bo.getDepositPaid());
|
||||
qw.eq(bo.getDepositRatio() != null, "co.deposit_ratio", bo.getDepositRatio());
|
||||
qw.eq(bo.getStatus() != null, "co.status", bo.getStatus());
|
||||
qw.eq(bo.getContractId() != null, "co.contract_id", bo.getContractId());
|
||||
qw.like(StringUtils.isNotBlank(bo.getAnnexFiles()), "co.annex_files", bo.getAnnexFiles());
|
||||
//逻辑删除
|
||||
qw.eq("co.del_flag", 0);
|
||||
//根据orderType排序预订单是0 正是订单是1 0排在前面 1排在后面 升序
|
||||
@@ -167,33 +128,6 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
lqw.eq(bo.getFinanceStatus() != null, CrmOrder::getFinanceStatus, bo.getFinanceStatus());
|
||||
lqw.eq(bo.getUnpaidAmount() != null, CrmOrder::getUnpaidAmount, bo.getUnpaidAmount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractCode()), CrmOrder::getContractCode, bo.getContractCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractName()), CrmOrder::getContractName, bo.getContractName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplier()), CrmOrder::getSupplier, bo.getSupplier());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomer()), CrmOrder::getCustomer, bo.getCustomer());
|
||||
lqw.eq(bo.getSignTime() != null, CrmOrder::getSignTime, bo.getSignTime());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSignLocation()), CrmOrder::getSignLocation, bo.getSignLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductContent()), CrmOrder::getProductContent, bo.getProductContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractContent()), CrmOrder::getContractContent, bo.getContractContent());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierAddress()), CrmOrder::getSupplierAddress, bo.getSupplierAddress());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierPhone()), CrmOrder::getSupplierPhone, bo.getSupplierPhone());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierBank()), CrmOrder::getSupplierBank, bo.getSupplierBank());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierAccount()), CrmOrder::getSupplierAccount, bo.getSupplierAccount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierTaxNo()), CrmOrder::getSupplierTaxNo, bo.getSupplierTaxNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerAddress()), CrmOrder::getCustomerAddress, bo.getCustomerAddress());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerPhone()), CrmOrder::getCustomerPhone, bo.getCustomerPhone());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerBank()), CrmOrder::getCustomerBank, bo.getCustomerBank());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerAccount()), CrmOrder::getCustomerAccount, bo.getCustomerAccount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerTaxNo()), CrmOrder::getCustomerTaxNo, bo.getCustomerTaxNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTechAnnex()), CrmOrder::getTechAnnex, bo.getTechAnnex());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBusinessAnnex()), CrmOrder::getBusinessAnnex, bo.getBusinessAnnex());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductionSchedule()), CrmOrder::getProductionSchedule, bo.getProductionSchedule());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitPriceRemark()), CrmOrder::getUnitPriceRemark, bo.getUnitPriceRemark());
|
||||
lqw.eq(bo.getDepositPayable() != null, CrmOrder::getDepositPayable, bo.getDepositPayable());
|
||||
lqw.eq(bo.getDepositPaid() != null, CrmOrder::getDepositPaid, bo.getDepositPaid());
|
||||
lqw.eq(bo.getDepositRatio() != null, CrmOrder::getDepositRatio, bo.getDepositRatio());
|
||||
lqw.eq(bo.getStatus() != null, CrmOrder::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getContractId() != null, CrmOrder::getContractId, bo.getContractId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAnnexFiles()), CrmOrder::getAnnexFiles, bo.getAnnexFiles());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class CrmSalesReportServiceImpl implements ICrmSalesReportService {
|
||||
List<CrmSalesReportVo.OrderDetail> orderDetails = baseMapper.selectOrderDetailList(bo);
|
||||
if (StringUtils.isNotNull(orderDetails) && !orderDetails.isEmpty()) {
|
||||
// 提取所有订单ID
|
||||
List<Long> orderIds = orderDetails.stream()
|
||||
List<String> orderIds = orderDetails.stream()
|
||||
.map(CrmSalesReportVo.OrderDetail::getOrderId)
|
||||
.filter(StringUtils::isNotNull)
|
||||
.distinct()
|
||||
@@ -70,7 +70,7 @@ public class CrmSalesReportServiceImpl implements ICrmSalesReportService {
|
||||
List<CrmOrderItem> orderItems = crmOrderItemMapper.selectOrderItemsByOrderIds(orderIds);
|
||||
|
||||
// 将明细按订单ID分组
|
||||
Map<Long, List<CrmOrderItem>> orderItemMap = orderItems.stream()
|
||||
Map<String, List<CrmOrderItem>> orderItemMap = orderItems.stream()
|
||||
.collect(Collectors.groupingBy(CrmOrderItem::getOrderId));
|
||||
|
||||
// 为每个订单设置对应的明细列表
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.crm.mapper.CrmContractMapper">
|
||||
|
||||
<resultMap type="com.klp.crm.domain.CrmContract" id="CrmContractResult">
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="contractName" column="contract_name"/>
|
||||
<result property="contractNo" column="contract_no"/>
|
||||
<result property="supplier" column="supplier"/>
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="deliveryDate" column="delivery_date"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signLocation" column="sign_location"/>
|
||||
<result property="productContent" column="product_content"/>
|
||||
<result property="contractContent" column="contract_content"/>
|
||||
<result property="supplierAddress" column="supplier_address"/>
|
||||
<result property="supplierPhone" column="supplier_phone"/>
|
||||
<result property="supplierBank" column="supplier_bank"/>
|
||||
<result property="supplierAccount" column="supplier_account"/>
|
||||
<result property="supplierTaxNo" column="supplier_tax_no"/>
|
||||
<result property="customerAddress" column="customer_address"/>
|
||||
<result property="customerPhone" column="customer_phone"/>
|
||||
<result property="customerBank" column="customer_bank"/>
|
||||
<result property="customerAccount" column="customer_account"/>
|
||||
<result property="customerTaxNo" column="customer_tax_no"/>
|
||||
<result property="techAnnex" column="tech_annex"/>
|
||||
<result property="businessAnnex" column="business_annex"/>
|
||||
<result property="productionSchedule" column="production_schedule"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.crm.mapper.CrmContractProductMapper">
|
||||
|
||||
<resultMap type="com.klp.crm.domain.CrmContractProduct" id="CrmContractProductResult">
|
||||
<result property="contractProductId" column="contract_product_id"/>
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="specMin" column="spec_min"/>
|
||||
<result property="specMax" column="spec_max"/>
|
||||
<result property="material" column="material"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="taxInclusiveUnitPrice" column="tax_inclusive_unit_price"/>
|
||||
<result property="exTaxUnitPrice" column="ex_tax_unit_price"/>
|
||||
<result property="taxInclusiveAmount" column="tax_inclusive_amount"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -14,7 +14,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="customerLevel" column="customer_level"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="bankInfo" column="bank_info"/>
|
||||
<result property="taxNumber" column="tax_number"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
@@ -17,8 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="material" column="material"/>
|
||||
<result property="grade" column="grade"/>
|
||||
<result property="weight" column="weight"/>
|
||||
<result property="widthTolerance" column="width_tolerance"/>
|
||||
<result property="thicknessTolerance" column="thickness_tolerance"/>
|
||||
<result property="contractPrice" column="contract_price"/>
|
||||
<result property="customizer" column="customizer"/>
|
||||
<result property="shipper" column="shipper"/>
|
||||
@@ -44,8 +42,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
material,
|
||||
grade,
|
||||
weight,
|
||||
width_tolerance,
|
||||
thickness_tolerance,
|
||||
contract_price,
|
||||
customizer,
|
||||
shipper,
|
||||
|
||||
@@ -20,33 +20,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="unpaidAmount" column="unpaid_amount"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="contractName" column="contract_name"/>
|
||||
<result property="supplier" column="supplier"/>
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signLocation" column="sign_location"/>
|
||||
<result property="productContent" column="product_content"/>
|
||||
<result property="contractContent" column="contract_content"/>
|
||||
<result property="supplierAddress" column="supplier_address"/>
|
||||
<result property="supplierPhone" column="supplier_phone"/>
|
||||
<result property="supplierBank" column="supplier_bank"/>
|
||||
<result property="supplierAccount" column="supplier_account"/>
|
||||
<result property="supplierTaxNo" column="supplier_tax_no"/>
|
||||
<result property="customerAddress" column="customer_address"/>
|
||||
<result property="customerPhone" column="customer_phone"/>
|
||||
<result property="customerBank" column="customer_bank"/>
|
||||
<result property="customerAccount" column="customer_account"/>
|
||||
<result property="customerTaxNo" column="customer_tax_no"/>
|
||||
<result property="techAnnex" column="tech_annex"/>
|
||||
<result property="businessAnnex" column="business_annex"/>
|
||||
<result property="productionSchedule" column="production_schedule"/>
|
||||
<result property="unitPriceRemark" column="unit_price_remark"/>
|
||||
<result property="depositPayable" column="deposit_payable"/>
|
||||
<result property="depositPaid" column="deposit_paid"/>
|
||||
<result property="depositRatio" column="deposit_ratio"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="annexFiles" column="annex_files"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -70,33 +43,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.contract_name AS contractName,
|
||||
co.supplier,
|
||||
co.customer,
|
||||
co.sign_time AS signTime,
|
||||
co.sign_location AS signLocation,
|
||||
co.product_content AS productContent,
|
||||
co.contract_content AS contractContent,
|
||||
co.supplier_address AS supplierAddress,
|
||||
co.supplier_phone AS supplierPhone,
|
||||
co.supplier_bank AS supplierBank,
|
||||
co.supplier_account AS supplierAccount,
|
||||
co.supplier_tax_no AS supplierTaxNo,
|
||||
co.customer_address AS customerAddress,
|
||||
co.customer_phone AS customerPhone,
|
||||
co.customer_bank AS customerBank,
|
||||
co.customer_account AS customerAccount,
|
||||
co.customer_tax_no AS customerTaxNo,
|
||||
co.tech_annex AS techAnnex,
|
||||
co.business_annex AS businessAnnex,
|
||||
co.production_schedule AS productionSchedule,
|
||||
co.unit_price_remark AS unitPriceRemark,
|
||||
co.deposit_payable AS depositPayable,
|
||||
co.deposit_paid AS depositPaid,
|
||||
co.deposit_ratio AS depositRatio,
|
||||
co.status,
|
||||
co.contract_id AS contractId,
|
||||
co.annex_files AS annexFiles,
|
||||
co.create_by AS createBy,
|
||||
co.create_time AS createTime,
|
||||
co.update_by AS updateBy,
|
||||
@@ -129,33 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.contract_name AS contractName,
|
||||
co.supplier,
|
||||
co.customer,
|
||||
co.sign_time AS signTime,
|
||||
co.sign_location AS signLocation,
|
||||
co.product_content AS productContent,
|
||||
co.contract_content AS contractContent,
|
||||
co.supplier_address AS supplierAddress,
|
||||
co.supplier_phone AS supplierPhone,
|
||||
co.supplier_bank AS supplierBank,
|
||||
co.supplier_account AS supplierAccount,
|
||||
co.supplier_tax_no AS supplierTaxNo,
|
||||
co.customer_address AS customerAddress,
|
||||
co.customer_phone AS customerPhone,
|
||||
co.customer_bank AS customerBank,
|
||||
co.customer_account AS customerAccount,
|
||||
co.customer_tax_no AS customerTaxNo,
|
||||
co.tech_annex AS techAnnex,
|
||||
co.business_annex AS businessAnnex,
|
||||
co.production_schedule AS productionSchedule,
|
||||
co.unit_price_remark AS unitPriceRemark,
|
||||
co.deposit_payable AS depositPayable,
|
||||
co.deposit_paid AS depositPaid,
|
||||
co.deposit_ratio AS depositRatio,
|
||||
co.status,
|
||||
co.contract_id AS contractId,
|
||||
co.annex_files AS annexFiles,
|
||||
co.create_by AS createBy,
|
||||
co.create_time AS createTime,
|
||||
co.update_by AS updateBy,
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.klp.pocket.acid.domain.vo.AcidOeeIdealCycleVo;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeLoss7Vo;
|
||||
import com.klp.pocket.acid.domain.vo.Klptcm1ProStoppageVo;
|
||||
import com.klp.pocket.acid.service.IAcidOeeService;
|
||||
import com.klp.pocket.galvanize1.service.IGalvanizeOeeService;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
@@ -62,7 +61,6 @@ import java.util.stream.Collectors;
|
||||
public class OeeReportController extends BaseController {
|
||||
|
||||
private final IAcidOeeService acidOeeService;
|
||||
private final IGalvanizeOeeService galvanizeOeeService;
|
||||
private final StringRedisTemplate stringRedisTemplate;
|
||||
private final OeeReportJobService oeeReportJobService;
|
||||
private final OeeWordAiAnalysisService oeeWordAiAnalysisService;
|
||||
@@ -78,20 +76,26 @@ public class OeeReportController extends BaseController {
|
||||
*
|
||||
* 路由:GET /oee/line/acid/summary
|
||||
* 说明:
|
||||
* - 支持 startDate/endDate 参数(yyyy-MM-dd);
|
||||
* - 若不传则默认查询当前月份(1号~今天);
|
||||
* - 仅实时计算,不走缓存。
|
||||
* - 不接受 start/end 参数,固定返回“当前月份(1号~今天)”的当月预计算结果;
|
||||
* - 优先从 Redis 当月缓存读取;若缓存缺失则实时计算一次当前月。
|
||||
*/
|
||||
@GetMapping("/acid/summary")
|
||||
public R<List<AcidOeeDailySummaryVo>> getAcidSummary(
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@RequestParam(required = false, defaultValue = "acid") String lineType
|
||||
) {
|
||||
String[] range = resolveDateRange(startDate, endDate);
|
||||
List<AcidOeeDailySummaryVo> dailyList = isGalvanize(lineType)
|
||||
? galvanizeOeeService.getDailySummary(range[0], range[1])
|
||||
: acidOeeService.getDailySummary(range[0], range[1]);
|
||||
public R<List<AcidOeeDailySummaryVo>> getAcidSummary() {
|
||||
String yyyyMM = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM"));
|
||||
String summaryKey = String.format("oee:report:month:summary:%s:SY", yyyyMM);
|
||||
|
||||
// 1. 优先从 Redis 读取当月预计算结果
|
||||
String json = stringRedisTemplate.opsForValue().get(summaryKey);
|
||||
if (StringUtils.isNotBlank(json)) {
|
||||
List<AcidOeeDailySummaryVo> cached =
|
||||
JSON.parseArray(json, AcidOeeDailySummaryVo.class);
|
||||
return R.ok(cached);
|
||||
}
|
||||
|
||||
// 2. 缓存缺失时,回退为实时计算当前月
|
||||
String[] range = resolveDateRange(null, null);
|
||||
List<AcidOeeDailySummaryVo> dailyList =
|
||||
acidOeeService.getDailySummary(range[0], range[1]);
|
||||
return R.ok(dailyList);
|
||||
}
|
||||
|
||||
@@ -105,15 +109,21 @@ public class OeeReportController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/acid/loss7")
|
||||
public R<List<AcidOeeLoss7Vo>> getAcidLoss7(
|
||||
@RequestParam(required = false, defaultValue = "50") Integer topN,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@RequestParam(required = false, defaultValue = "acid") String lineType
|
||||
@RequestParam(required = false, defaultValue = "50") Integer topN
|
||||
) {
|
||||
String[] range = resolveDateRange(startDate, endDate);
|
||||
List<AcidOeeLoss7Vo> lossList = isGalvanize(lineType)
|
||||
? galvanizeOeeService.getLoss7Summary(range[0], range[1])
|
||||
: acidOeeService.getLoss7Summary(range[0], range[1]);
|
||||
String yyyyMM = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM"));
|
||||
String loss7Key = String.format("oee:report:month:loss7:%s:SY", yyyyMM);
|
||||
|
||||
// 1. 优先从 Redis 读取当月 7 大损失预计算结果
|
||||
String json = stringRedisTemplate.opsForValue().get(loss7Key);
|
||||
List<AcidOeeLoss7Vo> lossList;
|
||||
if (StringUtils.isNotBlank(json)) {
|
||||
lossList = JSON.parseArray(json, AcidOeeLoss7Vo.class);
|
||||
} else {
|
||||
// 2. 缓存缺失时,回退为实时计算当前月
|
||||
String[] range = resolveDateRange(null, null);
|
||||
lossList = acidOeeService.getLoss7Summary(range[0], range[1]);
|
||||
}
|
||||
|
||||
if (topN != null && topN > 0 && lossList.size() > topN) {
|
||||
lossList = new ArrayList<>(lossList.subList(0, topN));
|
||||
@@ -137,16 +147,14 @@ public class OeeReportController extends BaseController {
|
||||
@RequestParam(required = false) String stopType,
|
||||
@RequestParam(required = false) String keyword,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false, defaultValue = "acid") String lineType
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize
|
||||
) {
|
||||
// 事件明细底层按「日期」查询,这里从时间字符串中截取日期部分
|
||||
String startDate = extractDateOrDefault(startTime, true);
|
||||
String endDate = extractDateOrDefault(endTime, false);
|
||||
|
||||
List<Klptcm1ProStoppageVo> events = isGalvanize(lineType)
|
||||
? galvanizeOeeService.getStoppageEvents(startDate, endDate)
|
||||
: acidOeeService.getStoppageEvents(startDate, endDate);
|
||||
List<Klptcm1ProStoppageVo> events =
|
||||
acidOeeService.getStoppageEvents(startDate, endDate);
|
||||
|
||||
// 业务筛选:stopType、关键字(目前对 stopType / remark 做 contains 匹配)
|
||||
List<Klptcm1ProStoppageVo> filtered = events.stream()
|
||||
@@ -192,12 +200,9 @@ public class OeeReportController extends BaseController {
|
||||
@GetMapping("/acid/idealCycle")
|
||||
public R<AcidOeeIdealCycleVo> getAcidIdealCycle(
|
||||
@RequestParam String startDate,
|
||||
@RequestParam String endDate,
|
||||
@RequestParam(required = false, defaultValue = "acid") String lineType
|
||||
@RequestParam String endDate
|
||||
) {
|
||||
AcidOeeIdealCycleVo data = isGalvanize(lineType)
|
||||
? galvanizeOeeService.getIdealCycle(startDate, endDate)
|
||||
: acidOeeService.getIdealCycle(startDate, endDate);
|
||||
AcidOeeIdealCycleVo data = acidOeeService.getIdealCycle(startDate, endDate);
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@@ -418,10 +423,6 @@ public class OeeReportController extends BaseController {
|
||||
/**
|
||||
* 若未显式传入日期范围,则默认当前月 [1号, 今天]。
|
||||
*/
|
||||
private boolean isGalvanize(String lineType) {
|
||||
return "galvanize1".equalsIgnoreCase(lineType) || "galvanize".equalsIgnoreCase(lineType) || "dx".equalsIgnoreCase(lineType);
|
||||
}
|
||||
|
||||
private String[] resolveDateRange(String startDate, String endDate) {
|
||||
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
||||
return new String[]{startDate, endDate};
|
||||
|
||||
137
klp-da/src/main/java/com/klp/da/task/AcidOeeMonthTask.java
Normal file
137
klp-da/src/main/java/com/klp/da/task/AcidOeeMonthTask.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.klp.da.task;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeDailySummaryVo;
|
||||
import com.klp.pocket.acid.service.IAcidOeeService;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 酸轧线 OEE 当月预计算任务
|
||||
*
|
||||
* 需求对应 docs/oee-report-design.md 第 12.2 节:
|
||||
* - 项目启动完成后即计算当月 OEE 聚合结果并写入 Redis;
|
||||
* - 每天凌晨 04:00 重新计算当月数据并覆盖缓存。
|
||||
*
|
||||
* 当前仅实现酸轧线(SY)的当月日汇总预计算;
|
||||
* key 约定:
|
||||
* - 汇总结果:oee:report:month:summary:{yyyyMM}:SY
|
||||
* - 元信息: oee:report:month:meta:{yyyyMM}:SY
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class AcidOeeMonthTask {
|
||||
|
||||
/** Redis 缓存 key 模板:当月 OEE 汇总(酸轧线) */
|
||||
private static final String SUMMARY_KEY_PATTERN = "oee:report:month:summary:%s:SY";
|
||||
|
||||
/** Redis 缓存 key 模板:当月元信息(酸轧线) */
|
||||
private static final String META_KEY_PATTERN = "oee:report:month:meta:%s:SY";
|
||||
|
||||
private static final DateTimeFormatter YEAR_MONTH_FMT = DateTimeFormatter.ofPattern("yyyyMM");
|
||||
private static final DateTimeFormatter DATE_FMT = DateTimeFormatter.ISO_DATE;
|
||||
private static final DateTimeFormatter DATE_TIME_FMT = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
|
||||
private final IAcidOeeService acidOeeService;
|
||||
private final StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
/**
|
||||
* 项目启动完成后立即计算一次当月酸轧 OEE 汇总并写入 Redis。
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
try {
|
||||
computeCurrentMonth("startup");
|
||||
} catch (Exception e) {
|
||||
log.error("[AcidOeeMonthTask] startup compute failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 每天凌晨 04:00 重新计算当月酸轧 OEE 汇总并覆盖 Redis 缓存。
|
||||
*/
|
||||
@Scheduled(cron = "0 0 4 * * ?")
|
||||
public void scheduleDaily() {
|
||||
try {
|
||||
computeCurrentMonth("schedule-04");
|
||||
} catch (Exception e) {
|
||||
log.error("[AcidOeeMonthTask] 4am compute failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算当前月份(从当月1号到今天)的酸轧 OEE 日汇总,并写入 Redis。
|
||||
*
|
||||
* @param trigger 触发来源标记(startup / schedule-04 等)
|
||||
*/
|
||||
private void computeCurrentMonth(String trigger) {
|
||||
long startNs = System.nanoTime();
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
String yyyyMM = now.format(YEAR_MONTH_FMT);
|
||||
|
||||
LocalDate startDate = now.withDayOfMonth(1);
|
||||
LocalDate endDate = now;
|
||||
|
||||
String startStr = startDate.format(DATE_FMT);
|
||||
String endStr = endDate.format(DATE_FMT);
|
||||
|
||||
log.info("[AcidOeeMonthTask] trigger={}, computing acid OEE month summary for {} ({} ~ {})",
|
||||
trigger, yyyyMM, startStr, endStr);
|
||||
|
||||
// 1. 调用 pocket 的 AcidOeeService 获取当月日汇总
|
||||
List<AcidOeeDailySummaryVo> dailySummaryList = acidOeeService.getDailySummary(startStr, endStr);
|
||||
|
||||
// 2. 写入 Redis(summary)
|
||||
String summaryKey = String.format(SUMMARY_KEY_PATTERN, yyyyMM);
|
||||
String summaryJson = JSON.toJSONString(dailySummaryList);
|
||||
stringRedisTemplate.opsForValue().set(summaryKey, summaryJson, 1, TimeUnit.DAYS);
|
||||
|
||||
long durationMs = (System.nanoTime() - startNs) / 1_000_000L;
|
||||
|
||||
// 3. 写入 Redis(meta)
|
||||
Meta meta = new Meta();
|
||||
meta.setComputedAt(LocalDateTime.now().format(DATE_TIME_FMT));
|
||||
meta.setDurationMs(durationMs);
|
||||
meta.setStartDate(startStr);
|
||||
meta.setEndDate(endStr);
|
||||
meta.setTrigger(trigger);
|
||||
|
||||
String metaKey = String.format(META_KEY_PATTERN, yyyyMM);
|
||||
stringRedisTemplate.opsForValue().set(metaKey, JSON.toJSONString(meta), 1, TimeUnit.DAYS);
|
||||
|
||||
log.info("[AcidOeeMonthTask] compute finish for {} dailySize={}, durationMs={}ms, summaryKey={}",
|
||||
yyyyMM, dailySummaryList.size(), durationMs, summaryKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当月预计算元信息
|
||||
*/
|
||||
@Data
|
||||
private static class Meta {
|
||||
/** 计算完成时间(ISO-8601 字符串) */
|
||||
private String computedAt;
|
||||
/** 计算耗时(毫秒) */
|
||||
private long durationMs;
|
||||
/** 统计起始日期(yyyy-MM-dd) */
|
||||
private String startDate;
|
||||
/** 统计结束日期(yyyy-MM-dd) */
|
||||
private String endDate;
|
||||
/** 触发来源(startup / schedule-04 等) */
|
||||
private String trigger;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.flywaydb.core.internal.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
|
||||
@@ -71,8 +71,8 @@ public class EqpAuxiliaryMaterialController extends BaseController {
|
||||
@Log(title = "辅料", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryMaterialBo bo) {
|
||||
return R.ok(iEqpAuxiliaryMaterialService.insertByBo(bo));
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryMaterialBo bo) {
|
||||
return toAjax(iEqpAuxiliaryMaterialService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,8 +71,8 @@ public class EqpSparePartController extends BaseController {
|
||||
@Log(title = "备品备件", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody EqpSparePartBo bo) {
|
||||
return R.ok(iEqpSparePartService.insertByBo(bo));
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpSparePartBo bo) {
|
||||
return toAjax(iEqpSparePartService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,10 +44,6 @@ public class EqpAuxiliaryMaterial extends BaseEntity {
|
||||
* 关联设备ID(可为空,通用辅料)
|
||||
*/
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -44,10 +44,6 @@ public class EqpSparePart extends BaseEntity {
|
||||
* 关联设备ID(可为空,通用备件)
|
||||
*/
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -47,11 +47,6 @@ public class EqpAuxiliaryMaterialBo extends BaseEntity {
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -47,11 +47,6 @@ public class EqpSparePartBo extends BaseEntity {
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -56,12 +56,6 @@ public class EqpAuxiliaryMaterialVo {
|
||||
@ExcelDictFormat(readConverterExp = "可=为空,通用辅料")
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
@ExcelProperty(value = "机组")
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -56,12 +56,6 @@ public class EqpSparePartVo {
|
||||
@ExcelDictFormat(readConverterExp = "可=为空,通用备件")
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
@ExcelProperty(value = "机组")
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ public interface IEqpAuxiliaryMaterialService {
|
||||
/**
|
||||
* 新增辅料
|
||||
*/
|
||||
Long insertByBo(EqpAuxiliaryMaterialBo bo);
|
||||
Boolean insertByBo(EqpAuxiliaryMaterialBo bo);
|
||||
|
||||
/**
|
||||
* 修改辅料
|
||||
|
||||
@@ -35,7 +35,7 @@ public interface IEqpSparePartService {
|
||||
/**
|
||||
* 新增备品备件
|
||||
*/
|
||||
Long insertByBo(EqpSparePartBo bo);
|
||||
Boolean insertByBo(EqpSparePartBo bo);
|
||||
|
||||
/**
|
||||
* 修改备品备件
|
||||
|
||||
@@ -66,7 +66,6 @@ public class EqpAuxiliaryMaterialServiceImpl implements IEqpAuxiliaryMaterialSer
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuxiliaryModel()), EqpAuxiliaryMaterial::getAuxiliaryModel, bo.getAuxiliaryModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), EqpAuxiliaryMaterial::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getEquipmentId() != null, EqpAuxiliaryMaterial::getEquipmentId, bo.getEquipmentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitTeam()), EqpAuxiliaryMaterial::getUnitTeam, bo.getUnitTeam());
|
||||
lqw.eq(bo.getQuantity() != null, EqpAuxiliaryMaterial::getQuantity, bo.getQuantity());
|
||||
return lqw;
|
||||
}
|
||||
@@ -75,14 +74,14 @@ public class EqpAuxiliaryMaterialServiceImpl implements IEqpAuxiliaryMaterialSer
|
||||
* 新增辅料
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(EqpAuxiliaryMaterialBo bo) {
|
||||
public Boolean insertByBo(EqpAuxiliaryMaterialBo bo) {
|
||||
EqpAuxiliaryMaterial add = BeanUtil.toBean(bo, EqpAuxiliaryMaterial.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setAuxiliaryId(add.getAuxiliaryId());
|
||||
}
|
||||
return add.getAuxiliaryId();
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,6 @@ public class EqpSparePartServiceImpl implements IEqpSparePartService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getModel()), "sp.model", bo.getModel());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getUnit()), "sp.unit", bo.getUnit());
|
||||
qw.eq(bo.getEquipmentId() != null, "sp.equipment_id", bo.getEquipmentId());
|
||||
qw.like(StringUtils.isNotBlank(bo.getUnitTeam()), "sp.unit_team", bo.getUnitTeam());
|
||||
qw.eq(bo.getQuantity() != null, "sp.quantity", bo.getQuantity());
|
||||
//逻辑删除
|
||||
qw.eq("sp.del_flag", 0);
|
||||
@@ -82,7 +81,6 @@ public class EqpSparePartServiceImpl implements IEqpSparePartService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), EqpSparePart::getModel, bo.getModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), EqpSparePart::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getEquipmentId() != null, EqpSparePart::getEquipmentId, bo.getEquipmentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitTeam()), EqpSparePart::getUnitTeam, bo.getUnitTeam());
|
||||
lqw.eq(bo.getQuantity() != null, EqpSparePart::getQuantity, bo.getQuantity());
|
||||
return lqw;
|
||||
}
|
||||
@@ -91,14 +89,14 @@ public class EqpSparePartServiceImpl implements IEqpSparePartService {
|
||||
* 新增备品备件
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(EqpSparePartBo bo) {
|
||||
public Boolean insertByBo(EqpSparePartBo bo) {
|
||||
EqpSparePart add = BeanUtil.toBean(bo, EqpSparePart.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPartId(add.getPartId());
|
||||
}
|
||||
return add.getPartId();
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<result property="auxiliaryModel" column="auxiliary_model"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="equipmentId" column="equipment_id"/>
|
||||
<result property="unitTeam" column="unit_team"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<result property="model" column="model"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="equipmentId" column="equipment_id"/>
|
||||
<result property="unitTeam" column="unit_team"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -28,7 +27,6 @@
|
||||
sp.model,
|
||||
sp.unit,
|
||||
sp.equipment_id,
|
||||
sp.unit_team,
|
||||
em.equipment_name AS equipmentName,
|
||||
sp.quantity,
|
||||
sp.remark
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.klp.pocket.acid.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 酸轧OEE按日钢卷信息(主库来源)。
|
||||
*/
|
||||
@Data
|
||||
public class AcidOeeCoilInfoByDateVo {
|
||||
|
||||
/** 统计日期 yyyy-MM-dd */
|
||||
private String statDate;
|
||||
|
||||
/** 当前钢卷号 */
|
||||
private String coilNo;
|
||||
|
||||
/** 重量(吨) */
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 判级 */
|
||||
private String qualityStatus;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.klp.pocket.acid.domain.vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 酸轧线OEE日汇总视图对象
|
||||
@@ -44,36 +45,18 @@ public class AcidOeeDailySummaryVo {
|
||||
/** 总产量(卷) */
|
||||
private Long totalOutputCoil;
|
||||
|
||||
/** 良品量(A系列,吨) */
|
||||
/** 良品量(吨) */
|
||||
private BigDecimal goodOutputTon;
|
||||
|
||||
/** 良品量(A系列,卷) */
|
||||
/** 良品量(卷) */
|
||||
private Long goodOutputCoil;
|
||||
|
||||
/** 合格品量(B系列,吨) */
|
||||
private BigDecimal qualifiedOutputTon;
|
||||
|
||||
/** 合格品量(B系列,卷) */
|
||||
private Long qualifiedOutputCoil;
|
||||
|
||||
/** 合格品合计(A+B,吨) */
|
||||
private BigDecimal abOutputTon;
|
||||
|
||||
/** 合格品合计(A+B,卷) */
|
||||
private Long abOutputCoil;
|
||||
|
||||
/** 次品量(C/D系列,吨) */
|
||||
/** 不良量(吨)= total_output_ton - good_output_ton */
|
||||
private BigDecimal defectOutputTon;
|
||||
|
||||
/** 次品量(C/D系列,卷) */
|
||||
/** 不良量(卷)= total_output_coil - good_output_coil */
|
||||
private Long defectOutputCoil;
|
||||
|
||||
/** 待判级量(O系列,吨) */
|
||||
private BigDecimal pendingOutputTon;
|
||||
|
||||
/** 待判级量(O系列,卷) */
|
||||
private Long pendingOutputCoil;
|
||||
|
||||
/** 理论节拍(min/吨;回归斜率) */
|
||||
private BigDecimal idealCycleTimeMinPerTon;
|
||||
|
||||
@@ -89,18 +72,9 @@ public class AcidOeeDailySummaryVo {
|
||||
/** 派生指标:性能稼动率(卷维度) */
|
||||
private BigDecimal performanceCoil;
|
||||
|
||||
/** 派生指标:良品率(A/总量) */
|
||||
/** 派生指标:良品率 */
|
||||
private BigDecimal quality;
|
||||
|
||||
/** 派生指标:合格品率(A+B/总量) */
|
||||
private BigDecimal qualifiedRate;
|
||||
|
||||
/** 派生指标:次品率(C/D系列/总量) */
|
||||
private BigDecimal defectRate;
|
||||
|
||||
/** 派生指标:待判级率(O系列/总量) */
|
||||
private BigDecimal pendingRate;
|
||||
|
||||
/** 派生指标:OEE(建议以吨维度为主) */
|
||||
private BigDecimal oee;
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.klp.pocket.acid.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 酸轧线OEE酸轧库Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
@DS("acid")
|
||||
public interface AcidOeeAcidMapper {
|
||||
|
||||
/**
|
||||
* 查询卷级生产节拍(min/吨),用于理论节拍计算。
|
||||
*/
|
||||
List<BigDecimal> selectCoilCycleMinPerTon(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.klp.pocket.acid.mapper;
|
||||
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeDailySummaryVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 酸轧线OEE Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-01-30
|
||||
*/
|
||||
@Mapper
|
||||
public interface AcidOeeMapper {
|
||||
|
||||
/**
|
||||
* 查询OEE日汇总(按日期范围)
|
||||
* 聚合产量(吨/卷)、停机时间等
|
||||
*
|
||||
* @param startDate 开始日期(yyyy-MM-dd)
|
||||
* @param endDate 结束日期(yyyy-MM-dd)
|
||||
* @return 日汇总列表
|
||||
*/
|
||||
List<AcidOeeDailySummaryVo> selectDailySummary(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询每日的钢卷号和重量(用于良品/次品判定)
|
||||
*
|
||||
* @param startDate 开始日期(yyyy-MM-dd)
|
||||
* @param endDate 结束日期(yyyy-MM-dd)
|
||||
* @return Map列表,key为日期,value为卷号和重量信息
|
||||
*/
|
||||
List<CoilInfoByDate> selectCoilInfoByDate(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询卷级生产节拍(min/吨),用于理论节拍计算。
|
||||
*
|
||||
* @param startDate 开始日期(yyyy-MM-dd)
|
||||
* @param endDate 结束日期(yyyy-MM-dd)
|
||||
* @return 每卷的生产节拍列表(min/吨)
|
||||
*/
|
||||
List<java.math.BigDecimal> selectCoilCycleMinPerTon(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 卷号信息内部类(用于Mapper返回)
|
||||
*/
|
||||
class CoilInfoByDate {
|
||||
private String statDate;
|
||||
private String coilNo;
|
||||
private java.math.BigDecimal weight;
|
||||
|
||||
public String getStatDate() { return statDate; }
|
||||
public void setStatDate(String statDate) { this.statDate = statDate; }
|
||||
public String getCoilNo() { return coilNo; }
|
||||
public void setCoilNo(String coilNo) { this.coilNo = coilNo; }
|
||||
public java.math.BigDecimal getWeight() { return weight; }
|
||||
public void setWeight(java.math.BigDecimal weight) { this.weight = weight; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.klp.pocket.acid.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeCoilInfoByDateVo;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeDailySummaryVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 酸轧线OEE主库Mapper。
|
||||
*/
|
||||
@Mapper
|
||||
@DS("master")
|
||||
public interface AcidOeeMasterMapper {
|
||||
|
||||
/**
|
||||
* 查询OEE日汇总(总产量来自主库 wms_material_coil)。
|
||||
*/
|
||||
List<AcidOeeDailySummaryVo> selectDailySummary(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("createBy") String createBy);
|
||||
|
||||
/**
|
||||
* 查询每日钢卷重量与判级(来自主库 wms_material_coil)。
|
||||
*/
|
||||
List<AcidOeeCoilInfoByDateVo> selectCoilInfoByDate(@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("createBy") String createBy);
|
||||
}
|
||||
|
||||
@@ -1,34 +1,25 @@
|
||||
package com.klp.pocket.acid.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeCoilInfoByDateVo;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeDailySummaryVo;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeIdealCycleVo;
|
||||
import com.klp.pocket.acid.domain.vo.AcidOeeLoss7Vo;
|
||||
import com.klp.pocket.acid.domain.vo.Klptcm1ProStoppageVo;
|
||||
import com.klp.pocket.acid.domain.bo.Klptcm1ProStoppageBo;
|
||||
import com.klp.pocket.acid.mapper.AcidOeeMasterMapper;
|
||||
import com.klp.pocket.acid.mapper.AcidOeeMapper;
|
||||
import com.klp.pocket.acid.service.IAcidOeeService;
|
||||
import com.klp.pocket.acid.service.IKlptcm1ProStoppageService;
|
||||
import com.klp.pocket.common.service.ICoilQualityJudgeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.*;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 酸轧线OEE Service实现类
|
||||
@@ -38,65 +29,53 @@ import java.util.Set;
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@DS("acid")
|
||||
@Service
|
||||
public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
|
||||
/** 次品判级集合(C/D系列) */
|
||||
private static final Set<String> CD_SERIES = new HashSet<>(
|
||||
Arrays.asList("C+", "C", "C-", "D+", "D", "D-")
|
||||
);
|
||||
|
||||
private final AcidOeeMasterMapper acidOeeMasterMapper;
|
||||
/** 酸轧成品库库区ID */
|
||||
private static final Long ACID_FINISHED_WAREHOUSE_ID = 1988150099140866050L;
|
||||
/** 固定理论节拍(min/吨) */
|
||||
private static final BigDecimal FIXED_IDEAL_CYCLE = BigDecimal.valueOf(0.47);
|
||||
private final AcidOeeMapper acidOeeMapper;
|
||||
private final IKlptcm1ProStoppageService stoppageService;
|
||||
|
||||
@Value("${oee.acid.coil-create-by}")
|
||||
private String acidCreateName;
|
||||
private final ICoilQualityJudgeService coilQualityJudgeService;
|
||||
|
||||
@Override
|
||||
public List<AcidOeeDailySummaryVo> getDailySummary(String startDate, String endDate) {
|
||||
// 1. 查询基础日汇总(产量、停机时间等)
|
||||
List<AcidOeeDailySummaryVo> summaries = acidOeeMasterMapper.selectDailySummary(
|
||||
startDate,
|
||||
endDate,
|
||||
acidCreateName
|
||||
);
|
||||
List<AcidOeeDailySummaryVo> summaries = acidOeeMapper.selectDailySummary(startDate, endDate);
|
||||
|
||||
if (summaries == null || summaries.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 2. 查询停机事件,按日期聚合停机时间
|
||||
Map<String, Long> downtimeByDate = aggregateDowntimeByDate(startDate, endDate);
|
||||
|
||||
// 3. 查询产量明细,用于良品/次品判定
|
||||
Map<String, List<CoilInfo>> coilInfoByDate = getCoilNosByDate(startDate, endDate);
|
||||
|
||||
// 4. 先按天计算 dailyCycle = runTime/totalOutputTon,再取中位数作为理论节拍
|
||||
List<BigDecimal> dailyCycles = new ArrayList<>();
|
||||
// 4. 理论节拍:使用固定值0.47
|
||||
BigDecimal idealCycleTon = FIXED_IDEAL_CYCLE;
|
||||
|
||||
// 5. 填充每个日汇总的完整数据
|
||||
for (AcidOeeDailySummaryVo summary : summaries) {
|
||||
String statDate = summary.getStatDate();
|
||||
summary.setLineId("SY");
|
||||
summary.setLineName("酸轧线");
|
||||
|
||||
// 填充停机时间
|
||||
Long downtime = downtimeByDate.getOrDefault(statDate, 0L);
|
||||
summary.setDowntimeMin(downtime);
|
||||
|
||||
// 计算运转时间
|
||||
Long loadingTime = summary.getLoadingTimeMin() != null ? summary.getLoadingTimeMin() : 0L;
|
||||
Long runTime = Math.max(0, loadingTime - downtime);
|
||||
summary.setRunTimeMin(runTime);
|
||||
|
||||
BigDecimal totalOutputTon = summary.getTotalOutputTon();
|
||||
if (runTime > 0 && totalOutputTon != null && totalOutputTon.compareTo(BigDecimal.ZERO) > 0) {
|
||||
BigDecimal dailyCycle = BigDecimal.valueOf(runTime)
|
||||
.divide(totalOutputTon, 6, RoundingMode.HALF_UP);
|
||||
dailyCycles.add(dailyCycle);
|
||||
}
|
||||
}
|
||||
dailyCycles.sort(BigDecimal::compareTo);
|
||||
BigDecimal idealCycleTon = applyEightyPercent(median(dailyCycles));
|
||||
|
||||
// 5. 回填理论节拍、良品次品并计算派生指标
|
||||
for (AcidOeeDailySummaryVo summary : summaries) {
|
||||
String statDate = summary.getStatDate();
|
||||
if (idealCycleTon != null) {
|
||||
// 理论节拍:若尚未填充,则统一使用“优良日统计”得到的节拍
|
||||
if (summary.getIdealCycleTimeMinPerTon() == null && idealCycleTon != null) {
|
||||
summary.setIdealCycleTimeMinPerTon(idealCycleTon);
|
||||
}
|
||||
|
||||
@@ -105,19 +84,18 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
List<CoilInfo> coilInfos = coilInfoByDate.get(statDate);
|
||||
calculateQualityOutput(summary, coilInfos);
|
||||
} else {
|
||||
// 没有卷明细时,全部归待判级
|
||||
summary.setGoodOutputTon(BigDecimal.ZERO);
|
||||
summary.setGoodOutputCoil(0L);
|
||||
summary.setQualifiedOutputTon(BigDecimal.ZERO);
|
||||
summary.setQualifiedOutputCoil(0L);
|
||||
summary.setAbOutputTon(BigDecimal.ZERO);
|
||||
summary.setAbOutputCoil(0L);
|
||||
// 如果没有卷号,默认全部为良品(或根据业务规则处理)
|
||||
summary.setGoodOutputTon(summary.getTotalOutputTon());
|
||||
summary.setGoodOutputCoil(summary.getTotalOutputCoil());
|
||||
summary.setDefectOutputTon(BigDecimal.ZERO);
|
||||
summary.setDefectOutputCoil(0L);
|
||||
summary.setPendingOutputTon(summary.getTotalOutputTon());
|
||||
summary.setPendingOutputCoil(summary.getTotalOutputCoil());
|
||||
}
|
||||
|
||||
// 填充理论节拍(从回归数据或缓存获取,这里暂时留空,由调用方填充)
|
||||
// summary.setIdealCycleTimeMinPerTon(...);
|
||||
// summary.setIdealCycleTimeMinPerCoil(...);
|
||||
|
||||
// 计算派生指标
|
||||
calculateDerivedMetrics(summary);
|
||||
}
|
||||
|
||||
@@ -149,11 +127,7 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
@Override
|
||||
public AcidOeeIdealCycleVo getIdealCycle(String startDate, String endDate) {
|
||||
// 1) 取基础日汇总(产量、负荷时间等)
|
||||
List<AcidOeeDailySummaryVo> daily = acidOeeMasterMapper.selectDailySummary(
|
||||
startDate,
|
||||
endDate,
|
||||
acidCreateName
|
||||
);
|
||||
List<AcidOeeDailySummaryVo> daily = acidOeeMapper.selectDailySummary(startDate, endDate);
|
||||
AcidOeeIdealCycleVo rsp = new AcidOeeIdealCycleVo();
|
||||
rsp.setLineId("SY");
|
||||
rsp.setLineName("酸轧线");
|
||||
@@ -177,31 +151,23 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
d.setRunTimeMin(Math.max(0, loading - downtime));
|
||||
}
|
||||
|
||||
// 3) 理论节拍按“天维度”:每天(运转时间/总吨),再按日样本统计中位数用于展示
|
||||
List<BigDecimal> dailyCycles = new ArrayList<>();
|
||||
for (AcidOeeDailySummaryVo d : daily) {
|
||||
Long run = d.getRunTimeMin();
|
||||
BigDecimal ton = d.getTotalOutputTon();
|
||||
if (run == null || run <= 0 || ton == null || ton.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
continue;
|
||||
}
|
||||
dailyCycles.add(BigDecimal.valueOf(run).divide(ton, 6, RoundingMode.HALF_UP));
|
||||
}
|
||||
dailyCycles.sort(BigDecimal::compareTo);
|
||||
BigDecimal medianCycle = median(dailyCycles);
|
||||
|
||||
// 理论节拍:按“当天运转时间/当天总吨”逐日计算,接口返回前乘以80%
|
||||
BigDecimal idealCycle = applyEightyPercent(medianCycle);
|
||||
rsp.setIdealCycleTimeMinPerTon(idealCycle);
|
||||
// 展示字段保持为中位数
|
||||
// 3) 卷级节拍 = (END_DATE - START_DATE)/出口重量,计算中位数(用于展示,不用于OEE计算)
|
||||
List<BigDecimal> coilCycles = acidOeeMapper.selectCoilCycleMinPerTon(startDate, endDate);
|
||||
coilCycles.removeIf(c -> c == null || c.compareTo(BigDecimal.ZERO) <= 0);
|
||||
coilCycles.sort(BigDecimal::compareTo);
|
||||
BigDecimal medianCycle = median(coilCycles);
|
||||
|
||||
// 理论节拍使用固定值0.47(用于OEE计算)
|
||||
rsp.setIdealCycleTimeMinPerTon(FIXED_IDEAL_CYCLE);
|
||||
// 中位数理论节拍(用于展示)
|
||||
rsp.setMedianCycleTimeMinPerTon(medianCycle);
|
||||
// 样本天数:当前查询区间内有产量的自然日数量(与传入的日期范围一一对应)
|
||||
rsp.setSampleDays(daily.size());
|
||||
|
||||
// 4) 日粒度对比数据:理论耗时 vs 实际运转时间(用于前端展示"有效性")
|
||||
// 使用“中间50%样本平均理论节拍”计算理论耗时
|
||||
// 使用固定值0.47计算理论耗时
|
||||
List<AcidOeeIdealCycleVo.DailyComparePointVo> compare = new ArrayList<>();
|
||||
if (idealCycle != null) {
|
||||
if (FIXED_IDEAL_CYCLE != null) {
|
||||
for (AcidOeeDailySummaryVo d : daily) {
|
||||
BigDecimal ton = d.getTotalOutputTon();
|
||||
Long run = d.getRunTimeMin();
|
||||
@@ -209,7 +175,7 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
AcidOeeIdealCycleVo.DailyComparePointVo p = new AcidOeeIdealCycleVo.DailyComparePointVo();
|
||||
p.setStatDate(d.getStatDate());
|
||||
p.setActualRunTimeMin(run);
|
||||
p.setTheoreticalTimeMin(idealCycle.multiply(ton));
|
||||
p.setTheoreticalTimeMin(FIXED_IDEAL_CYCLE.multiply(ton));
|
||||
compare.add(p);
|
||||
}
|
||||
}
|
||||
@@ -304,25 +270,25 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
||||
|
||||
for (Klptcm1ProStoppageVo event : events) {
|
||||
if (event.getStartDate() == null || event.getDuration() == null || event.getDuration() <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Date eventStart = event.getStartDate();
|
||||
long durationSec = event.getDuration();
|
||||
long durationMin = (durationSec + 59) / 60; // 向上取整,避免丢失秒数
|
||||
|
||||
|
||||
// 计算停机结束时间
|
||||
cal.setTime(eventStart);
|
||||
cal.add(Calendar.SECOND, (int) durationSec);
|
||||
Date eventEnd = cal.getTime();
|
||||
|
||||
|
||||
// 如果停机事件在同一天,直接累加
|
||||
String startDateStr = dateFormat.format(eventStart);
|
||||
String endDateStr = dateFormat.format(eventEnd);
|
||||
|
||||
|
||||
if (startDateStr.equals(endDateStr)) {
|
||||
// 同一天,直接累加
|
||||
downtimeMap.merge(startDateStr, durationMin, Long::sum);
|
||||
@@ -334,23 +300,23 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
Date dayStart = cal.getTime();
|
||||
|
||||
|
||||
Date currentDayStart = dayStart;
|
||||
|
||||
|
||||
while (currentDayStart.before(eventEnd)) {
|
||||
cal.setTime(currentDayStart);
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
Date nextDayStart = cal.getTime();
|
||||
|
||||
|
||||
// 计算当前天的停机分钟数
|
||||
Date dayEnd = nextDayStart.before(eventEnd) ? nextDayStart : eventEnd;
|
||||
long dayMinutes = Math.max(0, (dayEnd.getTime() - Math.max(currentDayStart.getTime(), eventStart.getTime())) / (1000 * 60));
|
||||
|
||||
|
||||
if (dayMinutes > 0) {
|
||||
String dateKey = dateFormat.format(currentDayStart);
|
||||
downtimeMap.merge(dateKey, dayMinutes, Long::sum);
|
||||
}
|
||||
|
||||
|
||||
currentDayStart = nextDayStart;
|
||||
}
|
||||
}
|
||||
@@ -363,18 +329,13 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
* 获取每日的钢卷号和重量(用于良品/次品判定)
|
||||
*/
|
||||
private Map<String, List<CoilInfo>> getCoilNosByDate(String startDate, String endDate) {
|
||||
|
||||
List<AcidOeeCoilInfoByDateVo> coilInfoList = acidOeeMasterMapper.selectCoilInfoByDate(
|
||||
startDate,
|
||||
endDate,
|
||||
acidCreateName
|
||||
);
|
||||
List<AcidOeeMapper.CoilInfoByDate> coilInfoList = acidOeeMapper.selectCoilInfoByDate(startDate, endDate);
|
||||
Map<String, List<CoilInfo>> result = new HashMap<>();
|
||||
|
||||
for (AcidOeeCoilInfoByDateVo info : coilInfoList) {
|
||||
for (AcidOeeMapper.CoilInfoByDate info : coilInfoList) {
|
||||
String date = info.getStatDate();
|
||||
result.computeIfAbsent(date, k -> new ArrayList<>())
|
||||
.add(new CoilInfo(info.getCoilNo(), info.getWeight(), info.getQualityStatus()));
|
||||
.add(new CoilInfo(info.getCoilNo(), info.getWeight()));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -384,64 +345,50 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
* 卷号信息内部类
|
||||
*/
|
||||
private static class CoilInfo {
|
||||
final String coilNo;
|
||||
final BigDecimal weight;
|
||||
final String qualityStatus;
|
||||
|
||||
CoilInfo(String coilNo, BigDecimal weight, String qualityStatus) {
|
||||
CoilInfo(String coilNo, BigDecimal weight) {
|
||||
this.coilNo = coilNo;
|
||||
this.weight = weight;
|
||||
this.qualityStatus = qualityStatus;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算质量细分产量:A良品、B合格品、C/D次品、O待判级。
|
||||
* 计算良品/次品产量
|
||||
*/
|
||||
private void calculateQualityOutput(AcidOeeDailySummaryVo summary, List<CoilInfo> coilInfos) {
|
||||
BigDecimal aTon = BigDecimal.ZERO;
|
||||
long aCoil = 0L;
|
||||
BigDecimal bTon = BigDecimal.ZERO;
|
||||
long bCoil = 0L;
|
||||
BigDecimal cdTon = BigDecimal.ZERO;
|
||||
long cdCoil = 0L;
|
||||
BigDecimal oTon = BigDecimal.ZERO;
|
||||
long oCoil = 0L;
|
||||
BigDecimal goodTon = BigDecimal.ZERO;
|
||||
long goodCoil = 0L;
|
||||
BigDecimal defectTon = BigDecimal.ZERO;
|
||||
long defectCoil = 0L;
|
||||
|
||||
for (CoilInfo coilInfo : coilInfos) {
|
||||
String coilNo = coilInfo.coilNo;
|
||||
BigDecimal coilWeight = coilInfo.weight != null ? coilInfo.weight : BigDecimal.ZERO;
|
||||
String qualityStatus = StringUtils.upperCase(StringUtils.trim(coilInfo.qualityStatus));
|
||||
|
||||
if (StringUtils.isBlank(qualityStatus) || "O".equals(qualityStatus)) {
|
||||
oTon = oTon.add(coilWeight);
|
||||
oCoil++;
|
||||
// 通过WMS判定良品/次品
|
||||
Boolean isScrap = coilQualityJudgeService.isScrap(ACID_FINISHED_WAREHOUSE_ID, coilNo);
|
||||
if (isScrap == null) {
|
||||
// 匹配不到,忽略不计
|
||||
continue;
|
||||
}
|
||||
|
||||
if (qualityStatus.startsWith("A")) {
|
||||
aTon = aTon.add(coilWeight);
|
||||
aCoil++;
|
||||
} else if (qualityStatus.startsWith("B")) {
|
||||
bTon = bTon.add(coilWeight);
|
||||
bCoil++;
|
||||
} else if (CD_SERIES.contains(qualityStatus)) {
|
||||
cdTon = cdTon.add(coilWeight);
|
||||
cdCoil++;
|
||||
if (Boolean.TRUE.equals(isScrap)) {
|
||||
// 次品
|
||||
defectTon = defectTon.add(coilWeight);
|
||||
defectCoil++;
|
||||
} else {
|
||||
// 未识别等级统一归待判级
|
||||
oTon = oTon.add(coilWeight);
|
||||
oCoil++;
|
||||
// 良品
|
||||
goodTon = goodTon.add(coilWeight);
|
||||
goodCoil++;
|
||||
}
|
||||
}
|
||||
|
||||
summary.setGoodOutputTon(aTon);
|
||||
summary.setGoodOutputCoil(aCoil);
|
||||
summary.setQualifiedOutputTon(bTon);
|
||||
summary.setQualifiedOutputCoil(bCoil);
|
||||
summary.setAbOutputTon(aTon.add(bTon));
|
||||
summary.setAbOutputCoil(aCoil + bCoil);
|
||||
summary.setDefectOutputTon(cdTon);
|
||||
summary.setDefectOutputCoil(cdCoil);
|
||||
summary.setPendingOutputTon(oTon);
|
||||
summary.setPendingOutputCoil(oCoil);
|
||||
summary.setGoodOutputTon(goodTon);
|
||||
summary.setGoodOutputCoil(goodCoil);
|
||||
summary.setDefectOutputTon(defectTon);
|
||||
summary.setDefectOutputCoil(defectCoil);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -459,7 +406,6 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
}
|
||||
|
||||
// 性能稼动率(吨维度)
|
||||
// 口径:理论节拍单位为 min/吨 时,性能稼动率 = (理论节拍 × 实际产量) / 实际运转时间 × 100
|
||||
Long runTime = summary.getRunTimeMin() != null ? summary.getRunTimeMin() : 0L;
|
||||
BigDecimal idealCycleTon = summary.getIdealCycleTimeMinPerTon();
|
||||
BigDecimal totalOutputTon = summary.getTotalOutputTon();
|
||||
@@ -469,14 +415,12 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
&& totalOutputTon != null
|
||||
&& totalOutputTon.compareTo(BigDecimal.ZERO) > 0) {
|
||||
BigDecimal idealTime = idealCycleTon.multiply(totalOutputTon);
|
||||
BigDecimal performanceTon = idealTime
|
||||
.divide(BigDecimal.valueOf(runTime), 4, RoundingMode.HALF_UP)
|
||||
BigDecimal performanceTon = idealTime.divide(BigDecimal.valueOf(runTime), 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setPerformanceTon(performanceTon);
|
||||
}
|
||||
|
||||
// 性能稼动率(卷维度)
|
||||
// 口径:理论节拍单位为 min/卷 时,性能稼动率 = (理论节拍 × 实际产量) / 实际运转时间 × 100
|
||||
Long totalOutputCoil = summary.getTotalOutputCoil() != null ? summary.getTotalOutputCoil() : 0L;
|
||||
BigDecimal idealCycleCoil = summary.getIdealCycleTimeMinPerCoil();
|
||||
if (runTime > 0
|
||||
@@ -484,35 +428,17 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
&& idealCycleCoil.compareTo(BigDecimal.ZERO) > 0
|
||||
&& totalOutputCoil > 0) {
|
||||
BigDecimal idealTime = idealCycleCoil.multiply(BigDecimal.valueOf(totalOutputCoil));
|
||||
BigDecimal performanceCoil = idealTime
|
||||
.divide(BigDecimal.valueOf(runTime), 4, RoundingMode.HALF_UP)
|
||||
BigDecimal performanceCoil = idealTime.divide(BigDecimal.valueOf(runTime), 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setPerformanceCoil(performanceCoil);
|
||||
}
|
||||
|
||||
// 质量细分比率
|
||||
// 良品率
|
||||
if (totalOutputTon != null && totalOutputTon.compareTo(BigDecimal.ZERO) > 0) {
|
||||
BigDecimal aTon = summary.getGoodOutputTon() != null ? summary.getGoodOutputTon() : BigDecimal.ZERO;
|
||||
BigDecimal bTon = summary.getQualifiedOutputTon() != null ? summary.getQualifiedOutputTon() : BigDecimal.ZERO;
|
||||
BigDecimal cdTon = summary.getDefectOutputTon() != null ? summary.getDefectOutputTon() : BigDecimal.ZERO;
|
||||
BigDecimal oTon = summary.getPendingOutputTon() != null ? summary.getPendingOutputTon() : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal quality = aTon.divide(totalOutputTon, 4, RoundingMode.HALF_UP)
|
||||
BigDecimal goodOutputTon = summary.getGoodOutputTon() != null ? summary.getGoodOutputTon() : BigDecimal.ZERO;
|
||||
BigDecimal quality = goodOutputTon.divide(totalOutputTon, 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setQuality(quality);
|
||||
|
||||
BigDecimal qualifiedRate = aTon.add(bTon)
|
||||
.divide(totalOutputTon, 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setQualifiedRate(qualifiedRate);
|
||||
|
||||
BigDecimal defectRate = cdTon.divide(totalOutputTon, 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setDefectRate(defectRate);
|
||||
|
||||
BigDecimal pendingRate = oTon.divide(totalOutputTon, 4, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100));
|
||||
summary.setPendingRate(pendingRate);
|
||||
}
|
||||
|
||||
// OEE(以吨维度为主)
|
||||
@@ -537,15 +463,6 @@ public class AcidOeeServiceImpl implements IAcidOeeService {
|
||||
return a.add(b).divide(BigDecimal.valueOf(2), 6, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
/** 理论节拍返回前按业务口径乘以70% */
|
||||
private BigDecimal applyEightyPercent(BigDecimal cycle) {
|
||||
if (cycle == null) {
|
||||
return null;
|
||||
}
|
||||
return cycle.multiply(BigDecimal.valueOf(0.7)).setScale(6, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析日期字符串为Date对象
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@ public class CrmPdiPlan {
|
||||
|
||||
private Integer seqid;
|
||||
private String coilid;
|
||||
private String enterCoilNo;
|
||||
private Integer dummyCoilFlag;
|
||||
private String status;
|
||||
private String planid;
|
||||
|
||||
@@ -19,7 +19,6 @@ public class CrmPdoExcoil {
|
||||
|
||||
private String exitMatId;
|
||||
private String entryMatId;
|
||||
private String enterCoilNo;
|
||||
private Integer subId;
|
||||
private Double startPosition;
|
||||
private Double endPosition;
|
||||
|
||||
@@ -15,7 +15,6 @@ public class CrmPdiPlanBo extends BaseEntity {
|
||||
|
||||
private Integer seqid;
|
||||
private String coilid;
|
||||
private String enterCoilNo;
|
||||
private Integer dummyCoilFlag;
|
||||
private String status;
|
||||
private String planid;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user