建模索引修改判断逻辑

This commit is contained in:
Mr-wang 2023-06-19 13:31:27 +08:00
parent 83424f1af9
commit df063e5589
3 changed files with 12 additions and 19 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -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){