Commit efe7753a by huluobin

# 费用系统 配置 批量导入导出

parent 714b818c
...@@ -2,11 +2,10 @@ package com.blt.other.module.cost.controller; ...@@ -2,11 +2,10 @@ package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.response.CostResult; import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.database.model.LogisticsSupplierBankDomain; import com.blt.other.module.cost.dto.request.*;
import com.blt.other.module.cost.dto.request.CostTypeAddReq;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult; import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.dto.response.GetLogisticsBankResp;
import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp;
import com.blt.other.module.cost.service.CostTypeKindService; import com.blt.other.module.cost.service.CostTypeKindService;
import com.blt.other.module.cost.service.CostTypeService; import com.blt.other.module.cost.service.CostTypeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -15,8 +14,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -15,8 +14,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import javax.servlet.http.HttpServletResponse;
import java.util.Map; import java.io.IOException;
@Slf4j @Slf4j
@Api(tags = "类型接口") @Api(tags = "类型接口")
...@@ -76,25 +75,29 @@ public class CostTypeController { ...@@ -76,25 +75,29 @@ public class CostTypeController {
@ApiOperation("获取物流subjectCode") @ApiOperation("获取物流subjectCode")
@GetMapping("/getLogisticsCode") @GetMapping("/getLogisticsCode")
public Map<String, Object> getLogisticsCode() { public GetLogisticsCodeResp getLogisticsCode() {
log.info("获取物流subjectCode"); log.info("获取物流subjectCode");
Map<String, Object> result = new HashMap<>(); return costTypeService.getLogisticsCode();
result.put("success", true);
result.put("logisticsCode", "22222");
return result;
} }
@ApiOperation("获取物流银行帐号") @ApiOperation("获取物流银行帐号")
@PostMapping("/getLogisticsBank") @PostMapping("/getLogisticsBank")
public Map<String, Object> getLogisticsBank(@RequestParam String subSupplierName) { public GetLogisticsBankResp getLogisticsBank(@RequestParam String subSupplierName) {
Map<String, Object> result = new HashMap<>(); return costTypeService.getLogisticsBank(subSupplierName);
LogisticsSupplierBankDomain bankDomain = costTypeKindService.getLogisticsBank(subSupplierName); }
if (bankDomain != null) {
result.put("success", true); @ApiOperation("批量导入数据")
result.put("bankInfo", bankDomain); @PostMapping("/importExcel")
} else { public CostResult<Void> importExcel(@RequestBody CostTypeImportExcelReq excel) throws IOException {
result.put("success", false); costTypeService.importExcel(excel);
} return CostResult.success();
return result; }
@ApiOperation("导出excel")
@PostMapping("/exportExcel")
public CostResult<Void> exportExcel(HttpServletResponse response,
@RequestBody CostTypeExportExcelReq req) throws IOException {
costTypeService.exportExcel(response, req);
return CostResult.success();
} }
} }
...@@ -3,8 +3,8 @@ package com.blt.other.module.cost.controller; ...@@ -3,8 +3,8 @@ package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.dto.LogisticsFinansysDto; import com.bailuntec.cost.api.dto.LogisticsFinansysDto;
import com.bailuntec.cost.api.dto.SubLogisticsFinansysDto; import com.bailuntec.cost.api.dto.SubLogisticsFinansysDto;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.module.cost.service.UserCostFinansysService;
import com.blt.other.database.model.UserCostFinansysDomain; import com.blt.other.database.model.UserCostFinansysDomain;
import com.blt.other.module.cost.service.UserCostFinansysService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
......
package com.blt.other.module.cost.dto.request;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/13 3:04 下午
*/
@Data
public class CostTypeExportExcelReq {
}
package com.blt.other.module.cost.dto.request;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/13 3:03 下午
*/
@Data
public class CostTypeImportExcelReq {
}
package com.blt.other.module.cost.dto.response;
import com.blt.other.database.model.LogisticsSupplierBankDomain;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/13 2:58 下午
*/
@Data
public class GetLogisticsBankResp {
private LogisticsSupplierBankDomain bankInfo;
private Boolean success;
}
package com.blt.other.module.cost.dto.response;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/13 2:56 下午
*/
@Data
public class GetLogisticsCodeResp {
private Boolean success;
private String logisticsCode;
}
...@@ -3,10 +3,12 @@ package com.blt.other.module.cost.service; ...@@ -3,10 +3,12 @@ package com.blt.other.module.cost.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.blt.other.database.model.CostTypeDomain; import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.module.cost.dto.request.CostTypeAddReq; import com.blt.other.module.cost.dto.request.*;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult; import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.dto.response.GetLogisticsBankResp;
import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp;
import javax.servlet.http.HttpServletResponse;
public interface CostTypeService extends IService<CostTypeDomain> { public interface CostTypeService extends IService<CostTypeDomain> {
...@@ -55,4 +57,16 @@ public interface CostTypeService extends IService<CostTypeDomain> { ...@@ -55,4 +57,16 @@ public interface CostTypeService extends IService<CostTypeDomain> {
* @return res * @return res
*/ */
CostTypeResult queryByNo(String typeNo); CostTypeResult queryByNo(String typeNo);
//获取物流subjectCode
GetLogisticsCodeResp getLogisticsCode();
//获取物流银行帐号
GetLogisticsBankResp getLogisticsBank(String subSupplierName);
//批量导入
void importExcel(CostTypeImportExcelReq excel);
//导出
void exportExcel(HttpServletResponse response, CostTypeExportExcelReq req);
} }
...@@ -6,19 +6,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,19 +6,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.CostTypeDomain; import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.database.model.LogisticsSupplierBankDomain;
import com.blt.other.module.auth.dao.OaUserMapper; import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.OaUser; import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.cost.dao.AccountingSubjectMapper; import com.blt.other.module.cost.dao.AccountingSubjectMapper;
import com.blt.other.module.cost.dao.CostTypeDao; import com.blt.other.module.cost.dao.CostTypeDao;
import com.blt.other.module.cost.dto.request.CostTypeAddReq; import com.blt.other.module.cost.dto.request.*;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult; import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.dto.response.GetLogisticsBankResp;
import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp;
import com.blt.other.module.cost.service.CostTypeKindService;
import com.blt.other.module.cost.service.CostTypeService; import com.blt.other.module.cost.service.CostTypeService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Service @Service
...@@ -99,6 +102,36 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -99,6 +102,36 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
return baseMapper.queryByNo(typeNo); return baseMapper.queryByNo(typeNo);
} }
@Override
public GetLogisticsCodeResp getLogisticsCode() {
GetLogisticsCodeResp resp = new GetLogisticsCodeResp();
resp.setSuccess(true);
resp.setLogisticsCode("22222");
return resp;
}
@Resource
CostTypeKindService costTypeKindService;
@Override
public GetLogisticsBankResp getLogisticsBank(String subSupplierName) {
GetLogisticsBankResp resp = new GetLogisticsBankResp();
resp.setSuccess(true);
LogisticsSupplierBankDomain bankDomain = costTypeKindService.getLogisticsBank(subSupplierName);
resp.setBankInfo(bankDomain);
return resp;
}
@Override
public void importExcel(CostTypeImportExcelReq excel) {
}
@Override
public void exportExcel(HttpServletResponse response, CostTypeExportExcelReq req) {
}
/** /**
* 根据ui类型获取费用类型 对应的费用模版类型 * 根据ui类型获取费用类型 对应的费用模版类型
* *
......
...@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -71,7 +72,8 @@ public class SpecDepartmentCheckConfigController { ...@@ -71,7 +72,8 @@ public class SpecDepartmentCheckConfigController {
@ApiOperation("批量导入数据") @ApiOperation("批量导入数据")
@PostMapping("/importExcel") @PostMapping("/importExcel")
public CostResult<Void> importExcel(@RequestBody SpecDepartmentCheckImportExcelReq excel) throws IOException { public CostResult<Void> importExcel(MultipartFile multipartFile,
@RequestBody SpecDepartmentCheckImportExcelReq excel) throws IOException {
specDepartmentCheckConfigService.importExcel(excel); specDepartmentCheckConfigService.importExcel(excel);
return CostResult.success(); return CostResult.success();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment