|
@@ -1,8 +1,12 @@
|
|
|
package org.dromara.system.service.impl.pay;
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson2.JSONArray;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.gson.JsonArray;
|
|
|
import org.dromara.common.core.utils.DateUtils;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
@@ -49,29 +53,49 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<XiaoyuanPayVo> queryPageList(XiaoyuanPayBo bo, PageQuery pageQuery) {
|
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
+
|
|
|
LambdaQueryWrapper<XiaoyuanPay> lqw = buildQueryWrapper(bo);
|
|
|
Page<XiaoyuanPayVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
//处理的返回值List
|
|
|
List<XiaoyuanPayVo> resultList = new ArrayList<>();
|
|
|
XiaoyuanPayVo vo = new XiaoyuanPayVo();
|
|
|
List<XiaoyuanPayVo> records = result.getRecords();
|
|
|
- List<String> detailList = new ArrayList<>();
|
|
|
+ List<JSONObject> detailList = new ArrayList<>();
|
|
|
if (records!= null && records.size()> 0){
|
|
|
- map.put("tableLabel",records.get(0).getTableHead());
|
|
|
for (XiaoyuanPayVo record : records) {
|
|
|
String tableDetail = record.getTableDetail();
|
|
|
- tableDetail.replace("=",":");
|
|
|
- detailList.add(tableDetail);
|
|
|
+ Map<String, String> stringMap = mapStringToMap(tableDetail);
|
|
|
+ detailList.add(new JSONObject(stringMap));
|
|
|
}
|
|
|
- map.put("tableData",detailList);
|
|
|
+ //vo.setTableLabelJA(JSONUtil.parseArray(records.get(0).getTableHead()));
|
|
|
+ vo.setTableDataJO(detailList);
|
|
|
}
|
|
|
- vo.setMap(map);
|
|
|
resultList.add(vo);
|
|
|
result.setRecords(resultList);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 将Map字符串转换为Map
|
|
|
+ *
|
|
|
+ * @param str Map字符串
|
|
|
+ * @return Map
|
|
|
+ */
|
|
|
+ public static Map<String,String> mapStringToMap(String str){
|
|
|
+ str = str.substring(1, str.length()-1);
|
|
|
+ String[] strs = str.split(",");
|
|
|
+ Map<String,String> map = new HashMap<String, String>();
|
|
|
+ for (String string : strs) {
|
|
|
+ String key = string.split("=")[0];
|
|
|
+ String value = string.split("=")[1];
|
|
|
+ // 去掉头部空格
|
|
|
+ String key1 = key.trim();
|
|
|
+ String value1 = value.trim();
|
|
|
+ map.put(key1, value1);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询教职工工资条列表
|
|
|
*/
|
|
@@ -143,12 +167,12 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
//去字典值中匹配学科名称 sys_subject
|
|
|
List<SysDictDataVo> sysSubject = sysDictTypeService.selectDictDataByType("wages");
|
|
|
//工资条所需要的所有表头信息
|
|
|
- List<Map <String,Object>> sysDictList = new ArrayList<>();
|
|
|
+ List<JSONObject> sysDictList = new ArrayList<>();
|
|
|
for (SysDictDataVo sysDictDataVo : sysSubject) {
|
|
|
Map <String,Object> sysDictMap = new HashMap<>();
|
|
|
sysDictMap.put("label",sysDictDataVo.getDictLabel());
|
|
|
sysDictMap.put("prop",sysDictDataVo.getDictLabel());
|
|
|
- sysDictList.add(sysDictMap);
|
|
|
+ sysDictList.add(new JSONObject(sysDictMap));
|
|
|
}
|
|
|
List<XiaoyuanPayBo> boList = new ArrayList<>();
|
|
|
for (Map<String, String> map : maps) {
|