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