net.mingsoft.freight.action.web.CompanyAction Maven / Gradle / Ivy
package net.mingsoft.freight.action.web;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.ui.ModelMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.alibaba.fastjson.JSONArray;
import net.mingsoft.freight.biz.ICompanyBiz;
import net.mingsoft.freight.entity.CompanyEntity;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.base.util.JSONObject;
import net.mingsoft.base.filter.DateValueFilter;
import net.mingsoft.base.filter.DoubleValueFilter;
import net.mingsoft.basic.bean.EUListBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
/**
* 快递公司管理控制层
* @author 小伍io678()
* 创建日期:2019-11-6 15:23:42
* 历史修订:
*/
@Api(value = "快递公司接口")
@Controller("webCompanyAction")
@RequestMapping("/freight/company")
public class CompanyAction extends net.mingsoft.freight.action.BaseAction{
/**
* 注入快递公司业务层
*/
@Autowired
private ICompanyBiz companyBiz;
/**
* 查询快递公司列表
* @param company 快递公司实体
* company参数包含字段信息参考:
* companyName 快递公司名称
* companyPic 快递公司logo
* companyDesc 公司简介
* createBy 创建人
* createDate 创建时间
* updateBy 修改人
* updateDate 修改时间
* del 删除标记
* id 编号
* 返回
* [
* {
* companyName: 快递公司名称
* companyPic: 快递公司logo
* companyDesc: 公司简介
* createBy: 创建人
* createDate: 创建时间
* updateBy: 修改人
* updateDate: 修改时间
* del: 删除标记
* id: 编号
* }
* ]
*/
@ApiOperation(value = "查询快递公司列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyName", value = "快递公司名称", required =false,paramType="query"),
@ApiImplicitParam(name = "companyPic", value = "快递公司logo", required =false,paramType="query"),
@ApiImplicitParam(name = "companyDesc", value = "公司简介", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@GetMapping("/list")
@ResponseBody
public void list(@ModelAttribute @ApiIgnore CompanyEntity company,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model) {
BasicUtil.startPage();
List companyList = companyBiz.query(company);
this.outJson(response, net.mingsoft.base.util.JSONArray.toJSONString(new EUListBean(companyList,(int)BasicUtil.endPage(companyList).getTotal()),new DoubleValueFilter(),new DateValueFilter()));
}
/**
* 获取快递公司
* @param company 快递公司实体
* company参数包含字段信息参考:
* companyName 快递公司名称
* companyPic 快递公司logo
* companyDesc 公司简介
* createBy 创建人
* createDate 创建时间
* updateBy 修改人
* updateDate 修改时间
* del 删除标记
* id 编号
* 返回
* {
* companyName: 快递公司名称
* companyPic: 快递公司logo
* companyDesc: 公司简介
* createBy: 创建人
* createDate: 创建时间
* updateBy: 修改人
* updateDate: 修改时间
* del: 删除标记
* id: 编号
* }
*/
@ApiOperation(value = "获取快递公司列表接口")
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public CompanyEntity get(@ModelAttribute @ApiIgnore CompanyEntity company,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){
if(company.getId()==null) {
return null;
}
CompanyEntity _company = (CompanyEntity)companyBiz.getEntity(Integer.parseInt(company.getId()));
return _company;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy