7525单价接口

This commit is contained in:
18792927508
2024-06-11 09:17:56 +08:00
parent c84cd68e04
commit 513452b7a7
6 changed files with 294 additions and 0 deletions
@@ -0,0 +1,182 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
import com.zzsmart.qomo.kn.cost.manage.service.IC7525costService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: c7525cost
* @Author: jeecg-boot
* @Date: 2024-06-06
* @Version: V1.0
*/
@Api(tags="7525单价")
@RestController
@RequestMapping("//c7525cost")
@Slf4j
public class C7525costController extends JeecgController<C7525cost, IC7525costService> {
@Autowired
private IC7525costService c7525costService;
/**
* 分页列表查询
*
* @param c7525cost
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "c7525cost-分页列表查询")
@ApiOperation(value="c7525cost-分页列表查询", notes="c7525cost-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<C7525cost>> queryPageList(C7525cost c7525cost,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<C7525cost> queryWrapper = QueryGenerator.initQueryWrapper(c7525cost, req.getParameterMap());
Page<C7525cost> page = new Page<C7525cost>(pageNo, pageSize);
IPage<C7525cost> pageList = c7525costService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param c7525cost
* @return
*/
@AutoLog(value = "c7525cost-添加")
@ApiOperation(value="c7525cost-添加", notes="c7525cost-添加")
// @RequiresPermissions(":c7525cost:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody C7525cost c7525cost) {
c7525costService.save(c7525cost);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param c7525cost
* @return
*/
@AutoLog(value = "c7525cost-编辑")
@ApiOperation(value="c7525cost-编辑", notes="c7525cost-编辑")
// @RequiresPermissions(":c7525cost:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody C7525cost c7525cost) {
c7525costService.updateById(c7525cost);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "c7525cost-通过id删除")
@ApiOperation(value="c7525cost-通过id删除", notes="c7525cost-通过id删除")
// @RequiresPermissions(":c7525cost:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
c7525costService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "c7525cost-批量删除")
@ApiOperation(value="c7525cost-批量删除", notes="c7525cost-批量删除")
// @RequiresPermissions(":c7525cost:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.c7525costService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "c7525cost-通过id查询")
@ApiOperation(value="c7525cost-通过id查询", notes="c7525cost-通过id查询")
@GetMapping(value = "/queryById")
public Result<C7525cost> queryById(@RequestParam(name="id",required=true) String id) {
C7525cost c7525cost = c7525costService.getById(id);
if(c7525cost==null) {
return Result.error("未找到对应数据");
}
return Result.OK(c7525cost);
}
/**
* 导出excel
*
* @param request
* @param c7525cost
*/
// @RequiresPermissions(":c7525cost:exportXls")
@ApiOperation(value="c7525cost-导出excel", notes="c7525cost-导出excel")
@RequestMapping(value = "/exportXls", method = RequestMethod.GET)
public ModelAndView exportXls(HttpServletRequest request, C7525cost c7525cost) {
return super.exportXls(request, c7525cost, C7525cost.class, "c7525cost");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions(":c7525cost:importExcel")
@ApiOperation(value="c7525cost-通过excel导入数据", notes="c7525cost-通过excel导入数据")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, C7525cost.class);
}
}
@@ -0,0 +1,54 @@
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.*;
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: c7525cost
* @Author: jeecg-boot
* @Date: 2024-06-06
* @Version: V1.0
*/
@Data
@TableName("c7525cost")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c7525cost对象", description="c7525cost")
public class C7525cost implements Serializable {
private static final long serialVersionUID = 1L;
/**年份*/
@Excel(name = "年份", width = 15)
@ApiModelProperty(value = "年份")
private String year;
/**门控料号(物料id)*/
@Excel(name = "门控料号(物料id)", width = 15)
@ApiModelProperty(value = "门控料号(物料id)")
private String materialNumber;
/**物料规格信息*/
@Excel(name = "物料规格信息", width = 15)
@ApiModelProperty(value = "物料规格信息")
private String zzggxh;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
@TableField(value = "price_7525")
private BigDecimal price7525;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Integer id;
}
@@ -0,0 +1,18 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import java.util.List;
import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: c7525cost
* @Author: jeecg-boot
* @Date: 2024-06-06
* @Version: V1.0
*/
public interface C7525costMapper extends BaseMapper<C7525cost> {
}
@@ -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.C7525costMapper">
</mapper>
@@ -0,0 +1,15 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
/**
* @Description: c7525cost
* @Author: jeecg-boot
* @Date: 2024-06-06
* @Version: V1.0
*/
public interface IC7525costService extends IService<C7525cost> {
}
@@ -0,0 +1,20 @@
package com.zzsmart.qomo.kn.cost.manage.service.impl;
import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost;
import com.zzsmart.qomo.kn.cost.manage.mapper.C7525costMapper;
import com.zzsmart.qomo.kn.cost.manage.service.IC7525costService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: c7525cost
* @Author: jeecg-boot
* @Date: 2024-06-06
* @Version: V1.0
*/
@Service
public class C7525costServiceImpl extends ServiceImpl<C7525costMapper, C7525cost> implements IC7525costService {
}