体现入库时间,供应商名称,去查询系统直接选择供应商导出
This commit is contained in:
@@ -14,6 +14,7 @@ import com.gear.common.utils.StringUtils;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.bo.GearStockIoOrderBo;
|
||||
import com.gear.oa.domain.bo.GearStockIoOrderWithDetailBo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderDetailVo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderVo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderWithDetailVo;
|
||||
import com.gear.oa.service.IGearStockIoOrderService;
|
||||
@@ -55,6 +56,13 @@ public class GearStockIoOrderController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "出入库单据", GearStockIoOrderVo.class, response);
|
||||
}
|
||||
|
||||
@Log(title = "出入库单据明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportDetail")
|
||||
public void exportDetail(GearStockIoOrderBo bo, HttpServletResponse response) {
|
||||
List<GearStockIoOrderDetailVo> list = stockIoOrderService.queryDetailExportList(bo);
|
||||
ExcelUtil.exportExcel(list, "出入库单据明细", GearStockIoOrderDetailVo.class, response);
|
||||
}
|
||||
|
||||
@GetMapping("/materialFlow")
|
||||
public R<IGearStockIoOrderService.MaterialFlowResp> materialFlow(@RequestParam(required = false) Long itemId,
|
||||
@RequestParam(required = false) String factory,
|
||||
|
||||
@@ -37,6 +37,8 @@ public class GearSalaryRecordsBo extends BaseEntity {
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 发薪月份(YYYY-MM-01)
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@ import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GearStockIoOrderBo extends BaseEntity {
|
||||
@@ -37,6 +39,18 @@ public class GearStockIoOrderBo extends BaseEntity {
|
||||
|
||||
private Date ioTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
private String itemName;
|
||||
|
||||
private String factory;
|
||||
|
||||
private Long supplierId;
|
||||
|
||||
private Date planArrivalTime;
|
||||
|
||||
private Date actualArrivalTime;
|
||||
|
||||
@@ -114,5 +114,8 @@ public class GearSalaryRecordsVo {
|
||||
//联查昵称
|
||||
private String employeeName;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.gear.oa.domain.vo;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@@ -25,29 +28,76 @@ public class GearStockIoOrderDetailVo extends BaseEntity {
|
||||
|
||||
private Integer materialTypeSnapshot;
|
||||
|
||||
@ExcelProperty(value = "物料类型")
|
||||
private String materialTypeName;
|
||||
|
||||
@ExcelProperty(value = "单据编号")
|
||||
private String orderCode;
|
||||
|
||||
@ExcelProperty(value = "出入库类型")
|
||||
private String ioType;
|
||||
|
||||
@ExcelProperty(value = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
@ExcelProperty(value = "出入库时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date ioTime;
|
||||
|
||||
@ExcelProperty(value = "状态")
|
||||
private String orderStatusText;
|
||||
|
||||
@ExcelProperty(value = "责任人")
|
||||
private String responsibleName;
|
||||
|
||||
@ExcelProperty(value = "物料名称")
|
||||
private String itemName;
|
||||
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specName;
|
||||
|
||||
@ExcelProperty(value = "型号")
|
||||
private String model;
|
||||
|
||||
@ExcelProperty(value = "厂家")
|
||||
private String factory;
|
||||
|
||||
private Long warehouseId;
|
||||
|
||||
private Long fromWarehouseId;
|
||||
|
||||
@ExcelProperty(value = "仓库/库位")
|
||||
private String warehouseName;
|
||||
|
||||
@ExcelProperty(value = "源库位")
|
||||
private String fromWarehouseName;
|
||||
|
||||
private Long supplierId;
|
||||
|
||||
@ExcelProperty(value = "供应商")
|
||||
private String supplierName;
|
||||
|
||||
@ExcelProperty(value = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
@ExcelProperty(value = "批次号")
|
||||
private String batchNo;
|
||||
|
||||
@ExcelProperty(value = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ExcelProperty(value = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty(value = "来源明细号")
|
||||
private String sourceDetailNo;
|
||||
|
||||
private Long reversalDetailId;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.oa.domain.GearSalaryRecords;
|
||||
import com.gear.oa.domain.vo.GearSalaryRecordsVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工资发放记录Mapper接口
|
||||
*
|
||||
@@ -16,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface GearSalaryRecordsMapper extends BaseMapperPlus<GearSalaryRecordsMapper, GearSalaryRecords, GearSalaryRecordsVo> {
|
||||
|
||||
Page<GearSalaryRecordsVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<GearSalaryRecords> lqw);
|
||||
|
||||
List<GearSalaryRecordsVo> selectVoListPlus(@Param("ew") Wrapper<GearSalaryRecords> wrapper);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import com.gear.oa.domain.GearStockIoOrderDetail;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderDetailVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GearStockIoOrderDetailMapper extends BaseMapperPlus<GearStockIoOrderDetailMapper, GearStockIoOrderDetail, GearStockIoOrderDetailVo> {
|
||||
}
|
||||
|
||||
List<GearStockIoOrderDetailVo> selectExportDetailList(@Param("ew") Wrapper<?> wrapper);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.oa.domain.bo.GearStockIoOrderBo;
|
||||
import com.gear.oa.domain.bo.GearStockIoOrderWithDetailBo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderDetailVo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderVo;
|
||||
import com.gear.oa.domain.vo.GearStockIoOrderWithDetailVo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@@ -23,6 +24,8 @@ public interface IGearStockIoOrderService {
|
||||
|
||||
List<GearStockIoOrderVo> queryList(GearStockIoOrderBo bo);
|
||||
|
||||
List<GearStockIoOrderDetailVo> queryDetailExportList(GearStockIoOrderBo bo);
|
||||
|
||||
Long createWithDetail(GearStockIoOrderWithDetailBo bo);
|
||||
|
||||
void updateWithDetail(GearStockIoOrderWithDetailBo bo);
|
||||
|
||||
@@ -55,6 +55,7 @@ public class GearSalaryRecordsServiceImpl implements IGearSalaryRecordsService {
|
||||
QueryWrapper<GearSalaryRecords> lqw = Wrappers.query();
|
||||
// 使用表别名 sr 来构建查询条件
|
||||
lqw.eq(bo.getEmployeeId() != null, "sr.employee_id", bo.getEmployeeId());
|
||||
lqw.eq(bo.getDeptId() != null, "su.dept_id", bo.getDeptId());
|
||||
lqw.eq(bo.getPayPeriod() != null, "sr.pay_period", bo.getPayPeriod());
|
||||
lqw.eq(bo.getBaseSalary() != null, "sr.base_salary", bo.getBaseSalary());
|
||||
lqw.eq(bo.getPerformanceBonus() != null, "sr.performance_bonus", bo.getPerformanceBonus());
|
||||
@@ -77,8 +78,8 @@ public class GearSalaryRecordsServiceImpl implements IGearSalaryRecordsService {
|
||||
*/
|
||||
@Override
|
||||
public List<GearSalaryRecordsVo> queryList(GearSalaryRecordsBo bo) {
|
||||
LambdaQueryWrapper<GearSalaryRecords> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
QueryWrapper<GearSalaryRecords> qw = buildQueryWrapperPlus(bo);
|
||||
return baseMapper.selectVoListPlus(qw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearSalaryRecords> buildQueryWrapper(GearSalaryRecordsBo bo) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.gear.oa.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
@@ -74,6 +75,12 @@ public class GearStockIoOrderServiceImpl implements IGearStockIoOrderService {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GearStockIoOrderDetailVo> queryDetailExportList(GearStockIoOrderBo bo) {
|
||||
QueryWrapper<Object> qw = buildDetailExportQueryWrapper(bo);
|
||||
return detailMapper.selectExportDetailList(qw);
|
||||
}
|
||||
|
||||
private void fillMaterialNames(List<GearStockIoOrderVo> orders) {
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return;
|
||||
@@ -130,11 +137,40 @@ public class GearStockIoOrderServiceImpl implements IGearStockIoOrderService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReversalFlag()), GearStockIoOrder::getReversalFlag, bo.getReversalFlag());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSourceNo()), GearStockIoOrder::getSourceNo, bo.getSourceNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getResponsibleName()), GearStockIoOrder::getResponsibleName, bo.getResponsibleName());
|
||||
lqw.ge(bo.getStartTime() != null, GearStockIoOrder::getIoTime, bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null, GearStockIoOrder::getIoTime, bo.getEndTime());
|
||||
lqw.apply(StringUtils.isNotBlank(bo.getItemName()),
|
||||
"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.item_name like concat('%',{0},'%'))",
|
||||
bo.getItemName());
|
||||
lqw.apply(StringUtils.isNotBlank(bo.getFactory()),
|
||||
"exists (select 1 from gear_stock_io_order_detail d left join mat_material m on d.item_type = 'material' and d.item_id = m.material_id and m.del_flag = 0 where d.del_flag = '0' and d.order_id = gear_stock_io_order.order_id and m.factory like concat('%',{0},'%'))",
|
||||
bo.getFactory());
|
||||
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.eq(StringUtils.isNotBlank(bo.getDelayStatus()), GearStockIoOrder::getDelayStatus, bo.getDelayStatus());
|
||||
lqw.orderByDesc(GearStockIoOrder::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private QueryWrapper<Object> buildDetailExportQueryWrapper(GearStockIoOrderBo bo) {
|
||||
QueryWrapper<Object> qw = Wrappers.query();
|
||||
qw.eq("d.del_flag", "0");
|
||||
qw.eq("o.del_flag", "0");
|
||||
qw.like(StringUtils.isNotBlank(bo.getOrderCode()), "o.order_code", bo.getOrderCode());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getIoType()), "o.io_type", bo.getIoType());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getBizType()), "o.biz_type", bo.getBizType());
|
||||
qw.like(StringUtils.isNotBlank(bo.getResponsibleName()), "o.responsible_name", bo.getResponsibleName());
|
||||
qw.ge(bo.getStartTime() != null, "o.io_time", bo.getStartTime());
|
||||
qw.le(bo.getEndTime() != null, "o.io_time", bo.getEndTime());
|
||||
qw.apply(StringUtils.isNotBlank(bo.getItemName()),
|
||||
"(d.item_name like concat('%',{0},'%') or m.material_name like concat('%',{0},'%'))",
|
||||
bo.getItemName());
|
||||
qw.like(StringUtils.isNotBlank(bo.getFactory()), "m.factory", bo.getFactory());
|
||||
qw.eq(bo.getSupplierId() != null, "ppd.supplier_id", bo.getSupplierId());
|
||||
return qw;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createWithDetail(GearStockIoOrderWithDetailBo bo) {
|
||||
|
||||
@@ -46,9 +46,43 @@
|
||||
sr.del_flag,
|
||||
sr.remark,
|
||||
sr.pay_status,
|
||||
su.nick_name as employeeName
|
||||
su.nick_name as employeeName,
|
||||
su.dept_id as deptId,
|
||||
sd.dept_name as deptName
|
||||
FROM gear_salary_records sr
|
||||
LEFT JOIN sys_user su ON sr.employee_id = su.user_id
|
||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY sr.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectVoListPlus" resultType="com.gear.oa.domain.vo.GearSalaryRecordsVo">
|
||||
SELECT
|
||||
sr.salary_id,
|
||||
sr.employee_id,
|
||||
sr.pay_period,
|
||||
sr.base_salary,
|
||||
sr.performance_bonus,
|
||||
sr.overtime_pay,
|
||||
sr.allowance,
|
||||
sr.social_security,
|
||||
sr.housing_fund,
|
||||
sr.income_tax,
|
||||
sr.gross_salary,
|
||||
sr.net_salary,
|
||||
sr.create_by,
|
||||
sr.create_time,
|
||||
sr.update_by,
|
||||
sr.update_time,
|
||||
sr.del_flag,
|
||||
sr.remark,
|
||||
sr.pay_status,
|
||||
su.nick_name as employeeName,
|
||||
su.dept_id as deptId,
|
||||
sd.dept_name as deptName
|
||||
FROM gear_salary_records sr
|
||||
LEFT JOIN sys_user su ON sr.employee_id = su.user_id
|
||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY sr.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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.gear.oa.mapper.GearStockIoOrderDetailMapper">
|
||||
|
||||
<select id="selectExportDetailList" resultType="com.gear.oa.domain.vo.GearStockIoOrderDetailVo">
|
||||
SELECT
|
||||
d.detail_id AS detailId,
|
||||
d.order_id AS orderId,
|
||||
d.line_no AS lineNo,
|
||||
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,
|
||||
o.order_code AS orderCode,
|
||||
o.io_type AS ioType,
|
||||
o.biz_type AS bizType,
|
||||
o.io_time AS ioTime,
|
||||
CASE
|
||||
WHEN o.revoke_flag = '1' THEN '已撤回'
|
||||
WHEN o.confirm_in_flag = '1' THEN '已确认'
|
||||
ELSE '正常'
|
||||
END AS orderStatusText,
|
||||
o.responsible_name AS responsibleName,
|
||||
COALESCE(d.item_name, m.material_name) AS itemName,
|
||||
COALESCE(d.spec_name, m.spec) AS specName,
|
||||
m.model AS model,
|
||||
m.factory AS factory,
|
||||
d.warehouse_id AS warehouseId,
|
||||
d.from_warehouse_id AS fromWarehouseId,
|
||||
w.warehouse_name AS warehouseName,
|
||||
fw.warehouse_name AS fromWarehouseName,
|
||||
ppd.supplier_id AS supplierId,
|
||||
s.name AS supplierName,
|
||||
d.quantity AS quantity,
|
||||
COALESCE(d.unit, m.unit) AS unit,
|
||||
d.batch_no AS batchNo,
|
||||
d.unit_price AS unitPrice,
|
||||
d.amount AS amount,
|
||||
d.source_detail_no AS sourceDetailNo,
|
||||
d.remark AS remark
|
||||
FROM gear_stock_io_order_detail d
|
||||
LEFT JOIN gear_stock_io_order o ON d.order_id = o.order_id
|
||||
LEFT JOIN mat_material m ON d.item_type = 'material' AND d.item_id = m.material_id AND m.del_flag = 0
|
||||
LEFT JOIN gear_warehouse w ON d.warehouse_id = w.warehouse_id AND w.del_flag = 0
|
||||
LEFT JOIN gear_warehouse fw ON d.from_warehouse_id = fw.warehouse_id AND fw.del_flag = 0
|
||||
LEFT JOIN gear_purchase_plan_detail ppd ON d.source_detail_no = ppd.detail_code AND ppd.del_flag = 0
|
||||
LEFT JOIN gear_supplier s ON ppd.supplier_id = s.supplier_id AND s.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
ORDER BY o.io_time DESC, o.order_id DESC, d.line_no ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user