|
@@ -2,10 +2,8 @@
|
|
|
package org.sky.scientific.service.impl;
|
|
package org.sky.scientific.service.impl;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import org.sky.core.log.exception.ServiceException;
|
|
import org.sky.core.log.exception.ServiceException;
|
|
|
import org.sky.core.mp.base.BaseServiceImpl;
|
|
import org.sky.core.mp.base.BaseServiceImpl;
|
|
|
-import org.sky.core.tool.utils.DateUtil;
|
|
|
|
|
import org.sky.scientific.excel.XmJtbExcel;
|
|
import org.sky.scientific.excel.XmJtbExcel;
|
|
|
import org.sky.scientific.mapper.XmJtbMapper;
|
|
import org.sky.scientific.mapper.XmJtbMapper;
|
|
|
import org.sky.scientific.pojo.dto.XmJtbDTO;
|
|
import org.sky.scientific.pojo.dto.XmJtbDTO;
|
|
@@ -14,7 +12,6 @@ import org.sky.scientific.pojo.vo.XmJtbVO;
|
|
|
import org.sky.scientific.service.IXmJtbService;
|
|
import org.sky.scientific.service.IXmJtbService;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
|
@@ -32,9 +29,9 @@ public class XmJtbServiceImpl extends BaseServiceImpl<XmJtbMapper, XmJtbEntity>
|
|
|
if (Objects.isNull(xmJtb.getXmId())) {
|
|
if (Objects.isNull(xmJtb.getXmId())) {
|
|
|
throw new ServiceException("请选择研发项目");
|
|
throw new ServiceException("请选择研发项目");
|
|
|
}
|
|
}
|
|
|
- if (null == xmJtb.getYearAndMonth()) {
|
|
|
|
|
- xmJtb.setYearAndMonth(DateUtil.format(new Date(), DateUtil.PATTERN_YYYYMM));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (null == xmJtb.getYearAndMonth()) {
|
|
|
|
|
+// xmJtb.setYearAndMonth(DateUtil.format(new Date(), DateUtil.PATTERN_YYYYMM));
|
|
|
|
|
+// }
|
|
|
return baseMapper.selectByCondition(xmJtb);
|
|
return baseMapper.selectByCondition(xmJtb);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -44,11 +41,12 @@ public class XmJtbServiceImpl extends BaseServiceImpl<XmJtbMapper, XmJtbEntity>
|
|
|
throw new ServiceException("请选择科研项目");
|
|
throw new ServiceException("请选择科研项目");
|
|
|
}
|
|
}
|
|
|
boolean result = false;
|
|
boolean result = false;
|
|
|
- if (this.isFieldDuplicate(XmJtbEntity::getXmId, xmJtb.getXmId())) {
|
|
|
|
|
- result = this.update(xmJtb, Wrappers.<XmJtbEntity>lambdaUpdate().eq(XmJtbEntity::getXmId, xmJtb.getXmId()));
|
|
|
|
|
- } else {
|
|
|
|
|
- result = this.save(xmJtb);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.saveOrUpdate(xmJtb);
|
|
|
|
|
+// if (this.isFieldDuplicate(XmJtbEntity::getXmId, xmJtb.getXmId())) {
|
|
|
|
|
+// result = this.update(xmJtb, Wrappers.<XmJtbEntity>lambdaUpdate().eq(XmJtbEntity::getXmId, xmJtb.getXmId()));
|
|
|
|
|
+// } else {
|
|
|
|
|
+// result = this.save(xmJtb);
|
|
|
|
|
+// }
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|