|
@@ -75,7 +75,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public String saveForm(CwProjectReportData reportData) throws Exception{
|
|
|
|
|
|
+ public synchronized String saveForm(CwProjectReportData reportData) throws Exception{
|
|
if (StringUtils.isNotEmpty(reportData.getId())){
|
|
if (StringUtils.isNotEmpty(reportData.getId())){
|
|
|
|
|
|
CwProjectReport report = reportMapper.selectById(reportData.getId());
|
|
CwProjectReport report = reportMapper.selectById(reportData.getId());
|
|
@@ -119,12 +119,28 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
//删除work_attachment_id信息
|
|
//删除work_attachment_id信息
|
|
attachmentMapper.deleteByAttachMnentId(info.getId());
|
|
attachmentMapper.deleteByAttachMnentId(info.getId());
|
|
});
|
|
});
|
|
|
|
+ List<CwProjectInfoData> finalInfoList = infoList;
|
|
infoList.forEach(in->{
|
|
infoList.forEach(in->{
|
|
in.setUpdateBy(UserUtils.getCurrentUserDTO().getId());
|
|
in.setUpdateBy(UserUtils.getCurrentUserDTO().getId());
|
|
in.setUpdateDate(new Date());
|
|
in.setUpdateDate(new Date());
|
|
|
|
+ in.setReportId(report.getId());
|
|
//先去数据库中查是否有数据,有则更新,无则添加
|
|
//先去数据库中查是否有数据,有则更新,无则添加
|
|
CwProjectInfoData cwProjectInfoData = infoMapper.selectById(in.getId());
|
|
CwProjectInfoData cwProjectInfoData = infoMapper.selectById(in.getId());
|
|
if (cwProjectInfoData == null){
|
|
if (cwProjectInfoData == null){
|
|
|
|
+ try {
|
|
|
|
+ //在插入报告文号前先去报告文号报废表中根据时间排序查看是否有报告文号,有则使用,delflag改为1
|
|
|
|
+ List<String> reportNo = infoMapper.getReportNo();
|
|
|
|
+ if (reportNo != null & !reportNo.isEmpty()){
|
|
|
|
+ for (int i = 0; i< finalInfoList.size(); i++){
|
|
|
|
+ in.setReportNo(reportNo.get(i));
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ String documentNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectInfoData.BIZ_CODE);
|
|
|
|
+ in.setReportNo(documentNo);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
infoMapper.insert(in);
|
|
infoMapper.insert(in);
|
|
}else {
|
|
}else {
|
|
infoMapper.updateById(in);
|
|
infoMapper.updateById(in);
|