Merge remote-tracking branch 'origin/test' into test

release
WangQi 2 years ago
commit 9287cdb4b6
  1. 1
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/service/impl/CommodityServiceImpl.java
  2. 2
      order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml
  3. 60
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java
  4. 11
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java

@ -134,6 +134,7 @@ public class CommodityServiceImpl implements CommodityService {
} }
if(StringUtils.isBlank(codeEntity.getYhzcbs())|| "0".equals(codeEntity.getYhzcbs())){ if(StringUtils.isBlank(codeEntity.getYhzcbs())|| "0".equals(codeEntity.getYhzcbs())){
codeEntity.setZzstsgl(""); codeEntity.setZzstsgl("");
codeEntity.setLslbs("");
} }
codeEntity.setXhfNsrsbh(null);//不更新税号 codeEntity.setXhfNsrsbh(null);//不更新税号
codeEntity.setModifyTime(new Date()); codeEntity.setModifyTime(new Date());

@ -297,7 +297,7 @@
<if test="commodityCode.ssflMc != null and commodityCode.ssflMc != ''"> <if test="commodityCode.ssflMc != null and commodityCode.ssflMc != ''">
tax_classification_name = #{commodityCode.ssflMc,jdbcType=VARCHAR}, tax_classification_name = #{commodityCode.ssflMc,jdbcType=VARCHAR},
</if> </if>
<if test="commodityCode.lslbs != null and commodityCode.lslbs != ''"> <if test="commodityCode.lslbs != null">
preferential_policies_type = #{commodityCode.lslbs,jdbcType=VARCHAR}, preferential_policies_type = #{commodityCode.lslbs,jdbcType=VARCHAR},
</if> </if>
<if test="commodityCode.zzstsgl != null"> <if test="commodityCode.zzstsgl != null">

@ -51,6 +51,7 @@ import com.dxhy.order.utils.JsonUtils;
import com.dxhy.order.utils.NsrsbhUtils; import com.dxhy.order.utils.NsrsbhUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -59,7 +60,6 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -173,7 +173,6 @@ public class InvoiceServiceImpl implements InvoiceService {
// if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ // if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
// return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); // return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
// } // }
String cpy = "";
String kcp = baseServiceConfig.getKcp(); String kcp = baseServiceConfig.getKcp();
boolean kcpMark; boolean kcpMark;
List<OrderItemInfo> cpyOrderItems = new ArrayList<OrderItemInfo>(); List<OrderItemInfo> cpyOrderItems = new ArrayList<OrderItemInfo>();
@ -301,34 +300,35 @@ public class InvoiceServiceImpl implements InvoiceService {
orderSplit.stream().forEach(splitEn -> { orderSplit.stream().forEach(splitEn -> {
List<OrderItemInfo> orderItemInfo = splitEn.getOrderItemInfo(); List<OrderItemInfo> orderItemInfo = splitEn.getOrderItemInfo();
orderItemInfo.stream().forEach(splitItem -> { orderItemInfo.stream().forEach(splitItem -> {
List<OrderItemInfo> collect = commonOrderInfo.getOrderItemInfo().stream().filter(oi -> oi.getXmmc().equals(splitItem.getXmmc()) && // List<OrderItemInfo> collect = commonOrderInfo.getOrderItemInfo().stream().filter(oi -> oi.getXmmc().equals(splitItem.getXmmc()) &&
((StrUtil.isBlank(oi.getGgxh()) && StrUtil.isBlank(splitItem.getGgxh())) || oi.getGgxh().equals(splitItem.getGgxh())) && // ((StrUtil.isBlank(oi.getGgxh()) && StrUtil.isBlank(splitItem.getGgxh())) || oi.getGgxh().equals(splitItem.getGgxh())) &&
((StrUtil.isBlank(oi.getXmdw()) && StrUtil.isBlank(splitItem.getXmdw())) || oi.getXmdw().equals(splitItem.getXmdw())) && // ((StrUtil.isBlank(oi.getXmdw()) && StrUtil.isBlank(splitItem.getXmdw())) || oi.getXmdw().equals(splitItem.getXmdw())) &&
((StrUtil.isBlank(oi.getSl()) && StrUtil.isBlank(splitItem.getSl())) || oi.getSl().equals(splitItem.getSl()))).collect(Collectors.toList()); // ((StrUtil.isBlank(oi.getSl()) && StrUtil.isBlank(splitItem.getSl())) || oi.getSl().equals(splitItem.getSl()))).collect(Collectors.toList());
if (collect.size() == 1) { // if (collect.size() == 1) {
List<RuleSplitEntity> ruleSplitEntityList = ruleSplitService.queryRuleSplit(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), pageInvoiceReq.getUserId()); // List<RuleSplitEntity> ruleSplitEntityList = ruleSplitService.queryRuleSplit(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), pageInvoiceReq.getUserId());
log.info("税号:{},用户ID:{},查询的拆分限额信息结果:{}", commonOrderInfo.getOrderInfo().getXhfNsrsbh(), // log.info("税号:{},用户ID:{},查询的拆分限额信息结果:{}", commonOrderInfo.getOrderInfo().getXhfNsrsbh(),
pageInvoiceReq.getUserId(), JsonUtils.getInstance().toJsonString(ruleSplitEntityList)); // pageInvoiceReq.getUserId(), JsonUtils.getInstance().toJsonString(ruleSplitEntityList));
String djce = ConfigureConstant.STRING_0; // String djce = ConfigureConstant.STRING_0;
if(ruleSplitEntityList.size() != 0){ // if(ruleSplitEntityList.size() != 0){
djce = StrUtil.isBlank(ruleSplitEntityList.get(0).getDjce())?ConfigureConstant.STRING_0:ruleSplitEntityList.get(0).getDjce(); // djce = StrUtil.isBlank(ruleSplitEntityList.get(0).getDjce())?ConfigureConstant.STRING_0:ruleSplitEntityList.get(0).getDjce();
} // }
if(ObjectUtil.isNotNull(collect.get(0).getXmdj()) && StrUtil.isNotBlank(collect.get(0).getXmdj()) && // if(ObjectUtil.isNotNull(collect.get(0).getXmdj()) && StrUtil.isNotBlank(collect.get(0).getXmdj()) &&
ObjectUtil.isNotNull(splitItem.getXmdj()) && StrUtil.isNotBlank(splitItem.getXmdj())){ // ObjectUtil.isNotNull(splitItem.getXmdj()) && StrUtil.isNotBlank(splitItem.getXmdj())){
BigDecimal abs = new BigDecimal(collect.get(0).getXmdj()).subtract(new BigDecimal(splitItem.getXmdj())).abs(); // BigDecimal abs = new BigDecimal(collect.get(0).getXmdj()).subtract(new BigDecimal(splitItem.getXmdj())).abs();
if (abs.compareTo(new BigDecimal(djce)) > 0) { // if (abs.compareTo(new BigDecimal(djce)) > 0) {
Map map = new HashMap(); // Map map = new HashMap();
map.put("ddh", commonOrderInfo.getOrderInfo().getDdh()); // map.put("ddh", commonOrderInfo.getOrderInfo().getDdh());
map.put("ghfMc", commonOrderInfo.getOrderInfo().getGhfMc()); // map.put("ghfMc", commonOrderInfo.getOrderInfo().getGhfMc());
map.put("xhfMc", commonOrderInfo.getOrderInfo().getXhfMc()); // map.put("xhfMc", commonOrderInfo.getOrderInfo().getXhfMc());
map.put("jshj", commonOrderInfo.getOrderInfo().getKphjje()); // map.put("jshj", commonOrderInfo.getOrderInfo().getKphjje());
djOverflowList.add(map); // djOverflowList.add(map);
} // }
} // }
} else { // }
log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size()); // else {
throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细"); // log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size());
} // throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
// }
}); });
}); });
} }

