Commit 05e04203 authored by renchao's avatar renchao

生产工序业务修改

parent 9147cefa
...@@ -316,19 +316,21 @@ public class ProjectEnum { ...@@ -316,19 +316,21 @@ public class ProjectEnum {
*/ */
public enum TSysDict { public enum TSysDict {
ID(0, "ID","ID"), ID(0, "ID",0,"ID"),
SIX(6, "6","id为6的数据"); TAG_DATE(1, "6",6,"id为6的数据");
// 成员变量 // 成员变量
private int value; private int value;
private String label; private String label;
private int id;
private String explain; private String explain;
// 构造方法 // 构造方法
TSysDict(int value, String label, String explain) { TSysDict(int value, String label, int id,String explain) {
this.value = value; this.value = value;
this.label = label; this.label = label;
this.id = id;
this.explain = explain; this.explain = explain;
} }
...@@ -341,7 +343,7 @@ public class ProjectEnum { ...@@ -341,7 +343,7 @@ public class ProjectEnum {
return c.label; return c.label;
} }
} }
return TSysDict.SIX.label; return TSysDict.ID.label;
} }
/** /**
...@@ -353,13 +355,30 @@ public class ProjectEnum { ...@@ -353,13 +355,30 @@ public class ProjectEnum {
return c.value; return c.value;
} }
} }
return TSysDict.SIX.value; return TSysDict.ID.value;
}
/**
* 根据label,获取value
*/
public static int getId(String label) {
for (TSysDict c : TSysDict.values()) {
if (StringUtils.equalsIgnoreCase(label, c.label)) {
return c.id;
}
}
return TSysDict.ID.id;
} }
public int getValue() { public int getValue() {
return value; return value;
} }
public int getId() {
return id;
}
public String getLabel() { public String getLabel() {
return label; return label;
} }
......
...@@ -98,7 +98,7 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -98,7 +98,7 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
//例如查询出来name字段是26:上月26日到当前日期的实测孔深相加 //例如查询出来name字段是26:上月26日到当前日期的实测孔深相加
//查询字典id为6的name字段 //查询字典id为6的name字段
TSysDictQuery tSysDictQuery = new TSysDictQuery(); TSysDictQuery tSysDictQuery = new TSysDictQuery();
tSysDictQuery.setId(ProjectEnum.TSysDict.SIX.getValue()); tSysDictQuery.setId(ProjectEnum.TSysDict.TAG_DATE.getId());
R<String> name = itSysDictService.getNameByQuery(tSysDictQuery); R<String> name = itSysDictService.getNameByQuery(tSysDictQuery);
if (name.getCode() != 0) { if (name.getCode() != 0) {
log.error("穿孔工序中->获取字典SysDict的id为6数据的name字段失败"); log.error("穿孔工序中->获取字典SysDict的id为6数据的name字段失败");
......
...@@ -41,7 +41,7 @@ public class TSysDictServiceImpl extends ServiceImpl<TSysDictMapper, TSysDict> i ...@@ -41,7 +41,7 @@ public class TSysDictServiceImpl extends ServiceImpl<TSysDictMapper, TSysDict> i
//获取标注日期,将字典中id为6的数据的name字段做比较 //获取标注日期,将字典中id为6的数据的name字段做比较
//大于name字段记录下一个月,小于该字段记录本月 //大于name字段记录下一个月,小于该字段记录本月
//获取id为6的字典 //获取id为6的字典
TSysDict tSysDict = baseMapper.selectById(ProjectEnum.TSysDict.SIX.getValue()); TSysDict tSysDict = baseMapper.selectById(ProjectEnum.TSysDict.TAG_DATE.getId());
if (tSysDict == null || StringUtils.isBlank(tSysDict.getName())) { if (tSysDict == null || StringUtils.isBlank(tSysDict.getName())) {
return R.failed("数据字典中->不存在id为6的数据"); return R.failed("数据字典中->不存在id为6的数据");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment