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.
udi-wms-java/src/main/java/com/glxp/api/controller/collect/RelCodeBatchController.java

99 lines
3.7 KiB
Java

10 months ago
package com.glxp.api.controller.collect;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.CusRedissonAnnotation;
import com.glxp.api.annotation.RepeatSubmit;
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.RelCodeBatch;
import com.glxp.api.req.collect.RelCodeBatchRequest;
import com.glxp.api.res.PageSimpleResponse;
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;
9 months ago
/**
*
* @param uuid
* @param file
* @return
*/
10 months ago
@RepeatSubmit()
10 months ago
@CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#uuid"}, timeOutMsg = "系统正在处理,请勿重复上传")
10 months ago
@PostMapping("/udiwms/relCode/batch/xmlUpload")
10 months ago
public BaseResponse xmlUpload(@RequestParam("uuid") String uuid,@RequestParam("file") MultipartFile file) {
10 months ago
relCodeBatchService.xmlUpload(file);
10 months ago
return ResultVOUtils.successMsg("上传成功!");
10 months ago
}
9 months ago
/**
*
* @param relCodeBatchRequest
* @return
*/
@RepeatSubmit()
@PostMapping("/udiwms/relCode/batch/add")
public BaseResponse add(@RequestBody @Valid RelCodeBatchRequest relCodeBatchRequest,BindingResult bindingResult) {
relCodeBatchService.add(relCodeBatchRequest);
return ResultVOUtils.successMsg("添加成功!");
}
/**
*
* @param relCodeBatchRequest
* @return
*/
@RepeatSubmit()
@PostMapping("/udiwms/relCode/batch/addRelCodeSpellBox")
public BaseResponse addRelCodeSpellBox(@RequestBody @Valid List<RelCodeBatchRequest> relCodeBatchRequest,BindingResult bindingResult) {
relCodeBatchService.addRelCodeSpellBox(relCodeBatchRequest);
return ResultVOUtils.successMsg("添加成功!");
}
10 months ago
@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")
10 months ago
public BaseResponse get(@RequestParam("id") Long id) {
10 months ago
RelCodeBatch relCodeBatch = relCodeBatchService.getById(id);
return ResultVOUtils.success(relCodeBatch);
}
10 months ago
@GetMapping("/udiwms/relCode/batch/delete")
public BaseResponse delete(@RequestParam("id") Long id) {
relCodeBatchService.delete(id);
return ResultVOUtils.success("删除成功");
}
10 months ago
@PostMapping("/udiwms/relCode/batch/update")
public BaseResponse update(@RequestBody @Valid RelCodeBatch relCodeBatch) {
relCodeBatchService.updateById(relCodeBatch);
return ResultVOUtils.success("修改成功!");
}
}