|
|
@@ -9,8 +9,6 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.box.tube.entity.DeclareCustoms;
|
|
|
-import org.springblade.box.tube.entity.TradingBox;
|
|
|
-import org.springblade.box.tube.entity.Transport;
|
|
|
import org.springblade.box.tube.excel.DeclareCustomsExcel;
|
|
|
import org.springblade.box.tube.service.IDeclareCustomsService;
|
|
|
import org.springblade.box.tube.vo.DeclareCustomsVo;
|
|
|
@@ -57,8 +55,8 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入declareCustoms")
|
|
|
- public R<IPage<DeclareCustoms>> list(DeclareCustoms declareCustoms, Query query){
|
|
|
- if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())){
|
|
|
+ public R<IPage<DeclareCustoms>> list(DeclareCustoms declareCustoms, Query query) {
|
|
|
+ if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())) {
|
|
|
throw new SecurityException("缺少必要参数");
|
|
|
}
|
|
|
LambdaQueryWrapper<DeclareCustoms> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
@@ -70,7 +68,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getCustomsNo()), DeclareCustoms::getCustomsNo, declareCustoms.getCustomsNo())//海关编号
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getDeliveryNumbers()), DeclareCustoms::getDeliveryNumbers, declareCustoms.getDeliveryNumbers())//提运单号
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getCustomsDeclarationPlace()), DeclareCustoms::getCustomsDeclarationPlace, declareCustoms.getCustomsDeclarationPlace())
|
|
|
- .ge(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(0)),DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(0))//申报日期开始时间
|
|
|
+ .ge(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(0)), DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(0))//申报日期开始时间
|
|
|
.le(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(1)), DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(1))//申报日期结束日期
|
|
|
.orderByDesc(DeclareCustoms::getDeclareDate);
|
|
|
IPage<DeclareCustoms> page = declareCustomsService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
@@ -84,7 +82,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@GetMapping("/page")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "自定义分页", notes = "传入declareCustoms")
|
|
|
- public R<IPage<DeclareCustomsVo>> page(DeclareCustoms declareCustoms, Query query){
|
|
|
+ public R<IPage<DeclareCustomsVo>> page(DeclareCustoms declareCustoms, Query query) {
|
|
|
IPage<DeclareCustomsVo> page = declareCustomsService.selDeclareCustomsPage(Condition.getPage(query), declareCustoms);
|
|
|
return R.data(page);
|
|
|
}
|
|
|
@@ -95,7 +93,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@PostMapping("/save")
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "新增", notes = "传入declareCustoms")
|
|
|
- public R save(@Valid @RequestBody DeclareCustoms declareCustoms){
|
|
|
+ public R save(@Valid @RequestBody DeclareCustoms declareCustoms) {
|
|
|
return R.status(declareCustomsService.save(declareCustoms));
|
|
|
}
|
|
|
|
|
|
@@ -116,7 +114,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入declareCustoms")
|
|
|
public R submit(@Valid @RequestBody DeclareCustoms declareCustoms) {
|
|
|
- if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())){
|
|
|
+ if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())) {
|
|
|
throw new SecurityException("缺少必要参数");
|
|
|
}
|
|
|
return R.data(declareCustomsService.add(declareCustoms));
|
|
|
@@ -186,7 +184,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@PostMapping("/revoke")
|
|
|
@ApiOperationSupport(order = 11)
|
|
|
@ApiOperation(value = "撤销审核", notes = "传入declareCustoms")
|
|
|
- public R revoke(@RequestBody DeclareCustoms declareCustoms){
|
|
|
+ public R revoke(@RequestBody DeclareCustoms declareCustoms) {
|
|
|
DeclareCustoms customs = declareCustomsService.revoke(declareCustoms);
|
|
|
return R.data(customs);
|
|
|
}
|
|
|
@@ -197,8 +195,8 @@ public class DeclareCustomsController extends BladeController {
|
|
|
@GetMapping("/export")
|
|
|
@ApiOperationSupport(order = 12)
|
|
|
@ApiOperation(value = "报关进出口导出", notes = "传入declareCustoms")
|
|
|
- public void export(DeclareCustoms declareCustoms, HttpServletResponse response){
|
|
|
- if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())){
|
|
|
+ public void export(DeclareCustoms declareCustoms, HttpServletResponse response) {
|
|
|
+ if (ObjectUtil.isEmpty(declareCustoms.getImportExportSigns())) {
|
|
|
throw new SecurityException("缺少必要参数");
|
|
|
}
|
|
|
LambdaQueryWrapper<DeclareCustoms> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
@@ -210,7 +208,7 @@ public class DeclareCustomsController extends BladeController {
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getCustomsNo()), DeclareCustoms::getCustomsNo, declareCustoms.getCustomsNo())//海关编号
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getDeliveryNumbers()), DeclareCustoms::getDeliveryNumbers, declareCustoms.getDeliveryNumbers())//提运单号
|
|
|
.like(ObjectUtil.isNotEmpty(declareCustoms.getCustomsDeclarationPlace()), DeclareCustoms::getCustomsDeclarationPlace, declareCustoms.getCustomsDeclarationPlace())
|
|
|
- .ge(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(0)),DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(0))//申报日期开始时间
|
|
|
+ .ge(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(0)), DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(0))//申报日期开始时间
|
|
|
.le(ObjectUtil.isNotEmpty(declareCustoms.getDeclareDateList().get(1)), DeclareCustoms::getDeclareDate, declareCustoms.getDeclareDateList().get(1))//申报日期结束日期
|
|
|
.orderByDesc(DeclareCustoms::getDeclareDate);
|
|
|
|
|
|
@@ -219,13 +217,13 @@ public class DeclareCustomsController extends BladeController {
|
|
|
List<DeclareCustomsExcel> excelList = BeanUtil.copy(list, DeclareCustomsExcel.class);
|
|
|
|
|
|
String typeName = "";
|
|
|
- if ("BGJK".equals(declareCustoms.getImportExportSigns())){
|
|
|
+ if ("BGJK".equals(declareCustoms.getImportExportSigns())) {
|
|
|
typeName = "进口";
|
|
|
- }else if ("BGCK".equals(declareCustoms.getImportExportSigns())){
|
|
|
+ } else if ("BGCK".equals(declareCustoms.getImportExportSigns())) {
|
|
|
typeName = "出口";
|
|
|
}
|
|
|
|
|
|
- ExcelUtil.export(response, "报关"+typeName, "报关"+typeName, excelList, DeclareCustomsExcel.class);
|
|
|
+ ExcelUtil.export(response, "报关" + typeName, "报关" + typeName, excelList, DeclareCustomsExcel.class);
|
|
|
}
|
|
|
|
|
|
}
|