|
@@ -1,8 +1,14 @@
|
|
|
package com.siwei.apply.service.impl;
|
|
|
|
|
|
+import com.siwei.apply.domain.Project;
|
|
|
import com.siwei.apply.domain.Tjyydhx;
|
|
|
+import com.siwei.apply.domain.res.TjyydhxRes;
|
|
|
+import com.siwei.apply.domain.vo.TjyydhxUpdateVo;
|
|
|
+import com.siwei.apply.domain.vo.TjyydhxVo;
|
|
|
+import com.siwei.apply.mapper.ProjectMapper;
|
|
|
import com.siwei.apply.mapper.TjyydhxMapper;
|
|
|
import com.siwei.apply.service.TjyydhxService;
|
|
|
+import com.siwei.common.core.utils.bean.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -16,9 +22,18 @@ public class TjyydhxImpl implements TjyydhxService {
|
|
|
|
|
|
@Autowired
|
|
|
private TjyydhxMapper tjyydhxMapper;
|
|
|
+ @Autowired
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
|
|
|
@Override
|
|
|
- public String add(Tjyydhx tjyydhx) {
|
|
|
+ public Boolean isExit(String projectId) {
|
|
|
+ return tjyydhxMapper.isExit(projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String add(TjyydhxVo tjyydhxVo) {
|
|
|
+ Tjyydhx tjyydhx = new Tjyydhx();
|
|
|
+ BeanUtils.copyProperties(tjyydhxVo, tjyydhx);
|
|
|
tjyydhx.generateId();
|
|
|
tjyydhx.setCreatorId(UserId);
|
|
|
tjyydhxMapper.add(tjyydhx);
|
|
@@ -26,12 +41,19 @@ public class TjyydhxImpl implements TjyydhxService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Tjyydhx get(String id) {
|
|
|
- return tjyydhxMapper.get(id);
|
|
|
+ public TjyydhxRes get(String projectId) {
|
|
|
+ Tjyydhx tjyydhx = tjyydhxMapper.get(projectId);
|
|
|
+ Project project = projectMapper.get(projectId);
|
|
|
+
|
|
|
+ TjyydhxRes tjyydhxRes = new TjyydhxRes();
|
|
|
+ BeanUtils.copyProperties(tjyydhx, tjyydhxRes);
|
|
|
+ tjyydhxRes.setProjectName(project.getName());
|
|
|
+ tjyydhxRes.setProjectCode(project.getCode());
|
|
|
+ return tjyydhxRes;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void update(Tjyydhx tjyydhx) {
|
|
|
- tjyydhxMapper.update(tjyydhx);
|
|
|
+ public void update(TjyydhxUpdateVo tjyydhxUpdateVo) {
|
|
|
+ tjyydhxMapper.update(tjyydhxUpdateVo);
|
|
|
}
|
|
|
}
|