|
@@ -11,9 +11,11 @@ import com.platform.dao.dto.preparation.PreparationDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
|
import com.platform.dao.entity.preparation.Preparation;
|
|
|
import com.platform.dao.entity.sb.SbPosition;
|
|
|
+import com.platform.dao.entity.upms.SysFile;
|
|
|
import com.platform.dao.enums.*;
|
|
|
import com.platform.dao.mapper.preparation.PreparationMapper;
|
|
|
import com.platform.dao.mapper.sb.SbPositionMapper;
|
|
|
+import com.platform.dao.mapper.upms.SysDeptMapper;
|
|
|
import com.platform.dao.mapper.upms.SysUserDeptMapper;
|
|
|
import com.platform.dao.mapper.upms.SysUserMapper;
|
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
@@ -53,6 +55,8 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
private SysUserMapper sysUserMapper;
|
|
|
@Resource
|
|
|
private SysFileService sysFileService;
|
|
|
+ @Resource
|
|
|
+ private SysDeptMapper sysDeptMapper;
|
|
|
|
|
|
@Override
|
|
|
public int batchDelete(List<String> ids) {
|
|
@@ -159,6 +163,36 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
mapper.updateByPrimaryKeySelective(updPre);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PreparationVO getVOById(String id) {
|
|
|
+ Preparation preparation = mapper.selectByPrimaryKey(id);
|
|
|
+ PreparationVO vo = BeanConverterUtil.copyObjectProperties(preparation,PreparationVO.class);
|
|
|
+ vo.setCompanyName(sbPositionMapper.selectNameById(vo.getParentPositionId()));
|
|
|
+ vo.setPositionName(sbPositionMapper.selectNameById(vo.getPositionId()));
|
|
|
+ if(!StringUtils.isEmpty(vo.getRepairUserId())){
|
|
|
+ vo.setRepairUserName(sysUserMapper.selectUserNameById(vo.getRepairUserId()));
|
|
|
+ }
|
|
|
+ vo.setDeptName(sysDeptMapper.selectByPrimaryKey(vo.getDepartId()).getName());
|
|
|
+ // 获取文件和图片
|
|
|
+ List<SysFile> sysFiles = sysFileService.getListByTargetAndType(id, null);
|
|
|
+ List<SysFile> imageList = ListUtils.newArrayList();
|
|
|
+ List<SysFile> fileList = ListUtils.newArrayList();
|
|
|
+ sysFiles.forEach(item -> {
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_IMGS.getValue())) {
|
|
|
+ imageList.add(item);
|
|
|
+ }
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_FILES.getValue())) {
|
|
|
+ fileList.add(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ vo.setImageList(imageList);
|
|
|
+ vo.setFileList(fileList);
|
|
|
+ if(!StringUtils.isEmpty(vo.getDispatchUserId())){
|
|
|
+ vo.setDispatchUserName(sysUserMapper.selectUserNameById(vo.getDispatchUserId()));
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
private String getParentPositionId(String positionId){
|
|
|
SbPosition sbPosition = sbPositionMapper.selectByPrimaryKey(positionId);
|
|
|
while(!StringUtils.isEmpty(sbPosition.getParentId())){
|