mirror of https://github.com/jeecgboot/jeecg-boot
Merge pull request #146 from LQYBill/feat/logisticExpenses
(WIP) Logistic expenses by companypull/8040/head
commit
97ab586303
|
@ -0,0 +1,163 @@
|
|||
package org.jeecg.modules.business.controller.admin;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.business.entity.LogisticCompany;
|
||||
import org.jeecg.modules.business.service.ILogisticCompanyService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: logistic_company
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-03-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="logistic_company")
|
||||
@RestController
|
||||
@RequestMapping("/logisticCompany")
|
||||
@Slf4j
|
||||
public class LogisticCompanyController extends JeecgController<LogisticCompany, ILogisticCompanyService> {
|
||||
@Autowired
|
||||
private ILogisticCompanyService logisticCompanyService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param logisticCompany
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "logistic_company-分页列表查询")
|
||||
@ApiOperation(value="logistic_company-分页列表查询", notes="logistic_company-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<LogisticCompany>> queryPageList(LogisticCompany logisticCompany,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LogisticCompany> queryWrapper = QueryGenerator.initQueryWrapper(logisticCompany, req.getParameterMap());
|
||||
Page<LogisticCompany> page = new Page<LogisticCompany>(pageNo, pageSize);
|
||||
IPage<LogisticCompany> pageList = logisticCompanyService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param logisticCompany
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_company-添加")
|
||||
@ApiOperation(value="logistic_company-添加", notes="logistic_company-添加")
|
||||
@RequiresPermissions("business:logistic_company:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody LogisticCompany logisticCompany) {
|
||||
logisticCompanyService.save(logisticCompany);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param logisticCompany
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_company-编辑")
|
||||
@ApiOperation(value="logistic_company-编辑", notes="logistic_company-编辑")
|
||||
@RequiresPermissions("business:logistic_company:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody LogisticCompany logisticCompany) {
|
||||
logisticCompanyService.updateById(logisticCompany);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_company-通过id删除")
|
||||
@ApiOperation(value="logistic_company-通过id删除", notes="logistic_company-通过id删除")
|
||||
@RequiresPermissions("business:logistic_company:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
logisticCompanyService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_company-批量删除")
|
||||
@ApiOperation(value="logistic_company-批量删除", notes="logistic_company-批量删除")
|
||||
@RequiresPermissions("business:logistic_company:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.logisticCompanyService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "logistic_company-通过id查询")
|
||||
@ApiOperation(value="logistic_company-通过id查询", notes="logistic_company-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LogisticCompany> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LogisticCompany logisticCompany = logisticCompanyService.getById(id);
|
||||
if(logisticCompany==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(logisticCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param logisticCompany
|
||||
*/
|
||||
@RequiresPermissions("business:logistic_company:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LogisticCompany logisticCompany) {
|
||||
return super.exportXls(request, logisticCompany, LogisticCompany.class, "logistic_company");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("business:logistic_company:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, LogisticCompany.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
package org.jeecg.modules.business.controller.admin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.business.entity.LogisticExpenseDetail;
|
||||
import org.jeecg.modules.business.service.ILogisticCompanyService;
|
||||
import org.jeecg.modules.business.service.ILogisticExpenseDetailService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.modules.business.vo.LogisticCompanyEnum;
|
||||
import org.jeecg.modules.business.vo.ResponsesWithMsg;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: logistic_expense_detail
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-02-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="logistic_expense_detail")
|
||||
@RestController
|
||||
@RequestMapping("/logisticExpenseDetail")
|
||||
@Slf4j
|
||||
public class LogisticExpenseDetailController extends JeecgController<LogisticExpenseDetail, ILogisticExpenseDetailService> {
|
||||
@Autowired
|
||||
private ILogisticExpenseDetailService logisticExpenseDetailService;
|
||||
@Autowired
|
||||
private ILogisticCompanyService logisticCompanyService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param logisticExpenseDetail
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "logistic_expense_detail-分页列表查询")
|
||||
@ApiOperation(value="logistic_expense_detail-分页列表查询", notes="logistic_expense_detail-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<LogisticExpenseDetail>> queryPageList(LogisticExpenseDetail logisticExpenseDetail,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LogisticExpenseDetail> queryWrapper = QueryGenerator.initQueryWrapper(logisticExpenseDetail, req.getParameterMap());
|
||||
Page<LogisticExpenseDetail> page = new Page<LogisticExpenseDetail>(pageNo, pageSize);
|
||||
IPage<LogisticExpenseDetail> pageList = logisticExpenseDetailService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param logisticExpenseDetail
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_expense_detail-添加")
|
||||
@ApiOperation(value="logistic_expense_detail-添加", notes="logistic_expense_detail-添加")
|
||||
@RequiresPermissions("business:logistic_expense_detail:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody LogisticExpenseDetail logisticExpenseDetail) {
|
||||
logisticExpenseDetailService.save(logisticExpenseDetail);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param logisticExpenseDetail
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_expense_detail-编辑")
|
||||
@ApiOperation(value="logistic_expense_detail-编辑", notes="logistic_expense_detail-编辑")
|
||||
@RequiresPermissions("business:logistic_expense_detail:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody LogisticExpenseDetail logisticExpenseDetail) {
|
||||
logisticExpenseDetailService.updateById(logisticExpenseDetail);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_expense_detail-通过id删除")
|
||||
@ApiOperation(value="logistic_expense_detail-通过id删除", notes="logistic_expense_detail-通过id删除")
|
||||
@RequiresPermissions("business:logistic_expense_detail:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
logisticExpenseDetailService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "logistic_expense_detail-批量删除")
|
||||
@ApiOperation(value="logistic_expense_detail-批量删除", notes="logistic_expense_detail-批量删除")
|
||||
@RequiresPermissions("business:logistic_expense_detail:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.logisticExpenseDetailService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "logistic_expense_detail-通过id查询")
|
||||
@ApiOperation(value="logistic_expense_detail-通过id查询", notes="logistic_expense_detail-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LogisticExpenseDetail> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LogisticExpenseDetail logisticExpenseDetail = logisticExpenseDetailService.getById(id);
|
||||
if(logisticExpenseDetail==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(logisticExpenseDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param logisticExpenseDetail
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LogisticExpenseDetail logisticExpenseDetail) {
|
||||
return super.exportXls(request, logisticExpenseDetail, LogisticExpenseDetail.class, "logistic_expense_detail");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request) throws IOException, ServletException {
|
||||
log.info("Importing logistic expense detail excel");
|
||||
ResponsesWithMsg responses = new ResponsesWithMsg();
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
MultipartFile file = multipartRequest.getFile("file");
|
||||
if(file == null) {
|
||||
return Result.error(400,"Missing file");
|
||||
}
|
||||
request.getParameterMap().forEach((k, v) -> log.info("key: {}, value: {}", k, Arrays.asList(v)));
|
||||
String logisticCompany = request.getParameterValues("logisticCompany")[0];
|
||||
System.out.println(logisticCompany);
|
||||
if(logisticCompany == null) {
|
||||
return Result.error(400,"Missing logistic company param");
|
||||
}
|
||||
try {
|
||||
LogisticCompanyEnum logisticCompanyEnum = LogisticCompanyEnum.valueOf(logisticCompany);
|
||||
logisticExpenseDetailService.importExcel(file, logisticCompanyEnum);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(400,"Invalid logistic company param");
|
||||
}
|
||||
|
||||
return Result.OK();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package org.jeecg.modules.business.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: logistic_company
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-03-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("logistic_company")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="logistic_company对象", description="logistic_company")
|
||||
public class LogisticCompany implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**名称*/
|
||||
@Excel(name = "名称", width = 15)
|
||||
@ApiModelProperty(value = "名称")
|
||||
private java.lang.String name;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
public class AnTuExpenseDetail {
|
||||
@Excel(name="原单号")
|
||||
private String platformOrderId;
|
||||
@Excel(name="转单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="国家")
|
||||
private String targetCountry;
|
||||
@Excel(name="计费重")
|
||||
private String chargingWeight;
|
||||
@Excel(name="运费")
|
||||
private String serviceFee;
|
||||
@Excel(name="燃油")
|
||||
private String fuelSurcharge;
|
||||
@Excel(name="杂费")
|
||||
private String additionalFee;
|
||||
@Excel(name="总金额")
|
||||
private String totalFee;
|
||||
/**
|
||||
* 备注
|
||||
* format : 配货:Sku1;Sku2;...;SkuN;
|
||||
*/
|
||||
@Excel(name="备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CNEExpenseDetail {
|
||||
@Excel(name="内单号")
|
||||
private String internalTrackingNumber;
|
||||
@Excel(name="转单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="参考号")
|
||||
private String platformOrderId;
|
||||
@Excel(name="产品名称")
|
||||
private String logisticChannelName;
|
||||
@Excel(name="目的地")
|
||||
private String targetCountryCn;
|
||||
@Excel(name="计费重(kg)")
|
||||
private BigDecimal chargingWeight;
|
||||
@Excel(name="金额")
|
||||
private BigDecimal totalFee;
|
||||
@Excel(name="币种")
|
||||
private String currency;
|
||||
@Excel(name="备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CNEExtraExpenseDetail {
|
||||
@Excel(name="附加费类型")
|
||||
private String feeType;
|
||||
@Excel(name="关联单号类型")
|
||||
private String relatedExpenseField;
|
||||
@Excel(name="关联单号")
|
||||
private String relatedExpenseValue;
|
||||
@Excel(name="金额")
|
||||
private BigDecimal totalFee;
|
||||
@Excel(name="币种")
|
||||
private String currency;
|
||||
@Excel(name="费用备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CNERefundDetail {
|
||||
@Excel(name="转单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="退款")
|
||||
private BigDecimal totalFee;
|
||||
@Excel(name="币种")
|
||||
private String currency;
|
||||
@Excel(name="退款原因")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CaiNiaoExpenseDetail {
|
||||
@Excel(name="费用项")
|
||||
private String expenseName;
|
||||
@Excel(name="物流商品")
|
||||
private String logisticChannelName;
|
||||
@Excel(name="计费币种")
|
||||
private String chargingCurrency;
|
||||
@Excel(name="计费金额")
|
||||
private BigDecimal billingAmount;
|
||||
@Excel(name="支付币种")
|
||||
private String paymentCurrency;
|
||||
@Excel(name="支付金额")
|
||||
private BigDecimal paymentAmount;
|
||||
@Excel(name="ERP单号")
|
||||
private String platformOrderId;
|
||||
@Excel(name="包裹计费重(克)")
|
||||
private String chargingWeight;
|
||||
@Excel(name="外单计泡包裹泡重")
|
||||
private BigDecimal volumetricWeight;
|
||||
@Excel(name="外单计泡包裹实重")
|
||||
private BigDecimal realWeight;
|
||||
@Excel(name="收件地址-国家")
|
||||
private String targetCountry;
|
||||
@Excel(name="目的国家-中文")
|
||||
private String targetCountryCn;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class WanBangExpenseDetail {
|
||||
@Excel(name="转单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="渠道名称")
|
||||
private String logisticChannelName;
|
||||
@Excel(name="计算重(kg)")
|
||||
private BigDecimal chargingWeight;
|
||||
@Excel(name="目的地")
|
||||
private String targetCountry;
|
||||
@Excel(name="基本邮费")
|
||||
private BigDecimal shippingFee;
|
||||
@Excel(name="处理费")
|
||||
private BigDecimal registrationFee;
|
||||
@Excel(name="关税")
|
||||
private BigDecimal customsDuty;
|
||||
@Excel(name="偏远附加费")
|
||||
private BigDecimal additionalFee;
|
||||
@Excel(name="燃油附加费")
|
||||
private BigDecimal fuelSurcharge;
|
||||
@Excel(name="超尺寸费")
|
||||
private BigDecimal oversizeSurcharge;
|
||||
@Excel(name="总额")
|
||||
private BigDecimal totalFee;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class WanBangOtherExpenseDetail {
|
||||
@Excel(name="类型")
|
||||
private String additionalFeeType;
|
||||
@Excel(name="金额")
|
||||
private BigDecimal totalFee;
|
||||
@Excel(name="快递单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="重量(Kg)")
|
||||
private BigDecimal weight;
|
||||
@Excel(name="备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.jeecg.modules.business.entity.LogisticExpense;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class YDHExpenseDetail {
|
||||
@Excel(name="客户单号")
|
||||
private String platformOrderId;
|
||||
@Excel(name="跟踪单号")
|
||||
private String trackingNumber;
|
||||
@Excel(name="目的国家")
|
||||
private String targetCountry;
|
||||
@Excel(name="实重")
|
||||
private BigDecimal realWeight;
|
||||
@Excel(name="体积重")
|
||||
private BigDecimal volumetricWeight;
|
||||
@Excel(name="计费重")
|
||||
private BigDecimal chargingWeight;
|
||||
@Excel(name="运费")
|
||||
private BigDecimal shippingFee;
|
||||
@Excel(name="燃油费")
|
||||
private BigDecimal fuelCosts;
|
||||
@Excel(name="挂号费")
|
||||
private BigDecimal registrationFee;
|
||||
@Excel(name="其他费用")
|
||||
private BigDecimal additionalFee;
|
||||
@Excel(name="时间段费用")
|
||||
private BigDecimal timePeriodFee;
|
||||
@Excel(name="总费用")
|
||||
private BigDecimal totalFee;
|
||||
}
|
|
@ -152,6 +152,12 @@ public class LogisticExpenseDetail implements Serializable {
|
|||
@Excel(name = "附加费用", width = 15)
|
||||
@ApiModelProperty(value = "附加费用")
|
||||
private BigDecimal additionalFee;
|
||||
/**
|
||||
* 附加费用备注
|
||||
*/
|
||||
@Excel(name = "附加费用备注", width = 15)
|
||||
@ApiModelProperty(value = "附加费用备注")
|
||||
private BigDecimal additionalFeeRemark;
|
||||
/**
|
||||
* 总费用
|
||||
*/
|
||||
|
@ -171,4 +177,10 @@ public class LogisticExpenseDetail implements Serializable {
|
|||
@Excel(name = "货物赔偿", width = 15)
|
||||
@ApiModelProperty(value = "货物赔偿")
|
||||
private BigDecimal compensation;
|
||||
/**
|
||||
* 货物赔偿备注
|
||||
*/
|
||||
@Excel(name = "货物赔偿备注", width = 15)
|
||||
@ApiModelProperty(value = "货物赔偿备注")
|
||||
private BigDecimal compensationRemark;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.business.entity.LogisticCompany;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description: logistic_company
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-03-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface LogisticCompanyMapper extends BaseMapper<LogisticCompany> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?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="org.jeecg.modules.business.mapper.LogisticCompanyMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.business.service;
|
||||
|
||||
import org.jeecg.modules.business.entity.LogisticCompany;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: logistic_company
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-03-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILogisticCompanyService extends IService<LogisticCompany> {
|
||||
|
||||
}
|
|
@ -2,9 +2,13 @@ package org.jeecg.modules.business.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.business.entity.LogisticExpenseDetail;
|
||||
import org.jeecg.modules.business.vo.LogisticCompanyEnum;
|
||||
import org.jeecg.modules.business.vo.LogisticExpenseProportion;
|
||||
import org.jeecg.modules.business.vo.dashboard.PeriodLogisticProfit;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -35,4 +39,6 @@ public interface ILogisticExpenseDetailService extends IService<LogisticExpenseD
|
|||
List<String> allChannels();
|
||||
|
||||
boolean saveBatch(Collection<LogisticExpenseDetail> expenseDetails);
|
||||
|
||||
void importExcel(MultipartFile file, LogisticCompanyEnum logisticCompanyEnum);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.business.service.impl;
|
||||
|
||||
import org.jeecg.modules.business.entity.LogisticCompany;
|
||||
import org.jeecg.modules.business.mapper.LogisticCompanyMapper;
|
||||
import org.jeecg.modules.business.service.ILogisticCompanyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: logistic_company
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-03-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LogisticCompanyServiceImpl extends ServiceImpl<LogisticCompanyMapper, LogisticCompany> implements ILogisticCompanyService {
|
||||
|
||||
}
|
|
@ -2,17 +2,23 @@ package org.jeecg.modules.business.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sun.istack.NotNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.business.entity.LogisticExpense.*;
|
||||
import org.jeecg.modules.business.entity.LogisticExpenseDetail;
|
||||
import org.jeecg.modules.business.mapper.LogisticExpenseDetailMapper;
|
||||
import org.jeecg.modules.business.mapper.PlatformOrderMapper;
|
||||
import org.jeecg.modules.business.service.ILogisticExpenseDetailService;
|
||||
import org.jeecg.modules.business.vo.LogisticCompanyEnum;
|
||||
import org.jeecg.modules.business.vo.LogisticExpenseProportion;
|
||||
import org.jeecg.modules.business.vo.PlatformOrderLogisticExpenseDetail;
|
||||
import org.jeecg.modules.business.vo.ResponsesWithMsg;
|
||||
import org.jeecg.modules.business.vo.dashboard.PeriodLogisticProfit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
@ -29,6 +35,7 @@ import java.util.stream.Stream;
|
|||
* @Date: 2021-07-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class LogisticExpenseDetailServiceImpl extends ServiceImpl<LogisticExpenseDetailMapper, LogisticExpenseDetail> implements ILogisticExpenseDetailService {
|
||||
|
||||
|
@ -205,6 +212,77 @@ public class LogisticExpenseDetailServiceImpl extends ServiceImpl<LogisticExpens
|
|||
return this.executeBatch((sqlSession) -> logisticExpenseDetailMapper.insertOrMerge(expenseDetails));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importExcel(MultipartFile file, LogisticCompanyEnum logisticCompanyEnum) {
|
||||
ResponsesWithMsg responses = new ResponsesWithMsg();
|
||||
Class<?> clazz = LogisticExpenseDetail.class;
|
||||
switch (logisticCompanyEnum) {
|
||||
case DISIFANG:
|
||||
|
||||
break;
|
||||
case CNE:
|
||||
log.info("Importing CNE expense detail excel");
|
||||
clazz = CNEExpenseDetail.class;
|
||||
break;
|
||||
case CHUKOUYI:
|
||||
|
||||
break;
|
||||
case ANTU:
|
||||
log.info("Importing AnTu expense detail excel");
|
||||
clazz = AnTuExpenseDetail.class;
|
||||
break;
|
||||
case MIAOXIN:
|
||||
|
||||
break;
|
||||
case YUNTU:
|
||||
|
||||
break;
|
||||
case JITU:
|
||||
|
||||
break;
|
||||
case WANGUOYOULIAN:
|
||||
|
||||
break;
|
||||
case WANGYISUDA:
|
||||
|
||||
break;
|
||||
case YIDA:
|
||||
log.info("Importing Yida expense detail excel");
|
||||
clazz = YDHExpenseDetail.class;
|
||||
break;
|
||||
case UBI:
|
||||
|
||||
break;
|
||||
case JIEHANG:
|
||||
|
||||
break;
|
||||
case WANBANG:
|
||||
log.info("Importing WanBang expense detail excel");
|
||||
clazz = WanBangExpenseDetail.class;
|
||||
break;
|
||||
case WIA:
|
||||
|
||||
break;
|
||||
case CHENMINGKUNXIAOBAO:
|
||||
|
||||
break;
|
||||
case CAINIAO:
|
||||
log.info("Importing CaiNiao expense detail excel");
|
||||
clazz = CaiNiaoExpenseDetail.class;
|
||||
break;
|
||||
case SHENZHENYUANPENG:
|
||||
|
||||
break;
|
||||
case WEIKELU:
|
||||
|
||||
break;
|
||||
case WANTONGWULIU:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> allCountries() {
|
||||
return platformOrderMapper.allCountries();
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package org.jeecg.modules.business.vo;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum LogisticCompanyEnum {
|
||||
DISIFANG ("递四方"),
|
||||
CNE ("CNE"),
|
||||
CHUKOUYI ("出口易"),
|
||||
ANTU ("安途"),
|
||||
MIAOXIN ("淼信"),
|
||||
YUNTU ("云途"),
|
||||
JITU ("极兔"),
|
||||
WANGUOYOULIAN ("万国优联"),
|
||||
WANGYISUDA ("网易速达"),
|
||||
YIDA ("义达"),
|
||||
UBI ("UBI"),
|
||||
JIEHANG ("杰航"),
|
||||
WANBANG ("万邦"),
|
||||
WIA ("WIA"),
|
||||
CHENMINGKUNXIAOBAO ("晨明坤小包"),
|
||||
CAINIAO ("菜鸟"),
|
||||
SHENZHENYUANPENG ("深圳远朋"),
|
||||
WEIKELU("维客路(海外仓)"),
|
||||
WANTONGWULIU ("万通物流");
|
||||
|
||||
private final String name;
|
||||
|
||||
LogisticCompanyEnum(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue