feature:接口开票销方组织取订单的开票组织默认值,不取大B

release
gaorl 2 years ago
parent 75910cf06e
commit 74082994c6
  1. 20
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/thirdservice/user/service/impl/UserInfoServiceImpl.java
  2. 16
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java

@ -442,6 +442,8 @@ public class UserInfoServiceImpl implements UserInfoService {
public DeptEntity querySysDeptEntity(DeptEntity deptEntity) { public DeptEntity querySysDeptEntity(DeptEntity deptEntity) {
List<String> groupIdList = Lists.newArrayList(); List<String> groupIdList = Lists.newArrayList();
groupIdList.add(deptEntity.getDeptId()); groupIdList.add(deptEntity.getDeptId());
DeptEntity deptEntityNew = new DeptEntity();
deptEntityNew.setDeptId(deptEntity.getDeptId());
List<GroupManagementEntity> entityList = groupManagementService.queryByGroupIdList(groupIdList); List<GroupManagementEntity> entityList = groupManagementService.queryByGroupIdList(groupIdList);
if (entityList != null && entityList.size() > 0) { if (entityList != null && entityList.size() > 0) {
//选出默认项 //选出默认项
@ -449,16 +451,16 @@ public class UserInfoServiceImpl implements UserInfoService {
.filter(groupManagementEntity -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(groupManagementEntity.getDefaultItem())) .filter(groupManagementEntity -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(groupManagementEntity.getDefaultItem()))
.findFirst(); .findFirst();
GroupManagementEntity groupManagementEntity = groupManagementEntityOptional.orElseGet(() -> entityList.get(0)); GroupManagementEntity groupManagementEntity = groupManagementEntityOptional.orElseGet(() -> entityList.get(0));
deptEntity.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh()); deptEntityNew.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh());
//todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化 //todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化
deptEntity.setName(groupManagementEntity.getGroupName()); deptEntityNew.setName(groupManagementEntity.getGroupName());
deptEntity.setTaxpayerName(groupManagementEntity.getXhfMc()); deptEntityNew.setTaxpayerName(groupManagementEntity.getXhfMc());
deptEntity.setTaxpayerAddress(groupManagementEntity.getXhfDz()); deptEntityNew.setTaxpayerAddress(groupManagementEntity.getXhfDz());
deptEntity.setTaxpayerPhone(groupManagementEntity.getXhfDh()); deptEntityNew.setTaxpayerPhone(groupManagementEntity.getXhfDh());
deptEntity.setTaxpayerBank(groupManagementEntity.getXhfYh()); deptEntityNew.setTaxpayerBank(groupManagementEntity.getXhfYh());
deptEntity.setTaxpayerAccount(groupManagementEntity.getXhfZh()); deptEntityNew.setTaxpayerAccount(groupManagementEntity.getXhfZh());
deptEntity.setInvoiceName(groupManagementEntity.getXhfMc()); deptEntityNew.setInvoiceName(groupManagementEntity.getXhfMc());
deptEntity.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh()); deptEntityNew.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh());
} }
return deptEntity; return deptEntity;
} }

@ -222,7 +222,13 @@ public class InvoiceRestApiV6 {
PoCommonRequestParam poCommonRequestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class); PoCommonRequestParam poCommonRequestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class);
Map zData = JsonUtils.getInstance().parseObject(poCommonRequestParam.getIS_INPUT().getZDATA(), Map.class); Map zData = JsonUtils.getInstance().parseObject(poCommonRequestParam.getIS_INPUT().getZDATA(), Map.class);
DeptEntity deptEntity = userInfoService.querySysDeptEntityByEnterpriseNumbers(zData.get("BUKRS").toString()); DeptEntity deptEntity = userInfoService.querySysDeptEntityByEnterpriseNumbers(zData.get("BUKRS").toString());
if(ObjectUtil.isNull(deptEntity)){ if(ObjectUtil.isNotNull(deptEntity) && StringUtils.isNotBlank(deptEntity.getDeptId())){
deptEntity = userInfoService.querySysDeptEntity(deptEntity);
DdpcxxReqBO ddpcxxReq = BeanTransitionUtils.transitionPoKpReq(poCommonRequestParam,deptEntity);
DdpcxxRspV5 ddpcxxRspV5 = interfaceServiceV6.generateQdInvoiceV6(ddpcxxReq, secretId, null);
PoCommonResponseParam poCommonResponseParam = BeanTransitionUtils.transitionPoKpResp(ddpcxxRspV5);
returnJsonString = JsonUtils.getInstance().toJsonString(poCommonResponseParam);
}else{
PoCommonResponseParam poCommonResponseParam = new PoCommonResponseParam(); PoCommonResponseParam poCommonResponseParam = new PoCommonResponseParam();
EsOutput esOutput = new EsOutput(); EsOutput esOutput = new EsOutput();
esOutput.setBSKEY(poCommonRequestParam.getIS_INPUT().getBSKEY()); esOutput.setBSKEY(poCommonRequestParam.getIS_INPUT().getBSKEY());
@ -231,14 +237,6 @@ public class InvoiceRestApiV6 {
esOutput.setZMESSAGE("根据公司代码未查询到对应销方"); esOutput.setZMESSAGE("根据公司代码未查询到对应销方");
poCommonResponseParam.setES_OUTPUT(esOutput); poCommonResponseParam.setES_OUTPUT(esOutput);
return JsonUtils.getInstance().toJsonString(poCommonResponseParam); return JsonUtils.getInstance().toJsonString(poCommonResponseParam);
}else {
if(StringUtils.isBlank(deptEntity.getInvoiceNsrsbh()) && StringUtils.isNotBlank(deptEntity.getDeptId())){
deptEntity = userInfoService.querySysDeptEntity(deptEntity);
}
DdpcxxReqBO ddpcxxReq = BeanTransitionUtils.transitionPoKpReq(poCommonRequestParam,deptEntity);
DdpcxxRspV5 ddpcxxRspV5 = interfaceServiceV6.generateQdInvoiceV6(ddpcxxReq, secretId, null);
PoCommonResponseParam poCommonResponseParam = BeanTransitionUtils.transitionPoKpResp(ddpcxxRspV5);
returnJsonString = JsonUtils.getInstance().toJsonString(poCommonResponseParam);
} }
} else if (ConfigurerInfo.GETORDERINFOANDINVOICEINFO.equals(interfaceName)){ } else if (ConfigurerInfo.GETORDERINFOANDINVOICEINFO.equals(interfaceName)){
//订单和发票数据查询接口 //订单和发票数据查询接口

Loading…
Cancel
Save