Merge remote-tracking branch 'origin/task_4631_wq' into release

# Conflicts:
#	order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java
release
WangQi 2 years ago
commit e9977aefc8
  1. 2
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/dao/BuyerMapper.java
  2. 5
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/model/BuyerEntity.java
  3. 5
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/model/BuyerImportExcel.java
  4. 5
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/model/BuyerImportExcelEnum.java
  5. 34
      order-management-base-service/src/main/resources/mybatis/mapper/BuyerMapper.xml
  6. 6
      order-management-common/src/main/java/com/dxhy/order/constant/OrderInfoEnum.java
  7. 5
      order-management-consumer/src/main/java/com/dxhy/order/consumer/model/OderDetailInfo.java
  8. 7
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/InvoiceService.java
  9. 47
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java
  10. 13
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/BuyerController.java
  11. 26
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderSplitController.java
  12. 13
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java
  13. BIN
      order-management-consumer/src/main/resources/download/BuyerExcel.xlsx
  14. 3
      升级sql/V1.0.5.sql

@ -106,4 +106,6 @@ public interface BuyerMapper {
* @return
*/
int insertBuyerByList(@Param("list") List<BuyerEntity> buyerEntityList);
BuyerEntity queryBuyerInfoByGhfIdAndEntId(@Param("ghfId") String ghfId, @Param("entId") String entId);
}

@ -140,4 +140,9 @@ public class BuyerEntity implements Serializable {
private String entId;
private String deptId;
/**
* 开票是否校验银行账号信息 0否 1是
*/
private String checkBankFlag;
}

@ -66,4 +66,9 @@ public class BuyerImportExcel {
private String ghfSjh;
private String khzt;
/**
* 开票是否校验银行账号信息 0否 1是
*/
private String checkBankFlag;
}

@ -75,6 +75,11 @@ public enum BuyerImportExcelEnum {
// private String status;
KH_ZT("客户状态", BuyerImportExcel.class.getDeclaredFields()[10].getName()),
/**
* 开票是否校验银行账号信息 0否 1是
*/
CHECK_BANK_FLAG("开票是否校验银行账号信息", BuyerImportExcel.class.getDeclaredFields()[11].getName()),
;

@ -27,6 +27,7 @@
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="sync_order" jdbcType="VARCHAR" property="syncOrder"/>
<result column="ent_id" jdbcType="VARCHAR" property="deptId"/>
<result column="check_bank_flag" jdbcType="VARCHAR" property="checkBankFlag"/>
<collection property="buyerEntityDetail" ofType="com.dxhy.order.baseservice.module.buyer.model.BuyerEntityDetail">
<id column="consumer_id" property="consumerId"/>
<result column="buyer_manage_id" jdbcType="VARCHAR" property="buyerManageId"/>
@ -149,7 +150,8 @@
bmid.phone as bmid_phone,
bmid.default_mark,
bmid.create_user,
bmid.update_user
bmid.update_user,
bmi.check_bank_flag
FROM
buyer_manage_info bmi left join buyer_manage_info_detail bmid on bmi.id = bmid.buyer_manage_id
@ -181,7 +183,8 @@
rownum as rowno,
status,
sync_order,
ent_id
ent_id,
check_bank_flag
FROM
buyer_manage_info
<where>
@ -312,6 +315,9 @@
<if test="buyer.deptId != null ">
ent_id = #{buyer.deptId,jdbcType=VARCHAR},
</if>
<if test="buyer.checkBankFlag != null ">
check_bank_flag = #{buyer.checkBankFlag,jdbcType=VARCHAR},
</if>
</set>
<where>
id = #{buyer.id,jdbcType=VARCHAR}
@ -406,6 +412,9 @@
<if test="buyer.deptId != null and buyer.deptId != ''">
ent_id = #{buyer.deptId,jdbcType=VARCHAR},
</if>
<if test="buyer.checkBankFlag != null ">
check_bank_flag = #{buyer.checkBankFlag,jdbcType=VARCHAR},
</if>
</set>
<where>
id in
@ -535,7 +544,9 @@
<if test="deptId != null">
ent_id,
</if>
<if test="checkBankFlag != null ">
check_bank_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -614,6 +625,10 @@
<if test="deptId != null">
#{deptId,jdbcType=VARCHAR},
</if>
<if test="checkBankFlag != null ">
#{checkBankFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@ -834,7 +849,8 @@
mdm_multicode_json,
status,
sync_order,
ent_id
ent_id,
check_bank_flag
)
values
<foreach collection="list" item="item" index="index"
@ -863,7 +879,8 @@
#{item.mdmMulticodeJson,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
#{item.syncOrder,jdbcType=VARCHAR},
#{item.entId,jdbcType=VARCHAR}
#{item.entId,jdbcType=VARCHAR},
#{item.checkBankFlag,jdbcType=VARCHAR}
)
</foreach>
</insert>
@ -1141,4 +1158,11 @@
</if>
</where>
</select>
<select id="queryBuyerInfoByGhfIdAndEntId"
resultMap="BaseResultMap">
select * from buyer_manage_info where buyer_code=#{ghfId} and ent_id=#{entId} order by modify_time desc limit 1
</select>
</mapper>

