|
|
|
@ -2,7 +2,6 @@ package com.djy.invoice.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.djy.core.http.HttpResult;
|
|
|
|
|
import com.djy.invoice.dto.*;
|
|
|
|
@ -734,6 +733,28 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 取消发票自助链接
|
|
|
|
|
*
|
|
|
|
|
* @param linkId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public HttpResult cancelLink(String linkId) {
|
|
|
|
|
log.info("取消发票链接:{}", linkId);
|
|
|
|
|
InvLinkInfo linkInfo = invLinkInfoMapper.getByGID(linkId);
|
|
|
|
|
if (linkInfo == null) {
|
|
|
|
|
log.info("取消发票链接返回:未找到数据{}",linkId);
|
|
|
|
|
return HttpResult.error(1001, "未找到相关数据");
|
|
|
|
|
} else if (!linkInfo.getStatus().equals(InvLinkInfo.StatusCreate)) {
|
|
|
|
|
log.info("取消发票链接返回:当前状态不能取消{}",linkId);
|
|
|
|
|
return HttpResult.error(1002, "当前状态不能取消");
|
|
|
|
|
} else {
|
|
|
|
|
clearLinkAll(linkId);
|
|
|
|
|
log.info("取消发票链接返回:操作成功{}",linkId);
|
|
|
|
|
return HttpResult.okWithMsg("操作成功");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Transactional
|
|
|
|
|
// @Override
|
|
|
|
|
//生成发票、发票明细、发票分配
|
|
|
|
@ -858,7 +879,7 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
|
|
|
|
|
List<InvBusinessInfo> businesses = new ArrayList<>();
|
|
|
|
|
for (String str : businessIds) {
|
|
|
|
|
InvBusinessInfo business = invBusinessInfoMapper.getById(str);
|
|
|
|
|
List<InvFeeInfo> list = invFeeInfoMapper.getListByBusinessIdAndLinkId(business.getGID(),link.getGID());
|
|
|
|
|
List<InvFeeInfo> list = invFeeInfoMapper.getListByBusinessIdAndLinkId(business.getGID(), link.getGID());
|
|
|
|
|
|
|
|
|
|
//获取人民币合计
|
|
|
|
|
List<InvFeeInfo> rmbfees = list.stream().filter(s -> s.getCurrency().equals("RMB")).filter(s -> s.getBusinessId().equals(str)).collect(Collectors.toList());
|
|
|
|
@ -1328,4 +1349,14 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
|
|
|
|
|
public void setUrlPath(String urlPath) {
|
|
|
|
|
InvLinkInfoServiceImpl.urlPath = urlPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//region 私有方法
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 清除发票自助链接相关的所有数据(业务信息会保留)
|
|
|
|
|
*/
|
|
|
|
|
private void clearLinkAll(String linkId) {
|
|
|
|
|
invLinkInfoMapper.clearInvLink(linkId);
|
|
|
|
|
}
|
|
|
|
|
//endregion
|
|
|
|
|
}
|
|
|
|
|