diff --git a/skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml b/skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml index f6d60dacac0562622686625a0ce8904c848f7f50..697e5024c16cd69361c28e2e79b86e6a413a74c9 100644 --- a/skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml @@ -9,7 +9,8 @@ a.group_num groupNum, a.group_desc groupDesc, CONVERT(a.create_time, char) createTime, - (SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum + (SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum, + (SELECT COUNT(*) FROM (SELECT COUNT(*), c.group_id FROM code_model_history c GROUP BY c.file_path) d WHERE d.group_id = a.id) useNum FROM code_model_group a WHERE 1 = 1 diff --git a/skyeye-web/src/main/resources/dbmapper/CodeModelMapper.xml b/skyeye-web/src/main/resources/dbmapper/CodeModelMapper.xml index 29ef4d879a419788a7bda6eb69529f673dc2bc67..9361fe65a7d20f9589f16887d88498214d537fbb 100644 --- a/skyeye-web/src/main/resources/dbmapper/CodeModelMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/CodeModelMapper.xml @@ -9,7 +9,8 @@ a.model_content modelContent, a.model_text modelText, a.model_type modelType, - CONVERT(a.create_time, char) createTime + CONVERT(a.create_time, char) createTime, + (SELECT COUNT(*) FROM code_model_history b WHERE b.model_id = a.id) useNum FROM code_model a WHERE a.group_id = #{groupId} diff --git a/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js b/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js index 91d46965dc6cc44cc13deb0f5ed9888b7b22cea6..c3b3f0fcc20ec45d351206db9668b19ac3142f54 100644 --- a/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js +++ b/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js @@ -30,6 +30,7 @@ layui.config({ { field: 'id', title: '模板内容', width: 120, templet: function(d){ return ''; }}, + { field: 'useNum', title: '调用次数', width: 120 }, { field: 'createTime', title: '创建时间', width: 180 }, { title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'} ]] diff --git a/skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js b/skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js index 77b224cf29ed610213288c651eb68191aa6c4016..33cd7c58b681a39748b7f9e250d2ba9f572edd64 100644 --- a/skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js +++ b/skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js @@ -29,6 +29,7 @@ layui.config({ return ''; }}, { field: 'modelNum', title: '模板数量', width: 120 }, + { field: 'useNum', title: '调用次数', width: 120 }, { field: 'createTime', title: '创建时间', width: 180 }, { title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'} ]] diff --git a/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js b/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js index b85c7d8c65fa4bc73f125794f6065920657e01aa..2fb25e5088b3c5d3d042cc1101cb18a65750adf6 100644 --- a/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js +++ b/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js @@ -34,18 +34,22 @@ layui.config({ //表单验证 if (winui.verifyForm(data.elem)) { var subData = list; - for(var i = 0; i < subData.length; i++){ - subData[i].modelContent = ""; + if(subData.length == 0){ + top.winui.window.msg('请先生成转换结果', {icon: 2,time: 2000}); + }else{ + for(var i = 0; i < subData.length; i++){ + subData[i].modelContent = ""; + } + AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg('保存成功,请前往生成历史下载。', {icon: 1,time: 2000}); + parent.layer.close(index); + parent.refreshCode = '0'; + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); } - AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){ - if(json.returnCode == 0){ - top.winui.window.msg('保存成功,请前往生成历史下载。', {icon: 1,time: 2000}); - parent.layer.close(index); - parent.refreshCode = '0'; - }else{ - top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); - } - }}); } return false; }); diff --git a/skyeye-web/src/main/webapp/tpl/codemodel/codemodellist.html b/skyeye-web/src/main/webapp/tpl/codemodel/codemodellist.html index d1c59aafd58cff1e2c4948ccc58ec8013f77c31d..7999504a1ef297f7bce272b1ca3f7250c6bee691 100644 --- a/skyeye-web/src/main/webapp/tpl/codemodel/codemodellist.html +++ b/skyeye-web/src/main/webapp/tpl/codemodel/codemodellist.html @@ -24,7 +24,9 @@