@ -1284,6 +1284,12 @@ public enum OrderInfoEnum {
INVOICE_REMARK_SET_BZDH("BZDH","报账单号"),
INVOICE_REMARK_SET_KB("KB","矿别"),
/**
*
* 开票是否校验银行账号信息 0否 1是
*/
CHECK_BANK_FLAG_YES("1", "是"),
CHECK_BANK_FLAG_NO("0", "否"),
;

@ -244,6 +244,9 @@ public class OderDetailInfo {
*/
private String xtly;
/**
* 开票是否校验银行账号信息 0否 1是
*/
private String checkBankFlag;
}

@ -109,4 +109,11 @@ public interface InvoiceService {
*/
R invalidAndReInvoice(Map mapList);
/**
* 校验购方银行账户
* @param buyerCode
* @param entId
*/
void checkBuyerCheckBankFlag(List<String> orderInfoIdList);
}

@ -14,6 +14,7 @@ import com.dxhy.order.baseservice.module.base.model.RuleSplitEntity;
import com.dxhy.order.baseservice.module.base.service.BaseService;
import com.dxhy.order.baseservice.module.base.service.DrawerInfoService;
import com.dxhy.order.baseservice.module.base.service.RuleSplitService;
import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper;
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity;
import com.dxhy.order.baseservice.module.buyer.service.BuyerService;
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper;
@ -32,6 +33,7 @@ import com.dxhy.order.consumer.utils.TaxSpecialPolicyUtil;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.invoice.config.InvoiceConfig;
import com.dxhy.order.invoice.module.fangge.service.FangGeService;
import com.dxhy.order.invoice.module.invoice.dao.OrderInfoMapper;
import com.dxhy.order.invoice.module.invoice.model.PageSld;
import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService;
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService;
@ -46,6 +48,7 @@ import com.dxhy.order.utils.JsonUtils;
import com.dxhy.order.utils.NsrsbhUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -132,6 +135,12 @@ public class InvoiceServiceImpl implements InvoiceService {
@Resource
private TaxClassCodeMapper taxClassCodeMapper;
@Autowired
private BuyerMapper buyerMapper;
@Autowired
private OrderInfoMapper orderInfoMapper;
@Override
@Transactional
@ -141,9 +150,14 @@ public class InvoiceServiceImpl implements InvoiceService {
List<CommonOrderInfo> commonOrderInfos = orderInfoService.batchQueryOrderInfoByOrderIdsAndNsrsbh(pageInvoiceItemList);
//购方是否为空、税编是否为空校验、成品油校验
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc())) {
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
}
checkBuyerCheckBankFlag(Arrays.asList(commonOrderInfo.getOrderInfo().getId()));
// if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
// return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
// }
String cpy = "";
String kcp = baseServiceConfig.getKcp();
boolean kcpMark;
@ -1507,4 +1521,35 @@ public class InvoiceServiceImpl implements InvoiceService {
}
}
@Override
@Transactional
public void checkBuyerCheckBankFlag(List<String> orderInfoIdList) {
orderInfoIdList.stream().forEach(id->{
OrderInfo orderInfo = orderInfoMapper.selectOrderInfoByOrderId(id, null);
BuyerEntity buyerEntity = buyerMapper.queryBuyerInfoByGhfIdAndEntId(orderInfo.getGhfId(), orderInfo.getEntId());
if (buyerEntity == null) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方信息为空,请补全!");
}
if (OrderInfoEnum.CHECK_BANK_FLAG_YES.getKey().equals(buyerEntity.getCheckBankFlag())) {
log.info("开始校验客户信息完整");
if (StrUtil.isBlank(orderInfo.getGhfNsrsbh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方纳税人识别号为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDz())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方地址为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方电话为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfYh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方开户行为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfZh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方银行账号为空,请补全!");
}
}
});
}
}

