|
|
@@ -0,0 +1,140 @@
|
|
|
+package com.fs.hisStore.controller;
|
|
|
+
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.company.service.ICompanyService;
|
|
|
+import com.fs.hisStore.domain.FsExpressScrm;
|
|
|
+import com.fs.hisStore.dto.ExpressNotifyDTO;
|
|
|
+import com.fs.hisStore.dto.ExpressResultDTO;
|
|
|
+import com.fs.hisStore.service.IFsExpressScrmService;
|
|
|
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 快递公司Controller
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2022-03-15
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/store/express")
|
|
|
+public class FsExpressScromController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private IFsExpressScrmService fsExpressService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderScrmService orderService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询快递公司列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(FsExpressScrm fsExpress)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ fsExpress.setIsDel(0);
|
|
|
+ List<FsExpressScrm> list = fsExpressService.selectFsExpressList(fsExpress);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getExpressList")
|
|
|
+ public R getExpressList()
|
|
|
+ {
|
|
|
+ FsExpressScrm map=new FsExpressScrm();
|
|
|
+ map.setIsDel(0);
|
|
|
+ List<FsExpressScrm> list = fsExpressService.selectFsExpressList(map);
|
|
|
+ return R.ok().put("data",list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出快递公司列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:export')")
|
|
|
+ @Log(title = "快递公司", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult export(FsExpressScrm fsExpress)
|
|
|
+ {
|
|
|
+ List<FsExpressScrm> list = fsExpressService.selectFsExpressList(fsExpress);
|
|
|
+ ExcelUtil<FsExpressScrm> util = new ExcelUtil<FsExpressScrm>(FsExpressScrm.class);
|
|
|
+ return util.exportExcel(list, "express");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取快递公司详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return AjaxResult.success(fsExpressService.selectFsExpressById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增快递公司
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:add')")
|
|
|
+ @Log(title = "快递公司", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody FsExpressScrm fsExpress)
|
|
|
+ {
|
|
|
+ return toAjax(fsExpressService.insertFsExpress(fsExpress));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改快递公司
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:edit')")
|
|
|
+ @Log(title = "快递公司", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody FsExpressScrm fsExpress)
|
|
|
+ {
|
|
|
+ return toAjax(fsExpressService.updateFsExpress(fsExpress));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除快递公司
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:remove')")
|
|
|
+ @Log(title = "快递公司", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
+ {
|
|
|
+ return toAjax(fsExpressService.deleteFsExpressByIds(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:express:allot')")
|
|
|
+ @PostMapping("/allotExpress/{omsCode}")
|
|
|
+ public R allotExpress(@RequestBody List<Long> companyIds,@PathVariable String omsCode){
|
|
|
+ companyService.updateOmsCodeByCompanyIds(companyIds,omsCode);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping( "/omsCode/{omsCode}")
|
|
|
+ public R getCompanyByOmsCode(@PathVariable("omsCode") String omsCode)
|
|
|
+ {
|
|
|
+ List<Long> list = companyService.selectCompanyByOmsCode(omsCode);
|
|
|
+ return R.ok().put("data2",list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("物流信息回调")
|
|
|
+ @PostMapping(path = "/expressNotify" )
|
|
|
+ public ExpressResultDTO expressNotify(ExpressNotifyDTO notifyDTO) throws Exception
|
|
|
+ {
|
|
|
+ return orderService.updateDeliveryItem(notifyDTO);
|
|
|
+ }
|
|
|
+}
|