|
|
|
@ -19,6 +19,9 @@ import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.model.protocol.SpxxcxReqBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.service.CommodityService; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.service.VerifyCommodityCodeService; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.GroupTaxClassCodeMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.model.GroupTaxClassCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.service.TaxClassCodeService; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.rabbitmq.service.RabbitMqSendMessageService; |
|
|
|
@ -53,6 +56,8 @@ import com.dxhy.order.consumer.openapi.protocol.v4.fpslzb.SlzbxxCxReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpslzb.SlzbxxCxRspBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpyl.FpylcxReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpyl.FpylcxRspBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.grouptax.GroupTaxReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.grouptax.GroupTaxRespBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.invalid.ZfcxReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.invalid.ZfcxRspBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.invoice.*; |
|
|
|
@ -272,6 +277,13 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
private CommonDisposeService commonDisposeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GroupTaxClassCodeMapper groupTaxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 发票结果查询接口业务处理 |
|
|
|
|
* |
|
|
|
@ -1371,7 +1383,6 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果申请类别为空,根据申请说明补全
|
|
|
|
|
HzsqdscpcBO hzsqdscpc1 = hzsqdscReq.getHZSQDSCPC(); |
|
|
|
|
if (StringUtils.isBlank(hzsqdscpc1.getSQLB())) { |
|
|
|
@ -4886,10 +4897,11 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建全电订单信息bean |
|
|
|
|
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a> |
|
|
|
|
* @date 2022-10-20 |
|
|
|
|
* |
|
|
|
|
* @param ddfpzxx 订单发票全数据返回协议bean |
|
|
|
|
* @return java.util.List<com.dxhy.order.model.qd.OrderInfoQd> |
|
|
|
|
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a> |
|
|
|
|
* @date 2022-10-20 |
|
|
|
|
*/ |
|
|
|
|
private List<OrderInfoQd> buildOrderInfoQd(DdfpzxxBO ddfpzxx) { |
|
|
|
|
List<OrderInfoQd> orderInfoQdList = new ArrayList<>(5); |
|
|
|
@ -5308,4 +5320,105 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
ddfpdrRsp.setZTXX("接收请求成功,等待异步处理"); |
|
|
|
|
return ddfpdrRsp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 同步集团商品税编表 |
|
|
|
|
* |
|
|
|
|
* @param groupTaxReqBO |
|
|
|
|
* @param secretId |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public GroupTaxRespBO syncGroupTax(List<GroupTaxReqBO> groupTaxReqBO, String secretId) { |
|
|
|
|
GroupTaxRespBO resp = GroupTaxRespBO.build(OrderInfoContentEnum.SUCCESS); |
|
|
|
|
// 根据商品名称和和商品编码查下商品编码公司是否已经录入了物料编码
|
|
|
|
|
try { |
|
|
|
|
for (GroupTaxReqBO tempBO : groupTaxReqBO) { |
|
|
|
|
GroupTaxRespBO tempResp = syncGroupTax(tempBO, secretId); |
|
|
|
|
if (tempResp.isFailed()) { |
|
|
|
|
return tempResp; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
|
log.error("{}同步集团商品税编表异常", LOGGER_MSG_V4, e); |
|
|
|
|
resp.setZTDM(e.getCode()); |
|
|
|
|
resp.setZTXX(e.getMessage()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return resp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private GroupTaxRespBO syncGroupTax(GroupTaxReqBO groupTaxReqBO, String secretId) throws OrderReceiveException { |
|
|
|
|
if (StringUtils.isEmpty(groupTaxReqBO.getSpmc())) { |
|
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getKey(), OrderInfoContentEnum.SYNC_GROUP_TAX_009999.getMessage()); |
|
|
|
|
} |
|
|
|
|
GroupTaxRespBO groupTaxRespBO = new GroupTaxRespBO(); |
|
|
|
|
if (StringUtils.isNotBlank(secretId)) { |
|
|
|
|
String dbSecretId = commonDisposeService.getAuthMap(groupTaxReqBO.getNsrsbh()); |
|
|
|
|
if (!secretId.equals(dbSecretId)) { |
|
|
|
|
log.error("{}请求税号与企业维护secretId不一致!", LOGGER_MSG); |
|
|
|
|
groupTaxRespBO.setZTDM(OrderInfoContentEnum.SYNC_GROUP_TAX_009998.getKey()); |
|
|
|
|
groupTaxRespBO.setZTXX(OrderInfoContentEnum.SYNC_GROUP_TAX_009998.getMessage()); |
|
|
|
|
return groupTaxRespBO; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理、保存明细
|
|
|
|
|
// 先从集团群里查询税收分类编码是否存在
|
|
|
|
|
GroupTaxClassCodeEntity myEntity = groupTaxClassCodeMapper.selectGroupTaxClassCodeByNsrsbhAndCode(groupTaxReqBO.getNsrsbh(), groupTaxReqBO.getEncoding()); |
|
|
|
|
if (myEntity == null) { |
|
|
|
|
myEntity = new GroupTaxClassCodeEntity(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询税收分类编码
|
|
|
|
|
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCacheBySpmcOrMs(groupTaxReqBO.getSpmc()); |
|
|
|
|
if (taxClassCodeEntity == null) { |
|
|
|
|
log.info("syncGroupTax:{}税收分类编码不存在!", LOGGER_MSG); |
|
|
|
|
groupTaxRespBO.setZTDM(OrderInfoContentEnum.SYNC_GROUP_TAX_009997.getKey()); |
|
|
|
|
groupTaxRespBO.setZTXX(OrderInfoContentEnum.SYNC_GROUP_TAX_009997.getMessage()); |
|
|
|
|
return groupTaxRespBO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 维护GroupTaxClassCodeEntity 参考的GroupTaxClassCodeServiceImpl -> transtionGroupTaxClassCode
|
|
|
|
|
myEntity.setMerchandiseName(groupTaxReqBO.getSpmc()); |
|
|
|
|
myEntity.setEncoding(groupTaxReqBO.getEncoding()); |
|
|
|
|
//分组id
|
|
|
|
|
myEntity.setGroupId(null); |
|
|
|
|
//税收编码
|
|
|
|
|
myEntity.setTaxClassCode(taxClassCodeEntity.getSpbm()); |
|
|
|
|
//税收名称
|
|
|
|
|
myEntity.setTaxClassificationName(taxClassCodeEntity.getSpmc()); |
|
|
|
|
myEntity.setTaxClassAbbreviation(taxClassCodeEntity.getSpjc()); |
|
|
|
|
myEntity.setDescription(taxClassCodeEntity.getSm()); |
|
|
|
|
//规格型号
|
|
|
|
|
myEntity.setSpecificationModel(null); |
|
|
|
|
//计量单位
|
|
|
|
|
myEntity.setMeteringUnit(groupTaxReqBO.getUnit()); |
|
|
|
|
//单价
|
|
|
|
|
myEntity.setUnitPrice(null); |
|
|
|
|
//数据来源
|
|
|
|
|
myEntity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_5.getKey()); |
|
|
|
|
//匹配状态
|
|
|
|
|
myEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_0.getKey()); |
|
|
|
|
//数据状态
|
|
|
|
|
myEntity.setDataState(TaxClassCodeEnum.DATA_STATE_1.getKey()); |
|
|
|
|
//共享状态
|
|
|
|
|
myEntity.setShareState(TaxClassCodeEnum.SHARE_STATE_1.getKey()); |
|
|
|
|
myEntity.setDeptId(null); |
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(myEntity.getId())) { |
|
|
|
|
myEntity.setId(baseService.getGenerateShotKey()); |
|
|
|
|
myEntity.setCreateTime(new Date()); |
|
|
|
|
// 插入
|
|
|
|
|
groupTaxClassCodeMapper.insert(myEntity); |
|
|
|
|
} else { |
|
|
|
|
// 更新
|
|
|
|
|
groupTaxClassCodeMapper.updateByPrimaryKey(myEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
groupTaxRespBO.setZTDM(OrderInfoContentEnum.SYNC_GROUP_TAX_000000.getKey()); |
|
|
|
|
groupTaxRespBO.setZTXX(OrderInfoContentEnum.SYNC_GROUP_TAX_000000.getMessage()); |
|
|
|
|
return groupTaxRespBO; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|