parent
49d65e418d
commit
def6d34ac1
41 changed files with 2175 additions and 14 deletions
@ -0,0 +1,204 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
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.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.spares.excel.ManufacturerInfoExcel; |
||||
import org.energy.modules.system.util.DataUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import org.energy.modules.spares.vo.ManufacturerInfoVO; |
||||
import org.energy.modules.spares.service.IManufacturerInfoService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* spt_manufacturer_info 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/manufacturerinfo") |
||||
@Api(value = "spt_manufacturer_info", tags = "spt_manufacturer_info接口") |
||||
public class ManufacturerInfoController extends DafController { |
||||
|
||||
private IManufacturerInfoService manufacturerInfoService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入manufacturerInfo") |
||||
public R<ManufacturerInfo> detail(ManufacturerInfo manufacturerInfo) { |
||||
ManufacturerInfo detail = manufacturerInfoService.getOne(Condition.getQueryWrapper(manufacturerInfo)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 spt_manufacturer_info |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入manufacturerInfo") |
||||
public R<IPage<ManufacturerInfo>> list(ManufacturerInfo manufacturerInfo, Query query) { |
||||
QueryWrapper<ManufacturerInfo> qw = new QueryWrapper<>(); |
||||
if (StringUtils.isNotEmpty(manufacturerInfo.getCreditCode())) { |
||||
qw.lambda().like(ManufacturerInfo::getCreditCode, manufacturerInfo.getCreditCode()); |
||||
} |
||||
if (StringUtils.isNotEmpty(manufacturerInfo.getManufacturerName())) { |
||||
qw.lambda().like(ManufacturerInfo::getManufacturerName, manufacturerInfo.getManufacturerName()); |
||||
} |
||||
qw.lambda().eq(ManufacturerInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
qw.lambda().orderByDesc(ManufacturerInfo::getUpdateTime); |
||||
IPage<ManufacturerInfo> pages = manufacturerInfoService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 spt_manufacturer_info |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入manufacturerInfo") |
||||
public R<IPage<ManufacturerInfoVO>> page(ManufacturerInfoVO manufacturerInfo, Query query) { |
||||
IPage<ManufacturerInfoVO> pages = manufacturerInfoService.selectManufacturerInfoPage(Condition.getPage(query), manufacturerInfo); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 spt_manufacturer_info |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入manufacturerInfo") |
||||
public R save(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { |
||||
return R.status(manufacturerInfoService.save(manufacturerInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 spt_manufacturer_info |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入manufacturerInfo") |
||||
public R update(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { |
||||
return R.status(manufacturerInfoService.updateById(manufacturerInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 spt_manufacturer_info |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入manufacturerInfo") |
||||
public R submit(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { |
||||
return R.status(manufacturerInfoService.saveOrUpdate(manufacturerInfo)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 spt_manufacturer_info |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(manufacturerInfoService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 审核 |
||||
*/ |
||||
@PostMapping("/auditing") |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(2,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回 |
||||
*/ |
||||
@PostMapping("/reject") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(3,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回OR审核 |
||||
*/ |
||||
public R approve(Integer status, String ids) { |
||||
List<ManufacturerInfo> list = new ArrayList<>(); |
||||
for (String id : ids.split(",")) { |
||||
ManufacturerInfo manufacturerInfo = new ManufacturerInfo(); |
||||
manufacturerInfo.setId(Long.parseLong(id)); |
||||
manufacturerInfo.setApprovalStatus(status); |
||||
list.add(manufacturerInfo); |
||||
} |
||||
return R.status(manufacturerInfoService.updateBatchById(list)); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
entity.remove("daf-auth"); |
||||
ManufacturerInfoVO vo = DataUtils.mapToEntity(entity, ManufacturerInfoVO::new); |
||||
List<ManufacturerInfoExcel> list = manufacturerInfoService.export(vo); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("制造商信息管理数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), ManufacturerInfoExcel.class).sheet("制造商信息管理").doWrite(list); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,170 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
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.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.spares.excel.MaterialClassExcel; |
||||
import org.energy.modules.system.util.DataUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import org.energy.modules.spares.vo.MaterialClassificationVO; |
||||
import org.energy.modules.spares.service.IMaterialClassificationService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* spt_material_classification 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/materialclassification") |
||||
@Api(value = "spt_material_classification", tags = "spt_material_classification接口") |
||||
public class MaterialClassificationController extends DafController { |
||||
|
||||
private IMaterialClassificationService materialClassificationService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入materialClassification") |
||||
public R<MaterialClassification> detail(MaterialClassification materialClassification) { |
||||
MaterialClassification detail = materialClassificationService.getOne(Condition.getQueryWrapper(materialClassification)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 spt_material_classification |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入materialClassification") |
||||
public R<IPage<MaterialClassification>> list(MaterialClassification materialClassification, Query query) { |
||||
QueryWrapper<MaterialClassification> qw = new QueryWrapper<>(); |
||||
if (StringUtils.isNotEmpty(materialClassification.getCode())) { |
||||
qw.lambda().like(MaterialClassification::getCode, materialClassification.getCode()); |
||||
} |
||||
if (materialClassification.getType() != null) { |
||||
qw.lambda().eq(MaterialClassification::getType, materialClassification.getType()); |
||||
} |
||||
qw.lambda().eq(MaterialClassification::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
qw.lambda().orderByDesc(MaterialClassification::getUpdateTime); |
||||
IPage<MaterialClassification> pages = materialClassificationService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 spt_material_classification |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入materialClassification") |
||||
public R<IPage<MaterialClassificationVO>> page(MaterialClassificationVO materialClassification, Query query) { |
||||
IPage<MaterialClassificationVO> pages = materialClassificationService.selectMaterialClassificationPage(Condition.getPage(query), materialClassification); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 spt_material_classification |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入materialClassification") |
||||
public R save(@Valid @RequestBody MaterialClassification materialClassification) { |
||||
return R.status(materialClassificationService.save(materialClassification)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 spt_material_classification |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入materialClassification") |
||||
public R update(@Valid @RequestBody MaterialClassification materialClassification) { |
||||
return R.status(materialClassificationService.updateById(materialClassification)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 spt_material_classification |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入materialClassification") |
||||
public R submit(@Valid @RequestBody MaterialClassification materialClassification) { |
||||
return R.status(materialClassificationService.saveOrUpdate(materialClassification)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 spt_material_classification |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(materialClassificationService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
entity.remove("daf-auth"); |
||||
MaterialClassificationVO vo = DataUtils.mapToEntity(entity, MaterialClassificationVO::new); |
||||
List<MaterialClassExcel> list = materialClassificationService.export(vo); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("物资分类码数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), MaterialClassExcel.class).sheet("物资分类码").doWrite(list); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,205 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
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.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.spares.excel.SupplierInfoExcel; |
||||
import org.energy.modules.system.util.DataUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import org.energy.modules.spares.vo.SupplierInfoVO; |
||||
import org.energy.modules.spares.service.ISupplierInfoService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* spt_supplier_info 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/supplierinfo") |
||||
@Api(value = "spt_supplier_info", tags = "spt_supplier_info接口") |
||||
public class SupplierInfoController extends DafController { |
||||
|
||||
private ISupplierInfoService supplierInfoService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入supplierInfo") |
||||
public R<SupplierInfo> detail(SupplierInfo supplierInfo) { |
||||
SupplierInfo detail = supplierInfoService.getOne(Condition.getQueryWrapper(supplierInfo)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 spt_supplier_info |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入supplierInfo") |
||||
public R<IPage<SupplierInfo>> list(SupplierInfo supplierInfo, Query query) { |
||||
QueryWrapper<SupplierInfo> qw = new QueryWrapper<>(); |
||||
if (StringUtils.isNotEmpty(supplierInfo.getCreditCode())) { |
||||
qw.lambda().like(SupplierInfo::getCreditCode, supplierInfo.getCreditCode()); |
||||
} |
||||
if (StringUtils.isNotEmpty(supplierInfo.getSupplierName())) { |
||||
qw.lambda().like(SupplierInfo::getSupplierName, supplierInfo.getSupplierName()); |
||||
} |
||||
qw.lambda().eq(SupplierInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
qw.lambda().orderByDesc(SupplierInfo::getUpdateTime); |
||||
IPage<SupplierInfo> pages = supplierInfoService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 spt_supplier_info |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入supplierInfo") |
||||
public R<IPage<SupplierInfoVO>> page(SupplierInfoVO supplierInfo, Query query) { |
||||
IPage<SupplierInfoVO> pages = supplierInfoService.selectSupplierInfoPage(Condition.getPage(query), supplierInfo); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 spt_supplier_info |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入supplierInfo") |
||||
public R save(@Valid @RequestBody SupplierInfo supplierInfo) { |
||||
return R.status(supplierInfoService.save(supplierInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 spt_supplier_info |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入supplierInfo") |
||||
public R update(@Valid @RequestBody SupplierInfo supplierInfo) { |
||||
return R.status(supplierInfoService.updateById(supplierInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 spt_supplier_info |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入supplierInfo") |
||||
public R submit(@Valid @RequestBody SupplierInfo supplierInfo) { |
||||
return R.status(supplierInfoService.saveOrUpdate(supplierInfo)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 spt_supplier_info |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(supplierInfoService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 审核 |
||||
*/ |
||||
@PostMapping("/auditing") |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(2,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回 |
||||
*/ |
||||
@PostMapping("/reject") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(3,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回OR审核 |
||||
*/ |
||||
public R approve(Integer status, String ids) { |
||||
List<SupplierInfo> list = new ArrayList<>(); |
||||
for (String id : ids.split(",")) { |
||||
SupplierInfo supplierInfo = new SupplierInfo(); |
||||
supplierInfo.setId(Long.parseLong(id)); |
||||
supplierInfo.setApprovalStatus(status); |
||||
list.add(supplierInfo); |
||||
} |
||||
return R.status(supplierInfoService.updateBatchById(list)); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
entity.remove("daf-auth"); |
||||
SupplierInfoVO vo = DataUtils.mapToEntity(entity, SupplierInfoVO::new); |
||||
List<SupplierInfoExcel> list = supplierInfoService.export(vo); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("供应商信息管理数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), SupplierInfoExcel.class).sheet("供应商信息管理").doWrite(list); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,211 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
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.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import org.energy.modules.spares.excel.WarehouseExcel; |
||||
import org.energy.modules.system.util.DataUtils; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import org.energy.modules.spares.vo.WarehouseVO; |
||||
import org.energy.modules.spares.service.IWarehouseService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* spt_warehouse 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/warehouse") |
||||
@Api(value = "spt_warehouse", tags = "spt_warehouse接口") |
||||
public class WarehouseController extends DafController { |
||||
|
||||
private IWarehouseService warehouseService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入warehouse") |
||||
public R<Warehouse> detail(Warehouse warehouse) { |
||||
Warehouse detail = warehouseService.getOne(Condition.getQueryWrapper(warehouse)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 spt_warehouse |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入warehouse") |
||||
public R<IPage<Warehouse>> list(Warehouse warehouse, Query query) { |
||||
QueryWrapper<Warehouse> qw = new QueryWrapper<>(); |
||||
if (StringUtils.isNotEmpty(warehouse.getCode())) { |
||||
qw.lambda().like(Warehouse::getCode, warehouse.getCode()); |
||||
} |
||||
if (StringUtils.isNotEmpty(warehouse.getName())) { |
||||
qw.lambda().like(Warehouse::getName, warehouse.getName()); |
||||
} |
||||
if (StringUtils.isNotEmpty(warehouse.getAddress())) { |
||||
qw.lambda().like(Warehouse::getAddress, warehouse.getAddress()); |
||||
} |
||||
if (warehouse.getType() != null) { |
||||
qw.lambda().eq(Warehouse::getType, warehouse.getType()); |
||||
} |
||||
qw.lambda().eq(Warehouse::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
qw.lambda().orderByDesc(Warehouse::getUpdateTime); |
||||
IPage<Warehouse> pages = warehouseService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 spt_warehouse |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入warehouse") |
||||
public R<IPage<WarehouseVO>> page(WarehouseVO warehouse, Query query) { |
||||
IPage<WarehouseVO> pages = warehouseService.selectWarehousePage(Condition.getPage(query), warehouse); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 spt_warehouse |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入warehouse") |
||||
public R save(@Valid @RequestBody Warehouse warehouse) { |
||||
return R.status(warehouseService.save(warehouse)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 spt_warehouse |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入warehouse") |
||||
public R update(@Valid @RequestBody Warehouse warehouse) { |
||||
return R.status(warehouseService.updateById(warehouse)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 spt_warehouse |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入warehouse") |
||||
public R submit(@Valid @RequestBody Warehouse warehouse) { |
||||
return R.status(warehouseService.saveOrUpdate(warehouse)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 spt_warehouse |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(warehouseService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 审核 |
||||
*/ |
||||
@PostMapping("/auditing") |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(2,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回 |
||||
*/ |
||||
@PostMapping("/reject") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve(3,ids); |
||||
} |
||||
|
||||
/** |
||||
* 驳回OR审核 |
||||
*/ |
||||
public R approve(Integer status, String ids) { |
||||
List<Warehouse> list = new ArrayList<>(); |
||||
for (String id : ids.split(",")) { |
||||
Warehouse warehouse = new Warehouse(); |
||||
warehouse.setId(Long.parseLong(id)); |
||||
warehouse.setApprovalStatus(status); |
||||
list.add(warehouse); |
||||
} |
||||
return R.status(warehouseService.updateBatchById(list)); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
entity.remove("daf-auth"); |
||||
WarehouseVO vo = DataUtils.mapToEntity(entity, WarehouseVO::new); |
||||
List<WarehouseExcel> list = warehouseService.export(vo); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("仓库数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), WarehouseExcel.class).sheet("仓库").doWrite(list); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.spares.dto; |
||||
|
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* spt_manufacturer_info数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class ManufacturerInfoDTO extends ManufacturerInfo { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.spares.dto; |
||||
|
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* spt_material_classification数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class MaterialClassificationDTO extends MaterialClassification { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.spares.dto; |
||||
|
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* spt_supplier_info数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class SupplierInfoDTO extends SupplierInfo { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.spares.dto; |
||||
|
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* spt_warehouse数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WarehouseDTO extends Warehouse { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,76 @@ |
||||
package org.energy.modules.spares.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* spt_manufacturer_info实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@TableName("spt_manufacturer_info") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "ManufacturerInfo对象", description = "spt_manufacturer_info") |
||||
public class ManufacturerInfo extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 统一社会信用代码/组织机构 |
||||
*/ |
||||
@ApiModelProperty(value = "统一社会信用代码/组织机构") |
||||
private String creditCode; |
||||
/** |
||||
* 制造商名称 |
||||
*/ |
||||
@ApiModelProperty(value = "制造商名称") |
||||
private String manufacturerName; |
||||
/** |
||||
* 注册地址 |
||||
*/ |
||||
@ApiModelProperty(value = "注册地址") |
||||
private String registeredAddress; |
||||
/** |
||||
* 生产地址 |
||||
*/ |
||||
@ApiModelProperty(value = "生产地址") |
||||
private String productionAddress; |
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
@ApiModelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
/** |
||||
* 电子邮箱 |
||||
*/ |
||||
@ApiModelProperty(value = "电子邮箱") |
||||
private String email; |
||||
/** |
||||
* 经营范围 |
||||
*/ |
||||
@ApiModelProperty(value = "经营范围") |
||||
private String businessScope; |
||||
/** |
||||
* 执行标准 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ApiModelProperty(value = "执行标准") |
||||
private Integer approvalStatus; |
||||
|
||||
|
||||
} |
@ -0,0 +1,46 @@ |
||||
package org.energy.modules.spares.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* spt_material_classification实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@TableName("spt_material_classification") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "MaterialClassification对象", description = "spt_material_classification") |
||||
public class MaterialClassification extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 物资分配码 |
||||
*/ |
||||
@ApiModelProperty(value = "物资分配码") |
||||
private String code; |
||||
/** |
||||
* 物资类型 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ApiModelProperty(value = "物资类型") |
||||
private Integer type; |
||||
|
||||
|
||||
} |
@ -0,0 +1,86 @@ |
||||
package org.energy.modules.spares.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* spt_supplier_info实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@TableName("spt_supplier_info") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SupplierInfo对象", description = "spt_supplier_info") |
||||
public class SupplierInfo extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 统一社会信用代码/组织机构 |
||||
*/ |
||||
@ApiModelProperty(value = "统一社会信用代码/组织机构") |
||||
private String creditCode; |
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
@ApiModelProperty(value = "供应商名称") |
||||
private String supplierName; |
||||
/** |
||||
* 注册地址 |
||||
*/ |
||||
@ApiModelProperty(value = "注册地址") |
||||
private String registeredAddress; |
||||
/** |
||||
* 生产地址 |
||||
*/ |
||||
@ApiModelProperty(value = "生产地址") |
||||
private String productionAddress; |
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
@ApiModelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
/** |
||||
* 电子邮箱 |
||||
*/ |
||||
@ApiModelProperty(value = "电子邮箱") |
||||
private String email; |
||||
/** |
||||
* 经营范围 |
||||
*/ |
||||
@ApiModelProperty(value = "经营范围") |
||||
private String businessScope; |
||||
/** |
||||
* 执行标准 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ApiModelProperty(value = "执行标准") |
||||
private Integer approvalStatus; |
||||
/** |
||||
* 付款条约 |
||||
*/ |
||||
@ApiModelProperty(value = "付款条约") |
||||
private String paymentTerms; |
||||
/** |
||||
* 价格条款 |
||||
*/ |
||||
@ApiModelProperty(value = "价格条款") |
||||
private String priceTerms; |
||||
|
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
package org.energy.modules.spares.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* spt_warehouse实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@TableName("spt_warehouse") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "Warehouse对象", description = "spt_warehouse") |
||||
public class Warehouse extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 仓库编号 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库编号") |
||||
private String code; |
||||
/** |
||||
* 仓库名称 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String name; |
||||
/** |
||||
* 仓库地址 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库地址") |
||||
private String address; |
||||
/** |
||||
* 仓库类型 |
||||
*/ |
||||
@ApiModelProperty(value = "仓库类型") |
||||
private Integer type; |
||||
/** |
||||
* 仓库负责人 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "仓库负责人") |
||||
private Long managerUserId; |
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
@ApiModelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
/** |
||||
* 审批状态 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ApiModelProperty(value = "审批状态") |
||||
private Integer approvalStatus; |
||||
|
||||
|
||||
} |
@ -0,0 +1,90 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.excel; |
||||
|
||||
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 com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* Warehouse model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class ManufacturerInfoExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 统一社会信用代码/组织机构 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "统一社会信用代码/组织机构") |
||||
private String creditCode; |
||||
/** |
||||
* 制造商名称 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "制造商名称") |
||||
private String manufacturerName; |
||||
/** |
||||
* 注册地址 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "注册地址") |
||||
private String registeredAddress; |
||||
/** |
||||
* 生产地址 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "生产地址") |
||||
private String productionAddress; |
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
/** |
||||
* 电子邮箱 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "电子邮箱") |
||||
private String email; |
||||
/** |
||||
* 经营范围 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "经营范围") |
||||
private String businessScope; |
||||
/** |
||||
* 执行标准 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "执行标准") |
||||
private String approvalStatus; |
||||
|
||||
} |
@ -0,0 +1,57 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.excel; |
||||
|
||||
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 lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* Warehouse model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class MaterialClassExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "物资分类码") |
||||
private String code; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "物资类型") |
||||
private String type; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "创建时间") |
||||
private String createTime; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "创建人") |
||||
private String createUserName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "审批状态") |
||||
private String approvalStatus; |
||||
|
||||
} |
@ -0,0 +1,99 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.excel; |
||||
|
||||
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 com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* SupplierInfo model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class SupplierInfoExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 统一社会信用代码/组织机构 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "统一社会信用代码/组织机构") |
||||
private String creditCode; |
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "供应商名称") |
||||
private String supplierName; |
||||
/** |
||||
* 注册地址 |
||||
*/ |
||||
/** |
||||
* 生产地址 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "生产地址") |
||||
private String productionAddress; |
||||
/** |
||||
* 联系电话 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
/** |
||||
* 电子邮箱 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "电子邮箱") |
||||
private String email; |
||||
/** |
||||
* 经营范围 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "经营范围") |
||||
private String businessScope; |
||||
/** |
||||
* 执行标准 |
||||
*/ |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "执行标准") |
||||
private String approvalStatus; |
||||
/** |
||||
* 付款条约 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "付款条约") |
||||
private String paymentTerms; |
||||
/** |
||||
* 价格条款 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "价格条款") |
||||
private String priceTerms; |
||||
|
||||
} |
@ -0,0 +1,66 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.spares.excel; |
||||
|
||||
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 lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* Warehouse model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class WarehouseExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "仓库编号") |
||||
private String code; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "仓库名称") |
||||
private String name; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "仓库地址") |
||||
private String address; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "仓库类型") |
||||
private String type; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "仓库负责人") |
||||
private String managerUserName; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "联系电话") |
||||
private String contactNumber; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "审批状态") |
||||
private String approvalStatus; |
||||
|
||||
|
||||
} |
@ -0,0 +1,30 @@ |
||||
package org.energy.modules.spares.mapper; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import org.energy.modules.spares.excel.ManufacturerInfoExcel; |
||||
import org.energy.modules.spares.vo.ManufacturerInfoVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_manufacturer_info Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface ManufacturerInfoMapper extends BaseMapper<ManufacturerInfo> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param manufacturerInfo |
||||
* @return |
||||
*/ |
||||
List<ManufacturerInfoVO> selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo); |
||||
|
||||
List<ManufacturerInfoExcel> exportData(@Param("vo") ManufacturerInfoVO manufacturerInfo); |
||||
} |
@ -0,0 +1,51 @@ |
||||
<?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="org.energy.modules.spares.mapper.ManufacturerInfoMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="manufacturerInfoResultMap" type="org.energy.modules.spares.entity.ManufacturerInfo"> |
||||
<id column="id" property="id"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="status" property="status"/> |
||||
<result column="credit_code" property="creditCode"/> |
||||
<result column="manufacturer_name" property="manufacturerName"/> |
||||
<result column="registered_address" property="registeredAddress"/> |
||||
<result column="production_address" property="productionAddress"/> |
||||
<result column="contact_number" property="contactNumber"/> |
||||
<result column="email" property="email"/> |
||||
<result column="business_scope" property="businessScope"/> |
||||
<result column="approval_status" property="approvalStatus"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectManufacturerInfoPage" resultMap="manufacturerInfoResultMap"> |
||||
select * from spt_manufacturer_info where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.spares.excel.ManufacturerInfoExcel"> |
||||
select |
||||
a.credit_code, |
||||
a.manufacturer_name, |
||||
a.registered_address, |
||||
a.production_address, |
||||
a.contact_number, |
||||
a.email, |
||||
a.business_scope, |
||||
a.approval_status |
||||
from spt_manufacturer_info a |
||||
where a.is_deleted = 0 |
||||
<if test="vo.creditCode != null and vo.creditCode != ''"> |
||||
and a.credit_Code LIKE CONCAT('%', #{vo.creditCode}, '%') |
||||
</if> |
||||
<if test="vo.manufacturerName != null and vo.manufacturerName != ''"> |
||||
and a.manufacturer_name LIKE CONCAT('%', #{vo.manufacturerName}, '%') |
||||
</if> |
||||
order by a.update_time desc |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,30 @@ |
||||
package org.energy.modules.spares.mapper; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import org.energy.modules.spares.excel.MaterialClassExcel; |
||||
import org.energy.modules.spares.vo.MaterialClassificationVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_material_classification Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface MaterialClassificationMapper extends BaseMapper<MaterialClassification> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param materialClassification |
||||
* @return |
||||
*/ |
||||
List<MaterialClassificationVO> selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification); |
||||
|
||||
List<MaterialClassExcel> exportData(@Param("vo") MaterialClassificationVO materialClassification); |
||||
} |
@ -0,0 +1,43 @@ |
||||
<?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="org.energy.modules.spares.mapper.MaterialClassificationMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="materialClassificationResultMap" type="org.energy.modules.spares.entity.MaterialClassification"> |
||||
<id column="id" property="id"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="status" property="status"/> |
||||
<result column="code" property="code"/> |
||||
<result column="type" property="type"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectMaterialClassificationPage" resultMap="materialClassificationResultMap"> |
||||
select * from spt_material_classification where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.spares.excel.MaterialClassExcel"> |
||||
select |
||||
a.code, |
||||
a.type, |
||||
a.approval_status, |
||||
a.create_time, |
||||
c.name as create_user_name |
||||
from spt_material_classification a |
||||
left join sys_user c on c.id = a.create_user and c.is_deleted = 0 |
||||
where a.is_deleted = 0 |
||||
<if test="vo.code != null and vo.code != ''"> |
||||
and a.code LIKE CONCAT('%', #{vo.code}, '%') |
||||
</if> |
||||
<if test="vo.type != null and vo.type != ''"> |
||||
and a.type = #{vo.type} |
||||
</if> |
||||
order by a.update_time desc |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,31 @@ |
||||
package org.energy.modules.spares.mapper; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import org.energy.modules.spares.excel.SupplierInfoExcel; |
||||
import org.energy.modules.spares.vo.SupplierInfoVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_supplier_info Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface SupplierInfoMapper extends BaseMapper<SupplierInfo> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param supplierInfo |
||||
* @return |
||||
*/ |
||||
List<SupplierInfoVO> selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo); |
||||
|
||||
List<SupplierInfoExcel> exportData(@Param("vo") SupplierInfoVO supplierInfo); |
||||
|
||||
} |
@ -0,0 +1,54 @@ |
||||
<?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="org.energy.modules.spares.mapper.SupplierInfoMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="supplierInfoResultMap" type="org.energy.modules.spares.entity.SupplierInfo"> |
||||
<id column="id" property="id"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="status" property="status"/> |
||||
<result column="credit_code" property="creditCode"/> |
||||
<result column="supplier_name" property="supplierName"/> |
||||
<result column="registered_address" property="registeredAddress"/> |
||||
<result column="production_address" property="productionAddress"/> |
||||
<result column="contact_number" property="contactNumber"/> |
||||
<result column="email" property="email"/> |
||||
<result column="business_scope" property="businessScope"/> |
||||
<result column="approval_status" property="approvalStatus"/> |
||||
<result column="payment_terms" property="paymentTerms"/> |
||||
<result column="price_terms" property="priceTerms"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectSupplierInfoPage" resultMap="supplierInfoResultMap"> |
||||
select * from spt_supplier_info where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.spares.excel.SupplierInfoExcel"> |
||||
select |
||||
a.credit_code, |
||||
a.supplier_name, |
||||
a.production_address, |
||||
a.contact_number, |
||||
a.email, |
||||
a.business_scope, |
||||
a.approval_status, |
||||
a.payment_terms, |
||||
a.price_terms |
||||
from spt_supplier_info a |
||||
where a.is_deleted = 0 |
||||
<if test="vo.creditCode != null and vo.creditCode != ''"> |
||||
and a.credit_code LIKE CONCAT('%', #{vo.creditCode}, '%') |
||||
</if> |
||||
<if test="vo.supplierName != null and vo.supplierName != ''"> |
||||
and a.supplier_name LIKE CONCAT('%', #{vo.supplierName}, '%') |
||||
</if> |
||||
order by a.update_time desc |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,30 @@ |
||||
package org.energy.modules.spares.mapper; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import org.energy.modules.spares.excel.WarehouseExcel; |
||||
import org.energy.modules.spares.vo.WarehouseVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_warehouse Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface WarehouseMapper extends BaseMapper<Warehouse> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param warehouse |
||||
* @return |
||||
*/ |
||||
List<WarehouseVO> selectWarehousePage(IPage page, WarehouseVO warehouse); |
||||
|
||||
List<WarehouseExcel> exportData(@Param("vo") WarehouseVO warehouseVO); |
||||
|
||||
} |
@ -0,0 +1,56 @@ |
||||
<?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="org.energy.modules.spares.mapper.WarehouseMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="warehouseResultMap" type="org.energy.modules.spares.entity.Warehouse"> |
||||
<id column="id" property="id"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="create_dept" property="createDept"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="status" property="status"/> |
||||
<result column="code" property="code"/> |
||||
<result column="name" property="name"/> |
||||
<result column="address" property="address"/> |
||||
<result column="type" property="type"/> |
||||
<result column="manager_user_id" property="managerUserId"/> |
||||
<result column="contact_number" property="contactNumber"/> |
||||
<result column="approval_status" property="approvalStatus"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectWarehousePage" resultMap="warehouseResultMap"> |
||||
select * from spt_warehouse where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.spares.excel.WarehouseExcel"> |
||||
select |
||||
a.code, |
||||
a.name, |
||||
a.address, |
||||
a.type, |
||||
a.contact_number, |
||||
c.name as manager_user_name, |
||||
a.approval_status |
||||
from spt_warehouse a |
||||
left join sys_user c on c.id = a.manager_user_id and c.is_deleted = 0 |
||||
where a.is_deleted = 0 |
||||
<if test="vo.code != null and vo.code != ''"> |
||||
and a.code LIKE CONCAT('%', #{vo.code}, '%') |
||||
</if> |
||||
<if test="vo.name != null and vo.name != ''"> |
||||
and a.name LIKE CONCAT('%', #{vo.name}, '%') |
||||
</if> |
||||
<if test="vo.address != null and vo.address != ''"> |
||||
and a.address LIKE CONCAT('%', #{vo.address}, '%') |
||||
</if> |
||||
<if test="vo.type != null and vo.type != ''"> |
||||
and a.type = #{vo.type} |
||||
</if> |
||||
order by a.update_time desc |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,29 @@ |
||||
package org.energy.modules.spares.service; |
||||
|
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import org.energy.modules.spares.excel.ManufacturerInfoExcel; |
||||
import org.energy.modules.spares.vo.ManufacturerInfoVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_manufacturer_info 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface IManufacturerInfoService extends BaseService<ManufacturerInfo> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param manufacturerInfo |
||||
* @return |
||||
*/ |
||||
IPage<ManufacturerInfoVO> selectManufacturerInfoPage(IPage<ManufacturerInfoVO> page, ManufacturerInfoVO manufacturerInfo); |
||||
|
||||
List<ManufacturerInfoExcel> export(ManufacturerInfoVO manufacturerInfoVO); |
||||
} |
@ -0,0 +1,30 @@ |
||||
package org.energy.modules.spares.service; |
||||
|
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import org.energy.modules.spares.excel.MaterialClassExcel; |
||||
import org.energy.modules.spares.vo.MaterialClassificationVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_material_classification 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface IMaterialClassificationService extends BaseService<MaterialClassification> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param materialClassification |
||||
* @return |
||||
*/ |
||||
IPage<MaterialClassificationVO> selectMaterialClassificationPage(IPage<MaterialClassificationVO> page, MaterialClassificationVO materialClassification); |
||||
|
||||
List<MaterialClassExcel> export(MaterialClassificationVO materialClassificationVO); |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package org.energy.modules.spares.service; |
||||
|
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import org.energy.modules.spares.excel.SupplierInfoExcel; |
||||
import org.energy.modules.spares.vo.SupplierInfoVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_supplier_info 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface ISupplierInfoService extends BaseService<SupplierInfo> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param supplierInfo |
||||
* @return |
||||
*/ |
||||
IPage<SupplierInfoVO> selectSupplierInfoPage(IPage<SupplierInfoVO> page, SupplierInfoVO supplierInfo); |
||||
|
||||
List<SupplierInfoExcel> export(SupplierInfoVO supplierInfo); |
||||
} |
@ -0,0 +1,30 @@ |
||||
package org.energy.modules.spares.service; |
||||
|
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import org.energy.modules.spares.excel.WarehouseExcel; |
||||
import org.energy.modules.spares.vo.WarehouseVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_warehouse 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
public interface IWarehouseService extends BaseService<Warehouse> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param warehouse |
||||
* @return |
||||
*/ |
||||
IPage<WarehouseVO> selectWarehousePage(IPage<WarehouseVO> page, WarehouseVO warehouse); |
||||
|
||||
List<WarehouseExcel> export(WarehouseVO warehouseVO); |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
package org.energy.modules.spares.service.impl; |
||||
|
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import org.energy.modules.spares.excel.ManufacturerInfoExcel; |
||||
import org.energy.modules.spares.excel.MaterialClassExcel; |
||||
import org.energy.modules.spares.vo.ManufacturerInfoVO; |
||||
import org.energy.modules.spares.mapper.ManufacturerInfoMapper; |
||||
import org.energy.modules.spares.service.IManufacturerInfoService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.energy.modules.system.service.IDictService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_manufacturer_info 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Service |
||||
public class ManufacturerInfoServiceImpl extends BaseServiceImpl<ManufacturerInfoMapper, ManufacturerInfo> implements IManufacturerInfoService { |
||||
|
||||
@Autowired |
||||
IDictService dictService; |
||||
|
||||
@Override |
||||
public IPage<ManufacturerInfoVO> selectManufacturerInfoPage(IPage<ManufacturerInfoVO> page, ManufacturerInfoVO manufacturerInfo) { |
||||
return page.setRecords(baseMapper.selectManufacturerInfoPage(page, manufacturerInfo)); |
||||
} |
||||
|
||||
@Override |
||||
public List<ManufacturerInfoExcel> export(ManufacturerInfoVO manufacturerInfoVO) { |
||||
List<ManufacturerInfoExcel> list = baseMapper.exportData(manufacturerInfoVO); |
||||
list.forEach(item -> { |
||||
if (StringUtils.isNotEmpty(item.getApprovalStatus())) |
||||
item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); |
||||
}); |
||||
return list; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package org.energy.modules.spares.service.impl; |
||||
|
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import org.energy.modules.spares.excel.MaterialClassExcel; |
||||
import org.energy.modules.spares.vo.MaterialClassificationVO; |
||||
import org.energy.modules.spares.mapper.MaterialClassificationMapper; |
||||
import org.energy.modules.spares.service.IMaterialClassificationService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.energy.modules.system.service.IDictService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_material_classification 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Service |
||||
public class MaterialClassificationServiceImpl extends BaseServiceImpl<MaterialClassificationMapper, MaterialClassification> implements IMaterialClassificationService { |
||||
|
||||
@Autowired |
||||
IDictService dictService; |
||||
|
||||
@Override |
||||
public IPage<MaterialClassificationVO> selectMaterialClassificationPage(IPage<MaterialClassificationVO> page, MaterialClassificationVO materialClassification) { |
||||
return page.setRecords(baseMapper.selectMaterialClassificationPage(page, materialClassification)); |
||||
} |
||||
|
||||
@Override |
||||
public List<MaterialClassExcel> export(MaterialClassificationVO materialClassificationVO) { |
||||
List<MaterialClassExcel> list = baseMapper.exportData(materialClassificationVO); |
||||
list.forEach(item -> { |
||||
if (StringUtils.isNotEmpty(item.getApprovalStatus())) |
||||
item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); |
||||
}); |
||||
return list; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package org.energy.modules.spares.service.impl; |
||||
|
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import org.energy.modules.spares.excel.SupplierInfoExcel; |
||||
import org.energy.modules.spares.vo.SupplierInfoVO; |
||||
import org.energy.modules.spares.mapper.SupplierInfoMapper; |
||||
import org.energy.modules.spares.service.ISupplierInfoService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.energy.modules.system.service.IDictService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_supplier_info 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Service |
||||
public class SupplierInfoServiceImpl extends BaseServiceImpl<SupplierInfoMapper, SupplierInfo> implements ISupplierInfoService { |
||||
|
||||
@Autowired |
||||
IDictService dictService; |
||||
|
||||
@Override |
||||
public IPage<SupplierInfoVO> selectSupplierInfoPage(IPage<SupplierInfoVO> page, SupplierInfoVO supplierInfo) { |
||||
return page.setRecords(baseMapper.selectSupplierInfoPage(page, supplierInfo)); |
||||
} |
||||
|
||||
@Override |
||||
public List<SupplierInfoExcel> export(SupplierInfoVO supplierInfo) { |
||||
List<SupplierInfoExcel> list = baseMapper.exportData(supplierInfo); |
||||
list.forEach(item -> { |
||||
if (StringUtils.isNotEmpty(item.getApprovalStatus())) |
||||
item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); |
||||
}); |
||||
return list; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
package org.energy.modules.spares.service.impl; |
||||
|
||||
import io.micrometer.core.instrument.util.StringUtils; |
||||
import org.energy.modules.smart.excel.WorkOrderExcel; |
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import org.energy.modules.spares.excel.WarehouseExcel; |
||||
import org.energy.modules.spares.vo.WarehouseVO; |
||||
import org.energy.modules.spares.mapper.WarehouseMapper; |
||||
import org.energy.modules.spares.service.IWarehouseService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.energy.modules.system.service.IDictService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* spt_warehouse 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Service |
||||
public class WarehouseServiceImpl extends BaseServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService { |
||||
|
||||
@Autowired |
||||
IDictService dictService; |
||||
|
||||
@Override |
||||
public IPage<WarehouseVO> selectWarehousePage(IPage<WarehouseVO> page, WarehouseVO warehouse) { |
||||
return page.setRecords(baseMapper.selectWarehousePage(page, warehouse)); |
||||
} |
||||
|
||||
@Override |
||||
public List<WarehouseExcel> export(WarehouseVO warehouseVO) { |
||||
List<WarehouseExcel> list = baseMapper.exportData(warehouseVO); |
||||
list.forEach(item -> { |
||||
if (StringUtils.isNotEmpty(item.getApprovalStatus())) |
||||
item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); |
||||
}); |
||||
return list; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.spares.vo; |
||||
|
||||
import org.energy.modules.spares.entity.ManufacturerInfo; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* spt_manufacturer_info视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "ManufacturerInfoVO对象", description = "spt_manufacturer_info") |
||||
public class ManufacturerInfoVO extends ManufacturerInfo { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.spares.vo; |
||||
|
||||
import org.energy.modules.spares.entity.MaterialClassification; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* spt_material_classification视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "MaterialClassificationVO对象", description = "spt_material_classification") |
||||
public class MaterialClassificationVO extends MaterialClassification { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.spares.vo; |
||||
|
||||
import org.energy.modules.spares.entity.SupplierInfo; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* spt_supplier_info视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "SupplierInfoVO对象", description = "spt_supplier_info") |
||||
public class SupplierInfoVO extends SupplierInfo { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.spares.vo; |
||||
|
||||
import org.energy.modules.spares.entity.Warehouse; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* spt_warehouse视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-15 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "WarehouseVO对象", description = "spt_warehouse") |
||||
public class WarehouseVO extends Warehouse { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
Loading…
Reference in new issue