Showing
8 changed files
with
631 additions
and
0 deletions
| @@ -290,6 +290,33 @@ public class QueryOrderDetailReportBo extends BaseBo<OrderDetailReport> { | @@ -290,6 +290,33 @@ public class QueryOrderDetailReportBo extends BaseBo<OrderDetailReport> { | ||
| 290 | @ApiModelProperty("工艺要求") | 290 | @ApiModelProperty("工艺要求") |
| 291 | private String productionProcess; | 291 | private String productionProcess; |
| 292 | 292 | ||
| 293 | + @ApiModelProperty("办事处代码") | ||
| 294 | + private String officeCode; | ||
| 295 | + | ||
| 296 | + @ApiModelProperty("办事处") | ||
| 297 | + private String officeName; | ||
| 298 | + | ||
| 299 | + @ApiModelProperty("客户简称") | ||
| 300 | + private String customerShortName; | ||
| 301 | + | ||
| 302 | + @ApiModelProperty("结算方式或期限") | ||
| 303 | + private String settlementTerms; | ||
| 304 | + | ||
| 305 | + @ApiModelProperty("执行标准") | ||
| 306 | + private String executionStandard; | ||
| 307 | + | ||
| 308 | + @ApiModelProperty("结构报表用(产品名称)") | ||
| 309 | + private String structureReportUsed; | ||
| 310 | + | ||
| 311 | + @ApiModelProperty("合同类型编码") | ||
| 312 | + private String contractTypeCode; | ||
| 313 | + | ||
| 314 | + @ApiModelProperty("特别注重要求") | ||
| 315 | + private String specialRequirements; | ||
| 316 | + | ||
| 317 | + @ApiModelProperty("合同创建人") | ||
| 318 | + private String contractCreateBy; | ||
| 319 | + | ||
| 293 | public QueryOrderDetailReportBo() { | 320 | public QueryOrderDetailReportBo() { |
| 294 | 321 | ||
| 295 | } | 322 | } |
| @@ -14,6 +14,7 @@ import com.lframework.xingyun.sc.entity.OrderDetailReport; | @@ -14,6 +14,7 @@ import com.lframework.xingyun.sc.entity.OrderDetailReport; | ||
| 14 | import com.lframework.xingyun.sc.enums.ExportType; | 14 | import com.lframework.xingyun.sc.enums.ExportType; |
| 15 | import com.lframework.xingyun.sc.excel.statistics.OrderDetailReportExportTaskWorker; | 15 | import com.lframework.xingyun.sc.excel.statistics.OrderDetailReportExportTaskWorker; |
| 16 | import com.lframework.xingyun.sc.excel.statistics.QualityOrderDetailReportExportTaskWorker; | 16 | import com.lframework.xingyun.sc.excel.statistics.QualityOrderDetailReportExportTaskWorker; |
| 17 | +import com.lframework.xingyun.sc.excel.statistics.StockInOrderDetailReportExportTaskWorker; | ||
| 17 | import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService; | 18 | import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService; |
| 18 | import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo; | 19 | import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo; |
| 19 | import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo; | 20 | import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo; |
| @@ -64,6 +65,30 @@ public class OrderDetailReportController extends DefaultBaseController { | @@ -64,6 +65,30 @@ public class OrderDetailReportController extends DefaultBaseController { | ||
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | /** | 67 | /** |
| 68 | + * 库存合同未锁价订单明细查询 | ||
| 69 | + */ | ||
| 70 | + @ApiOperation("库存合同未锁价订单明细查询") | ||
| 71 | + @HasPermission({"statistical-report:order-detail:query","statistical-report:quality-order-detail:query"}) | ||
| 72 | + @GetMapping("/inventoryUnlocked/query") | ||
| 73 | + public InvokeResult<PageResult<QueryOrderDetailReportBo>> inventoryUnlockedQuery(@Valid QueryOrderDetailReportVo vo) { | ||
| 74 | + vo.setInventoryUnlockedOnly(Boolean.TRUE); | ||
| 75 | + vo.setExcludeInventoryUnlocked(null); | ||
| 76 | + return query(vo); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 库存入库订单明细查询 | ||
| 81 | + */ | ||
| 82 | + @ApiOperation("库存入库订单明细查询") | ||
| 83 | + @HasPermission({"statistical-report:order-detail:query","statistical-report:quality-order-detail:query"}) | ||
| 84 | + @GetMapping("/stockIn/query") | ||
| 85 | + public InvokeResult<PageResult<QueryOrderDetailReportBo>> stockInQuery(@Valid QueryOrderDetailReportVo vo) { | ||
| 86 | + vo.setExcludeInventoryUnlocked(Boolean.TRUE); | ||
| 87 | + vo.setInventoryUnlockedOnly(null); | ||
| 88 | + return query(vo); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 67 | * 根据ID查询 | 92 | * 根据ID查询 |
| 68 | */ | 93 | */ |
| 69 | @ApiOperation("根据ID查询") | 94 | @ApiOperation("根据ID查询") |
| @@ -108,6 +133,34 @@ public class OrderDetailReportController extends DefaultBaseController { | @@ -108,6 +133,34 @@ public class OrderDetailReportController extends DefaultBaseController { | ||
| 108 | } | 133 | } |
| 109 | 134 | ||
| 110 | /** | 135 | /** |
| 136 | + * 库存入库订单明细导出 | ||
| 137 | + */ | ||
| 138 | + @ApiOperation("库存入库订单明细导出") | ||
| 139 | + @HasPermission({"statistical-report:order-detail:export"}) | ||
| 140 | + @PostMapping("/inventoryUnlocked/export") | ||
| 141 | + public InvokeResult<Void> inventoryUnlockedExport(@Valid @RequestBody QueryOrderDetailReportVo vo) { | ||
| 142 | + vo.setInventoryUnlockedOnly(Boolean.TRUE); | ||
| 143 | + vo.setExcludeInventoryUnlocked(null); | ||
| 144 | + vo.setExportType(ExportType.INVENTORY_UNLOCKED_ORDER_DETAIL_REPORT.getCode()); | ||
| 145 | + ExportTaskUtil.exportTask("库存入库订单明细报表", StockInOrderDetailReportExportTaskWorker.class, vo); | ||
| 146 | + return InvokeResultBuilder.success(); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + /** | ||
| 150 | + * 入库订单明细导出 | ||
| 151 | + */ | ||
| 152 | + @ApiOperation("入库订单明细导出") | ||
| 153 | + @HasPermission({"statistical-report:order-detail:export"}) | ||
| 154 | + @PostMapping("/stockIn/export") | ||
| 155 | + public InvokeResult<Void> stockInExport(@Valid @RequestBody QueryOrderDetailReportVo vo) { | ||
| 156 | + vo.setExcludeInventoryUnlocked(Boolean.TRUE); | ||
| 157 | + vo.setInventoryUnlockedOnly(null); | ||
| 158 | + vo.setExportType(ExportType.STOCK_IN_ORDER_DETAIL_REPORT.getCode()); | ||
| 159 | + ExportTaskUtil.exportTask("入库订单明细报表", StockInOrderDetailReportExportTaskWorker.class, vo); | ||
| 160 | + return InvokeResultBuilder.success(); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + /** | ||
| 111 | * 处理历史数据 | 164 | * 处理历史数据 |
| 112 | */ | 165 | */ |
| 113 | @ApiOperation("处理历史数据") | 166 | @ApiOperation("处理历史数据") |
| @@ -286,4 +286,49 @@ public class OrderDetailReport extends BaseEntity implements BaseDto { | @@ -286,4 +286,49 @@ public class OrderDetailReport extends BaseEntity implements BaseDto { | ||
| 286 | @TableField(fill = FieldFill.INSERT_UPDATE) | 286 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 287 | private LocalDateTime updateTime; | 287 | private LocalDateTime updateTime; |
| 288 | 288 | ||
| 289 | + /** | ||
| 290 | + * 办事处编码 | ||
| 291 | + */ | ||
| 292 | + @TableField(exist = false) | ||
| 293 | + private String deptCode; | ||
| 294 | + | ||
| 295 | + /** | ||
| 296 | + * 客户简称(基础信息-客户简称) | ||
| 297 | + */ | ||
| 298 | + @TableField(exist = false) | ||
| 299 | + private String customerShortName; | ||
| 300 | + | ||
| 301 | + /** | ||
| 302 | + * 结算方式 | ||
| 303 | + */ | ||
| 304 | + @TableField(exist = false) | ||
| 305 | + private String settlementTerms; | ||
| 306 | + | ||
| 307 | + /** | ||
| 308 | + * 执行标准 | ||
| 309 | + */ | ||
| 310 | + @TableField(exist = false) | ||
| 311 | + private String executionStandard; | ||
| 312 | + | ||
| 313 | + /** | ||
| 314 | + * 结构报表用(合同物料行产品ID) | ||
| 315 | + */ | ||
| 316 | + @TableField(exist = false) | ||
| 317 | + private String structureReportUsed; | ||
| 318 | + | ||
| 319 | + /** | ||
| 320 | + * 合同类型编码 | ||
| 321 | + */ | ||
| 322 | + @TableField(exist = false) | ||
| 323 | + private String contractTypeCode; | ||
| 324 | + | ||
| 325 | + /** | ||
| 326 | + * 特别注重要求 | ||
| 327 | + */ | ||
| 328 | + @TableField(exist = false) | ||
| 329 | + private String specialRequirements; | ||
| 330 | + | ||
| 331 | + @TableField(exist = false) | ||
| 332 | + private String contractCreateBy; | ||
| 333 | + | ||
| 289 | } | 334 | } |
| @@ -14,6 +14,8 @@ public enum ExportType implements BaseEnum<String> { | @@ -14,6 +14,8 @@ public enum ExportType implements BaseEnum<String> { | ||
| 14 | ORDER_DETAIL_REPORT("ORDER_DETAIL_REPORT", "订单明细报表"), | 14 | ORDER_DETAIL_REPORT("ORDER_DETAIL_REPORT", "订单明细报表"), |
| 15 | ORDER_EXPORT_ZIP("ORDER_EXPORT_ZIP", "订货单信息"), | 15 | ORDER_EXPORT_ZIP("ORDER_EXPORT_ZIP", "订货单信息"), |
| 16 | QUALITY_ORDER_DETAIL_REPORT("QUALITY_ORDER_DETAIL_REPORT", "品质科订单明细报表"), | 16 | QUALITY_ORDER_DETAIL_REPORT("QUALITY_ORDER_DETAIL_REPORT", "品质科订单明细报表"), |
| 17 | + INVENTORY_UNLOCKED_ORDER_DETAIL_REPORT("INVENTORY_UNLOCKED_ORDER_DETAIL_REPORT", "库存入库订单明细报表"), | ||
| 18 | + STOCK_IN_ORDER_DETAIL_REPORT("STOCK_IN_ORDER_DETAIL_REPORT", "入库订单明细报表"), | ||
| 17 | 19 | ||
| 18 | 20 | ||
| 19 | ; | 21 | ; |
| 1 | +package com.lframework.xingyun.sc.excel.statistics; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.common.utils.CollectionUtil; | ||
| 4 | +import com.lframework.starter.mq.core.components.export.ExportTaskWorker; | ||
| 5 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 6 | +import com.lframework.starter.web.core.utils.ApplicationUtil; | ||
| 7 | +import com.lframework.starter.web.core.utils.JsonUtil; | ||
| 8 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 9 | +import com.lframework.xingyun.sc.bo.statistics.orderDetail.QueryOrderDetailReportBo; | ||
| 10 | +import com.lframework.xingyun.sc.entity.OrderDetailReport; | ||
| 11 | +import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService; | ||
| 12 | +import com.lframework.xingyun.sc.utils.CommonUtil; | ||
| 13 | +import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo; | ||
| 14 | +import org.apache.commons.lang3.StringUtils; | ||
| 15 | + | ||
| 16 | +import java.math.BigDecimal; | ||
| 17 | +import java.time.LocalDate; | ||
| 18 | +import java.time.ZoneId; | ||
| 19 | +import java.util.List; | ||
| 20 | +import java.util.Date; | ||
| 21 | +import java.util.stream.Collectors; | ||
| 22 | + | ||
| 23 | +public class StockInOrderDetailReportExportTaskWorker implements | ||
| 24 | + ExportTaskWorker<QueryOrderDetailReportVo, QueryOrderDetailReportBo, StockInOrderDetailReportModel> { | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + public QueryOrderDetailReportVo parseParams(String json) { | ||
| 28 | + return JsonUtil.parseObject(json, QueryOrderDetailReportVo.class); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + @Override | ||
| 32 | + public PageResult<QueryOrderDetailReportBo> getDataList(int pageIndex, int pageSize, QueryOrderDetailReportVo params) { | ||
| 33 | + OrderDetailReportService orderDetailReportService = ApplicationUtil.getBean(OrderDetailReportService.class); | ||
| 34 | + PageResult<OrderDetailReport> pageResult = orderDetailReportService.query(pageIndex, pageSize, params); | ||
| 35 | + List<QueryOrderDetailReportBo> results = null; | ||
| 36 | + if (!CollectionUtil.isEmpty(pageResult.getDatas())) { | ||
| 37 | + results = pageResult.getDatas().stream().map(QueryOrderDetailReportBo::new).collect(Collectors.toList()); | ||
| 38 | + } | ||
| 39 | + return PageResultUtil.rebuild(pageResult, results); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public StockInOrderDetailReportModel exportData(QueryOrderDetailReportBo data) { | ||
| 44 | + String thicknessTol = CommonUtil.handleTolData( | ||
| 45 | + data.getThicknessTolPos() != null ? data.getThicknessTolPos().doubleValue() : null, | ||
| 46 | + data.getThicknessTolNeg() != null ? data.getThicknessTolNeg().doubleValue() : null); | ||
| 47 | + String widthTol = CommonUtil.handleTolData( | ||
| 48 | + data.getWidthTolPos() != null ? data.getWidthTolPos().doubleValue() : null, | ||
| 49 | + data.getWidthTolNeg() != null ? data.getWidthTolNeg().doubleValue() : null); | ||
| 50 | + String lengthTol = CommonUtil.handleTolData( | ||
| 51 | + data.getLengthTolPos() != null ? data.getLengthTolPos().doubleValue() : null, | ||
| 52 | + data.getLengthTolNeg() != null ? data.getLengthTolNeg().doubleValue() : null); | ||
| 53 | + | ||
| 54 | + StockInOrderDetailReportModel model = new StockInOrderDetailReportModel(); | ||
| 55 | + model.setOrderNo(data.getOrderNo()); | ||
| 56 | + model.setDeptCode(convertDeptNameToDeptCode(data.getDeptName())); | ||
| 57 | + model.setCustomerShortName(data.getCustomerShortName()); | ||
| 58 | + model.setOrderDate(toDate(data.getOrderDate())); | ||
| 59 | + model.setWorkshopName(data.getWorkshopName()); | ||
| 60 | + model.setDeptName(data.getDeptName()); | ||
| 61 | + model.setRegionName(data.getRegionName()); | ||
| 62 | + model.setCustomerName(data.getOrderingUnitName()); | ||
| 63 | + model.setIndustry(data.getIndustry()); | ||
| 64 | + model.setStructureReportUsed(data.getStructureReportUsed()); | ||
| 65 | + model.setBrand(data.getBrand()); | ||
| 66 | + model.setThickness(data.getThickness()); | ||
| 67 | + model.setThicknessTol(thicknessTol); | ||
| 68 | + model.setWidth(data.getWidth()); | ||
| 69 | + model.setWidthTol(widthTol); | ||
| 70 | + model.setLength(data.getLength()); | ||
| 71 | + model.setLengthTol(lengthTol); | ||
| 72 | + model.setStatus(data.getStatus()); | ||
| 73 | + model.setQuantity(data.getQuantity()); | ||
| 74 | + model.setSuggestedPrice(toBigDecimalOrZero(data.getSuggestedPrice())); | ||
| 75 | + model.setDeliveryDate(toDate(data.getDeliveryDate())); | ||
| 76 | + model.setAssessmentExceedsAgreement(toBigDecimalOrZero(data.getAssessmentExceedsAgreement())); | ||
| 77 | + model.setExecutionStandard(data.getExecutionStandard()); | ||
| 78 | + model.setSalesPrice(toBigDecimalOrZero(data.getSalesPrice())); | ||
| 79 | + model.setPriceListNo(data.getPriceListNo()); | ||
| 80 | + model.setPackagingFee(toBigDecimalOrZero(data.getPackagingFee())); | ||
| 81 | + model.setSettlementTerms(data.getSettlementTerms()); | ||
| 82 | + model.setPieceWeightHeader(data.getPieceWeightHeader()); | ||
| 83 | + model.setSurface(data.getSurface()); | ||
| 84 | + model.setTolerance(data.getTolerance()); | ||
| 85 | + model.setPerformance(data.getPerformance()); | ||
| 86 | + model.setPackaging(data.getPackaging()); | ||
| 87 | + model.setSpecialRequirements(data.getSpecialRequirements()); | ||
| 88 | + model.setRemarks(data.getRemarks()); | ||
| 89 | + model.setSalesman(data.getContractCreateBy()); | ||
| 90 | + model.setShippingCost(toBigDecimalOrZero(data.getShippingCost())); | ||
| 91 | + model.setReturnShippingCost(toBigDecimalOrZero(data.getReturnShippingCost())); | ||
| 92 | + model.setCustomerType(data.getCustomerType()); | ||
| 93 | + model.setQuality(data.getQuality()); | ||
| 94 | + model.setProcessingAndDistributor(data.getContractType()); | ||
| 95 | + model.setActualCustomer(data.getOrderingUnitName()); | ||
| 96 | + model.setOrderType(handleContractType(data.getContractTypeCode())); | ||
| 97 | + model.setLeadCadmiumPpm("Pb≤ppm\n" + "Cd≤ppm"); | ||
| 98 | + model.setIronConductivity("Fe≤ppm\n" + "Co+Ni≤ppm\n" + "%IACS"); | ||
| 99 | + model.setReserve1(data.getIndustry()); | ||
| 100 | + model.setReserve3(data.getOrderNo()); | ||
| 101 | + return model; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + @Override | ||
| 105 | + public Class<StockInOrderDetailReportModel> getModelClass() { | ||
| 106 | + return StockInOrderDetailReportModel.class; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + private static Date toDate(LocalDate date) { | ||
| 110 | + if (date == null) { | ||
| 111 | + return null; | ||
| 112 | + } | ||
| 113 | + return Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + private static BigDecimal toBigDecimalOrZero(String value) { | ||
| 117 | + if (StringUtils.isBlank(value)) { | ||
| 118 | + return BigDecimal.ZERO; | ||
| 119 | + } | ||
| 120 | + try { | ||
| 121 | + return new BigDecimal(value.trim()); | ||
| 122 | + } catch (Exception e) { | ||
| 123 | + return BigDecimal.ZERO; | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + private static String handleContractType(String contractType) { | ||
| 128 | + if ("DISTRIB_STD".equals(contractType)) { | ||
| 129 | + return "经销标准"; | ||
| 130 | + } | ||
| 131 | + if ("DIST_STOCK_CONTRACT".equals(contractType)) { | ||
| 132 | + return "经销库存"; | ||
| 133 | + } | ||
| 134 | + if ("DRAFT_DIST_AGMT".equals(contractType)) { | ||
| 135 | + return "经销未锁规"; | ||
| 136 | + } | ||
| 137 | + if ("INTL_STD_CONTRACT".equals(contractType)) { | ||
| 138 | + return "外贸标准"; | ||
| 139 | + } | ||
| 140 | + if ("INTL_INVENTORY_AGMT".equals(contractType)) { | ||
| 141 | + return "外贸库存"; | ||
| 142 | + } | ||
| 143 | + if ("INTL_OPEN_SPEC_AGMT".equals(contractType)) { | ||
| 144 | + return "外贸未锁规"; | ||
| 145 | + } | ||
| 146 | + if ("PROCESS_STD_AGMT".equals(contractType)) { | ||
| 147 | + return "加工标准"; | ||
| 148 | + } | ||
| 149 | + return null; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + private static String convertDeptNameToDeptCode(String deptName) { | ||
| 153 | + if (StringUtils.isBlank(deptName)) { | ||
| 154 | + return null; | ||
| 155 | + } | ||
| 156 | + String name = deptName.trim(); | ||
| 157 | + if (name.contains("北方")) { | ||
| 158 | + return "BF"; | ||
| 159 | + } | ||
| 160 | + if (name.contains("常州")) { | ||
| 161 | + return "CZ"; | ||
| 162 | + } | ||
| 163 | + if (name.contains("东莞")) { | ||
| 164 | + return "DG"; | ||
| 165 | + } | ||
| 166 | + if (name.contains("佛山")) { | ||
| 167 | + return "FS"; | ||
| 168 | + } | ||
| 169 | + if (name.contains("宁波")) { | ||
| 170 | + return "NB"; | ||
| 171 | + } | ||
| 172 | + if (name.contains("苏州")) { | ||
| 173 | + return "SZ"; | ||
| 174 | + } | ||
| 175 | + if (name.contains("温州")) { | ||
| 176 | + return "WZ"; | ||
| 177 | + } | ||
| 178 | + if (name.contains("紫铜")) { | ||
| 179 | + return "ZT"; | ||
| 180 | + } | ||
| 181 | + if (name.contains("外贸")) { | ||
| 182 | + return "WM"; | ||
| 183 | + } | ||
| 184 | + return null; | ||
| 185 | + } | ||
| 186 | +} | ||
| 187 | + |
| 1 | +package com.lframework.xingyun.sc.excel.statistics; | ||
| 2 | + | ||
| 3 | +import com.alibaba.excel.annotation.ExcelProperty; | ||
| 4 | +import com.alibaba.excel.annotation.format.DateTimeFormat; | ||
| 5 | +import com.lframework.starter.common.constants.StringPool; | ||
| 6 | +import com.lframework.starter.web.core.components.excel.ExcelModel; | ||
| 7 | +import lombok.Data; | ||
| 8 | + | ||
| 9 | +import java.math.BigDecimal; | ||
| 10 | +import java.util.Date; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 库存入库订单明细 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +public class StockInOrderDetailReportModel implements ExcelModel { | ||
| 17 | + | ||
| 18 | + @ExcelProperty(value = "订单编号", index = 0) | ||
| 19 | + private String orderNo; | ||
| 20 | + | ||
| 21 | + @ExcelProperty(value = "办事处编码", index = 1) | ||
| 22 | + private String deptCode; | ||
| 23 | + | ||
| 24 | + @ExcelProperty(value = "客户简称", index = 2) | ||
| 25 | + private String customerShortName; | ||
| 26 | + | ||
| 27 | + @ExcelProperty(value = "订货日期", index = 3) | ||
| 28 | + @DateTimeFormat(StringPool.EXCEL_DATE_PATTERN) | ||
| 29 | + private Date orderDate; | ||
| 30 | + | ||
| 31 | + @ExcelProperty(value = "生产厂", index = 4) | ||
| 32 | + private String workshopName; | ||
| 33 | + | ||
| 34 | + @ExcelProperty(value = "科办", index = 5) | ||
| 35 | + private String deptName; | ||
| 36 | + | ||
| 37 | + @ExcelProperty(value = "片", index = 6) | ||
| 38 | + private String regionName; | ||
| 39 | + | ||
| 40 | + @ExcelProperty(value = "客户名称", index = 7) | ||
| 41 | + private String customerName; | ||
| 42 | + | ||
| 43 | + @ExcelProperty(value = "行业(用途)", index = 8) | ||
| 44 | + private String industry; | ||
| 45 | + | ||
| 46 | + @ExcelProperty(value = "结构报表用", index = 9) | ||
| 47 | + private String structureReportUsed; | ||
| 48 | + | ||
| 49 | + @ExcelProperty(value = "牌号", index = 10) | ||
| 50 | + private String brand; | ||
| 51 | + | ||
| 52 | + @ExcelProperty(value = "厚", index = 11) | ||
| 53 | + private BigDecimal thickness; | ||
| 54 | + | ||
| 55 | + @ExcelProperty(value = "误差", index = 12) | ||
| 56 | + private String thicknessTol; | ||
| 57 | + | ||
| 58 | + @ExcelProperty(value = "宽", index = 13) | ||
| 59 | + private BigDecimal width; | ||
| 60 | + | ||
| 61 | + @ExcelProperty(value = "误差", index = 14) | ||
| 62 | + private String widthTol; | ||
| 63 | + | ||
| 64 | + @ExcelProperty(value = "长", index = 15) | ||
| 65 | + private BigDecimal length; | ||
| 66 | + | ||
| 67 | + @ExcelProperty(value = "误差", index = 16) | ||
| 68 | + private String lengthTol; | ||
| 69 | + | ||
| 70 | + @ExcelProperty(value = "状态", index = 17) | ||
| 71 | + private String status; | ||
| 72 | + | ||
| 73 | + @ExcelProperty(value = "订单数量", index = 18) | ||
| 74 | + private BigDecimal quantity; | ||
| 75 | + | ||
| 76 | + @ExcelProperty(value = "指导价", index = 19) | ||
| 77 | + private BigDecimal suggestedPrice; | ||
| 78 | + | ||
| 79 | + @ExcelProperty(value = "交货日期", index = 20) | ||
| 80 | + @DateTimeFormat(StringPool.EXCEL_DATE_PATTERN) | ||
| 81 | + private Date deliveryDate; | ||
| 82 | + | ||
| 83 | + @ExcelProperty(value = "超价协调价", index = 21) | ||
| 84 | + private BigDecimal assessmentExceedsAgreement; | ||
| 85 | + | ||
| 86 | + @ExcelProperty(value = "执行标准", index = 22) | ||
| 87 | + private String executionStandard; | ||
| 88 | + | ||
| 89 | + @ExcelProperty(value = "销售价", index = 23) | ||
| 90 | + private BigDecimal salesPrice; | ||
| 91 | + | ||
| 92 | + @ExcelProperty(value = "价格表编号", index = 24) | ||
| 93 | + private String priceListNo; | ||
| 94 | + | ||
| 95 | + @ExcelProperty(value = "包装费", index = 25) | ||
| 96 | + private BigDecimal packagingFee; | ||
| 97 | + | ||
| 98 | + @ExcelProperty(value = "结算方式", index = 26) | ||
| 99 | + private String settlementTerms; | ||
| 100 | + | ||
| 101 | + @ExcelProperty(value = "件重条头", index = 27) | ||
| 102 | + private String pieceWeightHeader; | ||
| 103 | + | ||
| 104 | + @ExcelProperty(value = "表面", index = 28) | ||
| 105 | + private String surface; | ||
| 106 | + | ||
| 107 | + @ExcelProperty(value = "公差", index = 29) | ||
| 108 | + private String tolerance; | ||
| 109 | + | ||
| 110 | + @ExcelProperty(value = "性能", index = 30) | ||
| 111 | + private String performance; | ||
| 112 | + | ||
| 113 | + @ExcelProperty(value = "包装", index = 31) | ||
| 114 | + private String packaging; | ||
| 115 | + | ||
| 116 | + @ExcelProperty(value = "特别注重要求", index = 32) | ||
| 117 | + private String specialRequirements; | ||
| 118 | + | ||
| 119 | + @ExcelProperty(value = "备注", index = 33) | ||
| 120 | + private String remarks; | ||
| 121 | + | ||
| 122 | + @ExcelProperty(value = "业务员", index = 34) | ||
| 123 | + private String salesman; | ||
| 124 | + | ||
| 125 | + @ExcelProperty(value = "运费", index = 35) | ||
| 126 | + private BigDecimal shippingCost; | ||
| 127 | + | ||
| 128 | + @ExcelProperty(value = "回程运费", index = 36) | ||
| 129 | + private BigDecimal returnShippingCost; | ||
| 130 | + | ||
| 131 | + @ExcelProperty(value = "客户类型", index = 37) | ||
| 132 | + private String customerType; | ||
| 133 | + | ||
| 134 | + @ExcelProperty(value = "品质", index = 38) | ||
| 135 | + private String quality; | ||
| 136 | + | ||
| 137 | + @ExcelProperty(value = "加工双经销", index = 39) | ||
| 138 | + private String processingAndDistributor; | ||
| 139 | + | ||
| 140 | + @ExcelProperty(value = "实际客户", index = 40) | ||
| 141 | + private String actualCustomer; | ||
| 142 | + | ||
| 143 | + @ExcelProperty(value = "订单类型", index = 41) | ||
| 144 | + private String orderType; | ||
| 145 | + | ||
| 146 | + @ExcelProperty(value = "铅、镉含量ppm", index = 42) | ||
| 147 | + private String leadCadmiumPpm; | ||
| 148 | + | ||
| 149 | + @ExcelProperty(value = "铁含量导电率%IACS", index = 43) | ||
| 150 | + private String ironConductivity; | ||
| 151 | + | ||
| 152 | + @ExcelProperty(value = "备用", index = 44) | ||
| 153 | + private String reserve1; | ||
| 154 | + | ||
| 155 | + @ExcelProperty(value = "加工来料", index = 45) | ||
| 156 | + private String processingIncomingMaterial; | ||
| 157 | + | ||
| 158 | + @ExcelProperty(value = "加工料补价代购锌锭", index = 46) | ||
| 159 | + private String processingExtraPriceOrPurchaseZinc; | ||
| 160 | + | ||
| 161 | + @ExcelProperty(value = "备用", index = 47) | ||
| 162 | + private String reserve2; | ||
| 163 | + | ||
| 164 | + @ExcelProperty(value = "备用", index = 48) | ||
| 165 | + private String reserve3; | ||
| 166 | + | ||
| 167 | + @ExcelProperty(value = "备用", index = 49) | ||
| 168 | + private String reserve4; | ||
| 169 | + | ||
| 170 | + @ExcelProperty(value = "其中行业", index = 50) | ||
| 171 | + private String industryIncluded; | ||
| 172 | + | ||
| 173 | + @ExcelProperty(value = "行业", index = 51) | ||
| 174 | + private String industryStandard; | ||
| 175 | + | ||
| 176 | + @ExcelProperty(value = "客户简称", index = 52) | ||
| 177 | + private String customerShortName2; | ||
| 178 | + | ||
| 179 | + @ExcelProperty(value = "品种", index = 53) | ||
| 180 | + private String variety; | ||
| 181 | + | ||
| 182 | + @ExcelProperty(value = "三厂库存", index = 54) | ||
| 183 | + private String thirdFactoryStock; | ||
| 184 | + | ||
| 185 | + @ExcelProperty(value = "电缆分类", index = 55) | ||
| 186 | + private String cableCategory; | ||
| 187 | + | ||
| 188 | + @ExcelProperty(value = "备用", index = 56) | ||
| 189 | + private String reserve5; | ||
| 190 | + | ||
| 191 | + @ExcelProperty(value = "备用", index = 57) | ||
| 192 | + private String reserve6; | ||
| 193 | + | ||
| 194 | + @ExcelProperty(value = "备用", index = 58) | ||
| 195 | + private String reserve7; | ||
| 196 | + | ||
| 197 | + @ExcelProperty(value = "备用", index = 59) | ||
| 198 | + private String reserve8; | ||
| 199 | + | ||
| 200 | + @ExcelProperty(value = "备用", index = 60) | ||
| 201 | + private String reserve9; | ||
| 202 | + | ||
| 203 | + @ExcelProperty(value = "备用", index = 61) | ||
| 204 | + private String reserve10; | ||
| 205 | + | ||
| 206 | + @ExcelProperty(value = "备用", index = 62) | ||
| 207 | + private String reserve11; | ||
| 208 | + | ||
| 209 | + @ExcelProperty(value = "备用", index = 63) | ||
| 210 | + private String reserve12; | ||
| 211 | + | ||
| 212 | + @ExcelProperty(value = "备用", index = 64) | ||
| 213 | + private String reserve13; | ||
| 214 | + | ||
| 215 | + @ExcelProperty(value = "备用", index = 65) | ||
| 216 | + private String reserve14; | ||
| 217 | + | ||
| 218 | + @ExcelProperty(value = "备用", index = 66) | ||
| 219 | + private String reserve15; | ||
| 220 | + | ||
| 221 | + @ExcelProperty(value = "备用", index = 67) | ||
| 222 | + private String reserve16; | ||
| 223 | + | ||
| 224 | + @ExcelProperty(value = "备用", index = 68) | ||
| 225 | + private String reserve17; | ||
| 226 | + | ||
| 227 | + @ExcelProperty(value = "备用", index = 69) | ||
| 228 | + private String reserve18; | ||
| 229 | + | ||
| 230 | + @ExcelProperty(value = "备用", index = 70) | ||
| 231 | + private String reserve19; | ||
| 232 | + | ||
| 233 | + @ExcelProperty(value = "备用", index = 71) | ||
| 234 | + private String reserve20; | ||
| 235 | + | ||
| 236 | + @ExcelProperty(value = "备用", index = 72) | ||
| 237 | + private String reserve21; | ||
| 238 | + | ||
| 239 | + @ExcelProperty(value = "备用", index = 73) | ||
| 240 | + private String reserve22; | ||
| 241 | + | ||
| 242 | + @ExcelProperty(value = "备用", index = 74) | ||
| 243 | + private String reserve23; | ||
| 244 | + | ||
| 245 | + @ExcelProperty(value = "备用", index = 75) | ||
| 246 | + private String reserve24; | ||
| 247 | + | ||
| 248 | + @ExcelProperty(value = "备用", index = 76) | ||
| 249 | + private String reserve25; | ||
| 250 | + | ||
| 251 | + @ExcelProperty(value = "备用", index = 77) | ||
| 252 | + private String reserve26; | ||
| 253 | + | ||
| 254 | + @ExcelProperty(value = "备用", index = 78) | ||
| 255 | + private String reserve27; | ||
| 256 | + | ||
| 257 | + @ExcelProperty(value = "备用", index = 79) | ||
| 258 | + private String reserve28; | ||
| 259 | + | ||
| 260 | + @ExcelProperty(value = "备用", index = 80) | ||
| 261 | + private String reserve29; | ||
| 262 | + | ||
| 263 | + @ExcelProperty(value = "备用", index = 81) | ||
| 264 | + private String reserve30; | ||
| 265 | + | ||
| 266 | + @ExcelProperty(value = "备用", index = 82) | ||
| 267 | + private String reserve31; | ||
| 268 | + | ||
| 269 | + @ExcelProperty(value = "备用", index = 83) | ||
| 270 | + private String reserve32; | ||
| 271 | + | ||
| 272 | + @ExcelProperty(value = "备用", index = 84) | ||
| 273 | + private String reserve33; | ||
| 274 | + | ||
| 275 | + @ExcelProperty(value = "备用", index = 85) | ||
| 276 | + private String reserve34; | ||
| 277 | + | ||
| 278 | + @ExcelProperty(value = "备用", index = 86) | ||
| 279 | + private String reserve35; | ||
| 280 | +} |
| @@ -95,4 +95,10 @@ public class QueryOrderDetailReportVo extends PageVo implements BaseVo, Serializ | @@ -95,4 +95,10 @@ public class QueryOrderDetailReportVo extends PageVo implements BaseVo, Serializ | ||
| 95 | @ApiModelProperty("状态") | 95 | @ApiModelProperty("状态") |
| 96 | private String status; | 96 | private String status; |
| 97 | 97 | ||
| 98 | + @ApiModelProperty("仅查询库存合同未锁价订单明细") | ||
| 99 | + private Boolean inventoryUnlockedOnly; | ||
| 100 | + | ||
| 101 | + @ApiModelProperty("排除库存合同未锁价订单明细(入库订单明细)") | ||
| 102 | + private Boolean excludeInventoryUnlocked; | ||
| 103 | + | ||
| 98 | } | 104 | } |
| @@ -54,6 +54,13 @@ | @@ -54,6 +54,13 @@ | ||
| 54 | <result column="update_by" property="updateBy"/> | 54 | <result column="update_by" property="updateBy"/> |
| 55 | <result column="create_time" property="createTime"/> | 55 | <result column="create_time" property="createTime"/> |
| 56 | <result column="update_time" property="updateTime"/> | 56 | <result column="update_time" property="updateTime"/> |
| 57 | + <result column="customer_short_name" property="customerShortName"/> | ||
| 58 | + <result column="settlement_terms" property="settlementTerms"/> | ||
| 59 | + <result column="execution_standard" property="executionStandard"/> | ||
| 60 | + <result column="structure_report_used" property="structureReportUsed"/> | ||
| 61 | + <result column="contract_type_code" property="contractTypeCode"/> | ||
| 62 | + <result column="special_requirements" property="specialRequirements"/> | ||
| 63 | + <result column="contract_create_by" property="contractCreateBy"/> | ||
| 57 | </resultMap> | 64 | </resultMap> |
| 58 | 65 | ||
| 59 | <sql id="OrderDetailReport_sql"> | 66 | <sql id="OrderDetailReport_sql"> |
| @@ -197,9 +204,25 @@ | @@ -197,9 +204,25 @@ | ||
| 197 | tb.update_by, | 204 | tb.update_by, |
| 198 | tb.create_time, | 205 | tb.create_time, |
| 199 | tb.update_time, | 206 | tb.update_time, |
| 207 | + cs.short_name AS customer_short_name, | ||
| 208 | + poi.settlement_terms AS settlement_terms, | ||
| 209 | + poi.execution_standard AS execution_standard, | ||
| 210 | + CASE | ||
| 211 | + WHEN c.type = 'PROCESS_STD_AGMT' THEN pl.product_id | ||
| 212 | + ELSE cl.product_id | ||
| 213 | + END AS structure_report_used, | ||
| 214 | + c.type AS contract_type_code, | ||
| 215 | + c.special_terms AS special_requirements, | ||
| 216 | + c.create_by AS contract_create_by, | ||
| 200 | MAX(tb.create_time) OVER (PARTITION BY tb.order_no, tb.purchase_order_line_id) AS group_latest_time | 217 | MAX(tb.create_time) OVER (PARTITION BY tb.order_no, tb.purchase_order_line_id) AS group_latest_time |
| 201 | FROM order_detail_report tb | 218 | FROM order_detail_report tb |
| 202 | LEFT JOIN base_data_workshop ws ON ws.id = tb.workshop_id | 219 | LEFT JOIN base_data_workshop ws ON ws.id = tb.workshop_id |
| 220 | + LEFT JOIN tbl_purchase_order_line pol ON pol.id = tb.purchase_order_line_id | ||
| 221 | + LEFT JOIN purchase_order_info poi ON poi.id = pol.purchase_order_id | ||
| 222 | + LEFT JOIN tbl_contract_distributor_standard c ON c.id = poi.contract_id | ||
| 223 | + LEFT JOIN base_data_customer_short cs ON cs.customer_id = poi.ordering_unit | ||
| 224 | + LEFT JOIN tbl_contract_distributor_line cl ON cl.id = pol.contract_distributor_line_id | ||
| 225 | + LEFT JOIN tbl_contract_std_processing_line pl ON pl.id = pol.contract_distributor_line_id | ||
| 203 | <where> | 226 | <where> |
| 204 | <if test="vo.ids != null and !vo.ids.isEmpty()"> | 227 | <if test="vo.ids != null and !vo.ids.isEmpty()"> |
| 205 | AND tb.id IN | 228 | AND tb.id IN |
| @@ -256,6 +279,14 @@ | @@ -256,6 +279,14 @@ | ||
| 256 | <if test="vo.status != null and vo.status != ''"> | 279 | <if test="vo.status != null and vo.status != ''"> |
| 257 | AND tb.status = #{vo.status} | 280 | AND tb.status = #{vo.status} |
| 258 | </if> | 281 | </if> |
| 282 | + <if test="vo.inventoryUnlockedOnly != null and vo.inventoryUnlockedOnly"> | ||
| 283 | + AND c.type IN ('DIST_STOCK_CONTRACT','INTL_INVENTORY_AGMT') | ||
| 284 | + AND (c.price_spec_locked = 0 OR c.price_spec_locked IS NULL) | ||
| 285 | + </if> | ||
| 286 | + <if test="vo.excludeInventoryUnlocked != null and vo.excludeInventoryUnlocked"> | ||
| 287 | + AND NOT (c.type IN ('DIST_STOCK_CONTRACT','INTL_INVENTORY_AGMT') | ||
| 288 | + AND (c.price_spec_locked = 0 OR c.price_spec_locked IS NULL)) | ||
| 289 | + </if> | ||
| 259 | </where> | 290 | </where> |
| 260 | ) t | 291 | ) t |
| 261 | ORDER BY | 292 | ORDER BY |