|
|
@@ -5,6 +5,7 @@ import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.jpsoft.employment.modules.base.dao.StudentAspirationsDAO;
|
|
|
import com.jpsoft.employment.modules.base.entity.StudentAspirations;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -21,6 +22,9 @@ public class WishInfoServiceImpl implements WishInfoService {
|
|
|
@Resource(name="wishInfoDAO")
|
|
|
private WishInfoDAO wishInfoDAO;
|
|
|
|
|
|
+ @Resource(name="studentAspirationsDAO")
|
|
|
+ private StudentAspirationsDAO studentAspirationsDAO;
|
|
|
+
|
|
|
@Override
|
|
|
public WishInfo get(String id) {
|
|
|
// TODO Auto-generated method stub
|
|
|
@@ -47,6 +51,8 @@ public class WishInfoServiceImpl implements WishInfoService {
|
|
|
studentAspirations.setCreateBy(model.getCreateBy());
|
|
|
studentAspirations.setWishInfoId(model.getId());
|
|
|
|
|
|
+
|
|
|
+ studentAspirationsDAO.insert(studentAspirations);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -59,6 +65,37 @@ public class WishInfoServiceImpl implements WishInfoService {
|
|
|
return wishInfoDAO.update(model);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int updateAndAspirations(WishInfo model){
|
|
|
+ int count = wishInfoDAO.update(model);
|
|
|
+ if(count>0){
|
|
|
+ List<StudentAspirations> curStudentAspirationsList = studentAspirationsDAO.findByWish(model.getId());
|
|
|
+
|
|
|
+ for (StudentAspirations studentAspirations:curStudentAspirationsList) {
|
|
|
+ studentAspirations.setDelFlag(true);
|
|
|
+ studentAspirations.setUpdateBy(model.getUpdateBy());
|
|
|
+ studentAspirations.setUpdateTime(model.getUpdateTime());
|
|
|
+
|
|
|
+ studentAspirationsDAO.update(studentAspirations);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StudentAspirations> newStudentAspirationsList = model.getStudentAspirationsList();
|
|
|
+
|
|
|
+ for (StudentAspirations studentAspirations:newStudentAspirationsList) {
|
|
|
+ studentAspirations.setId(UUID.randomUUID().toString());
|
|
|
+ studentAspirations.setDelFlag(false);
|
|
|
+ studentAspirations.setCreateTime(model.getCreateTime());
|
|
|
+ studentAspirations.setCreateBy(model.getCreateBy());
|
|
|
+ studentAspirations.setWishInfoId(model.getId());
|
|
|
+
|
|
|
+ studentAspirationsDAO.insert(studentAspirations);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return count;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int delete(String id) {
|
|
|
// TODO Auto-generated method stub
|