@ -2016,14 +2016,19 @@ public class OrderInfoServiceImpl implements OrderInfoService {
} }
List<OrderItemInfo> collect = null; List<OrderItemInfo> collect = null;
if(itemList != null){ if(itemList != null){
collect = orderItemInfos.stream().filter(t -> itemList.contains(t.getId()) && StringUtils.isNotBlank(t.getSpbm())).collect(Collectors.toList()); collect = orderItemInfos.stream().filter(t -> itemList.contains(t.getId()) && StringUtils.isBlank(t.getSpbm())).collect(Collectors.toList());
if(ObjectUtil.isNull(orderItemInfos)){ if(ObjectUtil.isNull(collect)){
return R.error("税收编码为空的不允许合并,请先更新税收编码"); return R.error("税收编码为空的不允许合并,请先更新税收编码");
} }
}else{ }else{
collect = orderItemInfos; 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())); Map<String, List<OrderItemInfo>> collect1 = collect.stream().map(t->{
t.setXmmc(StringUtils.isBlank(t.getXmmc())?"":t.getXmmc());
t.setXmdw(StringUtils.isBlank(t.getXmdw())?"":t.getXmdw());
t.setGgxh(StringUtils.isBlank(t.getGgxh())?"":t.getGgxh());
return t;
}).collect(Collectors.groupingBy(t -> t.getFphxz() + t.getXmmc() + t.getXmdw() + t.getGgxh() + t.getSl() + t.getSpbm()));
List<OrderItemInfo> orderItemInfoList = new ArrayList<>(); List<OrderItemInfo> orderItemInfoList = new ArrayList<>();
List<String> deleteItem = new ArrayList<>(); List<String> deleteItem = new ArrayList<>();
for (List<OrderItemInfo> value : collect1.values()) { for (List<OrderItemInfo> value : collect1.values()) {

Loading…
Cancel
Save