diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyEntity.java new file mode 100644 index 000000000..98737bf1e --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyEntity.java @@ -0,0 +1,90 @@ +/* + * 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 lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 资产 实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@TableName("logpm_basic_property") +@ApiModel(value = "BasicProperty对象", description = "资产") +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyEntity 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; + /** + * 资产类型;1-生产类,2-办公类. + */ + @ApiModelProperty(value = "资产类型;1-生产类,2-办公类.") + private String assetType; + /** + * 资产名称 + */ + @ApiModelProperty(value = "资产名称") + private String assetName; + /** + * 资产统一编号 + */ + @ApiModelProperty(value = "资产统一编号") + private String assetId; + /** + * 资产现有数量 + */ + @ApiModelProperty(value = "资产现有数量") + private Integer assetNub; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String node; + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyfieldEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyfieldEntity.java new file mode 100644 index 000000000..5f218a058 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicPropertyfieldEntity.java @@ -0,0 +1,105 @@ +/* + * 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 lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 资产字段表 实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@TableName("logpm_basic_propertyfield") +@ApiModel(value = "BasicPropertyfield对象", description = "资产字段表") +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyfieldEntity 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; + /** + * 资产表id + */ + @ApiModelProperty(value = "资产表id") + private Long masterId; + /** + * 属性名 + */ + @ApiModelProperty(value = "属性名") + private String property; + /** + * 属性类型;1-字符串,2-整数,3-小数,4-时间 + */ + @ApiModelProperty(value = "属性类型;1-字符串,2-整数,3-小数,4-时间") + private String propertyType; + /** + * 填写类型;1-文本输入,2-下拉选择,3-单选 + */ + @ApiModelProperty(value = "填写类型;1-文本输入,2-下拉选择,3-单选") + private String inputType; + /** + * 字段名称 + */ + @ApiModelProperty(value = "字段名称") + private String fieldName; + /** + * 字段权重 + */ + @ApiModelProperty(value = "字段权重") + private Integer sort; + /** + * 字典code + */ + @ApiModelProperty(value = "字典code") + private String dictionaryCode; + /** + * 是否搜索 + */ + @ApiModelProperty(value = "是否搜索") + private String isSearch; + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyClient.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyClient.java new file mode 100644 index 000000000..bbd47ef16 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyClient.java @@ -0,0 +1,50 @@ +/* + * 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.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.basic.entity.BasicPropertyEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 资产 Feign接口类 + * + * @author lmy + * @since 2023-06-06 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_BASIC_NAME +) +public interface IBasicPropertyClient { + + String API_PREFIX = "property/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取资产列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage<BasicPropertyEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyfieldClient.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyfieldClient.java new file mode 100644 index 000000000..be25f5a7a --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicPropertyfieldClient.java @@ -0,0 +1,50 @@ +/* + * 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.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.basic.entity.BasicPropertyfieldEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 资产字段表 Feign接口类 + * + * @author lmy + * @since 2023-06-06 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_BASIC_NAME +) +public interface IBasicPropertyfieldClient { + + String API_PREFIX = "propertyfield/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取资产字段表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage<BasicPropertyfieldEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyVO.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyVO.java new file mode 100644 index 000000000..8b4a8d622 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyVO.java @@ -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.BasicPropertyEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资产 视图实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyVO extends BasicPropertyEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyfieldVO.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyfieldVO.java new file mode 100644 index 000000000..7688bd069 --- /dev/null +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/BasicPropertyfieldVO.java @@ -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.BasicPropertyfieldEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资产字段表 视图实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyfieldVO extends BasicPropertyfieldEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java new file mode 100644 index 000000000..ffd10ebb6 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyController.java @@ -0,0 +1,151 @@ +/* + * 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 com.logpm.basic.dto.BasicPropertyDTO; +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.BasicPropertyEntity; +import com.logpm.basic.vo.BasicPropertyVO; +import com.logpm.basic.excel.BasicPropertyExcel; +import com.logpm.basic.service.IBasicPropertyService; +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 lmy + * @since 2023-06-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/property") +@Api(value = "资产", tags = "资产接口") +public class BasicPropertyController extends BladeController { + + private final IBasicPropertyService basicPropertyService; + + /** + * 资产 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入basicProperty") + public R<BasicPropertyEntity> detail(BasicPropertyEntity basicProperty) { + BasicPropertyEntity detail = basicPropertyService.getOne(Condition.getQueryWrapper(basicProperty)); + return R.data(detail); + } + /** + * 资产 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入basicProperty") + public R<IPage<BasicPropertyEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicProperty, Query query) { + IPage<BasicPropertyEntity> pages = basicPropertyService.page(Condition.getPage(query), Condition.getQueryWrapper(basicProperty, BasicPropertyEntity.class)); + return R.data(pages); + } + + /** + * 资产 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入basicProperty") + public R<IPage<BasicPropertyVO>> page(BasicPropertyVO basicProperty, Query query) { + IPage<BasicPropertyVO> pages = basicPropertyService.selectBasicPropertyPage(Condition.getPage(query), basicProperty); + return R.data(pages); + } + + /** + * 资产 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入basicProperty") + public R save(@Valid @RequestBody BasicPropertyDTO basicProperty) { + return R.status(basicPropertyService.save(basicProperty)); + } + + /** + * 资产 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入basicProperty") + public R update(@Valid @RequestBody BasicPropertyEntity basicProperty) { + return R.status(basicPropertyService.updateById(basicProperty)); + } + + /** + * 资产 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入basicProperty") + public R submit(@Valid @RequestBody BasicPropertyEntity basicProperty) { + return R.status(basicPropertyService.saveOrUpdate(basicProperty)); + } + + /** + * 资产 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(basicPropertyService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-basicProperty") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicProperty") + public void exportBasicProperty(@ApiIgnore @RequestParam Map<String, Object> basicProperty, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper<BasicPropertyEntity> queryWrapper = Condition.getQueryWrapper(basicProperty, BasicPropertyEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(BasicProperty::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(BasicPropertyEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List<BasicPropertyExcel> list = basicPropertyService.exportBasicProperty(queryWrapper); + ExcelUtil.export(response, "资产数据" + DateUtil.time(), "资产数据表", list, BasicPropertyExcel.class); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyfieldController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyfieldController.java new file mode 100644 index 000000000..95d6d2c89 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicPropertyfieldController.java @@ -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.BasicPropertyfieldEntity; +import com.logpm.basic.vo.BasicPropertyfieldVO; +import com.logpm.basic.excel.BasicPropertyfieldExcel; +import com.logpm.basic.service.IBasicPropertyfieldService; +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 lmy + * @since 2023-06-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("basicPropertyfield/basicPropertyfield") +@Api(value = "资产字段表", tags = "资产字段表接口") +public class BasicPropertyfieldController extends BladeController { + + private final IBasicPropertyfieldService basicPropertyfieldService; + + /** + * 资产字段表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入basicPropertyfield") + public R<BasicPropertyfieldEntity> detail(BasicPropertyfieldEntity basicPropertyfield) { + BasicPropertyfieldEntity detail = basicPropertyfieldService.getOne(Condition.getQueryWrapper(basicPropertyfield)); + return R.data(detail); + } + /** + * 资产字段表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入basicPropertyfield") + public R<IPage<BasicPropertyfieldEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicPropertyfield, Query query) { + IPage<BasicPropertyfieldEntity> pages = basicPropertyfieldService.page(Condition.getPage(query), Condition.getQueryWrapper(basicPropertyfield, BasicPropertyfieldEntity.class)); + return R.data(pages); + } + + /** + * 资产字段表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入basicPropertyfield") + public R<IPage<BasicPropertyfieldVO>> page(BasicPropertyfieldVO basicPropertyfield, Query query) { + IPage<BasicPropertyfieldVO> pages = basicPropertyfieldService.selectBasicPropertyfieldPage(Condition.getPage(query), basicPropertyfield); + return R.data(pages); + } + + /** + * 资产字段表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入basicPropertyfield") + public R save(@Valid @RequestBody BasicPropertyfieldEntity basicPropertyfield) { + return R.status(basicPropertyfieldService.save(basicPropertyfield)); + } + + /** + * 资产字段表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入basicPropertyfield") + public R update(@Valid @RequestBody BasicPropertyfieldEntity basicPropertyfield) { + return R.status(basicPropertyfieldService.updateById(basicPropertyfield)); + } + + /** + * 资产字段表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入basicPropertyfield") + public R submit(@Valid @RequestBody BasicPropertyfieldEntity basicPropertyfield) { + return R.status(basicPropertyfieldService.saveOrUpdate(basicPropertyfield)); + } + + /** + * 资产字段表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(basicPropertyfieldService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-basicPropertyfield") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入basicPropertyfield") + public void exportBasicPropertyfield(@ApiIgnore @RequestParam Map<String, Object> basicPropertyfield, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper<BasicPropertyfieldEntity> queryWrapper = Condition.getQueryWrapper(basicPropertyfield, BasicPropertyfieldEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(BasicPropertyfield::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(BasicPropertyfieldEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List<BasicPropertyfieldExcel> list = basicPropertyfieldService.exportBasicPropertyfield(queryWrapper); + ExcelUtil.export(response, "资产字段表数据" + DateUtil.time(), "资产字段表数据表", list, BasicPropertyfieldExcel.class); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyDTO.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyDTO.java new file mode 100644 index 000000000..8638b0d61 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyDTO.java @@ -0,0 +1,45 @@ +/* + * 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.BasicPropertyEntity; +import com.logpm.basic.entity.BasicPropertyfieldEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 资产 数据传输对象实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyDTO extends BasicPropertyEntity { + private static final long serialVersionUID = 1L; + + /** + * 字段表 + */ + @ApiModelProperty(value = "字段表") + private List<BasicPropertyfieldDTO> field; + + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyfieldDTO.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyfieldDTO.java new file mode 100644 index 000000000..76e361879 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/dto/BasicPropertyfieldDTO.java @@ -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.BasicPropertyfieldEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资产字段表 数据传输对象实体类 + * + * @author lmy + * @since 2023-06-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BasicPropertyfieldDTO extends BasicPropertyfieldEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyExcel.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyExcel.java new file mode 100644 index 000000000..cf957e25b --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyExcel.java @@ -0,0 +1,117 @@ +/* + * 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 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 lmy + * @since 2023-06-06 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicPropertyExcel 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; + /** + * 资产类型;1-生产类,2-办公类. + */ + @ColumnWidth(20) + @ExcelProperty("资产类型;1-生产类,2-办公类.") + private String assetType; + /** + * 资产名称 + */ + @ColumnWidth(20) + @ExcelProperty("资产名称") + private String assetName; + /** + * 资产统一编号 + */ + @ColumnWidth(20) + @ExcelProperty("资产统一编号") + private String assetId; + /** + * 资产现有数量 + */ + @ColumnWidth(20) + @ExcelProperty("资产现有数量") + private Integer assetNub; + /** + * 备注 + */ + @ColumnWidth(20) + @ExcelProperty("备注") + private String node; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyfieldExcel.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyfieldExcel.java new file mode 100644 index 000000000..b7d111e83 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/excel/BasicPropertyfieldExcel.java @@ -0,0 +1,135 @@ +/* + * 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 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 lmy + * @since 2023-06-06 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicPropertyfieldExcel 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; + /** + * 资产表id + */ + @ColumnWidth(20) + @ExcelProperty("资产表id") + private Long masterId; + /** + * 属性名 + */ + @ColumnWidth(20) + @ExcelProperty("属性名") + private String property; + /** + * 属性类型;1-字符串,2-整数,3-小数,4-时间 + */ + @ColumnWidth(20) + @ExcelProperty("属性类型;1-字符串,2-整数,3-小数,4-时间") + private String propertyType; + /** + * 填写类型;1-文本输入,2-下拉选择,3-单选 + */ + @ColumnWidth(20) + @ExcelProperty("填写类型;1-文本输入,2-下拉选择,3-单选") + private String inputType; + /** + * 字段名称 + */ + @ColumnWidth(20) + @ExcelProperty("字段名称") + private String fieldName; + /** + * 字段权重 + */ + @ColumnWidth(20) + @ExcelProperty("字段权重") + private Integer sort; + /** + * 字典code + */ + @ColumnWidth(20) + @ExcelProperty("字典code") + private String dictionaryCode; + /** + * 是否搜索 + */ + @ColumnWidth(20) + @ExcelProperty("是否搜索") + private String isSearch; + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyClient.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyClient.java new file mode 100644 index 000000000..c0253eca3 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyClient.java @@ -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.BasicPropertyEntity; +import com.logpm.basic.service.IBasicPropertyService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 资产 Feign实现类 + * + * @author lmy + * @since 2023-06-06 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class BasicPropertyClient implements IBasicPropertyClient { + + private final IBasicPropertyService basicPropertyService; + + @Override + @GetMapping(TOP) + public BladePage<BasicPropertyEntity> top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage<BasicPropertyEntity> page = basicPropertyService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyfieldClient.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyfieldClient.java new file mode 100644 index 000000000..2fbb6e280 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicPropertyfieldClient.java @@ -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.BasicPropertyfieldEntity; +import com.logpm.basic.service.IBasicPropertyfieldService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 资产字段表 Feign实现类 + * + * @author lmy + * @since 2023-06-06 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class BasicPropertyfieldClient implements IBasicPropertyfieldClient { + + private final IBasicPropertyfieldService basicPropertyfieldService; + + @Override + @GetMapping(TOP) + public BladePage<BasicPropertyfieldEntity> top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage<BasicPropertyfieldEntity> page = basicPropertyfieldService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/ISystemClient.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/ISystemClient.java index ab7e4ff66..e0cdc9bb7 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/ISystemClient.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/ISystemClient.java @@ -1,18 +1,18 @@ -package com.logpm.basic.feign; - -import com.logpm.basic.entity.BasicTeamStaffEntity; -import org.springblade.common.constant.LauncherConstant; -import org.springblade.core.mp.support.BladePage; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@FeignClient( - value = LauncherConstant.APPLICATION_SYSTEM_NAME+"-zhy" -) -public interface ISystemClient { - - @GetMapping("/user/selectUserByRoleId") - BladePage<BasicTeamStaffEntity> selectUserByRoleId(@RequestParam("roleId") String roleId); - -} +//package com.logpm.basic.feign; +// +//import com.logpm.basic.entity.BasicTeamStaffEntity; +//import org.springblade.common.constant.LauncherConstant; +//import org.springblade.core.mp.support.BladePage; +//import org.springframework.cloud.openfeign.FeignClient; +//import org.springframework.web.bind.annotation.GetMapping; +//import org.springframework.web.bind.annotation.RequestParam; +// +//@FeignClient( +// value = LauncherConstant.APPLICATION_SYSTEM_NAME+"-zhy" +//) +//public interface ISystemClient { +// +// @GetMapping("/user/selectUserByRoleId") +// BladePage<BasicTeamStaffEntity> selectUserByRoleId(@RequestParam("roleId") String roleId); +// +//} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.java new file mode 100644 index 000000000..363f80c6d --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.java @@ -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.BasicPropertyEntity; +import com.logpm.basic.vo.BasicPropertyVO; +import com.logpm.basic.excel.BasicPropertyExcel; +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 lmy + * @since 2023-06-06 + */ +public interface BasicPropertyMapper extends BaseMapper<BasicPropertyEntity> { + + /** + * 自定义分页 + * + * @param page + * @param basicProperty + * @return + */ + List<BasicPropertyVO> selectBasicPropertyPage(IPage page, BasicPropertyVO basicProperty); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List<BasicPropertyExcel> exportBasicProperty(@Param("ew") Wrapper<BasicPropertyEntity> queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.xml b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.xml new file mode 100644 index 000000000..ed55b7dfc --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyMapper.xml @@ -0,0 +1,38 @@ +<?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.BasicPropertyMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="basicPropertyResultMap" type="com.logpm.basic.entity.BasicPropertyEntity"> + <result column="id" property="id"/> + <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="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="asset_type" property="assetType"/> + <result column="asset_name" property="assetName"/> + <result column="asset_id" property="assetId"/> + <result column="asset_nub" property="assetNub"/> + <result column="node" property="node"/> + </resultMap> + + + <select id="selectBasicPropertyPage" resultMap="basicPropertyResultMap"> + select * from logpm_basic_property where is_deleted = 0 + </select> + + + <select id="exportBasicProperty" resultType="com.logpm.basic.excel.BasicPropertyExcel"> + SELECT * FROM logpm_basic_property ${ew.customSqlSegment} + </select> + +</mapper> diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.java new file mode 100644 index 000000000..2f88aa3d0 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.java @@ -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.BasicPropertyfieldEntity; +import com.logpm.basic.vo.BasicPropertyfieldVO; +import com.logpm.basic.excel.BasicPropertyfieldExcel; +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 lmy + * @since 2023-06-06 + */ +public interface BasicPropertyfieldMapper extends BaseMapper<BasicPropertyfieldEntity> { + + /** + * 自定义分页 + * + * @param page + * @param basicPropertyfield + * @return + */ + List<BasicPropertyfieldVO> selectBasicPropertyfieldPage(IPage page, BasicPropertyfieldVO basicPropertyfield); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List<BasicPropertyfieldExcel> exportBasicPropertyfield(@Param("ew") Wrapper<BasicPropertyfieldEntity> queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.xml b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.xml new file mode 100644 index 000000000..73d54c4be --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicPropertyfieldMapper.xml @@ -0,0 +1,41 @@ +<?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.BasicPropertyfieldMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="basicPropertyfieldResultMap" type="com.logpm.basic.entity.BasicPropertyfieldEntity"> + <result column="id" property="id"/> + <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="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="master_id" property="masterId"/> + <result column="property" property="property"/> + <result column="property_type" property="propertyType"/> + <result column="input_type" property="inputType"/> + <result column="field_name" property="fieldName"/> + <result column="sort" property="sort"/> + <result column="dictionary_code" property="dictionaryCode"/> + <result column="is_search" property="isSearch"/> + </resultMap> + + + <select id="selectBasicPropertyfieldPage" resultMap="basicPropertyfieldResultMap"> + select * from logpm_basic_propertyfield where is_deleted = 0 + </select> + + + <select id="exportBasicPropertyfield" resultType="com.logpm.basic.excel.BasicPropertyfieldExcel"> + SELECT * FROM logpm_basic_propertyfield ${ew.customSqlSegment} + </select> + +</mapper> diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyService.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyService.java new file mode 100644 index 000000000..7efe94084 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyService.java @@ -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.BasicPropertyEntity; +import com.logpm.basic.vo.BasicPropertyVO; +import com.logpm.basic.excel.BasicPropertyExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 资产 服务类 + * + * @author lmy + * @since 2023-06-06 + */ +public interface IBasicPropertyService extends BaseService<BasicPropertyEntity> { + /** + * 自定义分页 + * + * @param page + * @param basicProperty + * @return + */ + IPage<BasicPropertyVO> selectBasicPropertyPage(IPage<BasicPropertyVO> page, BasicPropertyVO basicProperty); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List<BasicPropertyExcel> exportBasicProperty(Wrapper<BasicPropertyEntity> queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyfieldService.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyfieldService.java new file mode 100644 index 000000000..923b3d40d --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicPropertyfieldService.java @@ -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.BasicPropertyfieldEntity; +import com.logpm.basic.vo.BasicPropertyfieldVO; +import com.logpm.basic.excel.BasicPropertyfieldExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 资产字段表 服务类 + * + * @author lmy + * @since 2023-06-06 + */ +public interface IBasicPropertyfieldService extends BaseService<BasicPropertyfieldEntity> { + /** + * 自定义分页 + * + * @param page + * @param basicPropertyfield + * @return + */ + IPage<BasicPropertyfieldVO> selectBasicPropertyfieldPage(IPage<BasicPropertyfieldVO> page, BasicPropertyfieldVO basicPropertyfield); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List<BasicPropertyfieldExcel> exportBasicPropertyfield(Wrapper<BasicPropertyfieldEntity> queryWrapper); + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyServiceImpl.java new file mode 100644 index 000000000..88255acfe --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyServiceImpl.java @@ -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.BasicPropertyEntity; +import com.logpm.basic.vo.BasicPropertyVO; +import com.logpm.basic.excel.BasicPropertyExcel; +import com.logpm.basic.mapper.BasicPropertyMapper; +import com.logpm.basic.service.IBasicPropertyService; +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 lmy + * @since 2023-06-06 + */ +@Service +public class BasicPropertyServiceImpl extends BaseServiceImpl<BasicPropertyMapper, BasicPropertyEntity> implements IBasicPropertyService { + + @Override + public IPage<BasicPropertyVO> selectBasicPropertyPage(IPage<BasicPropertyVO> page, BasicPropertyVO basicProperty) { + return page.setRecords(baseMapper.selectBasicPropertyPage(page, basicProperty)); + } + + + @Override + public List<BasicPropertyExcel> exportBasicProperty(Wrapper<BasicPropertyEntity> queryWrapper) { + List<BasicPropertyExcel> basicPropertyList = baseMapper.exportBasicProperty(queryWrapper); + //basicPropertyList.forEach(basicProperty -> { + // basicProperty.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicProperty.getType())); + //}); + return basicPropertyList; + } + +} diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyfieldServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyfieldServiceImpl.java new file mode 100644 index 000000000..79db32d93 --- /dev/null +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPropertyfieldServiceImpl.java @@ -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.BasicPropertyfieldEntity; +import com.logpm.basic.vo.BasicPropertyfieldVO; +import com.logpm.basic.excel.BasicPropertyfieldExcel; +import com.logpm.basic.mapper.BasicPropertyfieldMapper; +import com.logpm.basic.service.IBasicPropertyfieldService; +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 lmy + * @since 2023-06-06 + */ +@Service +public class BasicPropertyfieldServiceImpl extends BaseServiceImpl<BasicPropertyfieldMapper, BasicPropertyfieldEntity> implements IBasicPropertyfieldService { + + @Override + public IPage<BasicPropertyfieldVO> selectBasicPropertyfieldPage(IPage<BasicPropertyfieldVO> page, BasicPropertyfieldVO basicPropertyfield) { + return page.setRecords(baseMapper.selectBasicPropertyfieldPage(page, basicPropertyfield)); + } + + + @Override + public List<BasicPropertyfieldExcel> exportBasicPropertyfield(Wrapper<BasicPropertyfieldEntity> queryWrapper) { + List<BasicPropertyfieldExcel> basicPropertyfieldList = baseMapper.exportBasicPropertyfield(queryWrapper); + //basicPropertyfieldList.forEach(basicPropertyfield -> { + // basicPropertyfield.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicPropertyfield.getType())); + //}); + return basicPropertyfieldList; + } + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java index a47935697..f9076d221 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java @@ -34,7 +34,6 @@ import com.logpm.basicdata.service.IBasicdataGoodsShelfService; import com.logpm.basicdata.vo.BasicdataGoodsShelfVO; import lombok.AllArgsConstructor; import org.springblade.common.utils.QRCodeUtil; -import org.springblade.common.utils.RedisUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.BladeUser; @@ -73,7 +72,6 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo private IBasicTenantCodeClient basicTenantCodeClient; - private RedisUtil redisUtil; @Override public IPage<BasicdataGoodsShelfVO> selectBasicdataGoodsShelfPage(IPage<BasicdataGoodsShelfVO> page, BasicdataGoodsShelfVO basicdataGoodsShelfVO) {