|
@@ -44,7 +44,7 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
* 查询教职工工资条
|
|
|
*/
|
|
|
@Override
|
|
|
- public XiaoyuanPayVo queryById(Long payId){
|
|
|
+ public XiaoyuanPayVo queryById(Long payId) {
|
|
|
return baseMapper.selectVoById(payId);
|
|
|
}
|
|
|
|
|
@@ -61,10 +61,11 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
XiaoyuanPayVo vo = new XiaoyuanPayVo();
|
|
|
List<XiaoyuanPayVo> records = result.getRecords();
|
|
|
List<JSONObject> detailList = new ArrayList<>();
|
|
|
- if (records!= null && records.size()> 0){
|
|
|
+ if (records != null && records.size() > 0) {
|
|
|
for (XiaoyuanPayVo record : records) {
|
|
|
String tableDetail = record.getTableDetail();
|
|
|
- Map<String, String> stringMap = mapStringToMap(tableDetail);
|
|
|
+ Map<String, Object> stringMap = mapStringToMap(tableDetail);
|
|
|
+ stringMap.put("payId", record.getPayId());
|
|
|
detailList.add(new JSONObject(stringMap));
|
|
|
}
|
|
|
//vo.setTableLabelJA(JSONUtil.parseArray(records.get(0).getTableHead()));
|
|
@@ -81,10 +82,10 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
* @param str Map字符串
|
|
|
* @return Map
|
|
|
*/
|
|
|
- public static Map<String,String> mapStringToMap(String str){
|
|
|
- str = str.substring(1, str.length()-1);
|
|
|
+ public static Map<String, Object> mapStringToMap(String str) {
|
|
|
+ str = str.substring(1, str.length() - 1);
|
|
|
String[] strs = str.split(",");
|
|
|
- Map<String,String> map = new HashMap<String, String>();
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
for (String string : strs) {
|
|
|
String key = string.split("=")[0];
|
|
|
String value = string.split("=")[1];
|
|
@@ -143,7 +144,7 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
/**
|
|
|
* 保存前的数据校验
|
|
|
*/
|
|
|
- private void validEntityBeforeSave(XiaoyuanPay entity){
|
|
|
+ private void validEntityBeforeSave(XiaoyuanPay entity) {
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
}
|
|
|
|
|
@@ -152,7 +153,7 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
- if(isValid){
|
|
|
+ if (isValid) {
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
}
|
|
|
return baseMapper.deleteBatchIds(ids) > 0;
|
|
@@ -160,6 +161,7 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
|
|
|
/**
|
|
|
* 教职工工资表导入数据
|
|
|
+ *
|
|
|
* @param maps
|
|
|
*/
|
|
|
@Override
|
|
@@ -169,9 +171,9 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
//工资条所需要的所有表头信息
|
|
|
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());
|
|
|
+ Map<String, Object> sysDictMap = new HashMap<>();
|
|
|
+ sysDictMap.put("label", sysDictDataVo.getDictLabel());
|
|
|
+ sysDictMap.put("prop", sysDictDataVo.getDictLabel());
|
|
|
sysDictList.add(new JSONObject(sysDictMap));
|
|
|
}
|
|
|
List<XiaoyuanPayBo> boList = new ArrayList<>();
|
|
@@ -180,13 +182,19 @@ public class XiaoyuanPayServiceImpl implements IXiaoyuanPayService {
|
|
|
//组装数据
|
|
|
bo.setTeacherName(map.get("姓名"));
|
|
|
bo.setTeacherNum(map.get("工号"));
|
|
|
- bo.setPayTime(map.get("发放时间"));
|
|
|
+ String faTime = map.get("发放时间");
|
|
|
+ String[] split = faTime.split("-");
|
|
|
+ if (split.length > 1) {
|
|
|
+ bo.setYear(split[0]);
|
|
|
+ bo.setMonth(split[1]);
|
|
|
+ }
|
|
|
+ bo.setPayTime(faTime);
|
|
|
bo.setTableHead(sysDictList.toString());
|
|
|
bo.setTableDetail(map.toString());
|
|
|
bo.setCreateTime(DateUtils.getNowDate());
|
|
|
boList.add(bo);
|
|
|
}
|
|
|
- baseMapper.insertBatch(MapstructUtils.convert(boList,XiaoyuanPay.class));
|
|
|
+ baseMapper.insertBatch(MapstructUtils.convert(boList, XiaoyuanPay.class));
|
|
|
}
|
|
|
|
|
|
}
|