feature:接口开票取开票组织的销项默认值

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

@ -442,8 +442,7 @@ 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(); DeptEntity deptEntityNew = null;
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) {
//选出默认项 //选出默认项
@ -451,6 +450,8 @@ 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));
deptEntityNew = new DeptEntity();
deptEntityNew.setDeptId(deptEntity.getDeptId());
deptEntityNew.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh()); deptEntityNew.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh());
//todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化 //todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化
deptEntityNew.setName(groupManagementEntity.getGroupName()); deptEntityNew.setName(groupManagementEntity.getGroupName());
@ -462,7 +463,7 @@ public class UserInfoServiceImpl implements UserInfoService {
deptEntityNew.setInvoiceName(groupManagementEntity.getXhfMc()); deptEntityNew.setInvoiceName(groupManagementEntity.getXhfMc());
deptEntityNew.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh()); deptEntityNew.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh());
} }
return deptEntity; return deptEntityNew;
} }

@ -222,13 +222,10 @@ 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.isNotNull(deptEntity) && StringUtils.isNotBlank(deptEntity.getDeptId())){ if(deptEntity != null){
deptEntity = userInfoService.querySysDeptEntity(deptEntity); deptEntity = userInfoService.querySysDeptEntity(deptEntity);
DdpcxxReqBO ddpcxxReq = BeanTransitionUtils.transitionPoKpReq(poCommonRequestParam,deptEntity); }
DdpcxxRspV5 ddpcxxRspV5 = interfaceServiceV6.generateQdInvoiceV6(ddpcxxReq, secretId, null); if(deptEntity == 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());
@ -238,6 +235,11 @@ public class InvoiceRestApiV6 {
poCommonResponseParam.setES_OUTPUT(esOutput); poCommonResponseParam.setES_OUTPUT(esOutput);
return JsonUtils.getInstance().toJsonString(poCommonResponseParam); return JsonUtils.getInstance().toJsonString(poCommonResponseParam);
} }
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)){
//订单和发票数据查询接口 //订单和发票数据查询接口
DdfpcxReqV5 ddfpcxReq = JsonUtils.getInstance().parseObject(reqStr, DdfpcxReqV5.class); DdfpcxReqV5 ddfpcxReq = JsonUtils.getInstance().parseObject(reqStr, DdfpcxReqV5.class);

Loading…
Cancel
Save