From bfc7d111318e232f647347bee95a1d3d5a686e7c Mon Sep 17 00:00:00 2001 From: king Date: Fri, 13 Mar 2026 08:54:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E7=BB=8F=E8=90=A5=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=20=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/job/GenerateBusinessRealJob.java | 28 ++++ .../framework/entity/GrBiFsBusinessReal.java | 61 +++++++ .../core/framework/entity/GrBiStLot.java | 67 ++++++++ .../core/framework/entity/GrBiStProduct.java | 47 ++++++ .../framework/entity/GrBiStProductAvl.java | 51 ++++++ .../mapper/GrBiFsBusinessRealMapper.java | 73 +++++++++ .../framework/mapper/GrBiStLotMapper.java | 62 ++++++++ .../mapper/GrBiStProductAvlMapper.java | 62 ++++++++ .../framework/mapper/GrBiStProductMapper.java | 62 ++++++++ .../service/IGrBiFsBusinessRealService.java | 63 ++++++++ .../framework/service/IGrBiStLotService.java | 61 +++++++ .../service/IGrBiStProductAvlService.java | 61 +++++++ .../service/IGrBiStProductService.java | 61 +++++++ .../impl/GrBiFsBusinessRealServiceImpl.java | 146 +++++++++++++++++ .../framework/GrBiFsBusinessRealMapper.xml | 112 +++++++++++++ .../mapper/framework/GrBiStLotMapper.xml | 149 ++++++++++++++++++ .../framework/GrBiStProductAvlMapper.xml | 114 ++++++++++++++ .../mapper/framework/GrBiStProductMapper.xml | 104 ++++++++++++ 18 files changed, 1384 insertions(+) create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiFsBusinessRealMapper.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiFsBusinessRealService.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiFsBusinessRealServiceImpl.java create mode 100644 lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml create mode 100644 lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml create mode 100644 lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml create mode 100644 lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java new file mode 100644 index 0000000..1b3f485 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java @@ -0,0 +1,28 @@ +package com.lideeyunji.core.framework.config.job; + +import com.lideeyunji.core.framework.service.IGrBiFsBusinessRealService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * oracle gr_bi_fs_business_real -> mysql gr_bi_fs_business_real + */ +@Slf4j +@Component("generateBusinessRealJob") +public class GenerateBusinessRealJob implements JobHandler { + + @Resource + private IGrBiFsBusinessRealService grBiFsBusinessRealService; + + @Override + public String execute(String param) throws Exception { + log.info("*********** 开始生成经营指标完成情况 ************"); + grBiFsBusinessRealService.generateBusinessReal(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("*********** 生成经营指标完成情况完成 ************"); + return "*********** 生成经营指标完成情况完成 ************"; + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java new file mode 100644 index 0000000..c1645c4 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java @@ -0,0 +1,61 @@ +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; + +/** + * 经营指标完成情况对象 gr_bi_fs_business_real + * + * @author ruoyi + * @date 2026-03-12 + */ +@TableName("gr_bi_fs_business_real") +@Data +@EqualsAndHashCode(callSuper = true) +public class GrBiFsBusinessReal extends BaseTenantEntity +{ + private static final long serialVersionUID = 1L; + + @TableId(value = "ID", type = IdType.INPUT) + private String ID; + + @TableField(value = "USEYEAR") + private String useYear; + + @TableField(value = "USEMONTH") + private String useMonth; + + @TableField(value = "ITEMID") + private String itemId; + + @TableField(value = "ITEMNAME") + private String itemName; + + @TableField(value = "ITEMORDER") + private String itemOrder; + + @TableField(value = "MONTH_REAL") + private String monthReal; + + @TableField(value = "YEAR_REAL") + private String yearReal; + + @TableField(value = "MONTH_DIFF") + private String monthDiff; + + @TableField(value = "YEAR_PLAN") + private String yearPlan; + + @TableField(value = "YEAR_RATE") + private String yearRate; + + + + + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java new file mode 100644 index 0000000..74f7197 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java @@ -0,0 +1,67 @@ +package com.lideeyunji.core.framework.entity; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; + +/** + * 物料产品库存统计表对象 gr_bi_st_lot + * + * @author king + * @date 2026-03-12 + */ +@TableName("gr_bi_st_lot") +@Data +@EqualsAndHashCode(callSuper = true) +public class GrBiStLot extends BaseTenantEntity +{ + private static final long serialVersionUID = 1L; + + private Long ID; + + private Long GOODSID; + + private String GOODSNAME; + + private String GOODSTYPE; + + private String GOODSUNIT; + + private Long CLASSID; + + private String CLASSNAME; + + private Long LOTID; + + private String LOTNO; + + private Long GOODSQTY; + + private Date PRODDATE; + + private String INVALIDDATE; + + private Long INVALIDDAYS; + + private String STINDATE; + + private String STOUTDATE; + + private Long INVALIDDAYSTYPEID; + + private String INVALIDDAYSTYPE; + + private Long OUTTYPE; + + private Long STORAGEID; + + private String STORAGENAME; + + + + + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java new file mode 100644 index 0000000..7da271a --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java @@ -0,0 +1,47 @@ +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; + +/** + * 库存产品占比表对象 gr_bi_st_product + * + * @author king + * @date 2026-03-12 + */ +@TableName("gr_bi_st_product") +@Data +@EqualsAndHashCode(callSuper = true) +public class GrBiStProduct extends BaseTenantEntity +{ + private static final long serialVersionUID = 1L; + + private Long ID; + + private Long GOODSID; + + private String GOODSNAME; + + private String GOODSTYPE; + + private String GOODSUNIT; + + private Long GOODSCLASSID; + + private String GOODSCLASSNAME; + + private Long QTY; + + private Long qtyProp; + + private Long MONEY; + + private Long moneyProp; + + + + + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java new file mode 100644 index 0000000..7f7ed2a --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java @@ -0,0 +1,51 @@ +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; + +/** + * 产品可销库存对象 gr_bi_st_product_avl + * + * @author king + * @date 2026-03-12 + */ +@TableName("gr_bi_st_product_avl") +@Data +@EqualsAndHashCode(callSuper = true) +public class GrBiStProductAvl extends BaseTenantEntity +{ + private static final long serialVersionUID = 1L; + + private Long ID; + + private Long GOODSID; + + private String GOODSNAME; + + private String GOODSTYPE; + + private String GOODSUNIT; + + private Long PACKSIZE; + + private Long SORT; + + private Long SEMIREM; + + private String TODAYIN; + + private Long REM; + + private Long THISMONTHOUT; + + private Long LASTMONTHOUT; + + private Long THISYEAROUT; + + + + + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiFsBusinessRealMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiFsBusinessRealMapper.java new file mode 100644 index 0000000..4085d27 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiFsBusinessRealMapper.java @@ -0,0 +1,73 @@ +package com.lideeyunji.core.framework.mapper; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.lideeyunji.core.framework.entity.GrBiFsBusinessReal; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lideeyunji.core.framework.entity.GrBiSaAgg; +import org.apache.ibatis.annotations.Param; + +/** + * 经营指标完成情况Mapper接口 + * + * @author ruoyi + * @date 2026-03-12 + */ +public interface GrBiFsBusinessRealMapper extends BaseMapper +{ + /** + * 查询经营指标完成情况 + * + * @param ID 经营指标完成情况主键 + * @return 经营指标完成情况 + */ + public GrBiFsBusinessReal selectGrBiFsBusinessRealByID(String ID); + + /** + * 查询经营指标完成情况列表 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 经营指标完成情况集合 + */ + public List selectGrBiFsBusinessRealList(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 新增经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + public int insertGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 修改经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + public int updateGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 删除经营指标完成情况 + * + * @param ID 经营指标完成情况主键 + * @return 结果 + */ + public int deleteGrBiFsBusinessRealByID(String ID); + + /** + * 批量删除经营指标完成情况 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteGrBiFsBusinessRealByIDs(String[] IDs); + + @DS(value = "#dataSourceType") + List getBusinessRealList(@Param("dataSourceType") String dataSourceType, @Param("pastYearMonth") Integer pastYearMonth, + @Param("currentYearMonth") Integer currentYearMonth); + @DS(value = "#dataSourceType") + int deleteOldBusinessReal(@Param("dataSourceType") String dataSourceType, @Param("pastYearMonth") Integer pastYearMonth, + @Param("currentYearMonth") Integer currentYearMonth); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java new file mode 100644 index 0000000..ff28763 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java @@ -0,0 +1,62 @@ +package com.lideeyunji.core.framework.mapper; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStLot; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 物料产品库存统计表Mapper接口 + * + * @author king + * @date 2026-03-12 + */ +public interface GrBiStLotMapper extends BaseMapper +{ + /** + * 查询物料产品库存统计表 + * + * @param ID 物料产品库存统计表主键 + * @return 物料产品库存统计表 + */ + public GrBiStLot selectGrBiStLotByID(Long ID); + + /** + * 查询物料产品库存统计表列表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 物料产品库存统计表集合 + */ + public List selectGrBiStLotList(GrBiStLot grBiStLot); + + /** + * 新增物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + public int insertGrBiStLot(GrBiStLot grBiStLot); + + /** + * 修改物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + public int updateGrBiStLot(GrBiStLot grBiStLot); + + /** + * 删除物料产品库存统计表 + * + * @param ID 物料产品库存统计表主键 + * @return 结果 + */ + public int deleteGrBiStLotByID(Long ID); + + /** + * 批量删除物料产品库存统计表 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteGrBiStLotByIDs(Long[] IDs); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java new file mode 100644 index 0000000..04ce825 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java @@ -0,0 +1,62 @@ +package com.lideeyunji.core.framework.mapper; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStProductAvl; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 产品可销库存Mapper接口 + * + * @author king + * @date 2026-03-12 + */ +public interface GrBiStProductAvlMapper extends BaseMapper +{ + /** + * 查询产品可销库存 + * + * @param ID 产品可销库存主键 + * @return 产品可销库存 + */ + public GrBiStProductAvl selectGrBiStProductAvlByID(Long ID); + + /** + * 查询产品可销库存列表 + * + * @param grBiStProductAvl 产品可销库存 + * @return 产品可销库存集合 + */ + public List selectGrBiStProductAvlList(GrBiStProductAvl grBiStProductAvl); + + /** + * 新增产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + public int insertGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl); + + /** + * 修改产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + public int updateGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl); + + /** + * 删除产品可销库存 + * + * @param ID 产品可销库存主键 + * @return 结果 + */ + public int deleteGrBiStProductAvlByID(Long ID); + + /** + * 批量删除产品可销库存 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteGrBiStProductAvlByIDs(Long[] IDs); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java new file mode 100644 index 0000000..eb9164a --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java @@ -0,0 +1,62 @@ +package com.lideeyunji.core.framework.mapper; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStProduct; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 库存产品占比表Mapper接口 + * + * @author king + * @date 2026-03-12 + */ +public interface GrBiStProductMapper extends BaseMapper +{ + /** + * 查询库存产品占比表 + * + * @param ID 库存产品占比表主键 + * @return 库存产品占比表 + */ + public GrBiStProduct selectGrBiStProductByID(Long ID); + + /** + * 查询库存产品占比表列表 + * + * @param grBiStProduct 库存产品占比表 + * @return 库存产品占比表集合 + */ + public List selectGrBiStProductList(GrBiStProduct grBiStProduct); + + /** + * 新增库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + public int insertGrBiStProduct(GrBiStProduct grBiStProduct); + + /** + * 修改库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + public int updateGrBiStProduct(GrBiStProduct grBiStProduct); + + /** + * 删除库存产品占比表 + * + * @param ID 库存产品占比表主键 + * @return 结果 + */ + public int deleteGrBiStProductByID(Long ID); + + /** + * 批量删除库存产品占比表 + * + * @param IDs 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteGrBiStProductByIDs(Long[] IDs); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiFsBusinessRealService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiFsBusinessRealService.java new file mode 100644 index 0000000..8ad1a80 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiFsBusinessRealService.java @@ -0,0 +1,63 @@ +package com.lideeyunji.core.framework.service; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiFsBusinessReal; + +/** + * 经营指标完成情况Service接口 + * + * @author ruoyi + * @date 2026-03-12 + */ +public interface IGrBiFsBusinessRealService +{ + /** + * 查询经营指标完成情况 + * + * @param ID 经营指标完成情况主键 + * @return 经营指标完成情况 + */ + public GrBiFsBusinessReal selectGrBiFsBusinessRealByID(String ID); + + /** + * 查询经营指标完成情况列表 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 经营指标完成情况集合 + */ + public List selectGrBiFsBusinessRealList(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 新增经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + public int insertGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 修改经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + public int updateGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal); + + /** + * 批量删除经营指标完成情况 + * + * @param IDs 需要删除的经营指标完成情况主键集合 + * @return 结果 + */ + public int deleteGrBiFsBusinessRealByIDs(String[] IDs); + + /** + * 删除经营指标完成情况信息 + * + * @param ID 经营指标完成情况主键 + * @return 结果 + */ + public int deleteGrBiFsBusinessRealByID(String ID); + + void generateBusinessReal(String dataSourceType); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java new file mode 100644 index 0000000..d1b33cf --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java @@ -0,0 +1,61 @@ +package com.lideeyunji.core.framework.service; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStLot; + +/** + * 物料产品库存统计表Service接口 + * + * @author king + * @date 2026-03-12 + */ +public interface IGrBiStLotService +{ + /** + * 查询物料产品库存统计表 + * + * @param ID 物料产品库存统计表主键 + * @return 物料产品库存统计表 + */ + public GrBiStLot selectGrBiStLotByID(Long ID); + + /** + * 查询物料产品库存统计表列表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 物料产品库存统计表集合 + */ + public List selectGrBiStLotList(GrBiStLot grBiStLot); + + /** + * 新增物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + public int insertGrBiStLot(GrBiStLot grBiStLot); + + /** + * 修改物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + public int updateGrBiStLot(GrBiStLot grBiStLot); + + /** + * 批量删除物料产品库存统计表 + * + * @param IDs 需要删除的物料产品库存统计表主键集合 + * @return 结果 + */ + public int deleteGrBiStLotByIDs(Long[] IDs); + + /** + * 删除物料产品库存统计表信息 + * + * @param ID 物料产品库存统计表主键 + * @return 结果 + */ + public int deleteGrBiStLotByID(Long ID); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java new file mode 100644 index 0000000..f047dcd --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java @@ -0,0 +1,61 @@ +package com.lideeyunji.core.framework.service; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStProductAvl; + +/** + * 产品可销库存Service接口 + * + * @author king + * @date 2026-03-12 + */ +public interface IGrBiStProductAvlService +{ + /** + * 查询产品可销库存 + * + * @param ID 产品可销库存主键 + * @return 产品可销库存 + */ + public GrBiStProductAvl selectGrBiStProductAvlByID(Long ID); + + /** + * 查询产品可销库存列表 + * + * @param grBiStProductAvl 产品可销库存 + * @return 产品可销库存集合 + */ + public List selectGrBiStProductAvlList(GrBiStProductAvl grBiStProductAvl); + + /** + * 新增产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + public int insertGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl); + + /** + * 修改产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + public int updateGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl); + + /** + * 批量删除产品可销库存 + * + * @param IDs 需要删除的产品可销库存主键集合 + * @return 结果 + */ + public int deleteGrBiStProductAvlByIDs(Long[] IDs); + + /** + * 删除产品可销库存信息 + * + * @param ID 产品可销库存主键 + * @return 结果 + */ + public int deleteGrBiStProductAvlByID(Long ID); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java new file mode 100644 index 0000000..a830227 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java @@ -0,0 +1,61 @@ +package com.lideeyunji.core.framework.service; + +import java.util.List; +import com.lideeyunji.core.framework.entity.GrBiStProduct; + +/** + * 库存产品占比表Service接口 + * + * @author king + * @date 2026-03-12 + */ +public interface IGrBiStProductService +{ + /** + * 查询库存产品占比表 + * + * @param ID 库存产品占比表主键 + * @return 库存产品占比表 + */ + public GrBiStProduct selectGrBiStProductByID(Long ID); + + /** + * 查询库存产品占比表列表 + * + * @param grBiStProduct 库存产品占比表 + * @return 库存产品占比表集合 + */ + public List selectGrBiStProductList(GrBiStProduct grBiStProduct); + + /** + * 新增库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + public int insertGrBiStProduct(GrBiStProduct grBiStProduct); + + /** + * 修改库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + public int updateGrBiStProduct(GrBiStProduct grBiStProduct); + + /** + * 批量删除库存产品占比表 + * + * @param IDs 需要删除的库存产品占比表主键集合 + * @return 结果 + */ + public int deleteGrBiStProductByIDs(Long[] IDs); + + /** + * 删除库存产品占比表信息 + * + * @param ID 库存产品占比表主键 + * @return 结果 + */ + public int deleteGrBiStProductByID(Long ID); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiFsBusinessRealServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiFsBusinessRealServiceImpl.java new file mode 100644 index 0000000..bebc166 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiFsBusinessRealServiceImpl.java @@ -0,0 +1,146 @@ +package com.lideeyunji.core.framework.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lideeyunji.core.framework.entity.GrBiFsBusinessReal; +import com.lideeyunji.core.framework.mapper.GrBiFsBusinessRealMapper; +import com.lideeyunji.core.framework.service.IGrBiFsBusinessRealService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 经营指标完成情况Service业务层处理 + * + * @author ruoyi + * @date 2026-03-12 + */ +@Slf4j +@Service +public class GrBiFsBusinessRealServiceImpl extends ServiceImpl implements IGrBiFsBusinessRealService +{ + + + @Override + @DS(value = "#dataSourceType") + public void generateBusinessReal(String dataSourceType) { + //获取本地mysql数据库中表中UPDATE_TIME最新的数据 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().orderByDesc(GrBiFsBusinessReal::getUseYear, GrBiFsBusinessReal::getUseMonth).last("LIMIT 1"); + GrBiFsBusinessReal real = this.baseMapper.selectOne(queryWrapper); + int lastUserYear = 2022; + int lastUserMonth = 1; + if(real != null){ + lastUserYear = Integer.parseInt(real.getUseYear()); + lastUserMonth = Integer.parseInt(real.getUseMonth()); + } + // 获取当前时间的年和月 + LocalDateTime now = LocalDateTime.now(); + int currentYear = now.getYear(); + int currentMonth = now.getMonthValue(); + + // 获取三个月前的时间和年月 + LocalDateTime threeMonthsAgo = now.minusMonths(3); + int pastYear = threeMonthsAgo.getYear(); + int pastMonth = threeMonthsAgo.getMonthValue(); + + log.info("最后更新的年月:{}年{}月", lastUserYear, lastUserMonth); + log.info("当前:{}年{}月", currentYear, currentMonth); + log.info("三个月前:{}年{}月", pastYear, pastMonth); + if (lastUserYear < pastYear || (lastUserYear == pastYear && lastUserMonth < pastMonth)) { + pastYear = lastUserYear; + pastMonth = lastUserMonth; + } + log.info("开始时间:{}年{}月, 结束时间:{}年{}月", pastYear, pastMonth, currentYear, currentMonth); + + // 获取三个月前的数据 + List grBiSaSetdtlList = this.baseMapper.getBusinessRealList(lideeYunJiBaseConstant.DS_ORACLE_GRYYBI,pastYear * 100 + pastMonth, currentYear * 100 + currentMonth); + if (CollUtil.isEmpty(grBiSaSetdtlList)) { + return; + } + //保存数据 + int reNum = this.baseMapper.deleteOldBusinessReal(lideeYunJiBaseConstant.DS_ERP_BI_DATA,pastYear * 100 + pastMonth, currentYear * 100 + currentMonth); + log.info("删除数量:{}", reNum); + for (GrBiFsBusinessReal grBiSaSetdtl : grBiSaSetdtlList) { + int re = this.baseMapper.insert(grBiSaSetdtl); + if (re < 1) { + throw new RuntimeException("批量新增异常"); + } + } + } + /** + * 查询经营指标完成情况 + * + * @param ID 经营指标完成情况主键 + * @return 经营指标完成情况 + */ + @Override + public GrBiFsBusinessReal selectGrBiFsBusinessRealByID(String ID) + { + return this.baseMapper.selectGrBiFsBusinessRealByID(ID); + } + + /** + * 查询经营指标完成情况列表 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 经营指标完成情况 + */ + @Override + public List selectGrBiFsBusinessRealList(GrBiFsBusinessReal grBiFsBusinessReal) + { + return this.baseMapper.selectGrBiFsBusinessRealList(grBiFsBusinessReal); + } + + /** + * 新增经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + @Override + public int insertGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal) + { + return this.baseMapper.insertGrBiFsBusinessReal(grBiFsBusinessReal); + } + + /** + * 修改经营指标完成情况 + * + * @param grBiFsBusinessReal 经营指标完成情况 + * @return 结果 + */ + @Override + public int updateGrBiFsBusinessReal(GrBiFsBusinessReal grBiFsBusinessReal) + { + return this.baseMapper.updateGrBiFsBusinessReal(grBiFsBusinessReal); + } + + /** + * 批量删除经营指标完成情况 + * + * @param IDs 需要删除的经营指标完成情况主键 + * @return 结果 + */ + @Override + public int deleteGrBiFsBusinessRealByIDs(String[] IDs) + { + return this.baseMapper.deleteGrBiFsBusinessRealByIDs(IDs); + } + + /** + * 删除经营指标完成情况信息 + * + * @param ID 经营指标完成情况主键 + * @return 结果 + */ + @Override + public int deleteGrBiFsBusinessRealByID(String ID) + { + return this.baseMapper.deleteGrBiFsBusinessRealByID(ID); + } +} diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml new file mode 100644 index 0000000..102a245 --- /dev/null +++ b/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + select ID, USEYEAR, USEMONTH, ITEMID, ITEMNAME, ITEMORDER, MONTH_REAL, YEAR_REAL, MONTH_DIFF, YEAR_PLAN, YEAR_RATE from gr_bi_fs_business_real + + + + + + + + + insert into gr_bi_fs_business_real + + ID, + USEYEAR, + USEMONTH, + ITEMID, + ITEMNAME, + ITEMORDER, + MONTH_REAL, + YEAR_REAL, + MONTH_DIFF, + YEAR_PLAN, + YEAR_RATE, + + + #{ID}, + #{USEYEAR}, + #{USEMONTH}, + #{ITEMID}, + #{ITEMNAME}, + #{ITEMORDER}, + #{monthReal}, + #{yearReal}, + #{monthDiff}, + #{yearPlan}, + #{yearRate}, + + + + + update gr_bi_fs_business_real + + USEYEAR = #{USEYEAR}, + USEMONTH = #{USEMONTH}, + ITEMID = #{ITEMID}, + ITEMNAME = #{ITEMNAME}, + ITEMORDER = #{ITEMORDER}, + MONTH_REAL = #{monthReal}, + YEAR_REAL = #{yearReal}, + MONTH_DIFF = #{monthDiff}, + YEAR_PLAN = #{yearPlan}, + YEAR_RATE = #{yearRate}, + + where ID = #{ID} + + + + delete from gr_bi_fs_business_real where ID = #{ID} + + + + delete from gr_bi_fs_business_real where ID in + + #{ID} + + + \ No newline at end of file diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml new file mode 100644 index 0000000..9ae1c26 --- /dev/null +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, CLASSID, CLASSNAME, LOTID, LOTNO, GOODSQTY, PRODDATE, INVALIDDATE, INVALIDDAYS, STINDATE, STOUTDATE, INVALIDDAYSTYPEID, INVALIDDAYSTYPE, OUTTYPE, STORAGEID, STORAGENAME from gr_bi_st_lot + + + + + + + + insert into gr_bi_st_lot + + ID, + GOODSID, + GOODSNAME, + GOODSTYPE, + GOODSUNIT, + CLASSID, + CLASSNAME, + LOTID, + LOTNO, + GOODSQTY, + PRODDATE, + INVALIDDATE, + INVALIDDAYS, + STINDATE, + STOUTDATE, + INVALIDDAYSTYPEID, + INVALIDDAYSTYPE, + OUTTYPE, + STORAGEID, + STORAGENAME, + + + #{ID}, + #{GOODSID}, + #{GOODSNAME}, + #{GOODSTYPE}, + #{GOODSUNIT}, + #{CLASSID}, + #{CLASSNAME}, + #{LOTID}, + #{LOTNO}, + #{GOODSQTY}, + #{PRODDATE}, + #{INVALIDDATE}, + #{INVALIDDAYS}, + #{STINDATE}, + #{STOUTDATE}, + #{INVALIDDAYSTYPEID}, + #{INVALIDDAYSTYPE}, + #{OUTTYPE}, + #{STORAGEID}, + #{STORAGENAME}, + + + + + update gr_bi_st_lot + + GOODSID = #{GOODSID}, + GOODSNAME = #{GOODSNAME}, + GOODSTYPE = #{GOODSTYPE}, + GOODSUNIT = #{GOODSUNIT}, + CLASSID = #{CLASSID}, + CLASSNAME = #{CLASSNAME}, + LOTID = #{LOTID}, + LOTNO = #{LOTNO}, + GOODSQTY = #{GOODSQTY}, + PRODDATE = #{PRODDATE}, + INVALIDDATE = #{INVALIDDATE}, + INVALIDDAYS = #{INVALIDDAYS}, + STINDATE = #{STINDATE}, + STOUTDATE = #{STOUTDATE}, + INVALIDDAYSTYPEID = #{INVALIDDAYSTYPEID}, + INVALIDDAYSTYPE = #{INVALIDDAYSTYPE}, + OUTTYPE = #{OUTTYPE}, + STORAGEID = #{STORAGEID}, + STORAGENAME = #{STORAGENAME}, + + where ID = #{ID} + + + + delete from gr_bi_st_lot where ID = #{ID} + + + + delete from gr_bi_st_lot where ID in + + #{ID} + + + \ No newline at end of file diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml new file mode 100644 index 0000000..e9503a9 --- /dev/null +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, PACKSIZE, SORT, SEMIREM, TODAYIN, REM, THISMONTHOUT, LASTMONTHOUT, THISYEAROUT from gr_bi_st_product_avl + + + + + + + + insert into gr_bi_st_product_avl + + ID, + GOODSID, + GOODSNAME, + GOODSTYPE, + GOODSUNIT, + PACKSIZE, + SORT, + SEMIREM, + TODAYIN, + REM, + THISMONTHOUT, + LASTMONTHOUT, + THISYEAROUT, + + + #{ID}, + #{GOODSID}, + #{GOODSNAME}, + #{GOODSTYPE}, + #{GOODSUNIT}, + #{PACKSIZE}, + #{SORT}, + #{SEMIREM}, + #{TODAYIN}, + #{REM}, + #{THISMONTHOUT}, + #{LASTMONTHOUT}, + #{THISYEAROUT}, + + + + + update gr_bi_st_product_avl + + GOODSID = #{GOODSID}, + GOODSNAME = #{GOODSNAME}, + GOODSTYPE = #{GOODSTYPE}, + GOODSUNIT = #{GOODSUNIT}, + PACKSIZE = #{PACKSIZE}, + SORT = #{SORT}, + SEMIREM = #{SEMIREM}, + TODAYIN = #{TODAYIN}, + REM = #{REM}, + THISMONTHOUT = #{THISMONTHOUT}, + LASTMONTHOUT = #{LASTMONTHOUT}, + THISYEAROUT = #{THISYEAROUT}, + + where ID = #{ID} + + + + delete from gr_bi_st_product_avl where ID = #{ID} + + + + delete from gr_bi_st_product_avl where ID in + + #{ID} + + + \ No newline at end of file diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml new file mode 100644 index 0000000..a1f3f1a --- /dev/null +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, GOODSCLASSID, GOODSCLASSNAME, QTY, QTY_PROP, MONEY, MONEY_PROP from gr_bi_st_product + + + + + + + + insert into gr_bi_st_product + + ID, + GOODSID, + GOODSNAME, + GOODSTYPE, + GOODSUNIT, + GOODSCLASSID, + GOODSCLASSNAME, + QTY, + QTY_PROP, + MONEY, + MONEY_PROP, + + + #{ID}, + #{GOODSID}, + #{GOODSNAME}, + #{GOODSTYPE}, + #{GOODSUNIT}, + #{GOODSCLASSID}, + #{GOODSCLASSNAME}, + #{QTY}, + #{qtyProp}, + #{MONEY}, + #{moneyProp}, + + + + + update gr_bi_st_product + + GOODSID = #{GOODSID}, + GOODSNAME = #{GOODSNAME}, + GOODSTYPE = #{GOODSTYPE}, + GOODSUNIT = #{GOODSUNIT}, + GOODSCLASSID = #{GOODSCLASSID}, + GOODSCLASSNAME = #{GOODSCLASSNAME}, + QTY = #{QTY}, + QTY_PROP = #{qtyProp}, + MONEY = #{MONEY}, + MONEY_PROP = #{moneyProp}, + + where ID = #{ID} + + + + delete from gr_bi_st_product where ID = #{ID} + + + + delete from gr_bi_st_product where ID in + + #{ID} + + + \ No newline at end of file From bea29295a5f71b713ead52be9326587e0026d12c Mon Sep 17 00:00:00 2001 From: king Date: Fri, 13 Mar 2026 08:59:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E7=89=A9=E6=96=99=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=BB=9F=E8=AE=A1=E8=A1=A8=20=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/job/GenerateStLotJob.java | 29 ++++++ .../framework/service/IGrBiStLotService.java | 2 + .../service/impl/GrBiStLotServiceImpl.java | 95 +++++++++++++++++++ .../impl/GrBiStProductAvlServiceImpl.java | 90 ++++++++++++++++++ .../impl/GrBiStProductServiceImpl.java | 90 ++++++++++++++++++ 5 files changed, 306 insertions(+) create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductAvlServiceImpl.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java new file mode 100644 index 0000000..b32e03b --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java @@ -0,0 +1,29 @@ +package com.lideeyunji.core.framework.config.job; + +import com.lideeyunji.core.framework.service.IGrBiFsBusinessRealService; +import com.lideeyunji.core.framework.service.IGrBiStLotService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * oracle gr_bi_st_lot -> mysql gr_bi_st_lot + */ +@Slf4j +@Component("generateStLotJob") +public class GenerateStLotJob implements JobHandler { + + @Resource + private IGrBiStLotService grBiFsStLotService; + + @Override + public String execute(String param) throws Exception { + log.info("*********** 开始生成物料产品库存统计表完成情况 ************"); + grBiFsStLotService.generateStLot(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("*********** 生成物料产品库存统计表完成情况完成 ************"); + return "*********** 生成物料产品库存统计表完成情况完成 ************"; + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java index d1b33cf..bc6dce1 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java @@ -58,4 +58,6 @@ public interface IGrBiStLotService * @return 结果 */ public int deleteGrBiStLotByID(Long ID); + + void generateStLot(String dsErpBiData); } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java new file mode 100644 index 0000000..2807452 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java @@ -0,0 +1,95 @@ +package com.lideeyunji.core.framework.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.lideeyunji.core.framework.mapper.GrBiStLotMapper; +import com.lideeyunji.core.framework.entity.GrBiStLot; +import com.lideeyunji.core.framework.service.IGrBiStLotService; + +/** + * 物料产品库存统计表Service业务层处理 + * + * @author king + * @date 2026-03-12 + */ +@Service +public class GrBiStLotServiceImpl extends ServiceImpl implements IGrBiStLotService +{ + /** + * 查询物料产品库存统计表 + * + * @param ID 物料产品库存统计表主键 + * @return 物料产品库存统计表 + */ + @Override + public GrBiStLot selectGrBiStLotByID(Long ID) + { + return this.baseMapper.selectGrBiStLotByID(ID); + } + + /** + * 查询物料产品库存统计表列表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 物料产品库存统计表 + */ + @Override + public List selectGrBiStLotList(GrBiStLot grBiStLot) + { + return this.baseMapper.selectGrBiStLotList(grBiStLot); + } + + /** + * 新增物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + @Override + public int insertGrBiStLot(GrBiStLot grBiStLot) + { + return this.baseMapper.insertGrBiStLot(grBiStLot); + } + + /** + * 修改物料产品库存统计表 + * + * @param grBiStLot 物料产品库存统计表 + * @return 结果 + */ + @Override + public int updateGrBiStLot(GrBiStLot grBiStLot) + { + return this.baseMapper.updateGrBiStLot(grBiStLot); + } + + /** + * 批量删除物料产品库存统计表 + * + * @param IDs 需要删除的物料产品库存统计表主键 + * @return 结果 + */ + @Override + public int deleteGrBiStLotByIDs(Long[] IDs) + { + return this.baseMapper.deleteGrBiStLotByIDs(IDs); + } + + /** + * 删除物料产品库存统计表信息 + * + * @param ID 物料产品库存统计表主键 + * @return 结果 + */ + @Override + public int deleteGrBiStLotByID(Long ID) + { + return this.baseMapper.deleteGrBiStLotByID(ID); + } + + @Override + public void generateStLot(String dsErpBiData) { + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductAvlServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductAvlServiceImpl.java new file mode 100644 index 0000000..cb6cd71 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductAvlServiceImpl.java @@ -0,0 +1,90 @@ +package com.lideeyunji.core.framework.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.lideeyunji.core.framework.mapper.GrBiStProductAvlMapper; +import com.lideeyunji.core.framework.entity.GrBiStProductAvl; +import com.lideeyunji.core.framework.service.IGrBiStProductAvlService; + +/** + * 产品可销库存Service业务层处理 + * + * @author king + * @date 2026-03-12 + */ +@Service +public class GrBiStProductAvlServiceImpl extends ServiceImpl implements IGrBiStProductAvlService +{ + /** + * 查询产品可销库存 + * + * @param ID 产品可销库存主键 + * @return 产品可销库存 + */ + @Override + public GrBiStProductAvl selectGrBiStProductAvlByID(Long ID) + { + return this.baseMapper.selectGrBiStProductAvlByID(ID); + } + + /** + * 查询产品可销库存列表 + * + * @param grBiStProductAvl 产品可销库存 + * @return 产品可销库存 + */ + @Override + public List selectGrBiStProductAvlList(GrBiStProductAvl grBiStProductAvl) + { + return this.baseMapper.selectGrBiStProductAvlList(grBiStProductAvl); + } + + /** + * 新增产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + @Override + public int insertGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl) + { + return this.baseMapper.insertGrBiStProductAvl(grBiStProductAvl); + } + + /** + * 修改产品可销库存 + * + * @param grBiStProductAvl 产品可销库存 + * @return 结果 + */ + @Override + public int updateGrBiStProductAvl(GrBiStProductAvl grBiStProductAvl) + { + return this.baseMapper.updateGrBiStProductAvl(grBiStProductAvl); + } + + /** + * 批量删除产品可销库存 + * + * @param IDs 需要删除的产品可销库存主键 + * @return 结果 + */ + @Override + public int deleteGrBiStProductAvlByIDs(Long[] IDs) + { + return this.baseMapper.deleteGrBiStProductAvlByIDs(IDs); + } + + /** + * 删除产品可销库存信息 + * + * @param ID 产品可销库存主键 + * @return 结果 + */ + @Override + public int deleteGrBiStProductAvlByID(Long ID) + { + return this.baseMapper.deleteGrBiStProductAvlByID(ID); + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java new file mode 100644 index 0000000..f6c9c07 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java @@ -0,0 +1,90 @@ +package com.lideeyunji.core.framework.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.lideeyunji.core.framework.mapper.GrBiStProductMapper; +import com.lideeyunji.core.framework.entity.GrBiStProduct; +import com.lideeyunji.core.framework.service.IGrBiStProductService; + +/** + * 库存产品占比表Service业务层处理 + * + * @author king + * @date 2026-03-12 + */ +@Service +public class GrBiStProductServiceImpl extends ServiceImpl implements IGrBiStProductService +{ + /** + * 查询库存产品占比表 + * + * @param ID 库存产品占比表主键 + * @return 库存产品占比表 + */ + @Override + public GrBiStProduct selectGrBiStProductByID(Long ID) + { + return this.baseMapper.selectGrBiStProductByID(ID); + } + + /** + * 查询库存产品占比表列表 + * + * @param grBiStProduct 库存产品占比表 + * @return 库存产品占比表 + */ + @Override + public List selectGrBiStProductList(GrBiStProduct grBiStProduct) + { + return this.baseMapper.selectGrBiStProductList(grBiStProduct); + } + + /** + * 新增库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + @Override + public int insertGrBiStProduct(GrBiStProduct grBiStProduct) + { + return this.baseMapper.insertGrBiStProduct(grBiStProduct); + } + + /** + * 修改库存产品占比表 + * + * @param grBiStProduct 库存产品占比表 + * @return 结果 + */ + @Override + public int updateGrBiStProduct(GrBiStProduct grBiStProduct) + { + return this.baseMapper.updateGrBiStProduct(grBiStProduct); + } + + /** + * 批量删除库存产品占比表 + * + * @param IDs 需要删除的库存产品占比表主键 + * @return 结果 + */ + @Override + public int deleteGrBiStProductByIDs(Long[] IDs) + { + return this.baseMapper.deleteGrBiStProductByIDs(IDs); + } + + /** + * 删除库存产品占比表信息 + * + * @param ID 库存产品占比表主键 + * @return 结果 + */ + @Override + public int deleteGrBiStProductByID(Long ID) + { + return this.baseMapper.deleteGrBiStProductByID(ID); + } +} From 1ed3bc85f686123d6fa175ef4b20c0175f5edccb Mon Sep 17 00:00:00 2001 From: king Date: Fri, 13 Mar 2026 09:35:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E5=BA=93=E5=AD=98=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=8D=A0=E6=AF=94=E8=A1=A8=E5=AF=B9=E8=B1=A1,=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=8F=AF=E9=94=80=E5=BA=93=E5=AD=98=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=20=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/job/GenerateStProductAvlJob.java | 28 ++++++++ .../config/job/GenerateStProductJob.java | 29 ++++++++ .../core/framework/entity/GrBiStLot.java | 69 ++++++++++++------- .../core/framework/entity/GrBiStProduct.java | 32 ++++++--- .../framework/entity/GrBiStProductAvl.java | 46 ++++++++----- .../framework/mapper/GrBiStLotMapper.java | 14 ++++ .../mapper/GrBiStProductAvlMapper.java | 14 ++++ .../framework/mapper/GrBiStProductMapper.java | 14 ++++ .../framework/service/IGrBiStLotService.java | 2 +- .../service/IGrBiStProductAvlService.java | 2 + .../service/IGrBiStProductService.java | 2 + .../service/impl/GrBiStLotServiceImpl.java | 60 +++++++++++++++- .../impl/GrBiStProductAvlServiceImpl.java | 55 +++++++++++++++ .../impl/GrBiStProductServiceImpl.java | 54 +++++++++++++++ 14 files changed, 366 insertions(+), 55 deletions(-) create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java create mode 100644 lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java new file mode 100644 index 0000000..1338777 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java @@ -0,0 +1,28 @@ +package com.lideeyunji.core.framework.config.job; + +import com.lideeyunji.core.framework.service.IGrBiStProductAvlService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * oracle gr_bi_st_product_avl -> mysql gr_bi_st_product_avl + */ +@Slf4j +@Component("generateStProductAvlJob") +public class GenerateStProductAvlJob implements JobHandler { + + @Resource + private IGrBiStProductAvlService grBiFsStProductAvlService; + + @Override + public String execute(String param) throws Exception { + log.info("*********** 开始生成产品可销库存对象完成情况 ************"); + grBiFsStProductAvlService.generateStProductAvl(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("*********** 生成产品可销库存对象完成情况完成 ************"); + return "*********** 生成产品可销库存对象完成情况完成 ************"; + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java new file mode 100644 index 0000000..ce73c32 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java @@ -0,0 +1,29 @@ +package com.lideeyunji.core.framework.config.job; + +import com.lideeyunji.core.framework.service.IGrBiStLotService; +import com.lideeyunji.core.framework.service.IGrBiStProductService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * oracle gr_bi_st_product -> mysql gr_bi_st_product + */ +@Slf4j +@Component("generateStProductJob") +public class GenerateStProductJob implements JobHandler { + + @Resource + private IGrBiStProductService grBiFsStProductService; + + @Override + public String execute(String param) throws Exception { + log.info("*********** 开始生成库存产品占比表对象完成情况 ************"); + grBiFsStProductService.generateStProduct(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("*********** 生成库存产品占比表对象完成情况完成 ************"); + return "*********** 生成库存产品占比表对象完成情况完成 ************"; + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java index 74f7197..9a08618 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java @@ -1,6 +1,10 @@ package com.lideeyunji.core.framework.entity; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -20,48 +24,63 @@ public class GrBiStLot extends BaseTenantEntity { private static final long serialVersionUID = 1L; - private Long ID; + @TableId(value = "ID", type = IdType.INPUT) + private Long id; - private Long GOODSID; + @TableField(value = "GOODSID") + private Long goodsId; - private String GOODSNAME; + @TableField(value = "GOODSNAME") + private String goodsName; - private String GOODSTYPE; + @TableField(value = "GOODSTYPE") + private String goodsType; - private String GOODSUNIT; + @TableField(value = "GOODSUNIT") + private String goodsUnit; - private Long CLASSID; + @TableField(value = "CLASSID") + private Long classid; - private String CLASSNAME; + @TableField(value = "CLASSNAME") + private String className; - private Long LOTID; + @TableField(value = "LOTID") + private Long lotId; - private String LOTNO; + @TableField(value = "LOTNO") + private String lotNo; - private Long GOODSQTY; + @TableField(value = "GOODSQTY") + private Long goodsQty; - private Date PRODDATE; + @TableField(value = "PRODDATE") + private Date proddate; - private String INVALIDDATE; + @TableField(value = "INVALIDDATE") + private String invalidDate; - private Long INVALIDDAYS; + @TableField(value = "INVALIDDAYS") + private Long invalidDays; - private String STINDATE; + @TableField(value = "STINDATE") + private String stInDate; - private String STOUTDATE; - - private Long INVALIDDAYSTYPEID; - - private String INVALIDDAYSTYPE; - - private Long OUTTYPE; - - private Long STORAGEID; - - private String STORAGENAME; + @TableField(value = "STOUTDATE") + private String stOutDate; + @TableField(value = "INVALIDDAYSTYPEID") + private Long invalidDaysTypeId; + @TableField(value = "INVALIDDAYSTYPE") + private String invalidDaysType; + @TableField(value = "OUTTYPE") + private Long outType; + @TableField(value = "STORAGEID") + private Long storageId; + @TableField(value = "STORAGENAME") + private String storageName; } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java index 7da271a..08f31a6 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java @@ -1,5 +1,8 @@ package com.lideeyunji.core.framework.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -18,26 +21,37 @@ public class GrBiStProduct extends BaseTenantEntity { private static final long serialVersionUID = 1L; - private Long ID; + @TableId(value = "ID", type = IdType.INPUT) + private Long id; - private Long GOODSID; + @TableField(value = "GOODSID") + private Long goodsId; - private String GOODSNAME; + @TableField(value = "GOODSNAME") + private String goodsName; - private String GOODSTYPE; + @TableField(value = "GOODSTYPE") + private String goodsType; - private String GOODSUNIT; + @TableField(value = "GOODSUNIT") + private String goodsunit; - private Long GOODSCLASSID; + @TableField(value = "GOODSCLASSID") + private Long goodsclassid; - private String GOODSCLASSNAME; + @TableField(value = "GOODSCLASSNAME") + private String goodsClassName; - private Long QTY; + @TableField(value = "QTY") + private Long qty; + @TableField(value = "QTY_PROP") private Long qtyProp; - private Long MONEY; + @TableField(value = "MONEY") + private Long money; + @TableField(value = "MONEY_PROP") private Long moneyProp; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java index 7f7ed2a..cd1545c 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java @@ -1,5 +1,8 @@ package com.lideeyunji.core.framework.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -18,34 +21,43 @@ public class GrBiStProductAvl extends BaseTenantEntity { private static final long serialVersionUID = 1L; - private Long ID; + @TableId(value = "ID", type = IdType.INPUT) + private Long id; - private Long GOODSID; + @TableField(value = "GOODSID") + private Long goodsId; - private String GOODSNAME; + @TableField(value = "GOODSNAME") + private String goodsName; - private String GOODSTYPE; + @TableField(value = "GOODSTYPE") + private String goodsType; - private String GOODSUNIT; + @TableField(value = "GOODSUNIT") + private String goodsUnit; - private Long PACKSIZE; + @TableField(value = "PACKSIZE") + private Long packSize; - private Long SORT; + @TableField(value = "SORT") + private Long sort; - private Long SEMIREM; + @TableField(value = "SEMIREM") + private Long semiRem; - private String TODAYIN; - - private Long REM; - - private Long THISMONTHOUT; - - private Long LASTMONTHOUT; - - private Long THISYEAROUT; + @TableField(value = "TODAYIN") + private String todayIn; + @TableField(value = "REM") + private Long rem; + @TableField(value = "THISMONTHOUT") + private Long thisMonthOut; + @TableField(value = "LASTMONTHOUT") + private Long lastMonthOut; + @TableField(value = "THISYEAROUT") + private Long thisYearOut; } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java index ff28763..fed5e8c 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStLotMapper.java @@ -1,8 +1,12 @@ package com.lideeyunji.core.framework.mapper; import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.lideeyunji.core.framework.entity.GrBiStLot; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** * 物料产品库存统计表Mapper接口 @@ -59,4 +63,14 @@ public interface GrBiStLotMapper extends BaseMapper * @return 结果 */ public int deleteGrBiStLotByIDs(Long[] IDs); + + @DS(value = "#dataSourceType") + default List getStLotList(@Param("dataSourceType") String dataSourceType){ + return this.selectList(new QueryWrapper<>()); + } + + @DS(value = "#dataSourceType") + default int deleteOldStLot(@Param("dataSourceType") String dataSourceType){ + return this.delete(new QueryWrapper<>()); + } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java index 04ce825..1ce47ee 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductAvlMapper.java @@ -1,8 +1,12 @@ package com.lideeyunji.core.framework.mapper; import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.lideeyunji.core.framework.entity.GrBiStProductAvl; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** * 产品可销库存Mapper接口 @@ -59,4 +63,14 @@ public interface GrBiStProductAvlMapper extends BaseMapper * @return 结果 */ public int deleteGrBiStProductAvlByIDs(Long[] IDs); + + @DS(value = "#dataSourceType") + default List getStProductList(@Param("dataSourceType") String dataSourceType){ + return this.selectList(new QueryWrapper<>()); + } + + @DS(value = "#dataSourceType") + default int deleteOldStProduct(@Param("dataSourceType") String dataSourceType){ + return this.delete(new QueryWrapper<>()); + } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java index eb9164a..25627c5 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/GrBiStProductMapper.java @@ -1,8 +1,12 @@ package com.lideeyunji.core.framework.mapper; import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.lideeyunji.core.framework.entity.GrBiStProduct; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** * 库存产品占比表Mapper接口 @@ -59,4 +63,14 @@ public interface GrBiStProductMapper extends BaseMapper * @return 结果 */ public int deleteGrBiStProductByIDs(Long[] IDs); + + @DS(value = "#dataSourceType") + default List getStProductList(@Param("dataSourceType") String dataSourceType){ + return this.selectList(new QueryWrapper<>()); + } + + @DS(value = "#dataSourceType") + default int deleteOldStProduct(@Param("dataSourceType") String dataSourceType){ + return this.delete(new QueryWrapper<>()); + } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java index bc6dce1..f68d4ba 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStLotService.java @@ -59,5 +59,5 @@ public interface IGrBiStLotService */ public int deleteGrBiStLotByID(Long ID); - void generateStLot(String dsErpBiData); + void generateStLot(String dataSourceType); } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java index f047dcd..4afe3b3 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductAvlService.java @@ -58,4 +58,6 @@ public interface IGrBiStProductAvlService * @return 结果 */ public int deleteGrBiStProductAvlByID(Long ID); + + void generateStProductAvl(String dataSourceType); } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java index a830227..4c399e7 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IGrBiStProductService.java @@ -58,4 +58,6 @@ public interface IGrBiStProductService * @return 结果 */ public int deleteGrBiStProductByID(Long ID); + + void generateStProduct(String dataSourceType); } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java index 2807452..d13bde1 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java @@ -1,7 +1,15 @@ package com.lideeyunji.core.framework.service.impl; +import java.time.LocalDateTime; import java.util.List; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lideeyunji.core.framework.entity.GrBiFsBusinessReal; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import com.lideeyunji.core.framework.mapper.GrBiStLotMapper; import com.lideeyunji.core.framework.entity.GrBiStLot; @@ -13,9 +21,58 @@ import com.lideeyunji.core.framework.service.IGrBiStLotService; * @author king * @date 2026-03-12 */ +@Slf4j @Service public class GrBiStLotServiceImpl extends ServiceImpl implements IGrBiStLotService { + + @Override + @DS(value = "#dataSourceType") + public void generateStLot(String dataSourceType) { + //获取本地mysql数据库中表中UPDATE_TIME最新的数据 +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().orderByDesc(GrBiStLot::getUseYear, GrBiStLot::getUseMonth).last("LIMIT 1"); +// GrBiStLot real = this.baseMapper.selectOne(queryWrapper); +// int lastUserYear = 2022; +// int lastUserMonth = 1; +// if(real != null){ +// lastUserYear = Integer.parseInt(real.getUseYear()); +// lastUserMonth = Integer.parseInt(real.getUseMonth()); +// } +// // 获取当前时间的年和月 +// LocalDateTime now = LocalDateTime.now(); +// int currentYear = now.getYear(); +// int currentMonth = now.getMonthValue(); +// +// // 获取三个月前的时间和年月 +// LocalDateTime threeMonthsAgo = now.minusMonths(3); +// int pastYear = threeMonthsAgo.getYear(); +// int pastMonth = threeMonthsAgo.getMonthValue(); +// +// log.info("最后更新的年月:{}年{}月", lastUserYear, lastUserMonth); +// log.info("当前:{}年{}月", currentYear, currentMonth); +// log.info("三个月前:{}年{}月", pastYear, pastMonth); +// if (lastUserYear < pastYear || (lastUserYear == pastYear && lastUserMonth < pastMonth)) { +// pastYear = lastUserYear; +// pastMonth = lastUserMonth; +// } +// log.info("开始时间:{}年{}月, 结束时间:{}年{}月", pastYear, pastMonth, currentYear, currentMonth); + + // 获取数据 + List grBiSaSetdtlList = this.baseMapper.getStLotList(lideeYunJiBaseConstant.DS_ORACLE_GRYYBI); + if (CollUtil.isEmpty(grBiSaSetdtlList)) { + return; + } + //保存数据 + int reNum = this.baseMapper.deleteOldStLot(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("删除数量:{}", reNum); + for (GrBiStLot grBiSaSetdtl : grBiSaSetdtlList) { + int re = this.baseMapper.insert(grBiSaSetdtl); + if (re < 1) { + throw new RuntimeException("批量新增异常"); + } + } + } + /** * 查询物料产品库存统计表 * @@ -88,8 +145,5 @@ public class GrBiStLotServiceImpl extends ServiceImpl implements IGrBiStProductAvlService { + + @Override + @DS(value = "#dataSourceType") + public void generateStProductAvl(String dataSourceType) { + //获取本地mysql数据库中表中UPDATE_TIME最新的数据 +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().orderByDesc(grBiStProductAvl::getUseYear, grBiStProductAvl::getUseMonth).last("LIMIT 1"); +// grBiStProductAvl real = this.baseMapper.selectOne(queryWrapper); +// int lastUserYear = 2022; +// int lastUserMonth = 1; +// if(real != null){ +// lastUserYear = Integer.parseInt(real.getUseYear()); +// lastUserMonth = Integer.parseInt(real.getUseMonth()); +// } +// // 获取当前时间的年和月 +// LocalDateTime now = LocalDateTime.now(); +// int currentYear = now.getYear(); +// int currentMonth = now.getMonthValue(); +// +// // 获取三个月前的时间和年月 +// LocalDateTime threeMonthsAgo = now.minusMonths(3); +// int pastYear = threeMonthsAgo.getYear(); +// int pastMonth = threeMonthsAgo.getMonthValue(); +// +// log.info("最后更新的年月:{}年{}月", lastUserYear, lastUserMonth); +// log.info("当前:{}年{}月", currentYear, currentMonth); +// log.info("三个月前:{}年{}月", pastYear, pastMonth); +// if (lastUserYear < pastYear || (lastUserYear == pastYear && lastUserMonth < pastMonth)) { +// pastYear = lastUserYear; +// pastMonth = lastUserMonth; +// } +// log.info("开始时间:{}年{}月, 结束时间:{}年{}月", pastYear, pastMonth, currentYear, currentMonth); + + // 获取数据 + List grBiSaSetdtlList = this.baseMapper.getStProductList(lideeYunJiBaseConstant.DS_ORACLE_GRYYBI); + if (CollUtil.isEmpty(grBiSaSetdtlList)) { + return; + } + //保存数据 + int reNum = this.baseMapper.deleteOldStProduct(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("删除数量:{}", reNum); + for (GrBiStProductAvl grBiStProductAvl : grBiSaSetdtlList) { + int re = this.baseMapper.insert(grBiStProductAvl); + if (re < 1) { + throw new RuntimeException("批量新增异常"); + } + } + + } /** * 查询产品可销库存 * diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java index f6c9c07..3773f20 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStProductServiceImpl.java @@ -1,7 +1,13 @@ package com.lideeyunji.core.framework.service.impl; import java.util.List; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lideeyunji.core.framework.entity.GrBiStProduct; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import com.lideeyunji.core.framework.mapper.GrBiStProductMapper; import com.lideeyunji.core.framework.entity.GrBiStProduct; @@ -13,9 +19,57 @@ import com.lideeyunji.core.framework.service.IGrBiStProductService; * @author king * @date 2026-03-12 */ +@Slf4j @Service public class GrBiStProductServiceImpl extends ServiceImpl implements IGrBiStProductService { + @Override + @DS(value = "#dataSourceType") + public void generateStProduct(String dataSourceType) { + //获取本地mysql数据库中表中UPDATE_TIME最新的数据 +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().orderByDesc(GrBiStProduct::getUseYear, GrBiStProduct::getUseMonth).last("LIMIT 1"); +// GrBiStProduct real = this.baseMapper.selectOne(queryWrapper); +// int lastUserYear = 2022; +// int lastUserMonth = 1; +// if(real != null){ +// lastUserYear = Integer.parseInt(real.getUseYear()); +// lastUserMonth = Integer.parseInt(real.getUseMonth()); +// } +// // 获取当前时间的年和月 +// LocalDateTime now = LocalDateTime.now(); +// int currentYear = now.getYear(); +// int currentMonth = now.getMonthValue(); +// +// // 获取三个月前的时间和年月 +// LocalDateTime threeMonthsAgo = now.minusMonths(3); +// int pastYear = threeMonthsAgo.getYear(); +// int pastMonth = threeMonthsAgo.getMonthValue(); +// +// log.info("最后更新的年月:{}年{}月", lastUserYear, lastUserMonth); +// log.info("当前:{}年{}月", currentYear, currentMonth); +// log.info("三个月前:{}年{}月", pastYear, pastMonth); +// if (lastUserYear < pastYear || (lastUserYear == pastYear && lastUserMonth < pastMonth)) { +// pastYear = lastUserYear; +// pastMonth = lastUserMonth; +// } +// log.info("开始时间:{}年{}月, 结束时间:{}年{}月", pastYear, pastMonth, currentYear, currentMonth); + + // 获取数据 + List grBiSaSetdtlList = this.baseMapper.getStProductList(lideeYunJiBaseConstant.DS_ORACLE_GRYYBI); + if (CollUtil.isEmpty(grBiSaSetdtlList)) { + return; + } + //保存数据 + int reNum = this.baseMapper.deleteOldStProduct(lideeYunJiBaseConstant.DS_ERP_BI_DATA); + log.info("删除数量:{}", reNum); + for (GrBiStProduct grBiSaSetdtl : grBiSaSetdtlList) { + int re = this.baseMapper.insert(grBiSaSetdtl); + if (re < 1) { + throw new RuntimeException("批量新增异常"); + } + } + } + /** * 查询库存产品占比表 * From b023ce65f606ca470503166090f5afe902b218f4 Mon Sep 17 00:00:00 2001 From: king Date: Fri, 13 Mar 2026 10:52:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/job/GenerateBusinessRealJob.java | 1 + .../config/job/GenerateStLotJob.java | 8 ++-- .../config/job/GenerateStProductAvlJob.java | 7 +-- .../config/job/GenerateStProductJob.java | 8 ++-- .../framework/entity/GrBiFsBusinessReal.java | 9 ++-- .../core/framework/entity/GrBiStLot.java | 7 +-- .../core/framework/entity/GrBiStProduct.java | 9 ++-- .../framework/entity/GrBiStProductAvl.java | 6 ++- .../service/impl/GrBiStLotServiceImpl.java | 13 ++--- .../framework/GrBiFsBusinessRealMapper.xml | 33 +++++++------ .../mapper/framework/GrBiStLotMapper.xml | 48 +++++++++---------- .../framework/GrBiStProductAvlMapper.xml | 34 ++++++------- .../mapper/framework/GrBiStProductMapper.xml | 26 +++++----- 13 files changed, 108 insertions(+), 101 deletions(-) diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java index 1b3f485..230d1aa 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateBusinessRealJob.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; /** + * 经营指标完成情况 * oracle gr_bi_fs_business_real -> mysql gr_bi_fs_business_real */ @Slf4j diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java index b32e03b..148f837 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStLotJob.java @@ -1,6 +1,5 @@ package com.lideeyunji.core.framework.config.job; -import com.lideeyunji.core.framework.service.IGrBiFsBusinessRealService; import com.lideeyunji.core.framework.service.IGrBiStLotService; import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; @@ -10,6 +9,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; /** + * 物料产品库存统计表 * oracle gr_bi_st_lot -> mysql gr_bi_st_lot */ @Slf4j @@ -21,9 +21,9 @@ public class GenerateStLotJob implements JobHandler { @Override public String execute(String param) throws Exception { - log.info("*********** 开始生成物料产品库存统计表完成情况 ************"); + log.info("*********** 开始生成物料产品库存统计表 ************"); grBiFsStLotService.generateStLot(lideeYunJiBaseConstant.DS_ERP_BI_DATA); - log.info("*********** 生成物料产品库存统计表完成情况完成 ************"); - return "*********** 生成物料产品库存统计表完成情况完成 ************"; + log.info("*********** 生成物料产品库存统计表完成 ************"); + return "*********** 生成物料产品库存统计表完成 ************"; } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java index 1338777..7590326 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductAvlJob.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; /** + * 产品可销库存对象 * oracle gr_bi_st_product_avl -> mysql gr_bi_st_product_avl */ @Slf4j @@ -20,9 +21,9 @@ public class GenerateStProductAvlJob implements JobHandler { @Override public String execute(String param) throws Exception { - log.info("*********** 开始生成产品可销库存对象完成情况 ************"); + log.info("*********** 开始生成产品可销库存对象 ************"); grBiFsStProductAvlService.generateStProductAvl(lideeYunJiBaseConstant.DS_ERP_BI_DATA); - log.info("*********** 生成产品可销库存对象完成情况完成 ************"); - return "*********** 生成产品可销库存对象完成情况完成 ************"; + log.info("*********** 生成产品可销库存对象完成 ************"); + return "*********** 生成产品可销库存对象完成 ************"; } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java index ce73c32..e4f9174 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/config/job/GenerateStProductJob.java @@ -1,6 +1,5 @@ package com.lideeyunji.core.framework.config.job; -import com.lideeyunji.core.framework.service.IGrBiStLotService; import com.lideeyunji.core.framework.service.IGrBiStProductService; import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler; @@ -10,6 +9,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; /** + * 库存产品占比表对象 * oracle gr_bi_st_product -> mysql gr_bi_st_product */ @Slf4j @@ -21,9 +21,9 @@ public class GenerateStProductJob implements JobHandler { @Override public String execute(String param) throws Exception { - log.info("*********** 开始生成库存产品占比表对象完成情况 ************"); + log.info("*********** 开始生成库存产品占比表对象 ************"); grBiFsStProductService.generateStProduct(lideeYunJiBaseConstant.DS_ERP_BI_DATA); - log.info("*********** 生成库存产品占比表对象完成情况完成 ************"); - return "*********** 生成库存产品占比表对象完成情况完成 ************"; + log.info("*********** 生成库存产品占比表对象完成 ************"); + return "*********** 生成库存产品占比表对象完成 ************"; } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java index c1645c4..6c4bab7 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java @@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import java.io.Serializable; + /** * 经营指标完成情况对象 gr_bi_fs_business_real * @@ -16,13 +19,11 @@ import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; */ @TableName("gr_bi_fs_business_real") @Data -@EqualsAndHashCode(callSuper = true) -public class GrBiFsBusinessReal extends BaseTenantEntity -{ +public class GrBiFsBusinessReal implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "ID", type = IdType.INPUT) - private String ID; + private Long id; @TableField(value = "USEYEAR") private String useYear; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java index 9a08618..1b80c48 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStLot.java @@ -1,5 +1,6 @@ package com.lideeyunji.core.framework.entity; +import java.io.Serializable; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; @@ -7,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; @@ -19,8 +21,7 @@ import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; */ @TableName("gr_bi_st_lot") @Data -@EqualsAndHashCode(callSuper = true) -public class GrBiStLot extends BaseTenantEntity +public class GrBiStLot implements Serializable { private static final long serialVersionUID = 1L; @@ -55,7 +56,7 @@ public class GrBiStLot extends BaseTenantEntity private Long goodsQty; @TableField(value = "PRODDATE") - private Date proddate; + private Date prodDate; @TableField(value = "INVALIDDATE") private String invalidDate; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java index 08f31a6..a48eff4 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProduct.java @@ -8,6 +8,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import java.io.Serializable; + /** * 库存产品占比表对象 gr_bi_st_product * @@ -16,8 +18,7 @@ import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; */ @TableName("gr_bi_st_product") @Data -@EqualsAndHashCode(callSuper = true) -public class GrBiStProduct extends BaseTenantEntity +public class GrBiStProduct implements Serializable { private static final long serialVersionUID = 1L; @@ -34,10 +35,10 @@ public class GrBiStProduct extends BaseTenantEntity private String goodsType; @TableField(value = "GOODSUNIT") - private String goodsunit; + private String goodsUnit; @TableField(value = "GOODSCLASSID") - private Long goodsclassid; + private Long goodsClassId; @TableField(value = "GOODSCLASSNAME") private String goodsClassName; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java index cd1545c..7054d8f 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiStProductAvl.java @@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import java.io.Serializable; + /** * 产品可销库存对象 gr_bi_st_product_avl * @@ -16,8 +19,7 @@ import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; */ @TableName("gr_bi_st_product_avl") @Data -@EqualsAndHashCode(callSuper = true) -public class GrBiStProductAvl extends BaseTenantEntity +public class GrBiStProductAvl implements Serializable { private static final long serialVersionUID = 1L; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java index d13bde1..9008652 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/GrBiStLotServiceImpl.java @@ -1,19 +1,16 @@ package com.lideeyunji.core.framework.service.impl; -import java.time.LocalDateTime; -import java.util.List; - import cn.hutool.core.collection.CollUtil; import com.baomidou.dynamic.datasource.annotation.DS; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.lideeyunji.core.framework.entity.GrBiFsBusinessReal; +import com.lideeyunji.core.framework.entity.GrBiStLot; +import com.lideeyunji.core.framework.mapper.GrBiStLotMapper; +import com.lideeyunji.core.framework.service.IGrBiStLotService; import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import com.lideeyunji.core.framework.mapper.GrBiStLotMapper; -import com.lideeyunji.core.framework.entity.GrBiStLot; -import com.lideeyunji.core.framework.service.IGrBiStLotService; + +import java.util.List; /** * 物料产品库存统计表Service业务层处理 diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml index 102a245..4ae2343 100644 --- a/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml +++ b/lidee-core/src/main/resources/mapper/framework/GrBiFsBusinessRealMapper.xml @@ -4,13 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - + + + + + + + @@ -21,16 +21,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ID, USEYEAR, USEMONTH, ITEMID, ITEMNAME, ITEMORDER, MONTH_REAL, YEAR_REAL, MONTH_DIFF, YEAR_PLAN, YEAR_RATE from gr_bi_fs_business_real - - a.USEYEAR is not NULL - and (a.USEYEAR * 100 + a.USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth} + USEYEAR is not NULL + and (USEYEAR * 100 + USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth} - order by a.USEYEAR, a.USEMONTH + order by USEYEAR, USEMONTH - - and ID = #{ID} @@ -52,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ID = #{ID} - + insert into gr_bi_fs_business_real ID, @@ -82,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update gr_bi_fs_business_real USEYEAR = #{USEYEAR}, diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml index 9ae1c26..df77cb1 100644 --- a/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStLotMapper.xml @@ -4,34 +4,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, CLASSID, CLASSNAME, LOTID, LOTNO, GOODSQTY, PRODDATE, INVALIDDATE, INVALIDDAYS, STINDATE, STOUTDATE, INVALIDDAYSTYPEID, INVALIDDAYSTYPE, OUTTYPE, STORAGEID, STORAGENAME from gr_bi_st_lot - and ID = #{ID} @@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ID = #{ID} - + insert into gr_bi_st_lot ID, @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update gr_bi_st_lot GOODSID = #{GOODSID}, diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml index e9503a9..b9617d4 100644 --- a/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStProductAvlMapper.xml @@ -4,27 +4,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - + + + + + + + + + + + + + + select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, PACKSIZE, SORT, SEMIREM, TODAYIN, REM, THISMONTHOUT, LASTMONTHOUT, THISYEAROUT from gr_bi_st_product_avl - and ID = #{ID} @@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ID = #{ID} - + insert into gr_bi_st_product_avl ID, @@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update gr_bi_st_product_avl GOODSID = #{GOODSID}, diff --git a/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml b/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml index a1f3f1a..ccde60e 100644 --- a/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml +++ b/lidee-core/src/main/resources/mapper/framework/GrBiStProductMapper.xml @@ -4,17 +4,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - + + + + + + + + + - + @@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, GOODSCLASSID, GOODSCLASSNAME, QTY, QTY_PROP, MONEY, MONEY_PROP from gr_bi_st_product - and ID = #{ID} @@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ID = #{ID} - + insert into gr_bi_st_product ID, @@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update gr_bi_st_product GOODSID = #{GOODSID},