|
@@ -2321,4 +2321,76 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
|
|
|
return "保存审核意见失败!!";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存上报数据并上报省站
|
|
|
+ * @param reported
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public String saveReportedInfoByPerson(RuralProjectRecordsReported reported) {
|
|
|
+ this.disposeList(reported);
|
|
|
+ //查询是否已经上报项目信息
|
|
|
+ if (StringUtils.isBlank(reported.getId())){
|
|
|
+ reported.setCompany(UserUtils.getSelectCompany());
|
|
|
+ reported.setOffice(UserUtils.getSelectOffice());
|
|
|
+ reported.preInsert();
|
|
|
+ //将项目id设置为id
|
|
|
+ reported.setId(reported.getProjectId());
|
|
|
+ reported.setReportStatus("5");
|
|
|
+ ruralProjectRecordsReportedDao.insert(reported);
|
|
|
+ }else{
|
|
|
+ reported.preUpdate();
|
|
|
+ reported.setReportStatus("5");
|
|
|
+ ruralProjectRecordsReportedDao.update(reported);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //删除上报咨询员信息
|
|
|
+ ruralProjectRecordsReportedDao.deleteConsultant(reported);
|
|
|
+ //保存咨询员信息
|
|
|
+ for (ReportedConsultant info : reported.getReportedConsultantList()){
|
|
|
+ if (info.getId() == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //添加项目上报id
|
|
|
+ info.setReportedId(reported.getId());
|
|
|
+ info.preInsert();
|
|
|
+ ruralProjectRecordsReportedDao.insertConsultant(info);
|
|
|
+ }
|
|
|
+ RuralProjectRecordsReported ruralProjectRecordsReported = ruralProjectRecordsReportedDao.get(reported.getId());
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(reported, ruralProjectRecordsReported);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //处理上报数据
|
|
|
+ Map<String,String> map = RuralProjectReportedUtil.reportedDataManage(ruralProjectRecordsReported);
|
|
|
+ String mapStr = MapToXmlUtil.getMapToXML(map);
|
|
|
+ //进行上报
|
|
|
+ /*String client = RuralProjectReportedUtil.client(mapStr);
|
|
|
+ if(!"Success".equals(client)){
|
|
|
+ return "上报失败!";
|
|
|
+ }*/
|
|
|
+
|
|
|
+ //修改项目信息中的上报状态
|
|
|
+ RuralProjectRecords records = new RuralProjectRecords();
|
|
|
+ records.setId(reported.getId());
|
|
|
+ //获取项目信息
|
|
|
+ RuralProjectRecords record = ruralProjectRecordsService.get(records);
|
|
|
+ //修改项目表中上报状态
|
|
|
+ //判断项目是否超期,如果超期则将上报标志改为超期上报(7) 否则变更为正常上报数据
|
|
|
+ if(1 == record.getOverDueStatus()){
|
|
|
+ records.setReportedState("7");
|
|
|
+ }else{
|
|
|
+ records.setReportedState("5");
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改项目表中字段信息
|
|
|
+ dao.updateReported(records);
|
|
|
+ //完成上报
|
|
|
+ return "上报成功";
|
|
|
+ }
|
|
|
}
|