建模索引修改判断逻辑
This commit is contained in:
parent
83424f1af9
commit
df063e5589
@ -3579,9 +3579,9 @@ public class CoEPALController {
|
|||||||
* @return {@link String}
|
* @return {@link String}
|
||||||
*/
|
*/
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_guide_check_create")
|
@Mapping("com.actionsoft.apps.coe.pal_guide_check_create")
|
||||||
public String checkUserFirstCreateModel(UserContext me , String methodId ) {
|
public String checkUserFirstCreateModel(UserContext me , String methodId,String type) {
|
||||||
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
|
DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me);
|
||||||
return web.checkUserFirstCreateModel(methodId);
|
return web.checkUserFirstCreateModel(methodId,type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4104,29 +4104,21 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
|||||||
* @param methodId 模型类型
|
* @param methodId 模型类型
|
||||||
* @return {@link String}
|
* @return {@link String}
|
||||||
*/
|
*/
|
||||||
public String checkUserFirstCreateModel(String methodId) {
|
public String checkUserFirstCreateModel(String methodId,String type) {
|
||||||
ResponseObject ro = ResponseObject.newOkResponse();
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
String sql = "SELECT COUNT(1) FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER=? AND PLMETHODID=?";
|
String sql = "SELECT COUNT(1) FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER=? AND PLMETHODID=?";
|
||||||
String uid = _uc.getUID();
|
String uid = _uc.getUID();
|
||||||
int anInt = DBSql.getInt(sql, new Object[]{uid, methodId});
|
int anInt = DBSql.getInt(sql, new Object[]{uid, methodId});
|
||||||
|
System.out.println("是否第一次新建模型>>>>>"+anInt);
|
||||||
//只有一条记录的时候判断是否第一次创建对应模型
|
//只有一条记录的时候判断是否第一次创建对应模型
|
||||||
if (anInt == 1) {
|
if (type.equals("0")) {
|
||||||
String getCreateDateSql = "SELECT CREATEDATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER='" + uid + "' AND PLMETHODID='" + methodId + "'";
|
if (anInt > 1) {
|
||||||
long currentTimeMillis = System.currentTimeMillis();
|
|
||||||
Timestamp createDateTimestamp = DBSql.getTimestamp(getCreateDateSql, "CREATEDATE");
|
|
||||||
long createTimeMillis = createDateTimestamp.getTime();
|
|
||||||
long diff = (currentTimeMillis - createTimeMillis) / 1000 / 60;
|
|
||||||
//相隔时间小于等于1说明是第一次创建这个类型的模型
|
|
||||||
if (diff <= 1) {
|
|
||||||
ro.put("isFirst", true);
|
|
||||||
} else {
|
|
||||||
ro.put("isFirst", false);
|
ro.put("isFirst", false);
|
||||||
|
} else {
|
||||||
|
ro.put("isFirst", true);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
} else if (anInt > 1) {
|
|
||||||
ro.put("isFirst", false);
|
ro.put("isFirst", false);
|
||||||
} else {
|
|
||||||
ro.put("isFirst", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ro.toString();
|
return ro.toString();
|
||||||
|
|||||||
@ -519,8 +519,9 @@
|
|||||||
|
|
||||||
//检查用户是否第一次创建对应类型的模型
|
//检查用户是否第一次创建对应类型的模型
|
||||||
function checkUserFirstCreateModel(){
|
function checkUserFirstCreateModel(){
|
||||||
$.ajax({
|
var data_type = window.performance.navigation.type;
|
||||||
url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal_guide_check_create&methodId=" + methodId,
|
$.ajax({
|
||||||
|
url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal_guide_check_create&methodId=" + methodId+"&type="+data_type,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if(data.data.isFirst){
|
if(data.data.isFirst){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user