feat : new pages (sav_refund, shipping_calculation, billable_orders_breakdown), warehouses implementation

pull/6221/head
Gauthier LO 2023-06-14 11:37:39 +02:00
parent 83c8f1f5e0
commit 69a68e5531
27 changed files with 747 additions and 183 deletions

View File

@ -63,7 +63,7 @@ public class JeecgController<T, S extends IService<T>> {
}
// Step.2 获取导出数据
List<T> exportList = service.list(queryWrapper);
System.out.println("Export LIST : " + exportList.toString());
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下

View File

@ -11,6 +11,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.business.entity.Client;
import org.jeecg.modules.business.entity.ClientSku;
@ -19,6 +20,7 @@ import org.jeecg.modules.business.service.IClientService;
import org.jeecg.modules.business.service.IClientSkuService;
import org.jeecg.modules.business.service.IShopService;
import org.jeecg.modules.business.vo.ClientPage;
import org.jeecg.modules.online.cgform.mapper.OnlCgformFieldMapper;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -130,9 +132,23 @@ public class ClientController {
return Result.error("未找到对应数据");
}
clientService.updateMain(client, clientPage.getShopList(), clientPage.getClientSkuList());
updateShopId();
log.info("Shop names replaced by new created shop IDs");
return Result.OK("编辑成功!");
}
/**
* Call a routine to replace shop names (from MabangAPI)
* by shop IDs in platform_order table after creating a new shop
*/
private static void updateShopId() {
OnlCgformFieldMapper onlCgformFieldMapper = SpringContextUtils.getBean(OnlCgformFieldMapper.class);
Map<String, Object> params = new HashMap<>();
String sql = "UPDATE platform_order SET shop_id = shopErpToId(shop_id) WHERE shop_id NOT LIKE '1%'";
params.put("execute_sql_string", sql);
onlCgformFieldMapper.executeUpdatetSQL(params);
}
/**
* id
*

View File

@ -269,11 +269,11 @@ public class LogisticChannelController {
@GetMapping(value = "/find")
public Result<List<CostTrialCalculation>> findPrices(@RequestParam(name = "country") String country,
public Result<List<CostTrialCalculation>> findPrices(@RequestParam(name = "countryList[]") List<String> countryList,
@RequestParam(name = "weight") int weight,
@RequestParam(name = "volume", defaultValue = "1") int volume) {
List<CostTrialCalculation> calculations = logisticChannelService.logisticChannelTrial(weight, volume, country);
List<CostTrialCalculation> calculations = logisticChannelService.logisticChannelTrial(weight, volume, countryList);
return Result.OK(calculations);
}
@ -329,7 +329,7 @@ public class LogisticChannelController {
logisticChannelService.logisticChannelTrial(
totalWeight,
totalVolume,
param.getCountryCode()
Collections.singletonList(param.getCountryCode())
);
return Result.OK(calculations);

View File

@ -18,6 +18,7 @@ import org.jeecg.modules.business.mapper.PlatformOrderContentMapper;
import org.jeecg.modules.business.mapper.PlatformOrderMapper;
import org.jeecg.modules.business.service.*;
import org.jeecg.modules.business.vo.*;
import org.jeecg.modules.message.entity.SysMessage;
import org.jeecg.modules.quartz.entity.QuartzJob;
import org.jeecg.modules.quartz.service.IQuartzJobService;
import org.springframework.beans.factory.annotation.Autowired;
@ -92,7 +93,9 @@ public class InvoiceController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "type") String type,
@RequestParam(name = "warehouses[]") List<String> warehouses,
HttpServletRequest req) {
String warehouseString = String.join(",", warehouses);
QueryWrapper<PlatformOrder> queryWrapper = QueryGenerator.initQueryWrapper(platformOrder, req.getParameterMap());
LambdaQueryWrapper<PlatformOrder> lambdaQueryWrapper = queryWrapper.lambda();
if(type.equals("shipping"))
@ -107,7 +110,7 @@ public class InvoiceController {
Page<PlatformOrder> page = new Page<>(pageNo, pageSize);
IPage<PlatformOrder> pageList;
log.info("Request for " + type + " orders from client : " + clientId);
if (shopIDs == null || shopIDs.isEmpty()) {
if (shopIDs == null || shopIDs.isEmpty()) { // obsolete, used in old pages only
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT po.id FROM platform_order po\n" +
" JOIN shop s ON po.shop_id = s.id\n" +
" JOIN client c ON s.owner_id = c.id WHERE c.id = '" + clientId + "'");
@ -118,12 +121,20 @@ public class InvoiceController {
if(start != null || end != null){
log.info("Specified period between " + start + " and " + end);
if (type.equals("shipping"))
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT id FROM platform_order po WHERE po.shipping_time between '" + start + "' AND '" + end + "'");
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT po.id FROM platform_order po\n" +
"JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name\n" +
"WHERE po.shipping_time between '" + start + "' AND '" + end + "'\n" +
"AND lc.warehouse_in_china IN (" + warehouseString + ")");
else
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT id FROM platform_order po WHERE po.order_time between '" + start + "' AND '" + end + "'");
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT po.id FROM platform_order po\n" +
"JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name\n" +
"WHERE po.order_time between '" + start + "' AND '" + end + "'\n" +
"AND lc.warehouse_in_china IN (" + warehouseString + ")");
}
else {
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT id FROM platform_order po");
else {// obsolete
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT po.id FROM platform_order po\n" +
"JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name\n" +
"WHERE lc.warehouse_in_china IN (" + warehouseString + ")");
}
pageList = platformOrderMapper.selectPage(page, lambdaQueryWrapper);
return Result.OK(pageList);
@ -171,7 +182,6 @@ public class InvoiceController {
public Result<?> makeCompleteShippingInvoice(@RequestBody ShippingInvoiceParam param) {
try {
String method = param.getErpStatuses().toString().equals("[3]") ? "post" : param.getErpStatuses().toString().equals("[1, 2]") ? "pre-shipping" : "all";
System.out.println(param.getErpStatuses().toString());
InvoiceMetaData metaData = shippingInvoiceService.makeCompleteInvoicePostShipping(param, method);
return Result.OK(metaData);
} catch (UserException e) {
@ -228,8 +238,10 @@ public class InvoiceController {
log.info("Request for valid order time period for shops: " + shopIDs.toString() +
" and erpStatuses : " + erpStatuses.toString());
Period period = shippingInvoiceService.getValidOrderTimePeriod(shopIDs, erpStatuses);
if (period.isValid())
if (period.isValid()) {
System.out.println("start : " + period.start() + "; end : " + period.end());
return Result.OK(period);
}
else return Result.error("No package in the selected period");
}

View File

@ -18,7 +18,8 @@ public enum ScanType {
WAITING_FOR_DELIVERY("Waiting for Delivery"),
ARRIVED_PORT("Arrived at Port"),
FLIGHT_PREPARING("Flight Preparing"),
CN_CUSTOMS_INSPECTION("Customs Inspection");
CN_CUSTOMS_INSPECTION("Customs Inspection"),
BAGGING("Bagging");
private final String desc;
ScanType(String desc) {

View File

@ -0,0 +1,28 @@
package org.jeecg.modules.business.domain.api.cmk;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
public class CMKParcelDetail {
@JsonProperty("seventeenNo")
private String orderNo;
@JsonProperty("guoJia")
private String country;
@JsonProperty("shouHuoQuDao")
private String productCode;
public CMKParcelDetail(String orderNo, String country, String productCode) {
this.orderNo = orderNo;
this.country = country;
this.productCode = productCode;
}
public CMKParcelDetail() {
}
}

View File

@ -0,0 +1,221 @@
package org.jeecg.modules.business.domain.api.cmk;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.domain.api.ScanType;
import java.util.Objects;
import static org.jeecg.modules.business.domain.api.ScanType.*;
@Slf4j
@Data
public class CMKParcelTrace {
@JSONField(deserialize = false)
private String parcelId;
@JsonProperty("desc")
private String description;
private String descriptionEn;
private String time;
/**
*
*/
@JsonProperty("localtion")
private String location;
private String scanType;
public static final String VENTE_EN_LIGNE_TO_IGNORE = "009910,VENTE ON LINE";
public static final String VENTE_EN_LIGNE_CN_TO_IGNORE = "该包裹在法邮创建,等待送往法邮";
public static final String CUSTOM_CLEARED_CN_TO_IGNORE = "您的包裹已清关";
public static final String CMK = "Shipment information sent to CMK";
public static final String SHIPMENT_INFO_RECEIVED = "Shipment information received";
public static final String ARRIVE_FACILITY = "Arrived at Facility";
public static final String PROCESSED_FACILITY = "Processed at Facility";
public static final String DEPART_FACILITY = "Departed from Facility";
public static final String PACKED = "已打包";
public static final String PACKED_EN = "Bagging";
public static final String ARRIVE_AIRPORT_ABROAD = "Arrive at international airport to abroad";
public static final String DEPART_AIRPORT_ABROAD = "Departed from AIRPORT of Origin";
public static final String ARRIVE_AIRPORT_DESTINATION = "Arrived at AIRPORT of Destination";
public static final String CUSTOM_CLEARED = "Custom clearance completed";
public static final String CUSTOM_CLEARED_CN = "清关完成";
public static final String END_ARRIVED = "Delivery to local courier";
public static final String END_RECEIVED = "法邮已收取快件, 派送中";
public static final String END_RECEIVED_EN = "Shipment given to local courier";
public static final String ARRIVED_AT_DELIVERY = "包裹已到达分拣中心";
public static final String ARRIVED_AT_DELIVERY_EN = "Shipment arrived at distribution center";
public static final String DELIVERY_SCHEDULED = "包裹将在收件人选择的日期预约递送";
public static final String DELIVERY_SCHEDULED_2 = "包裹将在收件人选择的日期通过预约递送";
public static final String DELIVERY_SCHEDULED_EN = "Package will be delivered on date chosen by consignee";
public static final String DELIVERY_DELAYED = "包裹今天无法送达.将尽快安排再次配送";
public static final String DELIVERY_DELAYED_EN = "Package can not be delivered today, another attempt will be arranged as soon as possible";
public static final String DELIVERY_DELAYED_2 = "由于收件人地址的问题,包裹今天无法送达.将尽快安排再次配送";
public static final String DELIVERY_DELAYED_2_EN = "Due to a problem with the address, package can not be delivered today, another attempt will be arranged as soon as possible";
public static final String DELIVERY_DELAYED_3 = "由于无法控制的特殊情况,包裹今天无法送达.将尽快安排再次配送";
public static final String DELIVERY_DELAYED_3_EN = "Due to a circumstances beyond our control, package can not be delivered today, another attempt will be arranged as soon as possible";
public static final String CONSIGNEE_ABSENT = "由于收件人不在,您的包裹无法送达.它将在下一个工作日再次交付";
public static final String CONSIGNEE_ABSENT_EN = "Consignee absent, package can not be delivered today, another attempt will be made the next working day";
public static final String DELIVERY_NEXT_WORKING_DAY = "包裹将在下一个工作日送达。 如果您不在,请在www.colissimo.fr/monchoix告诉我们。";
public static final String DELIVERY_NEXT_WORKING_DAY_EN = "Package will be delivered the next working day. If absent, please inform us at www.colissimo.fr/monchoix";
public static final String DELIVERY_STATION = "您的包裹位于支持您地址的送货站点。我们准备交付。";
public static final String DELIVERY_STATION_EN = "Package has arrived at delivery site.";
public static final String DELIVERED = "包裹已送达";
public static final String DELIVERED_EN = "Delivered";
public static final String DELIVERED_TO_CONCIERGE = "包裹已由楼层管理员签收";
public static final String DELIVERED_TO_CONCIERGE_EN = "Delivered to concierge";
public static final String INSTRUCTIONS_RECEIVED = "包裹根据收件人的要求重新送至其指定的地点";
public static final String INSTRUCTIONS_RECEIVED_EN = "Package is being redirected to instructed address";
public static final String TO_BE_RETRIEVED = "包裹已投放至所选择的取货点, 收件人需10日携带有效证件前往领取";
public static final String TO_BE_RETRIEVED_EN = "Package has been left at relay point chosen by consignee and can be retrieved in the next 10 working days";
public static final String END_ABNORMAL_ADDRESS = "由于地址问题,您的包裹无法交付给您。它将退还给发件人。";
public static final String END_ABNORMAL_ADDRESS_EN = "Due to a problem with the address, the package can not be delivered and will be returned to sender";
public static final String END_ABNORMAL_ADDRESS_INCOMPLETE = "收件人地址信息不完整,无法送达.请联系客服部门补充地址信息";
public static final String END_ABNORMAL_ADDRESS_INCOMPLETE_EN = "Package can not be delivered due to incomplete consignee address, please contact customer service";
public static final String END_ABNORMAL_PICKING = "包裹分拣错误,现已重新派送";
public static final String END_ABNORMAL_PICKING_EN = "Picking error, package will be re-delivered";
public static final String END_RETURN_TO_SENDER = "包裹退回,送还至发件人";
public static final String END_RETURN_TO_SENDER_EN = "Return to sender";
public static final String END_RETURN = "包裹退回";
public static final String END_RETURN_EN = "Returned";
public CMKParcelTrace() {
}
public void parcelTraceProcess(String parcelId) {
setParcelId(parcelId);
switch (description) {
case CMK:
setDescriptionEn(SHIPMENT_INFO_RECEIVED);
setScanType(ORDER_PLACED.getDesc());
break;
case PACKED:
setDescriptionEn(PACKED_EN);
setScanType(BAGGING.getDesc());
break;
case ARRIVE_FACILITY:
setScanType(FACILITY_ARRIVED.getDesc());
break;
case PROCESSED_FACILITY:
setScanType(FACILITY_OUTBOUND.getDesc());
break;
case DEPART_FACILITY:
setScanType(FACILITY_DEPARTURE.getDesc());
break;
case ARRIVE_AIRPORT_ABROAD:
setScanType(ARRIVED_PORT.getDesc());
break;
case DEPART_AIRPORT_ABROAD:
setScanType(FLIGHT_DEPARTURE.getDesc());
break;
case ARRIVE_AIRPORT_DESTINATION:
setScanType(FLIGHT_ARRIVED.getDesc());
break;
case CUSTOM_CLEARED:
setScanType(CUSTOMS_CLEARANCE_COMPLETED.getDesc());
break;
case CUSTOM_CLEARED_CN:
setDescriptionEn(CUSTOM_CLEARED);
setScanType(CUSTOMS_CLEARANCE_COMPLETED.getDesc());
break;
case END_ARRIVED:
setScanType(ScanType.END_ARRIVED.getDesc());
break;
case END_RECEIVED:
setDescriptionEn(END_RECEIVED_EN);
setScanType(ScanType.END_RECEIVED.getDesc());
break;
case ARRIVED_AT_DELIVERY:
setDescriptionEn(ARRIVED_AT_DELIVERY_EN);
setScanType(END_DELIVERY.getDesc());
break;
case DELIVERY_STATION:
setDescriptionEn(DELIVERY_STATION_EN);
setScanType(END_DELIVERY.getDesc());
break;
case INSTRUCTIONS_RECEIVED:
setDescriptionEn(INSTRUCTIONS_RECEIVED_EN);
setScanType(END_DELIVERY.getDesc());
break;
case DELIVERY_SCHEDULED:
case DELIVERY_SCHEDULED_2:
setDescriptionEn(DELIVERY_SCHEDULED_EN);
setScanType(END_DELIVERY.getDesc());
break;
case DELIVERY_NEXT_WORKING_DAY:
setDescriptionEn(DELIVERY_NEXT_WORKING_DAY_EN);
setScanType(END_DELIVERY.getDesc());
break;
case DELIVERY_DELAYED:
setDescriptionEn(DELIVERY_DELAYED_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case DELIVERY_DELAYED_2:
setDescriptionEn(DELIVERY_DELAYED_2_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case DELIVERY_DELAYED_3:
setDescriptionEn(DELIVERY_DELAYED_3_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case CONSIGNEE_ABSENT:
setDescriptionEn(CONSIGNEE_ABSENT_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case DELIVERED:
setDescriptionEn(DELIVERED_EN);
setScanType(END_DELIVERED.getDesc());
break;
case DELIVERED_TO_CONCIERGE:
setDescriptionEn(DELIVERED_TO_CONCIERGE_EN);
setScanType(END_DELIVERED.getDesc());
break;
case TO_BE_RETRIEVED:
setDescriptionEn(TO_BE_RETRIEVED_EN);
setScanType(END_DELIVERED.getDesc());
break;
case END_ABNORMAL_ADDRESS:
setDescriptionEn(END_ABNORMAL_ADDRESS_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case END_ABNORMAL_PICKING:
setDescriptionEn(END_ABNORMAL_PICKING_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case END_ABNORMAL_ADDRESS_INCOMPLETE:
setDescriptionEn(END_ABNORMAL_ADDRESS_INCOMPLETE_EN);
setScanType(END_ABNORMAL.getDesc());
break;
case END_RETURN:
setDescriptionEn(END_RETURN_EN);
setScanType(RETURN.getDesc());
break;
case END_RETURN_TO_SENDER:
setDescriptionEn(END_RETURN_TO_SENDER_EN);
setScanType(RETURN.getDesc());
break;
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CMKParcelTrace that = (CMKParcelTrace) o;
return Objects.equals(description, that.description) && Objects.equals(time, that.time) && Objects.equals(location, that.location);
}
public boolean isUseful() {
return !getDescription().equalsIgnoreCase(VENTE_EN_LIGNE_CN_TO_IGNORE)
&& !getLocation().equalsIgnoreCase(VENTE_EN_LIGNE_TO_IGNORE)
&& !getDescription().equalsIgnoreCase(CUSTOM_CLEARED_CN_TO_IGNORE);
}
}

View File

@ -0,0 +1,46 @@
package org.jeecg.modules.business.domain.api.cmk;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
@Slf4j
@Data
@TableName("parcel")
public class CMKParcelTraceData {
@TableId(type = IdType.ASSIGN_ID)
private String id = IdWorker.getIdStr();
/**
*
*/
@JsonProperty("no")
private String thirdBillCode;
private String errorMsg;
private CMKParcelDetail detail;
@JsonProperty("trackList")
private List<CMKParcelTrace> traceList;
private String country;
public CMKParcelTraceData(String thirdBillCode, String errorMsg, CMKParcelDetail detail, List<CMKParcelTrace> traceList) {
this.thirdBillCode = thirdBillCode;
this.errorMsg = errorMsg;
this.detail = detail;
this.traceList = traceList;
}
public CMKParcelTraceData() {
}
}

View File

@ -0,0 +1,56 @@
package org.jeecg.modules.business.domain.api.cmk;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@Slf4j
public class CMKRequest {
private final static String URL = "https://cmk.itdida.com/itdida-api/queryTracks";
private static final String API_KEY = "ITDIDA-APP-KEY-YR573T2VQ2";
private static final RequestConfig REQUEST_CONFIG = RequestConfig.custom().build();
private final List<String> trackingNumbers;
public CMKRequest(List<String> trackingNumbers) {
this.trackingNumbers = trackingNumbers;
}
/**
* Sent request to the CMK API with a request body.
*
* @return the response
*/
public HttpResponse send() {
int attempts = 0;
while (attempts++ < 5) {
try {
HttpClient httpClient = HttpClientBuilder.create().setDefaultRequestConfig(REQUEST_CONFIG).build();
HttpGet request = new HttpGet(URL + "?no=" + String.join(",", trackingNumbers));
// adding the form data
request.setHeader(HttpHeaders.AUTHORIZATION, API_KEY);
return httpClient.execute(request);
} catch (Exception e) {
log.error("Request failed on attempt n°" + attempts);
}
}
return null;
}
}

View File

@ -0,0 +1,37 @@
package org.jeecg.modules.business.domain.api.cmk;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
@Slf4j
@Data
public class CMKResponse {
@TableId(type = IdType.ASSIGN_ID)
private String id = IdWorker.getIdStr();
@JSONField(deserialize = false)
private Integer statusCode;
@JSONField(deserialize = false)
private Boolean success;
@JsonProperty("data")
private List<CMKParcelTraceData> parcelData;
public CMKResponse(Integer statusCode, Boolean success, List<CMKParcelTraceData> parcelData) {
this.statusCode = statusCode;
this.success = success;
this.parcelData = parcelData;
}
public CMKResponse() {
}
}

View File

@ -64,7 +64,7 @@ public class SkuData {
@JSONField(name="height")
private String height;
@JSONField(name="weight")
private double weight;
private Double weight;
/**
* saleRemark contains the weight
*/

View File

@ -6,15 +6,18 @@ import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.jeecg.common.api.dto.message.TemplateMessageDTO;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.*;
import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuData;
import org.jeecg.modules.business.entity.Sku;
import org.jeecg.modules.business.service.ISkuListMabangService;
import org.jeecg.modules.online.cgform.mapper.OnlCgformFieldMapper;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.ZoneId;
@ -25,20 +28,36 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuStatus.*;
/**
* A Job that retrieves all Sku from Mabang
* if the sku is of status 3 (normal) and not in DB, then we insert it in DB
*/
@Slf4j
@Component
public class MabangSkuJob implements Job {
private static final String SECTION_START = "<section style=\"display:flex;align-items:stretch;justify-content:space-between;flex-wrap:wrap;\">";
private static final String DIV_START = "<div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">";
private static final String DIV_END_NEXT_DIV_START = "</div><div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">";
private static final String ROW_START = "<tr><td>";
private static final String ROW_END = "</td></tr>";
private static final String NEXT_COLUMN = "</td><td>";
private static final String TABLE_START = "<style>\n" +
"table, th, td {\n" +
" border: 1px solid black;\n" +
" width: 800px;\n" +
" text-align: center;\n" +
" vertical-align: middle;" +
"}\n" +
"</style><table><tr><th style=\"width:20%\">SKU</th><th style=\"width:50%\">中文名</th><th style=\"width:10%\">重量</th><th style=\"width:10%\">申报价</th><th style=\"width:10%\">售价</th></tr>";
private static final String SECTION_END = "</div></section>";
private static final String TABLE_END = "</table>";
@Autowired
@Setter
private ISkuListMabangService skuListMabangService;
private static final Integer DEFAULT_NUMBER_OF_DAYS = 5;
private static final DateType DEFAULT_DATE_TYPE = DateType.UPDATE;
private static final Integer NBR_SKU_PER_PAGE = 400;
private static final DateType DEFAULT_DATE_TYPE = DateType.CREATE;
@Autowired
private ISysBaseAPI ISysBaseApi;
@ -72,11 +91,9 @@ public class MabangSkuJob implements Job {
if (!endDateTime.isAfter(startDateTime)) {
throw new RuntimeException("EndDateTime must be strictly greater than StartDateTime !");
}
// else if (endDateTime.minusDays(30).isAfter(startDateTime)) {
// throw new RuntimeException("No more than 30 days can separate startDateTime and endDateTime !");
// }
Map<Sku, String> newSkusMap = new HashMap<>();
Map<String, SkuData> skuDataMap = new HashMap<>();
try {
while (startDateTime.until(endDateTime, ChronoUnit.HOURS) > 0) {
LocalDateTime dayBeforeEndDateTime = endDateTime.minusDays(1);
@ -85,10 +102,11 @@ public class MabangSkuJob implements Job {
SkuListStream stream = new SkuListStream(rawStream);
// the status is directly filtered in all() method
List<SkuData> skusFromMabang = stream.all();
skusFromMabang.forEach(skuData -> skuDataMap.put(skuData.getErpCode(), skuData));
log.info("{} skus from {} to {} ({})to be inserted.", skusFromMabang.size(),
dayBeforeEndDateTime, endDateTime, dateType);
if(skusFromMabang.size() > 0) {
if (skusFromMabang.size() > 0) {
// we save the skuDatas in DB
newSkusMap.putAll(skuListMabangService.saveSkuFromMabang(skusFromMabang));
}
@ -98,67 +116,90 @@ public class MabangSkuJob implements Job {
throw new RuntimeException(e);
}
updateSkuId();
log.info("SKU codes replaced by new created SKU IDs");
// here we send system notification with the number and list of new skus saved in DB
if(newSkusMap.size() > 0) {
List<String> messageContentList = new ArrayList<>();
List<String> newSkuCodeList = newSkusMap.keySet().stream().map(Sku::getErpCode).sorted().collect(Collectors.toList());
String skuListContent = "";
// we truncate the message and only send skus by groups of 400
for (int i = 0; i < newSkuCodeList.size(); i++) {
if (i % 10 == 0 && i != 0 && i % 400 != 0) {
skuListContent = skuListContent.concat("</div><div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">");
}
if (i == 0) {
skuListContent = skuListContent.concat("<section style=\"display:flex;align-items:stretch;justify-content:space-between;flex-wrap:wrap;\">" +
"<div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">");
}
skuListContent = skuListContent.concat("<p>" + newSkuCodeList.get(i) + "</p>");
if (i == newSkuCodeList.size() - 1 || i % 400 == 399) {
skuListContent = skuListContent.concat("</div></section>");
messageContentList.add(skuListContent);
skuListContent = "<section style=\"display:flex;align-items:stretch;justify-content:space-between;flex-wrap:wrap;\">" +
"<div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">";
}
if (newSkusMap.size() == 0) {
return;
}
List<String> messageContentList = new ArrayList<>();
List<String> newSkuCodeList = newSkusMap.keySet().stream().map(Sku::getErpCode).sorted().collect(Collectors.toList());
String skuListContent = TABLE_START;
// we truncate the message and only send skus by groups of 400
for (int i = 0; i < newSkuCodeList.size(); i++) {
String skuErpCode = newSkuCodeList.get(i);
SkuData skuData = skuDataMap.get(skuErpCode);
if (skuData != null) {
skuListContent = skuListContent
.concat(ROW_START)
.concat(skuErpCode)
.concat(NEXT_COLUMN)
.concat(skuData.getNameCN())
.concat(NEXT_COLUMN)
.concat(String.valueOf(skuData.getWeight() == null ? 0 : skuData.getWeight()))
.concat(NEXT_COLUMN)
.concat(String.valueOf(skuData.getDeclareValue() == null ? 0 : skuData.getDeclareValue()))
.concat(NEXT_COLUMN)
.concat(String.valueOf(skuData.getSalePrice() == null ? 0 : skuData.getSalePrice()))
.concat(ROW_END);
}
if (i == newSkuCodeList.size() - 1 || i % NBR_SKU_PER_PAGE == NBR_SKU_PER_PAGE - 1) {
skuListContent = skuListContent.concat(TABLE_END);
messageContentList.add(skuListContent);
skuListContent = TABLE_START;
}
}
// here we are printing the list of skus with extra info
Map<String, String> needTreatmentSkuMap = new HashMap<>();
for (Map.Entry<Sku, String> entry : newSkusMap.entrySet()) {
if (!entry.getValue().equals("")) {
needTreatmentSkuMap.put(entry.getKey().getErpCode(), entry.getValue());
}
// here we are printing the list of skus with extra info
Map<String, String> needTreatmentSkuMap = new HashMap<>();
for (Map.Entry<Sku, String> entry : newSkusMap.entrySet()) {
if (!entry.getValue().isEmpty()) {
needTreatmentSkuMap.put(entry.getKey().getErpCode(), entry.getValue());
}
String needTreatmentSku = "<section style=\"display:flex;align-items:stretch;justify-content:space-between;flex-wrap:wrap;\">";
int cpt = 0;
for (Map.Entry<String, String> entry : needTreatmentSkuMap.entrySet()) {
if (cpt % 10 == 0 && cpt != 0) {
needTreatmentSku = needTreatmentSku.concat("</div><div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">");
}
if (cpt == 0) {
needTreatmentSku = needTreatmentSku.concat("<div style=\"flex:1 1 160px;border:1px solid;padding-left:10px;\">");
}
needTreatmentSku = needTreatmentSku.concat("<p>" + entry.getKey() + " : " + entry.getValue() + "</p>");
cpt++;
}
String needTreatmentSku = SECTION_START;
int cpt = 0;
for (Map.Entry<String, String> entry : needTreatmentSkuMap.entrySet()) {
if (cpt % 10 == 0 && cpt != 0) {
needTreatmentSku = needTreatmentSku.concat(DIV_END_NEXT_DIV_START);
}
needTreatmentSku = needTreatmentSku.concat("</div></section>");
if (cpt == 0) {
needTreatmentSku = needTreatmentSku.concat(DIV_START);
}
needTreatmentSku = needTreatmentSku.concat("<p>" + entry.getKey() + " : " + entry.getValue() + "</p>");
cpt++;
}
needTreatmentSku = needTreatmentSku.concat(SECTION_END);
int page = 1;
for (String msg : messageContentList) {
Map<String, String> param = new HashMap<>();
param.put("nb_of_entries", String.valueOf(newSkusMap.size()));
param.put("sku_list", msg);
param.put("need_treatment", needTreatmentSkuMap.size() > 0 ? needTreatmentSku : "None");
param.put("current_page", String.valueOf(page));
param.put("total_page", String.valueOf(messageContentList.size()));
page++;
TemplateMessageDTO message = new TemplateMessageDTO("admin", "admin", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Alice", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Jessyca", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
}
int page = 1;
for (String msg : messageContentList) {
Map<String, String> param = new HashMap<>();
param.put("nb_of_entries", String.valueOf(newSkusMap.size()));
param.put("sku_list", msg);
param.put("need_treatment", needTreatmentSkuMap.size() > 0 ? needTreatmentSku : "None");
param.put("current_page", String.valueOf(page));
param.put("total_page", String.valueOf(messageContentList.size()));
TemplateMessageDTO message = new TemplateMessageDTO("admin", "admin", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Alice", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Jessyca", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message);
log.info("Page {} of recap sent through system announcement", page);
page++;
}
}
}
/**
* Call a routine to replace SKU codes (from MabangAPI)
* by SKU IDs in platform_order_content table after creating new SKUs
*/
private static void updateSkuId() {
OnlCgformFieldMapper onlCgformFieldMapper = SpringContextUtils.getBean(OnlCgformFieldMapper.class);
Map<String, Object> params = new HashMap<>();
String sql = "UPDATE platform_order_content SET sku_id = skuErpToId(sku_id) WHERE sku_id NOT LIKE '1%'";
params.put("execute_sql_string", sql);
onlCgformFieldMapper.executeUpdatetSQL(params);
}
}

View File

@ -220,7 +220,9 @@ public class ShippingInvoiceFactory {
Map<String, BigDecimal> skuServiceFees = new HashMap<>();
skuDataPreparation(skuRealWeights, skuServiceFees);
List<Country> countryList = countryService.findAll();
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(orderAndContent, true);
Map<String, LogisticChannel> logisticChannelMap = logisticChannelMapper.getAll().stream()
.collect(toMap(LogisticChannel::getId, Function.identity()));
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(logisticChannelMap, orderAndContent, true);
List<SkuDeclaredValue> latestDeclaredValues = skuDeclaredValueService.getLatestDeclaredValues();
List<Shop> shops = shopMapper.selectBatchIds(shopIds);
@ -230,7 +232,7 @@ public class ShippingInvoiceFactory {
shops.forEach(shop -> shopPackageMatFeeMap.put(shop.getId(), shop.getPackagingMaterialFee()));
String invoiceCode = generateCompleteInvoiceCode();
log.info("New invoice code: {}", invoiceCode);
calculateFees(orderAndContent, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
calculateFees(logisticChannelMap, orderAndContent, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
latestDeclaredValues, client, shopServiceFeeMap, shopPackageMatFeeMap, invoiceCode);
BigDecimal eurToUsd = exchangeRatesMapper.getLatestExchangeRate("EUR", "USD");
@ -320,7 +322,7 @@ public class ShippingInvoiceFactory {
* channel price, this exception will be thrown.
*/
@Transactional
public ShippingInvoice createInvoice(String customerId, List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses) throws UserException {
public ShippingInvoice createInvoice(String customerId, List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses, List<String> warehouses) throws UserException {
log.info(
"Creating an invoice with arguments:\n client ID: {}, shop IDs: {}, period:[{} - {}]",
customerId, shopIds.toString(), begin, end
@ -335,7 +337,7 @@ public class ShippingInvoiceFactory {
SUBJECT_FORMAT.format(begin),
SUBJECT_FORMAT.format(end)
);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrders(shopIds, begin, end);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrders(shopIds, begin, end, warehouses);
}
else if (erpStatuses.toString().equals("[1, 2]")) {
subject = String.format(
@ -343,7 +345,7 @@ public class ShippingInvoiceFactory {
SUBJECT_FORMAT.format(begin),
SUBJECT_FORMAT.format(end)
);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrderContentsForShopsAndStatus(shopIds, begin, end, erpStatuses);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrderContentsForShopsAndStatus(shopIds, begin, end, erpStatuses, warehouses);
}
else {
subject = String.format(
@ -351,7 +353,7 @@ public class ShippingInvoiceFactory {
SUBJECT_FORMAT.format(begin),
SUBJECT_FORMAT.format(end)
);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrderContentsForShopsAndStatus(shopIds, begin, end, erpStatuses);
uninvoicedOrderToContent = platformOrderService.findUninvoicedOrderContentsForShopsAndStatus(shopIds, begin, end, erpStatuses, warehouses);
}
return createInvoice(customerId, shopIds, uninvoicedOrderToContent, savRefunds, subject, false);
}
@ -393,11 +395,13 @@ public class ShippingInvoiceFactory {
skuDataPreparation(skuRealWeights, skuServiceFees);
List<Country> countryList = countryService.findAll();
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap;
Map<String, LogisticChannel> logisticChannelMap = logisticChannelMapper.getAll().stream()
.collect(toMap(LogisticChannel::getId, Function.identity()));
if(subject.contains("Pre") || subject.contains("All")) {
channelPriceMap = getChannelPriceMap(orderAndContent, skipShippingTimeComparing, "order");
channelPriceMap = getChannelPriceMap(logisticChannelMap, orderAndContent, skipShippingTimeComparing, "order");
}
else {
channelPriceMap = getChannelPriceMap(orderAndContent, skipShippingTimeComparing);
channelPriceMap = getChannelPriceMap(logisticChannelMap, orderAndContent, skipShippingTimeComparing);
}
List<SkuDeclaredValue> latestDeclaredValues = skuDeclaredValueService.getLatestDeclaredValues();
@ -409,7 +413,7 @@ public class ShippingInvoiceFactory {
shops.forEach(shop -> shopPackageMatFeeMap.put(shop.getId(), shop.getPackagingMaterialFee()));
String invoiceCode = generateInvoiceCode();
log.info("New invoice code: {}", invoiceCode);
calculateFees(orderAndContent, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
calculateFees(logisticChannelMap, orderAndContent, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
latestDeclaredValues, client, shopServiceFeeMap, shopPackageMatFeeMap, invoiceCode);
BigDecimal eurToUsd = exchangeRatesMapper.getLatestExchangeRate("EUR", "USD");
if (savRefunds != null) {
@ -420,7 +424,19 @@ public class ShippingInvoiceFactory {
return invoice;
}
private Map<LogisticChannel, List<LogisticChannelPrice>> getChannelPriceMap(Map<PlatformOrder, List<PlatformOrderContent>> orderAndContent,
/**
* Construct a map between LogisticChannel and LogisticChannelPrices, by using distinct country names and
* distinct effective logistic channel names(invoice logistic channel names trump over logistic channel names)
* from orders as filter.
* In the case where the logistic channel name points to a ghost channel(i.e. a channel whose samePriceChannelId isn't null),
* the result map may NOT contain the real channel if no order is actually shipped from it.
* @param logisticChannelMap A map of LogisticChannels keyed by IDs
* @param orderAndContent Map of order and contents
* @param skipShippingTimeComparing True if shipping time comparison should be skipped, false otherwise
* @return
*/
private Map<LogisticChannel, List<LogisticChannelPrice>> getChannelPriceMap(Map<String, LogisticChannel> logisticChannelMap,
Map<PlatformOrder, List<PlatformOrderContent>> orderAndContent,
boolean skipShippingTimeComparing, String ... dateType ) {
Date latestShippingTime;
List<PlatformOrder> sortedList;
@ -445,12 +461,10 @@ public class ShippingInvoiceFactory {
List<String> distinctChannelNames = sortedList.stream()
.map(order -> order.getInvoiceLogisticChannelName() == null ? order.getLogisticChannelName() : order.getInvoiceLogisticChannelName())
.distinct().collect(toList());
Map<String, LogisticChannel> logisticChannelMapById = logisticChannelMapper.getAll().stream()
.collect(toMap(LogisticChannel::getId, Function.identity()));
List<LogisticChannelPrice> allEligiblePrices = logisticChannelPriceMapper.findPricesBy(latestShippingTime,
distinctCountries, distinctChannelNames);
return allEligiblePrices.stream().collect(
groupingBy(logisticChannelPrice -> logisticChannelMapById.get(logisticChannelPrice.getChannelId()))
groupingBy(logisticChannelPrice -> logisticChannelMap.get(logisticChannelPrice.getChannelId()))
);
}
@ -464,7 +478,7 @@ public class ShippingInvoiceFactory {
}
}
private void calculateFees(Map<PlatformOrder, List<PlatformOrderContent>> orderAndContent,
private void calculateFees(Map<String, LogisticChannel> logisticChannelMap, Map<PlatformOrder, List<PlatformOrderContent>> orderAndContent,
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap,
List<Country> countryList,
Map<String, BigDecimal> skuRealWeights,
@ -497,7 +511,8 @@ public class ShippingInvoiceFactory {
contentMap,
skuRealWeights
);
Pair<LogisticChannel, LogisticChannelPrice> logisticChannelPair = findAppropriatePrice(countryList, channelPriceMap, uninvoicedOrder, contentWeight);
Pair<LogisticChannel, LogisticChannelPrice> logisticChannelPair = findAppropriatePrice(countryList, logisticChannelMap,
channelPriceMap, uninvoicedOrder, contentWeight);
LogisticChannelPrice price = logisticChannelPair.getRight();
// update attributes of orders and theirs content
BigDecimal packageMatFee = shopPackageMatFeeMap.get(uninvoicedOrder.getShopId());
@ -603,11 +618,22 @@ public class ShippingInvoiceFactory {
return totalDeclaredValue;
}
/**
*
* @param countryList
* @param logisticChannelMap Map of LogisticChannels where keys are IDs
* @param channelPriceMap
* @param uninvoicedOrder
* @param contentWeight
* @return
* @throws UserException
*/
@NotNull
private Pair<LogisticChannel, LogisticChannelPrice> findAppropriatePrice(List<Country> countryList, Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap,
PlatformOrder uninvoicedOrder, BigDecimal contentWeight) throws UserException {
LogisticChannelPrice price = null;
LogisticChannel channel = null;
private Pair<LogisticChannel, LogisticChannelPrice> findAppropriatePrice(List<Country> countryList, Map<String, LogisticChannel> logisticChannelMap,
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap,
PlatformOrder uninvoicedOrder, BigDecimal contentWeight) throws UserException {
LogisticChannelPrice price;
LogisticChannel channel;
try {
/* Find channel price */
Optional<Country> foundCountry = countryList.stream()
@ -620,24 +646,24 @@ public class ShippingInvoiceFactory {
}
Date shippingTime = uninvoicedOrder.getShippingTime() == null ? now().toSqlDate() : uninvoicedOrder.getShippingTime();
String logisticChannelName = uninvoicedOrder.getInvoiceLogisticChannelName() == null ?
uninvoicedOrder.getLogisticChannelName() : uninvoicedOrder.getInvoiceLogisticChannelName();
Optional<Map.Entry<LogisticChannel, List<LogisticChannelPrice>>> channelPriceMapCandidate = channelPriceMap.entrySet().stream()
// Find prices of the used channel
.filter(entry -> entry.getKey().getZhName().equals(logisticChannelName))
.findFirst();
if (channelPriceMapCandidate.isPresent()) {
channel = channelPriceMapCandidate.get().getKey();
Optional<LogisticChannelPrice> priceCandidate = channelPriceMapCandidate.get().getValue().stream()
.filter(channelPrice -> channelPrice.getEffectiveCountry().equals(foundCountry.get().getCode()))
.filter(channelPrice -> channelPrice.getWeightRangeEnd() >= contentWeight.intValue()
&& channelPrice.getWeightRangeStart() < contentWeight.intValue())
.filter(channelPrice -> channelPrice.getEffectiveDate().before(shippingTime))
.max(Comparator.comparing(LogisticChannelPrice::getEffectiveDate));
price = priceCandidate.orElse(null);
Map<String, LogisticChannel> logisticChannelNameMap = channelPriceMap.keySet().stream().collect(toMap(LogisticChannel::getZhName, Function.identity()));
// If an invoice logistic channel already present, use it,
// otherwise write in the same price logistic channel name (if present)
String invoiceLogisticChannelName = uninvoicedOrder.getInvoiceLogisticChannelName();
String logisticChannelName = invoiceLogisticChannelName == null ? uninvoicedOrder.getLogisticChannelName() : invoiceLogisticChannelName;
channel = logisticChannelNameMap.get(logisticChannelName);
if (invoiceLogisticChannelName == null && channel != null) {
String samePriceChannelId = channel.getSamePriceChannelId();
if (samePriceChannelId != null) {
LogisticChannel samePriceChannel = logisticChannelMap.get(samePriceChannelId);
if (samePriceChannel != null) {
// We don't affect samePriceChannel to channel here because channelPriceMap may not contain it
uninvoicedOrder.setInvoiceLogisticChannelName(samePriceChannel.getZhName());
}
}
}
if (price == null) {
String format = "Can not find propre channel price for" +
if (channel == null) {
String format = "Can not find propre channel for" +
"package Serial No: %s, delivered at %s, " +
"weight: %s, channel name: %s, destination: %s";
String msg = String.format(
@ -651,8 +677,15 @@ public class ShippingInvoiceFactory {
log.error(msg);
throw new UserException(msg);
}
if (channel == null) {
String format = "Can not find propre channel for" +
Optional<LogisticChannelPrice> priceCandidate = channelPriceMap.get(channel).stream()
.filter(channelPrice -> channelPrice.getEffectiveCountry().equals(foundCountry.get().getCode()))
.filter(channelPrice -> channelPrice.getWeightRangeEnd() >= contentWeight.intValue()
&& channelPrice.getWeightRangeStart() < contentWeight.intValue())
.filter(channelPrice -> channelPrice.getEffectiveDate().before(shippingTime))
.max(Comparator.comparing(LogisticChannelPrice::getEffectiveDate));
price = priceCandidate.orElse(null);
if (price == null) {
String format = "Can not find propre channel price for" +
"package Serial No: %s, delivered at %s, " +
"weight: %s, channel name: %s, destination: %s";
String msg = String.format(
@ -729,7 +762,9 @@ public class ShippingInvoiceFactory {
Map<PlatformOrder, List<PlatformOrderContent>> flattenedOrdersMap = uninvoicedOrdersByShopId.values().stream()
.flatMap(map -> map.entrySet().stream())
.collect(toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(flattenedOrdersMap, true);
Map<String, LogisticChannel> logisticChannelMap = logisticChannelMapper.getAll().stream()
.collect(toMap(LogisticChannel::getId, Function.identity()));
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(logisticChannelMap, flattenedOrdersMap, true);
for (Map.Entry<Client, List<Shop>> entry : clientToShopsMap.entrySet()) {
Client client = entry.getKey();
@ -741,7 +776,7 @@ public class ShippingInvoiceFactory {
shopPackageMatFeeMap.put(shop.getId(), shop.getPackagingMaterialFee());
Map<PlatformOrder, List<PlatformOrderContent>> orders = uninvoicedOrdersByShopId.get(shop.getId());
try {
calculateFees(orders, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
calculateFees(logisticChannelMap, orders, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
latestDeclaredValues, client, shopServiceFeeMap,shopPackageMatFeeMap, null);
BigDecimal eurToUsd = exchangeRatesMapper.getLatestExchangeRate("EUR", "USD");
ShippingInvoice invoice = new ShippingInvoice(client, "", "", orders, null, eurToUsd);
@ -785,7 +820,10 @@ public class ShippingInvoiceFactory {
Map<String, BigDecimal> skuServiceFees = new HashMap<>();
skuDataPreparation(skuRealWeights, skuServiceFees);
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(ordersMap, true);
Map<String, LogisticChannel> logisticChannelMap = logisticChannelMapper.getAll().stream()
.collect(toMap(LogisticChannel::getId, Function.identity()));
Map<LogisticChannel, List<LogisticChannelPrice>> channelPriceMap = getChannelPriceMap(logisticChannelMap, ordersMap, true);
for (Shop shop : shops) {
Map<String, BigDecimal> shopServiceFeeMap = new HashMap<>();
@ -794,7 +832,7 @@ public class ShippingInvoiceFactory {
shopPackageMatFeeMap.put(shop.getId(), shop.getPackagingMaterialFee());
Map<PlatformOrder, List<PlatformOrderContent>> orders = uninvoicedOrdersByShopId.get(shop.getId());
try {
calculateFees(orders, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
calculateFees(logisticChannelMap, orders, channelPriceMap, countryList, skuRealWeights, skuServiceFees,
latestDeclaredValues, client, shopServiceFeeMap, shopPackageMatFeeMap, null);
BigDecimal eurToUsd = exchangeRatesMapper.getLatestExchangeRate("EUR", "USD");
ShippingInvoice invoice = new ShippingInvoice(client, "", "", orders, null, eurToUsd);

View File

@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
* @Description:
* @Author: jeecg-boot
* @Date: 2022-05-31
* @Version: V1.1
* @Version: V1.2
*/
@ApiModel(value = "logistic_channel对象", description = "物流渠道")
@Data
@ -68,7 +68,13 @@ public class LogisticChannel implements Serializable {
*/
@Excel(name = "中文名称", width = 15)
@ApiModelProperty(value = "中文名称")
private String zhName;
private java.lang.String zhName;
/**
*
*/
@Excel(name = "渠道编码", width = 15)
@ApiModelProperty(value = "渠道编码")
private java.lang.String code;
/**
*
*/
@ -101,16 +107,17 @@ public class LogisticChannel implements Serializable {
@Excel(name = "是否活跃", width = 15)
@ApiModelProperty(value = "是否活跃")
private String active;
/**
*
*/
@Excel(name = "渠道编码", width = 15)
@ApiModelProperty(value = "渠道编码")
private String code;
/**
*
*/
@Excel(name = "中国仓库", width = 15)
@ApiModelProperty(value = "中国仓库")
private String warehouseInChina;
private java.lang.String warehouseInChina;
/**
* ID
*/
@Excel(name = "对标物流渠道ID", width = 15, dictTable = "logistic_channel", dicText = "internal_name", dicCode = "id")
@Dict(dictTable = "logistic_channel", dicText = "internal_name", dicCode = "id")
@ApiModelProperty(value = "对标物流渠道ID")
private java.lang.String samePriceChannelId;
}

View File

@ -64,8 +64,9 @@ public class SavRefund implements Serializable {
/**
* ID
*/
@Excel(name = "平台订单ID", width = 15, dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
@Dict(dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
// @Excel(name = "平台订单ID", width = 15, dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
@Excel(name = "平台订单ID", width = 15)
// @Dict(dictTable = "platform_order", dicText = "platform_order_id", dicCode = "id")
@ApiModelProperty(value = "平台订单ID")
private String platformOrderId;
/**

View File

@ -25,23 +25,23 @@ public interface LogisticChannelPriceMapper extends BaseMapper<LogisticChannelPr
List<String> getAllCountry();
/**
* Find logistic channel price by indicting its channel name, and destination country,
* Find logistic channel price by indicating its channel name, and destination country,
* also the platform order's shipping time and weight.
*
* @param channelName the channel name
* @param shippingTime the shipping time
* @param weight the weight
* @param country the country, represented by 2 letters code
* @param countryList the country, represented by 2 letters code
* @return one propre price
*/
LogisticChannelPrice findBy(
@Param("channelName") String channelName,
@Param("date") Date shippingTime,
@Param("trueWeight") BigDecimal weight,
@Param("country") String country);
@Param("countryList") List<String> countryList);
/**
* Find logistic channel price by indicting platform order's shipping time
* Find logistic channel price by indicating platform order's shipping time
*
* @param shippingTime the shipping time
* @param distinctCountries Country names
@ -52,7 +52,7 @@ public interface LogisticChannelPriceMapper extends BaseMapper<LogisticChannelPr
@Param("channelNames") List<String> distinctChannelNames);
/**
* Find logistic channel price by indicting its channel id, and destination country,
* Find logistic channel price by indicating its channel id, and destination country,
* also the platform order's shipping time and weight.
*
* @param channelId the channel name

View File

@ -81,7 +81,8 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
List<PlatformOrder> findUninvoicedOrders(
@Param("shopIDs") List<String> shopIds,
@Param("begin") Date begin,
@Param("end") Date end
@Param("end") Date end,
@Param("warehouses") List<String> warehouses
);
/**
@ -114,13 +115,13 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
String findPreviousCompleteInvoice();
Date findEarliestUninvoicedPlatformOrder(List<String> shopIDs);
Date findEarliestUninvoicedPlatformOrder(@Param("shopIDs") List<String> shopIDs);
Date findLatestUninvoicedPlatformOrder(List<String> shopIDs);
Date findLatestUninvoicedPlatformOrder(@Param("shopIDs") List<String> shopIDs);
Date findEarliestUninvoicedPlatformOrderTime(List<String> shopIDs, List<Integer> erpStatuses);
Date findEarliestUninvoicedPlatformOrderTime(@Param("shopIDs") List<String> shopIDs, @Param("erpStatuses") List<Integer> erpStatuses);
Date findLatestUninvoicedPlatformOrderTime(List<String> shopIDs, List<Integer> erpStatuses);
Date findLatestUninvoicedPlatformOrderTime(@Param("shopIDs") List<String> shopIDs, @Param("erpStatuses") List<Integer> erpStatuses);
/**
* Find all platform order containing a particular sku
@ -167,11 +168,13 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
List<PlatformOrderShopSync> fetchOrderInShopsReadyForShopifySync(@Param("shops") List<String> shopCodes);
List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("shops") List<String> shops);
@Param("endDate") String endDate,
@Param("shops") List<String> shops,
@Param("warehouses") List<String> warehouses);
List<PlatformOrder> fetchUninvoicedShippedOrderIDInShopsAndOrderTime(@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("shops") List<String> shops,
@Param("erpStatuses") List<Integer> erpStatuses);
@Param("erpStatuses") List<Integer> erpStatuses,
@Param("warehouses") List<String> warehouses);
}

View File

@ -20,19 +20,31 @@
WHERE zh_name = #{channelName}
AND weight_range_start &lt;= #{trueWeight}
AND weight_range_end &gt;= #{trueWeight}
AND effective_country = #{country}
AND effective_country IN
<foreach collection="countryList"
separator=","
open="("
close=")"
index="index"
item="country"
>
#{country}
</foreach>
AND effective_date &lt;= #{date}
AND active = 1
ORDER BY effective_date DESC
LIMIT 1 </select>
<select id="findPricesBy" resultType="org.jeecg.modules.business.entity.LogisticChannelPrice">
SELECT lcp.*
SELECT lcp.id, lcp.create_by, lcp.create_time, lcp.update_by, lcp.update_time,
lc.id AS channel_id, effective_date, effective_country,
weight_range_start, weight_range_end, minimum_weight, minimum_weight_price, cal_unit, cal_unit_price,
additional_cost, registration_fee, minimum_declared_value, picking_fee_per_item
FROM logistic_channel_price lcp
JOIN logistic_channel lc ON lc.id = lcp.channel_id
JOIN country c ON lcp.effective_country = c.code
JOIN logistic_channel lc ON lc.id = lcp.channel_id or lcp.channel_id = lc.same_price_channel_id
JOIN country c ON lcp.effective_country = c.code
WHERE effective_date &lt;= #{date}
AND (c.name_en IN
AND (c.name_en IN
<foreach
collection="countryNames"
separator=","

View File

@ -130,6 +130,7 @@
<select id="findUninvoicedOrders" resultType="org.jeecg.modules.business.entity.PlatformOrder">
SELECT *
FROM platform_order AS po
JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name
WHERE po.shop_id IN
<foreach
collection="shopIDs"
@ -140,6 +141,17 @@
separator=",">
#{item}
</foreach>
AND lc.warehouse_in_china IN
<foreach
collection="warehouses"
separator=","
open="("
close=")"
index="index"
item="warehouse"
>
#{warehouse}
</foreach>
AND shipping_time >= #{begin}
AND #{end} >= shipping_time
AND shipping_invoice_number IS NULL
@ -201,7 +213,7 @@
<select id="findEarliestUninvoicedPlatformOrder" resultType="date">
SELECT shipping_time
FROM platform_order
FROM platform_order AS po
WHERE shipping_invoice_number IS NULL
AND shipping_time IS NOT NULL
AND erp_status = 3
@ -222,7 +234,7 @@
<select id="findLatestUninvoicedPlatformOrder" resultType="date">
SELECT shipping_time
FROM platform_order
FROM platform_order AS po
WHERE shipping_invoice_number IS NULL
AND shipping_time IS NOT NULL
AND erp_status = 3
@ -447,8 +459,9 @@
</select>
<select id="fetchUninvoicedShippedOrderIDInShops" resultType="org.jeecg.modules.business.entity.PlatformOrder">
SELECT id
SELECT po.id
FROM platform_order po
JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name
WHERE po.shop_id IN
<foreach
collection="shops"
@ -460,12 +473,24 @@
>
#{shop}
</foreach>
AND lc.warehouse_in_china IN
<foreach
collection="warehouses"
separator=","
open="("
close=")"
index="index"
item="warehouse"
>
#{warehouse}
</foreach>
AND po.shipping_time between #{startDate} AND #{endDate}
AND po.erp_status = 3;
</select>
<select id="fetchUninvoicedShippedOrderIDInShopsAndOrderTime" resultType="org.jeecg.modules.business.entity.PlatformOrder">
SELECT id
FROM platform_order po
JOIN logistic_channel lc ON po.logistic_channel_name = lc.zh_name
WHERE po.shop_id IN
<foreach
collection="shops"
@ -477,6 +502,17 @@
>
#{shop}
</foreach>
AND lc.warehouse_in_china IN
<foreach
collection="warehouses"
separator=","
open="("
close=")"
index="index"
item="warehouse"
>
#{warehouse}
</foreach>
AND po.order_time between #{startDate} AND #{endDate}
AND po.erp_status IN
<foreach

View File

@ -47,9 +47,9 @@ public interface ILogisticChannelService extends IService<LogisticChannel> {
* @param country 2 letters code of the destination country
* @return one suitable logistic channel price
*/
LogisticChannelPrice findLogisticsChannelPrice(String channelName, Date date, int trueWeight, String country);
LogisticChannelPrice findLogisticsChannelPrice(String channelName, Date date, int trueWeight, List<String> country);
List<CostTrialCalculation> logisticChannelTrial(int weight, int volume, String country);
List<CostTrialCalculation> logisticChannelTrial(int weight, int volume, List<String> countryList);
}

View File

@ -78,7 +78,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
* @param end end of the period
* @return list of uninvoiced orders
*/
Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrders(List<String> shopIds, Date begin, Date end);
Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrders(List<String> shopIds, Date begin, Date end, List<String> warehouses);
/**
* Find all uninvoiced platform orders by shop ID
@ -95,7 +95,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
* @param end end of the period
* @return list of uninvoiced orders
*/
Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrderContentsForShopsAndStatus(List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses);
Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrderContentsForShopsAndStatus(List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses, List<String> warehouses);
/**
* Fetch data for orders and their contents
@ -138,5 +138,5 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
List<PlatformOrderShopSync> fetchOrderInShopsReadyForShopifySync(List<String> shopCodes);
List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops);
List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops, List<String> warehouses);
}

View File

@ -139,7 +139,8 @@ public class PlatformOrderShippingInvoiceService {
param.shopIDs(),
param.start(),
param.end(),
param.getErpStatuses()
param.getErpStatuses(),
param.getWarehouses()
);
// Chooses invoice template based on client's preference on currency
return getInvoiceMetaData(username, invoice);
@ -211,10 +212,10 @@ public class PlatformOrderShippingInvoiceService {
List<PlatformOrder> platformOrderList;
if(param.getErpStatuses().toString().equals("post")) {
//On récupère les commandes entre 2 dates d'expédition avec un status 3
platformOrderList = platformOrderMapper.fetchUninvoicedShippedOrderIDInShops(param.getStart(), param.getEnd(), param.shopIDs());
platformOrderList = platformOrderMapper.fetchUninvoicedShippedOrderIDInShops(param.getStart(), param.getEnd(), param.shopIDs(), param.getWarehouses());
} else {
// On récupère les commandes entre 2 dates de commandes avec un status (1,2) ou (1,2,3)
platformOrderList = platformOrderMapper.fetchUninvoicedShippedOrderIDInShopsAndOrderTime(param.getStart(), param.getEnd(), param.shopIDs(), param.getErpStatuses());
platformOrderList = platformOrderMapper.fetchUninvoicedShippedOrderIDInShopsAndOrderTime(param.getStart(), param.getEnd(), param.shopIDs(), param.getErpStatuses(), param.getWarehouses());
}
// on récupère seulement les ID des commandes
List<String> orderIds = platformOrderList.stream().map(PlatformOrder::getId).collect(Collectors.toList());

View File

@ -19,10 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Description:
@ -95,7 +92,7 @@ public class LogisticChannelPriceServiceImpl extends ServiceImpl<LogisticChannel
logisticChannelName,
order.getShippingTime(),
weight,
countryCode
Collections.singletonList(countryCode)
);
if (price == null) {

View File

@ -78,12 +78,12 @@ public class LogisticChannelServiceImpl extends ServiceImpl<LogisticChannelMappe
}
@Override
public LogisticChannelPrice findLogisticsChannelPrice(String channelName, Date date, int trueWeight, String country) {
return logisticChannelPriceMapper.findBy(channelName, new java.util.Date(), BigDecimal.valueOf(trueWeight), country);
public LogisticChannelPrice findLogisticsChannelPrice(String channelName, Date date, int trueWeight, List<String> countryList) {
return logisticChannelPriceMapper.findBy(channelName, new java.util.Date(), BigDecimal.valueOf(trueWeight), countryList);
}
@Override
public List<CostTrialCalculation> logisticChannelTrial(int weight, int volume, String country) {
public List<CostTrialCalculation> logisticChannelTrial(int weight, int volume, List<String> countryList) {
List<LogisticChannel> channels = list();
return channels.stream()
@ -98,7 +98,7 @@ public class LogisticChannelServiceImpl extends ServiceImpl<LogisticChannelMappe
} else {
trueWeight = weight;
}
LogisticChannelPrice price = findLogisticsChannelPrice(channelName, new Date(), trueWeight, country);
LogisticChannelPrice price = findLogisticsChannelPrice(channelName, new Date(), trueWeight, countryList);
if (price != null) {
return new CostTrialCalculation(price, trueWeight, internalName, code);
} else {

View File

@ -265,9 +265,9 @@ public class PlatformOrderServiceImpl extends ServiceImpl<PlatformOrderMapper, P
}
@Override
public Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrders(List<String> shopIds, Date begin, Date end) {
List<PlatformOrder> orderList = platformOrderMap.findUninvoicedOrders(shopIds, begin, end);
List<PlatformOrderContent> orderContents = platformOrderContentMap.findUninvoicedOrderContents(shopIds, begin, end);
public Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrders(List<String> shopIds, Date begin, Date end, List<String> warehouses) {
List<PlatformOrder> orderList = platformOrderMap.findUninvoicedOrders(shopIds, begin, end, warehouses);
List<PlatformOrderContent> orderContents = platformOrderContentMap.fetchOrderContent(orderList.stream().map(PlatformOrder::getId).collect(toList()));
Map<String, PlatformOrder> orderMap = orderList.stream().collect(toMap(PlatformOrder::getId, Function.identity()));
return orderContents.stream().collect(groupingBy(platformOrderContent -> orderMap.get(platformOrderContent.getPlatformOrderId())));
}
@ -287,7 +287,7 @@ public class PlatformOrderServiceImpl extends ServiceImpl<PlatformOrderMapper, P
);
}
@Override
public Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrderContentsForShopsAndStatus(List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses) {
public Map<PlatformOrder, List<PlatformOrderContent>> findUninvoicedOrderContentsForShopsAndStatus(List<String> shopIds, Date begin, Date end, List<Integer> erpStatuses, List<String> warehouses) {
List<PlatformOrder> orderList = platformOrderMap.findUninvoicedOrdersForShopsAndStatus(shopIds, begin, end, erpStatuses);
List<PlatformOrderContent> orderContents = platformOrderContentMap.findUninvoicedOrderContentsForShopsAndStatus(shopIds, begin, end, erpStatuses);
Map<String, PlatformOrder> orderMap = orderList.stream().collect(toMap(PlatformOrder::getId, Function.identity()));
@ -363,7 +363,7 @@ public class PlatformOrderServiceImpl extends ServiceImpl<PlatformOrderMapper, P
}
@Override
public List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops) {
return platformOrderMap.fetchUninvoicedShippedOrderIDInShops(startDate, endDate, shops);
public List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops, List<String> warehouses) {
return platformOrderMap.fetchUninvoicedShippedOrderIDInShops(startDate, endDate, shops, warehouses);
}
}

View File

@ -15,14 +15,21 @@ public class ShippingInvoiceParam {
private final String start;
private final String end;
private final List<Integer> erpStatuses;
private final List<String> warehouses;
private final static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
public ShippingInvoiceParam(@JsonProperty("clientID") String clientID, @JsonProperty("shopIDs") List<String> shopIDs, @JsonProperty("start") String start, @JsonProperty("end") String end, @JsonProperty("erpStatuses") List<Integer> erpStatuses) {
public ShippingInvoiceParam(@JsonProperty("clientID") String clientID,
@JsonProperty("shopIDs") List<String> shopIDs,
@JsonProperty("start") String start,
@JsonProperty("end") String end,
@JsonProperty("erpStatuses") List<Integer> erpStatuses,
@JsonProperty("warehouses") List<String> warehouses) {
this.clientID = clientID;
this.shopIDs = shopIDs;
this.start = start;
this.end = end;
this.erpStatuses = erpStatuses;
this.warehouses = warehouses;
}
public String clientID() {
@ -40,20 +47,24 @@ public class ShippingInvoiceParam {
public Date end() throws ParseException {
return format.parse(end);
}
public List<Integer> getErpStatuses() { return erpStatuses; }
public String getStart() {
return this.start;
}
public String getEnd() {
return this.end;
}
public List<Integer> getErpStatuses() { return erpStatuses; }
public List<String> getWarehouses() {
return warehouses;
}
@Override
public String toString() {
return "ShippingInvoiceParam{" + clientID +
", shopIDs=" + shopIDs +
", start=" + start +
", end=" + end +
", end=" + erpStatuses +
", warehouses=" + warehouses +
'}';
}
}

View File

@ -1,5 +1,5 @@
server:
port: 8080
port: 8081
tomcat:
max-swallow-size: -1
error:
@ -7,7 +7,7 @@ server:
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /jeecg-boot
context-path: /app
compression:
enabled: true
min-response-size: 1024
@ -26,8 +26,8 @@ spring:
max-request-size: 10MB
mail:
host: smtp.gmail.com
username: ?
password: ?
username: service@wia-sourcing.com
password: WIAsourcing2019*
properties:
mail:
smtp:
@ -131,9 +131,9 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: root
url: jdbc:mysql://127.0.0.1:3306/new_wia_app?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: admin
password: WIASourcing2021
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
@ -181,7 +181,7 @@ jeecg:
# 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local\minio\alioss
uploadType: alioss
uploadType: local
# 前端访问地址
domainUrl:
pc: http://localhost:3100