@ -191,10 +191,10 @@ public class BuyerController {
if(buyerEntity.getBuyerEntityDetail() != null && buyerEntity.getBuyerEntityDetail().size() > 0 ){
buyerEntity.getBuyerEntityDetail().forEach(t->{
if("0".equals(t.getDefaultMark())){
orderInfo.setGhfDz(StringUtils.isBlank(buyerEntity.getAddress())?null:buyerEntity.getAddress());
orderInfo.setGhfDh(StringUtils.isBlank(buyerEntity.getPhone())?null:buyerEntity.getPhone());
orderInfo.setGhfYh(StringUtils.isBlank(buyerEntity.getBankOfDeposit())?null:buyerEntity.getBankOfDeposit());
orderInfo.setGhfZh(StringUtils.isBlank(buyerEntity.getBankNumber())?null:buyerEntity.getBankNumber());
orderInfo.setGhfDz(StringUtils.isBlank(t.getAddress())?null:t.getAddress());
orderInfo.setGhfDh(StringUtils.isBlank(t.getPhone())?null:t.getPhone());
orderInfo.setGhfYh(StringUtils.isBlank(t.getBankName())?null:t.getBankName());
orderInfo.setGhfZh(StringUtils.isBlank(t.getBankAccount())?null:t.getBankAccount());
}
});
}
@ -307,6 +307,11 @@ public class BuyerController {
if("冻结".equals(buyerImportExcel.getKhzt())){
buyerEntity.setStatus("0");
}
// 开票是否校验银行账号信息 0否 1是
buyerEntity.setCheckBankFlag("0");
if ("是".equals(buyerImportExcel.getCheckBankFlag())) {
buyerEntity.setCheckBankFlag("1");
}
//购方名称 带中文括号的转换成英文括号
// 购方名称 带中文括号的转换成英文括号
buyerEntity.setPurchaseName(StringUtil.replaceStr(buyerEntity.getPurchaseName(), true));

@ -5,6 +5,7 @@ import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum;
import com.dxhy.order.constant.OrderManagementConstant;
import com.dxhy.order.consumer.modules.manager.service.InvoiceService;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.CommonOrderInfo;
import com.dxhy.order.model.OrderProcessInfo;
@ -23,11 +24,13 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -52,6 +55,9 @@ public class OrderSplitController {
@Resource
private OrderProcessService orderProcessService;
@Autowired
private InvoiceService invoiceService;
/**
* 根据开票项目拆分订单接口,对应前端-单据管理-单据详情-明细行拆分功能
@ -81,12 +87,15 @@ public class OrderSplitController {
if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
return r;
}
invoiceService.checkBuyerCheckBankFlag(orderIds);
orderSplitService.saveOrderSplitOrder(commonList);
return R.ok();
} catch (OrderReceiveException e) {
log.warn("{}订单拆分接口保存失败:{}", LOGGER_MSG, e);
return R.ok().put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage());
} catch (RuntimeException e) {
log.error("{}订单拆分接口异常,异常信息:{}", LOGGER_MSG, e);
return R.error(e.getMessage());
} catch (Exception e) {
log.error("{}订单拆分接口异常,异常信息:{}", LOGGER_MSG, e);
return R.error(e.getMessage());
@ -155,6 +164,7 @@ public class OrderSplitController {
if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
return r;
}
invoiceService.checkBuyerCheckBankFlag(orderIds);
/**
* 拆分订单
*/
@ -170,7 +180,12 @@ public class OrderSplitController {
log.error("{}订单多金额拆分异常:{}", LOGGER_MSG, e);
vo.put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage());
return vo;
} catch (Exception e) {
}catch (RuntimeException e) {
log.error("{}订单拆分异常:{}", LOGGER_MSG, e);
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey());
vo.put(OrderManagementConstant.MESSAGE, e.getMessage());
return vo;
}catch (Exception e) {
log.error("{}订单拆分异常:{}", LOGGER_MSG, e);
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey());
vo.put(OrderManagementConstant.MESSAGE, OrderInfoContentEnum.RECEIVE_FAILD.getMessage());
@ -208,7 +223,7 @@ public class OrderSplitController {
log.error("{},请求税号为空!", LOGGER_MSG);
return R.error(OrderInfoContentEnum.TAXCODE_ISNULL);
}
invoiceService.checkBuyerCheckBankFlag(Arrays.asList(orderId));
List<String> shList = NsrsbhUtils.transShListByXhfNsrsbh(xhfNsrsbh);
OrderSplitConfig config = new OrderSplitConfig();
config.setSplitType(OrderSplitEnum.ORDER_SPLIT_TYPE_3.getKey());
@ -222,6 +237,11 @@ public class OrderSplitController {
vo.put(OrderManagementConstant.CODE, e.getCode());
vo.put(OrderManagementConstant.MESSAGE, e.getMessage());
return vo;
} catch (RuntimeException e) {
log.error("{}订单拆分异常:{}", LOGGER_MSG, e);
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey());
vo.put(OrderManagementConstant.MESSAGE, e.getMessage());
return vo;
} catch (Exception e) {
log.error("{}订单拆分异常:{}", LOGGER_MSG, e);
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey());

