体现入库时间,供应商名称,去查询系统直接选择供应商导出
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) {
|
||||
|
||||
Reference in New Issue
Block a user