|
|
|
@ -1,13 +1,26 @@ |
|
|
|
|
package org.jeecg.modules.demo.project.service.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.modules.demo.departext.entity.DepartExt; |
|
|
|
|
import org.jeecg.modules.demo.departext.service.IDepartExtService; |
|
|
|
|
import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; |
|
|
|
|
import org.jeecg.modules.demo.project.entity.Project; |
|
|
|
|
import org.jeecg.modules.demo.project.mapper.ProjectMapper; |
|
|
|
|
import org.jeecg.modules.demo.project.service.IProjectService; |
|
|
|
|
import org.jeecg.modules.demo.userext.entity.UserExt; |
|
|
|
|
import org.jeecg.modules.demo.userext.service.IUserExtService; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Description: 项目表 |
|
|
|
|
* @Author: jeecg-boot |
|
|
|
@ -15,10 +28,43 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDepartExtService iDepartExtService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDepartService iSysDepartService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysUserService iSysUserService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IUserExtService iUserExtService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void save4shenbao(ProjectShenBaoDto dto) { |
|
|
|
|
System.out.println("dto = " + dto); |
|
|
|
|
log.info(">>> the 新增项目审报 reqParams:{}", JSON.toJSONString(dto)); |
|
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
// SysDepart sysDepart = new SysDepart();
|
|
|
|
|
DepartExt departExt = new DepartExt(); |
|
|
|
|
// SysUser sysUser = new SysUser();
|
|
|
|
|
UserExt userExt = new UserExt(); |
|
|
|
|
Project project = new Project(); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(dto, departExt); |
|
|
|
|
// BeanUtils.copyProperties(dto, sysDepart);
|
|
|
|
|
// BeanUtils.copyProperties(dto, sysUser);
|
|
|
|
|
BeanUtils.copyProperties(dto, userExt); |
|
|
|
|
BeanUtils.copyProperties(dto, project); |
|
|
|
|
|
|
|
|
|
//负责人
|
|
|
|
|
project.setProjectCharger(loginUser.getId()); |
|
|
|
|
this.save(project); |
|
|
|
|
userExt.setUserId(loginUser.getId()); |
|
|
|
|
this.iUserExtService.save(userExt); |
|
|
|
|
departExt.setDepartId(loginUser.getOrgId()); |
|
|
|
|
this.iDepartExtService.save(departExt); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|