新增采购合同相关接口

This commit is contained in:
wangqiong
2024-08-02 11:17:51 +08:00
parent b9f7d0380d
commit 28f050efc2
6 changed files with 300 additions and 0 deletions
@@ -0,0 +1,162 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-采购合同")
@RestController
@RequestMapping("//PurchaseEvaluate")
@Slf4j
public class AppSceneCostPurchaseEvaluateController extends JeecgController<AppSceneCostPurchaseEvaluate, IAppSceneCostPurchaseEvaluateService> {
@Autowired
private IAppSceneCostPurchaseEvaluateService appSceneCostPurchaseEvaluateService;
/**
* 分页列表查询
*
* @param appSceneCostPurchaseEvaluate
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_purchase_evaluate-分页列表查询")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-分页列表查询", notes = "app_scene_cost_purchase_evaluate-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostPurchaseEvaluate>> queryPageList(AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostPurchaseEvaluate> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchaseEvaluate, req.getParameterMap());
Page<AppSceneCostPurchaseEvaluate> page = new Page<AppSceneCostPurchaseEvaluate>(pageNo, pageSize);
IPage<AppSceneCostPurchaseEvaluate> pageList = appSceneCostPurchaseEvaluateService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appSceneCostPurchaseEvaluate
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-添加")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-添加", notes = "app_scene_cost_purchase_evaluate-添加")
@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
appSceneCostPurchaseEvaluateService.save(appSceneCostPurchaseEvaluate);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appSceneCostPurchaseEvaluate
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-编辑")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-编辑", notes = "app_scene_cost_purchase_evaluate-编辑")
@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
appSceneCostPurchaseEvaluateService.updateById(appSceneCostPurchaseEvaluate);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-通过id删除")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id删除", notes = "app_scene_cost_purchase_evaluate-通过id删除")
@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
appSceneCostPurchaseEvaluateService.removeById(id);
return Result.OK("删除成功!");
}
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_purchase_evaluate-批量删除")
// @ApiOperation(value = "app_scene_cost_purchase_evaluate-批量删除", notes = "app_scene_cost_purchase_evaluate-批量删除")
// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostPurchaseEvaluateService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@AutoLog(value = "app_scene_cost_purchase_evaluate-通过id查询")
// @ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id查询", notes = "app_scene_cost_purchase_evaluate-通过id查询")
// @GetMapping(value = "/queryById")
// public Result<AppSceneCostPurchaseEvaluate> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate = appSceneCostPurchaseEvaluateService.getById(id);
// if (appSceneCostPurchaseEvaluate == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostPurchaseEvaluate);
// }
//
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostPurchaseEvaluate
// */
// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
// return super.exportXls(request, appSceneCostPurchaseEvaluate, AppSceneCostPurchaseEvaluate.class, "app_scene_cost_purchase_evaluate");
// }
//
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostPurchaseEvaluate.class);
// }
}
@@ -0,0 +1,86 @@
package com.zzsmart.qomo.kn.cost.manage.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Builder;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@Builder
@TableName("app_scene_cost_purchase_evaluate")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_purchase_evaluate对象", description = "app_scene_cost_purchase_evaluate")
public class AppSceneCostPurchaseEvaluate implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private Integer id;
/**
* 合同编号
*/
@Excel(name = "合同编号", width = 15)
@ApiModelProperty(value = "合同编号")
private String contractNo;
/**
* 估价
*/
@Excel(name = "估价", width = 15)
@ApiModelProperty(value = "估价")
private BigDecimal evaluate;
/**
* 合同名称
*/
@Excel(name = "合同名称", width = 15)
@ApiModelProperty(value = "合同名称")
private String contractName;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private Integer createBy;
/**
* 更新时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private Integer updateBy;
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostPurchaseEvaluateMapper extends BaseMapper<AppSceneCostPurchaseEvaluate> {
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseEvaluateMapper">
</mapper>
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostPurchaseEvaluateService extends IService<AppSceneCostPurchaseEvaluate> {
}
@@ -0,0 +1,19 @@
package com.zzsmart.qomo.kn.cost.manage.service.impl;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseEvaluateMapper;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseEvaluateService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Service
public class AppSceneCostPurchaseEvaluateServiceImpl extends ServiceImpl<AppSceneCostPurchaseEvaluateMapper, AppSceneCostPurchaseEvaluate> implements IAppSceneCostPurchaseEvaluateService {
}