Compare commits
24 Commits
dev_js_202
...
78be751e99
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78be751e99 | ||
|
|
7a73fbb981 | ||
|
|
de66384d0c | ||
| f8dc751b86 | |||
| 8a35bbdede | |||
|
|
62163a5d16 | ||
|
|
dda951fb71 | ||
|
|
b023ce65f6 | ||
| 21fe5196be | |||
|
|
1ed3bc85f6 | ||
|
|
bea29295a5 | ||
|
|
bfc7d11131 | ||
|
|
fde5cfe3b2 | ||
|
|
70e5ed81f6 | ||
|
|
5b25cb3766 | ||
|
|
66028bf17a | ||
|
|
ebf54b4ecf | ||
|
|
8f22732f04 | ||
|
|
e230587f66 | ||
|
|
3fb081217f | ||
|
|
e882dd280e | ||
| eca53d5424 | |||
| f9d4b08495 | |||
| 32627270d1 |
@@ -30,7 +30,7 @@ spring:
|
||||
erp_bi_data: # 报表平台 mysql
|
||||
url: jdbc:mysql://127.0.0.1:3306/erp_bi_data?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root
|
||||
password: gryy@8888
|
||||
redis:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
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 "*********** 生成经营指标完成情况完成 ************";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lideeyunji.core.framework.config.job;
|
||||
|
||||
import com.lideeyunji.core.framework.service.IGrBiSaAggService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 计算销售报表
|
||||
* erp_bi_data.GR_BI_PUB_GOODS
|
||||
* erp_bi_data.GR_BI_PUB_SALEZONE
|
||||
* erp_bi_data.GR_BI_PUB_PROVINCE
|
||||
* erp_bi_data.GR_BI_PUB_SALETYPE
|
||||
* erp_bi_data.GR_BI_PUB_DOSAGE
|
||||
* erp_bi_data.GR_BI_PUB_CUSTOM
|
||||
* erp_bi_data.GR_BI_PUB_SALER
|
||||
* --> mysql erp_bi_data.yunji_gr_bi_sa_agg
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("generateSalesReportJob")
|
||||
public class GenerateSalesReportJob implements JobHandler {
|
||||
|
||||
@Resource
|
||||
private IGrBiSaAggService grBiSaAggService;
|
||||
public String execute(String param) {
|
||||
log.info("*********** 开始生成销售报表 ************");
|
||||
grBiSaAggService.generateSalesReportJob(lideeYunJiBaseConstant.DS_ERP_BI_DATA);
|
||||
log.info("*********** 生成销售报表完成 ************");
|
||||
return "*********** 生成销售报表完成 ************";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lideeyunji.core.framework.config.job;
|
||||
|
||||
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 "*********** 生成物料产品库存统计表完成 ************";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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 "*********** 生成产品可销库存对象完成 ************";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lideeyunji.core.framework.config.job;
|
||||
|
||||
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 "*********** 生成库存产品占比表对象完成 ************";
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,6 @@ import org.springframework.stereotype.Component;
|
||||
@Component("SaSetdtlSyncJob")
|
||||
public class SaSetdtlSyncJob implements JobHandler {
|
||||
|
||||
@Autowired
|
||||
private ILideeYunJiService lideeYunJiService;
|
||||
|
||||
@Autowired
|
||||
private IGrBiSaSetdtlService grBiSaSetdtlService;
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
|
||||
package com.lideeyunji.core.framework.config.job;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.lideeyunji.core.framework.entity.GrNhEntity;
|
||||
import com.lideeyunji.core.framework.service.IGrNhService;
|
||||
import com.lideeyunji.core.framework.service.ILideeYunJiService;
|
||||
import com.lideeyunji.tool.framework.common.util.http.HttpUtils;
|
||||
import com.lideeyunji.tool.framework.quartz.core.handler.JobHandler;
|
||||
import com.lideeyunji.tool.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.lideeyunji.tool.framework.yunji.component.redis.lideeYunjiRedisUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.ehcache.xml.model.CacheTemplate;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保存模块使用记录 能耗模块使用记录
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("anyToGrBiNh")
|
||||
public class anyToGrBiNh implements JobHandler {
|
||||
|
||||
@Autowired
|
||||
private lideeYunjiRedisUtils redisUtil;
|
||||
|
||||
@Autowired
|
||||
private IGrNhService grNhService;
|
||||
|
||||
@Override
|
||||
@TenantIgnore
|
||||
public String execute(String param) {
|
||||
log.info("*********** 同步能耗数据 ************");
|
||||
|
||||
getToken();
|
||||
String resultStr = "*********** 同步能耗数据保存成功 ************";
|
||||
log.info(resultStr);
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
private void getToken() {
|
||||
try {
|
||||
String nhtoken = redisUtil.get("nh_token", String.class);
|
||||
|
||||
System.out.println(nhtoken);
|
||||
if(nhtoken==null){
|
||||
|
||||
// 2. POST 表单请求
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("fLoginname", "9287ee99ae49b47dc7ce1746eac04f8b");
|
||||
params.put("fPassword", "d23d0731bcf61d824aa30372da5fae0b");
|
||||
params.put("loginType", "password");
|
||||
params.put("projectType", "4");
|
||||
String postResult = HttpUtils.doPost("http://111.39.171.64:8090/SubstationWEBV2/user/login", params, null);
|
||||
|
||||
JSONObject jsonObject = new JSONObject(postResult);
|
||||
jsonObject= new JSONObject(jsonObject.get("data").toString());
|
||||
redisUtil.set("nh_token",jsonObject.get("token"),(Long)jsonObject.get("tokenExpireTime"));
|
||||
System.out.println(jsonObject.get("token"));
|
||||
getNhsj(jsonObject.get("token").toString());
|
||||
}
|
||||
else {
|
||||
nhtoken = redisUtil.get("nh_token").toString();
|
||||
getNhsj(nhtoken);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void getNhsj(String token){
|
||||
try {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Authorization", token);
|
||||
String getResult = HttpUtils.doGet("http://111.39.171.64:8090/SubstationWEBV2/main/Compare/overview?fCoaccountno=1", headers);
|
||||
System.out.println("GET Response:\n" + getResult);
|
||||
|
||||
JSONObject jsonObject = new JSONObject(getResult);
|
||||
System.out.println(jsonObject.get("data"));
|
||||
GrNhEntity grNhEntity = new GrNhEntity();
|
||||
if (jsonObject.get("code").toString().equals("200")){
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
grNhEntity.setEleDayCurrent(data.getJSONObject("eleDayCompare").getFloat("currentValue")); //电-当日
|
||||
grNhEntity.setEleDayBefore(data.getJSONObject("eleDayCompare").getFloat("beforeValue"));//电-昨日
|
||||
grNhEntity.setEleMonthCurrent(data.getJSONObject("eleMonthCompare").getFloat("currentValue"));//电-当月
|
||||
grNhEntity.setEleMonthBefore(data.getJSONObject("eleMonthCompare").getFloat("beforeValue"));//电-上月
|
||||
grNhEntity.setEleYearCurrent(data.getJSONObject("eleYearCompare").getFloat("currentValue"));//电-昨年
|
||||
grNhEntity.setEleYearBefore(data.getJSONObject("eleYearCompare").getFloat("beforeValue"));////电-上年
|
||||
|
||||
|
||||
grNhEntity.setWaterDayCurrent(data.getJSONObject("waterDayCompare").getFloat("currentValue")); //水-当日
|
||||
grNhEntity.setWaterDayBefore(data.getJSONObject("waterDayCompare").getFloat("beforeValue"));//水-昨日
|
||||
grNhEntity.setWaterMonthCurrent(data.getJSONObject("waterMonthCompare").getFloat("currentValue"));//水-当月
|
||||
grNhEntity.setWaterMonthBefore(data.getJSONObject("waterMonthCompare").getFloat("beforeValue"));//水-上月
|
||||
grNhEntity.setWaterYearCurrent(data.getJSONObject("waterYearCompare").getFloat("currentValue"));//水-昨年
|
||||
grNhEntity.setWaterYearBefore(data.getJSONObject("waterYearCompare").getFloat("beforeValue"));////水-上年
|
||||
|
||||
|
||||
grNhEntity.setGasDayCurrent(data.getJSONObject("gasDayCompare").getFloat("currentValue")); //气-当日
|
||||
grNhEntity.setGasDayBefore(data.getJSONObject("gasDayCompare").getFloat("beforeValue"));//气-昨日
|
||||
grNhEntity.setGasMonthCurrent(data.getJSONObject("gasMonthCompare").getFloat("currentValue"));//气-当月
|
||||
grNhEntity.setGasMonthBefore(data.getJSONObject("gasMonthCompare").getFloat("beforeValue"));//气-上月
|
||||
grNhEntity.setGasYearCurrent(data.getJSONObject("gasYearCompare").getFloat("currentValue"));//气-昨年
|
||||
grNhEntity.setGasYearBefore(data.getJSONObject("gasYearCompare").getFloat("beforeValue"));////气-上年
|
||||
|
||||
|
||||
grNhEntity.setStcDayCurrent(data.getJSONObject("stcDayCompare").getFloat("currentValue")); //标准煤-当日
|
||||
grNhEntity.setStcDayBefore(data.getJSONObject("stcDayCompare").getFloat("beforeValue"));//标准煤-昨日
|
||||
grNhEntity.setStcMonthCurrent(data.getJSONObject("stcMonthCompare").getFloat("currentValue"));//标准煤-当月
|
||||
grNhEntity.setStcMonthBefore(data.getJSONObject("stcMonthCompare").getFloat("beforeValue"));//标准煤-上月
|
||||
grNhEntity.setStcYearCurrent(data.getJSONObject("stcYearCompare").getFloat("currentValue"));//标准煤-昨年
|
||||
grNhEntity.setStcYearBefore(data.getJSONObject("stcYearCompare").getFloat("beforeValue"));//标准煤-上年
|
||||
|
||||
grNhService.saveNH(grNhEntity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// grNhService.query().eq("add_time",1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 3. POST JSON 请求
|
||||
// String jsonBody = "{\"name\":\"Alice\",\"age\":25}";
|
||||
// Map<String, String> headers = new HashMap<>();
|
||||
// headers.put("Authorization", "Bearer your_token_here");
|
||||
// String jsonResult = HttpUtils.doPostJson("https://api.example.com/user", jsonBody, headers);
|
||||
// System.out.println("POST JSON Response:\n" + jsonResult);
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void main(String[] args) {
|
||||
getToken();
|
||||
// 2. POST 表单请求
|
||||
// Map<String, String> params = new HashMap<>();
|
||||
// params.put("fLoginname", "2613504b593d16343ccf368879f9519c");
|
||||
// params.put("fPassword", "c7d967eaeaa0963fe33c740b46316590");
|
||||
// params.put("loginType", "password");
|
||||
// params.put("projectType", "4");
|
||||
// String postResult = HttpUtils.doPost("http://111.39.171.64:8090/SubstationWEBV2/user/login", params, null);
|
||||
// System.out.println("POST Form Response:\n" + postResult);
|
||||
// JSONObject jsonObject = new JSONObject(postResult);
|
||||
// jsonObject= new JSONObject(jsonObject.get("data").toString());
|
||||
//System.out.println(jsonObject.get("token"));
|
||||
|
||||
// 1. GET 请求
|
||||
// String getResult = HttpUtils.doGet("https://api.example.com/data", null);
|
||||
// System.out.println("GET Response:\n" + getResult);
|
||||
|
||||
|
||||
// 3. POST JSON 请求
|
||||
// String jsonBody = "{\"name\":\"Alice\",\"age\":25}";
|
||||
// Map<String, String> headers = new HashMap<>();
|
||||
// headers.put("Authorization", "Bearer your_token_here");
|
||||
// String jsonResult = HttpUtils.doPostJson("https://api.example.com/user", jsonBody, headers);
|
||||
// System.out.println("POST JSON Response:\n" + jsonResult);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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 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
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@TableName("gr_bi_fs_business_real")
|
||||
@Data
|
||||
public class GrBiFsBusinessReal implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.INPUT)
|
||||
private Long 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("yunji_gr_bi_sa_agg")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class GrBiSaAgg implements Serializable {
|
||||
private final static long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.INPUT)
|
||||
private Integer id;
|
||||
|
||||
@TableField(value = "USEYEAR")
|
||||
private Integer useYear;
|
||||
|
||||
@TableField(value = "USEMONTH")
|
||||
private Integer useMonth;
|
||||
|
||||
@TableField(value = "ZONEID")
|
||||
private String zoneId;
|
||||
|
||||
@TableField(value = "ZONENAME")
|
||||
private String zoneName;
|
||||
|
||||
@TableField(value = "SALETYPEID")
|
||||
private String saleTypeId;
|
||||
|
||||
@TableField(value = "SALETYPENAME")
|
||||
private String saleTypeName;
|
||||
|
||||
@TableField(value = "CUSTOMID")
|
||||
private String customId;
|
||||
|
||||
@TableField(value = "CUSTOMNAME")
|
||||
private String customName;
|
||||
|
||||
@TableField(value = "DOSAGEID")
|
||||
private String dosageId;
|
||||
|
||||
@TableField(value = "DOSAGENAME")
|
||||
private String dosageName;
|
||||
|
||||
@TableField(value = "GOODSNAME")
|
||||
private String goodsName;
|
||||
|
||||
@TableField(value = "GOODSID")
|
||||
private String goodsId;
|
||||
|
||||
@TableField(value = "PROVINCEID")
|
||||
private String provinceId;
|
||||
|
||||
@TableField(value = "PROVINCENAME")
|
||||
private String provinceName;
|
||||
|
||||
@TableField(value = "SALERID")
|
||||
private String salerId;
|
||||
|
||||
@TableField(value = "SALERNAME")
|
||||
private String salerName;
|
||||
|
||||
@TableField(value = "MONTHSAQTY")
|
||||
private String monthSaqty;
|
||||
|
||||
@TableField(value = "THISSAQTY")
|
||||
private String thisSaqty;
|
||||
|
||||
@TableField(value = "LASTSAQTY")
|
||||
private String lastSaqty;
|
||||
|
||||
@TableField(value = "MONTHSAMONEY")
|
||||
private String monthSaMoney;
|
||||
|
||||
@TableField(value = "THISSAMONEY")
|
||||
private String thisSaMoney;
|
||||
|
||||
@TableField(value = "LASTSAMONEY")
|
||||
private String lastSaMoney;
|
||||
|
||||
@TableField(value = "MONTHPROFIT")
|
||||
private String monthProfit;
|
||||
|
||||
@TableField(value = "THISPROFIT")
|
||||
private String thisProfit;
|
||||
|
||||
@TableField(value = "LASTPROFIT")
|
||||
private String lastProfit;
|
||||
|
||||
@TableField(value = "MONTHCOST")
|
||||
private String monthCost;
|
||||
|
||||
@TableField(value = "THISCOST")
|
||||
private String thisCost;
|
||||
|
||||
@TableField(value = "LASTCOST")
|
||||
private String lastCost;
|
||||
|
||||
@TableField(value = "MONTHPROFITRATE")
|
||||
private String monthProfitRate;
|
||||
|
||||
@TableField(value = "THISPROFITRATE")
|
||||
private String thisProfitRate;
|
||||
|
||||
@TableField(value = "LASTPROFITRATE")
|
||||
private String lastProfitRate;
|
||||
|
||||
@TableField(value = "MONTHSAMONEYSHARE")
|
||||
private String monthSaMoneyShare;
|
||||
|
||||
@TableField(value = "THISSAMONEYSHARE")
|
||||
private String thisSaMoneyShare;
|
||||
|
||||
@TableField(value = "LASTSAMONEYSHARE")
|
||||
private String lastSaMoneyShare;
|
||||
|
||||
@TableField(value = "MONTHPROFITSHARE")
|
||||
private String monthProfitShare;
|
||||
|
||||
@TableField(value = "THISPROFITSHARE")
|
||||
private String thisProfitShare;
|
||||
|
||||
@TableField(value = "LASTPROFITSHARE")
|
||||
private String lastProfitShare;
|
||||
|
||||
@TableField(value = "SAMONEYGROWTH")
|
||||
private String saMoneyGrowth;
|
||||
|
||||
@TableField(value = "PROFITGROWTH")
|
||||
private String profitGrowth;
|
||||
|
||||
@TableField(value = "PROFITCHANGE")
|
||||
private String profitChange;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物料产品库存统计表对象 gr_bi_st_lot
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@TableName("gr_bi_st_lot")
|
||||
@Data
|
||||
public class GrBiStLot implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "GOODSID")
|
||||
private Long goodsId;
|
||||
|
||||
@TableField(value = "GOODSNAME")
|
||||
private String goodsName;
|
||||
|
||||
@TableField(value = "GOODSTYPE")
|
||||
private String goodsType;
|
||||
|
||||
@TableField(value = "GOODSUNIT")
|
||||
private String goodsUnit;
|
||||
|
||||
@TableField(value = "CLASSID")
|
||||
private Long classid;
|
||||
|
||||
@TableField(value = "CLASSNAME")
|
||||
private String className;
|
||||
|
||||
@TableField(value = "LOTID")
|
||||
private Long lotId;
|
||||
|
||||
@TableField(value = "LOTNO")
|
||||
private String lotNo;
|
||||
|
||||
@TableField(value = "GOODSQTY")
|
||||
private Long goodsQty;
|
||||
|
||||
@TableField(value = "PRODDATE")
|
||||
private Date prodDate;
|
||||
|
||||
@TableField(value = "INVALIDDATE")
|
||||
private String invalidDate;
|
||||
|
||||
@TableField(value = "INVALIDDAYS")
|
||||
private Long invalidDays;
|
||||
|
||||
@TableField(value = "STINDATE")
|
||||
private String stInDate;
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 库存产品占比表对象 gr_bi_st_product
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@TableName("gr_bi_st_product")
|
||||
@Data
|
||||
public class GrBiStProduct implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "GOODSID")
|
||||
private Long goodsId;
|
||||
|
||||
@TableField(value = "GOODSNAME")
|
||||
private String goodsName;
|
||||
|
||||
@TableField(value = "GOODSTYPE")
|
||||
private String goodsType;
|
||||
|
||||
@TableField(value = "GOODSUNIT")
|
||||
private String goodsUnit;
|
||||
|
||||
@TableField(value = "GOODSCLASSID")
|
||||
private Long goodsClassId;
|
||||
|
||||
@TableField(value = "GOODSCLASSNAME")
|
||||
private String goodsClassName;
|
||||
|
||||
@TableField(value = "QTY")
|
||||
private BigDecimal qty;
|
||||
|
||||
@TableField(value = "QTY_PROP")
|
||||
private BigDecimal qtyProp;
|
||||
|
||||
@TableField(value = "MONEY")
|
||||
private BigDecimal money;
|
||||
|
||||
@TableField(value = "MONEY_PROP")
|
||||
private BigDecimal moneyProp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产品可销库存对象 gr_bi_st_product_avl
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@TableName("gr_bi_st_product_avl")
|
||||
@Data
|
||||
public class GrBiStProductAvl implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@TableField(value = "GOODSID")
|
||||
private Long goodsId;
|
||||
|
||||
@TableField(value = "GOODSNAME")
|
||||
private String goodsName;
|
||||
|
||||
@TableField(value = "GOODSTYPE")
|
||||
private String goodsType;
|
||||
|
||||
@TableField(value = "GOODSUNIT")
|
||||
private String goodsUnit;
|
||||
|
||||
@TableField(value = "PACKSIZE")
|
||||
private Long packSize;
|
||||
|
||||
@TableField(value = "SORT")
|
||||
private Long sort;
|
||||
|
||||
@TableField(value = "SEMIREM")
|
||||
private BigDecimal semiRem;
|
||||
|
||||
@TableField(value = "TODAYIN")
|
||||
private String todayIn;
|
||||
|
||||
@TableField(value = "REM")
|
||||
private BigDecimal rem;
|
||||
|
||||
@TableField(value = "THISMONTHOUT")
|
||||
private BigDecimal thisMonthOut;
|
||||
|
||||
@TableField(value = "LASTMONTHOUT")
|
||||
private BigDecimal lastMonthOut;
|
||||
|
||||
@TableField(value = "THISYEAROUT")
|
||||
private BigDecimal thisYearOut;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.lideeyunji.core.framework.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 能耗数据
|
||||
*
|
||||
* @author 裕恒 282636116@qq.com
|
||||
* @since 1.0.0 2026-03-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("erp_bi_data.gr_nh")
|
||||
public class GrNhEntity {
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 电(当日)
|
||||
*/
|
||||
private Float eleDayCurrent;
|
||||
|
||||
/**
|
||||
* 电(昨日)
|
||||
*/
|
||||
private Float eleDayBefore;
|
||||
|
||||
/**
|
||||
* 电(当月)
|
||||
*/
|
||||
private Float eleMonthCurrent;
|
||||
|
||||
/**
|
||||
* 电(上月)
|
||||
*/
|
||||
private Float eleMonthBefore;
|
||||
|
||||
/**
|
||||
* 电(当年)
|
||||
*/
|
||||
private Float eleYearCurrent;
|
||||
|
||||
/**
|
||||
* 电(上年)
|
||||
*/
|
||||
private Float eleYearBefore;
|
||||
|
||||
/**
|
||||
* 水(当日)
|
||||
*/
|
||||
private Float waterDayCurrent;
|
||||
|
||||
/**
|
||||
* 水(昨日)
|
||||
*/
|
||||
private Float waterDayBefore;
|
||||
|
||||
/**
|
||||
* 水(当月)
|
||||
*/
|
||||
private Float waterMonthCurrent;
|
||||
|
||||
/**
|
||||
* 水(上月)
|
||||
*/
|
||||
private Float waterMonthBefore;
|
||||
|
||||
/**
|
||||
* 水(当年)
|
||||
*/
|
||||
private Float waterYearCurrent;
|
||||
|
||||
/**
|
||||
* 水(上年)
|
||||
*/
|
||||
private Float waterYearBefore;
|
||||
|
||||
/**
|
||||
* 气(当日)
|
||||
*/
|
||||
private Float gasDayCurrent;
|
||||
|
||||
/**
|
||||
* 气(昨日)
|
||||
*/
|
||||
private Float gasDayBefore;
|
||||
|
||||
/**
|
||||
* 气(当月)
|
||||
*/
|
||||
private Float gasMonthCurrent;
|
||||
|
||||
/**
|
||||
* 气(上月)
|
||||
*/
|
||||
private Float gasMonthBefore;
|
||||
|
||||
/**
|
||||
* 气(当年)
|
||||
*/
|
||||
private Float gasYearCurrent;
|
||||
|
||||
/**
|
||||
* 气(上年)
|
||||
*/
|
||||
private Float gasYearBefore;
|
||||
|
||||
/**
|
||||
* 标准煤
|
||||
(当日)
|
||||
*/
|
||||
private Float stcDayCurrent;
|
||||
|
||||
/**
|
||||
* 标准煤
|
||||
(昨日)
|
||||
*/
|
||||
private Float stcDayBefore;
|
||||
|
||||
/**
|
||||
* 标准煤
|
||||
(当月)
|
||||
*/
|
||||
private Float stcMonthCurrent;
|
||||
|
||||
/**
|
||||
* 标准煤
|
||||
(上月)
|
||||
*/
|
||||
private Float stcMonthBefore;
|
||||
|
||||
/**
|
||||
* 标准煤
|
||||
(当年)
|
||||
*/
|
||||
private Float stcYearCurrent;
|
||||
|
||||
/**
|
||||
* 标准煤(上年)
|
||||
*/
|
||||
private Float stcYearBefore;
|
||||
|
||||
/**
|
||||
* 添加日期
|
||||
*/
|
||||
private Date addTime=new Date();
|
||||
|
||||
}
|
||||
@@ -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<GrBiFsBusinessReal>
|
||||
{
|
||||
/**
|
||||
* 查询经营指标完成情况
|
||||
*
|
||||
* @param ID 经营指标完成情况主键
|
||||
* @return 经营指标完成情况
|
||||
*/
|
||||
public GrBiFsBusinessReal selectGrBiFsBusinessRealByID(String ID);
|
||||
|
||||
/**
|
||||
* 查询经营指标完成情况列表
|
||||
*
|
||||
* @param grBiFsBusinessReal 经营指标完成情况
|
||||
* @return 经营指标完成情况集合
|
||||
*/
|
||||
public List<GrBiFsBusinessReal> 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<GrBiFsBusinessReal> 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);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.entity.GrBiSaAgg;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@DS(lideeYunJiBaseConstant.DS_ERP_BI_DATA)
|
||||
public interface GrBiSaAggMapper extends BaseMapper<GrBiSaAgg> {
|
||||
|
||||
|
||||
List<GrBiSaAgg> generateSalesReport(@Param("pastYearMonth") Integer pastYearMonth,
|
||||
@Param("currentYearMonth") Integer currentYearMonth);
|
||||
|
||||
int deleteSalesReport(@Param("pastYearMonth") Integer pastYearMonth,
|
||||
@Param("currentYearMonth") Integer currentYearMonth);
|
||||
|
||||
void updateThisData();
|
||||
|
||||
void updateLastData();
|
||||
|
||||
void updateComplexCalculate1();
|
||||
void updateComplexCalculate2();
|
||||
void updateComplexCalculate3();
|
||||
void updateComplexCalculate4();
|
||||
void updateComplexCalculate5();
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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接口
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
public interface GrBiStLotMapper extends BaseMapper<GrBiStLot>
|
||||
{
|
||||
/**
|
||||
* 查询物料产品库存统计表
|
||||
*
|
||||
* @param ID 物料产品库存统计表主键
|
||||
* @return 物料产品库存统计表
|
||||
*/
|
||||
public GrBiStLot selectGrBiStLotByID(Long ID);
|
||||
|
||||
/**
|
||||
* 查询物料产品库存统计表列表
|
||||
*
|
||||
* @param grBiStLot 物料产品库存统计表
|
||||
* @return 物料产品库存统计表集合
|
||||
*/
|
||||
public List<GrBiStLot> 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);
|
||||
|
||||
@DS(value = "#dataSourceType")
|
||||
default List<GrBiStLot> 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<>());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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接口
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
public interface GrBiStProductAvlMapper extends BaseMapper<GrBiStProductAvl>
|
||||
{
|
||||
/**
|
||||
* 查询产品可销库存
|
||||
*
|
||||
* @param ID 产品可销库存主键
|
||||
* @return 产品可销库存
|
||||
*/
|
||||
public GrBiStProductAvl selectGrBiStProductAvlByID(Long ID);
|
||||
|
||||
/**
|
||||
* 查询产品可销库存列表
|
||||
*
|
||||
* @param grBiStProductAvl 产品可销库存
|
||||
* @return 产品可销库存集合
|
||||
*/
|
||||
public List<GrBiStProductAvl> 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);
|
||||
|
||||
@DS(value = "#dataSourceType")
|
||||
default List<GrBiStProductAvl> 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<>());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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接口
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
public interface GrBiStProductMapper extends BaseMapper<GrBiStProduct>
|
||||
{
|
||||
/**
|
||||
* 查询库存产品占比表
|
||||
*
|
||||
* @param ID 库存产品占比表主键
|
||||
* @return 库存产品占比表
|
||||
*/
|
||||
public GrBiStProduct selectGrBiStProductByID(Long ID);
|
||||
|
||||
/**
|
||||
* 查询库存产品占比表列表
|
||||
*
|
||||
* @param grBiStProduct 库存产品占比表
|
||||
* @return 库存产品占比表集合
|
||||
*/
|
||||
public List<GrBiStProduct> 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);
|
||||
|
||||
@DS(value = "#dataSourceType")
|
||||
default List<GrBiStProduct> 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<>());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.entity.GrNhEntity;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 能耗数据
|
||||
*
|
||||
* @author 裕恒 282636116@qq.com
|
||||
* @since 1.0.0 2026-03-13
|
||||
*/
|
||||
@DS(lideeYunJiBaseConstant.DS_ERP_BI_DATA)
|
||||
public interface GrNhMapper extends BaseMapper<GrNhEntity> {
|
||||
@DS(value = "#dataSourceType")
|
||||
default int save(@Param("dataSourceType") String dataSourceType, GrNhEntity grNhEntity) {
|
||||
return this.insert(grNhEntity);
|
||||
}
|
||||
}
|
||||
@@ -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<GrBiFsBusinessReal> 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);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.lideeyunji.core.framework.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lideeyunji.core.framework.entity.GrBiSaAgg;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface IGrBiSaAggService extends IService<GrBiSaAgg> {
|
||||
|
||||
//同步销售明细表
|
||||
void generateSalesReportJob(@Param("dataSourceType") String dataSourceType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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<GrBiStLot> 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);
|
||||
|
||||
void generateStLot(String dataSourceType);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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<GrBiStProductAvl> 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);
|
||||
|
||||
void generateStProductAvl(String dataSourceType);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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<GrBiStProduct> 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);
|
||||
|
||||
void generateStProduct(String dataSourceType);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.lideeyunji.core.framework.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lideeyunji.core.framework.entity.GrNhEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能耗数据
|
||||
*
|
||||
* @author 裕恒 282636116@qq.com
|
||||
* @since 1.0.0 2026-03-13
|
||||
*/
|
||||
public interface IGrNhService extends IService<GrNhEntity> {
|
||||
|
||||
Integer saveNH(GrNhEntity grNhEntity) ;
|
||||
|
||||
void delete(List<Long> idList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.lideeyunji.core.framework.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
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<GrBiFsBusinessRealMapper, GrBiFsBusinessReal> implements IGrBiFsBusinessRealService
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
@DSTransactional
|
||||
@DS(value = "#dataSourceType")
|
||||
public void generateBusinessReal(String dataSourceType) {
|
||||
//获取本地mysql数据库中表中UPDATE_TIME最新的数据
|
||||
LambdaQueryWrapper<GrBiFsBusinessReal> queryWrapper = new LambdaQueryWrapper<GrBiFsBusinessReal>().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<GrBiFsBusinessReal> 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<GrBiFsBusinessReal> 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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.GrBiSaAgg;
|
||||
import com.lideeyunji.core.framework.mapper.GrBiSaAggMapper;
|
||||
import com.lideeyunji.core.framework.service.IGrBiSaAggService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GrBiSaAggServiceImpl extends ServiceImpl<GrBiSaAggMapper, GrBiSaAgg> implements IGrBiSaAggService {
|
||||
|
||||
/**
|
||||
* 计算销售报表
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@DS(value = "#dataSourceType")
|
||||
public void generateSalesReportJob(@Param("dataSourceType") String dataSourceType) {
|
||||
//获取本地mysql数据库中表中UPDATE_TIME最新的数据
|
||||
LambdaQueryWrapper<GrBiSaAgg> queryWrapper = new LambdaQueryWrapper<GrBiSaAgg>().orderByDesc(GrBiSaAgg::getUseYear, GrBiSaAgg::getUseMonth).last("LIMIT 1");
|
||||
GrBiSaAgg grBiSaAgg = this.baseMapper.selectOne(queryWrapper);
|
||||
int lastUserYear = 2022;
|
||||
int lastUserMonth = 1;
|
||||
if(grBiSaAgg != null){
|
||||
lastUserYear = grBiSaAgg.getUseYear();
|
||||
lastUserMonth = grBiSaAgg.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<GrBiSaAgg> grBiSaSetdtlList = this.baseMapper.generateSalesReport(pastYear * 100 + pastMonth, currentYear * 100 + currentMonth);
|
||||
if (CollUtil.isEmpty(grBiSaSetdtlList)) {
|
||||
return;
|
||||
}
|
||||
//保存数据
|
||||
removeAndSaveBatch(pastYear, pastMonth, currentYear, currentMonth, grBiSaSetdtlList);
|
||||
this.baseMapper.updateThisData();
|
||||
this.baseMapper.updateLastData();
|
||||
this.baseMapper.updateComplexCalculate1();
|
||||
this.baseMapper.updateComplexCalculate2();
|
||||
this.baseMapper.updateComplexCalculate3();
|
||||
this.baseMapper.updateComplexCalculate4();
|
||||
this.baseMapper.updateComplexCalculate5();
|
||||
}
|
||||
|
||||
|
||||
//批量新增
|
||||
|
||||
public void removeAndSaveBatch(Integer pastYear, Integer pastMonth, Integer currentYear, Integer currentMonth, List<GrBiSaAgg> grBiSaSetdtlList) {
|
||||
|
||||
int reNum = this.baseMapper.deleteSalesReport(pastYear * 100 + pastMonth, currentYear * 100 + currentMonth);
|
||||
log.info("删除数量:{}", reNum);
|
||||
int result = 0;
|
||||
for (GrBiSaAgg grBiSaSetdtl : grBiSaSetdtlList) {
|
||||
int re = this.baseMapper.insert(grBiSaSetdtl);
|
||||
if (re < 1) {
|
||||
throw new RuntimeException("批量新增异常");
|
||||
}
|
||||
result += re;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.lideeyunji.core.framework.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 物料产品库存统计表Service业务层处理
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GrBiStLotServiceImpl extends ServiceImpl<GrBiStLotMapper, GrBiStLot> implements IGrBiStLotService
|
||||
{
|
||||
|
||||
@Override
|
||||
@DSTransactional
|
||||
@DS(value = "#dataSourceType")
|
||||
public void generateStLot(String dataSourceType) {
|
||||
//获取本地mysql数据库中表中UPDATE_TIME最新的数据
|
||||
// LambdaQueryWrapper<GrBiStLot> queryWrapper = new LambdaQueryWrapper<GrBiStLot>().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<GrBiStLot> 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("批量新增异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料产品库存统计表
|
||||
*
|
||||
* @param ID 物料产品库存统计表主键
|
||||
* @return 物料产品库存统计表
|
||||
*/
|
||||
@Override
|
||||
public GrBiStLot selectGrBiStLotByID(Long ID)
|
||||
{
|
||||
return this.baseMapper.selectGrBiStLotByID(ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料产品库存统计表列表
|
||||
*
|
||||
* @param grBiStLot 物料产品库存统计表
|
||||
* @return 物料产品库存统计表
|
||||
*/
|
||||
@Override
|
||||
public List<GrBiStLot> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
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.dynamic.datasource.annotation.DSTransactional;
|
||||
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.GrBiStProductAvlMapper;
|
||||
import com.lideeyunji.core.framework.entity.GrBiStProductAvl;
|
||||
import com.lideeyunji.core.framework.service.IGrBiStProductAvlService;
|
||||
|
||||
/**
|
||||
* 产品可销库存Service业务层处理
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GrBiStProductAvlServiceImpl extends ServiceImpl<GrBiStProductAvlMapper, GrBiStProductAvl> implements IGrBiStProductAvlService
|
||||
{
|
||||
|
||||
@Override
|
||||
@DSTransactional
|
||||
@DS(value = "#dataSourceType")
|
||||
public void generateStProductAvl(String dataSourceType) {
|
||||
//获取本地mysql数据库中表中UPDATE_TIME最新的数据
|
||||
// LambdaQueryWrapper<grBiStProductAvl> queryWrapper = new LambdaQueryWrapper<grBiStProductAvl>().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<GrBiStProductAvl> 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("批量新增异常");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询产品可销库存
|
||||
*
|
||||
* @param ID 产品可销库存主键
|
||||
* @return 产品可销库存
|
||||
*/
|
||||
@Override
|
||||
public GrBiStProductAvl selectGrBiStProductAvlByID(Long ID)
|
||||
{
|
||||
return this.baseMapper.selectGrBiStProductAvlByID(ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品可销库存列表
|
||||
*
|
||||
* @param grBiStProductAvl 产品可销库存
|
||||
* @return 产品可销库存
|
||||
*/
|
||||
@Override
|
||||
public List<GrBiStProductAvl> 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
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.dynamic.datasource.annotation.DSTransactional;
|
||||
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;
|
||||
import com.lideeyunji.core.framework.service.IGrBiStProductService;
|
||||
|
||||
/**
|
||||
* 库存产品占比表Service业务层处理
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GrBiStProductServiceImpl extends ServiceImpl<GrBiStProductMapper, GrBiStProduct> implements IGrBiStProductService
|
||||
{
|
||||
@Override
|
||||
@DSTransactional
|
||||
@DS(value = "#dataSourceType")
|
||||
public void generateStProduct(String dataSourceType) {
|
||||
//获取本地mysql数据库中表中UPDATE_TIME最新的数据
|
||||
// LambdaQueryWrapper<GrBiStProduct> queryWrapper = new LambdaQueryWrapper<GrBiStProduct>().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<GrBiStProduct> 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("批量新增异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存产品占比表
|
||||
*
|
||||
* @param ID 库存产品占比表主键
|
||||
* @return 库存产品占比表
|
||||
*/
|
||||
@Override
|
||||
public GrBiStProduct selectGrBiStProductByID(Long ID)
|
||||
{
|
||||
return this.baseMapper.selectGrBiStProductByID(ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存产品占比表列表
|
||||
*
|
||||
* @param grBiStProduct 库存产品占比表
|
||||
* @return 库存产品占比表
|
||||
*/
|
||||
@Override
|
||||
public List<GrBiStProduct> 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.lideeyunji.core.framework.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lideeyunji.core.framework.entity.GrNhEntity;
|
||||
import com.lideeyunji.core.framework.mapper.GrNhMapper;
|
||||
import com.lideeyunji.core.framework.service.IGrNhService;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能耗数据
|
||||
*
|
||||
* @author 裕恒 282636116@qq.com
|
||||
* @since 1.0.0 2026-03-13
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class GrNhServiceImpl extends ServiceImpl<GrNhMapper, GrNhEntity> implements IGrNhService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(List<Long> idList) {
|
||||
removeByIds(idList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//新增
|
||||
@Override
|
||||
@DSTransactional
|
||||
public Integer saveNH(GrNhEntity grNhEntity) {
|
||||
int re = this.baseMapper.save(lideeYunJiBaseConstant.DS_ERP_BI_DATA, grNhEntity);
|
||||
return re;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -278,6 +278,9 @@ public class Func extends FuncBase {
|
||||
return fieldValObj;
|
||||
}
|
||||
|
||||
/*
|
||||
* http post请求
|
||||
* */
|
||||
public static String sendPost(String url, Object body) throws Exception {
|
||||
String accept = HttpRequest.post(url)
|
||||
.body(Func.json2Str(body))
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.GrBiFsBusinessRealMapper">
|
||||
|
||||
<resultMap type="com.lideeyunji.core.framework.entity.GrBiFsBusinessReal" id="GrBiFsBusinessRealResult">
|
||||
<result property="id" column="ID" />
|
||||
<result property="useYear" column="USEYEAR" />
|
||||
<result property="useMonth" column="USEMONTH" />
|
||||
<result property="itemId" column="ITEMID" />
|
||||
<result property="itemName" column="ITEMNAME" />
|
||||
<result property="itemOrder" column="ITEMORDER" />
|
||||
<result property="monthReal" column="MONTH_REAL" />
|
||||
<result property="yearReal" column="YEAR_REAL" />
|
||||
<result property="monthDiff" column="MONTH_DIFF" />
|
||||
<result property="yearPlan" column="YEAR_PLAN" />
|
||||
<result property="yearRate" column="YEAR_RATE" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGrBiFsBusinessRealVo">
|
||||
select ID, USEYEAR, USEMONTH, ITEMID, ITEMNAME, ITEMORDER, MONTH_REAL, YEAR_REAL, MONTH_DIFF, YEAR_PLAN, YEAR_RATE from gr_bi_fs_business_real
|
||||
</sql>
|
||||
<select id="getBusinessRealList" resultMap="GrBiFsBusinessRealResult">
|
||||
<include refid="selectGrBiFsBusinessRealVo"/>
|
||||
<where>
|
||||
USEYEAR is not NULL
|
||||
and (USEYEAR * 100 + USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth}
|
||||
</where>
|
||||
order by USEYEAR, USEMONTH
|
||||
</select>
|
||||
<delete id="deleteOldBusinessReal">
|
||||
delete from gr_bi_fs_business_real
|
||||
where (USEYEAR * 100 + USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth}
|
||||
</delete>
|
||||
<select id="selectGrBiFsBusinessRealList" parameterType="com.lideeyunji.core.framework.entity.GrBiFsBusinessReal" resultMap="GrBiFsBusinessRealResult">
|
||||
<include refid="selectGrBiFsBusinessRealVo"/>
|
||||
<where>
|
||||
<if test="ID != null and ID != ''"> and ID = #{ID}</if>
|
||||
<if test="USEYEAR != null and USEYEAR != ''"> and USEYEAR = #{USEYEAR}</if>
|
||||
<if test="USEMONTH != null and USEMONTH != ''"> and USEMONTH = #{USEMONTH}</if>
|
||||
<if test="ITEMID != null and ITEMID != ''"> and ITEMID = #{ITEMID}</if>
|
||||
<if test="ITEMNAME != null and ITEMNAME != ''"> and ITEMNAME like concat('%', #{ITEMNAME}, '%')</if>
|
||||
<if test="ITEMORDER != null and ITEMORDER != ''"> and ITEMORDER = #{ITEMORDER}</if>
|
||||
<if test="monthReal != null and monthReal != ''"> and MONTH_REAL = #{monthReal}</if>
|
||||
<if test="yearReal != null and yearReal != ''"> and YEAR_REAL = #{yearReal}</if>
|
||||
<if test="monthDiff != null and monthDiff != ''"> and MONTH_DIFF = #{monthDiff}</if>
|
||||
<if test="yearPlan != null and yearPlan != ''"> and YEAR_PLAN = #{yearPlan}</if>
|
||||
<if test="yearRate != null and yearRate != ''"> and YEAR_RATE = #{yearRate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGrBiFsBusinessRealByID" parameterType="String" resultMap="GrBiFsBusinessRealResult">
|
||||
<include refid="selectGrBiFsBusinessRealVo"/>
|
||||
where ID = #{ID}
|
||||
</select>
|
||||
|
||||
<insert id="insertGrBiFsBusinessReal" parameterType="com.lideeyunji.core.framework.entity.GrBiFsBusinessReal">
|
||||
insert into gr_bi_fs_business_real
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">ID,</if>
|
||||
<if test="USEYEAR != null">USEYEAR,</if>
|
||||
<if test="USEMONTH != null">USEMONTH,</if>
|
||||
<if test="ITEMID != null">ITEMID,</if>
|
||||
<if test="ITEMNAME != null">ITEMNAME,</if>
|
||||
<if test="ITEMORDER != null">ITEMORDER,</if>
|
||||
<if test="monthReal != null">MONTH_REAL,</if>
|
||||
<if test="yearReal != null">YEAR_REAL,</if>
|
||||
<if test="monthDiff != null">MONTH_DIFF,</if>
|
||||
<if test="yearPlan != null">YEAR_PLAN,</if>
|
||||
<if test="yearRate != null">YEAR_RATE,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">#{ID},</if>
|
||||
<if test="USEYEAR != null">#{USEYEAR},</if>
|
||||
<if test="USEMONTH != null">#{USEMONTH},</if>
|
||||
<if test="ITEMID != null">#{ITEMID},</if>
|
||||
<if test="ITEMNAME != null">#{ITEMNAME},</if>
|
||||
<if test="ITEMORDER != null">#{ITEMORDER},</if>
|
||||
<if test="monthReal != null">#{monthReal},</if>
|
||||
<if test="yearReal != null">#{yearReal},</if>
|
||||
<if test="monthDiff != null">#{monthDiff},</if>
|
||||
<if test="yearPlan != null">#{yearPlan},</if>
|
||||
<if test="yearRate != null">#{yearRate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGrBiFsBusinessReal" parameterType="com.lideeyunji.core.framework.entity.GrBiFsBusinessReal">
|
||||
update gr_bi_fs_business_real
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="USEYEAR != null">USEYEAR = #{USEYEAR},</if>
|
||||
<if test="USEMONTH != null">USEMONTH = #{USEMONTH},</if>
|
||||
<if test="ITEMID != null">ITEMID = #{ITEMID},</if>
|
||||
<if test="ITEMNAME != null">ITEMNAME = #{ITEMNAME},</if>
|
||||
<if test="ITEMORDER != null">ITEMORDER = #{ITEMORDER},</if>
|
||||
<if test="monthReal != null">MONTH_REAL = #{monthReal},</if>
|
||||
<if test="yearReal != null">YEAR_REAL = #{yearReal},</if>
|
||||
<if test="monthDiff != null">MONTH_DIFF = #{monthDiff},</if>
|
||||
<if test="yearPlan != null">YEAR_PLAN = #{yearPlan},</if>
|
||||
<if test="yearRate != null">YEAR_RATE = #{yearRate},</if>
|
||||
</trim>
|
||||
where ID = #{ID}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGrBiFsBusinessRealByID" parameterType="String">
|
||||
delete from gr_bi_fs_business_real where ID = #{ID}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGrBiFsBusinessRealByIDs" parameterType="String">
|
||||
delete from gr_bi_fs_business_real where ID in
|
||||
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||||
#{ID}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,254 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.GrBiSaAggMapper">
|
||||
|
||||
|
||||
|
||||
<select id="generateSalesReport" resultType="com.lideeyunji.core.framework.entity.GrBiSaAgg">
|
||||
select a.USEYEAR,
|
||||
a.USEMONTH,
|
||||
goods.goodsid as GOODSID,
|
||||
goods.GOODSNAME,
|
||||
sales.SALEZONEID as ZONEID,
|
||||
sales.SALEZONENAME as ZONENAME,
|
||||
province.PROVINCEID,
|
||||
province.PROVINCENAME,
|
||||
salestype.SALETYPEID,
|
||||
salestype.SALETYPENAME,
|
||||
dosage.DOSAGEID,
|
||||
dosage.DOSAGENAME,
|
||||
custom.CUSTOMID,
|
||||
custom.CUSTOMNAME,
|
||||
saler.SALERID,
|
||||
saler.SALERNAME,
|
||||
a.`本月销量` as MONTHSAQTY,
|
||||
a.`含税销售额` as MONTHSAMONEY,
|
||||
a.`销售成本` as MONTHCOST,
|
||||
a.`毛利额` as MONTHPROFIT
|
||||
from erp_bi_data.GR_BI_PUB_GOODS as goods
|
||||
inner join erp_bi_data.GR_BI_PUB_SALEZONE as sales
|
||||
inner join erp_bi_data.GR_BI_PUB_PROVINCE as province
|
||||
inner join erp_bi_data.GR_BI_PUB_SALETYPE as salestype
|
||||
inner join erp_bi_data.GR_BI_PUB_DOSAGE as dosage
|
||||
inner join erp_bi_data.GR_BI_PUB_CUSTOM as custom
|
||||
INNER join erp_bi_data.GR_BI_PUB_SALER as saler
|
||||
left join
|
||||
(SELECT USEYEAR,
|
||||
USEMONTH,
|
||||
SALEZONEID,
|
||||
SALEZONENAME,
|
||||
PROVINCEID,
|
||||
PROVINCENAME,
|
||||
SALETYPE,
|
||||
SALETYPENAME,
|
||||
CUSTOMNAME,
|
||||
SALERNAME,
|
||||
DOSAGENAME,
|
||||
goodsid,
|
||||
GOODSNAME,
|
||||
GOODSTYPE,
|
||||
sum(SAQTY) as 本月销量,
|
||||
DOSAGEID,
|
||||
CUSTOMID,
|
||||
SALERID,
|
||||
round(SUM(SAMONEY), 2) 除税销售额,
|
||||
round(sum(SAMONEYTX), 2) 含税销售额,
|
||||
round(sum(COST), 2) 销售成本,
|
||||
round(sum(PROFIT), 2) 毛利额
|
||||
FROM GR_BI_SA_SETDTL
|
||||
where USESTATUS = 2
|
||||
GROUP BY SALETYPE, SALEZONEID, SALEZONENAME, PROVINCEID, PROVINCENAME, SALETYPE, SALETYPENAME, CUSTOMID,
|
||||
CUSTOMNAME, SALERID, SALERNAME, DOSAGEID, DOSAGENAME, GOODSID, GOODSNAME, GOODSTYPE, USEYEAR,
|
||||
USEMONTH) a
|
||||
on a.goodsid = goods.goodsid and a.SALEZONEID = sales.SALEZONEID and a.PROVINCEID = province.PROVINCEID
|
||||
and salestype.SALETYPEID = a.SALETYPE and dosage.DOSAGEID = a.DOSAGEID and
|
||||
custom.CUSTOMID = a.CUSTOMID and saler.SALERID = a.SALERID
|
||||
<where>
|
||||
a.USEYEAR is not NULL
|
||||
and (a.USEYEAR * 100 + a.USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth}
|
||||
</where>
|
||||
order by a.USEYEAR, a.USEMONTH
|
||||
</select>
|
||||
|
||||
<delete id="deleteSalesReport">
|
||||
delete from yunji_gr_bi_sa_agg
|
||||
where (USEYEAR * 100 + USEMONTH) BETWEEN #{pastYearMonth} AND #{currentYearMonth}
|
||||
</delete>
|
||||
|
||||
<update id="updateThisData">
|
||||
UPDATE yunji_gr_bi_sa_agg a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
USEYEAR,
|
||||
GOODSID,
|
||||
ZONEID,
|
||||
PROVINCEID,
|
||||
SALETYPEID,
|
||||
DOSAGEID,
|
||||
CUSTOMID,
|
||||
SALERID,
|
||||
SUM( MONTHSAQTY ) AS THISSAQTY, -- 本年销量
|
||||
SUM( MONTHSAMONEY ) AS THISSAMONEY, -- 本年销售金额
|
||||
SUM( MONTHCOST) as THISCOST, -- 本年毛利额
|
||||
SUM( MONTHPROFIT ) AS THISPROFIT -- 本年毛利额
|
||||
FROM
|
||||
yunji_gr_bi_sa_agg
|
||||
GROUP BY
|
||||
USEYEAR,
|
||||
GOODSID,
|
||||
ZONEID,
|
||||
PROVINCEID,
|
||||
SALETYPEID,
|
||||
DOSAGEID,
|
||||
CUSTOMID,
|
||||
SALERID
|
||||
) b ON b.USEYEAR = a.USEYEAR
|
||||
AND b.GOODSID = a.GOODSID
|
||||
AND b.ZONEID = a.ZONEID
|
||||
AND b.PROVINCEID = a.PROVINCEID
|
||||
AND b.SALETYPEID = a.SALETYPEID
|
||||
AND b.DOSAGEID = a.DOSAGEID
|
||||
AND b.CUSTOMID = a.CUSTOMID
|
||||
AND b.SALERID = a.SALERID
|
||||
SET a.THISSAQTY = COALESCE ( b.THISSAQTY, 0 ),
|
||||
a.THISSAMONEY = COALESCE ( b.THISSAMONEY, 0 ),
|
||||
a.THISCOST = COALESCE ( b.THISCOST, 0 ),
|
||||
a.THISPROFIT = COALESCE ( b.THISPROFIT, 0 );
|
||||
</update>
|
||||
|
||||
<update id="updateLastData">
|
||||
UPDATE yunji_gr_bi_sa_agg a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
USEYEAR,
|
||||
GOODSID,
|
||||
ZONEID,
|
||||
PROVINCEID,
|
||||
SALETYPEID,
|
||||
DOSAGEID,
|
||||
CUSTOMID,
|
||||
SALERID,
|
||||
SUM( MONTHSAQTY ) AS LASTSAQTY,
|
||||
SUM( MONTHSAMONEY ) AS LASTSAMONEY,
|
||||
SUM( MONTHCOST) as LASTCOST,
|
||||
SUM( MONTHPROFIT ) AS LASTPROFIT
|
||||
FROM
|
||||
yunji_gr_bi_sa_agg
|
||||
GROUP BY
|
||||
USEYEAR,
|
||||
GOODSID,
|
||||
ZONEID,
|
||||
PROVINCEID,
|
||||
SALETYPEID,
|
||||
DOSAGEID,
|
||||
CUSTOMID,
|
||||
SALERID
|
||||
) b ON b.USEYEAR = a.USEYEAR-1
|
||||
AND b.GOODSID = a.GOODSID
|
||||
AND b.ZONEID = a.ZONEID
|
||||
AND b.PROVINCEID = a.PROVINCEID
|
||||
AND b.SALETYPEID = a.SALETYPEID
|
||||
AND b.DOSAGEID = a.DOSAGEID
|
||||
AND b.CUSTOMID = a.CUSTOMID
|
||||
AND b.SALERID = a.SALERID
|
||||
SET a.LASTSAQTY = COALESCE ( b.LASTSAQTY, 0 ),
|
||||
a.LASTSAMONEY = COALESCE ( b.LASTSAMONEY, 0 ),
|
||||
a.LASTCOST = COALESCE ( b.LASTCOST, 0 ),
|
||||
a.LASTPROFIT = COALESCE ( b.LASTPROFIT, 0 );
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateComplexCalculate1">
|
||||
-- 本月毛利率 MONTHPROFITRATE 本月销售毛利/本月销售收入×100%
|
||||
-- 本年毛利率 THISPROFITRATE 本年销售毛利/本年销售收入×100%
|
||||
-- 上年毛利率 LASTPROFITRATE 上年销售毛利/上年销售收入×100%
|
||||
UPDATE yunji_gr_bi_sa_agg
|
||||
SET
|
||||
MONTHPROFITRATE = CASE WHEN MONTHSAMONEY = 0 or MONTHSAMONEY is null THEN
|
||||
IF(MONTHPROFIT > 0, 100, 0) ELSE MONTHPROFIT/ MONTHSAMONEY * 100 END,
|
||||
THISPROFITRATE = CASE WHEN THISSAMONEY = 0 or THISSAMONEY is null THEN
|
||||
IF(THISPROFIT > 0, 100, 0) ELSE THISPROFIT/ THISSAMONEY * 100 END,
|
||||
LASTPROFITRATE =CASE WHEN LASTSAMONEY = 0 or LASTSAMONEY is null THEN
|
||||
IF(LASTPROFIT > 0, 100, 0) ELSE LASTPROFIT/ LASTSAMONEY * 100 END;
|
||||
|
||||
|
||||
</update>
|
||||
<update id="updateComplexCalculate2">
|
||||
-- 本月销售金额占比 MONTHSAMONEYSHARE 当前行本月销售额/本月销售额总和*100%
|
||||
-- 本月毛利额占比 MONTHPROFITSHARE 当前行本月毛利额/本月毛利额总和*100%
|
||||
UPDATE yunji_gr_bi_sa_agg a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
USEYEAR,
|
||||
USEMONTH,
|
||||
SUM( MONTHSAMONEY ) AS MONTHSAMONEY_SUM,
|
||||
SUM(MONTHPROFIT) AS MONTHPROFIT_SUM
|
||||
FROM
|
||||
yunji_gr_bi_sa_agg
|
||||
GROUP BY
|
||||
USEYEAR,
|
||||
USEMONTH
|
||||
) b ON b.USEYEAR = a.USEYEAR
|
||||
AND b.USEMONTH = a.USEMONTH
|
||||
SET a.MONTHSAMONEYSHARE = COALESCE (ROUND( a.MONTHSAMONEY/b.MONTHSAMONEY_SUM * 100, 2), 0 ),
|
||||
a.MONTHPROFITSHARE = COALESCE (ROUND( a.MONTHPROFIT/b.MONTHPROFIT_SUM * 100, 2), 0 );
|
||||
</update>
|
||||
<update id="updateComplexCalculate3">
|
||||
|
||||
-- 本年销售金额占比 THISSAMONEYSHARE当前行本年销售额/本年销售额总和*100%
|
||||
-- 本年毛利额占比 THISPROFITSHARE 当前行本年毛利额/本年毛利额总和*100%
|
||||
UPDATE yunji_gr_bi_sa_agg a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
USEYEAR,
|
||||
SUM( THISSAMONEY ) AS THISSAMONEY_SUM,
|
||||
SUM( THISPROFIT ) AS THISPROFIT_SUM
|
||||
FROM
|
||||
yunji_gr_bi_sa_agg
|
||||
GROUP BY
|
||||
USEYEAR
|
||||
) b ON b.USEYEAR = a.USEYEAR
|
||||
SET a.THISSAMONEYSHARE = COALESCE (ROUND( a.THISSAMONEY/b.THISSAMONEY_SUM * 100, 2), 0 ),
|
||||
a.THISPROFITSHARE = COALESCE (ROUND( a.THISPROFIT/b.THISPROFIT_SUM * 100, 2), 0 );
|
||||
|
||||
</update>
|
||||
<update id="updateComplexCalculate4">
|
||||
|
||||
-- 上年销售金额占比 LASTSAMONEYSHARE 当前行上年销售额/上年销售额总和*100%
|
||||
-- 上年毛利额占比 LASTPROFITSHARE 当前行上年毛利额/上年毛利额总和*100%
|
||||
UPDATE yunji_gr_bi_sa_agg a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
USEYEAR,
|
||||
SUM(LASTSAMONEY) AS LASTSAMONEY_SUM,
|
||||
SUM(LASTPROFIT) AS LASTPROFIT_SUM
|
||||
|
||||
FROM
|
||||
yunji_gr_bi_sa_agg
|
||||
GROUP BY
|
||||
USEYEAR,
|
||||
USEMONTH
|
||||
) b ON b.USEYEAR = a.USEYEAR
|
||||
SET a.LASTSAMONEYSHARE = COALESCE (ROUND( CASE WHEN LASTSAMONEY_SUM = 0 or LASTSAMONEY_SUM is null THEN IF(a.LASTSAMONEY > 0, 100, 0) ELSE a.LASTSAMONEY/b.LASTSAMONEY_SUM * 100 END, 2), 0 ),
|
||||
a.LASTPROFITSHARE = COALESCE (ROUND( CASE WHEN LASTPROFIT_SUM = 0 or LASTPROFIT_SUM is null THEN IF(a.LASTPROFIT > 0, 100, 0) ELSE a.LASTPROFIT/b.LASTPROFIT_SUM * 100 END, 2), 0 );
|
||||
|
||||
</update>
|
||||
<update id="updateComplexCalculate5">
|
||||
-- 销售金额增长率 SAMONEYGROWTH (本年销售额-上年销售额)÷上年销售额×100%
|
||||
-- 毛利额增长率 PROFITGROWTH (本年毛利额 - 上年毛利额) / 上年毛利额 × 100%
|
||||
-- 毛利变动 PROFITCHANGE 本年毛利额 - 上年毛利额
|
||||
UPDATE yunji_gr_bi_sa_agg
|
||||
SET
|
||||
SAMONEYGROWTH = CASE
|
||||
WHEN ( LASTSAMONEY = 0 OR LASTSAMONEY IS NULL ) AND THISSAMONEY IS NOT NULL
|
||||
THEN IF((THISSAMONEY - LASTSAMONEY) > 0, 100, 0)
|
||||
ELSE ( THISSAMONEY - LASTSAMONEY )/ LASTSAMONEY * 100
|
||||
END,
|
||||
PROFITGROWTH = CASE
|
||||
WHEN ( LASTPROFIT = 0 OR LASTPROFIT IS NULL ) AND THISPROFIT IS NOT NULL
|
||||
THEN IF((THISSAMONEY - LASTSAMONEY) > 0, 100, 0)
|
||||
ELSE ( THISPROFIT - LASTPROFIT )/ LASTPROFIT * 100
|
||||
END,
|
||||
PROFITCHANGE = ( THISPROFIT - LASTPROFIT);
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.GrBiStLotMapper">
|
||||
|
||||
<resultMap type="com.lideeyunji.core.framework.entity.GrBiStLot" id="GrBiStLotResult">
|
||||
<result property="id" column="ID" />
|
||||
<result property="goodsId" column="GOODSID" />
|
||||
<result property="goodsName" column="GOODSNAME" />
|
||||
<result property="goodsType" column="GOODSTYPE" />
|
||||
<result property="goodsUnit" column="GOODSUNIT" />
|
||||
<result property="classid" column="CLASSID" />
|
||||
<result property="className" column="CLASSNAME" />
|
||||
<result property="lotId" column="LOTID" />
|
||||
<result property="lotNo" column="LOTNO" />
|
||||
<result property="goodsQty" column="GOODSQTY" />
|
||||
<result property="prodDate" column="PRODDATE" />
|
||||
<result property="invalidDate" column="INVALIDDATE" />
|
||||
<result property="invalidDays" column="INVALIDDAYS" />
|
||||
<result property="stInDate" column="STINDATE" />
|
||||
<result property="stOutDate" column="STOUTDATE" />
|
||||
<result property="invalidDaysTypeId" column="INVALIDDAYSTYPEID" />
|
||||
<result property="invalidDaysType" column="INVALIDDAYSTYPE" />
|
||||
<result property="outType" column="OUTTYPE" />
|
||||
<result property="storageId" column="STORAGEID" />
|
||||
<result property="storageName" column="STORAGENAME" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGrBiStLotVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectGrBiStLotList" parameterType="com.lideeyunji.core.framework.entity.GrBiStLot" resultMap="GrBiStLotResult">
|
||||
<include refid="selectGrBiStLotVo"/>
|
||||
<where>
|
||||
<if test="ID != null "> and ID = #{ID}</if>
|
||||
<if test="GOODSID != null "> and GOODSID = #{GOODSID}</if>
|
||||
<if test="GOODSNAME != null and GOODSNAME != ''"> and GOODSNAME like concat('%', #{GOODSNAME}, '%')</if>
|
||||
<if test="GOODSTYPE != null and GOODSTYPE != ''"> and GOODSTYPE = #{GOODSTYPE}</if>
|
||||
<if test="GOODSUNIT != null and GOODSUNIT != ''"> and GOODSUNIT = #{GOODSUNIT}</if>
|
||||
<if test="CLASSID != null "> and CLASSID = #{CLASSID}</if>
|
||||
<if test="CLASSNAME != null and CLASSNAME != ''"> and CLASSNAME like concat('%', #{CLASSNAME}, '%')</if>
|
||||
<if test="LOTID != null "> and LOTID = #{LOTID}</if>
|
||||
<if test="LOTNO != null and LOTNO != ''"> and LOTNO = #{LOTNO}</if>
|
||||
<if test="GOODSQTY != null "> and GOODSQTY = #{GOODSQTY}</if>
|
||||
<if test="PRODDATE != null "> and PRODDATE = #{PRODDATE}</if>
|
||||
<if test="INVALIDDATE != null and INVALIDDATE != ''"> and INVALIDDATE = #{INVALIDDATE}</if>
|
||||
<if test="INVALIDDAYS != null "> and INVALIDDAYS = #{INVALIDDAYS}</if>
|
||||
<if test="STINDATE != null and STINDATE != ''"> and STINDATE = #{STINDATE}</if>
|
||||
<if test="STOUTDATE != null and STOUTDATE != ''"> and STOUTDATE = #{STOUTDATE}</if>
|
||||
<if test="INVALIDDAYSTYPEID != null "> and INVALIDDAYSTYPEID = #{INVALIDDAYSTYPEID}</if>
|
||||
<if test="INVALIDDAYSTYPE != null and INVALIDDAYSTYPE != ''"> and INVALIDDAYSTYPE = #{INVALIDDAYSTYPE}</if>
|
||||
<if test="OUTTYPE != null "> and OUTTYPE = #{OUTTYPE}</if>
|
||||
<if test="STORAGEID != null "> and STORAGEID = #{STORAGEID}</if>
|
||||
<if test="STORAGENAME != null and STORAGENAME != ''"> and STORAGENAME like concat('%', #{STORAGENAME}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGrBiStLotByID" parameterType="Long" resultMap="GrBiStLotResult">
|
||||
<include refid="selectGrBiStLotVo"/>
|
||||
where ID = #{ID}
|
||||
</select>
|
||||
|
||||
<insert id="insertGrBiStLot" parameterType="com.lideeyunji.core.framework.entity.GrBiStLot">
|
||||
insert into gr_bi_st_lot
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">ID,</if>
|
||||
<if test="GOODSID != null">GOODSID,</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME,</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE,</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT,</if>
|
||||
<if test="CLASSID != null">CLASSID,</if>
|
||||
<if test="CLASSNAME != null">CLASSNAME,</if>
|
||||
<if test="LOTID != null">LOTID,</if>
|
||||
<if test="LOTNO != null">LOTNO,</if>
|
||||
<if test="GOODSQTY != null">GOODSQTY,</if>
|
||||
<if test="PRODDATE != null">PRODDATE,</if>
|
||||
<if test="INVALIDDATE != null">INVALIDDATE,</if>
|
||||
<if test="INVALIDDAYS != null">INVALIDDAYS,</if>
|
||||
<if test="STINDATE != null">STINDATE,</if>
|
||||
<if test="STOUTDATE != null">STOUTDATE,</if>
|
||||
<if test="INVALIDDAYSTYPEID != null">INVALIDDAYSTYPEID,</if>
|
||||
<if test="INVALIDDAYSTYPE != null">INVALIDDAYSTYPE,</if>
|
||||
<if test="OUTTYPE != null">OUTTYPE,</if>
|
||||
<if test="STORAGEID != null">STORAGEID,</if>
|
||||
<if test="STORAGENAME != null">STORAGENAME,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">#{ID},</if>
|
||||
<if test="GOODSID != null">#{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">#{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">#{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">#{GOODSUNIT},</if>
|
||||
<if test="CLASSID != null">#{CLASSID},</if>
|
||||
<if test="CLASSNAME != null">#{CLASSNAME},</if>
|
||||
<if test="LOTID != null">#{LOTID},</if>
|
||||
<if test="LOTNO != null">#{LOTNO},</if>
|
||||
<if test="GOODSQTY != null">#{GOODSQTY},</if>
|
||||
<if test="PRODDATE != null">#{PRODDATE},</if>
|
||||
<if test="INVALIDDATE != null">#{INVALIDDATE},</if>
|
||||
<if test="INVALIDDAYS != null">#{INVALIDDAYS},</if>
|
||||
<if test="STINDATE != null">#{STINDATE},</if>
|
||||
<if test="STOUTDATE != null">#{STOUTDATE},</if>
|
||||
<if test="INVALIDDAYSTYPEID != null">#{INVALIDDAYSTYPEID},</if>
|
||||
<if test="INVALIDDAYSTYPE != null">#{INVALIDDAYSTYPE},</if>
|
||||
<if test="OUTTYPE != null">#{OUTTYPE},</if>
|
||||
<if test="STORAGEID != null">#{STORAGEID},</if>
|
||||
<if test="STORAGENAME != null">#{STORAGENAME},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGrBiStLot" parameterType="com.lideeyunji.core.framework.entity.GrBiStLot">
|
||||
update gr_bi_st_lot
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="GOODSID != null">GOODSID = #{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME = #{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE = #{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT = #{GOODSUNIT},</if>
|
||||
<if test="CLASSID != null">CLASSID = #{CLASSID},</if>
|
||||
<if test="CLASSNAME != null">CLASSNAME = #{CLASSNAME},</if>
|
||||
<if test="LOTID != null">LOTID = #{LOTID},</if>
|
||||
<if test="LOTNO != null">LOTNO = #{LOTNO},</if>
|
||||
<if test="GOODSQTY != null">GOODSQTY = #{GOODSQTY},</if>
|
||||
<if test="PRODDATE != null">PRODDATE = #{PRODDATE},</if>
|
||||
<if test="INVALIDDATE != null">INVALIDDATE = #{INVALIDDATE},</if>
|
||||
<if test="INVALIDDAYS != null">INVALIDDAYS = #{INVALIDDAYS},</if>
|
||||
<if test="STINDATE != null">STINDATE = #{STINDATE},</if>
|
||||
<if test="STOUTDATE != null">STOUTDATE = #{STOUTDATE},</if>
|
||||
<if test="INVALIDDAYSTYPEID != null">INVALIDDAYSTYPEID = #{INVALIDDAYSTYPEID},</if>
|
||||
<if test="INVALIDDAYSTYPE != null">INVALIDDAYSTYPE = #{INVALIDDAYSTYPE},</if>
|
||||
<if test="OUTTYPE != null">OUTTYPE = #{OUTTYPE},</if>
|
||||
<if test="STORAGEID != null">STORAGEID = #{STORAGEID},</if>
|
||||
<if test="STORAGENAME != null">STORAGENAME = #{STORAGENAME},</if>
|
||||
</trim>
|
||||
where ID = #{ID}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGrBiStLotByID" parameterType="Long">
|
||||
delete from gr_bi_st_lot where ID = #{ID}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGrBiStLotByIDs" parameterType="String">
|
||||
delete from gr_bi_st_lot where ID in
|
||||
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||||
#{ID}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.GrBiStProductAvlMapper">
|
||||
|
||||
<resultMap type="com.lideeyunji.core.framework.entity.GrBiStProductAvl" id="GrBiStProductAvlResult">
|
||||
<result property="id" column="ID" />
|
||||
<result property="goodsId" column="GOODSID" />
|
||||
<result property="goodsName" column="GOODSNAME" />
|
||||
<result property="goodsType" column="GOODSTYPE" />
|
||||
<result property="goodsUnit" column="GOODSUNIT" />
|
||||
<result property="packSize" column="PACKSIZE" />
|
||||
<result property="sort" column="SORT" />
|
||||
<result property="semiRem" column="SEMIREM" />
|
||||
<result property="todayIn" column="TODAYIN" />
|
||||
<result property="rem" column="REM" />
|
||||
<result property="thisMonthOut" column="THISMONTHOUT" />
|
||||
<result property="lastMonthOut" column="LASTMONTHOUT" />
|
||||
<result property="thisYearOut" column="THISYEAROUT" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGrBiStProductAvlVo">
|
||||
select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, PACKSIZE, SORT, SEMIREM, TODAYIN, REM, THISMONTHOUT, LASTMONTHOUT, THISYEAROUT from gr_bi_st_product_avl
|
||||
</sql>
|
||||
|
||||
<select id="selectGrBiStProductAvlList" parameterType="com.lideeyunji.core.framework.entity.GrBiStProductAvl" resultMap="GrBiStProductAvlResult">
|
||||
<include refid="selectGrBiStProductAvlVo"/>
|
||||
<where>
|
||||
<if test="ID != null "> and ID = #{ID}</if>
|
||||
<if test="GOODSID != null "> and GOODSID = #{GOODSID}</if>
|
||||
<if test="GOODSNAME != null and GOODSNAME != ''"> and GOODSNAME like concat('%', #{GOODSNAME}, '%')</if>
|
||||
<if test="GOODSTYPE != null and GOODSTYPE != ''"> and GOODSTYPE = #{GOODSTYPE}</if>
|
||||
<if test="GOODSUNIT != null and GOODSUNIT != ''"> and GOODSUNIT = #{GOODSUNIT}</if>
|
||||
<if test="PACKSIZE != null "> and PACKSIZE = #{PACKSIZE}</if>
|
||||
<if test="SORT != null "> and SORT = #{SORT}</if>
|
||||
<if test="SEMIREM != null "> and SEMIREM = #{SEMIREM}</if>
|
||||
<if test="TODAYIN != null and TODAYIN != ''"> and TODAYIN = #{TODAYIN}</if>
|
||||
<if test="REM != null "> and REM = #{REM}</if>
|
||||
<if test="THISMONTHOUT != null "> and THISMONTHOUT = #{THISMONTHOUT}</if>
|
||||
<if test="LASTMONTHOUT != null "> and LASTMONTHOUT = #{LASTMONTHOUT}</if>
|
||||
<if test="THISYEAROUT != null "> and THISYEAROUT = #{THISYEAROUT}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGrBiStProductAvlByID" parameterType="Long" resultMap="GrBiStProductAvlResult">
|
||||
<include refid="selectGrBiStProductAvlVo"/>
|
||||
where ID = #{ID}
|
||||
</select>
|
||||
|
||||
<insert id="insertGrBiStProductAvl" parameterType="com.lideeyunji.core.framework.entity.GrBiStProductAvl">
|
||||
insert into gr_bi_st_product_avl
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">ID,</if>
|
||||
<if test="GOODSID != null">GOODSID,</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME,</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE,</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT,</if>
|
||||
<if test="PACKSIZE != null">PACKSIZE,</if>
|
||||
<if test="SORT != null">SORT,</if>
|
||||
<if test="SEMIREM != null">SEMIREM,</if>
|
||||
<if test="TODAYIN != null">TODAYIN,</if>
|
||||
<if test="REM != null">REM,</if>
|
||||
<if test="THISMONTHOUT != null">THISMONTHOUT,</if>
|
||||
<if test="LASTMONTHOUT != null">LASTMONTHOUT,</if>
|
||||
<if test="THISYEAROUT != null">THISYEAROUT,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">#{ID},</if>
|
||||
<if test="GOODSID != null">#{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">#{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">#{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">#{GOODSUNIT},</if>
|
||||
<if test="PACKSIZE != null">#{PACKSIZE},</if>
|
||||
<if test="SORT != null">#{SORT},</if>
|
||||
<if test="SEMIREM != null">#{SEMIREM},</if>
|
||||
<if test="TODAYIN != null">#{TODAYIN},</if>
|
||||
<if test="REM != null">#{REM},</if>
|
||||
<if test="THISMONTHOUT != null">#{THISMONTHOUT},</if>
|
||||
<if test="LASTMONTHOUT != null">#{LASTMONTHOUT},</if>
|
||||
<if test="THISYEAROUT != null">#{THISYEAROUT},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGrBiStProductAvl" parameterType="com.lideeyunji.core.framework.entity.GrBiStProductAvl">
|
||||
update gr_bi_st_product_avl
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="GOODSID != null">GOODSID = #{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME = #{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE = #{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT = #{GOODSUNIT},</if>
|
||||
<if test="PACKSIZE != null">PACKSIZE = #{PACKSIZE},</if>
|
||||
<if test="SORT != null">SORT = #{SORT},</if>
|
||||
<if test="SEMIREM != null">SEMIREM = #{SEMIREM},</if>
|
||||
<if test="TODAYIN != null">TODAYIN = #{TODAYIN},</if>
|
||||
<if test="REM != null">REM = #{REM},</if>
|
||||
<if test="THISMONTHOUT != null">THISMONTHOUT = #{THISMONTHOUT},</if>
|
||||
<if test="LASTMONTHOUT != null">LASTMONTHOUT = #{LASTMONTHOUT},</if>
|
||||
<if test="THISYEAROUT != null">THISYEAROUT = #{THISYEAROUT},</if>
|
||||
</trim>
|
||||
where ID = #{ID}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGrBiStProductAvlByID" parameterType="Long">
|
||||
delete from gr_bi_st_product_avl where ID = #{ID}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGrBiStProductAvlByIDs" parameterType="String">
|
||||
delete from gr_bi_st_product_avl where ID in
|
||||
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||||
#{ID}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.GrBiStProductMapper">
|
||||
|
||||
<resultMap type="com.lideeyunji.core.framework.entity.GrBiStProduct" id="GrBiStProductResult">
|
||||
<result property="id" column="ID" />
|
||||
<result property="goodsId" column="GOODSID" />
|
||||
<result property="goodsName" column="GOODSNAME" />
|
||||
<result property="goodsType" column="GOODSTYPE" />
|
||||
<result property="goodsUnit" column="GOODSUNIT" />
|
||||
<result property="goodsClassId" column="GOODSCLASSID" />
|
||||
<result property="goodsClassName" column="GOODSCLASSNAME" />
|
||||
<result property="qty" column="QTY" />
|
||||
<result property="qtyProp" column="QTY_PROP" />
|
||||
<result property="money" column="MONEY" />
|
||||
<result property="moneyProp" column="MONEY_PROP" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGrBiStProductVo">
|
||||
select ID, GOODSID, GOODSNAME, GOODSTYPE, GOODSUNIT, GOODSCLASSID, GOODSCLASSNAME, QTY, QTY_PROP, MONEY, MONEY_PROP from gr_bi_st_product
|
||||
</sql>
|
||||
|
||||
<select id="selectGrBiStProductList" parameterType="com.lideeyunji.core.framework.entity.GrBiStProduct" resultMap="GrBiStProductResult">
|
||||
<include refid="selectGrBiStProductVo"/>
|
||||
<where>
|
||||
<if test="ID != null "> and ID = #{ID}</if>
|
||||
<if test="GOODSID != null "> and GOODSID = #{GOODSID}</if>
|
||||
<if test="GOODSNAME != null and GOODSNAME != ''"> and GOODSNAME like concat('%', #{GOODSNAME}, '%')</if>
|
||||
<if test="GOODSTYPE != null and GOODSTYPE != ''"> and GOODSTYPE = #{GOODSTYPE}</if>
|
||||
<if test="GOODSUNIT != null and GOODSUNIT != ''"> and GOODSUNIT = #{GOODSUNIT}</if>
|
||||
<if test="GOODSCLASSID != null "> and GOODSCLASSID = #{GOODSCLASSID}</if>
|
||||
<if test="GOODSCLASSNAME != null and GOODSCLASSNAME != ''"> and GOODSCLASSNAME like concat('%', #{GOODSCLASSNAME}, '%')</if>
|
||||
<if test="QTY != null "> and QTY = #{QTY}</if>
|
||||
<if test="qtyProp != null "> and QTY_PROP = #{qtyProp}</if>
|
||||
<if test="MONEY != null "> and MONEY = #{MONEY}</if>
|
||||
<if test="moneyProp != null "> and MONEY_PROP = #{moneyProp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGrBiStProductByID" parameterType="Long" resultMap="GrBiStProductResult">
|
||||
<include refid="selectGrBiStProductVo"/>
|
||||
where ID = #{ID}
|
||||
</select>
|
||||
|
||||
<insert id="insertGrBiStProduct" parameterType="com.lideeyunji.core.framework.entity.GrBiStProduct">
|
||||
insert into gr_bi_st_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">ID,</if>
|
||||
<if test="GOODSID != null">GOODSID,</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME,</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE,</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT,</if>
|
||||
<if test="GOODSCLASSID != null">GOODSCLASSID,</if>
|
||||
<if test="GOODSCLASSNAME != null">GOODSCLASSNAME,</if>
|
||||
<if test="QTY != null">QTY,</if>
|
||||
<if test="qtyProp != null">QTY_PROP,</if>
|
||||
<if test="MONEY != null">MONEY,</if>
|
||||
<if test="moneyProp != null">MONEY_PROP,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ID != null">#{ID},</if>
|
||||
<if test="GOODSID != null">#{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">#{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">#{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">#{GOODSUNIT},</if>
|
||||
<if test="GOODSCLASSID != null">#{GOODSCLASSID},</if>
|
||||
<if test="GOODSCLASSNAME != null">#{GOODSCLASSNAME},</if>
|
||||
<if test="QTY != null">#{QTY},</if>
|
||||
<if test="qtyProp != null">#{qtyProp},</if>
|
||||
<if test="MONEY != null">#{MONEY},</if>
|
||||
<if test="moneyProp != null">#{moneyProp},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGrBiStProduct" parameterType="com.lideeyunji.core.framework.entity.GrBiStProduct">
|
||||
update gr_bi_st_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="GOODSID != null">GOODSID = #{GOODSID},</if>
|
||||
<if test="GOODSNAME != null">GOODSNAME = #{GOODSNAME},</if>
|
||||
<if test="GOODSTYPE != null">GOODSTYPE = #{GOODSTYPE},</if>
|
||||
<if test="GOODSUNIT != null">GOODSUNIT = #{GOODSUNIT},</if>
|
||||
<if test="GOODSCLASSID != null">GOODSCLASSID = #{GOODSCLASSID},</if>
|
||||
<if test="GOODSCLASSNAME != null">GOODSCLASSNAME = #{GOODSCLASSNAME},</if>
|
||||
<if test="QTY != null">QTY = #{QTY},</if>
|
||||
<if test="qtyProp != null">QTY_PROP = #{qtyProp},</if>
|
||||
<if test="MONEY != null">MONEY = #{MONEY},</if>
|
||||
<if test="moneyProp != null">MONEY_PROP = #{moneyProp},</if>
|
||||
</trim>
|
||||
where ID = #{ID}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGrBiStProductByID" parameterType="Long">
|
||||
delete from gr_bi_st_product where ID = #{ID}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGrBiStProductByIDs" parameterType="String">
|
||||
delete from gr_bi_st_product where ID in
|
||||
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||||
#{ID}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -85,6 +85,15 @@ public class AuthController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/logout-client")
|
||||
@PermitAll
|
||||
@Operation(tags = "授权管理",summary = "登出系统")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<Boolean> logoutClient(@RequestParam("refreshToken") String refreshToken) {
|
||||
logoutService(refreshToken);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/switch-login")
|
||||
@Operation(tags = "授权管理",summary = "切换部门登录")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
@@ -164,7 +173,9 @@ public class AuthController {
|
||||
@Parameter(name = "refreshToken", description = "根据token获取用户信息", required = true)
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AdminUserDO> getUerInfo(@RequestParam("refreshToken") String refreshToken) {
|
||||
return success(authService.getTokenTouserInfo(refreshToken));
|
||||
|
||||
CommonResult<AdminUserDO> result = CommonResult.success(authService.getTokenTouserInfo(refreshToken));
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/get-permission-info")
|
||||
@@ -291,7 +302,23 @@ public class AuthController {
|
||||
authService.logout(token, LoginLogTypeEnum.LOGOUT_SELF.getType());
|
||||
}
|
||||
//清空个人信息
|
||||
String userRedisKey="JEE_LOW_CODE:USER:"+loginUserId+":*";
|
||||
String userRedisKey="LIDEE_LOW_CODE:USER:"+loginUserId+":*";
|
||||
Set<String> keys = stringRedisTemplate.keys(userRedisKey);
|
||||
if(keys!=null && keys.size()>0){
|
||||
keys.forEach(key->{
|
||||
stringRedisTemplate.delete(key);
|
||||
});
|
||||
}
|
||||
}
|
||||
private void logoutService(String token){
|
||||
AdminUserDO user = authService.getTokenTouserInfo(token);
|
||||
Long loginUserId = user.getId();
|
||||
|
||||
if (StrUtil.isNotBlank(token)) {
|
||||
authService.logout(token, LoginLogTypeEnum.LOGOUT_SELF.getType());
|
||||
}
|
||||
//清空个人信息
|
||||
String userRedisKey="LIDEE_LOW_CODE:USER:"+loginUserId+":*";
|
||||
Set<String> keys = stringRedisTemplate.keys(userRedisKey);
|
||||
if(keys!=null && keys.size()>0){
|
||||
keys.forEach(key->{
|
||||
|
||||
@@ -100,7 +100,7 @@ public class LideeYunJiPermissionServiceImpl implements ILideeYunJiPermissionSer
|
||||
}
|
||||
//根据角色id来判断我是否是开发者,如果有开发者,则说明直接可以访问
|
||||
boolean devUserFlag=false;
|
||||
String isDevUserRedisKey="JEE_LOW_CODE:USER:"+userId+":DEVUSER";
|
||||
String isDevUserRedisKey="LIDEE_LOW_CODE:USER:"+userId+":DEVUSER";
|
||||
if(!stringRedisTemplate.hasKey(isDevUserRedisKey)){//没有数据,则查询获取 TODO 优化
|
||||
//所有菜单列表
|
||||
Set<Long> menuIdList = permissionService.getRoleMenuListByRoleId(roleIds);
|
||||
|
||||
@@ -85,6 +85,8 @@ public class OAuth2TokenServiceImpl implements IOAuth2TokenService {
|
||||
// 获得用户基本信息
|
||||
OAuth2AccessTokenDO accessTokenDO= oauth2AccessTokenMapper.selectByAccessToken(refreshToken);
|
||||
AdminUserDO user = adminUserService.getUser(accessTokenDO.getUserId());
|
||||
user.setPassword("");
|
||||
user.setEmail("");
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,18 @@
|
||||
<artifactId>lidee-tool</artifactId>
|
||||
<version>${lidee.version}</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>10</source>
|
||||
<target>10</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>tool-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -10,8 +10,12 @@ import org.springframework.web.util.UriComponents;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -21,6 +25,9 @@ import java.util.Map;
|
||||
*/
|
||||
public class HttpUtils {
|
||||
|
||||
private static final int CONNECT_TIMEOUT = 5000; // 连接超时(毫秒)
|
||||
private static final int READ_TIMEOUT = 10000; // 读取超时(毫秒)
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static String replaceUrlQuery(String url, String key, String value) {
|
||||
UrlBuilder builder = UrlBuilder.of(url, Charset.defaultCharset());
|
||||
@@ -122,5 +129,203 @@ public class HttpUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 HTTP GET 请求
|
||||
*
|
||||
* @param urlStr 请求地址
|
||||
* @param headers 请求头(可为 null)
|
||||
* @return 响应字符串
|
||||
*/
|
||||
public static String doGet(String urlStr, Map<String, String> headers) throws IOException {
|
||||
HttpURLConnection conn = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(urlStr);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
conn.setConnectTimeout(CONNECT_TIMEOUT);
|
||||
conn.setReadTimeout(READ_TIMEOUT);
|
||||
conn.setDoInput(true);
|
||||
|
||||
// 设置请求头
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
conn.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
reader = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
|
||||
StringBuilder result = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
return result.toString();
|
||||
} else {
|
||||
throw new IOException("GET request failed, response code: " + responseCode);
|
||||
}
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (conn != null) {
|
||||
conn.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 HTTP POST 请求(application/x-www-form-urlencoded)
|
||||
*
|
||||
* @param urlStr 请求地址
|
||||
* @param params 表单参数(可为 null)
|
||||
* @param headers 请求头(可为 null)
|
||||
* @return 响应字符串
|
||||
*/
|
||||
public static String doPost(String urlStr, Map<String, String> params, Map<String, String> headers)
|
||||
throws IOException {
|
||||
HttpURLConnection conn = null;
|
||||
BufferedWriter writer = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(urlStr);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setConnectTimeout(CONNECT_TIMEOUT);
|
||||
conn.setReadTimeout(READ_TIMEOUT);
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
|
||||
// 设置请求头
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
conn.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// 写入表单参数
|
||||
if (params != null && !params.isEmpty()) {
|
||||
StringBuilder paramStr = new StringBuilder();
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
if (paramStr.length() > 0) {
|
||||
paramStr.append("&");
|
||||
}
|
||||
paramStr.append(entry.getKey())
|
||||
.append("=")
|
||||
.append(java.net.URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8));
|
||||
}
|
||||
writer = new BufferedWriter(
|
||||
new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8));
|
||||
writer.write(paramStr.toString());
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
reader = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
|
||||
StringBuilder result = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
return result.toString();
|
||||
} else {
|
||||
throw new IOException("POST request failed, response code: " + responseCode);
|
||||
}
|
||||
} finally {
|
||||
if (writer != null) {
|
||||
try {
|
||||
writer.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (conn != null) {
|
||||
conn.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 JSON 格式的 POST 请求
|
||||
*
|
||||
* @param urlStr 请求地址
|
||||
* @param json 请求体 JSON 字符串
|
||||
* @param headers 请求头(可为 null)
|
||||
* @return 响应字符串
|
||||
*/
|
||||
public static String doPostJson(String urlStr, String json, Map<String, String> headers)
|
||||
throws IOException {
|
||||
HttpURLConnection conn = null;
|
||||
BufferedWriter writer = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(urlStr);
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setConnectTimeout(CONNECT_TIMEOUT);
|
||||
conn.setReadTimeout(READ_TIMEOUT);
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
|
||||
// 设置默认 Content-Type
|
||||
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
|
||||
// 设置自定义请求头
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
conn.setRequestProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// 写入 JSON 请求体
|
||||
writer = new BufferedWriter(
|
||||
new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8));
|
||||
writer.write(json);
|
||||
writer.flush();
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
reader = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
|
||||
StringBuilder result = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
return result.toString();
|
||||
} else {
|
||||
throw new IOException("POST JSON request failed, response code: " + responseCode);
|
||||
}
|
||||
} finally {
|
||||
if (writer != null) {
|
||||
try {
|
||||
writer.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (conn != null) {
|
||||
conn.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ package com.lideeyunji.tool.framework.yunji.constant;
|
||||
public interface lideeRedisConstants {
|
||||
|
||||
//低代码
|
||||
String lideeyunji_PREFIX = "JEE_LOW_CODE:";
|
||||
String lideeyunji_PREFIX = "LIDEE_LOW_CODE:";
|
||||
|
||||
//js增强加锁
|
||||
String ENHANCE_JS_LOCK = "LOCK_JS:%s";
|
||||
|
||||
Reference in New Issue
Block a user