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