diff --git a/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java b/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java index 32063b7..808c59a 100644 --- a/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java +++ b/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java @@ -271,6 +271,7 @@ public class EquipmentLedgerController extends DafController { if (StringUtils.isNotEmpty(coding)) { queryWrapper.lambda().like(EquipmentLedger::getKksEncoding, coding); } + queryWrapper.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED); queryWrapper.lambda().orderByDesc(EquipmentLedger::getKksEncoding); queryWrapper.lambda().last(" LIMIT 50"); List list = equipmentLedgerService.list(queryWrapper); diff --git a/src/main/java/org/energy/modules/release/controller/ProductionInformationController.java b/src/main/java/org/energy/modules/release/controller/ProductionInformationController.java new file mode 100644 index 0000000..5d7a340 --- /dev/null +++ b/src/main/java/org/energy/modules/release/controller/ProductionInformationController.java @@ -0,0 +1,215 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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.release.controller; + +import com.xkcoding.http.util.StringUtil; +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 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 org.energy.modules.smart.entity.OperationTicket; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.release.entity.ProductionInformation; +import org.energy.modules.release.vo.ProductionInformationVO; +import org.energy.modules.release.service.IProductionInformationService; +import com.dayu.daf.core.boot.ctrl.DafController; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; + +/** + * 生产信息发布 控制器 + * + * @author Daf + * @since 2024-07-15 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/release/productioninformation") +@Api(value = "生产信息发布", tags = "生产信息发布接口") +public class ProductionInformationController extends DafController { + + private IProductionInformationService productionInformationService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入productionInformation") + public R detail(ProductionInformation productionInformation) { + ProductionInformation detail = productionInformationService.getOne(Condition.getQueryWrapper(productionInformation)); + return R.data(detail); + } + + /** + * 分页 生产信息发布 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入productionInformation") + public R> list(ProductionInformation productionInformation, Query query) { + IPage pages = productionInformationService.page(Condition.getPage(query), Condition.getQueryWrapper(productionInformation)); + return R.data(pages); + } + + /** + * 自定义分页 生产信息发布 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入productionInformation") + public R> page(ProductionInformationVO productionInformation, Query query) { + IPage pages = productionInformationService.selectProductionInformationPage(Condition.getPage(query), productionInformation); + return R.data(pages); + } + + /** + * 新增 生产信息发布 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入productionInformation") + public R save(@Valid @RequestBody ProductionInformation productionInformation) { + return R.status(productionInformationService.save(productionInformation)); + } + + /** + * 修改 生产信息发布 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入productionInformation") + public R update(@Valid @RequestBody ProductionInformation productionInformation) { + return R.status(productionInformationService.updateById(productionInformation)); + } + + /** + * 新增或修改 生产信息发布 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入productionInformation") + public R submit(@Valid @RequestBody ProductionInformation productionInformation) { + LocalDate currentDate = LocalDate.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); + String formattedDate = currentDate.format(formatter); + //获取最大消息编码 + String maxMessageCd = productionInformationService.getMaxMessageCd("'"+formattedDate+"%'"); + int number; + if (StringUtil.isNotEmpty(maxMessageCd)){ + number = Integer.parseInt(maxMessageCd.substring(maxMessageCd.length()-4)); + number++; + }else{ + number = 1; + } + String numFormat = String.format("%04d", number); + productionInformation.setMessageEncoding(formattedDate+numFormat); + + return R.status(productionInformationService.saveOrUpdate(productionInformation)); + } + + + /** + * 删除 生产信息发布 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(productionInformationService.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 list = new ArrayList<>(); + for (String id : ids.split(",")) { + ProductionInformation productionInformation = new ProductionInformation(); + productionInformation.setId(Long.parseLong(id)); + productionInformation.setCheckstatus(status); + list.add(productionInformation); + } + return R.status(productionInformationService.updateBatchById(list)); + } + + /** + * 停用 生产信息发布 + */ + @PostMapping("/stop") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "更新", notes = "传入ids") + public R stop(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.changeRelease(2,ids); + } + + /** + * 发布 生产信息发布 + */ + @PostMapping("/release") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "更新", notes = "传入ids") + public R release(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) + { + return this.changeRelease(1,ids); + } + + /** + * 发布R停用 生产信息发布 + */ + public R changeRelease(Integer discontinue, String ids) { + List list = new ArrayList<>(); + for (String id : ids.split(",")) { + ProductionInformation productionInformation = new ProductionInformation(); + productionInformation.setId(Long.parseLong(id)); + productionInformation.setIsDiscontinue(discontinue); + list.add(productionInformation); + } + return R.status(productionInformationService.updateBatchById(list)); + } + +} diff --git a/src/main/java/org/energy/modules/release/dto/ProductionInformationDTO.java b/src/main/java/org/energy/modules/release/dto/ProductionInformationDTO.java new file mode 100644 index 0000000..29f7e31 --- /dev/null +++ b/src/main/java/org/energy/modules/release/dto/ProductionInformationDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.release.dto; + +import org.energy.modules.release.entity.ProductionInformation; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 生产信息发布数据传输对象实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProductionInformationDTO extends ProductionInformation { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/release/entity/ProductionInformation.java b/src/main/java/org/energy/modules/release/entity/ProductionInformation.java new file mode 100644 index 0000000..c491a73 --- /dev/null +++ b/src/main/java/org/energy/modules/release/entity/ProductionInformation.java @@ -0,0 +1,81 @@ +package org.energy.modules.release.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import java.io.Serializable; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 生产信息发布实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@TableName("rel_production_information") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProductionInformation对象", description = "生产信息发布") +public class ProductionInformation extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + private Long id; + /** + * 消息编码 + */ + @ApiModelProperty(value = "消息编码") + private String messageEncoding; + /** + * 消息主题 + */ + @ApiModelProperty(value = "消息主题") + private String messageTopic; + /** + * 消息类型 + */ + @ApiModelProperty(value = "消息类型") + private String messageType; + /** + * 消息内容 + */ + @ApiModelProperty(value = "消息内容") + private String messageContent; + /** + * 发布人 + */ + @ApiModelProperty(value = "发布人") + private String publisher; + /** + * 消息等级 + */ + @ApiModelProperty(value = "消息等级") + private String messageLevel; + /** + * 是否停用 + */ + @ApiModelProperty(value = "是否停用") + private Integer isDiscontinue; + /** + * 发布时间 + */ + @ApiModelProperty(value = "发布时间") + private String releaseTime; + /** + * 审核状态 + */ + @ApiModelProperty(value = "审核状态") + private Integer checkstatus; + + +} diff --git a/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.java b/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.java new file mode 100644 index 0000000..fb3d395 --- /dev/null +++ b/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.java @@ -0,0 +1,27 @@ +package org.energy.modules.release.mapper; + +import org.energy.modules.release.entity.ProductionInformation; +import org.energy.modules.release.vo.ProductionInformationVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 生产信息发布 Mapper 接口 + * + * @author Daf + * @since 2024-07-15 + */ +public interface ProductionInformationMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param productionInformation + * @return + */ + List selectProductionInformationPage(IPage page, ProductionInformationVO productionInformation); + + String getMaxMessageCd(String data); +} diff --git a/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.xml b/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.xml new file mode 100644 index 0000000..a3db19b --- /dev/null +++ b/src/main/java/org/energy/modules/release/mapper/ProductionInformationMapper.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/release/service/IProductionInformationService.java b/src/main/java/org/energy/modules/release/service/IProductionInformationService.java new file mode 100644 index 0000000..9963756 --- /dev/null +++ b/src/main/java/org/energy/modules/release/service/IProductionInformationService.java @@ -0,0 +1,26 @@ +package org.energy.modules.release.service; + +import org.energy.modules.release.entity.ProductionInformation; +import org.energy.modules.release.vo.ProductionInformationVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 生产信息发布 服务类 + * + * @author Daf + * @since 2024-07-15 + */ +public interface IProductionInformationService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param productionInformation + * @return + */ + IPage selectProductionInformationPage(IPage page, ProductionInformationVO productionInformation); + + String getMaxMessageCd(String data); +} diff --git a/src/main/java/org/energy/modules/release/service/impl/ProductionInformationServiceImpl.java b/src/main/java/org/energy/modules/release/service/impl/ProductionInformationServiceImpl.java new file mode 100644 index 0000000..6395763 --- /dev/null +++ b/src/main/java/org/energy/modules/release/service/impl/ProductionInformationServiceImpl.java @@ -0,0 +1,29 @@ +package org.energy.modules.release.service.impl; + +import org.energy.modules.release.entity.ProductionInformation; +import org.energy.modules.release.vo.ProductionInformationVO; +import org.energy.modules.release.mapper.ProductionInformationMapper; +import org.energy.modules.release.service.IProductionInformationService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 生产信息发布 服务实现类 + * + * @author Daf + * @since 2024-07-15 + */ +@Service +public class ProductionInformationServiceImpl extends BaseServiceImpl implements IProductionInformationService { + + @Override + public IPage selectProductionInformationPage(IPage page, ProductionInformationVO productionInformation) { + return page.setRecords(baseMapper.selectProductionInformationPage(page, productionInformation)); + } + @Override + public String getMaxMessageCd(String data){ + return baseMapper.getMaxMessageCd(data); + } + +} diff --git a/src/main/java/org/energy/modules/release/vo/ProductionInformationVO.java b/src/main/java/org/energy/modules/release/vo/ProductionInformationVO.java new file mode 100644 index 0000000..fc7acbc --- /dev/null +++ b/src/main/java/org/energy/modules/release/vo/ProductionInformationVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.release.vo; + +import org.energy.modules.release.entity.ProductionInformation; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 生产信息发布视图实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProductionInformationVO对象", description = "生产信息发布") +public class ProductionInformationVO extends ProductionInformation { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/smart/entity/WorkOrder.java b/src/main/java/org/energy/modules/smart/entity/WorkOrder.java index 0d532fb..a906147 100644 --- a/src/main/java/org/energy/modules/smart/entity/WorkOrder.java +++ b/src/main/java/org/energy/modules/smart/entity/WorkOrder.java @@ -48,6 +48,7 @@ public class WorkOrder extends BaseEntity { /** * 工单类型 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "工单类型") private Integer workOrderType; /** @@ -60,7 +61,7 @@ public class WorkOrder extends BaseEntity { */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty(value = "负责人") - private Long responsibleUserId; + private Long managerUserId; /** * 责任班组 */ @@ -74,11 +75,13 @@ public class WorkOrder extends BaseEntity { /** * 维护作业类型 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "维护作业类型") private Integer maintenanceTaskType; /** * 用户状态 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "用户状态") private Integer userStatus; /** @@ -114,6 +117,7 @@ public class WorkOrder extends BaseEntity { /** * 处理结果 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "处理结果") private Integer handlingResult; /** diff --git a/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java b/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java index 2564ebf..a9d8bc9 100644 --- a/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java +++ b/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java @@ -60,7 +60,7 @@ public class WorkOrderExcel implements Serializable { @ColumnWidth(20) @ExcelProperty(value = "负责人") - private String responsibleUserName; + private String managerUserName; @ColumnWidth(20) @ExcelProperty(value = "责任班组") diff --git a/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml b/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml index f5fd997..ca5bdf9 100644 --- a/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml +++ b/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml @@ -16,7 +16,7 @@ - + @@ -33,20 +33,20 @@ - + diff --git a/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java b/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java index 25ae0c9..adfce8c 100644 --- a/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java +++ b/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java @@ -23,7 +23,7 @@ public class WorkOrderVO extends WorkOrder { private Integer station; - private String responsibleUserName; + private String managerUserName; } diff --git a/src/main/java/org/energy/modules/spares/controller/InboundController.java b/src/main/java/org/energy/modules/spares/controller/InboundController.java index 2911f00..a6b0f55 100644 --- a/src/main/java/org/energy/modules/spares/controller/InboundController.java +++ b/src/main/java/org/energy/modules/spares/controller/InboundController.java @@ -15,6 +15,7 @@ */ package org.energy.modules.spares.controller; +import com.xkcoding.http.util.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -26,6 +27,7 @@ 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.Data; import org.energy.modules.leger.entity.TechParameters; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestParam; @@ -35,6 +37,8 @@ import org.energy.modules.spares.vo.InboundVO; import org.energy.modules.spares.service.IInboundService; import com.dayu.daf.core.boot.ctrl.DafController; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; /** @@ -111,6 +115,22 @@ public class InboundController extends DafController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入inbound") public R submit(@Valid @RequestBody Inbound inbound) { + String maxNo = inboundService.getMaxNo("'%" + inbound.getMaterialNo() + "%'"); + int number; + if (StringUtil.isNotEmpty(maxNo)){ + number = Integer.parseInt(maxNo.substring(10)); + number++; + }else{ + number = 1; + } + String numFormat = String.format("%06d", number); + String no = inbound.getMaterialNo() + "IN" + numFormat; + inbound.setInboundNo(no); + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + String time = sdf.format(date); + inbound.setInboundTime(time); + inbound.setIstatus(1L); return R.status(inboundService.saveOrUpdate(inbound)); } diff --git a/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java b/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java new file mode 100644 index 0000000..0a0ba02 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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 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> list(ManufacturerInfo manufacturerInfo, Query query) { + QueryWrapper 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 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> page(ManufacturerInfoVO manufacturerInfo, Query query) { + IPage 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 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 entity, HttpServletResponse response) { + entity.remove("daf-auth"); + ManufacturerInfoVO vo = DataUtils.mapToEntity(entity, ManufacturerInfoVO::new); + List 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); + } + +} diff --git a/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java new file mode 100644 index 0000000..a9a3efb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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 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> list(MaterialClassification materialClassification, Query query) { + QueryWrapper 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 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> page(MaterialClassificationVO materialClassification, Query query) { + IPage 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 entity, HttpServletResponse response) { + entity.remove("daf-auth"); + MaterialClassificationVO vo = DataUtils.mapToEntity(entity, MaterialClassificationVO::new); + List 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); + } + + +} diff --git a/src/main/java/org/energy/modules/spares/controller/MaterialController.java b/src/main/java/org/energy/modules/spares/controller/MaterialController.java index f4f58e2..39340d5 100644 --- a/src/main/java/org/energy/modules/spares/controller/MaterialController.java +++ b/src/main/java/org/energy/modules/spares/controller/MaterialController.java @@ -15,17 +15,29 @@ */ 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 com.xkcoding.http.util.StringUtil; 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.inspection.entity.InspectionRoute; +import org.energy.modules.inspection.excel.InspectionRouteExcel; +import org.energy.modules.spares.excel.MaterialExcel; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestParam; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -33,6 +45,11 @@ import org.energy.modules.spares.entity.Material; import org.energy.modules.spares.vo.MaterialVO; import org.energy.modules.spares.service.IMaterialService; 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; /** * 物资 控制器 @@ -66,7 +83,34 @@ public class MaterialController extends DafController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入material") public R> list(Material material, Query query) { - IPage pages = materialService.page(Condition.getPage(query), Condition.getQueryWrapper(material)); + QueryWrapper qw = new QueryWrapper<>(); + qw.orderByAsc("material_no"); + // 物资编号 + if (StringUtil.isNotEmpty(material.getMaterialNo())) { + qw.lambda().like(Material::getMaterialNo, material.getMaterialNo()); + } + + // 物资名称 + if (StringUtil.isNotEmpty(material.getMaterialName())) { + qw.lambda().like(Material::getMaterialName, material.getMaterialName()); + } + + // 规格型号 + if (StringUtil.isNotEmpty(material.getModel())) { + qw.lambda().like(Material::getModel, material.getModel()); + } + + // 场站 + if (null != material.getStation()) { + qw.lambda().eq(Material::getStation, material.getStation()); + } + + // 库存数量 + if (null != material.getInventoryCount()) { + qw.lambda().eq(Material::getInventoryCount, material.getInventoryCount()); + } + + IPage pages = materialService.page(Condition.getPage(query), qw); return R.data(pages); } @@ -108,6 +152,18 @@ public class MaterialController extends DafController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入material") public R submit(@Valid @RequestBody Material material) { + material.setIstatus(2L); + String maxNo = materialService.getMaxNo(); + int number; + if (StringUtil.isNotEmpty(maxNo)){ + number = Integer.parseInt(maxNo.substring(2)); + number++; + }else{ + number = 1; + } + String numFormat = String.format("%06d", number); + String no = "WZ" + numFormat; + material.setMaterialNo(no); return R.status(materialService.saveOrUpdate(material)); } @@ -122,5 +178,51 @@ public class MaterialController extends DafController { return R.status(materialService.deleteLogic(Func.toLongList(ids))); } + /** + * 获取物资编号 + */ + @GetMapping("/getNoList") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "获取物资编号", notes = "获取物资编号") + public R> getNoList() { + List noList = materialService.getNoList(); + return R.data(noList); + } + + /** + * 获取物资信息 + */ + @GetMapping("/getDetailList") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "获取物资信息", notes = "获取物资信息") + public R getDetailList(String materialNo) { + Material DetailList = materialService.getDetailList("'" + materialNo + "'"); + return R.data(DetailList); + } + + /** + * 导出 + */ + @SneakyThrows + @GetMapping("export") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导出", notes = "传入") + @ApiLog + public void exportMaterial(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { + if (entity.containsKey("station_equal")) { + entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); + } + + QueryWrapper queryWrapper = Condition.getQueryWrapper(entity, Material.class); + queryWrapper.lambda().eq(Material::getIsDeleted, DafConstant.DB_NOT_DELETED); + queryWrapper.orderByAsc("material_no"); + + List list = materialService.exportData(queryWrapper); + 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(), MaterialExcel.class).sheet("物资").doWrite(list); + } } diff --git a/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java b/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java new file mode 100644 index 0000000..f57bf4b --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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 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> list(SupplierInfo supplierInfo, Query query) { + QueryWrapper 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 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> page(SupplierInfoVO supplierInfo, Query query) { + IPage 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 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 entity, HttpServletResponse response) { + entity.remove("daf-auth"); + SupplierInfoVO vo = DataUtils.mapToEntity(entity, SupplierInfoVO::new); + List 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); + } + + +} diff --git a/src/main/java/org/energy/modules/spares/controller/WarehouseController.java b/src/main/java/org/energy/modules/spares/controller/WarehouseController.java new file mode 100644 index 0000000..415798a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/WarehouseController.java @@ -0,0 +1,211 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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 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> list(Warehouse warehouse, Query query) { + QueryWrapper 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 pages = warehouseService.page(Condition.getPage(query), qw); + return R.data(pages); + } + + /** + * 自定义分页 spt_warehouse + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入warehouse") + public R> page(WarehouseVO warehouse, Query query) { + IPage 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 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 entity, HttpServletResponse response) { + entity.remove("daf-auth"); + WarehouseVO vo = DataUtils.mapToEntity(entity, WarehouseVO::new); + List 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); + } + +} diff --git a/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java b/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java new file mode 100644 index 0000000..96df777 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java b/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java new file mode 100644 index 0000000..c6ea37c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java b/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java new file mode 100644 index 0000000..eeca2b0 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java b/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java new file mode 100644 index 0000000..0445acb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java b/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java new file mode 100644 index 0000000..5c2f52c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java @@ -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; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java new file mode 100644 index 0000000..fa670e1 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java @@ -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; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java b/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java new file mode 100644 index 0000000..753abff --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java @@ -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; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/Warehouse.java b/src/main/java/org/energy/modules/spares/entity/Warehouse.java new file mode 100644 index 0000000..171ab2c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/Warehouse.java @@ -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; + + +} diff --git a/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java b/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java new file mode 100644 index 0000000..51ee610 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java b/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java new file mode 100644 index 0000000..c0c71c7 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/MaterialExcel.java b/src/main/java/org/energy/modules/spares/excel/MaterialExcel.java new file mode 100644 index 0000000..0b02677 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/MaterialExcel.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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; + +/** + * EquipmentLedge model export + * @author edwong + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(16) +public class MaterialExcel implements Serializable { + private static final long serialVersionUID = 1L; + + @ColumnWidth(20) + @ExcelProperty(value = "物资编号") + private String materialNo; + + @ColumnWidth(15) + @ExcelProperty(value = "场站") + private String stationExt; + + @ColumnWidth(15) + @ExcelProperty(value = "物资名称") + private String materialName; + + @ColumnWidth(15) + @ExcelProperty(value = "规格型号") + private String model; + + @ColumnWidth(15) + @ExcelProperty(value = "库存数量") + private Long inventoryCount; + + @ColumnWidth(20) + @ExcelProperty(value = "物资描述") + private String materialDescription; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java b/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java new file mode 100644 index 0000000..4c00fa6 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java b/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java new file mode 100644 index 0000000..9084c2a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * 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 + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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; + + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/InboundMapper.java b/src/main/java/org/energy/modules/spares/mapper/InboundMapper.java index 582f04a..5825fd0 100644 --- a/src/main/java/org/energy/modules/spares/mapper/InboundMapper.java +++ b/src/main/java/org/energy/modules/spares/mapper/InboundMapper.java @@ -23,4 +23,9 @@ public interface InboundMapper extends BaseMapper { */ List selectInboundPage(IPage page, InboundVO inbound); + /** + * 获取最大编号 + */ + String getMaxNo(String materialNo); + } diff --git a/src/main/java/org/energy/modules/spares/mapper/InboundMapper.xml b/src/main/java/org/energy/modules/spares/mapper/InboundMapper.xml index 1dde980..618bfa3 100644 --- a/src/main/java/org/energy/modules/spares/mapper/InboundMapper.xml +++ b/src/main/java/org/energy/modules/spares/mapper/InboundMapper.xml @@ -25,4 +25,8 @@ select * from s_inbound where is_deleted = 0 + + diff --git a/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java new file mode 100644 index 0000000..f1f1784 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param manufacturerInfo + * @return + */ + List selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo); + + List exportData(@Param("vo") ManufacturerInfoVO manufacturerInfo); +} diff --git a/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml new file mode 100644 index 0000000..b9a40e0 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java new file mode 100644 index 0000000..0c5040e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param materialClassification + * @return + */ + List selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification); + + List exportData(@Param("vo") MaterialClassificationVO materialClassification); +} diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml new file mode 100644 index 0000000..c6e99d9 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.java b/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.java index 888e632..2b87eda 100644 --- a/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.java +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.java @@ -1,6 +1,13 @@ package org.energy.modules.spares.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import org.apache.ibatis.annotations.Param; +import org.energy.modules.inspection.entity.InspectionRoute; +import org.energy.modules.inspection.entity.InspectionTasks; +import org.energy.modules.inspection.excel.InspectionRouteExcel; +import org.energy.modules.inspection.excel.InspectionTasksExcel; import org.energy.modules.spares.entity.Material; +import org.energy.modules.spares.excel.MaterialExcel; import org.energy.modules.spares.vo.MaterialVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -23,4 +30,24 @@ public interface MaterialMapper extends BaseMapper { */ List selectMaterialPage(IPage page, MaterialVO material); + /** + * 导出 + */ + List exportData(@Param("ew") Wrapper queryWrapper); + + /** + * 获取物资编号 + */ + List getNoList(); + + /** + * 获取最大编号 + */ + String getMaxNo(); + + /** + * 获取物资的信息 + */ + Material getDetailList(String materialNo); + } diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.xml b/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.xml index 81fc633..f9c713b 100644 --- a/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.xml +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialMapper.xml @@ -29,4 +29,39 @@ select * from s_material where is_deleted = 0 + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java new file mode 100644 index 0000000..aa94acb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param supplierInfo + * @return + */ + List selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo); + + List exportData(@Param("vo") SupplierInfoVO supplierInfo); + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml new file mode 100644 index 0000000..514bf1e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java new file mode 100644 index 0000000..0d2d4de --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param warehouse + * @return + */ + List selectWarehousePage(IPage page, WarehouseVO warehouse); + + List exportData(@Param("vo") WarehouseVO warehouseVO); + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml new file mode 100644 index 0000000..3330ed9 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/service/IInboundService.java b/src/main/java/org/energy/modules/spares/service/IInboundService.java index 1a6a4d8..cf5c3f7 100644 --- a/src/main/java/org/energy/modules/spares/service/IInboundService.java +++ b/src/main/java/org/energy/modules/spares/service/IInboundService.java @@ -22,4 +22,9 @@ public interface IInboundService extends BaseService { */ IPage selectInboundPage(IPage page, InboundVO inbound); + /** + * 获取最大编号 + */ + String getMaxNo(String materialNo); + } diff --git a/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java b/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java new file mode 100644 index 0000000..8fa394d --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param manufacturerInfo + * @return + */ + IPage selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo); + + List export(ManufacturerInfoVO manufacturerInfoVO); +} diff --git a/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java b/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java new file mode 100644 index 0000000..1008333 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param materialClassification + * @return + */ + IPage selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification); + + List export(MaterialClassificationVO materialClassificationVO); + +} diff --git a/src/main/java/org/energy/modules/spares/service/IMaterialService.java b/src/main/java/org/energy/modules/spares/service/IMaterialService.java index 710b073..0cdc23f 100644 --- a/src/main/java/org/energy/modules/spares/service/IMaterialService.java +++ b/src/main/java/org/energy/modules/spares/service/IMaterialService.java @@ -1,10 +1,15 @@ package org.energy.modules.spares.service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import org.apache.ibatis.annotations.Param; import org.energy.modules.spares.entity.Material; +import org.energy.modules.spares.excel.MaterialExcel; import org.energy.modules.spares.vo.MaterialVO; import com.dayu.daf.core.mp.base.BaseService; import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + /** * 物资 服务类 * @@ -22,4 +27,24 @@ public interface IMaterialService extends BaseService { */ IPage selectMaterialPage(IPage page, MaterialVO material); + /** + * 导出 + */ + List exportData(Wrapper queryWrapper); + + /** + * 获取物资编号 + */ + List getNoList(); + + /** + * 获取最大编号 + */ + String getMaxNo(); + + /** + * 获取物资的信息 + */ + Material getDetailList(String materialNo); + } diff --git a/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java b/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java new file mode 100644 index 0000000..8c44d09 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param supplierInfo + * @return + */ + IPage selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo); + + List export(SupplierInfoVO supplierInfo); +} diff --git a/src/main/java/org/energy/modules/spares/service/IWarehouseService.java b/src/main/java/org/energy/modules/spares/service/IWarehouseService.java new file mode 100644 index 0000000..fec7262 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IWarehouseService.java @@ -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 { + + /** + * 自定义分页 + * + * @param page + * @param warehouse + * @return + */ + IPage selectWarehousePage(IPage page, WarehouseVO warehouse); + + List export(WarehouseVO warehouseVO); + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/InboundServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/InboundServiceImpl.java index 5ac96b0..af3975c 100644 --- a/src/main/java/org/energy/modules/spares/service/impl/InboundServiceImpl.java +++ b/src/main/java/org/energy/modules/spares/service/impl/InboundServiceImpl.java @@ -22,4 +22,10 @@ public class InboundServiceImpl extends BaseServiceImpl return page.setRecords(baseMapper.selectInboundPage(page, inbound)); } + @Override + public String getMaxNo(String materialNo){ + String maxNo = baseMapper.getMaxNo(materialNo); + return maxNo; + } + } diff --git a/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java new file mode 100644 index 0000000..51c9053 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java @@ -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 implements IManufacturerInfoService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo) { + return page.setRecords(baseMapper.selectManufacturerInfoPage(page, manufacturerInfo)); + } + + @Override + public List export(ManufacturerInfoVO manufacturerInfoVO) { + List list = baseMapper.exportData(manufacturerInfoVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java new file mode 100644 index 0000000..241416f --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java @@ -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 implements IMaterialClassificationService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification) { + return page.setRecords(baseMapper.selectMaterialClassificationPage(page, materialClassification)); + } + + @Override + public List export(MaterialClassificationVO materialClassificationVO) { + List list = baseMapper.exportData(materialClassificationVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/MaterialServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/MaterialServiceImpl.java index d806eec..aa7b4d5 100644 --- a/src/main/java/org/energy/modules/spares/service/impl/MaterialServiceImpl.java +++ b/src/main/java/org/energy/modules/spares/service/impl/MaterialServiceImpl.java @@ -1,6 +1,10 @@ package org.energy.modules.spares.service.impl; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import org.energy.modules.inspection.entity.InspectionRoute; +import org.energy.modules.inspection.excel.InspectionRouteExcel; import org.energy.modules.spares.entity.Material; +import org.energy.modules.spares.excel.MaterialExcel; import org.energy.modules.spares.vo.MaterialVO; import org.energy.modules.spares.mapper.MaterialMapper; import org.energy.modules.spares.service.IMaterialService; @@ -8,6 +12,8 @@ import com.dayu.daf.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + /** * 物资 服务实现类 * @@ -22,4 +28,28 @@ public class MaterialServiceImpl extends BaseServiceImpl exportData(Wrapper queryWrapper) { + List list = baseMapper.exportData(queryWrapper); + return list; + } + + @Override + public List getNoList() { + List list = baseMapper.getNoList(); + return list; + } + + @Override + public String getMaxNo(){ + String maxNo = baseMapper.getMaxNo(); + return maxNo; + } + + @Override + public Material getDetailList(String materialNo) { + Material DetailList = baseMapper.getDetailList(materialNo); + return DetailList; + } + } diff --git a/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java new file mode 100644 index 0000000..0cb74ae --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java @@ -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 implements ISupplierInfoService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo) { + return page.setRecords(baseMapper.selectSupplierInfoPage(page, supplierInfo)); + } + + @Override + public List export(SupplierInfoVO supplierInfo) { + List list = baseMapper.exportData(supplierInfo); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java new file mode 100644 index 0000000..486ed4e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java @@ -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 implements IWarehouseService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectWarehousePage(IPage page, WarehouseVO warehouse) { + return page.setRecords(baseMapper.selectWarehousePage(page, warehouse)); + } + + @Override + public List export(WarehouseVO warehouseVO) { + List list = baseMapper.exportData(warehouseVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java b/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java new file mode 100644 index 0000000..573e29d --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java b/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java new file mode 100644 index 0000000..82d9dcd --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/MaterialVO.java b/src/main/java/org/energy/modules/spares/vo/MaterialVO.java index 169afa8..48339dd 100644 --- a/src/main/java/org/energy/modules/spares/vo/MaterialVO.java +++ b/src/main/java/org/energy/modules/spares/vo/MaterialVO.java @@ -17,4 +17,15 @@ import io.swagger.annotations.ApiModel; public class MaterialVO extends Material { private static final long serialVersionUID = 1L; + // 物资名称 + private static final String materialName = ""; + + // 规格模型 + private static final String model = ""; + + // 仓库名 + private static final String warehouseName = ""; + + + } diff --git a/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java b/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java new file mode 100644 index 0000000..26005b2 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java @@ -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; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java b/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java new file mode 100644 index 0000000..a66909a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java @@ -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; + +} diff --git a/src/main/java/sql/productioninformation.menu.sql b/src/main/java/sql/productioninformation.menu.sql new file mode 100644 index 0000000..9b85441 --- /dev/null +++ b/src/main/java/sql/productioninformation.menu.sql @@ -0,0 +1,30 @@ +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069121', 1123598815738675201, 'productioninformation', '', 'menu', '/release/productioninformation', NULL, 1, 1, 0, 1, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069122', '1812723339080069121', 'productioninformation_add', '新增', 'add', '/release/productioninformation/add', 'plus', 1, 2, 1, 1, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069123', '1812723339080069121', 'productioninformation_edit', '修改', 'edit', '/release/productioninformation/edit', 'form', 2, 2, 2, 1, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069124', '1812723339080069121', 'productioninformation_delete', '删除', 'delete', '/api/release/productioninformation/remove', 'delete', 3, 2, 3, 1, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069125', '1812723339080069121', 'productioninformation_view', '查看', 'view', '/release/productioninformation/view', 'file-text', 4, 2, 2, 1, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069126', '1812723339080069121', 'productioninformation_col_id', '主键', 'prop', '', '', 5, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069127', '1812723339080069121', 'productioninformation_col_messageEncoding', '消息编码', 'prop', '', '', 6, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069128', '1812723339080069121', 'productioninformation_col_messageTopic', '消息主题', 'prop', '', '', 7, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069129', '1812723339080069121', 'productioninformation_col_messageType', '消息类型', 'prop', '', '', 8, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069130', '1812723339080069121', 'productioninformation_col_messageContent', '消息内容', 'prop', '', '', 9, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069131', '1812723339080069121', 'productioninformation_col_publisher', '发布人', 'prop', '', '', 10, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069132', '1812723339080069121', 'productioninformation_col_messageLevel', '消息等级', 'prop', '', '', 11, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069133', '1812723339080069121', 'productioninformation_col_isDiscontinue', '是否停用', 'prop', '', '', 12, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069134', '1812723339080069121', 'productioninformation_col_releaseTime', '发布时间', 'prop', '', '', 13, 3, 0, 0, NULL, 0); +INSERT INTO `sys_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES ('1812723339080069135', '1812723339080069121', 'productioninformation_col_checkstatus', '审核状态', 'prop', '', '', 14, 3, 0, 0, NULL, 0);