|
@@ -1,12 +1,16 @@
|
|
package com.ruoyi.system.service.impl.projectV2;
|
|
package com.ruoyi.system.service.impl.projectV2;
|
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
+import com.ruoyi.system.domain.projectV2.ZsyzFj;
|
|
import com.ruoyi.system.domain.projectV2.ZsyzSbbzb;
|
|
import com.ruoyi.system.domain.projectV2.ZsyzSbbzb;
|
|
|
|
+import com.ruoyi.system.mapper.projectV2.ZsyzFjMapper;
|
|
import com.ruoyi.system.mapper.projectV2.ZsyzSbbzbMapper;
|
|
import com.ruoyi.system.mapper.projectV2.ZsyzSbbzbMapper;
|
|
import com.ruoyi.system.service.projectV2.IZsyzSbbzbService;
|
|
import com.ruoyi.system.service.projectV2.IZsyzSbbzbService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -20,6 +24,9 @@ public class ZsyzSbbzbServiceImpl implements IZsyzSbbzbService {
|
|
@Autowired
|
|
@Autowired
|
|
private ZsyzSbbzbMapper zsyzSbbzbMapper;
|
|
private ZsyzSbbzbMapper zsyzSbbzbMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ZsyzFjMapper zsyzFjMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询招商引资_申报_首谈信息_主
|
|
* 查询招商引资_申报_首谈信息_主
|
|
*
|
|
*
|
|
@@ -27,8 +34,15 @@ public class ZsyzSbbzbServiceImpl implements IZsyzSbbzbService {
|
|
* @return 招商引资_申报_首谈信息_主
|
|
* @return 招商引资_申报_首谈信息_主
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public ZsyzSbbzb selectZsyzSbbzbById(Long id) {
|
|
|
|
- return zsyzSbbzbMapper.selectZsyzSbbzbById(id);
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public ZsyzSbbzb selectZsyzSbbzbById(Long id)
|
|
|
|
+ {
|
|
|
|
+ ZsyzSbbzb zsyzSbbzb = zsyzSbbzbMapper.selectZsyzSbbzbById(id);
|
|
|
|
+ ZsyzFj zsyzFj = new ZsyzFj();
|
|
|
|
+ zsyzFj.setSourceId(id);
|
|
|
|
+ List<ZsyzFj> zsyzFjList = zsyzFjMapper.selectZsyzFjList(zsyzFj);
|
|
|
|
+ zsyzSbbzb.setZsyzFjList(zsyzFjList);
|
|
|
|
+ return zsyzSbbzb;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -49,9 +63,21 @@ public class ZsyzSbbzbServiceImpl implements IZsyzSbbzbService {
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int insertZsyzSbbzb(ZsyzSbbzb zsyzSbbzb) {
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public int insertZsyzSbbzb(ZsyzSbbzb zsyzSbbzb)
|
|
|
|
+ {
|
|
zsyzSbbzb.setCreateTime(DateUtils.getNowDate());
|
|
zsyzSbbzb.setCreateTime(DateUtils.getNowDate());
|
|
- return zsyzSbbzbMapper.insertZsyzSbbzb(zsyzSbbzb);
|
|
|
|
|
|
+ int count = zsyzSbbzbMapper.insertZsyzSbbzb(zsyzSbbzb);
|
|
|
|
+ //保存附件信息
|
|
|
|
+ List<ZsyzFj> zsyzFjList = zsyzSbbzb.getZsyzFjList();
|
|
|
|
+ for (ZsyzFj zsyzFj : zsyzFjList) {
|
|
|
|
+ zsyzFj.setSourceId(zsyzSbbzb.getId());
|
|
|
|
+ zsyzFj.setType("1");
|
|
|
|
+ zsyzFj.setXmId(zsyzSbbzb.getId());
|
|
|
|
+ zsyzFj.setXmbh(zsyzSbbzb.getXmbh());
|
|
|
|
+ zsyzFjMapper.insertZsyzFj(zsyzFj);
|
|
|
|
+ }
|
|
|
|
+ return count;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -61,9 +87,28 @@ public class ZsyzSbbzbServiceImpl implements IZsyzSbbzbService {
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int updateZsyzSbbzb(ZsyzSbbzb zsyzSbbzb) {
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public int updateZsyzSbbzb(ZsyzSbbzb zsyzSbbzb)
|
|
|
|
+ {
|
|
|
|
+
|
|
zsyzSbbzb.setUpdateTime(DateUtils.getNowDate());
|
|
zsyzSbbzb.setUpdateTime(DateUtils.getNowDate());
|
|
- return zsyzSbbzbMapper.updateZsyzSbbzb(zsyzSbbzb);
|
|
|
|
|
|
+ int count = zsyzSbbzbMapper.updateZsyzSbbzb(zsyzSbbzb);
|
|
|
|
+ //修改附件
|
|
|
|
+ if(zsyzSbbzb.getZsyzFjList()!=null && zsyzSbbzb.getZsyzFjList().size()>0){
|
|
|
|
+ //先删除相关附件
|
|
|
|
+ zsyzFjMapper.deleteZsyzFjBySourceId(zsyzSbbzb.getId());
|
|
|
|
+ //再将文件新增进数据库
|
|
|
|
+ List<ZsyzFj> zsyzFjList = zsyzSbbzb.getZsyzFjList();
|
|
|
|
+ for (ZsyzFj zsyzFj : zsyzFjList) {
|
|
|
|
+ zsyzFj.setSourceId(zsyzSbbzb.getId());
|
|
|
|
+ zsyzFj.setType("1");
|
|
|
|
+ zsyzFj.setXmId(zsyzSbbzb.getId());
|
|
|
|
+ zsyzFj.setXmbh(zsyzSbbzb.getXmbh());
|
|
|
|
+ zsyzFjMapper.insertZsyzFj(zsyzFj);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return count;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|