修改页面

This commit is contained in:
liuwu 2023-09-05 16:09:04 +08:00
parent f5d9e8afc4
commit cb671ac6fc
6 changed files with 64 additions and 1 deletions

View File

@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cyx.common.annotation.Log;
import com.cyx.common.core.controller.BaseController;
import com.cyx.common.core.domain.AjaxResult;
@ -218,6 +220,32 @@ public class TAmentPartyAffairsController extends BaseController
return getDataTable(list);
}
@GetMapping("/deptTree")
@ResponseBody
public Object deptTree(TAmentPartyAffairs tAmentPartyAffairs)
{
JSONArray array =new JSONArray();
List<Map<String,Object>> list = tAmentPartyAffairsService.deptTree(tAmentPartyAffairs);
list.forEach(l->{
JSONObject p = new JSONObject();
p.put("id",l.get("id"));
p.put("pId",0);
p.put("name",l.get("type"));
p.put("title",l.get("type"));
p.put("open",false);
p.put("checked",false);
array.add(p);
JSONArray array1 = JSONArray.parseArray("["+l.get("json")+"]");
array1.forEach(a->{
JSONObject o = (JSONObject) a;
o.put("pId",l.get("id"));
o.put("type",l.get("type"));
array.add(o);
});
});
return array;
}
/**
* 查询党务列表
*/

View File

@ -80,4 +80,6 @@ public interface TAmentPartyAffairsMapper
List<TAmentPartyAffairs> warnList(TAmentPartyAffairs tAmentPartyAffairs);
List<TAmentPartyAffairs> approveList(TAmentPartyAffairs tAmentPartyAffairs);
List<Map<String, Object>> deptTree(TAmentPartyAffairs tAmentPartyAffairs);
}

View File

@ -80,4 +80,6 @@ public interface ITAmentPartyAffairsService
List<TAmentPartyAffairs> warnList(TAmentPartyAffairs tAmentPartyAffairs);
List<TAmentPartyAffairs> approveList(TAmentPartyAffairs tAmentPartyAffairs);
List<Map<String, Object>> deptTree(TAmentPartyAffairs tAmentPartyAffairs);
}

View File

@ -62,6 +62,11 @@ public class TAmentPartyAffairsServiceImpl implements ITAmentPartyAffairsService
return tAmentPartyAffairsMapper.approveList(tAmentPartyAffairs);
}
@Override
public List<Map<String, Object>> deptTree(TAmentPartyAffairs tAmentPartyAffairs){
return tAmentPartyAffairsMapper.deptTree(tAmentPartyAffairs);
}
/**
* 新增党务
*

View File

@ -33,7 +33,7 @@
<ul>
<input type="hidden" id="deptId" name="deptId">
<input type="hidden" id="parentId" name="parentId">
<input type="hidden" name="type" value="党务及意识形态"/>
<input type="hidden" id="type" name="type" value=""/>
<li>
<label>简写:</label>
<input type="text" id="shotName" name="shotName"/>
@ -303,6 +303,7 @@
});
function queryDeptTree(){
var url = ctx + "base/user/deptTreeData";
// var url = ctx + "base/affairs/deptTree";
var options = {
url: url,
expandLevel: 2,
@ -311,7 +312,9 @@
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
console.log(treeNode)
$("#deptId").val(treeNode.id);
$("#type").val(treeNode.type);
$("#parentId").val(treeNode.pId);
$.table.search();
}

View File

@ -131,6 +131,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by finish_date
</select>
<select id="deptTree" parameterType="TAmentPartyAffairs" resultType="map">
SELECT
f.id,
f.type,
GROUP_CONCAT( '{"pId":', f.id, ',"id":', f.dept_id, ',"name":"', f.dept_name, '","title":"', f.dept_name, '"}' ) json
FROM
(
SELECT
a.id,
a.type,
b.dept_id,
b.dept_name
FROM
t_ament_party_affairs a
LEFT JOIN sys_dept b ON a.dept_id = b.dept_id
GROUP BY
a.type,
a.dept_id
) f
GROUP BY
f.type
</select>
<select id="approveList" parameterType="TAmentPartyAffairs" resultMap="TAmentPartyAffairsResult">
SELECT
a.*,