123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- package com.steerinfo.dil.controller;
- import com.alibaba.fastjson.JSON;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.model.RmsCapacity;
- import com.steerinfo.dil.model.RmsConsignee;
- import com.steerinfo.dil.service.impl.RmsConsigneeServiceImpl;
- import com.steerinfo.dil.util.BaseRESTfulController;
- import com.steerinfo.dil.util.ColumnDataUtil;
- import com.steerinfo.dil.util.PageListAdd;
- import com.steerinfo.framework.controller.RESTfulResult;
- import com.steerinfo.framework.service.pagehelper.PageHelper;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.math.BigDecimal;
- import java.text.ParseException;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- @RestController
- @RequestMapping("/${api.version}/rmsconsignee")
- public class RmsConsigneeController extends BaseRESTfulController {
- @Autowired
- RmsConsigneeServiceImpl rmsConsigneeService;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @Autowired
- ESFeign esFeign;
- @ApiOperation(value = "模糊查询展示客户信息表", notes = "分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "407", required = false, dataType = "BigDecimal"),
- })
- @PostMapping(value = "/getConsigneeList")
- public RESTfulResult getConsigneeList(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String con
- ) {
- if (mapValue==null){
- mapValue=new HashMap<>();
- }
- if (con != null && !con.equals("undefined")) {
- mapValue.put("con","%" + con + "%");
- }
- List<Map<String, Object>> listTotal = rmsConsigneeService.getConsigneeList(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = rmsConsigneeService.getConsigneeList(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- /**
- * 新增收货客户
- * @param
- * @return
- */
- @ApiOperation(value="创建", notes="根据RmsConsignee对象创建")
- @ApiImplicitParam(name = "rmsCapacity", value = "详细实体rmsConsignee", required = true, dataType = "RmsCapacity")
- @PostMapping(value = "/insertConsignee")
- public RESTfulResult insertConsignee(@RequestBody Map<String,Object> mapVal) throws ParseException {
- int result = rmsConsigneeService.insertConsignee(mapVal);
- if(result==-1){
- return failed("收货客户已存在");
- }
- return success(result);
- }
- /**
- * 收货客户注册
- * @param
- * @return
- */
- @ApiOperation(value="创建", notes="根据RmsConsignee对象创建")
- @ApiImplicitParam(name = "rmsCapacity", value = "详细实体rmsConsignee", required = true, dataType = "RmsCapacity")
- @PostMapping(value = "/signConsignee")
- public RESTfulResult signConsignee(@RequestBody Map<String,Object> mapVal) {
- int result = rmsConsigneeService.signConsignee(mapVal);
- if(result==-1){
- return failed("请到金蝶系统先添加该收获客户");
- }
- return success(result);
- }
- /**
- * 根据id更新客户信息
- * @param
- * @return
- */
- @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的rmsConsignee信息来更新详细信息")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short"),
- @ApiImplicitParam(name = "rmsConsignee", value = "详细实体rmsConsignee", required = true, dataType = "RmsConsignee")
- })
- @PostMapping(value = "/updateConsignee", produces = "application/json;charset=UTF-8")
- public RESTfulResult updateConsignee( @RequestBody Map<String,Object> mapVal )throws ParseException{
- int result = rmsConsigneeService.updateConsignee(mapVal);
- return success(result);
- }
- /**
- * 根据id删除客户信息
- * @param id
- * @return
- */
- @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
- @PostMapping(value = "/deleteConsignee/{id}")
- public RESTfulResult deleteConsignee(@PathVariable("id") BigDecimal id){
- return success(rmsConsigneeService.deleteConsignee(id));
- }
- /**
- * 根据id获取客户信息
- * @param id
- * @return
- */
- @ApiOperation(value="获取客户信息详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @PostMapping(value = "/getConsigneeById/{id}")
- public RESTfulResult getConsigneeById(@PathVariable("id") BigDecimal id){
- List<Map<String,Object>> list= rmsConsigneeService.getConsigneeById(id);
- return success(list);
- }
- /*
- *边输边查收货客户父节点
- * */
- @ApiOperation(value = "边输边查收货客户父节点")
- @PostMapping(value = "getConsigneeFarId")
- public RESTfulResult getConsigneeFarId(@RequestParam(value ="state") String state){
- List<Map<String,Object>> result=rmsConsigneeService.getConsigneeFarId(state);
- return success(result);
- }
- @ApiOperation(value = "batchUpdateConsigneeRole")
- @PostMapping("batchUpdateConsigneeRole")
- public RESTfulResult batchUpdateConsigneeRole() {
- int i = rmsConsigneeService.batchUpdateConsigneeRole();
- return success(i);
- }
- }
|