ariesy 增加非空税号

release
yefei 2 years ago
parent da9738c17a
commit ccb2314755
  1. 168
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java

@ -43,14 +43,14 @@ import com.github.pagehelper.PageInfo;
* 手动勾选查询service实现类 * 手动勾选查询service实现类
* *
* @author kangzq * @author kangzq
* @date 2019年5月11日
* @version 1.0 * @version 1.0
* @date 2019年5月11日
*/ */
@SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"}) @SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"})
@Slf4j @Slf4j
@Service("baseInvoiceManualCheckService") @Service("baseInvoiceManualCheckService")
public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDxRecordInvoiceDao, BaseTDxRecordInvoice> public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDxRecordInvoiceDao, BaseTDxRecordInvoice>
implements BaseInvoiceManualCheckService { implements BaseInvoiceManualCheckService {
@Resource @Resource
private BaseTDxTaxCurrentDao baseTDxTaxCurrentDao; private BaseTDxTaxCurrentDao baseTDxTaxCurrentDao;
@Resource @Resource
@ -65,18 +65,18 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
@Override @Override
public String selectByManualCheck(Map<String, Object> pramsMap, int curr, int size) { public String selectByManualCheck(Map<String, Object> pramsMap, int curr, int size) {
long enter = System.currentTimeMillis(); long enter = System.currentTimeMillis();
log.info("入参是:{}",pramsMap); log.info("入参是:{}", pramsMap);
JSONObject json; JSONObject json;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try { try {
String company = (String)pramsMap.get("company"); String company = (String) pramsMap.get("company");
String menuId = (String)pramsMap.get("menuId"); String menuId = (String) pramsMap.get("menuId");
json = tabulateRedisService.getTabulateMenu(company, menuId); json = tabulateRedisService.getTabulateMenu(company, menuId);
List<BaseSggxCxRespVO> voList = new ArrayList<>(); List<BaseSggxCxRespVO> voList = new ArrayList<>();
List<String> gfshList = (List<String>)pramsMap.get("gfsh"); List<String> gfshList = (List<String>) pramsMap.get("gfsh");
log.info("购方税号{}",gfshList); log.info("购方税号{}", gfshList);
String qsflag = (String)pramsMap.get("qsflag"); String qsflag = (String) pramsMap.get("qsflag");
List<String> gfshList1 = new ArrayList<>(); List<String> gfshList1 = new ArrayList<>();
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap); List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap);
@ -88,7 +88,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
LocalDate localDate1 = localDate.plusMonths(1); LocalDate localDate1 = localDate.plusMonths(1);
LocalDate localDate2 = LocalDate.now(); LocalDate localDate2 = LocalDate.now();
if ("0".equals(cur.getTjStatus()) || "3".equals(cur.getTjStatus()) if ("0".equals(cur.getTjStatus()) || "3".equals(cur.getTjStatus())
|| localDate2.isBefore(localDate1)) { || localDate2.isBefore(localDate1)) {
gfshList1.add(cur.getTaxno()); gfshList1.add(cur.getTaxno());
} }
} }
@ -108,7 +108,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String hjse = "0"; String hjse = "0";
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectHj(pramsMap); List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectHj(pramsMap);
log.info("手工认证 查询统计信息耗时:{}",System.currentTimeMillis()-start); log.info("手工认证 查询统计信息耗时:{}", System.currentTimeMillis() - start);
BaseTDxRecordInvoice hjxx = hjList.get(0); BaseTDxRecordInvoice hjxx = hjList.get(0);
hjsl = hjxx.getSfygx(); hjsl = hjxx.getSfygx();
if (!"0".equals(hjsl)) { if (!"0".equals(hjsl)) {
@ -125,20 +125,20 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} }
} }
log.info("查询合计耗时:{}",System.currentTimeMillis()-enter); log.info("查询合计耗时:{}", System.currentTimeMillis() - enter);
PageHelper.startPage(curr, size); PageHelper.startPage(curr, size);
long start1 = System.currentTimeMillis(); long start1 = System.currentTimeMillis();
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectSggxcx(pramsMap); List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectSggxcx(pramsMap);
log.info("手工认证 查询列表信息耗时:{}",System.currentTimeMillis()-start1); log.info("手工认证 查询列表信息耗时:{}", System.currentTimeMillis() - start1);
PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList); PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList);
log.info("返回的列表为:{}",pageList); log.info("返回的列表为:{}", pageList);
log.info("查询耗时:{}",System.currentTimeMillis()-enter); log.info("查询耗时:{}", System.currentTimeMillis() - enter);
// 转化为页面展示对象 // 转化为页面展示对象
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (pageList.size() > 0) { if (pageList.size() > 0) {
List<Tax> taxList = (List<Tax>)pramsMap.get("taxList"); List<Tax> taxList = (List<Tax>) pramsMap.get("taxList");
List<String> taxnoList = new ArrayList<>(); List<String> taxnoList = new ArrayList<>();
if (taxList != null && taxList.size() > 0) { if (taxList != null && taxList.size() > 0) {
for (Tax tax : taxList) { for (Tax tax : taxList) {
@ -148,7 +148,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} }
} }
} }
List<Business> businessList = (List<Business>)pramsMap.get("business"); List<Business> businessList = (List<Business>) pramsMap.get("business");
int start = new Long(pageInfo.getStartRow()).intValue(); int start = new Long(pageInfo.getStartRow()).intValue();
for (int i = 0; i < pageList.size(); i++) { for (int i = 0; i < pageList.size(); i++) {
BaseSggxCxRespVO vo = new BaseSggxCxRespVO(); BaseSggxCxRespVO vo = new BaseSggxCxRespVO();
@ -163,17 +163,17 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setUpgradeStatus("0"); vo.setUpgradeStatus("0");
if (pageList.get(i).getDkTaxAmount() != null) { if (pageList.get(i).getDkTaxAmount() != null) {
vo.setDkse(AmountFormatUtil vo.setDkse(AmountFormatUtil
.fmtMicrometer(MathUtil.round(pageList.get(i).getDkTaxAmount().toString()))); .fmtMicrometer(MathUtil.round(pageList.get(i).getDkTaxAmount().toString())));
} else { } else {
vo.setDkse(AmountFormatUtil vo.setDkse(AmountFormatUtil
.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString()))); .fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString())));
} }
} }
String businessCode = pageList.get(i).getDeptId(); String businessCode = pageList.get(i).getDeptId();
String businessName = this.getBusinessName(businessCode, businessList); String businessName = this.getBusinessName(businessCode, businessList);
log.info("businessName={}",businessName); log.info("businessName={}", businessName);
vo.setVoucherNumber(pageList.get(i).getVoucherNumber()); vo.setVoucherNumber(pageList.get(i).getVoucherNumber());
vo.setSnVoucherNumber(pageList.get(i).getSnVoucherNumber()); vo.setSnVoucherNumber(pageList.get(i).getSnVoucherNumber());
vo.setImageNumber(pageList.get(i).getImageNumber()); vo.setImageNumber(pageList.get(i).getImageNumber());
@ -182,14 +182,14 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setId(String.valueOf(pageList.get(i).getId())); vo.setId(String.valueOf(pageList.get(i).getId()));
vo.setXh(String.valueOf(start + i)); vo.setXh(String.valueOf(start + i));
vo.setInvoiceAmount( vo.setInvoiceAmount(
AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getInvoiceAmount().toString()))); AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getInvoiceAmount().toString())));
vo.setInvoiceCode(pageList.get(i).getInvoiceCode()); vo.setInvoiceCode(pageList.get(i).getInvoiceCode());
vo.setInvoiceDate(sdf.format(pageList.get(i).getInvoiceDate())); vo.setInvoiceDate(sdf.format(pageList.get(i).getInvoiceDate()));
vo.setInvoiceNo(pageList.get(i).getInvoiceNo()); vo.setInvoiceNo(pageList.get(i).getInvoiceNo());
vo.setSettlementNo(pageList.get(i).getSettlementNo()); vo.setSettlementNo(pageList.get(i).getSettlementNo());
vo.setTaxAmount( vo.setTaxAmount(
AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString()))); AmountFormatUtil.fmtMicrometer(MathUtil.round(pageList.get(i).getTaxAmount().toString())));
vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,pageList.get(i).getInvoiceStatus())); vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, pageList.get(i).getInvoiceStatus()));
vo.setInvoiceType(pageList.get(i).getInvoiceType()); vo.setInvoiceType(pageList.get(i).getInvoiceType());
//报账单号和入账状态 //报账单号和入账状态
// vo.setInAccountStatus(pageList.get(i).getInvoiceStatus()); // vo.setInAccountStatus(pageList.get(i).getInvoiceStatus());
@ -201,28 +201,28 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setQsrq(sdf.format(pageList.get(i).getQsDate())); vo.setQsrq(sdf.format(pageList.get(i).getQsDate()));
} }
if (pageList.get(i).getQsType() != null) { if (pageList.get(i).getQsType() != null) {
vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE,pageList.get(i).getQsType())); vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE, pageList.get(i).getQsType()));
} }
vo.setQsr(pageList.get(i).getQsName()); vo.setQsr(pageList.get(i).getQsName());
} }
if (pageList.get(i).getQsStatus() != null) { if (pageList.get(i).getQsStatus() != null) {
vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS,pageList.get(i).getQsStatus())); vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS, pageList.get(i).getQsStatus()));
} }
log.info("inaccountStatus==>{}",pageList.get(i).getInAccountStatus()); log.info("inaccountStatus==>{}", pageList.get(i).getInAccountStatus());
if ("1".equals(pageList.get(i).getInAccountStatus())) { if ("1".equals(pageList.get(i).getInAccountStatus())) {
vo.setInAccountStatus("已入账"); vo.setInAccountStatus("已入账");
} else { } else {
vo.setInAccountStatus("未入账"); vo.setInAccountStatus("未入账");
} }
String suspendStatus = pageList.get(i).getSuspendStatus(); String suspendStatus = pageList.get(i).getSuspendStatus();
if ("1".equals(suspendStatus)){ if ("1".equals(suspendStatus)) {
vo.setSuspendStatus("是"); vo.setSuspendStatus("是");
}else { } else {
vo.setSuspendStatus("否"); vo.setSuspendStatus("否");
} }
vo.setSuspendDate(pageList.get(i).getSuspendDate()); vo.setSuspendDate(pageList.get(i).getSuspendDate());
vo.setBzr(pageList.get(i).getBzr()); vo.setBzr(pageList.get(i).getBzr());
vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,pageList.get(i).getPaymentStatus())); vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS, pageList.get(i).getPaymentStatus()));
vo.setPaymentDate(pageList.get(i).getPaymentDate()); vo.setPaymentDate(pageList.get(i).getPaymentDate());
vo.setGfmc(pageList.get(i).getGfName()); vo.setGfmc(pageList.get(i).getGfName());
vo.setXfmc(pageList.get(i).getXfName()); vo.setXfmc(pageList.get(i).getXfName());
@ -237,18 +237,18 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setSelect(true); vo.setSelect(true);
} }
log.info("手工勾选查询返回对象VO {}",vo); log.info("手工勾选查询返回对象VO {}", vo);
String invoiceStatus="07"; String invoiceStatus = "07";
if ( pageList.get(i).getInvoiceStatus() != null && !invoiceStatus.contains(pageList.get(i).getInvoiceStatus()) if (pageList.get(i).getInvoiceStatus() != null && !invoiceStatus.contains(pageList.get(i).getInvoiceStatus())
|| pageList.get(i).getInvoiceAmount() != null && pageList.get(i).getInvoiceAmount().compareTo(new BigDecimal(0)) < 0 || pageList.get(i).getInvoiceAmount() != null && pageList.get(i).getInvoiceAmount().compareTo(new BigDecimal(0)) < 0
|| pageList.get(i).getTaxAmount() != null && pageList.get(i).getTaxAmount().compareTo(new BigDecimal(0)) < 0) { || pageList.get(i).getTaxAmount() != null && pageList.get(i).getTaxAmount().compareTo(new BigDecimal(0)) < 0) {
vo.setSelect(false); vo.setSelect(false);
vo.setUpgradeStatus("0"); vo.setUpgradeStatus("0");
} }
String sign = (String) pramsMap.get("sign"); String sign = (String) pramsMap.get("sign");
if (!"88".equals(sign)){ if (!"88".equals(sign)) {
if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) { if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) {
vo.setSelect(false); vo.setSelect(false);
vo.setBkgxts("该发票税号已申请抵扣统计"); vo.setBkgxts("该发票税号已申请抵扣统计");
@ -271,7 +271,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
json.put("datalist", voList); json.put("datalist", voList);
} catch (Exception e) { } catch (Exception e) {
// 统一设置操作异常标识 // 统一设置操作异常标识
log.info("错误信息为:{}",e.getMessage()); log.info("错误信息为:{}", e.getMessage());
json = super.errorResult(e); json = super.errorResult(e);
} }
@ -281,19 +281,16 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
/** /**
* 根据businessCode获取对应名称用于页面显示 * 根据businessCode获取对应名称用于页面显示
* *
* @param businessCode * @param businessCode 业务单元
* 业务单元 * @param businessList 业务单元list
* @param businessList
* 业务单元list
* @return 返回 * @return 返回
*
*/ */
private String getBusinessName(String businessCode, List<Business> businessList) { private String getBusinessName(String businessCode, List<Business> businessList) {
String businessName = ""; String businessName = "";
if (!StringHelper.isBlank(businessCode) && businessList != null && businessList.size() > 0) { if (!StringHelper.isBlank(businessCode) && businessList != null && businessList.size() > 0) {
for (Business business : businessList) { for (Business business : businessList) {
if (!StringHelper.isBlank(business.getBusinessCode()) if (!StringHelper.isBlank(business.getBusinessCode())
&& business.getBusinessCode().equals(businessCode)) { && business.getBusinessCode().equals(businessCode)) {
businessName = StringHelper.trim(business.getBusinessName(), ""); businessName = StringHelper.trim(business.getBusinessName(), "");
break; break;
} }
@ -421,7 +418,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
tsflag = true; tsflag = true;
} else { } else {
LocalDate tjsj = LocalDate.of(Integer.parseInt(tjDate.substring(0, 4)), LocalDate tjsj = LocalDate.of(Integer.parseInt(tjDate.substring(0, 4)),
Integer.parseInt(tjDate.substring(4, 6)), Integer.parseInt(tjDate.substring(6, 8))); Integer.parseInt(tjDate.substring(4, 6)), Integer.parseInt(tjDate.substring(6, 8)));
if (tjsj.isBefore(localDate1)) { if (tjsj.isBefore(localDate1)) {
if (!taxList1.contains(cur.getTaxno())) { if (!taxList1.contains(cur.getTaxno())) {
tsxx1.append(cur.getTaxno()).append(" \n "); tsxx1.append(cur.getTaxno()).append(" \n ");
@ -449,21 +446,21 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
@Override @Override
public String inTellingCheck(Map<String, Object> pramsMap) { public String inTellingCheck(Map<String, Object> pramsMap) {
log.info("入参是:{}",pramsMap); log.info("入参是:{}", pramsMap);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
try { try {
String company = (String)pramsMap.get("company"); String company = (String) pramsMap.get("company");
String menuId = (String)pramsMap.get("menuId"); String menuId = (String) pramsMap.get("menuId");
if (StringUtils.isNotBlank(menuId)){ if (StringUtils.isNotBlank(menuId)) {
json = tabulateRedisService.getTabulateMenu(company, menuId); json = tabulateRedisService.getTabulateMenu(company, menuId);
} }
List<String> gfshList = (List<String>)pramsMap.get("gfsh"); List<String> gfshList = (List<String>) pramsMap.get("gfsh");
String sign = (String) pramsMap.get("sign"); String sign = (String) pramsMap.get("sign");
//如果有自己的税号则选择出在未申请抵扣的税号 //如果有自己的税号则选择出在未申请抵扣的税号
if (!"88".equals(sign)){ if (!"88".equals(sign)) {
List<String> gfshList1 = new ArrayList<>(); List<String> gfshList1 = new ArrayList<>();
if (gfshList.size() > 0) { if (gfshList.size() > 0) {
List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap); List<BaseTDxDkCount> curList = super.baseMapper.selectDksh(pramsMap);
@ -479,12 +476,12 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
gfshList1.add(cur.getTaxno()); gfshList1.add(cur.getTaxno());
} }
} }
if(ObjectUtils.isEmpty(gfshList1)|| gfshList1.size()==0){ if (ObjectUtils.isEmpty(gfshList1) || gfshList1.size() == 0) {
json.put("code","501"); json.put("code", "501");
json.put("message","税号已经申请抵扣"); json.put("message", "税号已经申请抵扣");
return super.responseResult(json); return super.responseResult(json);
}else { } else {
pramsMap.put("gfsh",gfshList1); pramsMap.put("gfsh", gfshList1);
} }
} else { } else {
json.put("code", "501"); json.put("code", "501");
@ -494,7 +491,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} }
String hjsl = "0"; String hjsl = "0";
String hjje = "0"; String hjje = "0";
String hjse = "0"; String hjse = "0";
@ -516,43 +512,43 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String isChooseAll = (String) pramsMap.get("isChooseAll"); String isChooseAll = (String) pramsMap.get("isChooseAll");
if ("N".equals(isChooseAll)){ if ("N".equals(isChooseAll)) {
int total = Integer.parseInt(hjsl); int total = Integer.parseInt(hjsl);
int curr = (int) pramsMap.get("curr"); int curr = (int) pramsMap.get("curr");
int size = (int) pramsMap.get("size"); int size = (int) pramsMap.get("size");
int totalPage = total % size == 0?total/size:total/size+1; int totalPage = total % size == 0 ? total / size : total / size + 1;
if (curr<1){ if (curr < 1) {
curr =1; curr = 1;
} }
if (curr>totalPage){ if (curr > totalPage) {
curr = totalPage; curr = totalPage;
} }
curr = (curr -1)*size; curr = (curr - 1) * size;
pramsMap.put("curr",curr); pramsMap.put("curr", curr);
} }
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectInTellingCheck(pramsMap); List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectInTellingCheck(pramsMap);
if (pageList == null || pageList.size() == 0){ if (pageList == null || pageList.size() == 0) {
json.put("message","无可操作的数据"); json.put("message", "无可操作的数据");
json.put("code","501"); json.put("code", "501");
return super.responseResult(json); return super.responseResult(json);
} }
PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList); PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList);
log.info("返回的列表为:{}",pageList); log.info("返回的列表为:{}", pageList);
// 转化为页面展示对象 // 转化为页面展示对象
List<BaseSggxCxRespVO> returnList = new ArrayList<>(); List<BaseSggxCxRespVO> returnList = new ArrayList<>();
//记录数量 //记录数量
int count = 1; int count = 1;
//税额上限 //税额上限
List<Business> businessList = (List<Business>)pramsMap.get("business"); List<Business> businessList = (List<Business>) pramsMap.get("business");
if (pageList.size() > 0) { if (pageList.size() > 0) {
List<Tax> taxList = (List<Tax>)pramsMap.get("taxList"); List<Tax> taxList = (List<Tax>) pramsMap.get("taxList");
List<String> taxnoList = new ArrayList<>(); List<String> taxnoList = new ArrayList<>();
if (taxList != null && taxList.size() > 0) { if (taxList != null && taxList.size() > 0) {
for (Tax tax : taxList) { for (Tax tax : taxList) {
@ -576,7 +572,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} catch (Exception e) { } catch (Exception e) {
// 统一设置操作异常标识 // 统一设置操作异常标识
log.info("错误信息为:{}",e.getMessage()); log.info("错误信息为:{}", e.getMessage());
json = super.errorResult(e); json = super.errorResult(e);
} }
@ -592,32 +588,34 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
Map<String, String> taxnoMap = taxnoList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, SysDeptEntity::getTaxno)); Map<String, String> taxnoMap = taxnoList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, SysDeptEntity::getTaxno));
Map<String, String> parentIdMap = parentIdList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, e -> e.getParentId() == null ? "" : e.getParentId())); Map<String, String> parentIdMap = parentIdList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, e -> e.getParentId() == null ? "" : e.getParentId()));
log.info("taxnoMap={},parentIdMap={}",taxnoMap,parentIdMap); log.info("taxnoMap={},parentIdMap={}", taxnoMap, parentIdMap);
String gfsh = ""; String gfsh = "";
for(String companyCode : companyCodes){ for (String companyCode : companyCodes) {
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>(); QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq("org_code",companyCode); wrapper.eq("org_code", companyCode);
SysDeptEntity sysDeptEntity = sysDeptAuthDao.selectOne(wrapper); List<SysDeptEntity> sysDeptEntityList = sysDeptAuthDao.selectList(wrapper);
if(sysDeptEntity != null) { SysDeptEntity sysDeptEntity = sysDeptEntityList.get(0);
if (sysDeptEntity != null) {
String dId = sysDeptEntity.getDeptId(); String dId = sysDeptEntity.getDeptId();
log.info("获取deptId为:{}",dId); log.info("获取deptId为:{}", dId);
if(StringUtils.isNotEmpty(dId)) { if (StringUtils.isNotEmpty(dId)) {
gfsh = getGfsh(dId, taxnoMap, parentIdMap); gfsh = getGfsh(dId, taxnoMap, parentIdMap);
gfshList.add(gfsh); if (StringUtils.isNotEmpty(gfsh))
gfshList.add(gfsh);
log.info("获取的税号为:{}", gfsh); log.info("获取的税号为:{}", gfsh);
} }
} }
} }
log.info("购方税号list为:{}",gfshList); log.info("购方税号list为:{}", gfshList);
return gfshList; return gfshList;
} }
private String getGfsh(String deptId,Map<String, String> taxnoMap,Map<String, String> parentIdMap) { private String getGfsh(String deptId, Map<String, String> taxnoMap, Map<String, String> parentIdMap) {
String taxno = ""; String taxno = "";
if(StringUtils.isNotEmpty(deptId)) { if (StringUtils.isNotEmpty(deptId)) {
log.info("deptId={}", deptId); log.info("deptId={}", deptId);
taxno = taxnoMap.get(deptId); taxno = taxnoMap.get(deptId);
@ -671,7 +669,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setSettlementNo(baseTDxRecordInvoice.getSettlementNo()); vo.setSettlementNo(baseTDxRecordInvoice.getSettlementNo());
vo.setTaxAmount( vo.setTaxAmount(
AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getTaxAmount().toString()))); AmountFormatUtil.fmtMicrometer(MathUtil.round(baseTDxRecordInvoice.getTaxAmount().toString())));
vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS,baseTDxRecordInvoice.getInvoiceStatus())); vo.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, baseTDxRecordInvoice.getInvoiceStatus()));
vo.setInvoiceType(baseTDxRecordInvoice.getInvoiceType()); vo.setInvoiceType(baseTDxRecordInvoice.getInvoiceType());
//报账单号和入账状态 //报账单号和入账状态
// vo.setInAccountStatus(pageList.get(i).getInvoiceStatus()); // vo.setInAccountStatus(pageList.get(i).getInvoiceStatus());
@ -683,25 +681,25 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
vo.setQsrq(sdf.format(baseTDxRecordInvoice.getQsDate())); vo.setQsrq(sdf.format(baseTDxRecordInvoice.getQsDate()));
} }
if (baseTDxRecordInvoice.getQsType() != null) { if (baseTDxRecordInvoice.getQsType() != null) {
vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE,baseTDxRecordInvoice.getQsType())); vo.setQsfs(dictdetaServcice.queryDictName(DictConstant.QS_TYPE, baseTDxRecordInvoice.getQsType()));
} }
vo.setQsr(baseTDxRecordInvoice.getQsName()); vo.setQsr(baseTDxRecordInvoice.getQsName());
} }
if (baseTDxRecordInvoice.getQsStatus() != null) { if (baseTDxRecordInvoice.getQsStatus() != null) {
vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS,baseTDxRecordInvoice.getQsStatus())); vo.setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS, baseTDxRecordInvoice.getQsStatus()));
} }
if ("1".equals(baseTDxRecordInvoice.getInAccountStatus())) { if ("1".equals(baseTDxRecordInvoice.getInAccountStatus())) {
vo.setInAccountStatus("已入账"); vo.setInAccountStatus("已入账");
} else { } else {
vo.setInAccountStatus("未入账"); vo.setInAccountStatus("未入账");
} }
if ("1".equals(vo.getSuspendStatus())){ if ("1".equals(vo.getSuspendStatus())) {
vo.setSuspendStatus("是"); vo.setSuspendStatus("是");
}else { } else {
vo.setSuspendStatus("否"); vo.setSuspendStatus("否");
vo.setSuspendDate(""); vo.setSuspendDate("");
} }
vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,baseTDxRecordInvoice.getPaymentStatus())); vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS, baseTDxRecordInvoice.getPaymentStatus()));
vo.setPaymentDate(baseTDxRecordInvoice.getPaymentDate()); vo.setPaymentDate(baseTDxRecordInvoice.getPaymentDate());
vo.setGfmc(baseTDxRecordInvoice.getGfName()); vo.setGfmc(baseTDxRecordInvoice.getGfName());
vo.setXfmc(baseTDxRecordInvoice.getXfName()); vo.setXfmc(baseTDxRecordInvoice.getXfName());

Loading…
Cancel
Save