|
|
@@ -12,6 +12,7 @@ import com.lc.ibps.bpmn.api.cmd.TaskFinishCmd;
|
|
|
import com.lc.ibps.bpmn.persistence.entity.BpmApprovePo;
|
|
|
import com.lc.ibps.bpmn.persistence.entity.BpmApproveTbl;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.cloud.file.provider.DownloadProvider;
|
|
|
import com.lc.ibps.cloud.file.provider.UploadProvider;
|
|
|
import com.lc.ibps.common.file.persistence.entity.AttachmentPo;
|
|
|
import com.lc.ibps.org.party.persistence.entity.DefaultPartyUserPo;
|
|
|
@@ -41,6 +42,9 @@ public class PatchService {
|
|
|
private UploadProvider uploadFile;
|
|
|
@Autowired
|
|
|
IdGenerator idGenerator;
|
|
|
+ @Autowired
|
|
|
+ private DownloadProvider downloadFile;
|
|
|
+
|
|
|
|
|
|
public void changCompleteTime(List<BpmApprovePo> approvals) {
|
|
|
if (Collections.isEmpty(approvals)) return;
|
|
|
@@ -202,11 +206,23 @@ public class PatchService {
|
|
|
|
|
|
if (result.getState() == 200 && BeanUtils.isNotEmpty(result.getData())) {
|
|
|
String kuaiZhaoId = result.getData().getId();
|
|
|
+ //先获取旧快照,在更新新快照ID后再删除旧快照
|
|
|
+ String sqlStr = "select kuai_zhao_ from "+boCode+" where id_='"+bizKey+"'";
|
|
|
+ String oldSnapShot = null;
|
|
|
+ List<Map<String, String>> oldSnapshotList = (List<Map<String, String>>) commonDao.query(sqlStr);
|
|
|
+ for(Map<String, String> oldSnapshotMap : oldSnapshotList){
|
|
|
+ String temp = oldSnapshotMap.get("kuai_zhao_");
|
|
|
+ oldSnapShot = (temp != null && !temp.isEmpty()) ? temp : null;
|
|
|
+ }
|
|
|
commonDao.execute("update "+boCode+" set kuai_zhao_='"+kuaiZhaoId+"' where id_='"+bizKey+"' ");
|
|
|
|
|
|
commonDao.execute("update t_bckzsjb set status_='1',kuai_zhao_='"+kuaiZhaoId+"' where id_='"+id+"'");
|
|
|
+ //删除旧快照
|
|
|
+ if (oldSnapShot != null) {
|
|
|
+ downloadFile.delete(new String[]{oldSnapShot});
|
|
|
+ }
|
|
|
+ logger.warn("Generated new Snapshot and delete old snapshot Success! {}_id={}, NewSnapShotID={},bckzsjb_id={},oldSnapShotID={}",boCode,bizKey,kuaiZhaoId,id,oldSnapShot );
|
|
|
|
|
|
- logger.warn("Generated Snapshot Success kuaiZhaoId={},id={}" + kuaiZhaoId,id );
|
|
|
success = success + 1;
|
|
|
}
|
|
|
}catch (Exception e){
|