2024-07-30 02:36:28 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Project: emis
|
|
|
|
|
* @Title: EmisWarehouseInController.java
|
|
|
|
|
* @author linfso
|
|
|
|
|
* @date 2024-05-22 00:20:31
|
|
|
|
|
* @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;
|
2024-08-30 21:40:11 +00:00
|
|
|
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
2024-07-30 02:36:28 +00:00
|
|
|
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.EmisWarehouseIn;
|
|
|
|
|
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
|
|
|
|
import com.xdadan.erp.emis.domain.vo.WaybillOrder;
|
|
|
|
|
import com.xdadan.erp.emis.service.IEmisWarehouseInService;
|
|
|
|
|
import com.xdadan.erp.emis.service.IEmisWaybillService;
|
|
|
|
|
import com.xdadan.erp.emis.utils.WaybillHelper;
|
|
|
|
|
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.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 进仓单Controller
|
|
|
|
|
*
|
|
|
|
|
* @author linfso
|
|
|
|
|
* @date 2024-05-22 00:20:31
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/apiweb/emisWarehouseIn")
|
|
|
|
|
public class WarehouseInController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
@Autowired
|
|
|
|
|
private IEmisWarehouseInService emisWarehouseInService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IEmisWaybillService emisWaybillService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询进仓单列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(EmisWarehouseIn emisWarehouseIn)
|
|
|
|
|
{
|
|
|
|
|
startPage();
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(emisWarehouseIn.getBillCode())){
|
|
|
|
|
emisWarehouseIn.setBillCode( WaybillHelper.formatQueryValue(emisWarehouseIn.getBillCode()));
|
|
|
|
|
String[] billCodeSortList = emisWarehouseIn.getBillCode().split(",");
|
|
|
|
|
if(billCodeSortList.length>1){
|
|
|
|
|
emisWarehouseIn.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(emisWarehouseIn.getInNo())){
|
|
|
|
|
emisWarehouseIn.setInNo(WaybillHelper.formatQueryValue(emisWarehouseIn.getInNo()));
|
|
|
|
|
String[] inNoSortList = emisWarehouseIn.getInNo().split(",");
|
|
|
|
|
if(inNoSortList.length>1){
|
|
|
|
|
emisWarehouseIn.getParams().put("inNoSortList",Arrays.asList(inNoSortList));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<EmisWarehouseIn> list = emisWarehouseInService.selectEmisWarehouseInList(emisWarehouseIn);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-30 21:40:11 +00:00
|
|
|
|
|
|
|
|
@JacksonFilter(include= {
|
|
|
|
|
"inNo",
|
|
|
|
|
"orderSn",
|
|
|
|
|
"billCode",
|
|
|
|
|
"createTime",
|
|
|
|
|
"entryDate",
|
|
|
|
|
"confirmStatus",
|
|
|
|
|
"confirmDate",
|
|
|
|
|
"usedStatus",
|
2024-09-08 03:45:37 +00:00
|
|
|
"stockInFlag",
|
2024-08-30 21:40:11 +00:00
|
|
|
"status",
|
2024-08-30 21:57:33 +00:00
|
|
|
"intoWarehouseCode",
|
|
|
|
|
"intoWarehouseName",
|
|
|
|
|
"intoWarehouseAddress",
|
|
|
|
|
"intoWarehouseContact",
|
|
|
|
|
"intoWarehousePhone",
|
|
|
|
|
"goodsInfo",
|
|
|
|
|
"receiveCountryName",
|
|
|
|
|
"receiveProvinceName",
|
|
|
|
|
"sendCountryName",
|
|
|
|
|
"sendProvinceName",
|
|
|
|
|
"transLineTypeName",
|
|
|
|
|
"productTypeName",
|
|
|
|
|
"sendSiteName",
|
2024-08-30 22:22:29 +00:00
|
|
|
"dispatchUnderlingSiteName",
|
|
|
|
|
"waybillDetail"
|
2024-08-30 21:40:11 +00:00
|
|
|
},value= EmisWarehouseIn.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
2024-07-30 02:36:28 +00:00
|
|
|
@GetMapping("/listSimple")
|
|
|
|
|
public TableDataInfo listSimple(EmisWarehouseIn emisWarehouseIn)
|
|
|
|
|
{
|
|
|
|
|
startPage();
|
|
|
|
|
emisWarehouseIn.setUsedStatus("0");
|
|
|
|
|
List<EmisWarehouseIn> list = emisWarehouseInService.selectEmisWarehouseInList(emisWarehouseIn);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取进仓单详细信息
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/getWarehouseInByInNo")
|
|
|
|
|
public AjaxResult getWarehouseInByInNo(EmisWarehouseIn emisWarehouseIn)
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.success(emisWarehouseInService.selectEmisWarehouseInByInNo(emisWarehouseIn.getInNo()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出进仓单模板
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "导出进仓单", businessType = BusinessType.EXPORT)
|
2024-09-01 13:13:16 +00:00
|
|
|
@PostMapping("/exportWarehouseInTpl")
|
2024-09-01 12:48:50 +00:00
|
|
|
public AjaxResult exportWarehouseInTpl(HttpServletResponse response,String orderSn) {
|
2024-07-30 02:36:28 +00:00
|
|
|
|
|
|
|
|
try{
|
2024-09-01 12:48:50 +00:00
|
|
|
emisWaybillService.genWarehouseInTplFile(response,orderSn);
|
2024-07-30 02:36:28 +00:00
|
|
|
return AjaxResult.success("下载成功");
|
|
|
|
|
}
|
|
|
|
|
catch(EmisBizError ex){
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
return AjaxResult.error("("+ex.getErrorCode()+")"+ex.getMessage());
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex){
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
// 返回子定义异常
|
|
|
|
|
if(ex instanceof EmisBizError){
|
|
|
|
|
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AjaxResult.error("服务器异常,联系客服");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|