You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.6 KiB
Java
67 lines
2.6 KiB
Java
10 months ago
|
package com.glxp.api.controller.collect;
|
||
|
|
||
|
import cn.hutool.core.util.StrUtil;
|
||
|
import com.github.pagehelper.PageInfo;
|
||
|
import com.glxp.api.annotation.CusRedissonAnnotation;
|
||
|
import com.glxp.api.annotation.RepeatSubmit;
|
||
|
import com.glxp.api.common.enums.ResultEnum;
|
||
|
import com.glxp.api.common.res.BaseResponse;
|
||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||
|
import com.glxp.api.constant.RedissonCacheKey;
|
||
|
import com.glxp.api.controller.BaseController;
|
||
|
import com.glxp.api.entity.collect.IoCollectOrder;
|
||
|
import com.glxp.api.entity.collect.RelCodeBatch;
|
||
|
import com.glxp.api.req.collect.IoCollectCodeRequest;
|
||
|
import com.glxp.api.req.collect.RelCodeBatchRequest;
|
||
|
import com.glxp.api.res.PageSimpleResponse;
|
||
|
import com.glxp.api.res.collect.IoCollectCodeResponse;
|
||
|
import com.glxp.api.res.collect.RelCodeBatchResponse;
|
||
|
import com.glxp.api.service.collect.RelCodeBatchService;
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
import org.springframework.validation.BindingResult;
|
||
|
import org.springframework.web.bind.annotation.*;
|
||
|
import org.springframework.web.multipart.MultipartFile;
|
||
|
|
||
|
import javax.annotation.Resource;
|
||
|
import javax.validation.Valid;
|
||
|
import java.util.List;
|
||
|
|
||
|
@Slf4j
|
||
|
@RestController
|
||
|
public class RelCodeBatchController extends BaseController {
|
||
|
|
||
|
@Resource
|
||
|
private RelCodeBatchService relCodeBatchService;
|
||
|
|
||
|
@RepeatSubmit()
|
||
|
@PostMapping("/udiwms/relCode/batch/xmlUpload")
|
||
|
public BaseResponse xmlUpload(@RequestBody RelCodeBatchRequest relCodeBatchRequest, @RequestParam("file") MultipartFile file) {
|
||
|
relCodeBatchService.xmlUpload(file);
|
||
|
return ResultVOUtils.success("保存成功!");
|
||
|
}
|
||
|
|
||
|
@GetMapping("/udiwms/relCode/batch/filter")
|
||
|
public BaseResponse list(RelCodeBatchRequest relCodeBatchRequest, BindingResult bindingResult) {
|
||
|
List<RelCodeBatchResponse> relCodeBatchResponses = relCodeBatchService.filterList(relCodeBatchRequest);
|
||
|
PageInfo<RelCodeBatchResponse> pageInfo = new PageInfo<>(relCodeBatchResponses);
|
||
|
PageSimpleResponse<RelCodeBatchResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||
|
pageSimpleResponse.setList(relCodeBatchResponses);
|
||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||
|
}
|
||
|
|
||
|
@GetMapping("/udiwms/relCode/batch/get")
|
||
|
public BaseResponse get(Long id) {
|
||
|
RelCodeBatch relCodeBatch = relCodeBatchService.getById(id);
|
||
|
return ResultVOUtils.success(relCodeBatch);
|
||
|
}
|
||
|
|
||
|
|
||
|
@PostMapping("/udiwms/relCode/batch/update")
|
||
|
public BaseResponse update(@RequestBody @Valid RelCodeBatch relCodeBatch) {
|
||
|
relCodeBatchService.updateById(relCodeBatch);
|
||
|
return ResultVOUtils.success("修改成功!");
|
||
|
}
|
||
|
|
||
|
}
|