修复
This commit is contained in:
@@ -92,6 +92,7 @@ public class MatPurchaseInDetailVo {
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
@ExcelProperty(value = "厂家")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,6 +51,8 @@ public class GearStockIoOrderBo extends BaseEntity {
|
||||
|
||||
private Long supplierId;
|
||||
|
||||
private Integer materialTypeSnapshot;
|
||||
|
||||
private Date planArrivalTime;
|
||||
|
||||
private Date actualArrivalTime;
|
||||
|
||||
@@ -46,6 +46,12 @@ public class GearPurchasePlanDetailVo {
|
||||
@ExcelProperty(value = "原材料名称")
|
||||
private String rawMaterialName;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
@ExcelProperty(value = "厂家")
|
||||
private String factory;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
|
||||
@@ -103,4 +103,6 @@ public class GearStockIoOrderVo extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
private String materialNames;
|
||||
|
||||
private String factoryNames;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.oa.domain.GearPurchasePlanDetail;
|
||||
@@ -8,6 +7,8 @@ import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购计划明细Mapper接口
|
||||
*
|
||||
@@ -17,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface GearPurchasePlanDetailMapper extends BaseMapperPlus<GearPurchasePlanDetailMapper, GearPurchasePlanDetail, GearPurchasePlanDetailVo> {
|
||||
|
||||
Page<GearPurchasePlanDetailVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<GearPurchasePlanDetail> lqw);
|
||||
|
||||
List<GearPurchasePlanDetailVo> selectVoListPlus(@Param("ew") QueryWrapper<GearPurchasePlanDetail> lqw);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.Map;
|
||||
|
||||
public interface MatMaterialSimpleMapper {
|
||||
|
||||
@Select("select material_id as materialId, material_name as materialName, material_type as materialType, unit as unit, current_stock as currentStock " +
|
||||
@Select("select material_id as materialId, material_name as materialName, material_type as materialType, unit as unit, factory as factory, current_stock as currentStock " +
|
||||
"from mat_material where material_id = #{materialId} and del_flag = 0 limit 1")
|
||||
Map<String, Object> selectSnapshot(@Param("materialId") Long materialId);
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ public class GearPurchasePlanDetailServiceImpl implements IGearPurchasePlanDetai
|
||||
*/
|
||||
@Override
|
||||
public List<GearPurchasePlanDetailVo> queryList(GearPurchasePlanDetailBo bo) {
|
||||
LambdaQueryWrapper<GearPurchasePlanDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
QueryWrapper<GearPurchasePlanDetail> lqw = buildQueryWrapperPlus(bo);
|
||||
return baseMapper.selectVoListPlus(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearPurchasePlanDetail> buildQueryWrapper(GearPurchasePlanDetailBo bo) {
|
||||
|
||||
@@ -102,25 +102,42 @@ public class GearStockIoOrderServiceImpl implements IGearStockIoOrderService {
|
||||
return;
|
||||
}
|
||||
Map<Long, LinkedHashSet<String>> namesMap = new HashMap<>();
|
||||
Map<Long, LinkedHashSet<String>> factoryMap = new HashMap<>();
|
||||
Map<Long, String> materialFactoryCache = new HashMap<>();
|
||||
for (GearStockIoOrderDetail d : details) {
|
||||
if (d == null || d.getOrderId() == null) {
|
||||
continue;
|
||||
}
|
||||
String name = d.getItemName();
|
||||
if (StringUtils.isBlank(name)) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
namesMap.computeIfAbsent(d.getOrderId(), k -> new LinkedHashSet<>()).add(name);
|
||||
}
|
||||
if (!"material".equals(d.getItemType()) || d.getItemId() == null) {
|
||||
continue;
|
||||
}
|
||||
namesMap.computeIfAbsent(d.getOrderId(), k -> new LinkedHashSet<>()).add(name);
|
||||
String factory = materialFactoryCache.get(d.getItemId());
|
||||
if (factory == null) {
|
||||
Map<String, Object> snapshot = matMaterialMapper.selectSnapshot(d.getItemId());
|
||||
Object factoryObj = snapshot == null ? null : snapshot.get("factory");
|
||||
factory = factoryObj == null ? "" : String.valueOf(factoryObj);
|
||||
materialFactoryCache.put(d.getItemId(), factory);
|
||||
}
|
||||
if (StringUtils.isNotBlank(factory)) {
|
||||
factoryMap.computeIfAbsent(d.getOrderId(), k -> new LinkedHashSet<>()).add(factory);
|
||||
}
|
||||
}
|
||||
for (GearStockIoOrderVo o : orders) {
|
||||
if (o == null || o.getOrderId() == null) {
|
||||
continue;
|
||||
}
|
||||
LinkedHashSet<String> set = namesMap.get(o.getOrderId());
|
||||
if (set == null || set.isEmpty()) {
|
||||
continue;
|
||||
if (set != null && !set.isEmpty()) {
|
||||
o.setMaterialNames(String.join("、", set));
|
||||
}
|
||||
LinkedHashSet<String> factorySet = factoryMap.get(o.getOrderId());
|
||||
if (factorySet != null && !factorySet.isEmpty()) {
|
||||
o.setFactoryNames(String.join("、", factorySet));
|
||||
}
|
||||
o.setMaterialNames(String.join("、", set));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +165,9 @@ public class GearStockIoOrderServiceImpl implements IGearStockIoOrderService {
|
||||
lqw.apply(bo.getSupplierId() != null,
|
||||
"exists (select 1 from gear_stock_io_order_detail d left join gear_purchase_plan_detail ppd on d.source_detail_no = ppd.detail_code and ppd.del_flag = 0 where d.del_flag = '0' and d.order_id = gear_stock_io_order.order_id and ppd.supplier_id = {0})",
|
||||
bo.getSupplierId());
|
||||
lqw.apply(bo.getMaterialTypeSnapshot() != null,
|
||||
"exists (select 1 from gear_stock_io_order_detail d where d.del_flag = '0' and d.order_id = gear_stock_io_order.order_id and d.material_type_snapshot = {0})",
|
||||
bo.getMaterialTypeSnapshot());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDelayStatus()), GearStockIoOrder::getDelayStatus, bo.getDelayStatus());
|
||||
lqw.orderByDesc(GearStockIoOrder::getCreateTime);
|
||||
return lqw;
|
||||
@@ -168,6 +188,7 @@ public class GearStockIoOrderServiceImpl implements IGearStockIoOrderService {
|
||||
bo.getItemName());
|
||||
qw.like(StringUtils.isNotBlank(bo.getFactory()), "m.factory", bo.getFactory());
|
||||
qw.eq(bo.getSupplierId() != null, "ppd.supplier_id", bo.getSupplierId());
|
||||
qw.eq(bo.getMaterialTypeSnapshot() != null, "d.material_type_snapshot", bo.getMaterialTypeSnapshot());
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
d.detail_code,
|
||||
d.supplier_id,
|
||||
d.raw_material_name,
|
||||
m.factory as factory,
|
||||
d.owner,
|
||||
d.quantity,
|
||||
d.unit,
|
||||
@@ -44,6 +45,43 @@
|
||||
s.name as supplierName
|
||||
from gear_purchase_plan_detail d
|
||||
left join gear_supplier s on d.supplier_id = s.supplier_id and s.del_flag = 0
|
||||
left join (
|
||||
select material_name, max(factory) as factory
|
||||
from mat_material
|
||||
where del_flag = 0
|
||||
group by material_name
|
||||
) m on m.material_name = d.raw_material_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectVoListPlus" resultType="com.gear.oa.domain.vo.GearPurchasePlanDetailVo">
|
||||
select d.detail_id,
|
||||
d.detail_code,
|
||||
d.supplier_id,
|
||||
d.raw_material_name,
|
||||
m.factory as factory,
|
||||
d.owner,
|
||||
d.quantity,
|
||||
d.unit,
|
||||
d.unit_price,
|
||||
d.total_amount,
|
||||
d.annex,
|
||||
d.status,
|
||||
d.remark,
|
||||
d.del_flag,
|
||||
d.create_time,
|
||||
d.create_by,
|
||||
d.update_time,
|
||||
d.update_by,
|
||||
s.name as supplierName
|
||||
from gear_purchase_plan_detail d
|
||||
left join gear_supplier s on d.supplier_id = s.supplier_id and s.del_flag = 0
|
||||
left join (
|
||||
select material_name, max(factory) as factory
|
||||
from mat_material
|
||||
where del_flag = 0
|
||||
group by material_name
|
||||
) m on m.material_name = d.raw_material_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
d.item_type AS itemType,
|
||||
d.item_id AS itemId,
|
||||
d.material_type_snapshot AS materialTypeSnapshot,
|
||||
CASE WHEN d.material_type_snapshot = 2 THEN '主材' ELSE '辅材' END AS materialTypeName,
|
||||
CASE
|
||||
WHEN d.material_type_snapshot = 2 THEN '主材'
|
||||
WHEN d.material_type_snapshot = 1 THEN '辅材'
|
||||
ELSE '-'
|
||||
END AS materialTypeName,
|
||||
o.order_code AS orderCode,
|
||||
o.io_type AS ioType,
|
||||
o.biz_type AS bizType,
|
||||
@@ -37,7 +41,7 @@
|
||||
COALESCE(d.unit, m.unit) AS unit,
|
||||
d.batch_no AS batchNo,
|
||||
d.unit_price AS unitPrice,
|
||||
d.amount AS amount,
|
||||
COALESCE(d.amount, d.unit_price * d.quantity) AS amount,
|
||||
d.source_detail_no AS sourceDetailNo,
|
||||
d.remark AS remark
|
||||
FROM gear_stock_io_order_detail d
|
||||
@@ -52,4 +56,3 @@
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
||||
}
|
||||
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
||||
OssClient storage = OssFactory.instance();
|
||||
try(InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) {
|
||||
OssClient storage = OssFactory.instance(sysOss.getService());
|
||||
try(InputStream inputStream = storage.getObjectContent(sysOss.getFileName())) {
|
||||
int available = inputStream.available();
|
||||
IoUtil.copy(inputStream, response.getOutputStream(), available);
|
||||
response.setContentLength(available);
|
||||
@@ -150,7 +150,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
||||
List<SysOss> list = baseMapper.selectBatchIds(ids);
|
||||
for (SysOss sysOss : list) {
|
||||
OssClient storage = OssFactory.instance(sysOss.getService());
|
||||
storage.delete(sysOss.getUrl());
|
||||
storage.delete(sysOss.getFileName());
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
<el-form-item label="供货商" prop="supplierId">
|
||||
<VendorSelect v-model="queryParams.supplierId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="factory">
|
||||
<el-input v-model="queryParams.factory" placeholder="请输入厂家" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型" prop="materialTypeSnapshot">
|
||||
<el-select v-model="queryParams.materialTypeSnapshot" placeholder="请选择" clearable style="width: 140px;">
|
||||
<el-option label="主材" :value="2" />
|
||||
<el-option label="辅材" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.timeRange"
|
||||
@@ -45,6 +54,9 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" size="mini" @click="handleExportOrder">导出单据</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain size="mini" @click="openFlow">统计/导出</el-button>
|
||||
</el-col>
|
||||
@@ -69,6 +81,19 @@
|
||||
<span v-else>{{ scope.row.materialNames || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家" align="center" min-width="220">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.factoryNames && String(scope.row.factoryNames).length > 16" effect="dark" placement="top">
|
||||
<template #content>
|
||||
<div style="max-width: 420px; white-space: normal; word-break: break-all;">
|
||||
{{ scope.row.factoryNames }}
|
||||
</div>
|
||||
</template>
|
||||
<span>{{ String(scope.row.factoryNames).slice(0, 16) + '…' }}</span>
|
||||
</el-tooltip>
|
||||
<span v-else>{{ scope.row.factoryNames || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务类型" align="center" prop="bizType" min-width="120" />
|
||||
<el-table-column label="责任人" align="center" prop="responsibleName" min-width="120" />
|
||||
<el-table-column label="状态" align="center" width="90">
|
||||
@@ -369,6 +394,8 @@ export default {
|
||||
orderCode: undefined,
|
||||
itemName: undefined,
|
||||
supplierId: undefined,
|
||||
factory: undefined,
|
||||
materialTypeSnapshot: undefined,
|
||||
timeRange: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
@@ -458,6 +485,10 @@ export default {
|
||||
this.queryParams.timeRange = undefined
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
this.queryParams.supplierId = undefined
|
||||
this.queryParams.itemName = undefined
|
||||
this.queryParams.factory = undefined
|
||||
this.queryParams.materialTypeSnapshot = undefined
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
@@ -476,6 +507,16 @@ export default {
|
||||
`stockIoOrder_in_detail_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
handleExportOrder() {
|
||||
this.syncTimeRange()
|
||||
this.download(
|
||||
'/gear/stockIoOrder/export',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`stockIoOrder_in_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
syncTimeRange() {
|
||||
const tr = this.queryParams.timeRange
|
||||
if (tr && tr.length === 2) {
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
<el-form-item label="供货商" prop="supplierId">
|
||||
<VendorSelect v-model="queryParams.supplierId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="factory">
|
||||
<el-input v-model="queryParams.factory" placeholder="请输入厂家" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型" prop="materialTypeSnapshot">
|
||||
<el-select v-model="queryParams.materialTypeSnapshot" placeholder="请选择" clearable style="width: 140px;">
|
||||
<el-option label="主材" :value="2" />
|
||||
<el-option label="辅材" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库时间" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.timeRange"
|
||||
@@ -42,6 +51,9 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" size="mini" @click="handleExportOrder">导出单据</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain size="mini" @click="openFlow">统计/导出</el-button>
|
||||
</el-col>
|
||||
@@ -66,6 +78,19 @@
|
||||
<span v-else>{{ scope.row.materialNames || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家" align="center" min-width="220">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.factoryNames && String(scope.row.factoryNames).length > 16" effect="dark" placement="top">
|
||||
<template #content>
|
||||
<div style="max-width: 420px; white-space: normal; word-break: break-all;">
|
||||
{{ scope.row.factoryNames }}
|
||||
</div>
|
||||
</template>
|
||||
<span>{{ String(scope.row.factoryNames).slice(0, 16) + '…' }}</span>
|
||||
</el-tooltip>
|
||||
<span v-else>{{ scope.row.factoryNames || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务类型" align="center" prop="bizType" min-width="120" />
|
||||
<el-table-column label="责任人" align="center" prop="responsibleName" min-width="120" />
|
||||
<el-table-column label="状态" align="center" width="90">
|
||||
@@ -350,6 +375,8 @@ export default {
|
||||
orderCode: undefined,
|
||||
itemName: undefined,
|
||||
supplierId: undefined,
|
||||
factory: undefined,
|
||||
materialTypeSnapshot: undefined,
|
||||
timeRange: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
@@ -439,6 +466,10 @@ export default {
|
||||
this.queryParams.timeRange = undefined
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
this.queryParams.supplierId = undefined
|
||||
this.queryParams.itemName = undefined
|
||||
this.queryParams.factory = undefined
|
||||
this.queryParams.materialTypeSnapshot = undefined
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
@@ -456,6 +487,16 @@ export default {
|
||||
`stockIoOrder_out_detail_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
handleExportOrder() {
|
||||
this.syncTimeRange()
|
||||
this.download(
|
||||
'/gear/stockIoOrder/export',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`stockIoOrder_out_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
syncTimeRange() {
|
||||
const tr = this.queryParams.timeRange
|
||||
if (tr && tr.length === 2) {
|
||||
|
||||
Reference in New Issue
Block a user