新增供应链模块服务
This commit is contained in:
parent
6a2d5ddbb3
commit
1122b99d2e
|
|
@ -205,6 +205,9 @@ public class OrderInfoMobileBusinessImpl implements OrderInfoMobileBusiness {
|
|||
// orderInfoVO.setStallId(379074929284354048L);
|
||||
// orderInfoVO.setMealtimeType("4");
|
||||
AllocMetadata vo=orderInfoMapper.queryAllocMetadata(orderInfoVO);
|
||||
if(vo == null){
|
||||
return orderInfoVO ;
|
||||
}
|
||||
String modelValue=vo.getModelValue();
|
||||
Map<String, Object> map=null;
|
||||
try{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CanteenOrg {
|
||||
private Long orgId; // org_id
|
||||
private String orgName; // org_name
|
||||
private String orgFullName; // org_full_name
|
||||
private Long superId; // super_id
|
||||
private List<CanteenOrg> children; // 子节点
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CanteenRecord extends BaseEntity {
|
||||
private Long orgId; // 主键ID
|
||||
private String orgName;
|
||||
@Excel(name = "用户姓名")
|
||||
private String custName; // 姓名
|
||||
@Excel(name = "用户编号")
|
||||
private String custId; // 用户编号
|
||||
@Excel(name = "所属组织")
|
||||
private String orgFullName; // 所属组织
|
||||
private String flowTypeName; // 消费情况
|
||||
private String consumeSource;
|
||||
private String ordDate; // 就餐日期
|
||||
@Excel(name = "订单金额")
|
||||
private Double amount; // 订单金额
|
||||
private String phone; // 用户手机号
|
||||
@Excel(name = "下单时间")
|
||||
private String ordTime; // 下单时间
|
||||
private String remark; // 备注
|
||||
private String startPayTime;
|
||||
private String endPayTime;
|
||||
private String flowType;
|
||||
private String totalConsume;
|
||||
private String totalRefund;
|
||||
private String[] selectedOrg;
|
||||
|
||||
// 导出用的字段
|
||||
@Excel(name = "订单类型")
|
||||
private String flowTypeText;
|
||||
|
||||
// 在查询或封装数据时,给 flowTypeText 赋值
|
||||
public void setFlowTypeTextByFlowType() {
|
||||
if ("110".equals(flowType)) {
|
||||
this.flowTypeText = "消费";
|
||||
} else if ("120".equals(flowType)) {
|
||||
this.flowTypeText = "补助";
|
||||
} else if ("130".equals(flowType)) {
|
||||
this.flowTypeText = "退款";
|
||||
} else {
|
||||
this.flowTypeText = flowType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 字典VO对象
|
||||
*/
|
||||
@Data
|
||||
public class DrpDictVO {
|
||||
|
||||
private String value;
|
||||
private String label;
|
||||
private Long id;
|
||||
private String dictLabel;
|
||||
private String dictValue;
|
||||
private Long parentId;
|
||||
private List<DrpDictVO> children;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存入库明细查询DTO对象
|
||||
*
|
||||
* @author lizhenhua
|
||||
* @date 2025-12-29
|
||||
*/
|
||||
@Data
|
||||
public class DrpInventoryIntoDetailQueryDTO extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String recordId;
|
||||
private List<String> intoTypeList;
|
||||
private String goodsCategory;
|
||||
private List<Long> warehouseIdList;
|
||||
private String goodsName;
|
||||
private List<Long> supplierIdList;
|
||||
private List<Long> areaIdList;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private String materialName;
|
||||
private List<Long> categoryIdList;
|
||||
public int pageNum;
|
||||
public int pageSize;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.exportUtils.FenToYuanHandler;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 库存入库明细相关VO(合并版)
|
||||
* 包含:入库明细VO、仓库VO、供应商VO、字典VO
|
||||
*
|
||||
* @author lizhenhua
|
||||
* @date 2025-12-29
|
||||
*/
|
||||
@Data
|
||||
public class DrpInventoryIntoDetailVO{
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 操作人ID */
|
||||
private String operatorId;
|
||||
|
||||
/** 供应商ID */
|
||||
private Long supplierId;
|
||||
|
||||
/** 货品类别 */
|
||||
private String goodsCategory;
|
||||
|
||||
/** 货品编码 */
|
||||
@Excel(name = "货品编码")
|
||||
private String goodsCode;
|
||||
|
||||
/** 货品类别名称 */
|
||||
@Excel(name = "货品类别")
|
||||
private String goodsCategoryName;
|
||||
|
||||
/** 货品名称 */
|
||||
@Excel(name = "货品名称")
|
||||
private String goodsName;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
/** 货品规格 */
|
||||
@Excel(name = "货品规格")
|
||||
private String specification;
|
||||
|
||||
/** 单价(元) */
|
||||
@Excel(name = "单价(元)", cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal price;
|
||||
|
||||
/** 所属区域名称 */
|
||||
@Excel(name = "所属区域")
|
||||
private String areaName;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "货品仓库")
|
||||
private String warehouseName;
|
||||
|
||||
/** 入库类型 */
|
||||
@Excel(name = "入库类型")
|
||||
private String intoType;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商")
|
||||
private String supplierName;
|
||||
|
||||
/** 入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "入库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date intoDate;
|
||||
|
||||
/** 入库数量 */
|
||||
@Excel(name = "入库数量", cellType = Excel.ColumnType.NUMERIC)
|
||||
private BigDecimal intoNum;
|
||||
|
||||
@Excel(name = "入库金额(元)", cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal intoAmount;
|
||||
|
||||
/** 结存数量 */
|
||||
@Excel(name = "结存数量", cellType = Excel.ColumnType.NUMERIC)
|
||||
private BigDecimal balanceNum;
|
||||
|
||||
/** 结存金额(元) */
|
||||
@Excel(name = "结存金额(元)",cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生产日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/** 过期日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "过期日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiryDate;
|
||||
|
||||
/** 操作人名称 */
|
||||
@Excel(name = "操作人")
|
||||
private String operatorName;
|
||||
|
||||
/** 入库单号 */
|
||||
@Excel(name = "入库单号")
|
||||
private String recordId;
|
||||
|
||||
/** 合计行 */
|
||||
private Boolean sumRow = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存入库明细相关VO(合并版)
|
||||
* 解决分页问题
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DrpInventoryIntoDetailWrapper {
|
||||
|
||||
private DrpInventoryIntoDetailQueryDTO param;
|
||||
private List<Long> warehouseAuthority;
|
||||
private List<Long> areaAuth;
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.exportUtils.FenToYuanHandler;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 库存出库明细相关VO(合并版)
|
||||
* 包含:出库明细VO、仓库VO、供应商VO、字典VO
|
||||
*
|
||||
* @author lizhenhua
|
||||
* @date 2025-12-29
|
||||
*/
|
||||
@Data
|
||||
public class DrpInventoryoutDetailVO {
|
||||
|
||||
/**
|
||||
* 记录类型标识
|
||||
* 0: 正常入库记录
|
||||
* 1: 退款记录(数量金额为负)
|
||||
*/
|
||||
private Integer recordTypeFlag;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 操作人ID */
|
||||
private String operatorId;
|
||||
|
||||
/** 供应商ID */
|
||||
private Long supplierId;
|
||||
|
||||
/** 货品类别 */
|
||||
private String goodsCategory;
|
||||
|
||||
/** 货品编码 */
|
||||
@Excel(name = "货品编码")
|
||||
private String goodsCode;
|
||||
|
||||
/** 货品类别名称 */
|
||||
@Excel(name = "货品类别")
|
||||
private String goodsCategoryName;
|
||||
|
||||
/** 货品名称 */
|
||||
@Excel(name = "货品名称")
|
||||
private String goodsName;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
/** 货品规格 */
|
||||
@Excel(name = "货品规格")
|
||||
private String specification;
|
||||
|
||||
/** 单价(元) */
|
||||
@Excel(name = "单价(元)", cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal price;
|
||||
|
||||
/** 所属区域名称 */
|
||||
@Excel(name = "所属区域")
|
||||
private String areaName;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "货品仓库")
|
||||
private String warehouseName;
|
||||
|
||||
/** 出库类型 */
|
||||
@Excel(name = "出库类型")
|
||||
private String intoType;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商")
|
||||
private String supplierName;
|
||||
|
||||
/** 出库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date intoDate;
|
||||
|
||||
/** 出库数量 */
|
||||
@Excel(name = "出库数量", cellType = Excel.ColumnType.NUMERIC)
|
||||
private BigDecimal intoNum;
|
||||
|
||||
@Excel(name = "出库金额(元)", cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal intoAmount;
|
||||
|
||||
/** 结存数量 */
|
||||
@Excel(name = "结存数量", cellType = Excel.ColumnType.NUMERIC)
|
||||
private BigDecimal balanceNum;
|
||||
|
||||
/** 结存金额(元) */
|
||||
@Excel(name = "结存金额(元)",cellType = Excel.ColumnType.NUMERIC, handler = FenToYuanHandler.class)
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生产日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/** 过期日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "过期日期", width = 15, dateFormat = "yyyy-MM-dd")
|
||||
private Date expiryDate;
|
||||
|
||||
/** 操作人名称 */
|
||||
@Excel(name = "操作人")
|
||||
private String operatorName;
|
||||
|
||||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private String recordId;
|
||||
|
||||
/** 合计行 */
|
||||
private Boolean sumRow = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 供应商VO对象
|
||||
*/
|
||||
@Data
|
||||
public class DrpSupplierVO {
|
||||
|
||||
private Long supplierId;
|
||||
private String supplierName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DrpWarehouseAllVO {
|
||||
|
||||
private Long warehouseId;
|
||||
private Long areaId;
|
||||
private String warehouseName;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InventoryGoodsSummaryVO {
|
||||
/** 货品ID */
|
||||
private Long materialId;
|
||||
|
||||
/** 货品名称 */
|
||||
@Excel(name = "货品名称")
|
||||
private String materialName;
|
||||
|
||||
/** 货品编码 */
|
||||
@Excel(name = "货品编码")
|
||||
private String materialCode;
|
||||
|
||||
/** 分类ID */
|
||||
private Long categoryId;
|
||||
|
||||
/** 分类名称 */
|
||||
@Excel(name = "货品类别")
|
||||
private String categoryName;
|
||||
|
||||
/** 单位ID */
|
||||
private Long unitId;
|
||||
|
||||
/** 单位名称 */
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
/** 尺寸/规格 */
|
||||
@Excel(name = "货品规格")
|
||||
private String size;
|
||||
|
||||
/** 入库总数 */
|
||||
@Excel(name = "入库数量")
|
||||
private BigDecimal intoTotalNum;
|
||||
|
||||
/** 入库总金额 */
|
||||
@Excel(name = "入库金额")
|
||||
private BigDecimal intoTotalAmount;
|
||||
|
||||
/** 出库总数 */
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outTotalNum;
|
||||
|
||||
/** 出库总金额 */
|
||||
@Excel(name = "出库金额")
|
||||
private BigDecimal outTotalAmount;
|
||||
|
||||
/** 结存数量 */
|
||||
private BigDecimal balanceNum;
|
||||
|
||||
/** 结存金额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 区域名称 */
|
||||
@Excel(name = "区域名称")
|
||||
private String areaName;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
private String supplierName;
|
||||
private Long supplierId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InventoryIntoSummaryVO {
|
||||
|
||||
private BigDecimal totalInQty; // 出库数量合计
|
||||
private BigDecimal totalInAmount; // 出库金额合计
|
||||
private BigDecimal totalStockQty; // 结存数量合计
|
||||
private BigDecimal totalStockAmount; // 结存金额合计
|
||||
private BigDecimal intoTotalNum; // 内部数量
|
||||
private BigDecimal intoTotalAmount; // 内部金额
|
||||
private BigDecimal outTotalNum; // 外部数量
|
||||
private BigDecimal outTotalAmount; // 外部金额
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class OrgConsume {
|
||||
private Long orgId;
|
||||
private String orgName; // 食堂名字
|
||||
private BigDecimal reserveAmount = BigDecimal.ZERO; // APP预定金额
|
||||
private BigDecimal canteenAmount = BigDecimal.ZERO; // 食堂消费
|
||||
private BigDecimal superAmount = BigDecimal.ZERO; // 超市消费
|
||||
private BigDecimal deductionAmount = BigDecimal.ZERO; // 补扣消费
|
||||
private BigDecimal teabreakAmount = BigDecimal.ZERO; // 茶歇消费
|
||||
//H5消费
|
||||
private BigDecimal h5Amount = BigDecimal.ZERO;
|
||||
private BigDecimal amount= BigDecimal.ZERO; //详情中都用这个字段做消费
|
||||
private String startPayTime;//开始支付时间
|
||||
private String endPayTime;//结束支付时间
|
||||
private String custName;
|
||||
private String custNameLike;
|
||||
private String remark;
|
||||
|
||||
private String flowId;
|
||||
private Integer flowType;
|
||||
private String payTime;
|
||||
private String orgFullName;
|
||||
private String walletId;
|
||||
|
||||
/**
|
||||
* 1:APP预定 2:驿站消费 3:食堂消费 4:超市消费
|
||||
*/
|
||||
private Integer conSource;
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ReportDrpInventoryWarehouseSummaryVO {
|
||||
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
@Excel(name = "所属区域")
|
||||
private String areaName;
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
@Excel(name = "仓库ID")
|
||||
|
||||
private String warehouseId;
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
@Excel(name = "仓库名称")
|
||||
|
||||
private String warehouseName;
|
||||
/**
|
||||
* 入库总数量
|
||||
*/
|
||||
@Excel(name = "入库总数量")
|
||||
private BigDecimal intoTotalNum;
|
||||
/**
|
||||
* 入库总金额
|
||||
*/
|
||||
@Excel(name = "入库总金额")
|
||||
|
||||
private BigDecimal intoTotalAmount;
|
||||
/**
|
||||
* 出库总数量
|
||||
*/
|
||||
@Excel(name = "出库总数量")
|
||||
|
||||
private BigDecimal outTotalNum;
|
||||
/**
|
||||
* 出库总金额
|
||||
*/
|
||||
@Excel(name = "出库总金额")
|
||||
|
||||
private BigDecimal outTotalAmount;
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.canteen.core.reportforms.beans;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ReportOrderInfoVo extends BaseEntity {
|
||||
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private int commonOrg ; // “1”表示同组织,“0”表示不同组织
|
||||
private String[] selectedOrg;
|
||||
private String[] gzselectedOrg;
|
||||
|
||||
// 分页字段
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 10;
|
||||
|
||||
private Long orderId;
|
||||
private Long custId;
|
||||
@Excel(name = "用户账号")
|
||||
private String custNum;
|
||||
@Excel(name = "用户姓名")
|
||||
private String custName;
|
||||
@Excel(name = "用户手机号")
|
||||
private String mobile;
|
||||
private String orgName;
|
||||
@Excel(name = "所属组织")
|
||||
private String orgFullName;
|
||||
private BigDecimal payableAmount;
|
||||
private BigDecimal payableAmountAll;
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal realAmount;
|
||||
private String payTime;
|
||||
private Long areaId;
|
||||
@Excel(name = "消费地")
|
||||
private String areaName;
|
||||
private Long diningPlaceId;
|
||||
@Excel(name = "工作地")
|
||||
private String workAreaName;
|
||||
// @Excel(name = "交易次数")
|
||||
private int tradeNum;
|
||||
private int tradeNumAll;
|
||||
@Excel(name = "订单类型")
|
||||
private String orderType;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.bonus.canteen.core.reportforms.controller;
|
||||
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.DrpInventoryIntoDetailQueryDTO;
|
||||
import com.bonus.canteen.core.reportforms.beans.DrpInventoryIntoDetailVO;
|
||||
import com.bonus.canteen.core.reportforms.beans.InventoryGoodsSummaryVO;
|
||||
import com.bonus.canteen.core.reportforms.beans.InventoryIntoSummaryVO;
|
||||
import com.bonus.canteen.core.reportforms.service.DrpInventoryService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/drp/inventoryIntohz")
|
||||
public class DrpInventoryController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private DrpInventoryService drpInventoryService;
|
||||
|
||||
/**
|
||||
* 查询货品汇总明细列表
|
||||
*/
|
||||
@GetMapping("/goods/summary/page")
|
||||
public AjaxResult list(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
// 调用Service方法 - 返回 Map
|
||||
Map<String, Object> result = drpInventoryService.pageInventoryIntoDetail(queryDTO);
|
||||
List<DrpInventoryIntoDetailVO> list = (List<DrpInventoryIntoDetailVO>) result.get("list");
|
||||
InventoryIntoSummaryVO summary = (InventoryIntoSummaryVO) result.get("summary");
|
||||
// 使用 AjaxResult 返回数据
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("rows", list);
|
||||
ajax.put("total", new PageInfo(list).getTotal());
|
||||
ajax.put("summary", summary);
|
||||
return ajax;
|
||||
}
|
||||
/**
|
||||
* 导出货品汇总明细列表
|
||||
*/
|
||||
@PostMapping("/goods/summary/export")
|
||||
public void export(HttpServletResponse response, DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
List<InventoryGoodsSummaryVO> list = drpInventoryService.pageInventoryIntoDetailExport(queryDTO);
|
||||
//里面金额除以100
|
||||
list.forEach(item -> {
|
||||
item.setIntoTotalAmount(item.getIntoTotalAmount().divide(new java.math.BigDecimal(100)));
|
||||
item.setOutTotalAmount(item.getOutTotalAmount().divide(new java.math.BigDecimal(100)));
|
||||
});
|
||||
ExcelUtil<InventoryGoodsSummaryVO> util = new ExcelUtil<InventoryGoodsSummaryVO>(InventoryGoodsSummaryVO.class);
|
||||
util.exportExcel(response, list, "货品汇总明细数据");
|
||||
}
|
||||
/**
|
||||
* 查询仓库汇总明细列表
|
||||
*/
|
||||
@GetMapping("/warehouse/summary/page")
|
||||
public AjaxResult warehouselist(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
// 调用Service方法 - 返回 Map
|
||||
Map<String, Object> result = drpInventoryService.pageInventoryWarehouseSummary(queryDTO);
|
||||
List<DrpInventoryIntoDetailVO> list = (List<DrpInventoryIntoDetailVO>) result.get("list");
|
||||
InventoryIntoSummaryVO summary = (InventoryIntoSummaryVO) result.get("summary");
|
||||
// 使用 AjaxResult 返回数据
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("rows", list);
|
||||
ajax.put("total", new PageInfo(list).getTotal());
|
||||
ajax.put("summary", summary);
|
||||
return ajax;
|
||||
}
|
||||
/**
|
||||
* 供应商汇总
|
||||
*/
|
||||
@GetMapping("/summarylist")
|
||||
public TableDataInfo summarylist(DrpInventoryIntoDetailQueryDTO inventoryInOutSummaryVO)
|
||||
{
|
||||
startPage();
|
||||
List<InventoryGoodsSummaryVO> list = drpInventoryService.selectInventoryInOutSummaryList(inventoryInOutSummaryVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.bonus.canteen.core.reportforms.controller;
|
||||
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.*;
|
||||
import com.bonus.canteen.core.reportforms.service.IDrpInventoryIntoDetailService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 库存入库明细Controller
|
||||
* 包含所有接口:查询、导出、公共数据接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-01-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/drp/inventoryInto")
|
||||
public class DrpInventoryIntoDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDrpInventoryIntoDetailService drpInventoryIntoDetailService;
|
||||
|
||||
/**
|
||||
* 查询库存入库明细列表
|
||||
*/
|
||||
@GetMapping("/detail/list")
|
||||
public AjaxResult list(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
// 调用Service方法 - 返回 Map
|
||||
Map<String, Object> result = drpInventoryIntoDetailService.pageInventoryIntoDetail(queryDTO);
|
||||
List<DrpInventoryIntoDetailVO> list = (List<DrpInventoryIntoDetailVO>) result.get("list");
|
||||
InventoryIntoSummaryVO summary = (InventoryIntoSummaryVO) result.get("summary");
|
||||
// 使用 AjaxResult 返回数据
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("rows", list);
|
||||
ajax.put("total", new PageInfo(list).getTotal());
|
||||
ajax.put("summary", summary);
|
||||
|
||||
return ajax;
|
||||
}
|
||||
/**
|
||||
* 查询库存出库明细列表
|
||||
*/
|
||||
@GetMapping("/detail/listout")
|
||||
public AjaxResult listout(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
// 调用Service方法 - 返回 Map
|
||||
Map<String, Object> result = drpInventoryIntoDetailService.pageInventoryOutDetail(queryDTO);
|
||||
List<DrpInventoryIntoDetailVO> list = (List<DrpInventoryIntoDetailVO>) result.get("list");
|
||||
InventoryIntoSummaryVO summary = (InventoryIntoSummaryVO) result.get("summary");
|
||||
// 使用 AjaxResult 返回数据
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("rows", list);
|
||||
ajax.put("total", new PageInfo(list).getTotal());
|
||||
ajax.put("summary", summary);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出库存入库明细列表
|
||||
*/
|
||||
@PostMapping("/detail/export")
|
||||
public void export(HttpServletResponse response, DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
List<DrpInventoryIntoDetailVO> list = drpInventoryIntoDetailService.pageInventoryIntoDetailesport(queryDTO);
|
||||
for (DrpInventoryIntoDetailVO vo : list) {
|
||||
vo.setIntoType(convertIntoType(vo.getIntoType()));
|
||||
}
|
||||
ExcelUtil<DrpInventoryIntoDetailVO> util = new ExcelUtil<DrpInventoryIntoDetailVO>(DrpInventoryIntoDetailVO.class);
|
||||
util.exportExcel(response, list, "库存入库明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出库存出库明细列表
|
||||
*/
|
||||
@PostMapping("/detail/outexport")
|
||||
public void outexport(HttpServletResponse response, DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
List<DrpInventoryoutDetailVO> list = drpInventoryIntoDetailService.pageInventoryIntoDetailoutesport(queryDTO);
|
||||
for (DrpInventoryoutDetailVO vo : list) {
|
||||
vo.setIntoType(convertIntoOutType(vo.getIntoType()));
|
||||
}
|
||||
ExcelUtil<DrpInventoryoutDetailVO> util = new ExcelUtil<DrpInventoryoutDetailVO>(DrpInventoryoutDetailVO.class);
|
||||
util.exportExcel(response, list, "库存出库明细数据");
|
||||
}
|
||||
private String convertIntoType(String type) {
|
||||
if ("6".equals(type)) {
|
||||
return "超市退单入库";
|
||||
} else if ("1".equals(type)) {
|
||||
return "采购入库";
|
||||
} else if ("5".equals(type)) {
|
||||
return "即入即出";
|
||||
} else {
|
||||
return "--";
|
||||
}
|
||||
}
|
||||
private String convertIntoOutType(String type) {
|
||||
if ("6".equals(type)) {
|
||||
return "超市入库";
|
||||
} else if ("1".equals(type)) {
|
||||
return "领取出库";
|
||||
} else if ("5".equals(type)) {
|
||||
return "即入即出";
|
||||
} else if ("3".equals(type)) {
|
||||
return "退货出库";
|
||||
}else {
|
||||
return "--";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取仓库列表(带权限控制)
|
||||
*/
|
||||
@GetMapping("/warehouse/list")
|
||||
public AjaxResult getWarehouseList(@RequestParam("areaIdList") Long[] areaIdList)
|
||||
{
|
||||
List<DrpWarehouseAllVO> list = drpInventoryIntoDetailService.getTenantWarehouse(areaIdList);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商列表
|
||||
*/
|
||||
@GetMapping("/supplier/list")
|
||||
public AjaxResult getSupplierList()
|
||||
{
|
||||
List<DrpSupplierVO> list = drpInventoryIntoDetailService.getSupplierList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货品类别字典
|
||||
*/
|
||||
@GetMapping("/goodsCategory/dict")
|
||||
public AjaxResult getGoodsCategoryDict()
|
||||
{
|
||||
List<DrpDictVO> list = drpInventoryIntoDetailService.getGoodsCategoryDict();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
package com.bonus.canteen.core.reportforms.controller;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenOrg;
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenRecord;
|
||||
import com.bonus.canteen.core.reportforms.beans.OrgConsume;
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportOrderInfoVo;
|
||||
import com.bonus.canteen.core.reportforms.service.reportformsService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/api/v2/report"})
|
||||
public class reportformsController extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(reportformsController.class);
|
||||
|
||||
@Resource
|
||||
private reportformsService service;
|
||||
@PostMapping("/consume/list")
|
||||
public List<OrgConsume> list(@RequestBody OrgConsume orgConsume) {
|
||||
return service.getOrgConsumeList(orgConsume);
|
||||
}
|
||||
|
||||
@GetMapping("/consume/peoplelist")
|
||||
public TableDataInfo peoplelist(CanteenRecord orgConsume) {
|
||||
startPage();
|
||||
List<CanteenRecord> peoplelist = service.getPeoplelist(orgConsume);
|
||||
return getDataTable(peoplelist);
|
||||
}
|
||||
/**
|
||||
* 人员报表查询导出功能
|
||||
* @param orgConsume
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/consume/exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, CanteenRecord orgConsume) throws UnsupportedEncodingException {
|
||||
if (orgConsume.getCustName() != null && !orgConsume.getCustName().trim().isEmpty()) {
|
||||
try {
|
||||
String decodedName = URLDecoder.decode(orgConsume.getCustName(), StandardCharsets.UTF_8.name());
|
||||
orgConsume.setCustName(decodedName);
|
||||
} catch (Exception e) {
|
||||
// 出错时打印日志,但不要影响后续逻辑
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 1. 查询数据
|
||||
List<CanteenRecord> peoplelist = service.getPeoplelist(orgConsume);
|
||||
// 2. 给 flowTypeText 赋值
|
||||
for (CanteenRecord record : peoplelist) {
|
||||
//获取的金额除以100
|
||||
record.setAmount(record.getAmount()/100);
|
||||
if ("110".equals(record.getFlowType())) {
|
||||
record.setFlowTypeText("消费");
|
||||
record.setAmount(-record.getAmount());
|
||||
} else if ("120".equals(record.getFlowType())) {
|
||||
record.setFlowTypeText("补助");
|
||||
record.setAmount(-record.getAmount());
|
||||
} else if ("130".equals(record.getFlowType())) {
|
||||
record.setFlowTypeText("退款");
|
||||
} else {
|
||||
record.setFlowTypeText(record.getFlowType());
|
||||
}
|
||||
}
|
||||
// 3. 导出 Excel
|
||||
ExcelUtil<CanteenRecord> util = new ExcelUtil<>(CanteenRecord.class);
|
||||
util.exportExcel(response, peoplelist, "人员导出数据详情");
|
||||
}
|
||||
|
||||
/**
|
||||
* 食堂预订餐接口查询
|
||||
* 通过区域名称查询
|
||||
* @param orgConsume
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/consume/listByArea")
|
||||
public List<OrgConsume> listByArea(@RequestBody OrgConsume orgConsume) {
|
||||
String orgName = orgConsume.getOrgName();
|
||||
Integer conSource = orgConsume.getConSource();
|
||||
|
||||
// 统一处理机构名称
|
||||
if (orgName != null) {
|
||||
orgName = orgName.replace("食堂", "");
|
||||
|
||||
// 特殊机构名称处理
|
||||
if ("运检后勤".equals(orgName) && conSource == 1) {
|
||||
orgName = "运检分公司";
|
||||
} else if ("送变电工业园".equals(orgName) && (conSource == 3 || conSource == 4 || conSource == 5 || conSource == 6)) {
|
||||
orgName = "sbd工业园";
|
||||
}
|
||||
|
||||
orgConsume.setOrgName(orgName);
|
||||
}
|
||||
|
||||
// 根据数据源类型路由到不同的服务方法
|
||||
switch (conSource) {
|
||||
case 1:
|
||||
return service.getlistByH5list(orgConsume);
|
||||
case 2:
|
||||
return service.getlistByOtherlist(orgConsume);
|
||||
case 3:
|
||||
return service.getlistByArealist(orgConsume);
|
||||
case 4:
|
||||
return service.getlistBySuperlist(orgConsume);
|
||||
case 5:
|
||||
return service.getDeductionlist(orgConsume);
|
||||
case 6:
|
||||
return service.getTeabreaklist(orgConsume);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 超市预订餐接口查询
|
||||
*/
|
||||
@PostMapping("/consume/listBySuper")
|
||||
public List<OrgConsume> listBySuper(@RequestBody OrgConsume orgConsume) {
|
||||
return service.getlistBySuperlist(orgConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5预订餐详情查询
|
||||
*/
|
||||
@PostMapping("/consume/listByH5")
|
||||
public List<OrgConsume> listByH5(@RequestBody OrgConsume orgConsume) {
|
||||
return service.getlistByH5list(orgConsume);
|
||||
}
|
||||
/**
|
||||
* 组织结构后台
|
||||
*/
|
||||
@GetMapping("/tree")
|
||||
public List<CanteenOrg> getOrgTree() {
|
||||
return service.getOrgTree();
|
||||
}
|
||||
|
||||
@GetMapping("/areatree")
|
||||
public List<CanteenOrg> getOrgareatree() {
|
||||
List<CanteenOrg> orgareatree = service.getOrgareatree();
|
||||
return orgareatree;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单区域不匹配列表
|
||||
*/
|
||||
@PostMapping("/getplaceList")
|
||||
public TableDataInfo getplaceList(@RequestBody ReportOrderInfoVo reportOrderInfoVo) {
|
||||
startPage();
|
||||
List<ReportOrderInfoVo> list = service.selectOrderMismatchList(reportOrderInfoVo);
|
||||
// 封装返回给前端
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 异地消费汇总
|
||||
*
|
||||
*/
|
||||
@PostMapping("/getplacehzList")
|
||||
public TableDataInfo getplacehzList(@RequestBody ReportOrderInfoVo reportOrderInfoVo) {
|
||||
List<ReportOrderInfoVo> list = service.selectplaceHzList(reportOrderInfoVo);
|
||||
// 封装返回给前端
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 人员报表查询导出功能
|
||||
* @param orgConsume
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/consume/placeexportExcel")
|
||||
public void placeexportExcel(HttpServletResponse response, ReportOrderInfoVo orgConsume) throws UnsupportedEncodingException {
|
||||
if (orgConsume.getCustName() != null && !orgConsume.getCustName().trim().isEmpty()) {
|
||||
try {
|
||||
String decodedName = URLDecoder.decode(orgConsume.getCustName(), StandardCharsets.UTF_8.name());
|
||||
orgConsume.setCustName(decodedName);
|
||||
} catch (Exception e) {
|
||||
// 出错时打印日志,但不要影响后续逻辑
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
checkCommonOrg(orgConsume);
|
||||
// 1. 查询数据
|
||||
List<ReportOrderInfoVo> peoplelist = service.placeexportExcel(orgConsume);
|
||||
|
||||
/// 分 -> 元
|
||||
peoplelist.forEach(record -> {
|
||||
if (record.getPayableAmount() != null) {
|
||||
record.setPayableAmount(
|
||||
record.getPayableAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)
|
||||
);
|
||||
}
|
||||
if (record.getRealAmount()!= null) {
|
||||
record.setRealAmount(
|
||||
record.getRealAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)
|
||||
);
|
||||
}
|
||||
});
|
||||
// 3. 导出 Excel
|
||||
ExcelUtil<ReportOrderInfoVo> util = new ExcelUtil<>(ReportOrderInfoVo.class);
|
||||
util.exportExcel(response, peoplelist, "人员导出数据详情");
|
||||
}
|
||||
private void checkCommonOrg(ReportOrderInfoVo vo) {
|
||||
if (vo.getSelectedOrg() == null || vo.getGzselectedOrg() == null) {
|
||||
vo.setCommonOrg(0);
|
||||
return;
|
||||
}
|
||||
|
||||
Set<String> set1 = new HashSet<>(Arrays.asList(vo.getSelectedOrg()));
|
||||
Set<String> set2 = new HashSet<>(Arrays.asList(vo.getGzselectedOrg()));
|
||||
|
||||
vo.setCommonOrg(set1.equals(set2) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.canteen.core.reportforms.exportUtils;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelHandlerAdapter;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class FenToYuanHandler implements ExcelHandlerAdapter {
|
||||
@Override
|
||||
public Object format(Object value, String[] args, Cell cell, Workbook workbook) {
|
||||
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
BigDecimal fen = new BigDecimal(value.toString());
|
||||
BigDecimal yuan = fen.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
|
||||
|
||||
// 关键三件套
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(yuan.doubleValue());
|
||||
return yuan.doubleValue();
|
||||
|
||||
} catch (Exception e) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.bonus.canteen.core.reportforms.mapper;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DrpInventoryIntoDetailMapper {
|
||||
/**
|
||||
* 查询库存入库明细列表
|
||||
*/
|
||||
public List<DrpInventoryIntoDetailVO> queryInventoryIntoDocDetail(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
InventoryIntoSummaryVO queryInventoryIntoDocDetailSum(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
|
||||
/**
|
||||
* 获取租户仓库列表(带权限控制)
|
||||
*/
|
||||
public List<DrpWarehouseAllVO> getTenantWarehouse(@Param("areaAuth") Long[] areaAuth);
|
||||
|
||||
/**
|
||||
* 获取用户有权限的仓库ID列表
|
||||
*/
|
||||
public List<Long> getTenantWarehouseIds(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户有权限的区域ID列表
|
||||
*/
|
||||
public List<Long> getTenantAreaIds(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 获取供应商列表
|
||||
*/
|
||||
List<DrpSupplierVO> getSupplierList(@Param("content") List<Long> areaAuth);
|
||||
|
||||
/**
|
||||
* 获取货品类别字典
|
||||
*/
|
||||
public List<DrpDictVO> getGoodsCategoryDict(@Param("areaAuth") List<Long> areaAuth);
|
||||
|
||||
/**
|
||||
* 查询库存出库明细列表
|
||||
*/
|
||||
List<DrpInventoryoutDetailVO> queryInventoryOutDetail(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
|
||||
InventoryIntoSummaryVO queryInventoryIntoDocDetailoutSum(DrpInventoryIntoDetailWrapper wrapper);
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.canteen.core.reportforms.mapper;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.DrpInventoryIntoDetailWrapper;
|
||||
import com.bonus.canteen.core.reportforms.beans.InventoryGoodsSummaryVO;
|
||||
import com.bonus.canteen.core.reportforms.beans.InventoryIntoSummaryVO;
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportDrpInventoryWarehouseSummaryVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DrpInventoryhzMapper {
|
||||
|
||||
List<InventoryGoodsSummaryVO> pageInventoryIntoDetail(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
InventoryIntoSummaryVO queryInventoryIntoDocDetailSum(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
List<ReportDrpInventoryWarehouseSummaryVO> queryInventoryWarehouseSummaryList(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
InventoryIntoSummaryVO queryInventoryWarehouseSummarySum(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
List<InventoryGoodsSummaryVO> queryInventorySupplierSummaryList(DrpInventoryIntoDetailWrapper wrapper);
|
||||
|
||||
List<InventoryGoodsSummaryVO> queryWarehouseInventorySupplierSummaryList(@Param("idList") List<Long> idList,
|
||||
@Param("wrapper") DrpInventoryIntoDetailWrapper wrapper);
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.canteen.core.reportforms.mapper;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenOrg;
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenRecord;
|
||||
import com.bonus.canteen.core.reportforms.beans.OrgConsume;
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportOrderInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface OrgConsumeMapper {
|
||||
|
||||
List<Map<String, Object>> selectConsumeRecords(OrgConsume orgConsume);
|
||||
|
||||
List<Map<String, Object>> selectReserveRecords(OrgConsume orgConsume);
|
||||
|
||||
List<Map<String, String>> selectAreaOrgMap();
|
||||
|
||||
List<OrgConsume> getlistByArealist(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistBySuperlist(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistByH5list(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistByOtherlist(OrgConsume orgConsume);
|
||||
|
||||
BigDecimal yzSumMoney(OrgConsume neworgConsume);
|
||||
|
||||
List<OrgConsume> getlistConsmerlist(OrgConsume orgConsume);
|
||||
|
||||
List<CanteenRecord> getPeoplelist(CanteenRecord orgConsume);
|
||||
|
||||
List<CanteenOrg> selectAllOrgs();
|
||||
|
||||
List<OrgConsume> getDeductionlist(OrgConsume orgConsume);
|
||||
|
||||
List<Map<String, Object>> selectReserveRecordsFromDatabase(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistForH5Special(OrgConsume orgConsume);
|
||||
|
||||
List<ReportOrderInfoVo> selectOrderMismatchList( @Param("vo") ReportOrderInfoVo reportOrderInfoVo);
|
||||
|
||||
ReportOrderInfoVo selectOrderMismatchListTotal(ReportOrderInfoVo reportOrderInfoVo);
|
||||
|
||||
List<CanteenOrg> selectAllareaOrgs();
|
||||
|
||||
List<OrgConsume> getTeabreaklist(OrgConsume orgConsume);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.canteen.core.reportforms.mapper;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportOrderInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PlaceMapper {
|
||||
|
||||
List<ReportOrderInfoVo> placeexportExcel(ReportOrderInfoVo orgConsume);
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.canteen.core.reportforms.service;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.DrpInventoryIntoDetailQueryDTO;
|
||||
import com.bonus.canteen.core.reportforms.beans.InventoryGoodsSummaryVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface DrpInventoryService {
|
||||
/**
|
||||
* 查询货品汇总明细列表
|
||||
*/
|
||||
Map<String, Object> pageInventoryIntoDetail(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
|
||||
List<InventoryGoodsSummaryVO> pageInventoryIntoDetailExport(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
|
||||
Map<String, Object> pageInventoryWarehouseSummary(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
|
||||
List<InventoryGoodsSummaryVO> selectInventoryInOutSummaryList(DrpInventoryIntoDetailQueryDTO inventoryInOutSummaryVO);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.canteen.core.reportforms.service;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IDrpInventoryIntoDetailService {
|
||||
/**
|
||||
* 查询库存入库明细列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 库存入库明细列表
|
||||
*/
|
||||
public Map<String, Object> pageInventoryIntoDetail(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
/**
|
||||
* 导出库存入库明细列表
|
||||
*/
|
||||
public List<DrpInventoryIntoDetailVO> pageInventoryIntoDetailesport(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 获取租户仓库列表(带权限控制)
|
||||
*
|
||||
* @param areaIdList 区域ID列表
|
||||
* @return 仓库列表
|
||||
*/
|
||||
public List<DrpWarehouseAllVO> getTenantWarehouse(Long[] areaIdList);
|
||||
|
||||
/**
|
||||
* 获取供应商列表
|
||||
*
|
||||
* @return 供应商列表
|
||||
*/
|
||||
public List<DrpSupplierVO> getSupplierList();
|
||||
|
||||
/**
|
||||
* 获取货品类别字典
|
||||
*
|
||||
* @return 货品类别字典列表
|
||||
*/
|
||||
public List<DrpDictVO> getGoodsCategoryDict();
|
||||
|
||||
public Map<String, Object> pageInventoryOutDetail(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
|
||||
List<DrpInventoryoutDetailVO> pageInventoryIntoDetailoutesport(DrpInventoryIntoDetailQueryDTO queryDTO);
|
||||
}
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
package com.bonus.canteen.core.reportforms.service.impl;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.*;
|
||||
import com.bonus.canteen.core.reportforms.mapper.DrpInventoryIntoDetailMapper;
|
||||
import com.bonus.canteen.core.reportforms.service.IDrpInventoryIntoDetailService;
|
||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class DrpInventoryIntoDetailServiceImpl implements IDrpInventoryIntoDetailService
|
||||
{
|
||||
@Autowired
|
||||
private DrpInventoryIntoDetailMapper drpInventoryIntoDetailMapper;
|
||||
/**
|
||||
* 查询库存入库明细列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 库存入库明细列表
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> pageInventoryIntoDetail(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> warehouseAuthority = drpInventoryIntoDetailMapper.getTenantWarehouseIds(currentUser.getUserId());
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
PageHelper.startPage(queryDTO);
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setWarehouseAuthority(warehouseAuthority);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
|
||||
// 查询明细数据
|
||||
List<DrpInventoryIntoDetailVO> drpInventoryIntoDetailVOS = drpInventoryIntoDetailMapper.queryInventoryIntoDocDetail(wrapper);
|
||||
for ( DrpInventoryIntoDetailVO c : drpInventoryIntoDetailVOS) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getOperatorName() != null && !c.getOperatorName().isEmpty()) {
|
||||
c.setOperatorName(SM4EncryptUtils.sm4Decrypt(c.getOperatorName()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 查询合计数据 - 这里应该返回 InventoryIntoSummaryVO
|
||||
InventoryIntoSummaryVO sumRow = drpInventoryIntoDetailMapper.queryInventoryIntoDocDetailSum(wrapper);
|
||||
|
||||
// 创建一个Map来返回明细和合计数据
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", drpInventoryIntoDetailVOS);
|
||||
result.put("summary", sumRow); // 这里直接放入 sumRow 对象
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DrpInventoryIntoDetailVO> pageInventoryIntoDetailesport(DrpInventoryIntoDetailQueryDTO queryDTO)
|
||||
{
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> warehouseAuthority = drpInventoryIntoDetailMapper.getTenantWarehouseIds(currentUser.getUserId());
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setWarehouseAuthority(warehouseAuthority);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
List<DrpInventoryIntoDetailVO> drpInventoryIntoDetailVOS = drpInventoryIntoDetailMapper.queryInventoryIntoDocDetail(wrapper);
|
||||
for ( DrpInventoryIntoDetailVO c : drpInventoryIntoDetailVOS) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getOperatorName() != null && !c.getOperatorName().isEmpty()) {
|
||||
c.setOperatorName(SM4EncryptUtils.sm4Decrypt(c.getOperatorName()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return drpInventoryIntoDetailVOS;
|
||||
}
|
||||
@Override
|
||||
public Map<String, Object> pageInventoryOutDetail(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> warehouseAuthority = drpInventoryIntoDetailMapper.getTenantWarehouseIds(currentUser.getUserId());
|
||||
// List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
PageHelper.startPage(queryDTO);
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setWarehouseAuthority(warehouseAuthority);
|
||||
wrapper.setAreaAuth(null);
|
||||
List<DrpInventoryoutDetailVO> drpInventoryoutDetailVOS = drpInventoryIntoDetailMapper.queryInventoryOutDetail(wrapper);
|
||||
/* for ( DrpInventoryoutDetailVO c : drpInventoryoutDetailVOS) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getOperatorName() != null && !c.getOperatorName().isEmpty()) {
|
||||
c.setOperatorName(SM4EncryptUtils.sm4Decrypt(c.getOperatorName()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
// 查询合计数据 - 这里应该返回 InventoryIntoSummaryVO
|
||||
InventoryIntoSummaryVO sumRow = drpInventoryIntoDetailMapper.queryInventoryIntoDocDetailoutSum(wrapper);
|
||||
//有关退款问题进行处理
|
||||
|
||||
// 创建一个Map来返回明细和合计数据
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", drpInventoryoutDetailVOS);
|
||||
result.put("summary", sumRow); // 这里直接放入 sumRow 对象
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DrpInventoryoutDetailVO> pageInventoryIntoDetailoutesport(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> warehouseAuthority = drpInventoryIntoDetailMapper.getTenantWarehouseIds(currentUser.getUserId());
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setWarehouseAuthority(warehouseAuthority);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
List<DrpInventoryoutDetailVO> drpInventoryIntoDetailVOS = drpInventoryIntoDetailMapper.queryInventoryOutDetail(wrapper);
|
||||
for ( DrpInventoryoutDetailVO c : drpInventoryIntoDetailVOS) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getOperatorName() != null && !c.getOperatorName().isEmpty()) {
|
||||
c.setOperatorName(SM4EncryptUtils.sm4Decrypt(c.getOperatorName()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return drpInventoryIntoDetailVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户仓库列表(带权限控制)
|
||||
*
|
||||
* @param areaIdList 区域ID列表
|
||||
* @return 仓库列表
|
||||
*/
|
||||
@Override
|
||||
public List<DrpWarehouseAllVO> getTenantWarehouse(Long[] areaIdList)
|
||||
{
|
||||
// 获取当前用户信息
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
// List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
// 调用Mapper查询
|
||||
List<DrpWarehouseAllVO> tenantWarehouse = drpInventoryIntoDetailMapper.getTenantWarehouse(areaIdList);
|
||||
return tenantWarehouse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商列表
|
||||
*
|
||||
* @return 供应商列表
|
||||
*/
|
||||
@Override
|
||||
public List<DrpSupplierVO> getSupplierList()
|
||||
{
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
return drpInventoryIntoDetailMapper.getSupplierList(areaAuth);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货品类别字典
|
||||
*
|
||||
* @return 货品类别字典列表
|
||||
*/
|
||||
@Override
|
||||
public List<DrpDictVO> getGoodsCategoryDict()
|
||||
{
|
||||
// 获取当前用户信息
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
List<DrpDictVO> list = drpInventoryIntoDetailMapper.getGoodsCategoryDict(areaAuth);
|
||||
|
||||
// 构建树形结构
|
||||
return buildGoodsCategoryTree(list);
|
||||
}
|
||||
/**
|
||||
* 构建货品类别树形结构
|
||||
*/
|
||||
private List<DrpDictVO> buildGoodsCategoryTree(List<DrpDictVO> list) {
|
||||
// 创建根节点(原料和商品)
|
||||
List<DrpDictVO> tree = new ArrayList<>();
|
||||
|
||||
// 1. 原料根节点
|
||||
DrpDictVO materialRoot = new DrpDictVO();
|
||||
materialRoot.setId(25595457052610560L);
|
||||
materialRoot.setDictLabel("原料");
|
||||
materialRoot.setParentId(-1L);
|
||||
materialRoot.setChildren(new ArrayList<>());
|
||||
tree.add(materialRoot);
|
||||
|
||||
// 2. 商品根节点
|
||||
DrpDictVO goodsRoot = new DrpDictVO();
|
||||
goodsRoot.setId(65595542415085568L);
|
||||
goodsRoot.setDictLabel("商品");
|
||||
goodsRoot.setParentId(-1L);
|
||||
goodsRoot.setChildren(new ArrayList<>());
|
||||
tree.add(goodsRoot);
|
||||
|
||||
// 将数据按 parent_id 分组
|
||||
Map<Long, List<DrpDictVO>> parentMap = list.stream()
|
||||
.filter(item -> item.getParentId() != null && item.getParentId() != -1L)
|
||||
.collect(Collectors.groupingBy(DrpDictVO::getParentId));
|
||||
|
||||
// 递归构建树
|
||||
buildCategoryChildren(materialRoot, parentMap);
|
||||
buildCategoryChildren(goodsRoot, parentMap);
|
||||
|
||||
return tree;
|
||||
}
|
||||
/**
|
||||
* 递归构建子节点
|
||||
*/
|
||||
private void buildCategoryChildren(DrpDictVO parent, Map<Long, List<DrpDictVO>> parentMap) {
|
||||
List<DrpDictVO> children = parentMap.get(parent.getId());
|
||||
if (children != null && !children.isEmpty()) {
|
||||
// 确保 children 列表已初始化
|
||||
if (parent.getChildren() == null) {
|
||||
parent.setChildren(new ArrayList<>());
|
||||
}
|
||||
|
||||
for (DrpDictVO child : children) {
|
||||
// 递归构建孙子节点
|
||||
buildCategoryChildren(child, parentMap);
|
||||
parent.getChildren().add(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.bonus.canteen.core.reportforms.service.impl;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.*;
|
||||
import com.bonus.canteen.core.reportforms.mapper.DrpInventoryIntoDetailMapper;
|
||||
import com.bonus.canteen.core.reportforms.mapper.DrpInventoryhzMapper;
|
||||
import com.bonus.canteen.core.reportforms.service.DrpInventoryService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class DrpInventoryServiceImpl implements DrpInventoryService {
|
||||
|
||||
@Autowired
|
||||
private DrpInventoryhzMapper drpInventoryMapper;
|
||||
|
||||
@Autowired
|
||||
private DrpInventoryIntoDetailMapper drpInventoryIntoDetailMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> pageInventoryIntoDetail(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
PageHelper.startPage(queryDTO);
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
// 查询明细数据
|
||||
List<InventoryGoodsSummaryVO> drpInventoryIntoDetailVOS = drpInventoryMapper.pageInventoryIntoDetail(wrapper);
|
||||
|
||||
// 查询合计数据 - 这里应该返回 InventoryIntoSummaryVO
|
||||
InventoryIntoSummaryVO sumRow = drpInventoryMapper.queryInventoryIntoDocDetailSum(wrapper);
|
||||
|
||||
// 创建一个Map来返回明细和合计数据
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", drpInventoryIntoDetailVOS);
|
||||
result.put("summary", sumRow); // 这里直接放入 sumRow 对象
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryGoodsSummaryVO> pageInventoryIntoDetailExport(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
// 查询明细数据
|
||||
List<InventoryGoodsSummaryVO> drpInventoryIntoDetailVOS = drpInventoryMapper.pageInventoryIntoDetail(wrapper);
|
||||
return drpInventoryIntoDetailVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> pageInventoryWarehouseSummary(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
PageHelper.startPage(queryDTO);
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
List<ReportDrpInventoryWarehouseSummaryVO> list = this.drpInventoryMapper.queryInventoryWarehouseSummaryList(wrapper);
|
||||
// 查询合计数据 - 这里应该返回 InventoryIntoSummaryVO
|
||||
InventoryIntoSummaryVO sumRow = drpInventoryMapper.queryInventoryWarehouseSummarySum(wrapper);
|
||||
// 创建一个Map来返回明细和合计数据
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("list", list);
|
||||
result.put("summary", sumRow); // 这里直接放入 sumRow 对象
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryGoodsSummaryVO> selectInventoryInOutSummaryList(DrpInventoryIntoDetailQueryDTO queryDTO) {
|
||||
|
||||
SysUser currentUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<Long> areaAuth = drpInventoryIntoDetailMapper.getTenantAreaIds(currentUser.getUserId());
|
||||
PageHelper.startPage(queryDTO);
|
||||
DrpInventoryIntoDetailWrapper wrapper = new DrpInventoryIntoDetailWrapper();
|
||||
wrapper.setParam(queryDTO);
|
||||
wrapper.setAreaAuth(areaAuth);
|
||||
List<InventoryGoodsSummaryVO> list = this.drpInventoryMapper.queryInventorySupplierSummaryList(wrapper);
|
||||
List<Long> idList = new ArrayList<Long>();
|
||||
for (InventoryGoodsSummaryVO vo : list) {
|
||||
Long supplierId = vo.getSupplierId();
|
||||
if (supplierId != null) {
|
||||
idList.add(supplierId);
|
||||
}
|
||||
}
|
||||
List<InventoryGoodsSummaryVO> warhouseVOList = this.drpInventoryMapper.queryWarehouseInventorySupplierSummaryList(idList, wrapper);
|
||||
return warhouseVOList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,476 @@
|
|||
package com.bonus.canteen.core.reportforms.service.impl;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenOrg;
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenRecord;
|
||||
import com.bonus.canteen.core.reportforms.beans.OrgConsume;
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportOrderInfoVo;
|
||||
import com.bonus.canteen.core.reportforms.mapper.OrgConsumeMapper;
|
||||
import com.bonus.canteen.core.reportforms.mapper.PlaceMapper;
|
||||
import com.bonus.canteen.core.reportforms.service.reportformsService;
|
||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
public class reportformsServiceImpl implements reportformsService {
|
||||
@Resource
|
||||
private OrgConsumeMapper mapper;
|
||||
|
||||
@Resource
|
||||
private PlaceMapper placemapper;
|
||||
@Override
|
||||
public List<OrgConsume> getOrgConsumeList(OrgConsume orgConsume) {
|
||||
// 查询食堂、超市、消费补扣的所有数据信息
|
||||
List<Map<String, Object>> consumeRecords = mapper.selectConsumeRecords(orgConsume);
|
||||
// 查询预定的订单信息
|
||||
List<Map<String, Object>> reserveRecords = mapper.selectReserveRecords(orgConsume);
|
||||
|
||||
// 判断是否包含指定的食堂,假设指定食堂的名称为 '宏源工业园食堂'
|
||||
boolean containsCanteen = reserveRecords.stream()
|
||||
.anyMatch(record -> "宏源工业园食堂".equals(record.get("orgName")));
|
||||
|
||||
// 如果没有找到食堂,重新查询并赋值
|
||||
/* if (!containsCanteen) {
|
||||
List<Map<String, Object>> newReserveRecords = mapper.selectReserveRecordsFromDatabase(orgConsume);
|
||||
// 插入新的记录到原有的数据列表
|
||||
reserveRecords.addAll(newReserveRecords); // 保证格式一致,直接合并
|
||||
}*/
|
||||
//针对特殊食堂退款的问题进行处理,专门写一个方法
|
||||
|
||||
//查询区域关联的字段信息
|
||||
List<Map<String, String>> areaOrgMaps = mapper.selectAreaOrgMap();
|
||||
|
||||
// area -> org 映射
|
||||
Map<String, String> areaToOrg = new HashMap<>();
|
||||
for (Map<String, String> map : areaOrgMaps) {
|
||||
areaToOrg.put(map.get("area_name"), map.get("org_name"));
|
||||
}
|
||||
|
||||
// 初始化结果
|
||||
Map<String, OrgConsume> resultMap = new HashMap<>();
|
||||
for (Map<String, Object> r : reserveRecords) {
|
||||
String orgName = (String) r.get("orgName");
|
||||
BigDecimal reserveAmount = (r.get("reserveAmount") != null) ?
|
||||
new BigDecimal(r.get("reserveAmount").toString()) : BigDecimal.ZERO;
|
||||
|
||||
OrgConsume oc = new OrgConsume();
|
||||
oc.setOrgName(orgName);
|
||||
oc.setReserveAmount(reserveAmount);
|
||||
resultMap.put(orgName, oc);
|
||||
}
|
||||
// 合并消费记录
|
||||
for (Map<String, Object> c : consumeRecords) {
|
||||
String areaName = (String) c.get("areaName");
|
||||
String conSource = (String) c.get("conSource");
|
||||
BigDecimal amount = (c.get("amount") != null) ?
|
||||
new BigDecimal(c.get("amount").toString()).abs() : BigDecimal.ZERO;
|
||||
String orgName = areaToOrg.get(areaName);
|
||||
if (orgName == null) {
|
||||
continue; // 没有映射关系,跳过
|
||||
}
|
||||
OrgConsume oc = resultMap.getOrDefault(orgName, new OrgConsume());
|
||||
oc.setOrgName(orgName);
|
||||
|
||||
if ("canteen".equals(conSource)) {
|
||||
oc.setCanteenAmount(oc.getCanteenAmount().add(amount));
|
||||
} else if ("super".equals(conSource)) {
|
||||
oc.setSuperAmount(oc.getSuperAmount().add(amount));
|
||||
}else if("teabreak".equals(conSource)){
|
||||
oc.setTeabreakAmount(oc.getTeabreakAmount().add(amount));
|
||||
}
|
||||
else if("station".equals(conSource)){
|
||||
//
|
||||
//驿站支付sql查询无法达到目标,从子表重新查询
|
||||
// oc.setH5Amount(oc.getH5Amount().add(amount));
|
||||
OrgConsume neworgConsume = new OrgConsume();
|
||||
neworgConsume.setStartPayTime(orgConsume.getStartPayTime());
|
||||
neworgConsume.setEndPayTime(orgConsume.getEndPayTime());
|
||||
neworgConsume.setOrgName(orgName.replace("食堂", ""));
|
||||
List<OrgConsume> orgConsumes = getlistByOtherlist(neworgConsume);
|
||||
BigDecimal othersum = orgConsumes.stream().map(OrgConsume::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
oc.setH5Amount(othersum);
|
||||
}else if("deduction".equals(conSource)){
|
||||
oc.setDeductionAmount(oc.getDeductionAmount().add(amount));
|
||||
}
|
||||
resultMap.put(orgName, oc);
|
||||
}
|
||||
return new ArrayList<>(resultMap.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgConsume> getlistByArealist(OrgConsume orgConsume) {
|
||||
List<OrgConsume> orgConsumes = mapper.getlistByArealist(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgConsume> getlistBySuperlist(OrgConsume orgConsume) {
|
||||
List<OrgConsume> orgConsumes = mapper.getlistBySuperlist(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
@Override
|
||||
public List<OrgConsume> getDeductionlist(OrgConsume orgConsume) {
|
||||
List<OrgConsume> orgConsumes = mapper.getDeductionlist(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportOrderInfoVo> selectOrderMismatchList(ReportOrderInfoVo reportOrderInfoVo) {
|
||||
// 在查询前或查询后判断 selectedOrg / gzselectedOrg
|
||||
checkCommonOrg(reportOrderInfoVo);
|
||||
List<ReportOrderInfoVo> reportOrderInfoVos = mapper.selectOrderMismatchList(reportOrderInfoVo);
|
||||
if (reportOrderInfoVos != null && !reportOrderInfoVos.isEmpty()) {
|
||||
for (ReportOrderInfoVo c : reportOrderInfoVos) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
}
|
||||
|
||||
// 手机解密 + 脱敏
|
||||
if (c.getMobile() != null && !c.getMobile().isEmpty()) {
|
||||
String phone = SM4EncryptUtils.sm4Decrypt(c.getMobile());
|
||||
if (phone.length() == 11) {
|
||||
c.setMobile(phone.substring(0, 3) + "****" + phone.substring(7));
|
||||
} else {
|
||||
c.setMobile(phone);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 查询全表合计
|
||||
ReportOrderInfoVo totalVo = mapper.selectOrderMismatchListTotal(reportOrderInfoVo);
|
||||
if (totalVo != null) {
|
||||
ReportOrderInfoVo totalRow = new ReportOrderInfoVo();
|
||||
totalRow.setCustNum("合计");
|
||||
totalRow.setTradeNum(totalVo.getTradeNum());
|
||||
totalRow.setPayableAmount(totalVo.getPayableAmount());
|
||||
totalRow.setRealAmount(totalRow.getRealAmount());
|
||||
// 其它字段按需填充空或默认值
|
||||
reportOrderInfoVos.add(totalRow);
|
||||
}
|
||||
|
||||
|
||||
return reportOrderInfoVos;
|
||||
}
|
||||
private static final String YUNJIAN_ORG_ID = "456681751578677248";
|
||||
|
||||
private void checkCommonOrg(ReportOrderInfoVo vo) {
|
||||
String[] selected = vo.getSelectedOrg();
|
||||
String[] gzSelected = vo.getGzselectedOrg();
|
||||
|
||||
if (selected == null || gzSelected == null) {
|
||||
vo.setCommonOrg(0);
|
||||
return;
|
||||
}
|
||||
|
||||
Set<String> set1 = new HashSet<>(Arrays.asList(selected));
|
||||
Set<String> set2 = new HashSet<>(Arrays.asList(gzSelected));
|
||||
|
||||
// 特殊情况:两个集合都包含“运检分公司”ID
|
||||
boolean isYunjian = set1.contains(YUNJIAN_ORG_ID) && set2.contains(YUNJIAN_ORG_ID);
|
||||
|
||||
// 普通情况:两个集合完全相同
|
||||
boolean isSame = set1.equals(set2);
|
||||
|
||||
vo.setCommonOrg((isSame || isYunjian) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgConsume> getlistByH5list(OrgConsume orgConsume) {
|
||||
if ("宏源工业园".equals(orgConsume.getOrgName())) {
|
||||
// 对 "宏源工业园" 使用专门的查询逻辑
|
||||
return getListForH5Special(orgConsume);
|
||||
} else {
|
||||
// 使用原有的查询逻辑
|
||||
return getListByH5list(orgConsume);
|
||||
}
|
||||
}
|
||||
private List<OrgConsume> getListForH5Special(OrgConsume orgConsume) {
|
||||
// 专门处理 "宏源工业园" 的查询逻辑
|
||||
List<OrgConsume> orgConsumes = mapper.getlistForH5Special(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
|
||||
private List<OrgConsume> getListByH5list(OrgConsume orgConsume) {
|
||||
// 使用原有的查询逻辑
|
||||
List<OrgConsume> orgConsumes = mapper.getlistByH5list(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
@Override
|
||||
public List<OrgConsume> getlistByOtherlist(OrgConsume orgConsume) {
|
||||
List<OrgConsume> orgConsumes = mapper.getlistByOtherlist(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 如果列表为空,直接返回
|
||||
if (orgConsumes == null || orgConsumes.isEmpty()) {
|
||||
return orgConsumes;
|
||||
}
|
||||
// 去重退款记录(flowType=130,payTime相同保留第一次)
|
||||
/* Set<String> seenPayTimes = new HashSet<>();
|
||||
orgConsumes.removeIf(c -> c.getFlowType() == 130 && !seenPayTimes.add(c.getPayTime()));*/
|
||||
return orgConsumes;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CanteenRecord> getPeoplelist(CanteenRecord orgConsume) {
|
||||
if(orgConsume.getCustName() != null){
|
||||
// 解密
|
||||
try {
|
||||
orgConsume.setCustName(SM4EncryptUtils.sm4Encrypt(orgConsume.getCustName()));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
List<CanteenRecord> list = mapper.getPeoplelist(orgConsume);
|
||||
for (CanteenRecord c : list) {
|
||||
try {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
}
|
||||
if (c.getPhone() != null) {
|
||||
String phone = SM4EncryptUtils.sm4Decrypt(c.getPhone());
|
||||
if (phone.length() == 11) {
|
||||
phone = phone.substring(0, 3) + "****" + phone.substring(7);
|
||||
}
|
||||
c.setPhone(phone);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CanteenOrg> getOrgTree() {
|
||||
List<CanteenOrg> all = mapper.selectAllOrgs();
|
||||
return buildTree(all, -1L); // 假设顶级 super_id = 0
|
||||
}
|
||||
@Override
|
||||
public List<CanteenOrg> getOrgareatree() {
|
||||
List<CanteenOrg> all = mapper.selectAllareaOrgs();
|
||||
return buildAreaTree(all, 378915229716713472L); // 假设顶级 super_id = 0
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportOrderInfoVo> placeexportExcel(ReportOrderInfoVo orgConsume) {
|
||||
checkCommonOrg(orgConsume);
|
||||
// 导出前,清分页参数
|
||||
orgConsume.setPageNum(null);
|
||||
orgConsume.setPageSize(null);
|
||||
|
||||
List<ReportOrderInfoVo> reportOrderInfoVos = placemapper.placeexportExcel(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
if (c.getMobile() != null) {
|
||||
String phone = SM4EncryptUtils.sm4Decrypt(c.getMobile());
|
||||
c.setMobile(phone);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return reportOrderInfoVos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgConsume> getTeabreaklist(OrgConsume orgConsume) {
|
||||
// 使用原有的查询逻辑
|
||||
List<OrgConsume> orgConsumes = mapper.getTeabreaklist(orgConsume)
|
||||
.stream()
|
||||
.peek(c -> {
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
try {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return orgConsumes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportOrderInfoVo> selectplaceHzList(ReportOrderInfoVo reportOrderInfoVo) {
|
||||
checkCommonOrg(reportOrderInfoVo);
|
||||
List<ReportOrderInfoVo> reportOrderInfoVos = mapper.selectOrderMismatchList(reportOrderInfoVo);
|
||||
if (reportOrderInfoVos != null && !reportOrderInfoVos.isEmpty()) {
|
||||
|
||||
// ========== 第一步:解密姓名和手机号 ==========
|
||||
for (ReportOrderInfoVo c : reportOrderInfoVos) {
|
||||
try {
|
||||
// 姓名解密
|
||||
if (c.getCustName() != null && !c.getCustName().isEmpty()) {
|
||||
c.setCustName(SM4EncryptUtils.sm4Decrypt(c.getCustName()));
|
||||
}
|
||||
|
||||
// 手机号解密 + 脱敏
|
||||
if (c.getMobile() != null && !c.getMobile().isEmpty()) {
|
||||
String phone = SM4EncryptUtils.sm4Decrypt(c.getMobile());
|
||||
if (phone.length() == 11) {
|
||||
c.setMobile(phone.substring(0, 3) + "****" + phone.substring(7));
|
||||
} else {
|
||||
c.setMobile(phone);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 第二步:合并“消费地与工作地相同”的数据 ==========
|
||||
Map<String, ReportOrderInfoVo> mergedMap = new LinkedHashMap<>();
|
||||
|
||||
for (ReportOrderInfoVo c : reportOrderInfoVos) {
|
||||
// key = 消费地 + "_" + 工作地
|
||||
String key = (c.getAreaName() == null ? "" : c.getAreaName()) + "_" +
|
||||
(c.getWorkAreaName() == null ? "" : c.getWorkAreaName());
|
||||
|
||||
if (mergedMap.containsKey(key)) {
|
||||
ReportOrderInfoVo exist = mergedMap.get(key);
|
||||
|
||||
// ✅ 交易次数累加(int)
|
||||
exist.setTradeNum(exist.getTradeNum() + c.getTradeNum());
|
||||
|
||||
// ✅ 应付金额累加(BigDecimal)
|
||||
if (exist.getPayableAmount() == null) {
|
||||
exist.setPayableAmount(BigDecimal.ZERO);
|
||||
}
|
||||
if (c.getPayableAmount() != null) {
|
||||
exist.setPayableAmount(exist.getPayableAmount().add(c.getPayableAmount()));
|
||||
}
|
||||
|
||||
// ✅ 实付金额累加(BigDecimal)
|
||||
if (exist.getRealAmount() == null) {
|
||||
exist.setRealAmount(BigDecimal.ZERO);
|
||||
}
|
||||
if (c.getRealAmount() != null) {
|
||||
exist.setRealAmount(exist.getRealAmount().add(c.getRealAmount()));
|
||||
}
|
||||
|
||||
} else {
|
||||
// 不存在则直接放入 map
|
||||
mergedMap.put(key, c);
|
||||
}
|
||||
}
|
||||
|
||||
// 转换为列表返回
|
||||
reportOrderInfoVos = new ArrayList<>(mergedMap.values());
|
||||
}
|
||||
|
||||
return reportOrderInfoVos;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private List<CanteenOrg> buildAreaTree(List<CanteenOrg> list, Long parentId) {
|
||||
System.err.println("parentId = " + parentId);
|
||||
List<CanteenOrg> tree = new ArrayList<>();
|
||||
for (CanteenOrg org : list) {
|
||||
if ((parentId == null && org.getSuperId() == null)
|
||||
|| (parentId != null && parentId.equals(org.getSuperId()))) {
|
||||
org.setChildren(buildAreaTree(list, org.getOrgId()));
|
||||
tree.add(org);
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
|
||||
private List<CanteenOrg> buildTree(List<CanteenOrg> list, Long parentId) {
|
||||
List<CanteenOrg> tree = new ArrayList<>();
|
||||
for (CanteenOrg org : list) {
|
||||
if (org.getSuperId().equals(parentId)) {
|
||||
org.setChildren(buildTree(list, org.getOrgId()));
|
||||
tree.add(org);
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.canteen.core.reportforms.service;
|
||||
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenOrg;
|
||||
import com.bonus.canteen.core.reportforms.beans.CanteenRecord;
|
||||
import com.bonus.canteen.core.reportforms.beans.OrgConsume;
|
||||
import com.bonus.canteen.core.reportforms.beans.ReportOrderInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface reportformsService {
|
||||
List<OrgConsume> getOrgConsumeList(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistByArealist(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistBySuperlist(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistByH5list(OrgConsume orgConsume);
|
||||
|
||||
List<OrgConsume> getlistByOtherlist(OrgConsume orgConsume);
|
||||
|
||||
List<CanteenRecord> getPeoplelist(CanteenRecord orgConsume);
|
||||
|
||||
List<CanteenOrg> getOrgTree();
|
||||
|
||||
List<OrgConsume> getDeductionlist(OrgConsume orgConsume);
|
||||
|
||||
List<ReportOrderInfoVo> selectOrderMismatchList(ReportOrderInfoVo reportOrderInfoVo);
|
||||
|
||||
List<CanteenOrg> getOrgareatree();
|
||||
|
||||
List<ReportOrderInfoVo> placeexportExcel(ReportOrderInfoVo orgConsume);
|
||||
|
||||
List<OrgConsume> getTeabreaklist(OrgConsume orgConsume);
|
||||
|
||||
List<ReportOrderInfoVo> selectplaceHzList(ReportOrderInfoVo reportOrderInfoVo);
|
||||
}
|
||||
Loading…
Reference in New Issue