|
|
|
@ -13,8 +13,11 @@ import com.jianshui.invoice.domain.Invoice; |
|
|
|
|
import com.jianshui.invoice.domain.InvoiceDetail; |
|
|
|
|
import com.jianshui.invoice.domain.Redinfo; |
|
|
|
|
import com.jianshui.invoice.domain.Redinfodetail; |
|
|
|
|
import com.jianshui.invoice.domain.dto.HXResponse; |
|
|
|
|
import com.jianshui.invoice.factory.IInvoiceServiceFactory; |
|
|
|
|
import com.jianshui.invoice.mapper.InvoiceMapper; |
|
|
|
|
import com.jianshui.invoice.mapper.RedinfoMapper; |
|
|
|
|
import com.jianshui.invoice.service.IInvoiceApiService; |
|
|
|
|
import com.jianshui.platform.constant.ExceptionInformationConstants; |
|
|
|
|
import com.jianshui.platform.constant.RedWordConstants; |
|
|
|
|
import com.jianshui.invoice.domain.dto.FindRedWordDTO; |
|
|
|
@ -62,6 +65,9 @@ public class RedInformationServiceImpl implements RedInformationService { |
|
|
|
|
@Autowired |
|
|
|
|
private IServiceManageService serviceManageService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IInvoiceServiceFactory invoiceServiceFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 功能描述: 红字信息选择 |
|
|
|
@ -405,4 +411,35 @@ public class RedInformationServiceImpl implements RedInformationService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 功能描述: 红字信息表上传 |
|
|
|
|
* @param id |
|
|
|
|
* @return : com.jianshui.common.core.domain.AjaxResult |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse uploadRedWord(Long id) { |
|
|
|
|
// TODO 暂未开发完成
|
|
|
|
|
if (id == null){ |
|
|
|
|
return new HXResponse(ExceptionInformationConstants.REDWORDINFOISEMPT); |
|
|
|
|
} |
|
|
|
|
Redinfo redinfo = redinfoMapper.selectRedinfoById(id); |
|
|
|
|
if (redinfo == null){ |
|
|
|
|
return new HXResponse(ExceptionInformationConstants.NOTFINREDWORDINFO); |
|
|
|
|
} |
|
|
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
|
|
SysUser sysUser = sysUserMapper.selectUserById(userId); |
|
|
|
|
Companyservice companyservice = companyserviceMapper.selectCompanyserviceByCompanyid(sysUser.getCompanyId()); |
|
|
|
|
String serviceKey = null; |
|
|
|
|
HXResponse result; |
|
|
|
|
try { |
|
|
|
|
serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", sysUser.getCompanyId()); |
|
|
|
|
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey); |
|
|
|
|
result = invoiceService.uploadRedInfo(redinfo, companyservice); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("简税产品端,红字信息上传失败,企业税号={},servicekey={}",companyservice.toString(),serviceKey); |
|
|
|
|
throw new JianshuiServiceException("红字信息上传异常!"); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|