97 lines
3.2 KiB
Java
97 lines
3.2 KiB
Java
|
|
|
||
|
|
/**
|
||
|
|
* @Project: emis
|
||
|
|
* @Title: EmisDestinationController.java
|
||
|
|
* @author linfso
|
||
|
|
* @date 2024-01-10 02:53:35
|
||
|
|
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||
|
|
* @version v1.0
|
||
|
|
* @Description: <p> 目的地 控制器 </p>
|
||
|
|
*/
|
||
|
|
|
||
|
|
package com.xdadan.erp.apiweb;
|
||
|
|
|
||
|
|
import com.xdadan.erp.common.annotation.Log;
|
||
|
|
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||
|
|
import com.xdadan.erp.common.core.controller.BaseController;
|
||
|
|
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||
|
|
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||
|
|
import com.xdadan.erp.common.enums.BusinessType;
|
||
|
|
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||
|
|
import com.xdadan.erp.emis.domain.EmisDestination;
|
||
|
|
import com.xdadan.erp.emis.service.IEmisDestinationService;
|
||
|
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 目的地Controller
|
||
|
|
*
|
||
|
|
* @author linfso
|
||
|
|
* @date 2024-01-10 02:53:35
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/apiweb/emisDestination")
|
||
|
|
public class DestinationController extends BaseController
|
||
|
|
{
|
||
|
|
@Autowired
|
||
|
|
private IEmisDestinationService emisDestinationService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 根据客户信息获取目的地站点
|
||
|
|
* @param province
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@GetMapping("/getDestSite")
|
||
|
|
@JacksonFilter(include= {
|
||
|
|
"id","destCode","destName","destNameEn",
|
||
|
|
"lineCode","lineName","countryName","country","siteCode","siteName",
|
||
|
|
},value= EmisDestination.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||
|
|
public AjaxResult getDestSite(String country,String lineCode,String province,String city,String county,String address)
|
||
|
|
{
|
||
|
|
if(StringUtils.isAnyEmpty(province)){
|
||
|
|
return AjaxResult.error("参数错误,省份不能为空!");
|
||
|
|
}
|
||
|
|
|
||
|
|
EmisDestination dest = emisDestinationService.calcDestSite(country,lineCode,province,city,county,address);
|
||
|
|
if(dest==null){
|
||
|
|
return AjaxResult.error("联系客户,收件地不在服务范围!");
|
||
|
|
}else{
|
||
|
|
return AjaxResult.success("获取成功",dest);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取寄件网点
|
||
|
|
* @param province
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@GetMapping("/getSendSite")
|
||
|
|
@JacksonFilter(include= {
|
||
|
|
"id","destCode","destName","destNameEn",
|
||
|
|
"lineCode","lineName","countryName","country","siteCode","siteName",
|
||
|
|
},value= EmisDestination.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||
|
|
public AjaxResult getSendSite(String country,String lineCode,String province,String city,String county,String address)
|
||
|
|
{
|
||
|
|
if(StringUtils.isAnyEmpty(province)){
|
||
|
|
return AjaxResult.error("参数错误,省份不能为空!");
|
||
|
|
}
|
||
|
|
|
||
|
|
EmisDestination dest = emisDestinationService.calcDestSite(country,lineCode,province,city,county,address);
|
||
|
|
if(dest==null){
|
||
|
|
return AjaxResult.error("联系客户,收件地不在服务范围!");
|
||
|
|
}else{
|
||
|
|
return AjaxResult.success("获取成功",dest);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|