|
|
|
@ -6,6 +6,7 @@ import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.core.utils.StringUtils;
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.op.mes.domain.BaseFile;
|
|
|
|
|
import com.op.mes.domain.ProProcess;
|
|
|
|
|
import com.op.mes.mapper.BaseFileMapper;
|
|
|
|
|
import com.op.mes.mapper.ProProcessMapper;
|
|
|
|
@ -14,6 +15,7 @@ import com.op.mes.service.IProProcessService;
|
|
|
|
|
import com.op.system.api.RemoteUserService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
@ -43,7 +45,12 @@ public class ProProcessServiceImpl implements IProProcessService
|
|
|
|
|
@Override
|
|
|
|
|
public ProProcess selectProProcessByProcessId(String processId)
|
|
|
|
|
{
|
|
|
|
|
return proProcessMapper.selectProProcessByProcessId(processId);
|
|
|
|
|
ProProcess p = proProcessMapper.selectProProcessByProcessId(processId);
|
|
|
|
|
List<BaseFile> files = baseFileMapper.getBaseFileBatch(processId);
|
|
|
|
|
if(!CollectionUtils.isEmpty(files)){
|
|
|
|
|
p.setFiles(files);
|
|
|
|
|
}
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -108,6 +115,7 @@ public class ProProcessServiceImpl implements IProProcessService
|
|
|
|
|
for(String id:ids){
|
|
|
|
|
file = new BaseFileData();
|
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
|
file.setFileAddress(id);
|
|
|
|
|
file.setSourceId(proProcess.getProcessId());
|
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
@ -129,6 +137,26 @@ public class ProProcessServiceImpl implements IProProcessService
|
|
|
|
|
@Override
|
|
|
|
|
public int updateProProcess(ProProcess proProcess)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//上传附件
|
|
|
|
|
if(StringUtils.isNotEmpty(proProcess.getFileList())){
|
|
|
|
|
baseFileMapper.deleteBaseFileBySourceId(proProcess.getProcessId());
|
|
|
|
|
String[] ids = proProcess.getFileList().split(",");
|
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
|
BaseFileData file = null;
|
|
|
|
|
for(String id:ids){
|
|
|
|
|
file = new BaseFileData();
|
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
|
file.setFileAddress(id);
|
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
|
file.setSourceId(proProcess.getProcessId());
|
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
|
files.add(file);
|
|
|
|
|
}
|
|
|
|
|
baseFileMapper.insertBaseFileBatch(files);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
proProcess.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return proProcessMapper.updateProProcess(proProcess);
|
|
|
|
|
}
|
|
|
|
|