12 changed files with 828 additions and 4 deletions
@ -0,0 +1,131 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
/** |
||||
* 物料基础信息 实体类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@Data |
||||
@TableName("logpm_basicdata_material") |
||||
@ApiModel(value = "BasicMaterial对象", description = "物料基础信息") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BasicMaterialEntity extends TenantEntity { |
||||
|
||||
/** |
||||
* 预留1 |
||||
*/ |
||||
@ApiModelProperty(value = "预留1") |
||||
private String reserve1; |
||||
/** |
||||
* 预留2 |
||||
*/ |
||||
@ApiModelProperty(value = "预留2") |
||||
private String reserve2; |
||||
/** |
||||
* 预留3 |
||||
*/ |
||||
@ApiModelProperty(value = "预留3") |
||||
private String reserve3; |
||||
/** |
||||
* 预留4 |
||||
*/ |
||||
@ApiModelProperty(value = "预留4") |
||||
private String reserve4; |
||||
/** |
||||
* 预留5 |
||||
*/ |
||||
@ApiModelProperty(value = "预留5") |
||||
private String reserve5; |
||||
/** |
||||
* 产品编码 |
||||
*/ |
||||
@ApiModelProperty(value = "产品编码") |
||||
private String productCode; |
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ApiModelProperty(value = "名称") |
||||
private String name; |
||||
/** |
||||
* 品牌 |
||||
*/ |
||||
@ApiModelProperty(value = "品牌") |
||||
private String brandId; |
||||
/** |
||||
* 属性 |
||||
*/ |
||||
@ApiModelProperty(value = "属性") |
||||
private String property; |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ApiModelProperty(value = "规格") |
||||
private String specification; |
||||
/** |
||||
* 包装规格 |
||||
*/ |
||||
@ApiModelProperty(value = "包装规格") |
||||
private String packingSpecification; |
||||
/** |
||||
* 包装材质 |
||||
*/ |
||||
@ApiModelProperty(value = "包装材质") |
||||
private String packagingMaterial; |
||||
/** |
||||
* 长 |
||||
*/ |
||||
@ApiModelProperty(value = "长") |
||||
private BigDecimal extent; |
||||
/** |
||||
* 宽 |
||||
*/ |
||||
@ApiModelProperty(value = "宽") |
||||
private BigDecimal breadth; |
||||
/** |
||||
* 高度 |
||||
*/ |
||||
@ApiModelProperty(value = "高度") |
||||
private BigDecimal altitude; |
||||
/** |
||||
* 体积 |
||||
*/ |
||||
@ApiModelProperty(value = "体积") |
||||
private BigDecimal volume; |
||||
/** |
||||
* 总量 |
||||
*/ |
||||
@ApiModelProperty(value = "总量") |
||||
private BigDecimal weight; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remark; |
||||
|
||||
} |
@ -0,0 +1,49 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.feign; |
||||
|
||||
import org.springblade.core.mp.support.BladePage; |
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
/** |
||||
* 物料基础信息 Feign接口类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@FeignClient( |
||||
value = "blade-basicMaterial" |
||||
) |
||||
public interface IBasicMaterialClient { |
||||
|
||||
String API_PREFIX = "material/client"; |
||||
String TOP = API_PREFIX + "/top"; |
||||
|
||||
/** |
||||
* 获取物料基础信息列表 |
||||
* |
||||
* @param current 页号 |
||||
* @param size 页数 |
||||
* @return BladePage |
||||
*/ |
||||
@GetMapping(TOP) |
||||
BladePage<BasicMaterialEntity> materialTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); |
||||
|
||||
} |
@ -0,0 +1,35 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.vo; |
||||
|
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import org.springblade.core.tool.node.INode; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 物料基础信息 视图实体类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BasicMaterialVO extends BasicMaterialEntity { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,150 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.controller; |
||||
|
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import lombok.AllArgsConstructor; |
||||
import javax.validation.Valid; |
||||
|
||||
import org.springblade.core.secure.BladeUser; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.vo.BasicMaterialVO; |
||||
import com.logpm.basic.excel.BasicMaterialExcel; |
||||
import com.logpm.basic.service.IBasicMaterialService; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.tool.constant.BladeConstant; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
import java.util.Map; |
||||
import java.util.List; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* 物料基础信息 控制器 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/material") |
||||
@Api(value = "物料基础信息", tags = "物料基础信息接口") |
||||
public class BasicMaterialController extends BladeController { |
||||
|
||||
private final IBasicMaterialService basicMaterialService; |
||||
|
||||
/** |
||||
* 物料基础信息 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入basicMaterial") |
||||
public R<BasicMaterialEntity> detail(BasicMaterialEntity basicMaterial) { |
||||
BasicMaterialEntity detail = basicMaterialService.getOne(Condition.getQueryWrapper(basicMaterial)); |
||||
return R.data(detail); |
||||
} |
||||
/** |
||||
* 物料基础信息 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入basicMaterial") |
||||
public R<IPage<BasicMaterialEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicMaterial, Query query) { |
||||
IPage<BasicMaterialEntity> pages = basicMaterialService.page(Condition.getPage(query), Condition.getQueryWrapper(basicMaterial, BasicMaterialEntity.class)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 物料基础信息 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入basicMaterial") |
||||
public R<IPage<BasicMaterialVO>> page(BasicMaterialVO basicMaterial, Query query) { |
||||
IPage<BasicMaterialVO> pages = basicMaterialService.selectBasicMaterialPage(Condition.getPage(query), basicMaterial); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 物料基础信息 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入basicMaterial") |
||||
public R save(@Valid @RequestBody BasicMaterialEntity basicMaterial) { |
||||
return R.status(basicMaterialService.save(basicMaterial)); |
||||
} |
||||
|
||||
/** |
||||
* 物料基础信息 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入basicMaterial") |
||||
public R update(@Valid @RequestBody BasicMaterialEntity basicMaterial) { |
||||
return R.status(basicMaterialService.updateById(basicMaterial)); |
||||
} |
||||
|
||||
/** |
||||
* 物料基础信息 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入basicMaterial") |
||||
public R submit(@Valid @RequestBody BasicMaterialEntity basicMaterial) { |
||||
return R.status(basicMaterialService.saveOrUpdate(basicMaterial)); |
||||
} |
||||
|
||||
/** |
||||
* 物料基础信息 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(basicMaterialService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
*/ |
||||
@GetMapping("/export-basicMaterial") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "导出数据", notes = "传入basicMaterial") |
||||
public void exportBasicMaterial(@ApiIgnore @RequestParam Map<String, Object> basicMaterial, BladeUser bladeUser, HttpServletResponse response) { |
||||
QueryWrapper<BasicMaterialEntity> queryWrapper = Condition.getQueryWrapper(basicMaterial, BasicMaterialEntity.class); |
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(BasicMaterial::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
queryWrapper.lambda().eq(BasicMaterialEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
||||
List<BasicMaterialExcel> list = basicMaterialService.exportBasicMaterial(queryWrapper); |
||||
ExcelUtil.export(response, "物料基础信息数据" + DateUtil.time(), "物料基础信息数据表", list, BasicMaterialExcel.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,34 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.dto; |
||||
|
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 物料基础信息 数据传输对象实体类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BasicMaterialDTO extends BasicMaterialEntity { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,166 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.excel; |
||||
|
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import java.io.Serializable; |
||||
|
||||
|
||||
/** |
||||
* 物料基础信息 Excel实体类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class BasicMaterialExcel implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 租户号 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("租户号") |
||||
private String tenantId; |
||||
/** |
||||
* 是否已删除 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("是否已删除") |
||||
private Integer isDeleted; |
||||
/** |
||||
* 预留1 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("预留1") |
||||
private String reserve1; |
||||
/** |
||||
* 预留2 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("预留2") |
||||
private String reserve2; |
||||
/** |
||||
* 预留3 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("预留3") |
||||
private String reserve3; |
||||
/** |
||||
* 预留4 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("预留4") |
||||
private String reserve4; |
||||
/** |
||||
* 预留5 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("预留5") |
||||
private String reserve5; |
||||
/** |
||||
* 产品编码 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("产品编码") |
||||
private String productCode; |
||||
/** |
||||
* 名称 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("名称") |
||||
private String name; |
||||
/** |
||||
* 品牌 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("品牌") |
||||
private String brand; |
||||
/** |
||||
* 属性 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("属性") |
||||
private String property; |
||||
/** |
||||
* 规格 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("规格") |
||||
private String specification; |
||||
/** |
||||
* 包装规格 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("包装规格") |
||||
private String packingSpecification; |
||||
/** |
||||
* 包装材质 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("包装材质") |
||||
private String packagingMaterial; |
||||
/** |
||||
* 长 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("长") |
||||
private BigDecimal extent; |
||||
/** |
||||
* 宽 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("宽") |
||||
private BigDecimal breadth; |
||||
/** |
||||
* 高度 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("高度") |
||||
private BigDecimal altitude; |
||||
/** |
||||
* 体积 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("体积") |
||||
private BigDecimal volume; |
||||
/** |
||||
* 总量 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("总量") |
||||
private BigDecimal weight; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("备注") |
||||
private String remark; |
||||
|
||||
} |
@ -0,0 +1,53 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.feign; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.mp.support.BladePage; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.service.IBasicMaterialService; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
/** |
||||
* 物料基础信息 Feign实现类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class BasicMaterialClient implements IBasicMaterialClient { |
||||
|
||||
private final IBasicMaterialService basicMaterialService; |
||||
|
||||
@Override |
||||
@GetMapping(TOP) |
||||
public BladePage<BasicMaterialEntity> materialTop(Integer current, Integer size) { |
||||
Query query = new Query(); |
||||
query.setCurrent(current); |
||||
query.setSize(size); |
||||
IPage<BasicMaterialEntity> page = basicMaterialService.page(Condition.getPage(query)); |
||||
return BladePage.of(page); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,54 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.mapper; |
||||
|
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.vo.BasicMaterialVO; |
||||
import com.logpm.basic.excel.BasicMaterialExcel; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 物料基础信息 Mapper 接口 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
public interface BasicMaterialMapper extends BaseMapper<BasicMaterialEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param basicMaterial |
||||
* @return |
||||
*/ |
||||
List<BasicMaterialVO> selectBasicMaterialPage(IPage page, BasicMaterialVO basicMaterial); |
||||
|
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<BasicMaterialExcel> exportBasicMaterial(@Param("ew") Wrapper<BasicMaterialEntity> queryWrapper); |
||||
|
||||
} |
@ -0,0 +1,46 @@
|
||||
<?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.logpm.basic.mapper.BasicMaterialMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="basicMaterialResultMap" type="com.logpm.basic.entity.BasicMaterialEntity"> |
||||
<result column="tenant_id" property="tenantId"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="status" property="status"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="id" property="id"/> |
||||
<result column="reserve1" property="reserve1"/> |
||||
<result column="reserve2" property="reserve2"/> |
||||
<result column="reserve3" property="reserve3"/> |
||||
<result column="reserve4" property="reserve4"/> |
||||
<result column="reserve5" property="reserve5"/> |
||||
<result column="product_code" property="productCode"/> |
||||
<result column="name" property="name"/> |
||||
<result column="brand" property="brand"/> |
||||
<result column="property" property="property"/> |
||||
<result column="specification" property="specification"/> |
||||
<result column="packing_specification" property="packingSpecification"/> |
||||
<result column="packaging_material" property="packagingMaterial"/> |
||||
<result column="extent" property="extent"/> |
||||
<result column="breadth" property="breadth"/> |
||||
<result column="altitude" property="altitude"/> |
||||
<result column="volume" property="volume"/> |
||||
<result column="weight" property="weight"/> |
||||
<result column="remark" property="remark"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectBasicMaterialPage" resultMap="basicMaterialResultMap"> |
||||
select * from logpm_basicdata_material where is_deleted = 0 |
||||
</select> |
||||
|
||||
|
||||
<select id="exportBasicMaterial" resultType="com.logpm.basic.excel.BasicMaterialExcel"> |
||||
SELECT * FROM logpm_basicdata_material ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,52 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.vo.BasicMaterialVO; |
||||
import com.logpm.basic.excel.BasicMaterialExcel; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 物料基础信息 服务类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
public interface IBasicMaterialService extends BaseService<BasicMaterialEntity> { |
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param basicMaterial |
||||
* @return |
||||
*/ |
||||
IPage<BasicMaterialVO> selectBasicMaterialPage(IPage<BasicMaterialVO> page, BasicMaterialVO basicMaterial); |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<BasicMaterialExcel> exportBasicMaterial(Wrapper<BasicMaterialEntity> queryWrapper); |
||||
|
||||
} |
@ -0,0 +1,54 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.basic.service.impl; |
||||
|
||||
import com.logpm.basic.entity.BasicMaterialEntity; |
||||
import com.logpm.basic.vo.BasicMaterialVO; |
||||
import com.logpm.basic.excel.BasicMaterialExcel; |
||||
import com.logpm.basic.mapper.BasicMaterialMapper; |
||||
import com.logpm.basic.service.IBasicMaterialService; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 物料基础信息 服务实现类 |
||||
* |
||||
* @author tjj |
||||
* @since 2023-05-26 |
||||
*/ |
||||
@Service |
||||
public class BasicMaterialServiceImpl extends BaseServiceImpl<BasicMaterialMapper, BasicMaterialEntity> implements IBasicMaterialService { |
||||
|
||||
@Override |
||||
public IPage<BasicMaterialVO> selectBasicMaterialPage(IPage<BasicMaterialVO> page, BasicMaterialVO basicMaterial) { |
||||
return page.setRecords(baseMapper.selectBasicMaterialPage(page, basicMaterial)); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<BasicMaterialExcel> exportBasicMaterial(Wrapper<BasicMaterialEntity> queryWrapper) { |
||||
List<BasicMaterialExcel> basicMaterialList = baseMapper.exportBasicMaterial(queryWrapper); |
||||
//basicMaterialList.forEach(basicMaterial -> {
|
||||
// basicMaterial.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicMaterial.getType()));
|
||||
//});
|
||||
return basicMaterialList; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue