|
|
|
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(@RequestParam("id") Long id) {
|
|
|
|
RelCodeBatch relCodeBatch = relCodeBatchService.getById(id);
|
|
|
|
return ResultVOUtils.success(relCodeBatch);
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/udiwms/relCode/batch/delete")
|
|
|
|
public BaseResponse delete(@RequestParam("id") Long id) {
|
|
|
|
relCodeBatchService.delete(id);
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/relCode/batch/update")
|
|
|
|
public BaseResponse update(@RequestBody @Valid RelCodeBatch relCodeBatch) {
|
|
|
|
relCodeBatchService.updateById(relCodeBatch);
|
|
|
|
return ResultVOUtils.success("修改成功!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|