|
@@ -962,6 +962,76 @@ 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 PageInfo<HashMap<String, Object>> getleaderUserList(int page, int rows, String username, Integer usertype) {
|
|
|
PageHelper.startPage(page, rows);
|