Compare commits
215 Commits
fb0dfb0d76
...
0.8.X
| Author | SHA1 | Date | |
|---|---|---|---|
| cdcf5e2428 | |||
| deb684ce27 | |||
| 3f300e05e9 | |||
| af002b84d3 | |||
| 143764f7f8 | |||
| 0822ca7cc8 | |||
| 5b452bad31 | |||
| 4f259c5aba | |||
| 34dd8004c4 | |||
| 254dada485 | |||
| ee2bb280b6 | |||
| 96082b9124 | |||
| ddb1beb629 | |||
| 67cf5aa7cb | |||
| e1cc0fda34 | |||
| 4e5e1bbca1 | |||
| 2e363f9ad8 | |||
| f158830abf | |||
| 843512ab7e | |||
| dd27069b4c | |||
| b95bd5b93d | |||
| 4d588985e8 | |||
| 3ad3fd2fee | |||
| 79ee9d572d | |||
| c9742b08cf | |||
| 6bd5d2ded3 | |||
| da1813e65a | |||
| 8dbb7d1113 | |||
| ae77c529ae | |||
| edcbf7a5f1 | |||
| 28622a2b16 | |||
| 44303cb1c7 | |||
| c0f7c699a8 | |||
| e69dc5e76e | |||
| ec0660acba | |||
| 110597657e | |||
| 50670b64d8 | |||
|
|
823afd7a00 | ||
|
|
344488f08e | ||
| c2da7640c3 | |||
| e99d7709d2 | |||
| 623e78629d | |||
| c1938e29a4 | |||
| 54d426984b | |||
|
|
440e70ee82 | ||
|
|
220a24da78 | ||
| c31dc4948e | |||
| 7b55f358b4 | |||
| 2fcc7b3279 | |||
|
|
8e5ce5c119 | ||
|
|
ee275d3ea5 | ||
|
|
5e80208d61 | ||
| 05f0933514 | |||
| ec5da2a7ca | |||
| 7d6957165d | |||
| 31648431c8 | |||
|
|
36ff376c55 | ||
|
|
f68167b102 | ||
| 671a7e129f | |||
| 84a0cb43ee | |||
|
|
d15f57ae6d | ||
|
|
b32f826488 | ||
|
|
a99126a9a3 | ||
| 6e5b9fc962 | |||
| c9a93fe942 | |||
|
|
5f5e5cacb4 | ||
|
|
263c2b5f37 | ||
| 910ec2b22f | |||
| a62ef2d0b0 | |||
| 31d44c19ca | |||
| fea3c78c4f | |||
|
|
8de4042bdf | ||
|
|
54bea01416 | ||
|
|
9f3d402174 | ||
| c3d6d7cece | |||
|
|
37dc213605 | ||
|
|
5ee730bffa | ||
|
|
116d79e7c2 | ||
|
|
4c373e6af5 | ||
|
|
4beaf79fd6 | ||
| b4dc0ed9e4 | |||
| 5efdcf99dc | |||
|
|
3020a4244d | ||
| 848ad2c3cd | |||
| 57b07885e3 | |||
|
|
466ac13742 | ||
|
|
8e2069cecf | ||
| 92441e569e | |||
| 509c41a4d4 | |||
|
|
ec0fa3966a | ||
|
|
9b52621df1 | ||
| c323ef7a52 | |||
| 1bbd3a6f4d | |||
| c8987f6fdd | |||
|
|
a19c4e4eaf | ||
|
|
255a6dc616 | ||
|
|
0e075fe5d4 | ||
| 731dd21b0e | |||
| 39d73c0f2c | |||
|
|
b232cbf14d | ||
|
|
7930991eb8 | ||
|
|
9c83c9d9a5 | ||
| cd5bca19f6 | |||
| 9adbc1ea0c | |||
| f92d5c16e0 | |||
|
|
9bd63d90fc | ||
|
|
6b0fa81224 | ||
| dc2624ece1 | |||
| b58a14bc87 | |||
|
|
c68a4573dc | ||
|
|
7e487a487d | ||
|
|
6b9c05d5ee | ||
|
|
43f28a4225 | ||
| 60d10c03a6 | |||
| f9a60cec99 | |||
|
|
1bfd3a598a | ||
|
|
505f821df0 | ||
|
|
dc92939262 | ||
| e32739cb09 | |||
|
|
ab9ab90ffa | ||
|
|
38f980dbbf | ||
|
|
3d27e14620 | ||
| d67054d891 | |||
| b399587841 | |||
|
|
04081ab0ae | ||
|
|
1fa4c55869 | ||
| 4075ead84e | |||
| 031d7ba708 | |||
| e82d015cea | |||
| 82c801cf9c | |||
|
|
3f86f0be38 | ||
|
|
31d79a6c53 | ||
|
|
ba3d2c2b35 | ||
|
|
c4c9641901 | ||
|
|
b9385858f3 | ||
|
|
b9da0d6d76 | ||
| 0d4d7f4235 | |||
| 47198a0d01 | |||
|
|
e6d63ef4f7 | ||
|
|
e673dcbaeb | ||
|
|
74eae50ab0 | ||
|
|
5ec293fc94 | ||
|
|
d31bd14692 | ||
| 821af42976 | |||
|
|
579bf3796f | ||
|
|
f959f97099 | ||
|
|
800cf0c8d1 | ||
|
|
0223102269 | ||
|
|
abcc644f74 | ||
|
|
62444ef743 | ||
|
|
a253d1ccea | ||
|
|
aca10bcd45 | ||
| b7d8463198 | |||
|
|
4617328b8e | ||
|
|
070b0aea8d | ||
| 6835a35c02 | |||
| 02469383f4 | |||
| 15a3f843f1 | |||
| 8a5f2bc4df | |||
| ca176de4ef | |||
| d26bdb38ca | |||
| 2dff94c3bd | |||
|
|
bb9252e3a2 | ||
|
|
aacf433462 | ||
| e553bfcb22 | |||
| cb9998e0c4 | |||
| 15058727d0 | |||
| ab7af2ade8 | |||
|
|
9cf0d289c3 | ||
|
|
4988630db9 | ||
| cdf49ab8fe | |||
|
|
a43cedc00f | ||
|
|
667c411997 | ||
|
|
05fb0358a2 | ||
| e767502d7b | |||
| 112cdce0d0 | |||
|
|
49427608ad | ||
|
|
97cb78bbbe | ||
| 086d01fa3f | |||
| c3f2f5ef83 | |||
|
|
8d6c3302a3 | ||
|
|
97cc86c6c4 | ||
| f3d5e1f0bf | |||
|
|
499654907b | ||
| 00939dae2f | |||
| 6e23e932da | |||
| c554508000 | |||
| 317b7187f5 | |||
| d28f50ba65 | |||
| 862efcfabd | |||
| d51b555fa2 | |||
|
|
f685ea4cea | ||
|
|
9c2d8cfb4a | ||
| ba722e0439 | |||
|
|
bc00846f14 | ||
| 1c9a59636a | |||
| b842f267cc | |||
| 5be8f2857e | |||
| 62eb5aedfb | |||
|
|
cd00b9562d | ||
| c294149274 | |||
| 0d3bde95f3 | |||
| 15a2920053 | |||
|
|
ab3914811a | ||
|
|
19b48d711a | ||
|
|
1e6be8cd76 | ||
| 2041cb3e5d | |||
| d4b5f09882 | |||
| 278cb24d54 | |||
| 1b9787f983 | |||
| 0f760e90b5 | |||
|
|
5d3cbde044 | ||
|
|
a389a98664 | ||
| 38862cf0ea | |||
| 281f86ca8c |
@@ -0,0 +1,99 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
230
klp-aps/src/main/java/com/klp/aps/domain/bo/ApsPlanDetailBo.java
Normal file
230
klp-aps/src/main/java/com/klp/aps/domain/bo/ApsPlanDetailBo.java
Normal file
@@ -0,0 +1,230 @@
|
||||
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 java.util.List;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 关联排产单ID列表(用于批量查询)
|
||||
*/
|
||||
private List<Long> planSheetIds;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
}
|
||||
271
klp-aps/src/main/java/com/klp/aps/domain/vo/ApsPlanDetailVo.java
Normal file
271
klp-aps/src/main/java/com/klp/aps/domain/vo/ApsPlanDetailVo.java
Normal file
@@ -0,0 +1,271 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
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> selectListByReq(ApsPlanSheetQueryReq req);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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);
|
||||
|
||||
/**
|
||||
* 根据排产单ID列表查询明细
|
||||
*/
|
||||
List<ApsPlanDetailVo> queryListByPlanSheetIds(List<Long> planSheetIds);
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
Boolean updateByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除排产单明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据排产单ID删除明细
|
||||
*/
|
||||
int deleteByPlanSheetIds(Collection<Long> planSheetIds);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据排产单ID列表查询明细
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanDetailVo> queryListByPlanSheetIds(List<Long> planSheetIds) {
|
||||
if (planSheetIds == null || planSheetIds.isEmpty()) {
|
||||
return new java.util.ArrayList<>();
|
||||
}
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(ApsPlanDetail::getPlanSheetId, planSheetIds);
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
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.selectListByReq(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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?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>
|
||||
77
klp-aps/src/main/resources/mapper/aps/ApsPlanSheetMapper.xml
Normal file
77
klp-aps/src/main/resources/mapper/aps/ApsPlanSheetMapper.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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="selectListByReq" 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>
|
||||
@@ -12,7 +12,7 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
@@ -43,5 +43,9 @@
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-wms</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-aps</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
@@ -21,6 +26,10 @@ import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderBo;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 正式订单主
|
||||
@@ -35,6 +44,8 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
public class CrmOrderController extends BaseController {
|
||||
|
||||
private final ICrmOrderService iCrmOrderService;
|
||||
private final IApsPlanSheetService iApsPlanSheetService;
|
||||
private final IApsPlanDetailService iApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
@@ -96,4 +107,54 @@ public class CrmOrderController extends BaseController {
|
||||
@PathVariable String[] orderIds) {
|
||||
return toAjax(iCrmOrderService.deleteWithValidByIds(Arrays.asList(orderIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询每日订单(根据排产计划获取今天的订单)
|
||||
*
|
||||
* @param planDate 排产日期,默认今天
|
||||
*/
|
||||
@GetMapping("/daily")
|
||||
public R<List<CrmOrderVo>> getDailyOrders(
|
||||
@RequestParam(value = "planDate", required = false)
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date planDate) {
|
||||
if (planDate == null) {
|
||||
planDate = new Date();
|
||||
}
|
||||
// 将日期设置为当天的开始时间 00:00:00
|
||||
java.util.Calendar calendar = java.util.Calendar.getInstance();
|
||||
calendar.setTime(planDate);
|
||||
calendar.set(java.util.Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(java.util.Calendar.MINUTE, 0);
|
||||
calendar.set(java.util.Calendar.SECOND, 0);
|
||||
calendar.set(java.util.Calendar.MILLISECOND, 0);
|
||||
planDate = calendar.getTime();
|
||||
|
||||
ApsPlanSheetBo bo = new ApsPlanSheetBo();
|
||||
bo.setPlanDate(planDate);
|
||||
List<ApsPlanSheetVo> planSheetList = iApsPlanSheetService.queryList(bo);
|
||||
if (planSheetList == null || planSheetList.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<Long> planSheetIds = new ArrayList<>();
|
||||
for (ApsPlanSheetVo sheet : planSheetList) {
|
||||
planSheetIds.add(sheet.getPlanSheetId());
|
||||
}
|
||||
ApsPlanDetailBo detailBo = new ApsPlanDetailBo();
|
||||
detailBo.setPlanSheetIds(planSheetIds);
|
||||
List<ApsPlanDetailVo> detailList = iApsPlanDetailService.queryListByPlanSheetIds(planSheetIds);
|
||||
if (detailList == null || detailList.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<Long> orderIds = new ArrayList<>();
|
||||
for (ApsPlanDetailVo detail : detailList) {
|
||||
if (detail.getOrderId() != null) {
|
||||
orderIds.add(detail.getOrderId());
|
||||
}
|
||||
}
|
||||
if (orderIds.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<CrmOrderVo> orders = iCrmOrderService.queryByIds(orderIds);
|
||||
return R.ok(orders);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,10 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -96,4 +98,38 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
135
klp-crm/src/main/java/com/klp/crm/domain/CrmContract.java
Normal file
135
klp-crm/src/main/java/com/klp/crm/domain/CrmContract.java
Normal file
@@ -0,0 +1,135 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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,6 +56,10 @@ 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 String orderId;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@@ -85,6 +85,141 @@ 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 String itemId;
|
||||
private Long itemId;
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@@ -69,6 +69,14 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
private BigDecimal widthTolerance;
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
private BigDecimal thicknessTolerance;
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -85,10 +93,34 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 排产批次
|
||||
*/
|
||||
private String productionBatch;
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
161
klp-crm/src/main/java/com/klp/crm/domain/bo/CrmContractBo.java
Normal file
161
klp-crm/src/main/java/com/klp/crm/domain/bo/CrmContractBo.java
Normal file
@@ -0,0 +1,161 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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,10 +62,20 @@ public class CrmCustomerBo extends BaseEntity {
|
||||
*/
|
||||
private String bankInfo;
|
||||
|
||||
/**
|
||||
* 纳税人识别号/税号
|
||||
*/
|
||||
private String taxNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*/
|
||||
private String keyword;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ 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
|
||||
@@ -23,7 +24,7 @@ public class CrmOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 订单ID(主键)
|
||||
*/
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
@@ -53,6 +54,8 @@ public class CrmOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/**
|
||||
@@ -95,5 +98,147 @@ 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 String itemId;
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品类型
|
||||
@@ -57,7 +57,7 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 成品规格
|
||||
*/
|
||||
@@ -78,6 +78,16 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
private BigDecimal widthTolerance;
|
||||
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
private BigDecimal thicknessTolerance;
|
||||
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -98,5 +108,34 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
*/
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
|
||||
}
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
180
klp-crm/src/main/java/com/klp/crm/domain/vo/CrmContractVo.java
Normal file
180
klp-crm/src/main/java/com/klp/crm/domain/vo/CrmContractVo.java
Normal file
@@ -0,0 +1,180 @@
|
||||
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,6 +78,12 @@ 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 String itemId;
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 关联正式订单ID(外键)
|
||||
*/
|
||||
@ExcelProperty(value = "关联正式订单ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "外=键")
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品类型
|
||||
@@ -95,6 +95,18 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 宽度公差
|
||||
*/
|
||||
@ExcelProperty(value = "宽度公差")
|
||||
private BigDecimal widthTolerance;
|
||||
|
||||
/**
|
||||
* 厚度公差
|
||||
*/
|
||||
@ExcelProperty(value = "厚度公差")
|
||||
private BigDecimal thicknessTolerance;
|
||||
|
||||
/**
|
||||
* 合同定价
|
||||
*/
|
||||
@@ -119,5 +131,40 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "排产批次")
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
}
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "切边要求")
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ExcelProperty(value = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
@ExcelProperty(value = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@ExcelProperty(value = "用途")
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.klp.crm.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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 com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -28,7 +31,7 @@ public class CrmOrderVo extends BaseEntity {
|
||||
*/
|
||||
@ExcelProperty(value = "订单ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "主=键")
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
@@ -114,6 +117,168 @@ 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;
|
||||
@@ -130,4 +295,8 @@ public class CrmOrderVo extends BaseEntity {
|
||||
private String createByName;
|
||||
//更新人
|
||||
private String updateByName;
|
||||
/**
|
||||
* 关联的钢卷列表
|
||||
*/
|
||||
private List<WmsMaterialCoilVo> coilList;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class CrmSalesReportVo {
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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<String> orderIds);
|
||||
List<CrmOrderItem> selectOrderItemsByOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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,6 +9,10 @@ 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接口
|
||||
*
|
||||
@@ -46,4 +50,29 @@ 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);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,11 @@ public interface ICrmOrderService {
|
||||
*/
|
||||
CrmOrderVo queryById(String orderId);
|
||||
|
||||
/**
|
||||
* 根据ID列表查询正式订单
|
||||
*/
|
||||
List<CrmOrderVo> queryByIds(List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
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,14 +61,27 @@ 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.eq(StringUtils.isNotBlank(bo.getContactPerson()), CrmCustomer::getContactPerson, bo.getContactPerson());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactWay()), CrmCustomer::getContactWay, bo.getContactWay());
|
||||
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.getIndustry()), CrmCustomer::getIndustry, bo.getIndustry());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerLevel()), CrmCustomer::getCustomerLevel, bo.getCustomerLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAddress()), CrmCustomer::getAddress, bo.getAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBankInfo()), CrmCustomer::getBankInfo, bo.getBankInfo());
|
||||
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());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,17 +7,35 @@ 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.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 正式订单明细Service业务层处理
|
||||
@@ -30,12 +48,18 @@ import java.util.Collection;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -61,7 +85,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(StringUtils.isNotBlank(bo.getOrderId()), CrmOrderItem::getOrderId, bo.getOrderId());
|
||||
lqw.eq(bo.getOrderId() != null, 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());
|
||||
@@ -71,10 +95,18 @@ 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());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductionBatch()), CrmOrderItem::getProductionBatch, bo.getProductionBatch());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), CrmOrderItem::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEdgeCuttingReq()), CrmOrderItem::getEdgeCuttingReq, bo.getEdgeCuttingReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPackagingReq()), CrmOrderItem::getPackagingReq, bo.getPackagingReq());
|
||||
lqw.eq(bo.getWidth() != null, CrmOrderItem::getWidth, bo.getWidth());
|
||||
lqw.eq(bo.getThickness() != null, CrmOrderItem::getThickness, bo.getThickness());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPurpose()), CrmOrderItem::getPurpose, bo.getPurpose());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -106,7 +138,7 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmOrderItem entity){
|
||||
private void validEntityBeforeSave(CrmOrderItem entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@@ -115,9 +147,198 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ 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.vo.CrmOrderOperationTraceVo;
|
||||
import com.klp.mapper.WmsCoilContractRelMapper;
|
||||
import com.klp.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -17,6 +18,11 @@ import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.CrmOrder;
|
||||
import com.klp.crm.mapper.CrmOrderMapper;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
import com.klp.domain.WmsCoilContractRel;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.service.IWmsCoilContractRelService;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -35,6 +41,10 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
private final WmsCoilContractRelMapper coilContractRelMapper;
|
||||
|
||||
private final IWmsMaterialCoilService materialCoilService;
|
||||
|
||||
/**
|
||||
* 查询正式订单主
|
||||
*/
|
||||
@@ -43,6 +53,19 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
return baseMapper.selectVoById(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID列表查询正式订单
|
||||
*/
|
||||
@Override
|
||||
public List<CrmOrderVo> queryByIds(List<Long> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LambdaQueryWrapper<CrmOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(CrmOrder::getOrderId, orderIds);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
@@ -76,12 +99,75 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询订单关联的钢卷ID列表
|
||||
List<Long> contractIds = records.stream()
|
||||
.map(CrmOrderVo::getOrderId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!contractIds.isEmpty()) {
|
||||
// 批量查询钢卷与合同关联关系
|
||||
LambdaQueryWrapper<WmsCoilContractRel> coilQw = Wrappers.lambdaQuery();
|
||||
coilQw.in(WmsCoilContractRel::getContractId, contractIds);
|
||||
coilQw.eq(WmsCoilContractRel::getDelFlag, 0);
|
||||
List<WmsCoilContractRel> coilRels = coilContractRelMapper.selectList(coilQw);
|
||||
|
||||
// 按contractId分组,收集coilId列表
|
||||
Map<Long, List<Long>> coilIdMap = coilRels.stream()
|
||||
.filter(rel -> rel.getContractId() != null && rel.getCoilId() != null)
|
||||
.collect(Collectors.groupingBy(
|
||||
WmsCoilContractRel::getContractId,
|
||||
Collectors.mapping(WmsCoilContractRel::getCoilId, Collectors.toList())
|
||||
));
|
||||
|
||||
// 查询所有相关钢卷的详细信息
|
||||
Set<Long> allCoilIds = coilIdMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<Long, WmsMaterialCoilVo> coilVoMap = Collections.emptyMap();
|
||||
if (!allCoilIds.isEmpty()) {
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(allCoilIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
List<WmsMaterialCoilVo> allCoils = materialCoilService.queryList(coilBo);
|
||||
coilVoMap = allCoils.stream()
|
||||
.collect(Collectors.toMap(WmsMaterialCoilVo::getCoilId, c -> c, (a, b) -> a));
|
||||
}
|
||||
|
||||
// 设置到每个订单的coilIds和coilList字段
|
||||
for (CrmOrderVo vo : records) {
|
||||
if (vo.getOrderId() != null && coilIdMap.containsKey(vo.getOrderId())) {
|
||||
List<Long> coilIdList = coilIdMap.get(vo.getOrderId());
|
||||
// 设置coilList(钢卷详细信息列表)
|
||||
List<WmsMaterialCoilVo> coilList = coilIdList.stream()
|
||||
.map(coilVoMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
vo.setCoilList(coilList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -95,6 +181,33 @@ 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排在后面 升序
|
||||
@@ -128,6 +241,33 @@ 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<String> orderIds = orderDetails.stream()
|
||||
List<Long> 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<String, List<CrmOrderItem>> orderItemMap = orderItems.stream()
|
||||
Map<Long, List<CrmOrderItem>> orderItemMap = orderItems.stream()
|
||||
.collect(Collectors.groupingBy(CrmOrderItem::getOrderId));
|
||||
|
||||
// 为每个订单设置对应的明细列表
|
||||
|
||||
42
klp-crm/src/main/resources/mapper/CrmContractMapper.xml
Normal file
42
klp-crm/src/main/resources/mapper/CrmContractMapper.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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,6 +14,7 @@ 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,10 +17,18 @@ 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"/>
|
||||
<result property="productionBatch" column="production_batch"/>
|
||||
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||
<result property="edgeCuttingReq" column="edge_cutting_req"/>
|
||||
<result property="packagingReq" column="packaging_req"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="purpose" column="purpose"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -42,10 +50,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
material,
|
||||
grade,
|
||||
weight,
|
||||
width_tolerance,
|
||||
thickness_tolerance,
|
||||
contract_price,
|
||||
customizer,
|
||||
shipper,
|
||||
production_batch,
|
||||
surface_treatment,
|
||||
edge_cutting_req,
|
||||
packaging_req,
|
||||
width,
|
||||
thickness,
|
||||
purpose,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
|
||||
@@ -20,6 +20,33 @@ 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"/>
|
||||
@@ -43,6 +70,33 @@ 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,
|
||||
@@ -75,6 +129,33 @@ 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,
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
"@babel/parser": "7.7.4",
|
||||
"@jiaminghi/data-view": "^2.10.0",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"@vue-office/docx": "^1.6.3",
|
||||
"@vue-office/excel": "^1.7.14",
|
||||
"@vue/composition-api": "^1.7.2",
|
||||
"axios": "0.24.0",
|
||||
"bpmn-js-token-simulation": "0.10.0",
|
||||
"clipboard": "2.0.8",
|
||||
@@ -74,12 +77,15 @@
|
||||
"vue": "2.6.12",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-cropper": "0.5.5",
|
||||
"vue-demi": "^0.14.10",
|
||||
"vue-flv-player": "^1.0.3",
|
||||
"vue-konva": "^2.1.7",
|
||||
"vue-meta": "2.4.0",
|
||||
"vue-router": "3.4.9",
|
||||
"vuedraggable": "2.24.3",
|
||||
"vuex": "3.6.0",
|
||||
"vxe-table": "^2.11.0",
|
||||
"xe-utils": "^3.5.31",
|
||||
"xlsx": "^0.18.5",
|
||||
"xml-js": "1.6.11"
|
||||
},
|
||||
|
||||
44
klp-ui/src/api/aps/planDetail.js
Normal file
44
klp-ui/src/api/aps/planDetail.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询排产单明细列表
|
||||
export function listPlanDetail(query) {
|
||||
return request({
|
||||
url: '/aps/planDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询排产单明细详细
|
||||
export function getPlanDetail(planDetailId) {
|
||||
return request({
|
||||
url: '/aps/planDetail/' + planDetailId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增排产单明细
|
||||
export function addPlanDetail(data) {
|
||||
return request({
|
||||
url: '/aps/planDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改排产单明细
|
||||
export function updatePlanDetail(data) {
|
||||
return request({
|
||||
url: '/aps/planDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除排产单明细
|
||||
export function delPlanDetail(planDetailId) {
|
||||
return request({
|
||||
url: '/aps/planDetail/' + planDetailId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/aps/planSheet.js
Normal file
44
klp-ui/src/api/aps/planSheet.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询排产单主列表
|
||||
export function listPlanSheet(query) {
|
||||
return request({
|
||||
url: '/aps/planSheet/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询排产单主详细
|
||||
export function getPlanSheet(planSheetId) {
|
||||
return request({
|
||||
url: '/aps/planSheet/' + planSheetId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增排产单主
|
||||
export function addPlanSheet(data) {
|
||||
return request({
|
||||
url: '/aps/planSheet',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改排产单主
|
||||
export function updatePlanSheet(data) {
|
||||
return request({
|
||||
url: '/aps/planSheet',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除排产单主
|
||||
export function delPlanSheet(planSheetId) {
|
||||
return request({
|
||||
url: '/aps/planSheet/' + planSheetId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
62
klp-ui/src/api/crm/contract.js
Normal file
62
klp-ui/src/api/crm/contract.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询合同信息列表
|
||||
export function listContract(query) {
|
||||
return request({
|
||||
url: '/crm/contract/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询合同信息详细
|
||||
export function getContract(contractId) {
|
||||
return request({
|
||||
url: '/crm/contract/' + contractId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增合同信息
|
||||
export function addContract(data) {
|
||||
return request({
|
||||
url: '/crm/contract',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改合同信息
|
||||
export function updateContract(data) {
|
||||
return request({
|
||||
url: '/crm/contract',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除合同信息
|
||||
export function delContract(contractId) {
|
||||
return request({
|
||||
url: '/crm/contract/' + contractId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询合同下的所有订单异议和收款记录
|
||||
export function listContractOrderObjection(contractId) {
|
||||
return request({
|
||||
url: '/crm/orderItem/contractFinance/' + contractId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询该合同下的配卷情况
|
||||
*/
|
||||
export function listContractPackaging(contractId) {
|
||||
return request({
|
||||
url: '/crm/orderItem/coils/contract/' + contractId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/crm/contractProduct.js
Normal file
44
klp-ui/src/api/crm/contractProduct.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询合同产品明细列表
|
||||
export function listContractProduct(query) {
|
||||
return request({
|
||||
url: '/crm/contractProduct/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询合同产品明细详细
|
||||
export function getContractProduct(contractProductId) {
|
||||
return request({
|
||||
url: '/crm/contractProduct/' + contractProductId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增合同产品明细
|
||||
export function addContractProduct(data) {
|
||||
return request({
|
||||
url: '/crm/contractProduct',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改合同产品明细
|
||||
export function updateContractProduct(data) {
|
||||
return request({
|
||||
url: '/crm/contractProduct',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除合同产品明细
|
||||
export function delContractProduct(contractProductId) {
|
||||
return request({
|
||||
url: '/crm/contractProduct/' + contractProductId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,19 @@ export function delCustomer(customerId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询该客户相关的配卷情况
|
||||
export function listCoilByCustomerId(customerId) {
|
||||
return request({
|
||||
url: '/crm/orderItem/coils/customer/' + customerId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询该项目相关的订单异议和财务信息
|
||||
export function listFinanceByCustomerId(customerId) {
|
||||
return request({
|
||||
url: '/crm/orderItem/customerFinance/' + customerId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,24 @@ export function delOrder(orderId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询该订单下的所有配卷
|
||||
*/
|
||||
export function listOrderPackaging(orderId) {
|
||||
return request({
|
||||
url: `/crm/orderItem/coils/order/${orderId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询今日订单
|
||||
*/
|
||||
export function listTodayOrder(query) {
|
||||
return request({
|
||||
url: '/crm/order/daily',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
44
klp-ui/src/api/wms/annealOperateEvent.js
Normal file
44
klp-ui/src/api/wms/annealOperateEvent.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询退火操作事件列表
|
||||
export function listAnnealOperateEvent(query) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询退火操作事件详细
|
||||
export function getAnnealOperateEvent(eventId) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/' + eventId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增退火操作事件
|
||||
export function addAnnealOperateEvent(data) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改退火操作事件
|
||||
export function updateAnnealOperateEvent(data) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除退火操作事件
|
||||
export function delAnnealOperateEvent(eventId) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/' + eventId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -378,4 +378,23 @@ export function listWithBindInfoCoil(params) {
|
||||
params,
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型不匹配的卷
|
||||
*/
|
||||
export function listTypeErrorCoil() {
|
||||
return request({
|
||||
url: '/wms/materialCoil/queryMismatchedItemCoils',
|
||||
method: 'get',
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export function getCoilStatisticsList(params) {
|
||||
return request({
|
||||
url: '/wms/materialCoil/statisticsList',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/coilContractRel.js
Normal file
44
klp-ui/src/api/wms/coilContractRel.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询钢卷与合同关联关系列表
|
||||
export function listCoilContractRel(query) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询钢卷与合同关联关系详细
|
||||
export function getCoilContractRel(relId) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/' + relId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增钢卷与合同关联关系
|
||||
export function addCoilContractRel(data) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改钢卷与合同关联关系
|
||||
export function updateCoilContractRel(data) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除钢卷与合同关联关系
|
||||
export function delCoilContractRel(relId) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/' + relId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/exportFile.js
Normal file
44
klp-ui/src/api/wms/exportFile.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询报导出文件列表
|
||||
export function listExportFile(query) {
|
||||
return request({
|
||||
url: '/wms/exportFile/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报导出文件详细
|
||||
export function getExportFile(id) {
|
||||
return request({
|
||||
url: '/wms/exportFile/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报导出文件
|
||||
export function addExportFile(data) {
|
||||
return request({
|
||||
url: '/wms/exportFile',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报导出文件
|
||||
export function updateExportFile(data) {
|
||||
return request({
|
||||
url: '/wms/exportFile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报导出文件
|
||||
export function delExportFile(id) {
|
||||
return request({
|
||||
url: '/wms/exportFile/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -122,10 +122,13 @@ export function startProcess(actionId) {
|
||||
}
|
||||
|
||||
// 完成操作
|
||||
export function completeAction(actionId) {
|
||||
export function completeAction(actionId, newCoilIds) {
|
||||
return request({
|
||||
url: `/wms/coilPendingAction/complete/${actionId}`,
|
||||
method: 'put'
|
||||
method: 'put',
|
||||
params: {
|
||||
newCoilIds: newCoilIds || '-'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
44
klp-ui/src/api/wms/reportResultStorage.js
Normal file
44
klp-ui/src/api/wms/reportResultStorage.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询报结果存储(JSON+横向对比专用)列表
|
||||
export function listReportResultStorage(query) {
|
||||
return request({
|
||||
url: '/wms/reportResultStorage/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报结果存储(JSON+横向对比专用)详细
|
||||
export function getReportResultStorage(storageId) {
|
||||
return request({
|
||||
url: '/wms/reportResultStorage/' + storageId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报结果存储(JSON+横向对比专用)
|
||||
export function addReportResultStorage(data) {
|
||||
return request({
|
||||
url: '/wms/reportResultStorage',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报结果存储(JSON+横向对比专用)
|
||||
export function updateReportResultStorage(data) {
|
||||
return request({
|
||||
url: '/wms/reportResultStorage',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报结果存储(JSON+横向对比专用)
|
||||
export function delReportResultStorage(storageId) {
|
||||
return request({
|
||||
url: '/wms/reportResultStorage/' + storageId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
klp-ui/src/api/wms/transferOrder.js
Normal file
52
klp-ui/src/api/wms/transferOrder.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询调拨单主列表
|
||||
export function listTransferOrder(query) {
|
||||
return request({
|
||||
url: '/wms/transferOrder/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询调拨单主详细
|
||||
export function getTransferOrder(orderId) {
|
||||
return request({
|
||||
url: '/wms/transferOrder/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增调拨单主
|
||||
export function addTransferOrder(data) {
|
||||
return request({
|
||||
url: '/wms/transferOrder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改调拨单主
|
||||
export function updateTransferOrder(data) {
|
||||
return request({
|
||||
url: '/wms/transferOrder',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除调拨单主
|
||||
export function delTransferOrder(orderId) {
|
||||
return request({
|
||||
url: '/wms/transferOrder/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 审批调拨单
|
||||
export function approveTransferOrder(orderId, status) {
|
||||
return request({
|
||||
url: '/wms/transferOrder/approve/' + orderId + '/' + status,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
116
klp-ui/src/api/wms/transferOrderItem.js
Normal file
116
klp-ui/src/api/wms/transferOrderItem.js
Normal file
@@ -0,0 +1,116 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询调拨单明细列表
|
||||
export function listTransferOrderItem(query) {
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询调拨单明细详细
|
||||
export function getTransferOrderItem(orderItemId) {
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/' + orderItemId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增调拨单明细
|
||||
export function addTransferOrderItem(data) {
|
||||
return request({
|
||||
url: '/wms/transferOrderItem',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改调拨单明细
|
||||
export function updateTransferOrderItem(data) {
|
||||
return request({
|
||||
url: '/wms/transferOrderItem',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除调拨单明细
|
||||
export function delTransferOrderItem(orderItemId) {
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/' + orderItemId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步物料信息
|
||||
*/
|
||||
export function matchOrCreateMaterial({ itemId, itemType }) {
|
||||
if (!itemId || !itemType) {
|
||||
return Promise.reject('参数错误')
|
||||
}
|
||||
|
||||
const data = {
|
||||
itemId,
|
||||
itemType
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/itemType/matchOrCreate',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增调拨信息
|
||||
*/
|
||||
export function batchAddTransferOrderItem({ transferId, coilIds }) {
|
||||
if (!transferId || !coilIds || coilIds.length === 0) {
|
||||
return Promise.reject('参数错误')
|
||||
}
|
||||
|
||||
const data = {
|
||||
transferId,
|
||||
coilIds
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/batch',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认调拨
|
||||
*/
|
||||
export function confirmTransferOrderItem(item) {
|
||||
if (!item.orderItemId) {
|
||||
return Promise.reject('参数错误')
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/confirm',
|
||||
method: 'post',
|
||||
data: item
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消调拨
|
||||
*/
|
||||
export function cancelTransferOrderItem(orderItemId) {
|
||||
if (!orderItemId) {
|
||||
return Promise.reject('参数错误')
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/wms/transferOrderItem/cancel',
|
||||
method: 'post',
|
||||
params: {
|
||||
orderItemId
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -944,6 +944,14 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.el-dialog.is-fullscreen {
|
||||
.el-dialog__body {
|
||||
padding: $--spacing-lg;
|
||||
max-height: calc(100vh - 100px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 抽屉
|
||||
.el-drawer {
|
||||
// background: $--metal-gradient-light;
|
||||
|
||||
@@ -47,12 +47,17 @@ function formatAreaText(value) {
|
||||
return { standard, custom };
|
||||
}
|
||||
|
||||
// 非组合格式(纯标准地址/纯自定义地址)→ 默认归为standard
|
||||
return { standard: trimVal, custom: '' };
|
||||
// 非组合格式(纯任意字符串)→ 归为custom
|
||||
return { standard: '', custom: trimVal };
|
||||
}
|
||||
|
||||
// ========== 场景3:输入是对象 → 格式化为组合字符串 ==========
|
||||
if (typeof value === 'object' && !Array.isArray(value)) {
|
||||
// 处理空对象
|
||||
if (Object.keys(value).length === 0) {
|
||||
return '[]()';
|
||||
}
|
||||
|
||||
const { standard = '', custom = '' } = value;
|
||||
// 转字符串并去空格
|
||||
const standardStr = String(standard).trim();
|
||||
@@ -71,11 +76,19 @@ function formatAreaText(value) {
|
||||
*/
|
||||
function formatAreaTextEnhanced(value, keyType = 'name') {
|
||||
// 先调用基础版解析/格式化
|
||||
const result = formatAreaText(value);
|
||||
let result = formatAreaText(value);
|
||||
|
||||
// 如果是解析模式(返回对象)且keyType为name,转换code为name
|
||||
// 如果是解析模式(返回对象)且keyType为name,检查是否为代码输入
|
||||
if (typeof result === 'object' && keyType === 'name') {
|
||||
result.standard = convertCodeToName(result.standard);
|
||||
// 检查custom是否可能是代码(不包含中文)
|
||||
if (result.custom && !/[\u4e00-\u9fa5]/.test(result.custom)) {
|
||||
// 尝试转换code为name
|
||||
const convertedName = convertCodeToName(result.custom);
|
||||
// 如果转换成功(返回非空字符串),则将其移到standard字段
|
||||
if (convertedName) {
|
||||
result = { standard: convertedName, custom: '' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
<script>
|
||||
import areaData from './data.js'
|
||||
import { formatAreaTextEnhanced } from './index.js'
|
||||
|
||||
export default {
|
||||
name: 'ChinaAreaSelectWithDetail',
|
||||
@@ -105,32 +106,9 @@ export default {
|
||||
* @param {String} val - 外部传入的「[标准地址](自定义地址)」格式值
|
||||
*/
|
||||
parseCombineValue(val) {
|
||||
if (!val) {
|
||||
this.areaValue = []
|
||||
this.detailAddress = ''
|
||||
return
|
||||
}
|
||||
|
||||
// 核心正则:匹配「[xxx](yyy)」格式,分组提取xxx和yyy(无匹配则为空)
|
||||
const reg = /\[([^\]]*)\]\(([^)]*)\)/
|
||||
const matchResult = val.match(reg)
|
||||
|
||||
// 提取标准地址(第一个分组)和自定义地址(第二个分组)
|
||||
const standardAddress = matchResult?.[1] || ''
|
||||
const customAddress = matchResult?.[2] || ''
|
||||
|
||||
// 1. 处理自定义地址:直接赋值
|
||||
this.detailAddress = customAddress.trim()
|
||||
|
||||
// 2. 处理标准地址:转换为区域选择器的code数组
|
||||
if (standardAddress) {
|
||||
const standardArr = standardAddress.split('/').filter(Boolean)
|
||||
this.areaValue = this.keyType === 'name'
|
||||
? this.convertNameToCode(standardArr) // name转code
|
||||
: standardArr.filter(code => !!areaData[code]) // code直接过滤无效值
|
||||
} else {
|
||||
this.areaValue = []
|
||||
}
|
||||
const formattedAddress = formatAreaTextEnhanced(val)
|
||||
this.areaValue = formattedAddress.standard.split('/').filter(Boolean)
|
||||
this.detailAddress = formattedAddress.custom.trim()
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
export const defaultColumns = [
|
||||
{
|
||||
label: '卷号',
|
||||
label: '入场卷号',
|
||||
align: 'center',
|
||||
prop: 'enterCoilNo',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
label: '当前卷号',
|
||||
align: 'center',
|
||||
prop: 'currentCoilNo',
|
||||
showOverflowTooltip: true
|
||||
|
||||
@@ -21,32 +21,39 @@
|
||||
@close="handleClose" append-to-body :fullscreen="orderBy">
|
||||
<!-- 搜索区域 -->
|
||||
<el-form v-if="!rangeMode" inline :model="queryParams" class="search-form">
|
||||
<!-- <el-form-item label="类型">
|
||||
<el-select v-model="queryParams.selectType" placeholder="请选择类型" size="small">
|
||||
<el-form-item label="入场卷号">
|
||||
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前卷号">
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型">
|
||||
<el-select v-model="queryParams.itemType" placeholder="请选择物料类型" size="small" clearable>
|
||||
<el-option label="成品" value="product" />
|
||||
<el-option label="原料" value="raw_material" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="卷号">
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<muti-select v-model="queryParams.itemName" :options="dict.type.coil_itemname" placeholder="请选择物料"
|
||||
<el-form-item label="物料名称" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemName" :options="dict.type.coil_itemname" placeholder="请选择物料名称"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格">
|
||||
<el-form-item label="规格" v-if="queryParams.itemType">
|
||||
<memo-input storageKey="coilSpec" v-model="queryParams.itemSpecification" placeholder="请输入规格" clearable
|
||||
size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质">
|
||||
<el-form-item label="材质" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemMaterial" :options="dict.type.coil_material" placeholder="请选择材质"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家">
|
||||
<el-form-item label="厂家" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemManufacturer" :options="dict.type.coil_manufacturer" placeholder="请选择厂家"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="表面处理" v-if="queryParams.itemType">
|
||||
<el-input v-model="queryParams.itemSurfaceTreatmentDesc" placeholder="请输入表面处理" clearable size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="切边" prop="trimmingRequirement" v-if="orderBy">
|
||||
<el-select v-model="queryParams.trimmingRequirement" placeholder="请选择切边" clearable style="width: 100%">
|
||||
<el-option label="净边" value="净边" />
|
||||
@@ -60,6 +67,10 @@
|
||||
<el-option label="简包" value="简包" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品质">
|
||||
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
|
||||
placeholder="请选择品质" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际库区" v-if="orderBy">
|
||||
<actual-warehouse-select v-model="queryParams.actualWarehouseId" placeholder="请选择实际库区" canSelectLevel2
|
||||
canSelectDisabled :clearInput="false" clearable />
|
||||
@@ -69,6 +80,8 @@
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
<el-checkbox v-if="orderBy" style="margin-left: 10px;" v-model="showCoilMap" size="small">显示钢卷地图</el-checkbox>
|
||||
<el-checkbox v-if="orderBy && orderId" style="margin-left: 10px;" v-model="showOrderInfo"
|
||||
size="small">显示订单详情</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -78,6 +91,7 @@
|
||||
<!-- 自定义列 -->
|
||||
<el-table-column v-for="column in renderColumns" :label="column.label" :align="column.align" :prop="column.prop"
|
||||
:width="column.width" :show-overflow-tooltip="column.showOverflowTooltip" />
|
||||
<el-table-column v-if="orderBy" label="表面处理" prop="surfaceTreatmentDesc"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="品质" prop="qualityStatus"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="切边" prop="trimmingRequirement"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="包装" prop="packagingRequirement"></el-table-column>
|
||||
@@ -95,6 +109,7 @@
|
||||
<!-- 自定义列 -->
|
||||
<el-table-column v-for="column in renderColumns" :label="column.label" :align="column.align"
|
||||
:prop="column.prop" :width="column.width" :show-overflow-tooltip="column.showOverflowTooltip" />
|
||||
<el-table-column v-if="orderBy" label="表面处理" prop="surfaceTreatmentDesc"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="品质" prop="qualityStatus"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="切边" prop="trimmingRequirement"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="包装" prop="packagingRequirement"></el-table-column>
|
||||
@@ -102,8 +117,15 @@
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<div style="display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px;">
|
||||
<span>
|
||||
总净重:{{ coilTrimStatistics.total_net_weight || 0 }}t
|
||||
</span>
|
||||
|
||||
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="multiple && selectedCoils.length > 0" class="selected-stats">
|
||||
<div class="stats-content">
|
||||
@@ -121,7 +143,10 @@
|
||||
<el-table v-if="multiple && selectedCoils.length > 0" :data="selectedCoils">
|
||||
<el-table-column v-for="column in renderColumns" :label="column.label" :align="column.align" :prop="column.prop"
|
||||
:width="column.width" :show-overflow-tooltip="column.showOverflowTooltip" />
|
||||
<el-table-column v-if="orderBy" label="表面处理" prop="surfaceTreatmentDesc"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="品质" prop="qualityStatus"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="切边" prop="trimmingRequirement"></el-table-column>
|
||||
<el-table-column v-if="orderBy" label="包装" prop="packagingRequirement"></el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
@@ -147,12 +172,18 @@
|
||||
:id="selectedNodeId" :canToggle="false" :canRelease="false" />
|
||||
</div>
|
||||
</DragResizeBox>
|
||||
|
||||
<DragResizeBox v-if="orderBy && orderId && showOrderInfo" storageKey="coil-order-info">
|
||||
<div style="height: 100%; width: 100%; background-color: #fff;">
|
||||
<order-detail v-if="orderBy && orderId && showOrderInfo" :orderId="orderId" :editable="false" />
|
||||
</div>
|
||||
</DragResizeBox>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialCoil } from '@/api/wms/coil';
|
||||
import { listMaterialCoil, getCoilStatisticsList } from '@/api/wms/coil';
|
||||
import { listActualWarehouse } from "@/api/wms/actualWarehouse";
|
||||
import { treeActualWarehouseTwoLevel } from "@/api/wms/actualWarehouse";
|
||||
import MemoInput from '@/components/MemoInput/index.vue';
|
||||
@@ -161,6 +192,7 @@ import { defaultColumns } from './data';
|
||||
import ActualWarehouseSelect from '@/components/KLPService/ActualWarehouseSelect/index.vue';
|
||||
import WarehouseBirdMini from '@/views/wms/warehouse/components/WarehouseBirdMini.vue';
|
||||
import DragResizeBox from '@/components/DragResizeBox/index.vue';
|
||||
import OrderDetail from '@/views/crm/components/OrderDetail.vue';
|
||||
|
||||
export default {
|
||||
name: 'CoilSelector',
|
||||
@@ -169,9 +201,10 @@ export default {
|
||||
MutiSelect,
|
||||
ActualWarehouseSelect,
|
||||
WarehouseBirdMini,
|
||||
DragResizeBox
|
||||
DragResizeBox,
|
||||
OrderDetail
|
||||
},
|
||||
dicts: ['coil_itemname', 'coil_material', 'coil_manufacturer'],
|
||||
dicts: ['coil_itemname', 'coil_material', 'coil_manufacturer', 'coil_quality_status'],
|
||||
props: {
|
||||
// 非触发器模式下,外部控制显隐(触发器模式下无效)
|
||||
visible: {
|
||||
@@ -180,7 +213,7 @@ export default {
|
||||
},
|
||||
dialogWidth: {
|
||||
type: String,
|
||||
default: '1000px'
|
||||
default: '1200px'
|
||||
},
|
||||
// 过滤条件(可以预设一些查询条件)
|
||||
filters: {
|
||||
@@ -238,6 +271,14 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
defaultType: {
|
||||
type: String,
|
||||
default: 'product'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -251,14 +292,15 @@ export default {
|
||||
selectedCoil: null,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
currentCoilNo: null,
|
||||
grade: null,
|
||||
itemSpecification: null,
|
||||
itemMaterial: null,
|
||||
itemManufacturer: null,
|
||||
actualWarehouseId: null,
|
||||
selectType: 'product',
|
||||
itemType: this.defaultType,
|
||||
selectType: this.defaultType,
|
||||
status: 0, // 不包含已发货的钢卷
|
||||
dataType: 1 // 只查询当前数据,不查询历史数据
|
||||
},
|
||||
@@ -271,6 +313,8 @@ export default {
|
||||
warehouseTree: [],
|
||||
treeProps: { label: "actualWarehouseName", children: "children" },
|
||||
treeLoading: false,
|
||||
showOrderInfo: false,
|
||||
coilTrimStatistics: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -455,12 +499,18 @@ export default {
|
||||
...this.queryParams,
|
||||
...this.filters,
|
||||
};
|
||||
queryPayload.selectType = queryPayload.itemType;
|
||||
// 处于销售视角,且my视图时,只查询当前用户的钢卷
|
||||
console.log('this.salesRestricted', this.salesRestricted, this.currentTab, this.currentUserId);
|
||||
if (this.salesRestricted && this.currentTab === 'my') {
|
||||
queryPayload.saleId = this.currentUserId;
|
||||
}
|
||||
const response = await listMaterialCoil(queryPayload);
|
||||
const { pageNum, pageSize, excludeBound, orderBy, ...noPager } = queryPayload;
|
||||
getCoilStatisticsList(noPager).then((res) => {
|
||||
console.log('钢卷统计数据:', res);
|
||||
this.coilTrimStatistics = res.data || {};
|
||||
});
|
||||
if (response.code === 200) {
|
||||
this.coilList = response.rows || [];
|
||||
this.total = response.total || 0;
|
||||
@@ -506,7 +556,8 @@ export default {
|
||||
currentCoilNo: null,
|
||||
grade: null,
|
||||
dataType: 1,
|
||||
selectType: 'raw_material',
|
||||
itemType: this.defaultType,
|
||||
selectType: this.defaultType,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
@@ -518,8 +569,9 @@ export default {
|
||||
this.$message.warning('您没有权限选择此钢卷');
|
||||
return; // 终止后续逻辑
|
||||
}
|
||||
if (this.disableO && row.qualityStatus == 'O') {
|
||||
this.$message.warning('O卷不能选择');
|
||||
const disabledOList = ['O', 'C+', 'C', 'C-', 'D+', 'D', 'D-']
|
||||
if (this.disableO && disabledOList.includes(row.qualityStatus)) {
|
||||
this.$message.warning(`${row.qualityStatus}卷不能选择`);
|
||||
return;
|
||||
}
|
||||
this.handleSelect(row);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div
|
||||
v-if="editable"
|
||||
@click="openDictDialog"
|
||||
style="cursor: pointer; height: 24px; width: 24px; margin-top: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid #828991; margin-left: 8px; border-radius: 2px;"
|
||||
style="cursor: pointer; min-height: 24px; min-width: 24px; margin-top: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid #828991; margin-left: 8px; border-radius: 2px;"
|
||||
>
|
||||
<i class="el-icon-setting"></i>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
<div
|
||||
v-if="refresh"
|
||||
@click="handleRefresh"
|
||||
style="cursor: pointer; height: 24px; width: 24px; margin-top: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid #828991; margin-left: 8px; border-radius: 2px;"
|
||||
style="cursor: pointer; min-height: 24px; min-width: 24px; margin-top: 4px; display: flex; align-items: center; justify-content: center; border: 1px solid #828991; margin-left: 8px; border-radius: 2px;"
|
||||
>
|
||||
<i class="el-icon-refresh"></i>
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="kisv ? 24 : 12">
|
||||
<el-form-item label="值/标签" prop="dictValue" v-if="kisv">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入字典值(标签自动同步)" />
|
||||
<el-input v-model="form.dictValue" placeholder="请输入字典值,在此处输入用于新增字典项" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典标签" prop="dictLabel" v-else>
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入字典标签" />
|
||||
|
||||
159
klp-ui/src/components/DragResizePanel/index.vue
Normal file
159
klp-ui/src/components/DragResizePanel/index.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="drag-resize-panel" :class="{ 'vertical': direction === 'vertical' }">
|
||||
<div class="panel-a" :style="panelAstyle">
|
||||
<slot name="panelA"></slot>
|
||||
</div>
|
||||
<div class="resizer" :class="{ 'vertical-resizer': direction === 'vertical' }" @mousedown="startResize"></div>
|
||||
<div class="panel-b" :style="panelBstyle">
|
||||
<slot name="panelB"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DragResizePanel',
|
||||
props: {
|
||||
direction: {
|
||||
type: String,
|
||||
default: 'horizontal',
|
||||
validator: function(value) {
|
||||
return ['horizontal', 'vertical'].includes(value);
|
||||
}
|
||||
},
|
||||
// 设置panelA的初始大小,最大值和最小值,默认值为300px,10000px,100px
|
||||
// panelB占据剩余空间
|
||||
initialSize: {
|
||||
type: Number,
|
||||
default: 300
|
||||
},
|
||||
minSize: {
|
||||
type: Number,
|
||||
default: 100
|
||||
},
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 10000
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentSize: this.initialSize,
|
||||
isResizing: false,
|
||||
startPosition: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
panelAstyle() {
|
||||
if (this.direction === 'horizontal') {
|
||||
return { width: this.currentSize + 'px' };
|
||||
} else {
|
||||
return { height: this.currentSize + 'px' };
|
||||
}
|
||||
},
|
||||
panelBstyle() {
|
||||
if (this.direction === 'horizontal') {
|
||||
return { flex: 1 };
|
||||
} else {
|
||||
return { flex: 1 };
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
startResize(e) {
|
||||
e.preventDefault();
|
||||
this.isResizing = true;
|
||||
this.startPosition = this.direction === 'horizontal' ? e.clientX : e.clientY;
|
||||
this.startSize = this.currentSize;
|
||||
|
||||
document.addEventListener('mousemove', this.handleResize);
|
||||
document.addEventListener('mouseup', this.stopResize);
|
||||
},
|
||||
handleResize(e) {
|
||||
if (!this.isResizing) return;
|
||||
|
||||
const delta = this.direction === 'horizontal' ? e.clientX - this.startPosition : e.clientY - this.startPosition;
|
||||
const newSize = this.startSize + delta;
|
||||
|
||||
if (newSize >= this.minSize && newSize <= this.maxSize) {
|
||||
this.currentSize = newSize;
|
||||
}
|
||||
},
|
||||
stopResize() {
|
||||
this.isResizing = false;
|
||||
document.removeEventListener('mousemove', this.handleResize);
|
||||
document.removeEventListener('mouseup', this.stopResize);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drag-resize-panel {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.drag-resize-panel.vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.panel-a {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.panel-b {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.resizer {
|
||||
width: 4px;
|
||||
cursor: col-resize;
|
||||
position: relative;
|
||||
transition: background-color 0.3s;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.resizer.vertical-resizer {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.resizer:hover {
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
.resizer::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
height: 40px;
|
||||
width: 2px;
|
||||
background-color: #c0c4cc;
|
||||
border-radius: 1px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.resizer.vertical-resizer::before {
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
.resizer:hover::before {
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
.resizer:active {
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
.resizer:active::before {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,52 +1,61 @@
|
||||
<template>
|
||||
<div class="file-list-container">
|
||||
<el-table
|
||||
:data="fileList"
|
||||
border
|
||||
size="small"
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column
|
||||
label="文件名"
|
||||
prop="originalName"
|
||||
min-width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-document" style="margin-right: 8px;"></i>
|
||||
{{ scope.row.originalName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="100"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-download"
|
||||
@click="downloadFile(scope.row)"
|
||||
size="small"
|
||||
>
|
||||
下载
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 空数据提示 -->
|
||||
<div v-if="fileList.length === 0 && !loading" class="empty-tip">
|
||||
<el-empty description="暂无文件数据"></el-empty>
|
||||
</div>
|
||||
<!-- 自定义文件列表 -->
|
||||
<div v-else class="file-list" v-loading="loading">
|
||||
<div
|
||||
v-for="file in fileList"
|
||||
:key="file.ossId"
|
||||
class="file-item"
|
||||
>
|
||||
<div class="file-info">
|
||||
<i class="el-icon-document"></i>
|
||||
<span class="file-name">{{ file.originalName }}</span>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handlePreview(file)"
|
||||
size="small"
|
||||
class="preview-btn"
|
||||
>
|
||||
预览
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-download"
|
||||
@click="downloadFile(file)"
|
||||
size="small"
|
||||
class="download-btn"
|
||||
>
|
||||
下载
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件预览组件 -->
|
||||
<file-preview
|
||||
:visible.sync="previewVisible"
|
||||
:file-url="previewFileUrl"
|
||||
:file-name="previewFileName"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByIds } from "@/api/system/oss";
|
||||
import FilePreview from "../FilePreview";
|
||||
|
||||
export default {
|
||||
name: "FileList",
|
||||
components: {
|
||||
FilePreview
|
||||
},
|
||||
props: {
|
||||
ossIds: {
|
||||
type: String,
|
||||
@@ -56,7 +65,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
loading: false // 加载状态
|
||||
loading: false, // 加载状态
|
||||
// 预览相关
|
||||
previewVisible: false,
|
||||
previewFileUrl: '',
|
||||
previewFileName: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -94,6 +107,12 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.$download.oss(file.ossId);
|
||||
},
|
||||
// 预览文件
|
||||
handlePreview(file) {
|
||||
this.previewFileUrl = file.url;
|
||||
this.previewFileName = file.originalName;
|
||||
this.previewVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,8 +131,64 @@ export default {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
--el-table-header-text-color: #606266;
|
||||
--el-table-row-hover-bg-color: #f5f7fa;
|
||||
.file-list {
|
||||
width: 100%;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.file-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.file-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.file-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.file-item:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.file-info .el-icon-document {
|
||||
margin-right: 8px;
|
||||
color: #409eff;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.download-btn {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.download-btn:hover {
|
||||
color: #66b1ff;
|
||||
}
|
||||
</style>
|
||||
122
klp-ui/src/components/FilePreview/index.vue
Normal file
122
klp-ui/src/components/FilePreview/index.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
:width="width"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
@close="handleClose"
|
||||
>
|
||||
<!-- 图片预览 -->
|
||||
<ImagePreview v-if="fileType === 'image'" :src="fileUrl" />
|
||||
|
||||
<!-- PDF预览 -->
|
||||
<PdfPreview v-else-if="fileType === 'pdf'" :src="fileUrl" />
|
||||
|
||||
<!-- Word预览 -->
|
||||
<DocxPreview v-else-if="fileType === 'docx'" :src="fileUrl" />
|
||||
|
||||
<!-- Excel预览 (xlsx) -->
|
||||
<XlsxPreview v-else-if="fileType === 'xlsx'" :src="fileUrl" />
|
||||
|
||||
<!-- Excel预览 (xls) -->
|
||||
<XlsPreview v-else-if="fileType === 'xls'" :src="fileUrl" />
|
||||
|
||||
<!-- 不支持的文件类型 -->
|
||||
<div v-else class="preview-not-supported">
|
||||
<el-empty description="暂不支持预览此文件类型"></el-empty>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ImagePreview from './preview/image/index.vue';
|
||||
import PdfPreview from './preview/pdf/index.vue';
|
||||
import DocxPreview from './preview/docx/index.vue';
|
||||
import XlsxPreview from './preview/xlsx/index.vue';
|
||||
import XlsPreview from './preview/xls/index.vue';
|
||||
|
||||
export default {
|
||||
name: "FilePreview",
|
||||
components: {
|
||||
ImagePreview,
|
||||
PdfPreview,
|
||||
DocxPreview,
|
||||
XlsxPreview,
|
||||
XlsPreview
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
fileUrl: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
fileName: {
|
||||
type: String,
|
||||
default: "文件预览"
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "80%"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
visible: {
|
||||
handler(val) {
|
||||
this.dialogVisible = val;
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
dialogVisible(val) {
|
||||
if (!val) {
|
||||
this.$emit('update:visible', false);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.fileName || "文件预览";
|
||||
},
|
||||
fileType() {
|
||||
const fileName = this.fileName || '';
|
||||
const ext = fileName.split('.').pop()?.toLowerCase();
|
||||
if (['png', 'jpg', 'jpeg', 'bmp', 'webp'].includes(ext)) {
|
||||
return 'image';
|
||||
} else if (ext === 'pdf') {
|
||||
return 'pdf';
|
||||
} else if (ext === 'docx') {
|
||||
return 'docx';
|
||||
} else if (ext === 'xlsx') {
|
||||
return 'xlsx';
|
||||
} else if (ext === 'xls') {
|
||||
return 'xls';
|
||||
} else {
|
||||
return 'other';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.$emit('update:visible', false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.preview-not-supported {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
38
klp-ui/src/components/FilePreview/preview/docx/index.vue
Normal file
38
klp-ui/src/components/FilePreview/preview/docx/index.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<div class="docx-preview">
|
||||
<vue-office-docx :src="src" @render-error="handleDocxError" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueOfficeDocx from '@vue-office/docx';
|
||||
import '@vue-office/docx/lib/index.css';
|
||||
|
||||
export default {
|
||||
name: "DocxPreview",
|
||||
components: {
|
||||
VueOfficeDocx
|
||||
},
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "Word文件的URL或路径"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleDocxError(err) {
|
||||
console.error('docx预览失败:', err);
|
||||
this.$message.error('文档预览失败,请下载查看');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.docx-preview {
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
99
klp-ui/src/components/FilePreview/preview/image/index.vue
Normal file
99
klp-ui/src/components/FilePreview/preview/image/index.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="preview-image">
|
||||
<div class="image-controls">
|
||||
<el-button type="primary" size="small" @click="zoomIn">放大</el-button>
|
||||
<el-button type="primary" size="small" @click="zoomOut">缩小</el-button>
|
||||
<el-button type="primary" size="small" @click="resetZoom">重置</el-button>
|
||||
</div>
|
||||
<div class="image-container" ref="imageContainer">
|
||||
<img
|
||||
:src="src"
|
||||
:style="{ transform: `scale(${scale})` }"
|
||||
class="preview-image-content"
|
||||
@wheel="handleWheel"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ImagePreview",
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "图片文件的URL或路径"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
scale: 1
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 放大图片
|
||||
zoomIn() {
|
||||
if (this.scale < 3) {
|
||||
this.scale += 0.1;
|
||||
}
|
||||
},
|
||||
// 缩小图片
|
||||
zoomOut() {
|
||||
if (this.scale > 0.1) {
|
||||
this.scale -= 0.1;
|
||||
}
|
||||
},
|
||||
// 重置缩放
|
||||
resetZoom() {
|
||||
this.scale = 1;
|
||||
},
|
||||
// 鼠标滚轮缩放
|
||||
handleWheel(event) {
|
||||
event.preventDefault();
|
||||
const delta = event.deltaY > 0 ? -0.1 : 0.1;
|
||||
if ((this.scale > 0.1 || delta > 0) && (this.scale < 3 || delta < 0)) {
|
||||
this.scale += delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.preview-image {
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
background-color: #f5f7fa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.image-controls {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.image-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.preview-image-content {
|
||||
transition: transform 0.3s ease;
|
||||
cursor: zoom-in;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.preview-image-content:hover {
|
||||
cursor: zoom-in;
|
||||
}
|
||||
</style>
|
||||
34
klp-ui/src/components/FilePreview/preview/pdf/index.vue
Normal file
34
klp-ui/src/components/FilePreview/preview/pdf/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="preview-pdf">
|
||||
<iframe
|
||||
:src="src"
|
||||
class="preview-pdf-content"
|
||||
frameborder="0"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "PdfPreview",
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "PDF文件的URL或路径"
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.preview-pdf {
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
}
|
||||
|
||||
.preview-pdf-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
238
klp-ui/src/components/FilePreview/preview/xls/index.vue
Normal file
238
klp-ui/src/components/FilePreview/preview/xls/index.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div class="xls-preview">
|
||||
<!-- 加载状态 -->
|
||||
<div v-if="loading" class="loading">
|
||||
<div class="spinner"></div>
|
||||
<p>正在加载Excel文件...</p>
|
||||
</div>
|
||||
|
||||
<!-- 错误信息 -->
|
||||
<div v-if="error" class="error">{{ error }}</div>
|
||||
|
||||
<!-- Excel内容展示 -->
|
||||
<div v-if="workbook" class="workbook-container">
|
||||
<!-- 工作表标签 -->
|
||||
<div class="sheet-tabs">
|
||||
<button v-for="(sheet, index) in workbook.SheetNames" :key="index"
|
||||
:class="{ active: activeSheetIndex === index }" @click="activeSheetIndex = index">
|
||||
{{ sheet }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 表格内容区域 -->
|
||||
<div class="sheet-content">
|
||||
<table v-if="activeSheetData">
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in activeSheetData" :key="rowIndex">
|
||||
<td v-for="(cell, colIndex) in row" :key="colIndex" :class="{
|
||||
'header-cell': rowIndex === 0,
|
||||
'odd-row': rowIndex % 2 === 1
|
||||
}">
|
||||
{{ cell || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
export default {
|
||||
name: "XlsPreview",
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "Excel文件的URL或路径"
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
workbook: null, // 解析后的Excel工作簿
|
||||
activeSheetIndex: 0, // 当前激活的工作表索引
|
||||
loading: false, // 加载状态
|
||||
error: null // 错误信息
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
src: {
|
||||
immediate: true,
|
||||
handler () {
|
||||
this.loadAndParseExcel();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 获取当前激活的工作表数据
|
||||
activeSheetData () {
|
||||
if (!this.workbook || !this.workbook.SheetNames.length) return null;
|
||||
|
||||
const sheetName = this.workbook.SheetNames[this.activeSheetIndex];
|
||||
const worksheet = this.workbook.Sheets[sheetName];
|
||||
|
||||
// 将工作表转换为二维数组
|
||||
return XLSX.utils.sheet_to_json(worksheet, { header: 1 });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 加载并解析Excel文件
|
||||
*/
|
||||
async loadAndParseExcel () {
|
||||
this.loading = true;
|
||||
this.error = null;
|
||||
this.workbook = null;
|
||||
|
||||
try {
|
||||
// 验证URL格式
|
||||
if (!this.src || (this.src.startsWith('http') && !this.isValidUrl(this.src))) {
|
||||
throw new Error('无效的文件路径');
|
||||
}
|
||||
|
||||
// 加载文件
|
||||
const response = await fetch(this.src);
|
||||
if (!response.ok) {
|
||||
throw new Error(`加载失败: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
|
||||
// 转换为ArrayBuffer
|
||||
const arrayBuffer = await response.arrayBuffer();
|
||||
|
||||
// 解析Excel
|
||||
this.workbook = XLSX.read(arrayBuffer, {
|
||||
type: 'array',
|
||||
cellDates: true, // 解析日期类型
|
||||
cellText: false // 保持单元格原始类型
|
||||
});
|
||||
|
||||
// 重置到第一个工作表
|
||||
this.activeSheetIndex = 0;
|
||||
} catch (err) {
|
||||
this.error = err.message;
|
||||
console.error('Excel处理错误:', err);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证URL格式
|
||||
*/
|
||||
isValidUrl (url) {
|
||||
try {
|
||||
new URL(url);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.xls-preview {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
}
|
||||
|
||||
/* 加载状态样式 */
|
||||
.loading {
|
||||
padding: 40px 20px;
|
||||
text-align: center;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 auto 16px;
|
||||
border: 4px solid #e5e7eb;
|
||||
border-top-color: #3b82f6;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* 错误信息样式 */
|
||||
.error {
|
||||
padding: 20px;
|
||||
color: #dc2626;
|
||||
background-color: #fee2e2;
|
||||
border-bottom: 1px solid #fecaca;
|
||||
}
|
||||
|
||||
/* 工作表标签样式 */
|
||||
.sheet-tabs {
|
||||
display: flex;
|
||||
background-color: #f9fafb;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sheet-tabs button {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
background: none;
|
||||
font-size: 14px;
|
||||
color: #4b5563;
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.sheet-tabs button:hover:not(.active) {
|
||||
background-color: #f3f4f6;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.sheet-tabs button.active {
|
||||
border-bottom-color: #3b82f6;
|
||||
color: #3b82f6;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 表格内容样式 */
|
||||
.sheet-content {
|
||||
overflow: auto;
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
min-width: max-content;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #e5e7eb;
|
||||
min-width: 80px;
|
||||
font-size: 14px;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.header-cell {
|
||||
background-color: #f3f4f6;
|
||||
font-weight: 500;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.odd-row {
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
</style>
|
||||
42
klp-ui/src/components/FilePreview/preview/xlsx/index.vue
Normal file
42
klp-ui/src/components/FilePreview/preview/xlsx/index.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<div class="xlsx-preview" :style="{ height: height }">
|
||||
<vue-office-excel :src="src" @render-error="handleExcelError" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueOfficeExcel from '@vue-office/excel';
|
||||
import '@vue-office/excel/lib/index.css';
|
||||
|
||||
export default {
|
||||
name: "XlsxPreview",
|
||||
components: {
|
||||
VueOfficeExcel
|
||||
},
|
||||
props: {
|
||||
src: {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "Excel文件的URL或路径"
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "70vh",
|
||||
description: "预览区域高度"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleExcelError(err) {
|
||||
console.error('excel预览失败:', err);
|
||||
this.$message.error('Excel预览失败,请下载查看');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.xlsx-preview {
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -32,19 +32,31 @@
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-link :underline="false" @click="handlePreview(file)" type="primary">预览</el-link>
|
||||
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
|
||||
<!-- 文件预览组件 -->
|
||||
<file-preview
|
||||
:visible.sync="previewVisible"
|
||||
:file-url="previewFileUrl"
|
||||
:file-name="previewFileName"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { listByIds, delOss } from "@/api/system/oss";
|
||||
import FilePreview from "../FilePreview";
|
||||
|
||||
export default {
|
||||
name: "FileUpload",
|
||||
components: {
|
||||
FilePreview
|
||||
},
|
||||
props: {
|
||||
// 值
|
||||
value: [String, Object, Array],
|
||||
@@ -85,6 +97,10 @@ export default {
|
||||
},
|
||||
fileList: [],
|
||||
loading: false,
|
||||
// 预览相关
|
||||
previewVisible: false,
|
||||
previewFileUrl: '',
|
||||
previewFileName: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -232,6 +248,12 @@ export default {
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||
},
|
||||
// 预览文件
|
||||
handlePreview(file) {
|
||||
this.previewFileUrl = file.url;
|
||||
this.previewFileName = file.name;
|
||||
this.previewVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
269
klp-ui/src/components/KLPService/ContractSelect/index.vue
Normal file
269
klp-ui/src/components/KLPService/ContractSelect/index.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="display: flex; align-items: center; margin-bottom: 12px;">
|
||||
<el-select v-model="selectedValue" placeholder="请选择合同" style="width: 100%">
|
||||
<el-option v-for="item in contractList" :key="item.orderId" :value="item.orderId"
|
||||
:label="item.contractCode" />
|
||||
</el-select>
|
||||
<!-- 编辑按钮:点击打开弹窗 -->
|
||||
<el-button v-if="mode == 'today'" @click="openSelectDialog" type="primary" size="small" style="margin-left: 8px; padding: 0 12px;">
|
||||
<i class="el-icon-setting"></i>
|
||||
</el-button>
|
||||
|
||||
<!-- 刷新时不会移除手动添加的合同 -->
|
||||
<el-button @click="handleRefresh" type="info" size="small" style="margin-left: 8px; padding: 0 12px;">
|
||||
<i class="el-icon-refresh"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 查询所有的合同和当前localstorage中的合同,可以对localstorage中的合同进行新增和删除,手动新增的合同带有手动添加的标记 -->
|
||||
<el-dialog title="可选合同配置" :visible.sync="dialogVisible" width="80%">
|
||||
<el-tabs v-model="activeTab">
|
||||
<!-- 已配置合同tab -->
|
||||
<el-tab-pane label="可选合同" name="configured">
|
||||
<div v-if="contractList.length === 0" style="text-align: center; padding: 20px;">
|
||||
暂无已配置合同
|
||||
</div>
|
||||
<el-table v-else :data="contractList" style="width: 100%" size="mini" height="600">
|
||||
<el-table-column prop="contractCode" label="合同编号" width="160" />
|
||||
<el-table-column prop="contractName" label="合同名称" width="180" />
|
||||
<el-table-column prop="customer" label="客户" width="140" />
|
||||
<el-table-column prop="salesman" label="销售人员" width="100" />
|
||||
<el-table-column prop="deliveryDate" label="交付日期" width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deliveryDate || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column label="添加方式" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isManual" type="success" size="small">手动</el-tag>
|
||||
<el-tag v-else type="info" size="small">接口</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" @click="removeContract(scope.row.orderId)" plain>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 所有合同tab -->
|
||||
<el-tab-pane label="所有合同" name="all">
|
||||
<div style="margin-bottom: 16px;">
|
||||
<el-input v-model="searchKeyword" placeholder="搜索合同" @input="handleSearch" clearable size="small">
|
||||
<el-button slot="append" icon="el-icon-search" size="small"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<el-table :data="allContracts" style="width: 100%" size="mini" height="600">
|
||||
<el-table-column prop="contractCode" label="合同编号" width="160" />
|
||||
<el-table-column prop="contractName" label="合同名称" width="180" />
|
||||
<el-table-column prop="customer" label="客户" width="140" />
|
||||
<el-table-column prop="salesman" label="销售人员" width="100" />
|
||||
<el-table-column prop="deliveryDate" label="交付日期" width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deliveryDate || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="isContractInList(scope.row.orderId)" type="success" size="small">已添加</el-tag>
|
||||
<el-tag v-else type="info" size="small">未添加</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="!isContractInList(scope.row.orderId)"
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="addContract(scope.row)"
|
||||
plain
|
||||
>
|
||||
添加
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="removeContract(scope.row.orderId)"
|
||||
plain
|
||||
>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div v-if="allContracts.length === 0" style="text-align: center; padding: 20px;">
|
||||
暂无合同数据
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrder, listTodayOrder } from '@/api/crm/order';
|
||||
|
||||
export default {
|
||||
name: "ContractSelect",
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "today" // today 或 all
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
contractList: [],
|
||||
dialogVisible: false,
|
||||
searchKeyword: '',
|
||||
allContracts: [],
|
||||
activeTab: 'configured', // 默认显示已配置合同tab
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectedValue: {
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.mode == "today") {
|
||||
// 从localstorage中获取合同列表
|
||||
this.loadFromLocalStorage();
|
||||
} else {
|
||||
this.loadContractList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 从localStorage中加载合同列表
|
||||
loadFromLocalStorage() {
|
||||
try {
|
||||
const storedContracts = localStorage.getItem('todayContracts');
|
||||
if (storedContracts) {
|
||||
this.contractList = JSON.parse(storedContracts);
|
||||
} else {
|
||||
// 如果localStorage中没有,从接口获取
|
||||
this.loadContractList();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load contracts from localStorage:', error);
|
||||
this.loadContractList();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存合同列表到localStorage
|
||||
saveToLocalStorage() {
|
||||
try {
|
||||
localStorage.setItem('todayContracts', JSON.stringify(this.contractList));
|
||||
} catch (error) {
|
||||
console.error('Failed to save contracts to localStorage:', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 加载合同列表
|
||||
async loadContractList(keyword) {
|
||||
if (this.mode == "all") {
|
||||
const res = await listOrder({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
keyword: keyword || undefined,
|
||||
});
|
||||
this.contractList = res.rows || [];
|
||||
}
|
||||
else if (this.mode == "today") {
|
||||
const res = await listTodayOrder();
|
||||
// 获取现有手动添加的合同
|
||||
const existingManualContracts = this.contractList.filter(item => item.isManual);
|
||||
// 将接口返回的合同标记为非手动添加
|
||||
const apiContracts = (res.data || []).map(item => ({
|
||||
...item,
|
||||
isManual: false
|
||||
}));
|
||||
// 合并合同列表,保留手动添加的合同
|
||||
this.contractList = [...apiContracts, ...existingManualContracts];
|
||||
// 去重,避免重复合同
|
||||
this.contractList = this.contractList.filter((item, index, self) =>
|
||||
index === self.findIndex(t => t.orderId === item.orderId)
|
||||
);
|
||||
// 保存到localStorage
|
||||
this.saveToLocalStorage();
|
||||
}
|
||||
},
|
||||
// 打开选择弹窗
|
||||
async openSelectDialog() {
|
||||
this.dialogVisible = true;
|
||||
// 加载所有合同供选择
|
||||
await this.loadAllContracts();
|
||||
},
|
||||
|
||||
// 加载所有合同
|
||||
async loadAllContracts() {
|
||||
try {
|
||||
const res = await listOrder({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
keyword: this.searchKeyword || undefined,
|
||||
});
|
||||
// 合并现有合同(包括手动添加的)
|
||||
const existingContracts = this.contractList;
|
||||
this.allContracts = [...res.rows || [], ...existingContracts].filter((item, index, self) =>
|
||||
index === self.findIndex(t => t.orderId === item.orderId)
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Failed to load all contracts:', error);
|
||||
this.allContracts = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索合同
|
||||
handleSearch() {
|
||||
this.loadAllContracts();
|
||||
},
|
||||
|
||||
// 检查合同是否在列表中
|
||||
isContractInList(orderId) {
|
||||
return this.contractList.some(item => item.orderId === orderId);
|
||||
},
|
||||
|
||||
// 添加合同
|
||||
addContract(contract) {
|
||||
if (!this.isContractInList(contract.orderId)) {
|
||||
this.contractList.push({
|
||||
...contract,
|
||||
isManual: true // 标记为手动添加
|
||||
});
|
||||
this.saveToLocalStorage();
|
||||
}
|
||||
},
|
||||
|
||||
// 移除合同
|
||||
removeContract(orderId) {
|
||||
this.contractList = this.contractList.filter(item => item.orderId !== orderId);
|
||||
this.saveToLocalStorage();
|
||||
},
|
||||
|
||||
// 刷新合同列表
|
||||
handleRefresh() {
|
||||
this.loadContractList();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-select filterable v-model="_customerId" remote :remote-method="remoteSearchCustomer" :loading="customerLoading" placeholder="请选择客户">
|
||||
<el-option v-for="item in customerList" :key="item.customerId" :label="item.name" :value="item.customerId" />
|
||||
<el-select filterable v-model="_customerId" remote :remote-method="remoteSearchCustomer" :style="style" :loading="customerLoading" placeholder="请选择客户">
|
||||
<el-option v-for="item in customerList" :key="item[bindField]" :label="item.companyName" :value="item[bindField]" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
@@ -13,6 +13,14 @@
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
bindField: {
|
||||
type: String,
|
||||
default: 'customerId'
|
||||
},
|
||||
style: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -22,6 +30,12 @@
|
||||
},
|
||||
set(value) {
|
||||
this.$emit('input', value);
|
||||
// 找到对应的客户信息
|
||||
const customer = this.customerList.find(item => item[this.bindField] === value);
|
||||
// 触发 change 事件,传递客户信息
|
||||
if (customer) {
|
||||
this.$emit('change', customer);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -37,7 +51,7 @@
|
||||
methods: {
|
||||
remoteSearchCustomer(query) {
|
||||
this.customerLoading = true;
|
||||
listCustomer({ name: query, pageNum: 1, pageSize: 10 }).then(response => {
|
||||
listCustomer({ companyName: query, pageNum: 1, pageSize: 10 }).then(response => {
|
||||
this.customerList = response.rows;
|
||||
}).finally(() => {
|
||||
this.customerLoading = false;
|
||||
|
||||
@@ -153,7 +153,7 @@ export default {
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
readonly: {
|
||||
@@ -224,7 +224,7 @@ export default {
|
||||
this.selectedId = val || '';
|
||||
if (this.selectedId) {
|
||||
const res = await getProduct(this.selectedId);
|
||||
if (res.code === 200) this.selectedRow = res.data;
|
||||
if (res.code === 200 && res.data != null) this.selectedRow = res.data || {};
|
||||
} else {
|
||||
this.selectedRow = {};
|
||||
}
|
||||
@@ -233,6 +233,7 @@ export default {
|
||||
dialogVisible(val) {
|
||||
if (val) {
|
||||
this.getList();
|
||||
this.listRecentlySelected();
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -274,7 +275,7 @@ export default {
|
||||
// 选中项不在列表则追加,保证选中高亮
|
||||
if (this.selectedId && !this.productList.some(item => item.productId === this.selectedId)) {
|
||||
const res = await getProduct(this.selectedId);
|
||||
res.code === 200 && this.productList.push(res.data);
|
||||
res.code === 200 && res.data && this.productList.push(res.data);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -408,10 +409,10 @@ export default {
|
||||
this.resetForm("form");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.listRecentlySelected();
|
||||
this.getList();
|
||||
},
|
||||
// mounted() {
|
||||
|
||||
// this.getList();
|
||||
// },
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
props: {
|
||||
// 绑定值:原材料ID 单选字符串格式
|
||||
value: {
|
||||
type: String,
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
// 是否只读
|
||||
@@ -222,7 +222,7 @@ export default {
|
||||
// 有选中ID则获取详情赋值
|
||||
if (this.selectedId) {
|
||||
const res = await getRawMaterial(this.selectedId);
|
||||
if (res.code === 200) this.selectedRow = res.data;
|
||||
if (res.code === 200) this.selectedRow = res.data || {};
|
||||
} else {
|
||||
this.selectedRow = {};
|
||||
}
|
||||
@@ -231,6 +231,7 @@ export default {
|
||||
// 弹窗打开时加载数据
|
||||
dialogVisible(val) {
|
||||
if (val) {
|
||||
this.listRecentlySelected();
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
@@ -359,7 +360,7 @@ export default {
|
||||
// 选中的项不在列表中则追加进去,保证选中高亮
|
||||
if (this.selectedId && !this.rawMaterialList.some(item => item.rawMaterialId === this.selectedId)) {
|
||||
const res = await getRawMaterial(this.selectedId);
|
||||
res.code === 200 && this.rawMaterialList.push(res.data);
|
||||
res.code === 200 && res.data && this.rawMaterialList.push(res.data);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -417,10 +418,10 @@ export default {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listRecentlySelected();
|
||||
this.getList();
|
||||
}
|
||||
// mounted() {
|
||||
// this.listRecentlySelected();
|
||||
// this.getList();
|
||||
// }
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
286
klp-ui/src/components/KLPService/Renderer/CoilCard.vue
Normal file
286
klp-ui/src/components/KLPService/Renderer/CoilCard.vue
Normal file
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<div class="material-card" :style="cardStyle">
|
||||
<div class="card-header">
|
||||
<div class="header-left">
|
||||
<current-coil-no :current-coil-no="coil.currentCoilNo"></current-coil-no>
|
||||
<!-- <span class="material-type">{{ coil.materialType || '原料' }}</span> -->
|
||||
<el-popover placement="top" width="280" trigger="hover" popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-title">
|
||||
{{ coil.itemName || '—' }}
|
||||
</div>
|
||||
<div class="params-list">
|
||||
<div class="param-coil">
|
||||
<div class="param-row" v-if="coil.specification">
|
||||
<span class="param-label">规格:</span>
|
||||
<span class="param-value">{{ coil.specification }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.material">
|
||||
<span class="param-label">材质:</span>
|
||||
<span class="param-value">{{ coil.material }}</span>
|
||||
</div>
|
||||
|
||||
<div class="param-row" v-if="coil.surfaceTreatmentDesc">
|
||||
<span class="param-label">表面处理:</span>
|
||||
<span class="param-value">{{ coil.surfaceTreatmentDesc }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.zincLayer">
|
||||
<span class="param-label">镀层质量:</span>
|
||||
<span class="param-value">{{ coil.zincLayer }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.manufacturer">
|
||||
<span class="param-label">厂家:</span>
|
||||
<span class="param-value">{{ coil.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-divider"></div>
|
||||
<div class="param-coil">
|
||||
<div class="param-row" v-if="coil.actualWarehouseName">
|
||||
<span class="param-label">实际库区:</span>
|
||||
<span class="param-value">{{ coil.actualWarehouseName }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.qualityStatus">
|
||||
<span class="param-label">质量状态:</span>
|
||||
<span class="param-value">{{ coil.qualityStatus }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.trimmingRequirement">
|
||||
<span class="param-label">切边要求:</span>
|
||||
<span class="param-value">{{ coil.trimmingRequirement }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.packingStatus">
|
||||
<span class="param-label">原料材质:</span>
|
||||
<span class="param-value">{{ coil.packingStatus }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.packagingRequirement">
|
||||
<span class="param-label">包装要求:</span>
|
||||
<span class="param-value">{{ coil.packagingRequirement }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.grossWeight">
|
||||
<span class="param-label">毛重:</span>
|
||||
<span class="param-value">{{ coil.grossWeight }}t</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.netWeight">
|
||||
<span class="param-label">净重:</span>
|
||||
<span class="param-value">{{ coil.netWeight }}t</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.length">
|
||||
<span class="param-label">长度:</span>
|
||||
<span class="param-value">{{ coil.length }}米</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.actualLength">
|
||||
<span class="param-label">实测长度:</span>
|
||||
<span class="param-value">{{ coil.actualLength }}米</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.actualThickness">
|
||||
<span class="param-label">实测厚度:</span>
|
||||
<span class="param-value">{{ coil.actualThickness }}米</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.actualWidth">
|
||||
<span class="param-label">实测宽度:</span>
|
||||
<span class="param-value">{{ coil.actualWidth }}米</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.temperGrade">
|
||||
<span class="param-label">调制度:</span>
|
||||
<span class="param-value">{{ coil.temperGrade }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.coatingType">
|
||||
<span class="param-label">镀层种类:</span>
|
||||
<span class="param-value">{{ coil.coatingType }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.coilSurfaceTreatment">
|
||||
<span class="param-label">钢卷表面处理:</span>
|
||||
<span class="param-value">{{ coil.coilSurfaceTreatment }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.team">
|
||||
<span class="param-label">班组:</span>
|
||||
<span class="param-value">{{ coil.team }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.updateTime">
|
||||
<span class="param-label">更新时间:</span>
|
||||
<span class="param-value">{{ parseTime(coil.updateTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.updateBy">
|
||||
<span class="param-label">更新人:</span>
|
||||
<span class="param-value">{{ coil.updateBy }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.transferType">
|
||||
<span class="param-label">调拨标记:</span>
|
||||
<span class="param-value">{{ coil.transferType }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.remark">
|
||||
<span class="param-label">备注:</span>
|
||||
<span class="param-value">{{ coil.remark }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-setting param-icon"></i>
|
||||
</el-popover>
|
||||
|
||||
<slot name="header"></slot>
|
||||
<!-- <i class="el-icon-view param-icon" @click="handlePreviewLabel(coil)" title="查看标签"></i>
|
||||
<el-button v-loading="buttonLoading" style="margin-left: 0px; padding: 4px !important;" type="text" size="mini"
|
||||
@click="handlePrintLabel(coil)" title="打印标签">打印</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body" style="position: relative;">
|
||||
<slot name="body">
|
||||
<div class="info-list">
|
||||
<div class="info-coil">
|
||||
<span class="info-label">入场:</span>
|
||||
<span class="info-value" :title="coil.enterCoilNo">{{ coil.enterCoilNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
<span class="info-label">厂家:</span>
|
||||
<span class="info-value" :title="coil.supplierCoilNo">{{ coil.supplierCoilNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
<span class="info-label">库位:</span>
|
||||
<span class="info-value" :title="coil.warehouseName">{{ coil.warehouseName || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
<span class="info-label">规格:</span>
|
||||
<span class="info-value" :title="coil.specification">{{ coil.specification || '—'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
<span class="info-label">重量:</span>
|
||||
<span class="info-value">{{ coil.netWeight || '—' }}t</span>
|
||||
</div>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<slot name="footer"></slot>
|
||||
<!-- <el-button v-if="useSpecialSplit" :style="splitButtonStyle" icon="el-icon-scissors" size="mini"
|
||||
@click="handleStartSplit(coil)" :loading="buttonLoading" class="action-btn">加工</el-button>
|
||||
<el-button v-else type="primary" icon="el-icon-check" size="mini" @click="handlePickMaterial(coil)"
|
||||
:loading="buttonLoading" class="action-btn">领料</el-button>
|
||||
<el-button type="danger" icon="el-icon-alarm-clock" :plain="coil.abnormalCount == 0" size="mini"
|
||||
@click="handleAddAbnormal(coil)" :loading="buttonLoading" class="action-btn">
|
||||
缺陷明细
|
||||
<span v-if="coil.abnormalCount > 0">({{ coil.abnormalCount }})</span>
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CoilCard',
|
||||
props: {
|
||||
coil: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
},
|
||||
cardStyle: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.material-card {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: all 0.3s ease;
|
||||
height: 100%;
|
||||
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 6px rgba(64, 158, 255, 0.12);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
background-color: #fafafa;
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.coil-no-tag {
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
.material-type {
|
||||
font-size: 11px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.param-icon {
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
cursor: pointer;
|
||||
transition: color 0.3s;
|
||||
|
||||
&:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 8px;
|
||||
flex: 1;
|
||||
|
||||
.info-list {
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
color: #909399;
|
||||
white-space: nowrap;
|
||||
margin-right: 4px;
|
||||
min-width: 40px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
padding: 6px 8px;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
background-color: #fafafa;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.action-btn {
|
||||
width: 100%;
|
||||
padding: 5px 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div :class="{'g-coil-no': isGCoilNo}">
|
||||
<!-- 有coilId时显示popover,无则只显示标签 -->
|
||||
<el-popover
|
||||
v-if="coilId"
|
||||
v-if="coilId || (coil && coil.currentCoilNo)"
|
||||
placement="left"
|
||||
width="200"
|
||||
trigger="hover"
|
||||
@@ -38,6 +38,10 @@
|
||||
<span class="label">实测长度:</span>
|
||||
<span class="value">{{ actualLength }}</span>
|
||||
</div>
|
||||
<div class="info-item" v-if="actualLength">
|
||||
<span class="label">实测厚度:</span>
|
||||
<span class="value">{{ actualThickness }}</span>
|
||||
</div>
|
||||
<div class="info-item" v-if="actualWidth">
|
||||
<span class="label">实测宽度:</span>
|
||||
<span class="value">{{ actualWidth }}</span>
|
||||
@@ -69,6 +73,10 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
coil: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() { // 修正:data应该是函数
|
||||
return {
|
||||
@@ -80,34 +88,37 @@ export default {
|
||||
return this.coilNo && this.coilNo.startsWith('G');
|
||||
},
|
||||
specification() {
|
||||
return this.coilInfo.specification || '-'
|
||||
return this.coilInfo.specification || this.coil?.specification || '-'
|
||||
},
|
||||
itemName() {
|
||||
return this.coilInfo.itemName || '-'
|
||||
return this.coilInfo.itemName || this.coil?.itemName || '-'
|
||||
},
|
||||
material() {
|
||||
return this.coilInfo.material || '-'
|
||||
return this.coilInfo.material || this.coil?.material || '-'
|
||||
},
|
||||
manufacturer() {
|
||||
return this.coilInfo.manufacturer || '-'
|
||||
return this.coilInfo.manufacturer || this.coil?.manufacturer || '-'
|
||||
},
|
||||
currentCoilNo() {
|
||||
return this.coilNo || this.coilInfo?.currentCoilNo || '-'
|
||||
return this.coilNo || this.coil?.currentCoilNo || this.coilInfo?.currentCoilNo || '-'
|
||||
},
|
||||
netWeight() {
|
||||
return this.coilInfo.netWeight || '-'
|
||||
return this.coilInfo.netWeight || this.coil?.netWeight || '-'
|
||||
},
|
||||
supplierCoilNo() {
|
||||
return this.coilInfo.supplierCoilNo || '-'
|
||||
return this.coilInfo.supplierCoilNo || this.coil?.supplierCoilNo || '-'
|
||||
},
|
||||
length() {
|
||||
return this.coilInfo.length || '-'
|
||||
return this.coilInfo.length || this.coil?.length || '-'
|
||||
},
|
||||
actualLength() {
|
||||
return this.coilInfo.actualLength || '-'
|
||||
return this.coilInfo.actualLength || this.coil?.actualLength || '-'
|
||||
},
|
||||
actualWidth() {
|
||||
return this.coilInfo.actualWidth || '-'
|
||||
return this.coilInfo.actualWidth || this.coil?.actualWidth || '-'
|
||||
},
|
||||
actualThickness() {
|
||||
return this.coilInfo.actualThickness || this.coil?.actualThickness || '-'
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -133,7 +144,7 @@ export default {
|
||||
if (newVal) {
|
||||
this.getCoilInfo();
|
||||
} else {
|
||||
this.coilInfo = {};
|
||||
this.coilInfo = this.coil || {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ export default {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
productId: this.product.itemId || '',
|
||||
productName: this.product.itemName || '',
|
||||
productId: this.product.itemId || this.product.productId || '',
|
||||
productName: this.product.itemName || this.product.productName || '',
|
||||
// productCode: this.product.productCode || '',
|
||||
specification: this.product.specification || '',
|
||||
material: this.product.material || '',
|
||||
|
||||
@@ -51,8 +51,8 @@ export default {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
rawMaterialId: this.material.itemId || '',
|
||||
rawMaterialName: this.material.itemName || '',
|
||||
rawMaterialId: this.material.itemId || this.material.rawMaterialId || '',
|
||||
rawMaterialName: this.material.itemName || this.material.rawMaterialName || '',
|
||||
// rawMaterialCode: this.material.rawMaterialCode || '',
|
||||
specification: this.material.specification || '',
|
||||
material: this.material.material || '',
|
||||
|
||||
@@ -74,8 +74,10 @@ export default {
|
||||
console.log('仓库API返回数据:', response);
|
||||
const data = response.data || [];
|
||||
console.log('处理后的数据:', data);
|
||||
this.warehouseOptions = this.buildTreeOptions(data);
|
||||
console.log('构建的树形选项:', this.warehouseOptions);
|
||||
let options = this.buildTreeOptions(data);
|
||||
options = this.sortOptionsByUsage(options);
|
||||
this.warehouseOptions = options;
|
||||
console.log('构建并排序后的树形选项:', this.warehouseOptions);
|
||||
}).catch(error => {
|
||||
console.error("加载仓库选项失败:", error);
|
||||
this.warehouseOptions = [];
|
||||
@@ -106,7 +108,36 @@ export default {
|
||||
|
||||
return options;
|
||||
},
|
||||
getWarehouseUsage() {
|
||||
try {
|
||||
const usage = localStorage.getItem('warehouseUsage');
|
||||
return usage ? JSON.parse(usage) : {};
|
||||
} catch (error) {
|
||||
console.error('获取仓库使用记录失败:', error);
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateWarehouseUsage(warehouseId) {
|
||||
try {
|
||||
const usage = this.getWarehouseUsage();
|
||||
usage[warehouseId] = (usage[warehouseId] || 0) + 1;
|
||||
localStorage.setItem('warehouseUsage', JSON.stringify(usage));
|
||||
} catch (error) {
|
||||
console.error('更新仓库使用记录失败:', error);
|
||||
}
|
||||
},
|
||||
sortOptionsByUsage(options) {
|
||||
const usage = this.getWarehouseUsage();
|
||||
return options.sort((a, b) => {
|
||||
const usageA = usage[a.warehouseId] || 0;
|
||||
const usageB = usage[b.warehouseId] || 0;
|
||||
return usageB - usageA;
|
||||
});
|
||||
},
|
||||
onChange(val) {
|
||||
if (val) {
|
||||
this.updateWarehouseUsage(val);
|
||||
}
|
||||
this.$emit('input', val);
|
||||
this.$emit('change', val);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
<script>
|
||||
import { listWarehouse } from '@/api/wms/warehouse';
|
||||
// import { listActualWarehouse } from '@/api/wms/actualWarehouse';
|
||||
import { treeActualWarehouseTwoLevel } from '@/api/wms/actualWarehouse';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<transition name="el-fade-in-linear">
|
||||
<div v-if="tooltipVisible && data" class="row-tooltip" :style="adjustedTooltipStyle" ref="rowTooltip">
|
||||
<slot>
|
||||
<div class="tooltip-list">
|
||||
<div class="tooltip-list" :style="{ gridTemplateColumns: `repeat(${columnCount}, 1fr)` }">
|
||||
<div class="tooltip-item" v-for="field in visibleColumns" :key="field.prop">
|
||||
<span class="label">{{ field.label }}:</span>
|
||||
<span class="value">{{ formatTooltipValue(data, field) }}</span>
|
||||
@@ -21,6 +21,10 @@ export default {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
columnCount: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
@@ -45,15 +49,34 @@ export default {
|
||||
const tooltipRect = this.$refs.rowTooltip?.getBoundingClientRect();
|
||||
if (!tooltipRect) return this.tooltipStyle;
|
||||
|
||||
// 检查是否超出底部边界
|
||||
if (parseInt(top) + tooltipRect.height > window.innerHeight) {
|
||||
return { ...this.tooltipStyle, top: `${window.innerHeight - tooltipRect.height - 12}px` };
|
||||
let adjustedTop = parseInt(top);
|
||||
let adjustedLeft = parseInt(left);
|
||||
const offset = 16;
|
||||
|
||||
// 检查是否超出底部边界 - 如果超出,将浮层显示在鼠标上方
|
||||
if (adjustedTop + tooltipRect.height > window.innerHeight) {
|
||||
adjustedTop = adjustedTop - tooltipRect.height - offset;
|
||||
}
|
||||
// 检查是否超出右侧边界
|
||||
if (parseInt(left) + tooltipRect.width > window.innerWidth) {
|
||||
return { ...this.tooltipStyle, left: `${window.innerWidth - tooltipRect.width - 16}px` };
|
||||
|
||||
// 检查是否超出右侧边界 - 如果超出,将浮层显示在鼠标左侧
|
||||
if (adjustedLeft + tooltipRect.width > window.innerWidth) {
|
||||
adjustedLeft = adjustedLeft - tooltipRect.width - offset;
|
||||
}
|
||||
return this.tooltipStyle;
|
||||
|
||||
// 检查是否超出顶部边界
|
||||
if (adjustedTop < 0) {
|
||||
adjustedTop = offset;
|
||||
}
|
||||
|
||||
// 检查是否超出左侧边界
|
||||
if (adjustedLeft < 0) {
|
||||
adjustedLeft = offset;
|
||||
}
|
||||
|
||||
return {
|
||||
top: `${adjustedTop}px`,
|
||||
left: `${adjustedLeft}px`
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -98,9 +121,28 @@ export default {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
padding: 12px 14px;
|
||||
pointer-events: none;
|
||||
z-index: 5;
|
||||
/* max-height: 70%; */
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.tooltip-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tooltip-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tooltip-item .label {
|
||||
flex-shrink: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.tooltip-item .value {
|
||||
color: #333;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user