diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java index e5efd0ed..18609966 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java @@ -1,11 +1,14 @@ package com.bonus.sgzb.base.api.domain; +import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * * @author Dingjie @@ -43,26 +46,31 @@ public class MaMachine extends BaseEntity { * 物品种类 */ @ApiModelProperty(value = "物品种类") + @Excel(name = "物品种类", sort = 1) private String itemType; /** * 设备类型 */ @ApiModelProperty(value = "设备类型") + @Excel(name = "设备类型", sort = 2) private String deviceType; /** * 规格型号 */ @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号", sort = 3) private String specificationType; /** * 机具编号 */ @ApiModelProperty(value = "机具编号") + @Excel(name = "设备编码", sort = 4) private String maCode; /** * 原编号 */ @ApiModelProperty(value = "原编号") + @Excel(name = "设备原编号", sort = 8) private String preCode; /** * 机具状态(数据字典) @@ -73,11 +81,13 @@ public class MaMachine extends BaseEntity { * 机具状态(数据字典) */ @ApiModelProperty(value = "机具状态(数据字典)名称") + @Excel(name = "设备状态", sort = 6) private String maStatusName; /** * 二维码 */ @ApiModelProperty(value = "二维码") + @Excel(name = "二维码", sort = 9) private String qrCode; /** * 购置价 @@ -103,6 +113,7 @@ public class MaMachine extends BaseEntity { * 固定资产编号 */ @ApiModelProperty(value = "固定资产编号") + @Excel(name = "固定资产编号", sort = 7) private String assetsCode; /** * 本次检验人 @@ -148,6 +159,7 @@ public class MaMachine extends BaseEntity { * 购置批次 */ @ApiModelProperty(value = "购置批次") + @Excel(name = "采购单号", sort = 5) private String buyTask; /** * 所在仓库 @@ -176,6 +188,7 @@ public class MaMachine extends BaseEntity { private String endTime; @ApiModelProperty(value = "仓库名称") + @Excel(name = "所在仓库", sort = 10) private String ownHouseName; @ApiModelProperty(value = "仓库id") private Long houseId; @@ -221,5 +234,8 @@ public class MaMachine extends BaseEntity { @ApiModelProperty(value = "1:二维码绑定标识 2:rfid绑定标识") private Integer flag; + /** 导出选中列表 */ + private List dataCondition; + } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineController.java index 782723c7..2c351410 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineController.java @@ -3,6 +3,7 @@ package com.bonus.sgzb.base.controller; import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.mapper.MaMachineMapper; import com.bonus.sgzb.base.service.MaMachineService; +import com.bonus.sgzb.common.core.utils.poi.ExcelUtil; import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.page.TableDataInfo; @@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -56,6 +58,20 @@ public class MaMachineController extends BaseController { return getDataTable(list); } + /** + * 导出查询机具设备管理 + * @param response + * @param maMachine + */ + @ApiOperation(value = "导出查询机具设备管理") + @PostMapping("/export") + public void export(HttpServletResponse response, MaMachine maMachine) + { + List list = maMachineService.getMaMachine(maMachine); + ExcelUtil util = new ExcelUtil<>(MaMachine.class); + util.exportExcel(response, list, "机具设备管理"); + } + /** * 新增机具设备管理 diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml index ae99c58b..528d3b75 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml @@ -75,6 +75,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND m.create_time between #{beginTime} and #{endTime} + + AND m.ma_id in + + #{maId} + + order by m.ma_id desc @@ -244,7 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ma_status = #{maStatus}, qr_code = #{qrCode}, buy_price = #{buyPrice}, - ma_vender = #{maVender}, + ma_vender = #{maVender}, out_fac_time =#{outFacTime}, out_fac_code = #{outFacCode}, assets_code =#{assetsCode}, diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index 67853ba6..1899b13b 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue @@ -372,12 +372,10 @@ - { this.form = response.data if (this.form.maVender) this.form.maVender = parseInt(this.form.maVender) + if (this.form.propId == 0) this.form.propId = '' this.open = true this.title = '编辑' }) @@ -779,9 +778,10 @@ export default { }, /** 导出按钮操作 */ handleExport() { - // this.download('system/dict/type/export', { - // ...this.queryParams - // }, `type_${new Date().getTime()}.xlsx`) + this.download('base/machine/export', { + ...this.queryParams, + dataCondition: this.ids + }, `编码设备管理_${new Date().getTime()}.xlsx`) }, }, }