123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- package com.steerinfo.dil.controller;
- import com.alibaba.fastjson.JSON;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.mapper.AmsshipDeliveryNoticeMapper;
- 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.ImageFileUtils;
- 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.http.MediaType;
- import org.springframework.web.bind.annotation.*;
- import org.springframework.web.multipart.MultipartFile;
- 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
- AmsshipDeliveryNoticeMapper amsshipDeliveryNoticeMapper;
- @Autowired
- ImageFileUtils imageFileUtils;
- @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,
- Integer status,
- String con){
- //判断状态值是否为空
- if (status!=null){
- mapVal.put("status",status);
- }
- if (con != null && !"null".equals(con)) {
- mapVal.put("con", "%" + con + "%");
- }
- //初始化过滤
- List<Map<String, Object>> 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 Map<String,Object> map){
- int code=amsshipDeliveryNoticeService.insert(map);
- if (code==-1){
- return failed("进厂船名重复,请输入唯一的进厂船名");
- }
- return success(code);
- }
- // 渲染信息
- @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);
- }
- //得到收货人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")
- @PostMapping(value ="/deleteByNoticeId/{noticeId}")
- public RESTfulResult deleteByNoticeId(@PathVariable("noticeId") Integer noticeId){
- Map<String,Object> mapval=new HashMap<>();
- if (noticeId!=null){
- mapval.put("noticeId",noticeId);
- }
- int i = amsshipDeliveryNoticeService.deleteDeliveryNotice(mapval);
- 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 Map<String,Object> map){
- int result=amsshipDeliveryNoticeService.updateAmsDeliveryNotice(map);
- return success(result);
- }
- // 下发
- @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){
- Map<String,Object> map=new HashMap<>();
- if (noticeId!=null){
- map.put("noticeId",noticeId);
- }
- int i=amsshipDeliveryNoticeService.sendDeliveryNotice(map);
- return success("下发成功");
- }
- // 处理货权转移图片
- @PostMapping(value = "/uploadCargoPic",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
- public RESTfulResult uploadCargoPic(@RequestParam("file") MultipartFile multipartFile) throws Exception {
- String url = imageFileUtils.updateFile(multipartFile);
- return success(url);
- }
- //获取货权转移的图片
- @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 = "/downLoadDeilveryNotice", produces = "application/json;charset=UTF-8")
- public RESTfulResult downLoadDeilveryNotice(@RequestParam Integer noticeId) {
- String LoadDeliveryNoticePicture = amsshipDeliveryNoticeService.getLoadDeliveryNotice(noticeId);
- String photo = null;
- try {
- photo = imageFileUtils.downloadFile(LoadDeliveryNoticePicture).toString();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return success(photo);
- }
- }
|