diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxEnergyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxEnergyController.java index e2198c05b..049833d1a 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxEnergyController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxEnergyController.java @@ -26,6 +26,7 @@ import com.iformall.enums.EnumFeesStandardsCalcuteUnit; import com.iformall.enums.EnumFeesStandardsTimeUnit; import com.iformall.enums.EnumFinanceCashierType; import com.iformall.enums.EnumYesOrNo; +import com.iformall.enums.EnumeElectriType; import com.iformall.exception.MallinkException; import com.iformall.service.WxEnergyService; import com.iformall.service.WxMallFloorService; @@ -82,6 +83,16 @@ public class WxEnergyController extends BaseController { return new ResultData(retMap); } + @ApiOperation("电表类型") + @GetMapping("electriTypes") + public ResultData electriTypes() { + Map retMap = new HashMap(); + for (EnumeElectriType mem : EnumeElectriType.values()) { + retMap.put(mem.getCode(), mem.getMessage()); + } + return new ResultData(retMap); + } + @ApiOperation("表分组") @GetMapping("meterPhysicsTypeTypeList") public ResultData meterPhysicsTypeTypeList() { diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxEnergyMeter.java b/mallinkService/src/main/java/com/iformall/domain/po/WxEnergyMeter.java index b4828aaa3..da391354d 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxEnergyMeter.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxEnergyMeter.java @@ -6,6 +6,7 @@ import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumEnergyMeterPhysicsType; import com.iformall.enums.EnumEnergyMeterType; import com.iformall.enums.EnumRentShopType; +import com.iformall.enums.EnumeElectriType; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; @@ -89,8 +90,31 @@ public class WxEnergyMeter extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "是否参与计费", name = "hasFee") private Integer hasFee; + @Excel(name = "三相/单相", replace = {"三相_1", "单相_2"}, width = 20, orderNum = "8") + @io.swagger.annotations.ApiModelProperty(value = "三相/单相EnumeElectriType", name = "electriType") + private Integer electriType; + @TableField(exist = false) + private String electriTypeName; + public String getElectriType() { + if (null != electriType) { + return EnumeElectriType.getEnum(electriType).getMessage(); + } + return null; + } + + @Excel(name = "变电器名称", width = 20, orderNum = "9") + @io.swagger.annotations.ApiModelProperty(value="变电器名称",name="transName") + private String transName; + + @Excel(name = "比值", width = 20, orderNum = "10") + @io.swagger.annotations.ApiModelProperty(value="比值",name="ratio") + private String ratio; + + @Excel(name = "位置", width = 20, orderNum = "11") + @io.swagger.annotations.ApiModelProperty(value="位置",name="address") + private String address; - @Excel(name = "关联", width = 20, orderNum = "8") + @Excel(name = "关联", width = 20, orderNum = "12") @TableField(exist = false) private String aliseName; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumeElectriType.java b/mallinkService/src/main/java/com/iformall/enums/EnumeElectriType.java new file mode 100644 index 000000000..a2770683b --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumeElectriType.java @@ -0,0 +1,37 @@ +package com.iformall.enums; + + +/** + * @author gongbiao + */ + +public enum EnumeElectriType { + + SAN_XIANG(1, "三相"), + DAN_XIANG(2, "单相"); + + public static EnumeElectriType getEnum(Integer code) { + for (EnumeElectriType value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumeElectriType(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/resources/mapper/WxEnergyMeterMapper.xml b/mallinkService/src/main/resources/mapper/WxEnergyMeterMapper.xml index 1c0a1b15f..666d5e83f 100644 --- a/mallinkService/src/main/resources/mapper/WxEnergyMeterMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxEnergyMeterMapper.xml @@ -14,10 +14,15 @@ + + + + - `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`,`type`,`rate`,`physics_type`,`shop_type`,`has_fee` + `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`,`type`,`rate`,`physics_type`,`shop_type`, + `has_fee`,`electri_type`,`trans_name`,`ratio`,`address` @@ -36,6 +41,7 @@ and name like concat('%', #{name},'%') and `physics_type` in (1,2) and `has_fee` = #{hasFee} + and `electri_type` = #{electriType} and id not in