108 lines
3.3 KiB
Java
108 lines
3.3 KiB
Java
|
|
package com.klp.controller;
|
||
|
|
|
||
|
|
import com.klp.common.annotation.Log;
|
||
|
|
import com.klp.common.annotation.RepeatSubmit;
|
||
|
|
import com.klp.common.core.controller.BaseController;
|
||
|
|
import com.klp.common.core.domain.PageQuery;
|
||
|
|
import com.klp.common.core.domain.R;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
import com.klp.common.core.validate.AddGroup;
|
||
|
|
import com.klp.common.core.validate.EditGroup;
|
||
|
|
import com.klp.common.enums.BusinessType;
|
||
|
|
import com.klp.common.utils.poi.ExcelUtil;
|
||
|
|
import com.klp.domain.bo.WmsExpressBo;
|
||
|
|
import com.klp.domain.vo.WmsExpressVo;
|
||
|
|
import com.klp.service.IWmsExpressService;
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import javax.validation.constraints.NotEmpty;
|
||
|
|
import javax.validation.constraints.NotNull;
|
||
|
|
import java.io.IOException;
|
||
|
|
import java.util.Arrays;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 物流预览
|
||
|
|
*
|
||
|
|
* @author hdka
|
||
|
|
* @date 2025-07-20
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/oa/express")
|
||
|
|
public class WmsExpressController extends BaseController {
|
||
|
|
|
||
|
|
private final IWmsExpressService iWmsExpressService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询物流预览列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<WmsExpressVo> list(WmsExpressBo bo, PageQuery pageQuery) {
|
||
|
|
return iWmsExpressService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出物流预览列表
|
||
|
|
*/
|
||
|
|
@Log(title = "物流预览", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(WmsExpressBo bo, HttpServletResponse response) {
|
||
|
|
List<WmsExpressVo> list = iWmsExpressService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "物流预览", WmsExpressVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取物流预览详细信息
|
||
|
|
*
|
||
|
|
* @param expressId 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{expressId}")
|
||
|
|
public R<WmsExpressVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Long expressId) {
|
||
|
|
return R.ok(iWmsExpressService.queryById(expressId));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增物流预览
|
||
|
|
*/
|
||
|
|
@Log(title = "物流预览", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsExpressBo bo) {
|
||
|
|
return toAjax(iWmsExpressService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改物流预览
|
||
|
|
*/
|
||
|
|
@Log(title = "物流预览", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsExpressBo bo) {
|
||
|
|
return toAjax(iWmsExpressService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除物流预览
|
||
|
|
*
|
||
|
|
* @param expressIds 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "物流预览", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{expressIds}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Long[] expressIds) {
|
||
|
|
return toAjax(iWmsExpressService.deleteWithValidByIds(Arrays.asList(expressIds), true));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@GetMapping("/refresh/{expressIds}")
|
||
|
|
public R<Void> getRefreshExpress(@PathVariable Long[] expressIds) throws IOException {
|
||
|
|
return toAjax(iWmsExpressService.getRefreshExpress(Arrays.asList(expressIds)));
|
||
|
|
}
|
||
|
|
}
|