提交 68c1c1d3 authored 作者: 000516's avatar 000516 提交者: Coding

axmr005战区数据同步飞书表格 (日数据)

axmr005战区数据同步飞书表格 (日数据)
...@@ -14,7 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -14,7 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomConfig @EnableCustomConfig
@EnableRyFeignClients @EnableRyFeignClients
@SpringBootApplication @SpringBootApplication
@MapperScan({"com.sfa.job.domain.job.mapper","com.sfa.job.domain.system.mapper","com.sfa.job.domain.order.mapper"}) @MapperScan({"com.sfa.job.domain.job.mapper","com.sfa.job.domain.system.mapper","com.sfa.job.domain.order.mapper","com.sfa.job.domain.erp.mapper","com.sfa.job.domain.use.mapper"})
public class SfaJobApplication public class SfaJobApplication
{ {
public static void main(String[] args) { public static void main(String[] args) {
......
package com.sfa.job.domain.erp.dao;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-04-08 13
* @describe :
*/
public interface ErpAxmr005ShippingDetailsDao {
List<Object> getZhanquDataset(Date date);
}
package com.sfa.job.domain.erp.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.sfa.common.core.utils.DateUtils;
import com.sfa.job.domain.erp.entity.ErpAxmr005ShippingDetails;
import com.sfa.job.domain.erp.mapper.ErpAxmr005ShippingDetailsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-04-08 13
* @describe :
*/
@DS("bi")
@Service
public class ErpAxmr005ShippingDetailsDaoImpl implements ErpAxmr005ShippingDetailsDao{
@Autowired
private ErpAxmr005ShippingDetailsMapper erpAxmr005ShippingDetailsMapper;
@Override
public List<Object> getZhanquDataset(Date date) {
List<ErpAxmr005ShippingDetails> zhanquDataset = erpAxmr005ShippingDetailsMapper.getZhanquDataset(date);
List<Object> os = new ArrayList<>();
long millis = System.currentTimeMillis();
String dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
for (ErpAxmr005ShippingDetails erpDo : zhanquDataset) {
List<Object> data = new ArrayList<>();
data.add(millis+"_"+erpDo.getId());
data.add(erpDo.getShippingOrderNumber());
data.add(dateStr);
data.add(erpDo.getSalesDepartmentAbbr());
data.add(erpDo.getReceivingCustomerAbbr());
data.add(erpDo.getProductName());
data.add(erpDo.getQuantity());
data.add(erpDo.getThirdPartySystemCode());
os.add(data);
}
return os;
}
}
package com.sfa.job.domain.erp.entity;
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;
import java.util.Date;
/**
* erp_axmr005出货明细表
* @TableName erp_axmr005_shipping_details
*/
@TableName(value ="erp_axmr005_shipping_details")
@Data
public class ErpAxmr005ShippingDetails implements Serializable {
@TableField(exist = false)
private Integer id;
/**
* 出货单号
*/
@TableId
private String shippingOrderNumber;
/**
* 项次
*/
private Integer itemSequence;
/**
* 营运据点
*/
private String operatingSite;
/**
* 单据日期
*/
private Date documentDate;
/**
* 扣账日期
*/
private Date debitDate;
/**
* 起运日期
*/
private Date shippingDate;
/**
* 出货性质
*/
private String shippingNature;
/**
* 状态
*/
private String status;
/**
* 销退方式
*/
private String salesReturnMethod;
/**
* 业务人员
*/
private String salesStaff;
/**
* 业务人员姓名
*/
private String salesStaffName;
/**
* 业务部门
*/
private String salesDepartment;
/**
* 业务部门简称
*/
private String salesDepartmentAbbr;
/**
* 订单客户
*/
private String orderCustomer;
/**
* 客户简称
*/
private String customerAbbr;
/**
* 收货客户
*/
private String receivingCustomer;
/**
* 收货客户简称
*/
private String receivingCustomerAbbr;
/**
* 收款客户
*/
private String paymentCustomer;
/**
* 收款客户简称
*/
private String paymentCustomerAbbr;
/**
* 国家
*/
private String country;
/**
* 国家说明
*/
private String countryDescription;
/**
* 省
*/
private String province;
/**
* 省份说明
*/
private String provinceDescription;
/**
* 县/市
*/
private String countyCity;
/**
* 县/市说明
*/
private String countyCityDescription;
/**
* 行政区域
*/
private String administrativeRegion;
/**
* 行政区域说明
*/
private String administrativeRegionDescription;
/**
* 送货地址
*/
private String deliveryAddress;
/**
* 地址
*/
private String address;
/**
* 运输方式
*/
private String transportationMethod;
/**
* 运输方式说明
*/
private String transportationMethodDescription;
/**
* 快递单号
*/
private String expressNumber;
/**
* 订单单号
*/
private String orderNumber;
/**
* 项次
*/
private Integer itemSequenceAgain;
/**
* 订单状态
*/
private String orderStatus;
/**
* 项序
*/
private Integer itemOrder;
/**
* 分批序
*/
private Integer batchSequence;
/**
* 客户订购单号
*/
private String customerOrderNumber;
/**
* 客户料号
*/
private String customerMaterialNumber;
/**
* 客户料号品名
*/
private String customerMaterialName;
/**
* 客户料号规格
*/
private String customerMaterialSpecification;
/**
* 子件特性
*/
private String subPartFeature;
/**
* 产品分类
*/
private String productCategory;
/**
* 产品分类说明
*/
private String productCategoryDescription;
/**
* 销售分群
*/
private String salesGroup;
/**
* 销售分群说明
*/
private String salesGroupDescription;
/**
* 料件编号
*/
private String materialNumber;
/**
* 品名
*/
private String productName;
/**
* 规格
*/
private String productSpecification;
/**
* 品牌
*/
private String brand;
/**
* 克重
*/
private BigDecimal weightGram;
/**
* 口味说明
*/
private String tasteDescription;
/**
* 克重
*/
private String weightGramAgain;
/**
* 克重说明
*/
private String weightGramDescription;
/**
* 产品特征
*/
private String productFeature;
/**
* 产品特征说明
*/
private String productFeatureDescription;
/**
* 数量
*/
private Integer quantity;
/**
* 出货单位
*/
private String shippingUnit;
/**
* 已验收数量
*/
private Integer acceptedQuantity;
/**
* 已签退量
*/
private Integer signedBackQuantity;
/**
* 未签收量
*/
private Integer unsignedQuantity;
/**
* 库位
*/
private String storageLocation;
/**
* 库位名称
*/
private String storageLocationName;
/**
* 储位
*/
private String storagePosition;
/**
* 储位名称
*/
private String storagePositionName;
/**
* 批号
*/
private String batchNumber;
/**
* 库存管理特征
*/
private String inventoryManagementFeature;
/**
* 备注
*/
private String remarks;
/**
* 单价
*/
private BigDecimal unitPrice;
/**
* 含税金额
*/
private BigDecimal amountWithTax;
/**
* 税额
*/
private BigDecimal taxAmount;
/**
* 币种
*/
private String currency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/**
* 本币税前金额
*/
private BigDecimal localPreTaxAmount;
/**
* 本币含税金额
*/
private BigDecimal localAmountWithTax;
/**
* 本币税额
*/
private BigDecimal localTaxAmount;
/**
* 折扣金额
*/
private BigDecimal discountAmount;
/**
* 折扣金额(开票)
*/
private BigDecimal discountAmountInvoice;
/**
* 多角序号
*/
private String multiAngleSequenceNumber;
/**
* 客户分类
*/
private String customerCategory;
/**
* 客户分类说明
*/
private String customerCategoryDescription;
/**
* 销售渠道
*/
private String salesChannel;
/**
* 销售渠道说明
*/
private String salesChannelDescription;
/**
* 订单类型
*/
private String orderType;
/**
* 类型说明
*/
private String typeDescription;
/**
* 备注
*/
private String remarksAgain;
/**
* 物流备注
*/
private String logisticsRemarks;
/**
* 第三方系统标识码
*/
private String thirdPartySystemCode;
/**
* 资料录入日期
*/
private Date dataEntryDate;
/**
* 打款类型说明
*/
private String paymentTypeDescription;
/**
* 订单拆单状态
*/
private String orderSplitStatus;
/**
* 基础单位
*/
private String baseUnit;
/**
* 订单基础单位数量
*/
private Integer orderBaseUnitQuantity;
/**
* 标准成本
*/
private BigDecimal standardCost;
/**
* 实际成本
*/
private BigDecimal actualCost;
/**
* 采集批次
*/
private String collectionBatch;
/**
* 采集时间
*/
private Date collectionTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.sfa.job.domain.erp.mapper;
import com.sfa.job.domain.erp.entity.ErpAxmr005ShippingDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* @author a02200059
* @description 针对表【erp_axmr005_shipping_details(erp_axmr005出货明细表)】的数据库操作Mapper
* @createDate 2025-04-08 13:10:15
* @Entity com.sfa.job.domain.erp.entity.ErpAxmr005ShippingDetails
*/
@Repository
public interface ErpAxmr005ShippingDetailsMapper extends BaseMapper<ErpAxmr005ShippingDetails> {
List<ErpAxmr005ShippingDetails> getZhanquDataset(Date date);
}
package com.sfa.job.domain.use.dao;
import com.sfa.job.pojo.response.FeishuSheetRecordDto;
/**
* @author : liqiulin
* @date : 2025-04-08 17
* @describe :
*/
public interface FeishuSheetRecordDao {
FeishuSheetRecordDto selectOne(Integer type, String createMonth);
}
package com.sfa.job.domain.use.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.sfa.common.core.utils.bean.BeanUtils;
import com.sfa.job.domain.use.entity.FeishuSheetRecord;
import com.sfa.job.domain.use.mapper.FeishuSheetRecordMapper;
import com.sfa.job.pojo.response.FeishuSheetRecordDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author : liqiulin
* @date : 2025-04-08 17
* @describe :
*/
@DS("bi")
@Service
public class FeishuSheetRecordDaoImpl implements FeishuSheetRecordDao{
@Autowired
private FeishuSheetRecordMapper feishuSheetRecordMapper;
@Override
public FeishuSheetRecordDto selectOne(Integer type, String createMonth) {
FeishuSheetRecord feishuSheetRecord = feishuSheetRecordMapper.findOne(type, createMonth);
return BeanUtils.transitionDto(feishuSheetRecord, FeishuSheetRecordDto.class);
}
}
package com.sfa.job.domain.use.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 java.io.Serializable;
import lombok.Data;
/**
* 推广图片推送至飞书电子表格-分月表
* @TableName feishu_sheet_record
*/
@TableName(value ="feishu_sheet_record")
@Data
public class FeishuSheetRecord implements Serializable {
/**
* 主键id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 电子表格token
*/
private String sheetToken;
/**
* 工作表id
*/
private String sheetId;
/**
* 创建月份
*/
private String createMonth;
/**
* 1:axmr005_战区(每天);2:axmr005_战区(每月);
*/
private Integer type;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.sfa.job.domain.use.mapper;
import com.sfa.job.domain.use.entity.FeishuSheetRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* @author a02200059
* @description 针对表【feishu_sheet_record(推广图片推送至飞书电子表格-分月表)】的数据库操作Mapper
* @createDate 2025-04-08 17:07:31
* @Entity com.sfa.job.xxljob.use.entity.FeishuSheetRecord
*/
@Repository
public interface FeishuSheetRecordMapper extends BaseMapper<FeishuSheetRecord> {
FeishuSheetRecord findOne(@Param("type") Integer type,@Param("createMonth") String createMonth);
}
package com.sfa.job.enums;
import lombok.Getter;
/**
* @author : liqiulin
* @date : 2025-04-08 18
* @describe :
*/
@Getter
public enum FSRecordEnum {
/**
* 1:axmr005_战区(每天)
*/
AXMR005_1(1),
AXMR005_2(2),
;
private Integer type;
FSRecordEnum(Integer type) {
this.type = type;
}
}
package com.sfa.job.pojo.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author : liqiulin
* @date : 2025-04-08 17
* @describe :
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class FeishuSheetRecordDto {
/**
* 主键id
*/
private Integer id;
/**
* 电子表格token
*/
private String sheetToken;
/**
* 工作表id
*/
private String sheetId;
/**
* 创建月份
*/
private String createMonth;
/**
* 1:axmr005_战区(每天);2:axmr005_战区(每月);
*/
private Integer type;
}
package com.sfa.job.service.erp;
import java.util.Date;
/**
* @author : liqiulin
* @date : 2025-04-08 13
* @describe :
*/
public interface ErpAxmr005Service {
void axmr005ZQToFS(Date debitDate,Integer type);
}
package com.sfa.job.service.erp.impl;
import com.alibaba.fastjson2.JSONObject;
import com.sfa.common.core.utils.DateUtils;
import com.sfa.job.domain.erp.dao.ErpAxmr005ShippingDetailsDao;
import com.sfa.job.pojo.response.FeishuSheetRecordDto;
import com.sfa.job.service.erp.ErpAxmr005Service;
import com.sfa.job.util.FeiShuUtil;
import com.sfa.job.domain.use.dao.FeishuSheetRecordDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-04-08 13
* @describe :
*/
@Service
public class ErpAxmr005ServiceImpl implements ErpAxmr005Service {
@Autowired
private ErpAxmr005ShippingDetailsDao erpAxmr005ShippingDetailsDao;
@Autowired
private FeishuSheetRecordDao feishuSheetRecordDao;
@Autowired
private FeiShuUtil feiShuUtil;
@Override
public void axmr005ZQToFS(Date debitDate,Integer type) {
List<Object> zhanquDataset = erpAxmr005ShippingDetailsDao.getZhanquDataset(debitDate);
FeishuSheetRecordDto recordDto = feishuSheetRecordDao.selectOne(type, DateUtils.parseDateToStr(DateUtils.YYYY_MM, debitDate));
/**
* 将结果推送到飞书表格,每次推100条
*/
String range = recordDto.getSheetId() + "!A:H";
JSONObject botToken1 = feiShuUtil.getBotToken1();
int batchSize = 100;
for (int i = 0; i < zhanquDataset.size(); i+=batchSize) {
// 计算当前批次的结束位置
int end = Math.min(i + batchSize, zhanquDataset.size());
System.out.println(end);
List<Object> batch = zhanquDataset.subList(i, end);
feiShuUtil.pushSetToSheet(range,batch,recordDto.getSheetToken(),botToken1.getString("tenant_access_token"));
}
}
}
package com.sfa.job.util; package com.sfa.job.util;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
...@@ -16,6 +17,11 @@ import lombok.extern.slf4j.Slf4j; ...@@ -16,6 +17,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-12-06 16 * @date : 2024-12-06 16
...@@ -30,6 +36,20 @@ public class FeiShuUtil { ...@@ -30,6 +36,20 @@ public class FeiShuUtil {
@Value("${feishu.luzx.app_secret}") @Value("${feishu.luzx.app_secret}")
private String appSecret; private String appSecret;
@Value("${feishu.bot_1.app_id}")
private String botAppId1;
@Value("${feishu.bot_1.app_secret}")
private String botAppSecret1;
private static final String CONTENT_TYPE = "application/json; charset=utf-8";
private static final String SHEET_URL = "https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/";
private static final String TENANT_ACCESS_TOKEN_URL = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal";
private static final String VALUES_APPEND = "/values_append";
private static final String VALUES_IMAGE = "/values_image";
private static final String VALUES = "/values";
/** /**
* 根据部门父编码获取子部门 * 根据部门父编码获取子部门
* 公司编码:"0" * 公司编码:"0"
...@@ -56,6 +76,9 @@ public class FeiShuUtil { ...@@ -56,6 +76,9 @@ public class FeiShuUtil {
return null; return null;
} }
/**
* 获取部门用户
*/
public JSONArray getUsersByDeptId(String deptCode) { public JSONArray getUsersByDeptId(String deptCode) {
try { try {
Client client = getClient(); Client client = getClient();
...@@ -82,4 +105,44 @@ public class FeiShuUtil { ...@@ -82,4 +105,44 @@ public class FeiShuUtil {
private Client getClient() { private Client getClient() {
return Client.newBuilder(appId, appSecret).build(); return Client.newBuilder(appId, appSecret).build();
} }
public Integer pushSetToSheet(String range, List<Object> datas, String sheetToken, String autoToken) {
// 组装参数
Map<String, Map<String, Object>> bodyMap = new HashMap<>();
Map<String, Object> valueRange = new HashMap<>();
valueRange.put("range", range);
valueRange.put("values", datas);
bodyMap.put("valueRange", valueRange);
String bodyJson = JSONObject.toJSONString(bodyMap);
// body上传
String result = HttpUtil.createPost(SHEET_URL + sheetToken + VALUES_APPEND)
.auth("Bearer " + autoToken).contentType(CONTENT_TYPE)
.body(bodyJson)
.execute().body();
// 上传结果判断
JSONObject resultJson = JSONObject.parseObject(result);
return resultJson.getInteger("code");
}
public JSONObject getBotToken1() {
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("app_id", botAppId1);
bodyMap.put("app_secret", botAppSecret1);
String bodyJson = JSONObject.toJSONString(bodyMap);
String result = HttpUtil.createPost(TENANT_ACCESS_TOKEN_URL)
.contentType(CONTENT_TYPE)
.body(bodyJson)
.execute().body();
JSONObject resultJson = JSONObject.parseObject(result);
int code = resultJson.getInteger("code");
if (code != 0) {
throw new RuntimeException("获取tenant_access_token错误");
}
return resultJson;
}
} }
package com.sfa.job.xxljob.erp;
import com.sfa.common.core.utils.DateUtils;
import com.sfa.job.enums.FSRecordEnum;
import com.sfa.job.service.erp.ErpAxmr005Service;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* @author : liqiulin
* @date : 2025-04-08 13
* @describe :
*/
@Component
@Slf4j
public class shippingTask {
@Autowired
private ErpAxmr005Service erpAxmr005Service;
/**
* 同步axmr005中t-1的数据到飞书表格
* 只同步线下战区数据、部分字段
*/
@XxlJob("axmr005_zhanqu_days")
public void axmr005ZQByDays() {
Date date = DateUtils.addDays(new Date(), -1);
Integer type = FSRecordEnum.AXMR005_1.getType();
axmr005ZQToFSByDate(date,type);
}
@XxlJob("axmr005_zhanqu_month")
public void axmr005ZQByMonth() {
Date date = DateUtils.addDays(new Date(), -4);
Integer type = FSRecordEnum.AXMR005_2.getType();
axmr005ZQToFSByDate(date,type);
}
private void axmr005ZQToFSByDate(Date date,Integer type) {
erpAxmr005Service.axmr005ZQToFS(date,type);
}
}
...@@ -29,7 +29,7 @@ public class FinanceOrderTask { ...@@ -29,7 +29,7 @@ public class FinanceOrderTask {
FinanceOrderSyncService financeOrderSyncService; FinanceOrderSyncService financeOrderSyncService;
/** /**
* 同步部门数据 * 同步财务订单数据
*/ */
@XxlJob("syncWangdiantongOrderDetail") @XxlJob("syncWangdiantongOrderDetail")
public SyncOrderDetailDto syncWangdiantongOrderDetail() { public SyncOrderDetailDto syncWangdiantongOrderDetail() {
......
<?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.sfa.job.domain.erp.mapper.ErpAxmr005ShippingDetailsMapper">
<resultMap id="BaseResultMap" type="com.sfa.job.domain.erp.entity.ErpAxmr005ShippingDetails">
<id property="shippingOrderNumber" column="shipping_order_number" jdbcType="VARCHAR"/>
<result property="itemSequence" column="item_sequence" jdbcType="INTEGER"/>
<result property="operatingSite" column="operating_site" jdbcType="VARCHAR"/>
<result property="documentDate" column="document_date" jdbcType="DATE"/>
<result property="debitDate" column="debit_date" jdbcType="DATE"/>
<result property="shippingDate" column="shipping_date" jdbcType="DATE"/>
<result property="shippingNature" column="shipping_nature" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="salesReturnMethod" column="sales_return_method" jdbcType="VARCHAR"/>
<result property="salesStaff" column="sales_staff" jdbcType="VARCHAR"/>
<result property="salesStaffName" column="sales_staff_name" jdbcType="VARCHAR"/>
<result property="salesDepartment" column="sales_department" jdbcType="VARCHAR"/>
<result property="salesDepartmentAbbr" column="sales_department_abbr" jdbcType="VARCHAR"/>
<result property="orderCustomer" column="order_customer" jdbcType="VARCHAR"/>
<result property="customerAbbr" column="customer_abbr" jdbcType="VARCHAR"/>
<result property="receivingCustomer" column="receiving_customer" jdbcType="VARCHAR"/>
<result property="receivingCustomerAbbr" column="receiving_customer_abbr" jdbcType="VARCHAR"/>
<result property="paymentCustomer" column="payment_customer" jdbcType="VARCHAR"/>
<result property="paymentCustomerAbbr" column="payment_customer_abbr" jdbcType="VARCHAR"/>
<result property="country" column="country" jdbcType="VARCHAR"/>
<result property="countryDescription" column="country_description" jdbcType="VARCHAR"/>
<result property="province" column="province" jdbcType="VARCHAR"/>
<result property="provinceDescription" column="province_description" jdbcType="VARCHAR"/>
<result property="countyCity" column="county_city" jdbcType="VARCHAR"/>
<result property="countyCityDescription" column="county_city_description" jdbcType="VARCHAR"/>
<result property="administrativeRegion" column="administrative_region" jdbcType="VARCHAR"/>
<result property="administrativeRegionDescription" column="administrative_region_description" jdbcType="VARCHAR"/>
<result property="deliveryAddress" column="delivery_address" jdbcType="VARCHAR"/>
<result property="address" column="address" jdbcType="VARCHAR"/>
<result property="transportationMethod" column="transportation_method" jdbcType="VARCHAR"/>
<result property="transportationMethodDescription" column="transportation_method_description" jdbcType="VARCHAR"/>
<result property="expressNumber" column="express_number" jdbcType="VARCHAR"/>
<result property="orderNumber" column="order_number" jdbcType="VARCHAR"/>
<result property="itemSequenceAgain" column="item_sequence_again" jdbcType="INTEGER"/>
<result property="orderStatus" column="order_status" jdbcType="VARCHAR"/>
<result property="itemOrder" column="item_order" jdbcType="INTEGER"/>
<result property="batchSequence" column="batch_sequence" jdbcType="INTEGER"/>
<result property="customerOrderNumber" column="customer_order_number" jdbcType="VARCHAR"/>
<result property="customerMaterialNumber" column="customer_material_number" jdbcType="VARCHAR"/>
<result property="customerMaterialName" column="customer_material_name" jdbcType="VARCHAR"/>
<result property="customerMaterialSpecification" column="customer_material_specification" jdbcType="VARCHAR"/>
<result property="subPartFeature" column="sub_part_feature" jdbcType="VARCHAR"/>
<result property="productCategory" column="product_category" jdbcType="VARCHAR"/>
<result property="productCategoryDescription" column="product_category_description" jdbcType="VARCHAR"/>
<result property="salesGroup" column="sales_group" jdbcType="VARCHAR"/>
<result property="salesGroupDescription" column="sales_group_description" jdbcType="VARCHAR"/>
<result property="materialNumber" column="material_number" jdbcType="VARCHAR"/>
<result property="productName" column="product_name" jdbcType="VARCHAR"/>
<result property="productSpecification" column="product_specification" jdbcType="VARCHAR"/>
<result property="brand" column="brand" jdbcType="VARCHAR"/>
<result property="weightGram" column="weight_gram" jdbcType="DECIMAL"/>
<result property="tasteDescription" column="taste_description" jdbcType="VARCHAR"/>
<result property="weightGramAgain" column="weight_gram_again" jdbcType="VARCHAR"/>
<result property="weightGramDescription" column="weight_gram_description" jdbcType="VARCHAR"/>
<result property="productFeature" column="product_feature" jdbcType="VARCHAR"/>
<result property="productFeatureDescription" column="product_feature_description" jdbcType="VARCHAR"/>
<result property="quantity" column="quantity" jdbcType="INTEGER"/>
<result property="shippingUnit" column="shipping_unit" jdbcType="VARCHAR"/>
<result property="acceptedQuantity" column="accepted_quantity" jdbcType="INTEGER"/>
<result property="signedBackQuantity" column="signed_back_quantity" jdbcType="INTEGER"/>
<result property="unsignedQuantity" column="unsigned_quantity" jdbcType="INTEGER"/>
<result property="storageLocation" column="storage_location" jdbcType="VARCHAR"/>
<result property="storageLocationName" column="storage_location_name" jdbcType="VARCHAR"/>
<result property="storagePosition" column="storage_position" jdbcType="VARCHAR"/>
<result property="storagePositionName" column="storage_position_name" jdbcType="VARCHAR"/>
<result property="batchNumber" column="batch_number" jdbcType="VARCHAR"/>
<result property="inventoryManagementFeature" column="inventory_management_feature" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="unitPrice" column="unit_price" jdbcType="DECIMAL"/>
<result property="amountWithTax" column="amount_with_tax" jdbcType="DECIMAL"/>
<result property="taxAmount" column="tax_amount" jdbcType="DECIMAL"/>
<result property="currency" column="currency" jdbcType="VARCHAR"/>
<result property="exchangeRate" column="exchange_rate" jdbcType="DECIMAL"/>
<result property="localPreTaxAmount" column="local_pre_tax_amount" jdbcType="DECIMAL"/>
<result property="localAmountWithTax" column="local_amount_with_tax" jdbcType="DECIMAL"/>
<result property="localTaxAmount" column="local_tax_amount" jdbcType="DECIMAL"/>
<result property="discountAmount" column="discount_amount" jdbcType="DECIMAL"/>
<result property="discountAmountInvoice" column="discount_amount_invoice" jdbcType="DECIMAL"/>
<result property="multiAngleSequenceNumber" column="multi_angle_sequence_number" jdbcType="VARCHAR"/>
<result property="customerCategory" column="customer_category" jdbcType="VARCHAR"/>
<result property="customerCategoryDescription" column="customer_category_description" jdbcType="VARCHAR"/>
<result property="salesChannel" column="sales_channel" jdbcType="VARCHAR"/>
<result property="salesChannelDescription" column="sales_channel_description" jdbcType="VARCHAR"/>
<result property="orderType" column="order_type" jdbcType="VARCHAR"/>
<result property="typeDescription" column="type_description" jdbcType="VARCHAR"/>
<result property="remarksAgain" column="remarks_again" jdbcType="VARCHAR"/>
<result property="logisticsRemarks" column="logistics_remarks" jdbcType="VARCHAR"/>
<result property="thirdPartySystemCode" column="third_party_system_code" jdbcType="VARCHAR"/>
<result property="dataEntryDate" column="data_entry_date" jdbcType="DATE"/>
<result property="paymentTypeDescription" column="payment_type_description" jdbcType="VARCHAR"/>
<result property="orderSplitStatus" column="order_split_status" jdbcType="VARCHAR"/>
<result property="baseUnit" column="base_unit" jdbcType="VARCHAR"/>
<result property="orderBaseUnitQuantity" column="order_base_unit_quantity" jdbcType="INTEGER"/>
<result property="standardCost" column="standard_cost" jdbcType="DECIMAL"/>
<result property="actualCost" column="actual_cost" jdbcType="DECIMAL"/>
<result property="collectionBatch" column="collection_batch" jdbcType="VARCHAR"/>
<result property="collectionTime" column="collection_time" jdbcType="TIMESTAMP"/>
</resultMap>
<resultMap id="ZhanquMap" type="com.sfa.job.domain.erp.entity.ErpAxmr005ShippingDetails">
<id property="shippingOrderNumber" column="shipping_order_number" jdbcType="VARCHAR"/>
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="debitDate" column="debit_date" jdbcType="DATE"/>
<result property="salesDepartmentAbbr" column="sales_department_abbr" jdbcType="VARCHAR"/>
<result property="receivingCustomerAbbr" column="receiving_customer_abbr" jdbcType="VARCHAR"/>
<result property="productName" column="product_name" jdbcType="VARCHAR"/>
<result property="quantity" column="quantity" jdbcType="INTEGER"/>
<result property="shippingUnit" column="shipping_unit" jdbcType="VARCHAR"/>
<result property="thirdPartySystemCode" column="third_party_system_code" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
shipping_order_number,item_sequence,operating_site,
document_date,debit_date,shipping_date,
shipping_nature,status,sales_return_method,
sales_staff,sales_staff_name,sales_department,
sales_department_abbr,order_customer,customer_abbr,
receiving_customer,receiving_customer_abbr,payment_customer,
payment_customer_abbr,country,country_description,
province,province_description,county_city,
county_city_description,administrative_region,administrative_region_description,
delivery_address,address,transportation_method,
transportation_method_description,express_number,order_number,
item_sequence_again,order_status,item_order,
batch_sequence,customer_order_number,customer_material_number,
customer_material_name,customer_material_specification,sub_part_feature,
product_category,product_category_description,sales_group,
sales_group_description,material_number,product_name,
product_specification,brand,weight_gram,
taste_description,weight_gram_again,weight_gram_description,
product_feature,product_feature_description,quantity,
shipping_unit,accepted_quantity,signed_back_quantity,
unsigned_quantity,storage_location,storage_location_name,
storage_position,storage_position_name,batch_number,
inventory_management_feature,remarks,unit_price,
amount_with_tax,tax_amount,currency,
exchange_rate,local_pre_tax_amount,local_amount_with_tax,
local_tax_amount,discount_amount,discount_amount_invoice,
multi_angle_sequence_number,customer_category,customer_category_description,
sales_channel,sales_channel_description,order_type,
type_description,remarks_again,logistics_remarks,
third_party_system_code,data_entry_date,payment_type_description,
order_split_status,base_unit,order_base_unit_quantity,
standard_cost,actual_cost,collection_batch,
collection_time
</sql>
<select id="getZhanquDataset" resultMap="ZhanquMap">
select (@row_number := @row_number + 1) as id,
shipping_order_number,
debit_date,
sales_department_abbr,
receiving_customer_abbr,
product_name,
quantity,
third_party_system_code
from erp_axmr005_shipping_details,
(SELECT @row_number := 0) AS r
where operating_site = 'AHSD'
and customer_category = 'A'
and debit_date = DATE(#{date})
and shipping_unit = '箱'
and sales_department_abbr like '%战区'
</select>
</mapper>
<?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.sfa.job.domain.use.mapper.FeishuSheetRecordMapper">
<resultMap id="BaseResultMap" type="com.sfa.job.domain.use.entity.FeishuSheetRecord">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="sheetToken" column="sheet_token" jdbcType="VARCHAR"/>
<result property="sheetId" column="sheet_id" jdbcType="VARCHAR"/>
<result property="createMonth" column="create_month" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id,sheet_token,sheet_id,
create_month,type
</sql>
<select id="findOne" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from feishu_sheet_record where type = #{type} and create_month = #{createMonth}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论