Commit 1b0183b5 authored by 廖旭伟's avatar 廖旭伟

测试bug修改

parent 4aa851e7
......@@ -44,6 +44,7 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.record.dao.ApplyLogDao;
import com.mortals.xhx.module.record.model.ApplyLogEntity;
import com.mortals.xhx.module.record.service.ApplyLogService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
......@@ -95,6 +96,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
orConditionList.add(condition2);
query.setOrConditionList(orConditionList);
}
query.setRecordStatus(YesNoEnum.NO.getValue());
return query;
}
......@@ -151,20 +153,21 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
}
@Override
@Transactional(rollbackFor = Exception.class)
public void generateOriginal(ApplyLogEntity applyLogEntity, Context context) throws AppException {
validData(applyLogEntity,context);
Long oldId = null;
boolean delete = false;
boolean is_record = false;
CertificateCatalogEntity catalog = certificateCatalogService.get(applyLogEntity.getCatalogId());
applyLogEntity.setCatalogCode(catalog.getCatalogCode());
applyLogEntity.setCatalogName(catalog.getCatalogName());
applyLogEntity.setFormTemplate(catalog.getFormContent());
DocTemplateVO docTemplate = new DocTemplateVO(catalog.getTemplateUrl(),applyLogEntity.getFormContent());
String paths = preview(docTemplate, context);
String[] vals = paths.split(";");
applyLogEntity.setCertificateUrl(vals[0]);
applyLogEntity.setPreviewUrl(vals[1]);
applyLogEntity.setCreateTime(new Date());
applyLogEntity.setRecordStatus(YesNoEnum.NO.getValue());
if(context!=null && context.getUser()!=null) {
applyLogEntity.setCreateUserId(context.getUser().getId());
}
......@@ -172,7 +175,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
if(applyLogEntity.getId()!=null && applyLogEntity.getRecordId()!=null){
applyLogEntity.setOperType(OperTypeEnum.UPDATE.getValue());
oldId = applyLogEntity.getId();
delete = true;
is_record = true;
RecordEntity recordEntity = new RecordEntity();
recordEntity.setId(applyLogEntity.getRecordId());
recordEntity.setUpdateUserId(applyLogEntity.getCreateUserId());
......@@ -191,8 +194,12 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
applyLogEntity.setRecordId(recordEntity.getId());
}
dao.insert(applyLogEntity);
if(delete){
dao.delete(oldId);
if(is_record){
ApplyLogEntity updata = new ApplyLogEntity();
updata.setId(oldId);
updata.setRecordStatus(YesNoEnum.YES.getValue());
updata.setUpdateTime(new Date());
dao.update(updata);
}
printWaitQueueService.creatWaitQueueByApply(applyLogEntity, GenerateStatus.ORIGINAL.getValue(),context);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment