123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- package com.steerinfo.dil.controller;
- import com.alibaba.fastjson.JSON;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.model.AmsshipDeliveryAttorney;
- import com.steerinfo.dil.model.AmsshipDeliveryNotice;
- import com.steerinfo.dil.model.OmsshipShipmentInstructions;
- import com.steerinfo.dil.service.IAmsshipDeliveryNoticeService;
- 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 oracle.jdbc.proxy.annotation.Post;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.*;
- import java.math.BigDecimal;
- /**
- * AmsshipDeliveryNotice RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-08-18 03:54
- * 类描述
- * 修订历史:
- * 日期:2021-08-18
- * 作者:generator
- * 参考:
- * 描述:AmsshipDeliveryNotice RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @RestController
- @RequestMapping("/${api.version}/amsshipdeliverynotices")
- public class AmsshipDeliveryNoticeController extends BaseRESTfulController {
- @Autowired
- IAmsshipDeliveryNoticeService amsshipDeliveryNoticeService;
- @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 = "69", required = false, dataType = "BigDecimal"),
- })
- @PostMapping(value = "/getshipDeliveryNoticeList")
- public RESTfulResult getshipDeliveryNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String con){
- //框计算
- if(con != null){
- if(!"undefined".equals(con)){
- //设置要查询的索引名称
- String index="get_ship_delivery_notice_list";
- //获取查询结果
- return success(esFeign.getConResult(mapVal,index,apiId,pageNum,pageSize,con));
- }
- }
- //初始化过滤
- List<Map<String, Object>> listTotal = null;
- //如果有条件查询则跳过初始化,和创建索引
- if (mapVal.size() == 0) {
- //将查询结果存入索引中
- listTotal = amsshipDeliveryNoticeService.selectShipDeliveryNotice(null);
- Map<String, Object> map = new HashMap<>();
- //添加索引
- map.put("index", "get_ship_delivery_notice_list");
- //添加id
- map.put("indexId", "noticeId");
- listTotal.add(map);
- //新建索引
- String s = JSON.toJSONString(listTotal);
- esFeign.insertIndex(listTotal);
- //删除
- listTotal.remove(listTotal.size() - 1);
- }
- if (listTotal == null) {
- listTotal = amsshipDeliveryNoticeService.selectShipDeliveryNotice(mapVal);
- }
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = amsshipDeliveryNoticeService.selectShipDeliveryNotice(mapVal);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- //新增
- @ApiOperation(value="新增", notes="根据AmsshipDeliveryNotice对象创建")
- @ApiImplicitParam(name = "amsshipDeliveryNotice", value = "详细实体amsshipDeliveryNotice", required = true, dataType = "AmsshipDeliveryNotice", paramType = "java.util.Map")
- @PostMapping(value = "/insertDeliveryNotice")
- public RESTfulResult insertSelective(@RequestBody AmsshipDeliveryNotice amsshipDeliveryNotice){
- int code=amsshipDeliveryNoticeService.insert(amsshipDeliveryNotice);
- return success(code);
- }
- // //查询发货通知单信息
- // @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- // @ApiImplicitParam(paramType = "path", name = "noticeId", value = "noticeId", required = true, dataType = "BigDecimal")
- //
- // @GetMapping(value = "/{noticeId}")
- // public RESTfulResult get(@PathVariable BigDecimal noticeId){
- // AmsshipDeliveryNotice amsshipDeliveryNotice = amsshipDeliveryNoticeService.selectByPrimaryKey(noticeId);
- // return success(amsshipDeliveryNotice);
- // }
- // 渲染信息
- @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的amsshipDeliveryNotice信息来更新详细信息")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "path", name = "noticeId", value = "noticeId", required = true, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "amsshipDeliveryNotice", value = "详细实体amsshipDeliveryNotice", required = true, dataType = "AmsshipDeliveryNotice")
- })
- @PostMapping(value = "/selectByNoticeId/{noticeId}")
- public RESTfulResult update(@PathVariable("noticeId") Integer noticeId){
- List<Map<String,Object>> amsshipDeliveryNotice =amsshipDeliveryNoticeService.selectByNoticeId(noticeId);
- return success(amsshipDeliveryNotice);
- }
- // 删除详细信息
- @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
- @ApiImplicitParam(paramType = "path", name = "id", value = "noticeId", required = true, dataType = "BigDecimal")
- //@RequiresPermissions("omsshipshipmentinstructions:delete")
- @DeleteMapping(value = "/{noticeId}")//BigDecimal
- public RESTfulResult deleteByPrimaryKey(BigDecimal noticeId){
- amsshipDeliveryNoticeService.deleteByPrimaryKey(noticeId);
- return success();
- }
- //得到收货人id
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @GetMapping(value ="/getResultNumber")
- public RESTfulResult getResultNumber(){
- List<Map<String,Object>> list= amsshipDeliveryNoticeService.getResultNumber();
- return success(list);
- }
- //得到承运单位
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @GetMapping(value ="/getCarrier")
- public RESTfulResult getCarrier(){
- List<Map<String,Object>> list= amsshipDeliveryNoticeService.getcarrier();
- return success(list);
- }
- //得到委托单位
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @GetMapping(value ="/getShipper")
- public RESTfulResult getShipper(){
- List<Map<String,Object>> list= amsshipDeliveryNoticeService.getShipper();
- return success(list);
- }
- // //得到采购订单号
- // @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- // @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- //
- // @GetMapping(value ="/getOrderNo")
- // public RESTfulResult getOrderNo(){
- // List<Map<String,Object>> list= amsshipDeliveryNoticeService.getOrderNo();
- // return success(list);
- // }
- //删除
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @PostMapping(value ="/deleteByNoticeId/{noticeId}")
- public RESTfulResult deleteByNoticeId(@PathVariable("noticeId") Integer noticeId){
- // 初始话对象
- AmsshipDeliveryNotice amsshipDeliveryNotice=new AmsshipDeliveryNotice();
- // 设置一个新的noticeId
- amsshipDeliveryNotice.setNoticeId(new BigDecimal(noticeId));
- // 将删除状态设置为1.
- Short deleted=1;
- // 将设置完的值传回后端
- amsshipDeliveryNotice.setDeleted(deleted);
- amsshipDeliveryNoticeService.updateByPrimaryKeySelective(amsshipDeliveryNotice);
- return success();
- }
- //修改
- @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的amsshipDeliveryNotice信息来更新详细信息")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "amsshipDeliveryNotice", value = "详细实体amsshipDeliveryNotice", required = true, dataType = "amsshipDeliveryNotice")
- })
- @PostMapping(value = "/editDeliveryNotice", produces = "application/json;charset=UTF-8")
- public RESTfulResult editDeliveryNotice(@RequestBody AmsshipDeliveryNotice amsshipDeliveryNotice){
- amsshipDeliveryNoticeService.updateByPrimaryKeySelective(amsshipDeliveryNotice);
- System.out.println(amsshipDeliveryNotice);
- return success(amsshipDeliveryNotice);
- }
- // 下发
- @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的amsshipDeliveryNotice信息来更新详细信息")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "amsshipDeliveryNotice", value = "详细实体amsshipDeliveryNotice", required = true, dataType = "amsshipDeliveryNotice")
- })
- @PostMapping(value = "/sendDeliveryNotice/{noticeId}", produces = "application/json;charset=UTF-8")
- public RESTfulResult sendDeliveryNotice(@PathVariable("noticeId") Integer noticeId){
- AmsshipDeliveryNotice amsshipDeliveryNotice =new AmsshipDeliveryNotice();
- amsshipDeliveryNotice.setNoticeId(new BigDecimal(noticeId));
- amsshipDeliveryNotice.setNoticeDistributionStatus("下发");
- amsshipDeliveryNoticeService.updateByPrimaryKeySelective(amsshipDeliveryNotice);
- System.out.println(amsshipDeliveryNotice);
- return success(amsshipDeliveryNotice);
- }
- }
|