diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java new file mode 100644 index 0000000..6fe285c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java @@ -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 { + @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> queryPageList(C7525cost c7525cost, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(c7525cost, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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 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 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 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 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 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); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java new file mode 100644 index 0000000..6b462c6 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java @@ -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; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java new file mode 100644 index 0000000..57a4091 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java @@ -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 { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.xml new file mode 100644 index 0000000..ea32c53 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java new file mode 100644 index 0000000..250e666 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java @@ -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 { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java new file mode 100644 index 0000000..df2d814 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java @@ -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 implements IC7525costService { + +}