|
|
|
@ -55,7 +55,9 @@ import com.glxp.api.util.IntUtil;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import com.glxp.api.util.udi.UdiCalCountUtil;
|
|
|
|
|
import io.netty.util.internal.ThrowableUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
|
|
|
import org.apache.regexp.RE;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -849,8 +851,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
@Override
|
|
|
|
|
public void scanInvSfOrderGenerateSfOrder() {
|
|
|
|
|
log.info("扫描处理第三方收费明细生成单据定时任务开始");
|
|
|
|
|
// List<ThrInvOrderDetail> list = thrInvOrderDetailMapper.selectSourceTypeList(Constant.THR_INV_SF_ORDER_TYPE);
|
|
|
|
|
|
|
|
|
|
List<ThrInvOrder> thrInvOrders = thrInvOrderMapper.selectList(new LambdaQueryWrapper<ThrInvOrder>()
|
|
|
|
|
.eq(ThrInvOrder::getSourceType, Constant.THR_INV_SF_ORDER_TYPE)
|
|
|
|
|
.lt(ThrInvOrder::getGenStatus, 3));
|
|
|
|
@ -858,6 +858,15 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
if (CollUtil.isNotEmpty(thrInvOrders)) {
|
|
|
|
|
|
|
|
|
|
for (ThrInvOrder thrInvOrder : thrInvOrders) {
|
|
|
|
|
try {
|
|
|
|
|
ThrInvOrder temp = thrInvOrderMapper.selectById(thrInvOrder.getId());
|
|
|
|
|
if (temp.getGenStatus() < 3) {
|
|
|
|
|
thrInvOrder.setGenStatus(4);
|
|
|
|
|
thrInvOrderMapper.updateById(thrInvOrder);
|
|
|
|
|
} else {
|
|
|
|
|
//如果该单据还在生成中则跳过
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(
|
|
|
|
|
new LambdaQueryWrapper<ThrInvOrderDetail>()
|
|
|
|
|
.and(o -> o.isNull(ThrInvOrderDetail::getHandleStatus).or().ne(ThrInvOrderDetail::getHandleStatus, 1)).
|
|
|
|
@ -960,9 +969,14 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
|
|
|
|
|
genOrder(thrInvOrder, bussinessTypeEntity, updateThrInvOrderDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("生成单据异常", ExceptionUtils.getStackTrace(e));
|
|
|
|
|
thrInvOrder.setGenStatus(2);
|
|
|
|
|
thrInvOrder.setRemark(new Date() + "出现异常");
|
|
|
|
|
thrInvOrderMapper.updateById(thrInvOrder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1032,6 +1046,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
}
|
|
|
|
|
thrInvOrderDetailMapper.updateBatchById(thrInvOrderDetails);
|
|
|
|
|
thrInvOrder.setToBillNo(toBillNo);
|
|
|
|
|
thrInvOrder.setGenStatus(3);
|
|
|
|
|
thrInvOrderMapper.updateById(thrInvOrder);
|
|
|
|
|
ioOrderService.insertOrder(ioOrderEntity);
|
|
|
|
|
ioOrderDetailBizService.batchInsertBizs(newOrderDetailBiz);
|
|
|
|
|