|
@@ -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;
|
|
@@ -87,6 +88,12 @@ public class PartyTwoServiceImpl implements PartyTwoService {
|
|
|
@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);
|
|
@@ -412,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("提交成功!");
|
|
@@ -442,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
|