|
|
|
|
@ -37,8 +37,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/kaohe/kh_result")
|
|
|
|
|
public class KhKhrwResultController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
public class KhKhrwResultController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IKhKhrwResultService khKhrwResultService;
|
|
|
|
|
@Autowired
|
|
|
|
|
@ -58,7 +57,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
headerData.put("label", pc.getPcTitle());
|
|
|
|
|
List<Object> children = new ArrayList<>();
|
|
|
|
|
JSONObject tableColumn = new JSONObject();
|
|
|
|
|
tableColumn.put("name", "khdxName");
|
|
|
|
|
tableColumn.put("name", "khdx");
|
|
|
|
|
if (pc.getBkhdxType().equals("0")) {
|
|
|
|
|
tableColumn.put("label", "单位");
|
|
|
|
|
} else {
|
|
|
|
|
@ -96,30 +95,26 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
Collectors.toList())); // 根据getBkhdxName分组*/lists.stream().
|
|
|
|
|
//循环map得到对应数据
|
|
|
|
|
Set<Map.Entry<String, List<KhVoteEmp>>> entries = khdxMap.entrySet();
|
|
|
|
|
Integer index1=0;
|
|
|
|
|
for (Map.Entry<String, List<KhVoteEmp>> entry : entries) {
|
|
|
|
|
index1++;
|
|
|
|
|
BigDecimal sumScore = BigDecimal.ZERO;
|
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
//获取表头数据
|
|
|
|
|
List<Object> children2 = new ArrayList<>();
|
|
|
|
|
List<Object> children3 = new ArrayList<>();
|
|
|
|
|
JSONObject child1 = new JSONObject();
|
|
|
|
|
JSONObject child2 = new JSONObject();
|
|
|
|
|
JSONObject child3 = new JSONObject();
|
|
|
|
|
JSONObject child4 = new JSONObject();
|
|
|
|
|
JSONObject child5 = new JSONObject();
|
|
|
|
|
JSONObject child6 = new JSONObject();
|
|
|
|
|
//------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
//获取表数据
|
|
|
|
|
JSONObject pcdata = new JSONObject();
|
|
|
|
|
List<KhVoteEmp> value = entry.getValue();
|
|
|
|
|
JSONObject votesDatas = new JSONObject();
|
|
|
|
|
Integer index=0;
|
|
|
|
|
Integer index2 = 0;
|
|
|
|
|
for (KhVoteEmp voteEmp : value) {
|
|
|
|
|
index++;
|
|
|
|
|
String pyVoteTitle = PinYinUtil.getPinyinInitials(voteEmp.getVoteTitle());
|
|
|
|
|
index2++;
|
|
|
|
|
// String pyVoteTitle = PinYinUtil.getPinyinInitials(voteEmp.getVoteTitle());
|
|
|
|
|
JSONObject tabledata = new JSONObject();
|
|
|
|
|
tabledata.put("name", pyVoteTitle);
|
|
|
|
|
// tabledata.put("name", pyVoteTitle);
|
|
|
|
|
tabledata.put("name", "khx"+index2);
|
|
|
|
|
tabledata.put("label", voteEmp.getVoteTitle());
|
|
|
|
|
|
|
|
|
|
Object objectData;
|
|
|
|
|
@ -132,9 +127,17 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
xxpf.setOptionD(voteEmp.getOptionD());
|
|
|
|
|
xxpf.setAvgScore(voteEmp.getAvgScore());
|
|
|
|
|
xxpf.setPercentage(voteEmp.getPercentage());
|
|
|
|
|
objectData = xxpf;
|
|
|
|
|
// votesDatas.put(pyVoteTitle, xxpf);
|
|
|
|
|
votesDatas.put("khx"+index2, xxpf);
|
|
|
|
|
sumScore = sumScore.add(voteEmp.getEndScore());
|
|
|
|
|
if(index==1){
|
|
|
|
|
if (index1 == 1) {
|
|
|
|
|
List<Object> children3 = new ArrayList<>();
|
|
|
|
|
JSONObject child1 = new JSONObject();
|
|
|
|
|
JSONObject child2 = new JSONObject();
|
|
|
|
|
JSONObject child3 = new JSONObject();
|
|
|
|
|
JSONObject child4 = new JSONObject();
|
|
|
|
|
JSONObject child5 = new JSONObject();
|
|
|
|
|
JSONObject child6 = new JSONObject();
|
|
|
|
|
child1.put("name", "optionA");
|
|
|
|
|
child1.put("label", "优秀");
|
|
|
|
|
child2.put("name", "optionB");
|
|
|
|
|
@ -153,53 +156,41 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
children3.add(child4);
|
|
|
|
|
children3.add(child5);
|
|
|
|
|
children3.add(child6);
|
|
|
|
|
tabledata.put("children", children3);
|
|
|
|
|
children2.add(tabledata);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (voteEmp.getKhitemTypeid().equals(2L)) {//评分占比
|
|
|
|
|
KhPfzb pfzb = new KhPfzb();
|
|
|
|
|
pfzb.setAvgScore(voteEmp.getAvgScore());
|
|
|
|
|
pfzb.setPercentage(voteEmp.getPercentage());
|
|
|
|
|
objectData = pfzb;
|
|
|
|
|
//votesDatas.put(pyVoteTitle, voteEmp.getAvgScore());
|
|
|
|
|
votesDatas.put("khx"+index2, voteEmp.getAvgScore());
|
|
|
|
|
// votesDatas.put(pyVoteTitle+"_zb", voteEmp.getPercentage());
|
|
|
|
|
votesDatas.put("khx"+index2+"_zb", voteEmp.getPercentage());
|
|
|
|
|
sumScore = sumScore.add(voteEmp.getEndScore());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(index==1){
|
|
|
|
|
child1.put("name","avgScore");
|
|
|
|
|
child1.put("label","得分");
|
|
|
|
|
child2.put("name","percentage");
|
|
|
|
|
child2.put("label","占比");
|
|
|
|
|
children3.add(child2);
|
|
|
|
|
children3.add(child1);
|
|
|
|
|
if (index1 == 1) {
|
|
|
|
|
JSONObject tabledata2 = new JSONObject();
|
|
|
|
|
// tabledata2.put("name", pyVoteTitle + "_zb");
|
|
|
|
|
tabledata2.put("name", "khx"+index2 + "_zb");
|
|
|
|
|
tabledata2.put("label", "占比");
|
|
|
|
|
children2.add(tabledata);
|
|
|
|
|
children2.add(tabledata2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {//单独评分
|
|
|
|
|
KhDdpf ddpf = new KhDdpf();
|
|
|
|
|
ddpf.setAvgScore(voteEmp.getAvgScore());
|
|
|
|
|
objectData = ddpf;
|
|
|
|
|
if (index1 == 1) {
|
|
|
|
|
// votesDatas.put(pyVoteTitle, voteEmp.getAvgScore());
|
|
|
|
|
votesDatas.put("khx"+index2, voteEmp.getAvgScore());
|
|
|
|
|
children2.add(tabledata);
|
|
|
|
|
}
|
|
|
|
|
sumScore = sumScore.add(voteEmp.getAvgScore());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(index==1){{
|
|
|
|
|
child1.put("name","avgScore");
|
|
|
|
|
child1.put("label","得分");
|
|
|
|
|
children3.add(child1);
|
|
|
|
|
}}
|
|
|
|
|
}
|
|
|
|
|
votesDatas.put(pyVoteTitle, objectData);
|
|
|
|
|
|
|
|
|
|
tabledata.put("children",children3);
|
|
|
|
|
children2.add(tabledata);
|
|
|
|
|
}
|
|
|
|
|
pcdata.put("khdxName", key);
|
|
|
|
|
pcdata.put("khdx", key);
|
|
|
|
|
pcdata.put(pyPCtitle, votesDatas);
|
|
|
|
|
pcdata.put("df", sumScore);
|
|
|
|
|
endData.add(pcdata);
|
|
|
|
|
|
|
|
|
|
if (index1 == 1) {
|
|
|
|
|
tableColumn2.put("children", children2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
children.add(tableColumn2);
|
|
|
|
|
JSONObject tableColumn3 = new JSONObject();
|
|
|
|
|
@ -216,7 +207,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
pcResult.setTableHeader(header.toJSONString());
|
|
|
|
|
pcResult.setTableData(endData.toJSONString());
|
|
|
|
|
khKhrwResultService.insertKhKhrwResult(pcResult);
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
return AjaxResult.success(header);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -224,8 +215,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:list')")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(KhKhrwResult khKhrwResult)
|
|
|
|
|
{
|
|
|
|
|
public TableDataInfo list(KhKhrwResult khKhrwResult) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<KhKhrwResult> list = khKhrwResultService.selectKhKhrwResultList(khKhrwResult);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
@ -237,8 +227,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:export')")
|
|
|
|
|
@Log(title = "考核结果", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, KhKhrwResult khKhrwResult)
|
|
|
|
|
{
|
|
|
|
|
public void export(HttpServletResponse response, KhKhrwResult khKhrwResult) {
|
|
|
|
|
List<KhKhrwResult> list = khKhrwResultService.selectKhKhrwResultList(khKhrwResult);
|
|
|
|
|
ExcelUtil<KhKhrwResult> util = new ExcelUtil<KhKhrwResult>(KhKhrwResult.class);
|
|
|
|
|
util.exportExcel(response, list, "考核结果数据");
|
|
|
|
|
@ -249,8 +238,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:query')")
|
|
|
|
|
@GetMapping(value = "/{id}")
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
|
|
return success(khKhrwResultService.selectKhKhrwResultById(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -260,8 +248,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:add')")
|
|
|
|
|
@Log(title = "考核结果", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@RequestBody KhKhrwResult khKhrwResult)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult add(@RequestBody KhKhrwResult khKhrwResult) {
|
|
|
|
|
return toAjax(khKhrwResultService.insertKhKhrwResult(khKhrwResult));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -271,8 +258,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:edit')")
|
|
|
|
|
@Log(title = "考核结果", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult edit(@RequestBody KhKhrwResult khKhrwResult)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult edit(@RequestBody KhKhrwResult khKhrwResult) {
|
|
|
|
|
return toAjax(khKhrwResultService.updateKhKhrwResult(khKhrwResult));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -282,8 +268,7 @@ public class KhKhrwResultController extends BaseController
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('kaohe:kh_result:remove')")
|
|
|
|
|
@Log(title = "考核结果", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
|
|
return toAjax(khKhrwResultService.deleteKhKhrwResultByIds(ids));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|