|
@@ -1,5 +1,6 @@
|
|
|
package com.ghsc.partybuild.service.impl;
|
|
|
|
|
|
+import com.ghsc.partybuild.vo.partyLife.PartyLifeMeetingVo;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
|
|
@@ -84,6 +85,15 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
@Autowired
|
|
|
private PartyService partyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private com.ghsc.partybuild.util.StringUtils stringUtils;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PfPartylifemeetingPersonnelMapper pfPartylifemeetingPersonnelMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PartyLifeMeetingCQuery partyLifeMeetingCQuery;
|
|
|
+
|
|
|
@Override
|
|
|
public DjDnpxxx getDnpxxx(String id) {
|
|
|
return dnpxxxMapper.selectByPrimaryKey(id);
|
|
@@ -409,18 +419,54 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public RequsetData<String> saveZtdrxx(DjZtdrxx model) {
|
|
|
+ public RequsetData<String> saveZtdrxx(DjZtdrxxVo data) {
|
|
|
RequsetData<String> res = new RequsetData<String>();
|
|
|
int result;
|
|
|
+
|
|
|
+ DjZtdrxx model = ztdrxxMapper.selectByPrimaryKey(data.getId());
|
|
|
+ boolean isSave = model == null;
|
|
|
+ if (model == null) {
|
|
|
+ model = new DjZtdrxx();
|
|
|
+ model.setId(data.getId());
|
|
|
+ }
|
|
|
+
|
|
|
//同步数据
|
|
|
model.setOperatestate("A");
|
|
|
model.setOperatetime(new Date());
|
|
|
model.setSyncstate("N");
|
|
|
- if (ztdrxxMapper.selectByPrimaryKey(model.getId()) == null) {
|
|
|
+ // 从Vo类中同步字段
|
|
|
+ model.setDzzdm(data.getDzzdm());
|
|
|
+ model.setDzzmc(data.getDzzmc());
|
|
|
+ model.setTitle(data.getTitle());
|
|
|
+ model.setActivitytime(data.getActivitytime());
|
|
|
+ model.setLocation(data.getLocation());
|
|
|
+ model.setSubjecttype(data.getSubjecttype());
|
|
|
+ model.setSubjectcontent(data.getSubjectcontent());
|
|
|
+
|
|
|
+ if (isSave) {
|
|
|
result = ztdrxxMapper.insert(model);
|
|
|
} else {
|
|
|
result = ztdrxxMapper.updateByPrimaryKeyWithBLOBs(model);
|
|
|
}
|
|
|
+
|
|
|
+ //出席人员
|
|
|
+ PfPartylifemeetingPersonnelExample perExp = new PfPartylifemeetingPersonnelExample();
|
|
|
+ perExp.or().andPartylifemeetingidEqualTo(data.getId());
|
|
|
+ pfPartylifemeetingPersonnelMapper.deleteByExample(perExp);
|
|
|
+ if(data.getPersonnellist().size() > 0){
|
|
|
+ data.getPersonnellist().forEach(item -> {
|
|
|
+ PfPartylifemeetingPersonnel perModel = new PfPartylifemeetingPersonnel();
|
|
|
+ perModel.setId(UUID.randomUUID().toString());
|
|
|
+ perModel.setRybm(item.getRybm());
|
|
|
+ perModel.setPartylifemeetingid(data.getId());
|
|
|
+ perModel.setIsabsenteeism(item.getIsabsenteeism());
|
|
|
+ perModel.setAbsenteeismcause(item.getAbsenteeismcause());
|
|
|
+ perModel.setCreatetime(new Date());
|
|
|
+
|
|
|
+ pfPartylifemeetingPersonnelMapper.insert(perModel);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (result > 0) {
|
|
|
res.setSuccess(true);
|
|
|
res.setMsg("提交成功!");
|
|
@@ -439,15 +485,24 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
@Override
|
|
|
public PageInfo<DjZtdrxxVo> getZtdrxxList(int page, int rows, String dzzdm, String dzzmc, String title, Integer subjectType, String location, String beginTime, String endTime, Integer zzfbType) {
|
|
|
PageHelper.startPage(page, rows);
|
|
|
- List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(dzzdm, dzzmc, title, location, subjectType, beginTime, endTime, zzfbType);
|
|
|
+ List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(dzzdm, dzzmc, title, location, subjectType, beginTime, endTime, zzfbType, null);
|
|
|
|
|
|
PageInfo<DjZtdrxxVo> result = new PageInfo(list);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DjZtdrxx getZtdrxx(String id) {
|
|
|
- return ztdrxxMapper.selectByPrimaryKey(id);
|
|
|
+ public DjZtdrxxVo getZtdrxx(String id) {
|
|
|
+ if (stringUtils.IsNullOrEmpty(id))
|
|
|
+ return null;
|
|
|
+
|
|
|
+ List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(null, null, null, null, null, null, null, null, null);
|
|
|
+ DjZtdrxxVo data = list.size() > 0 ? list.get(0) : null;
|
|
|
+ if(data != null){
|
|
|
+ // 查询出席人员列表
|
|
|
+ data.setPersonnellist(partyLifeMeetingCQuery.selectMeetingPersonnelList(data.getId()));
|
|
|
+ }
|
|
|
+ return data;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -846,6 +901,12 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<HashMap<String, Object>> getMzpybhgclqkList() {
|
|
|
+ List<HashMap<String, Object>> list = partyTwoCquery.selectMzpybhgclqkList();
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
public ZzMzpyxxVo getMzpyById(String id) {
|
|
|
if (!StringUtils.isNotBlank(id))
|
|
|
return null;
|
|
@@ -901,6 +962,106 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
return zzMzpyxxMapper.deleteByExample(exp);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ZzMzpyxxVo> importMzpy(List<ZzMzpyxxVo> dataList) throws Exception {
|
|
|
+ if (dataList.size() <= 0) {
|
|
|
+ throw new Exception("请添加导入数据");
|
|
|
+ }
|
|
|
+ List<ZzMzpyxxVo> errorList = new ArrayList<>();
|
|
|
+ List<HashMap<String, Object>> mzpyjgList = getMzpyjgList(); // 民主评议结果字典
|
|
|
+ List<HashMap<String, Object>> mzpybhgclqkList = getMzpybhgclqkList(); // 民主评议不合格处理情况字典
|
|
|
+
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
+ String errorInfo = "";
|
|
|
+ HashMap<String, Object> pyjg = null;
|
|
|
+ HashMap<String, Object> pyjcqk = null;
|
|
|
+ HashMap<String, Object> partyUserInfo = new HashMap<>();
|
|
|
+
|
|
|
+ int finalI = i;
|
|
|
+ if (stringUtils.IsNullOrEmpty(dataList.get(i).getUserName())) {
|
|
|
+ errorInfo += "请填写党员姓名!";
|
|
|
+ } else {
|
|
|
+ partyUserInfo = partyUserService.getPartyUserExtByName(dataList.get(i).getUserName()); // 按名字查询出党员信息
|
|
|
+ if (partyUserInfo == null || partyUserInfo.isEmpty()) {
|
|
|
+ errorInfo += "该党员不存在!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty(dataList.get(i).getKzpyrq())) {
|
|
|
+ errorInfo += "请填写评议开始日期!";
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty(dataList.get(i).getJspyrq())) {
|
|
|
+ errorInfo += "请填写评议结束日期!";
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty(dataList.get(i).getPyjg())) {
|
|
|
+ errorInfo += "请填写评议结果!";
|
|
|
+ } else {
|
|
|
+ pyjg = mzpyjgList.stream().filter(it -> it.get("HZMC").equals(dataList.get(finalI).getPyjg())).findFirst().orElse(null);
|
|
|
+ if (pyjg == null) {
|
|
|
+ errorInfo += "评议结果不存在!";
|
|
|
+ } else {
|
|
|
+ dataList.get(i).setPyjg((String) pyjg.get("BM"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!stringUtils.IsNullOrEmpty(dataList.get(i).getPyjcqk())) {
|
|
|
+ pyjcqk = mzpybhgclqkList.stream().filter(it -> it.get("HZMC").equals(dataList.get(finalI).getPyjcqk())).findFirst().orElse(null);
|
|
|
+ if (pyjcqk == null) {
|
|
|
+ errorInfo += "不合格处理情况不存在!";
|
|
|
+ } else {
|
|
|
+ dataList.get(i).setPyjcqk((String) pyjcqk.get("BM"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (stringUtils.IsNullOrEmpty(errorInfo)) {
|
|
|
+ // 初始化数据
|
|
|
+ dataList.get(i).setRybm((String) partyUserInfo.get("RYBM"));
|
|
|
+ dataList.get(i).setSzdzbdm((String) partyUserInfo.get("SZDZBDM"));
|
|
|
+ dataList.get(i).setKzpyrq(dateUtils.strFormat_short(dataList.get(i).getKzpyrq()));
|
|
|
+ dataList.get(i).setJspyrq(dateUtils.strFormat_short(dataList.get(i).getJspyrq()));
|
|
|
+ dataList.get(i).setMzpyxxbs(UUID.randomUUID().toString());
|
|
|
+ } else {
|
|
|
+ dataList.get(i).setErrorInfo(errorInfo);
|
|
|
+ errorList.add(dataList.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (errorList.isEmpty()) {
|
|
|
+ for (ZzMzpyxxVo zzMzpyxxVo : dataList) {
|
|
|
+ saveMzpy(zzMzpyxxVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return errorList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<HashMap<String, Object>> getMzpyTotalList(String dzzdm) {
|
|
|
+ // 查询计数统计
|
|
|
+ List<HashMap<String, Object>> hashMaps = partyTwoCquery.selectMzpyjgCountList(dzzdm);
|
|
|
+ HashMap<String, Object> countMap = new HashMap<>();
|
|
|
+ // 初始化 countMap 中的累加字段
|
|
|
+ if (!hashMaps.isEmpty()) {
|
|
|
+ // 初始化countMap的字段,假设所有map中的字段名是一致的
|
|
|
+ hashMaps.get(0).forEach((key, value) -> {
|
|
|
+ if (value instanceof Number) {
|
|
|
+ countMap.put(key, 0); // 初始化为0
|
|
|
+ }
|
|
|
+ });
|
|
|
+ countMap.put("DZZMC", "合计");
|
|
|
+ }
|
|
|
+ // 计算合计数据
|
|
|
+ hashMaps.forEach(map -> {
|
|
|
+ map.forEach((key, value) -> {
|
|
|
+ if (value instanceof Number) {
|
|
|
+ // 获取countMap中当前累加的值
|
|
|
+ int currentCount = (int) countMap.getOrDefault(key, 0);
|
|
|
+ // 将当前值累加到countMap中
|
|
|
+ countMap.put(key, currentCount + ((Number) value).intValue());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ hashMaps.add(countMap);
|
|
|
+ return hashMaps;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public PageInfo<HashMap<String, Object>> getleaderUserList(int page, int rows, String username, Integer usertype) {
|
|
|
PageHelper.startPage(page, rows);
|
|
@@ -909,4 +1070,88 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
PageInfo<HashMap<String, Object>> result = new PageInfo(list);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> importDnpxxx(List<Map<String, Object>> dataList) throws Exception {
|
|
|
+ if (dataList.size() <= 0) {
|
|
|
+ throw new Exception("请添加导入数据");
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> errorList = new ArrayList<>();
|
|
|
+ List<CfDictionary> positionLevelList = dictionaryService.getDictionaryListByDicTypeKey("positionLevel");
|
|
|
+ List<CfDictionary> honourTypeList = dictionaryService.getDictionaryListByDicTypeKey("honourType");
|
|
|
+
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
+ String errorInfo = "";
|
|
|
+ Integer honourlevel = null;
|
|
|
+ Integer honourtype = null;
|
|
|
+ HashMap<String, Object> partyUserInfo = new HashMap<>();
|
|
|
+
|
|
|
+ int finalI = i;
|
|
|
+ if (stringUtils.IsNullOrEmpty((String) dataList.get(i).get("userName"))) {
|
|
|
+ errorInfo += "请填写党员姓名!";
|
|
|
+ } else {
|
|
|
+ partyUserInfo = partyUserService.getPartyUserExtByName((String) dataList.get(i).get("userName")); // 按名字查询出党员信息
|
|
|
+ if (partyUserInfo == null || partyUserInfo.isEmpty()) {
|
|
|
+ errorInfo += "该党员不存在!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty((String) dataList.get(i).get("honourname"))) {
|
|
|
+ errorInfo += "请填写荣誉名称!";
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty((String) dataList.get(i).get("honourlevel"))) {
|
|
|
+ errorInfo += "请填写荣誉等级!";
|
|
|
+ } else {
|
|
|
+ honourlevel = positionLevelList.stream().filter(it -> it.getDicvalue().equals(dataList.get(finalI).get("honourlevel"))).findFirst().orElse(new CfDictionary()).getDickey();
|
|
|
+ if (honourlevel == null) {
|
|
|
+ errorInfo += "荣誉等级不存在!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty((String) dataList.get(i).get("honourtime"))) {
|
|
|
+ errorInfo += "请填写获得荣誉时间!";
|
|
|
+ }
|
|
|
+ if (stringUtils.IsNullOrEmpty((String) dataList.get(i).get("honourtype"))) {
|
|
|
+ errorInfo += "请填写荣誉类型!";
|
|
|
+ } else {
|
|
|
+ honourtype = honourTypeList.stream().filter(it -> it.getDicvalue().equals(dataList.get(finalI).get("honourtype"))).findFirst().orElse(new CfDictionary()).getDickey();
|
|
|
+ if (honourtype == null) {
|
|
|
+ errorInfo += "荣誉等级不存在!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (stringUtils.IsNullOrEmpty(errorInfo)) {
|
|
|
+ // 处理数据
|
|
|
+ // 创建实体类
|
|
|
+ DjDnpxxx model = new DjDnpxxx();
|
|
|
+ model.setId(UUID.randomUUID().toString());
|
|
|
+ model.setDzzdm((String) partyUserInfo.get("DZZDM"));
|
|
|
+ model.setDzzmc((String) partyUserInfo.get("DZZMC"));
|
|
|
+ model.setHonourlevel(honourlevel);
|
|
|
+ model.setHonourtype(honourtype);
|
|
|
+ model.setHonourname((String) dataList.get(i).get("honourname"));
|
|
|
+ model.setHonourtime(dateUtils.strToDateExt((String) dataList.get(i).get("honourtime")));
|
|
|
+ model.setPxlx("1");
|
|
|
+
|
|
|
+ UserItemVo userItem = new UserItemVo();
|
|
|
+ userItem.setRybm((String) partyUserInfo.get("RYBM"));
|
|
|
+ userItem.setXm((String) partyUserInfo.get("XM"));
|
|
|
+ UserItemVo[] vos = new UserItemVo[]{userItem};
|
|
|
+
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("model", model);
|
|
|
+ result.put("userItemVo", vos);
|
|
|
+ resultList.add(result);
|
|
|
+ } else {
|
|
|
+ dataList.get(i).put("errorInfo", errorInfo);
|
|
|
+ errorList.add(dataList.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (errorList.isEmpty()) {
|
|
|
+ resultList.forEach(item -> {
|
|
|
+ RequsetData<String> stringRequsetData = saveDnpxxx((DjDnpxxx) item.get("model"), (UserItemVo[]) item.get("userItemVo"));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return errorList;
|
|
|
+ }
|
|
|
}
|