@ -11,6 +11,7 @@ import com.dxhy.base.utils.PriceTaxSeparationUtilNew;
import com.dxhy.common.generatepdf.util.EwmUtil;
import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.base.service.BaseService;
import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper;
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity;
import com.dxhy.order.baseservice.module.buyer.service.BuyerService;
import com.dxhy.order.baseservice.module.commodity.dao.CommodityMapper;
@ -63,6 +64,7 @@ import com.dxhy.order.model.qdsk.taxpayerinfo.Qdjcxx;
import com.dxhy.order.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -175,6 +177,9 @@ public class OrderInfoServiceImpl implements OrderInfoService {
@Resource
private GsClientMapper gsClientMapper;
@Autowired
private BuyerMapper buyerMapper;
@Resource
private BaseService baseService;
@ -261,6 +266,14 @@ public class OrderInfoServiceImpl implements OrderInfoService {
oderDetailInfo = this.convertOderDetailInfo(orderProcessInfo, orderItemList, orderInfo, pageOrderExts, orderInvoiceInfo);
BuyerEntity buyerEntity = buyerMapper.queryBuyerInfoByGhfIdAndEntId(orderInfo.getGhfId(), orderInfo.getEntId());
if (buyerEntity == null) {
log.error("{}查询原始订单客户信息为空,id为:{}", LOGGER_MSG, orderProcessInfo.getOrderInfoId());
oderDetailInfo.setCheckBankFlag(OrderInfoEnum.CHECK_BANK_FLAG_YES.getKey());
} else {
oderDetailInfo.setCheckBankFlag(buyerEntity.getCheckBankFlag());
}
/**
* 如果是机动车,返回机动车信息

@ -0,0 +1,3 @@
-- 任务4631 客户信息增加校验银行信息开关
ALTER TABLE buyer_manage_info add check_bank_flag VARCHAR(1) DEFAULT '0' COMMENT '开票是否校验银行账号信息 0否 1是';
Loading…
Cancel
Save