提交代码

master
胡锐 5 months ago
parent 83ddfe933f
commit a72c96ff56
  1. 2
      bweb/src/main/java/com/bweb/controller/BsDeviceController.java
  2. 29
      service/src/main/java/com/hfkj/dao/BsDeviceMapper.java
  3. 14
      service/src/main/java/com/hfkj/dao/BsDeviceSqlProvider.java
  4. 16
      service/src/main/java/com/hfkj/entity/BsDevice.java
  5. 60
      service/src/main/java/com/hfkj/entity/BsDeviceExample.java
  6. 66
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java
  7. 54
      service/src/main/java/com/hfkj/sysenum/DeviceReceiptOutContentEnum.java

@ -14,6 +14,7 @@ import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDeviceService;
import com.hfkj.service.merchant.BsMerchantService; import com.hfkj.service.merchant.BsMerchantService;
import com.hfkj.sysenum.DeviceReceiptOutContentEnum;
import com.hfkj.sysenum.DeviceTypeEnum; import com.hfkj.sysenum.DeviceTypeEnum;
import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -102,6 +103,7 @@ public class BsDeviceController {
device.setDeviceKey(body.getDeviceKey()); device.setDeviceKey(body.getDeviceKey());
device.setDeviceImei(body.getDeviceImei()); device.setDeviceImei(body.getDeviceImei());
device.setDeviceIccid(body.getDeviceIccid()); device.setDeviceIccid(body.getDeviceIccid());
device.setReceiptOutContent(body.getReceiptOutContent()==null?DeviceReceiptOutContentEnum.content2.getType():body.getReceiptOutContent());
device.setReceiptTop(body.getReceiptTop()); device.setReceiptTop(body.getReceiptTop());
device.setReceiptSource(body.getReceiptSource()); device.setReceiptSource(body.getReceiptSource());
device.setReceiptBottom(body.getReceiptBottom()); device.setReceiptBottom(body.getReceiptBottom());

@ -45,22 +45,22 @@ public interface BsDeviceMapper extends BsDeviceMapperExt {
"mer_no, mer_name, ", "mer_no, mer_name, ",
"device_name, device_sn, ", "device_name, device_sn, ",
"device_key, device_imei, ", "device_key, device_imei, ",
"device_iccid, receipt_top, ", "device_iccid, receipt_out_content, ",
"receipt_source, receipt_bottom, ", "receipt_top, receipt_source, ",
"`status`, create_time, ", "receipt_bottom, `status`, ",
"update_time, ext_1, ", "create_time, update_time, ",
"ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ", "values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ", "#{companyName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ",
"#{agentName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ", "#{agentName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", "#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
"#{deviceName,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, ", "#{deviceName,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, ",
"#{deviceKey,jdbcType=VARCHAR}, #{deviceImei,jdbcType=VARCHAR}, ", "#{deviceKey,jdbcType=VARCHAR}, #{deviceImei,jdbcType=VARCHAR}, ",
"#{deviceIccid,jdbcType=VARCHAR}, #{receiptTop,jdbcType=VARCHAR}, ", "#{deviceIccid,jdbcType=VARCHAR}, #{receiptOutContent,jdbcType=INTEGER}, ",
"#{receiptSource,jdbcType=VARCHAR}, #{receiptBottom,jdbcType=VARCHAR}, ", "#{receiptTop,jdbcType=VARCHAR}, #{receiptSource,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{receiptBottom,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDevice record); int insert(BsDevice record);
@ -85,6 +85,7 @@ public interface BsDeviceMapper extends BsDeviceMapperExt {
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR), @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_out_content", property="receiptOutContent", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
@ -100,9 +101,9 @@ public interface BsDeviceMapper extends BsDeviceMapperExt {
@Select({ @Select({
"select", "select",
"id, `type`, company_id, company_name, agent_id, agent_name, mer_id, mer_no, ", "id, `type`, company_id, company_name, agent_id, agent_name, mer_id, mer_no, ",
"mer_name, device_name, device_sn, device_key, device_imei, device_iccid, receipt_top, ", "mer_name, device_name, device_sn, device_key, device_imei, device_iccid, receipt_out_content, ",
"receipt_source, receipt_bottom, `status`, create_time, update_time, ext_1, ext_2, ", "receipt_top, receipt_source, receipt_bottom, `status`, create_time, update_time, ",
"ext_3", "ext_1, ext_2, ext_3",
"from bs_device", "from bs_device",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -121,6 +122,7 @@ public interface BsDeviceMapper extends BsDeviceMapperExt {
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR), @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_out_content", property="receiptOutContent", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR), @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
@ -157,6 +159,7 @@ public interface BsDeviceMapper extends BsDeviceMapperExt {
"device_key = #{deviceKey,jdbcType=VARCHAR},", "device_key = #{deviceKey,jdbcType=VARCHAR},",
"device_imei = #{deviceImei,jdbcType=VARCHAR},", "device_imei = #{deviceImei,jdbcType=VARCHAR},",
"device_iccid = #{deviceIccid,jdbcType=VARCHAR},", "device_iccid = #{deviceIccid,jdbcType=VARCHAR},",
"receipt_out_content = #{receiptOutContent,jdbcType=INTEGER},",
"receipt_top = #{receiptTop,jdbcType=VARCHAR},", "receipt_top = #{receiptTop,jdbcType=VARCHAR},",
"receipt_source = #{receiptSource,jdbcType=VARCHAR},", "receipt_source = #{receiptSource,jdbcType=VARCHAR},",
"receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},", "receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},",

@ -80,6 +80,10 @@ public class BsDeviceSqlProvider {
sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}"); sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}");
} }
if (record.getReceiptOutContent() != null) {
sql.VALUES("receipt_out_content", "#{receiptOutContent,jdbcType=INTEGER}");
}
if (record.getReceiptTop() != null) { if (record.getReceiptTop() != null) {
sql.VALUES("receipt_top", "#{receiptTop,jdbcType=VARCHAR}"); sql.VALUES("receipt_top", "#{receiptTop,jdbcType=VARCHAR}");
} }
@ -139,6 +143,7 @@ public class BsDeviceSqlProvider {
sql.SELECT("device_key"); sql.SELECT("device_key");
sql.SELECT("device_imei"); sql.SELECT("device_imei");
sql.SELECT("device_iccid"); sql.SELECT("device_iccid");
sql.SELECT("receipt_out_content");
sql.SELECT("receipt_top"); sql.SELECT("receipt_top");
sql.SELECT("receipt_source"); sql.SELECT("receipt_source");
sql.SELECT("receipt_bottom"); sql.SELECT("receipt_bottom");
@ -221,6 +226,10 @@ public class BsDeviceSqlProvider {
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}"); sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
} }
if (record.getReceiptOutContent() != null) {
sql.SET("receipt_out_content = #{record.receiptOutContent,jdbcType=INTEGER}");
}
if (record.getReceiptTop() != null) { if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}"); sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
} }
@ -279,6 +288,7 @@ public class BsDeviceSqlProvider {
sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}");
sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}"); sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}");
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}"); sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
sql.SET("receipt_out_content = #{record.receiptOutContent,jdbcType=INTEGER}");
sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}"); sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}"); sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}");
sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}"); sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}");
@ -350,6 +360,10 @@ public class BsDeviceSqlProvider {
sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}"); sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}");
} }
if (record.getReceiptOutContent() != null) {
sql.SET("receipt_out_content = #{receiptOutContent,jdbcType=INTEGER}");
}
if (record.getReceiptTop() != null) { if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{receiptTop,jdbcType=VARCHAR}"); sql.SET("receipt_top = #{receiptTop,jdbcType=VARCHAR}");
} }

