diff --git a/src/main/java/com/cm/inspection/pojo/dtos/industryuser/IndustryUserDTO.java b/src/main/java/com/cm/inspection/pojo/dtos/industryuser/IndustryUserDTO.java index 1f1a705..493316f 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/industryuser/IndustryUserDTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/industryuser/IndustryUserDTO.java @@ -29,6 +29,8 @@ public class IndustryUserDTO { private String userName; @ApiModelProperty(name = "gmtCreate", value = "关联时间") private String gmtCreate; + @ApiModelProperty(name = "gmtModified", value = "修改时间") + private String gmtModified; public String getIndustryUserId() { return industryUserId == null ? "" : industryUserId.trim(); @@ -78,21 +80,31 @@ public class IndustryUserDTO { this.gmtCreate = gmtCreate; } + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + @Override public String toString() { final StringBuilder sb = new StringBuilder("{"); - sb.append("\"industryUserId\":") - .append("\"").append(industryUserId).append("\""); - sb.append(",\"industryId\":") - .append("\"").append(industryId).append("\""); - sb.append(",\"industryIdDictionaryName\":") - .append("\"").append(industryIdDictionaryName).append("\""); - sb.append(",\"userId\":") - .append("\"").append(userId).append("\""); - sb.append(",\"userName\":") - .append("\"").append(userName).append("\""); - sb.append(",\"gmtCreate\":") - .append("\"").append(gmtCreate).append("\""); + sb.append("\"industryUserId\":\"") + .append(industryUserId).append('\"'); + sb.append(",\"industryId\":\"") + .append(industryId).append('\"'); + sb.append(",\"industryIdDictionaryName\":\"") + .append(industryIdDictionaryName).append('\"'); + sb.append(",\"userId\":\"") + .append(userId).append('\"'); + sb.append(",\"userName\":\"") + .append(userName).append('\"'); + sb.append(",\"gmtCreate\":\"") + .append(gmtCreate).append('\"'); + sb.append(",\"gmtModified\":\"") + .append(gmtModified).append('\"'); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/cm/inspection/service/industryuser/impl/IndustryUserServiceImpl.java b/src/main/java/com/cm/inspection/service/industryuser/impl/IndustryUserServiceImpl.java index a45e1e9..20ac7e3 100644 --- a/src/main/java/com/cm/inspection/service/industryuser/impl/IndustryUserServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/industryuser/impl/IndustryUserServiceImpl.java @@ -62,21 +62,28 @@ public class IndustryUserServiceImpl extends BaseService implements IIndustryUse String name = userIdArray[1]; IndustryUserDTO industryUserDTO = getIndustryUserByUserId(id); if (industryUserDTO != null) { + updateIndustryUser(industryUserDTO.getIndustryUserId(), industryId, id, name, params); continue; } params.put("industryUserId", UUIDUtil.getUUID()); params.put("industryId", industryId); params.put("userId", id); params.put("userName", name); - if (token != null) { - setSaveInfo(token, params); - } else { - setSaveInfo(params); - } + setSaveInfo(params); industryUserDao.saveIndustryUser(params); } } + private void updateIndustryUser(String industryUserId, String industryId, String userId, String userName, Map params) { + params.clear(); + params.put("industryUserId", industryUserId); + params.put("industryId", industryId); + params.put("userId", userId); + params.put("userName", userName); + setUpdateInfo(params); + industryUserDao.updateIndustryUser(params); + } + @Override public IndustryUserDTO getIndustryUserByUserId(String userId) throws SearchException { Map params = getHashMap(1); diff --git a/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml b/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml index e802b97..4f46b86 100644 --- a/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml +++ b/src/main/resources/mybatis/mapper/gridpersonnel/gridpersonnel-mapper.xml @@ -140,7 +140,7 @@ LEFT JOIN gen_industry_user jt1 ON - jt1.user_id = t1.user_id + jt1.user_id = SUBSTR(t1.user_id, 1, 36) WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/industryuser/industryuser-mapper.xml b/src/main/resources/mybatis/mapper/industryuser/industryuser-mapper.xml index 86cc825..47c5039 100644 --- a/src/main/resources/mybatis/mapper/industryuser/industryuser-mapper.xml +++ b/src/main/resources/mybatis/mapper/industryuser/industryuser-mapper.xml @@ -9,6 +9,7 @@ + @@ -73,13 +74,13 @@ gen_industry_user SET - industry_id = #{industryId} + industry_id = #{industryId}, user_id = #{userId}, - user_name = #{userName} + user_name = #{userName}, modifier = #{modifier}, gmt_modified = #{gmtModified} @@ -117,6 +118,7 @@ t1.user_name, dt1.dictionary_name industry_id_dictionary_name, t1.gmt_create, + t1.gmt_modified, t1.industry_user_id FROM gen_industry_user t1 @@ -132,7 +134,7 @@ AND ( dt1.dictionary_name LIKE CONCAT(#{keywords}, '%') OR - jt1.name LIKE CONCAT(#{keywords}, '%') + t1.user_name LIKE CONCAT(#{keywords}, '%') ) diff --git a/src/main/resources/static/route/industryuser/list-industryuser.html b/src/main/resources/static/route/industryuser/list-industryuser.html index b80adcb..0afac28 100644 --- a/src/main/resources/static/route/industryuser/list-industryuser.html +++ b/src/main/resources/static/route/industryuser/list-industryuser.html @@ -56,9 +56,9 @@ var table = layui.table; var resizeTimeout = null; var hrefParams = top.restAjax.params(window.location.href); - var natureId = hrefParams.natureId; - var natureName = hrefParams.natureName; - var tableUrl = 'api/industryuser/listpageindustryuser?natureId='+ natureId; + var industryId = hrefParams.industryId; + var industryName = hrefParams.industryName; + var tableUrl = 'api/industryuser/listpageindustryuser?industryId='+ industryId; function initTable() { table.render({ @@ -94,6 +94,15 @@ } return rowData.substring(0, rowData.length - 2); } + }, + {field: 'gmtModified', width: 200, title: '修改时间', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData.substring(0, rowData.length - 2); + } } ]], page: true, @@ -151,7 +160,7 @@ userIdList.push(item.userId +'|'+ item.userName); } var layIndex; - top.restAjax.post(top.restAjax.path('api/industryuser/saveindustryuserbynatureid/{natureId}', [natureId]), { + top.restAjax.post(top.restAjax.path('api/industryuser/saveindustryuserbynatureid/{industryId}', [industryId]), { userIds: userIdList }, null, function(code, data) { top.dialog.msg('关联成功', {time: 1000}); @@ -196,7 +205,7 @@ if(layEvent === 'saveEvent') { top.dialog.open({ url: top.restAjax.path('route/tree/treeuser', []), - title: '【'+ natureName + '】关联行业人员', + title: '【'+ industryName + '】关联行业人员', width: '500px', height: '500px', onClose: function() { diff --git a/src/main/resources/static/route/industryuser/list-tree-industryuser.html b/src/main/resources/static/route/industryuser/list-tree-industryuser.html index 1a89086..c0424ec 100644 --- a/src/main/resources/static/route/industryuser/list-tree-industryuser.html +++ b/src/main/resources/static/route/industryuser/list-tree-industryuser.html @@ -50,7 +50,7 @@ // 初始化IFrame function initIFrame() { - $('#listContent').attr('src', top.restAjax.path('route/industryuser/list-industryuser.html?natureId={parentId}&natureName={natureName}', [parentId, encodeURI(parentName)])); + $('#listContent').attr('src', top.restAjax.path('route/industryuser/list-industryuser.html?industryId={parentId}&industryName={parentName}', [parentId, encodeURI(parentName)])); } // 初始化大小 function initSize() {