|
|
@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 手写信息采集表Service业务层处理
|
|
|
@@ -67,8 +68,9 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
|
|
|
@Override
|
|
|
public int insertHandwriteCollection(HandwriteCollection handwriteCollection)
|
|
|
{
|
|
|
- handwriteCollection.setCreateTime(new Date());
|
|
|
- handwriteCollection.setUpdateTime(new Date());
|
|
|
+ Date currentTime = DateUtils.getNowDate();
|
|
|
+ handwriteCollection.setCreateTime(currentTime);
|
|
|
+ handwriteCollection.setUpdateTime(currentTime);
|
|
|
handwriteCollection.setCreateBy(handwriteCollection.getCompanyUserId());
|
|
|
handwriteCollection.setUpdateBy(handwriteCollection.getCompanyUserId());
|
|
|
try {
|
|
|
@@ -96,7 +98,6 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
|
|
|
FsStoreOrderScrm fsStoreOrder=new FsStoreOrderScrm();
|
|
|
fsStoreOrder.setOrderCode(handwriteCollection.getOrderCode());
|
|
|
fsStoreOrder.setHandleCollectionId(handwriteCollection.getId());
|
|
|
- //TODO 需要设置推送订单表的状态为已绑定信息采集标识
|
|
|
return storeOrderScrmMapper.updateFsStoreOrderByOrderCode(fsStoreOrder);
|
|
|
}
|
|
|
|
|
|
@@ -108,15 +109,31 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int deleteHandwriteCollectionByIds(Integer[] ids)
|
|
|
{
|
|
|
+ //删除之前先去查询订单信息,将订单关联的的手写信息采集id设置为空
|
|
|
+ List<HandwriteCollection> handwriteCollectionList = handwriteCollectionMapper.selectHandwriteCollectionListByIds(ids);
|
|
|
+ if (CollectionUtils.isEmpty(handwriteCollectionList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ List<String> orderCodeList = handwriteCollectionList.stream().map(HandwriteCollection::getOrderCode).collect(Collectors.toList());
|
|
|
+ int result=storeOrderScrmMapper.updateStoreOrderScrmHandIdIsNullByOrderCodeList(orderCodeList);
|
|
|
return handwriteCollectionMapper.deleteHandwriteCollectionByIds(ids);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int deleteHandwriteCollectionById(Integer id)
|
|
|
{
|
|
|
- return handwriteCollectionMapper.deleteHandwriteCollectionById(id);
|
|
|
+ Integer[] ids = new Integer[]{id};
|
|
|
+ //删除之前先去查询订单信息,将订单关联的的手写信息采集id设置为空
|
|
|
+ List<HandwriteCollection> handwriteCollectionList = handwriteCollectionMapper.selectHandwriteCollectionListByIds(ids);
|
|
|
+ if (CollectionUtils.isEmpty(handwriteCollectionList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ List<String> orderCodeList = handwriteCollectionList.stream().map(HandwriteCollection::getOrderCode).collect(Collectors.toList());
|
|
|
+ int result=storeOrderScrmMapper.updateStoreOrderScrmHandIdIsNullByOrderCodeList(orderCodeList);
|
|
|
+ return handwriteCollectionMapper.deleteHandwriteCollectionByIds(ids);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -144,7 +161,7 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public CollectionOrcVO imageProcess(CollectionOrcParam collectionOrcParam) {
|
|
|
if (StringUtils.isEmpty(collectionOrcParam.getImgUrl())) {
|
|
|
log.error("图片地址不能为空!");
|