|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.dxhy.base.constant.OrderSeparationException; |
|
|
|
|
import com.dxhy.base.constant.TaxSeparateConfig; |
|
|
|
|
import com.dxhy.base.utils.PriceTaxSeparationUtilNew; |
|
|
|
@ -1855,15 +1856,20 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R mergeOrderItem(String entId, String orderInfoId,List<String> itemList){ |
|
|
|
|
public R mergeOrderItem(String entId, String orderInfoId,List<String> itemList) throws Exception{ |
|
|
|
|
|
|
|
|
|
List<OrderItemInfo> orderItemInfos = orderItemInfoMapper.selectAllByOrderId(Arrays.asList(orderInfoId), null); |
|
|
|
|
if(ObjectUtil.isNull(orderItemInfos)){ |
|
|
|
|
return R.error("根据订单号未查询到明细行信息"); |
|
|
|
|
} |
|
|
|
|
List<OrderItemInfo> collect = orderItemInfos.stream().filter(t -> itemList.contains(t.getId()) && StringUtils.isNotBlank(t.getSpbm())).collect(Collectors.toList()); |
|
|
|
|
if(ObjectUtil.isNull(orderItemInfos)){ |
|
|
|
|
return R.error("税收编码为空的不允许合并,请先更新税收编码"); |
|
|
|
|
List<OrderItemInfo> collect = null; |
|
|
|
|
if(itemList != null){ |
|
|
|
|
collect = orderItemInfos.stream().filter(t -> itemList.contains(t.getId()) && StringUtils.isNotBlank(t.getSpbm())).collect(Collectors.toList()); |
|
|
|
|
if(ObjectUtil.isNull(orderItemInfos)){ |
|
|
|
|
return R.error("税收编码为空的不允许合并,请先更新税收编码"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
collect = orderItemInfos; |
|
|
|
|
} |
|
|
|
|
Map<String, List<OrderItemInfo>> collect1 = collect.stream().collect(Collectors.groupingBy(t -> t.getFphxz() + t.getXmmc() + t.getXmdw() + t.getGgxh() + t.getSl() + t.getSpbm())); |
|
|
|
|
List<OrderItemInfo> orderItemInfoList = new ArrayList<>(); |
|
|
|
@ -1928,6 +1934,26 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R batchMegerOrderItem(List<JSONObject> jsonObjects){ |
|
|
|
|
for (JSONObject t : jsonObjects) { |
|
|
|
|
String orderInfoId = t.getString("orderInfoId"); |
|
|
|
|
String entId = t.getString("entId"); |
|
|
|
|
String ddh = t.getString("ddh"); |
|
|
|
|
try { |
|
|
|
|
R r = mergeOrderItem(orderInfoId, entId, null); |
|
|
|
|
if(!ConfigureConstant.STRING_0000.equals(r.getCode())){ |
|
|
|
|
return R.error("结算单号{}明细行合并失败",ddh); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("批量合并报错orderInfoId:{},entId:{},报错信息:{}",orderInfoId,entId,e.getMessage()); |
|
|
|
|
return R.error("结算单号{}明细行合并失败",ddh); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(readOnly = true) |
|
|
|
|
public Boolean checkInvoiceRemarksFlag(String xfnsrsbh, String ghfId) { |
|
|
|
|