幼儿评估-图表
This commit is contained in:
@ -4,6 +4,8 @@ import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.project.common.SchoolCommon;
|
||||
import com.ruoyi.project.system.domain.SysDictData;
|
||||
import com.ruoyi.project.system.service.ISysDictDataService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -36,6 +38,8 @@ public class ByAssessmentchildController extends BaseController {
|
||||
private IByAssessmentchildService byAssessmentchildService;
|
||||
@Autowired
|
||||
private SchoolCommon schoolCommon;
|
||||
@Autowired
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
/**
|
||||
* 查询幼儿评估列表
|
||||
@ -48,6 +52,14 @@ public class ByAssessmentchildController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getdicdata/{id}")
|
||||
public AjaxResult getListDicData(@PathVariable("id") Long id) {
|
||||
AjaxResult ajaxResult = AjaxResult.success();
|
||||
List<SysDictData> list = dictDataService.selectDictDataByChildId(id);
|
||||
ajaxResult.put("dictdata", list);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出幼儿评估列表
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.project.benyi.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
@ -65,8 +66,8 @@ public class ByAssessmentcontentController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('benyi:assessmentcontent:query')")
|
||||
@GetMapping(value = "/byparentid/{id}")
|
||||
public AjaxResult getInfobyparentId(@PathVariable("id") Long id) {
|
||||
System.out.println("start:"+id);
|
||||
ByAssessmentcontent byAssessmentcontent=new ByAssessmentcontent();
|
||||
System.out.println("start:" + id);
|
||||
ByAssessmentcontent byAssessmentcontent = new ByAssessmentcontent();
|
||||
byAssessmentcontent.setParentId(id);
|
||||
return AjaxResult.success(byAssessmentcontentService.selectByAssessmentcontentList(byAssessmentcontent));
|
||||
}
|
||||
@ -144,4 +145,35 @@ public class ByAssessmentcontentController extends BaseController {
|
||||
}
|
||||
return toAjax(byAssessmentcontentService.deleteByAssessmentcontentById(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getassessmentstatistics/{childid}/{scope}")
|
||||
public AjaxResult getAssessmentStatistics(@PathVariable("childid") Long childid, @PathVariable("scope") String scope) {
|
||||
AjaxResult ajaxResult = AjaxResult.success();
|
||||
String[] strArr = new String[]{"健康", "语言", "社会", "科学", "艺术"};
|
||||
List<Double> douArr = new ArrayList<Double>();
|
||||
for (int i = 0; i < strArr.length; i++) {
|
||||
ByAssessmentcontent byAssessmentcontent = new ByAssessmentcontent();
|
||||
byAssessmentcontent.setScope(scope);
|
||||
byAssessmentcontent.setName(strArr[i]);
|
||||
//获取{"健康", "语言", "社会", "科学", "艺术"} 对应的值
|
||||
List<ByAssessmentcontent> list = byAssessmentcontentService.selectByAssessmentcontentList(byAssessmentcontent);
|
||||
if (list != null && list.size() > 0) {
|
||||
Long id = list.get(0).getId();
|
||||
byAssessmentcontent.setId(id);
|
||||
byAssessmentcontent.setSort(childid);
|
||||
int count = byAssessmentcontentService.selectCountElement(byAssessmentcontent);
|
||||
int countChild = byAssessmentcontentService.selectCountElementByChild(byAssessmentcontent);
|
||||
if (scope.equals("1")) {
|
||||
douArr.add((((double) 48 / count) * countChild));
|
||||
} else if (scope.equals("2")) {
|
||||
douArr.add((((double) 60 / count) * countChild));
|
||||
} else if (scope.equals("3")) {
|
||||
douArr.add((((double) 72 / count) * countChild));
|
||||
}
|
||||
}
|
||||
}
|
||||
ajaxResult.put("statistics", douArr);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -74,4 +74,20 @@ public interface ByAssessmentcontentMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
public int hasChildByAssessmentcontentId(Long id);
|
||||
|
||||
/**
|
||||
* 节点元素个数
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectCountElement(ByAssessmentcontent byAssessmentcontent);
|
||||
|
||||
/**
|
||||
* 节点元素个数根据child
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectCountElementByChild(ByAssessmentcontent byAssessmentcontent);
|
||||
}
|
||||
|
@ -91,4 +91,20 @@ public interface IByAssessmentcontentService {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByAssessmentcontentById(Long id);
|
||||
|
||||
/**
|
||||
* 节点元素个数
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectCountElement(ByAssessmentcontent byAssessmentcontent);
|
||||
|
||||
/**
|
||||
* 节点元素个数根据child
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int selectCountElementByChild(ByAssessmentcontent byAssessmentcontent);
|
||||
}
|
||||
|
@ -202,4 +202,26 @@ public class ByAssessmentcontentServiceImpl implements IByAssessmentcontentServi
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 节点元素个数
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int selectCountElement(ByAssessmentcontent byAssessmentcontent){
|
||||
return byAssessmentcontentMapper.selectCountElement(byAssessmentcontent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 节点元素个数根据child
|
||||
*
|
||||
* @param byAssessmentcontent 内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int selectCountElementByChild(ByAssessmentcontent byAssessmentcontent){
|
||||
return byAssessmentcontentMapper.selectCountElementByChild(byAssessmentcontent);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,14 @@ public interface SysDictDataMapper
|
||||
*/
|
||||
public SysDictData selectDictDataById(Long dictCode);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
* @param childId 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByChildId(Long childId);
|
||||
|
||||
/**
|
||||
* 查询字典数据
|
||||
*
|
||||
|
@ -43,6 +43,14 @@ public interface ISysDictDataService
|
||||
*/
|
||||
public SysDictData selectDictDataById(Long dictCode);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
* @param childId 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByChildId(Long childId);
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典数据信息
|
||||
*
|
||||
|
@ -67,6 +67,17 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
return dictDataMapper.selectDictDataById(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
* @param childId 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByChildId(Long childId){
|
||||
return dictDataMapper.selectDictDataByChildId(childId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典数据信息
|
||||
*
|
||||
|
@ -57,6 +57,18 @@ order by t.sort
|
||||
where parentId = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectCountElement" parameterType="ByAssessmentcontent" resultType="int">
|
||||
select count(*) from by_assessmentcontent where find_in_set(id, getChildLst(#{id})) and scope=#{scope} and iselement='Y';
|
||||
</select>
|
||||
|
||||
<!--sort 暂且代替childid-->
|
||||
<select id="selectCountElementByChild" parameterType="ByAssessmentcontent" resultType="int">
|
||||
select count(*) from (
|
||||
select a.* from by_assessmentcontent a
|
||||
right join by_assessmentchild b on a.id=b.contentid where b.childid=#{sort} and b.scope=#{scope}) temp
|
||||
where find_in_set(id, getChildLst(#{id})) ;
|
||||
</select>
|
||||
|
||||
<insert id="insertByAssessmentcontent" parameterType="ByAssessmentcontent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into by_assessmentcontent
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -54,6 +54,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<!--获取评估代码 根据幼儿id,幼儿id暂且用sort代替一下 传参-->
|
||||
<select id="selectDictDataByChildId" parameterType="Long" resultMap="SysDictDataResult">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data where dict_type='sys_dm_pgyssyfw'
|
||||
and dict_value in ( select distinct scope from by_assessmentchild where childid= #{dictSort})
|
||||
order by dict_sort desc
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
|
Reference in New Issue
Block a user