@ -83,6 +83,11 @@ public class BsDevice implements Serializable {
*/ */
private String deviceIccid; private String deviceIccid;
/**
* 小票打印内容 1全部 2油站存根 3客户存根
*/
private Integer receiptOutContent;
/** /**
* 小票顶部显示 * 小票顶部显示
*/ */
@ -233,6 +238,14 @@ public class BsDevice implements Serializable {
this.deviceIccid = deviceIccid; this.deviceIccid = deviceIccid;
} }
public Integer getReceiptOutContent() {
return receiptOutContent;
}
public void setReceiptOutContent(Integer receiptOutContent) {
this.receiptOutContent = receiptOutContent;
}
public String getReceiptTop() { public String getReceiptTop() {
return receiptTop; return receiptTop;
} }
@ -331,6 +344,7 @@ public class BsDevice implements Serializable {
&& (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey())) && (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey()))
&& (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei())) && (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei()))
&& (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid())) && (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid()))
&& (this.getReceiptOutContent() == null ? other.getReceiptOutContent() == null : this.getReceiptOutContent().equals(other.getReceiptOutContent()))
&& (this.getReceiptTop() == null ? other.getReceiptTop() == null : this.getReceiptTop().equals(other.getReceiptTop())) && (this.getReceiptTop() == null ? other.getReceiptTop() == null : this.getReceiptTop().equals(other.getReceiptTop()))
&& (this.getReceiptSource() == null ? other.getReceiptSource() == null : this.getReceiptSource().equals(other.getReceiptSource())) && (this.getReceiptSource() == null ? other.getReceiptSource() == null : this.getReceiptSource().equals(other.getReceiptSource()))
&& (this.getReceiptBottom() == null ? other.getReceiptBottom() == null : this.getReceiptBottom().equals(other.getReceiptBottom())) && (this.getReceiptBottom() == null ? other.getReceiptBottom() == null : this.getReceiptBottom().equals(other.getReceiptBottom()))
@ -360,6 +374,7 @@ public class BsDevice implements Serializable {
result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode()); result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode());
result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode()); result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode());
result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().hashCode()); result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().hashCode());
result = prime * result + ((getReceiptOutContent() == null) ? 0 : getReceiptOutContent().hashCode());
result = prime * result + ((getReceiptTop() == null) ? 0 : getReceiptTop().hashCode()); result = prime * result + ((getReceiptTop() == null) ? 0 : getReceiptTop().hashCode());
result = prime * result + ((getReceiptSource() == null) ? 0 : getReceiptSource().hashCode()); result = prime * result + ((getReceiptSource() == null) ? 0 : getReceiptSource().hashCode());
result = prime * result + ((getReceiptBottom() == null) ? 0 : getReceiptBottom().hashCode()); result = prime * result + ((getReceiptBottom() == null) ? 0 : getReceiptBottom().hashCode());
@ -392,6 +407,7 @@ public class BsDevice implements Serializable {
sb.append(", deviceKey=").append(deviceKey); sb.append(", deviceKey=").append(deviceKey);
sb.append(", deviceImei=").append(deviceImei); sb.append(", deviceImei=").append(deviceImei);
sb.append(", deviceIccid=").append(deviceIccid); sb.append(", deviceIccid=").append(deviceIccid);
sb.append(", receiptOutContent=").append(receiptOutContent);
sb.append(", receiptTop=").append(receiptTop); sb.append(", receiptTop=").append(receiptTop);
sb.append(", receiptSource=").append(receiptSource); sb.append(", receiptSource=").append(receiptSource);
sb.append(", receiptBottom=").append(receiptBottom); sb.append(", receiptBottom=").append(receiptBottom);

@ -1055,6 +1055,66 @@ public class BsDeviceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andReceiptOutContentIsNull() {
addCriterion("receipt_out_content is null");
return (Criteria) this;
}
public Criteria andReceiptOutContentIsNotNull() {
addCriterion("receipt_out_content is not null");
return (Criteria) this;
}
public Criteria andReceiptOutContentEqualTo(Integer value) {
addCriterion("receipt_out_content =", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentNotEqualTo(Integer value) {
addCriterion("receipt_out_content <>", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentGreaterThan(Integer value) {
addCriterion("receipt_out_content >", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentGreaterThanOrEqualTo(Integer value) {
addCriterion("receipt_out_content >=", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentLessThan(Integer value) {
addCriterion("receipt_out_content <", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentLessThanOrEqualTo(Integer value) {
addCriterion("receipt_out_content <=", value, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentIn(List<Integer> values) {
addCriterion("receipt_out_content in", values, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentNotIn(List<Integer> values) {
addCriterion("receipt_out_content not in", values, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentBetween(Integer value1, Integer value2) {
addCriterion("receipt_out_content between", value1, value2, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptOutContentNotBetween(Integer value1, Integer value2) {
addCriterion("receipt_out_content not between", value1, value2, "receiptOutContent");
return (Criteria) this;
}
public Criteria andReceiptTopIsNull() { public Criteria andReceiptTopIsNull() {
addCriterion("receipt_top is null"); addCriterion("receipt_top is null");
return (Criteria) this; return (Criteria) this;

@ -8,6 +8,7 @@ import com.hfkj.entity.BsDevice;
import com.hfkj.entity.BsDeviceExample; import com.hfkj.entity.BsDeviceExample;
import com.hfkj.entity.BsGasOrder; import com.hfkj.entity.BsGasOrder;
import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDeviceService;
import com.hfkj.sysenum.DeviceReceiptOutContentEnum;
import com.hfkj.sysenum.DeviceTypeEnum; import com.hfkj.sysenum.DeviceTypeEnum;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -90,33 +91,44 @@ public class BsDeviceServiceImpl implements BsDeviceService {
new Thread(() -> { new Thread(() -> {
try { try {
SpPrinterConfig sp = new SpPrinterConfig(); SpPrinterConfig sp = new SpPrinterConfig();
sp.print(device.getDeviceSn(),
SpPrinterTemplate.oilCashierStubTemp( if (device.getReceiptOutContent().equals(DeviceReceiptOutContentEnum.content1.getType())
gasOrder.getMerName(), || device.getReceiptOutContent().equals(DeviceReceiptOutContentEnum.content2.getType())) {
gasOrder.getOrderNo(), // 加油站存根
DateUtil.date2String(gasOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), sp.print(device.getDeviceSn(),
gasOrder.getUserPhone(), SpPrinterTemplate.oilCashierStubTemp(
gasOrder.getGasGunNo(), gasOrder.getMerName(),
gasOrder.getGasOilNo(), gasOrder.getOrderNo(),
gasOrder.getGasOilLiters().toString(), DateUtil.date2String(gasOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
gasOrder.getGasRefuelPrice().toString(), gasOrder.getUserPhone(),
receiptMap, gasOrder.getGasGunNo(),
makeUp gasOrder.getGasOilNo(),
), 1); gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(),
sp.print(device.getDeviceSn(), receiptMap,
SpPrinterTemplate.oilClientStubTemp( makeUp
gasOrder.getMerName(), ), 1);
gasOrder.getOrderNo(), }
DateUtil.date2String(gasOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
gasOrder.getUserPhone(), if (device.getReceiptOutContent().equals(DeviceReceiptOutContentEnum.content1.getType())
gasOrder.getGasGunNo(), || device.getReceiptOutContent().equals(DeviceReceiptOutContentEnum.content3.getType())) {
gasOrder.getGasOilNo(), // 客户存根
gasOrder.getGasOilLiters().toString(), sp.print(device.getDeviceSn(),
gasOrder.getGasRefuelPrice().toString(), SpPrinterTemplate.oilClientStubTemp(
receiptMap, gasOrder.getMerName(),
makeUp gasOrder.getOrderNo(),
), 1); DateUtil.date2String(gasOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
gasOrder.getUserPhone(),
gasOrder.getGasGunNo(),
gasOrder.getGasOilNo(),
gasOrder.getGasOilLiters().toString(),
gasOrder.getGasRefuelPrice().toString(),
receiptMap,
makeUp
), 1);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

@ -0,0 +1,54 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* 设备类型
* @author hurui
*/
public enum DeviceReceiptOutContentEnum {
/**
* 全部
*/
content1(1 , "全部"),
/**
* 油站存根
*/
content2(2 , "油站存根"),
/**
* 客户存根
*/
content3(3 , "客户存根"),
;
private Integer type;
private String name;
DeviceReceiptOutContentEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static String getNameByType(Integer type) {
for (DeviceReceiptOutContentEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getName();
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Loading…
Cancel
Save