在FI848添加税率修正代码,改正sap传输税率不正确的问题

release
路明慧 2 years ago
parent 130580e31e
commit 2effc74c75
  1. 2
      dxhy-common/src/main/java/com/dxhy/common/enums/KjkmTaxEnmu.java
  2. 5
      dxhy-core/src/main/java/com/dxhy/core/service/frJob/RecordToQueryServiceImpl.java
  3. 7
      dxhy-core/src/main/java/com/dxhy/core/service/frJob/VoucherRecordItemServiceImpl.java
  4. 2
      dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java
  5. 16
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/VoucherRecordServiceImpl.java

@ -1,4 +1,4 @@
package com.dxhy.core.enmu; package com.dxhy.common.enums;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;

@ -2,13 +2,10 @@ package com.dxhy.core.service.frJob;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.core.dao.frTask.RecordToQueryDao; import com.dxhy.core.dao.frTask.RecordToQueryDao;
import com.dxhy.core.enmu.KjkmTaxEnmu; import com.dxhy.common.enums.KjkmTaxEnmu;
import com.dxhy.core.entity.frJob.FpTaxAmount; import com.dxhy.core.entity.frJob.FpTaxAmount;
import com.dxhy.core.entity.frJob.VoucherRecordQuery; import com.dxhy.core.entity.frJob.VoucherRecordQuery;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

@ -1,17 +1,12 @@
package com.dxhy.core.service.frJob; package com.dxhy.core.service.frJob;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.core.dao.frTask.VoucherRecordItemDao; import com.dxhy.core.dao.frTask.VoucherRecordItemDao;
import com.dxhy.core.enmu.KjkmTaxEnmu; import com.dxhy.common.enums.KjkmTaxEnmu;
import com.dxhy.core.entity.frJob.VoucherRecordItemEntity; import com.dxhy.core.entity.frJob.VoucherRecordItemEntity;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

@ -1186,7 +1186,7 @@ public class InterfaceController extends AbstractController {
outPut.setES_OUTPUT(esOutPutResp); outPut.setES_OUTPUT(esOutPutResp);
return JsonUtils.getInstance().toJsonString(outPut); return JsonUtils.getInstance().toJsonString(outPut);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); log.error("FI848报错信息为:{}",e);
EsOutPutResp esOutPutResp = new EsOutPutResp(); EsOutPutResp esOutPutResp = new EsOutPutResp();
esOutPutResp.setBSKEY(requestParam.getIS_INPUT().getBSKEY()); esOutPutResp.setBSKEY(requestParam.getIS_INPUT().getBSKEY());
esOutPutResp.setSAPKEY(requestParam.getIS_INPUT().getSAPKEY()); esOutPutResp.setSAPKEY(requestParam.getIS_INPUT().getSAPKEY());

@ -1,5 +1,6 @@
package com.dxhy.erp.service.impl; package com.dxhy.erp.service.impl;
import com.dxhy.common.enums.KjkmTaxEnmu;
import com.dxhy.common.service.impl.MpBaseServiceImpl; import com.dxhy.common.service.impl.MpBaseServiceImpl;
import com.dxhy.erp.dao.VoucherRecordDao; import com.dxhy.erp.dao.VoucherRecordDao;
import com.dxhy.erp.dao.VoucherRecordItemDao; import com.dxhy.erp.dao.VoucherRecordItemDao;
@ -8,11 +9,13 @@ import com.dxhy.erp.entity.VoucherRecordItem;
import com.dxhy.erp.service.VoucherRecordItemService; import com.dxhy.erp.service.VoucherRecordItemService;
import com.dxhy.erp.service.VoucherRecordService; import com.dxhy.erp.service.VoucherRecordService;
import com.dxhy.erp.utils.DistributedKeyMaker; import com.dxhy.erp.utils.DistributedKeyMaker;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -101,7 +104,18 @@ public class VoucherRecordServiceImpl extends MpBaseServiceImpl<VoucherRecordDao
} }
this.saveBatch(newRecordList); this.saveBatch(newRecordList);
this.saveBatch(repeatRecordList); this.saveBatch(repeatRecordList);
b = voucherRecordItemService.inserBatch(addItems); //处理sap传输报文税率不正确问题
Map<String, String> taxMap = KjkmTaxEnmu.getTaxMap();
for (VoucherRecordItem addItem : addItems) {
if (StringUtils.isNotBlank(taxMap.get(addItem.getRacct()))) {
addItem.setKbetr(taxMap.get(addItem.getRacct()));
}
//将主营业务收入税率的格式统一为整数
if (StringUtils.isNotBlank(addItem.getRacct()) && addItem.getRacct().startsWith("6001")){
addItem.setKbetr(StringUtils.isBlank(addItem.getKbetr()) ? addItem.getKbetr() : new BigDecimal(addItem.getKbetr()).stripTrailingZeros().toString());
}
}
b = voucherRecordItemService.inserBatch(addItems);
} }
return b; return b;
} }

Loading…
Cancel
Save