Merge remote-tracking branch 'origin/release' into release

# Conflicts:
#	dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
release
yefei 2 years ago
commit 8872cacd9f
  1. 1
      dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java
  2. 1
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java
  3. 8
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java
  4. 18
      dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java
  5. 2
      dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java
  6. 4
      dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml
  7. 8
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  8. 21
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  9. 2
      dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java
  10. 2
      dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml

@ -88,5 +88,6 @@ public interface EmailMaintainDao extends BaseMapper<EmailMaintainVo> {
String getUserName(@Param("userCode") String userCode);
String getUserByUsername(@Param("username") String username);
}

@ -49,6 +49,7 @@ public interface EmailMaintainService {
boolean deleteById(String id);
String getUserName(String userCode);
String getUserByUsername(String username);
int insertBatch(List<EmailMaintainVo> entities);

@ -99,6 +99,7 @@ public class EmailMaintainServiceImpl implements EmailMaintainService {
*/
@Override
public boolean update(EmailMaintainVo emailMaintain) {
DynamicContextHolder.push(DbConstant.BASICS_WRITE);
emailMaintain.setModifyTime(new Date());
int update = this.emailMaintainDao.update(emailMaintain);
return update > 0 ;
@ -121,6 +122,13 @@ public class EmailMaintainServiceImpl implements EmailMaintainService {
return emailMaintainDao.getUserName(userCode);
}
@Override
public String getUserByUsername(String username) {
DynamicContextHolder.push("business_itax_read");
return emailMaintainDao.getUserByUsername(username);
}
@Override
public int insertBatch(List<EmailMaintainVo> entities) {
return emailMaintainDao.insertBatch(entities);

@ -150,6 +150,10 @@ public class SnEmailGatherTask {
String uid = inbox.getUID(msg);
if(StringUtils.isBlank(maintainVo.getEmailUid()) && i+1 == messages.length){
emailMaintainVo.setEmailUid(uid);
buildEmailMaintainVo(emailMaintainVo);
} else if(i+1 == messages.length){
emailMaintainVo.setEmailUid(uid);
buildEmailMaintainVo(emailMaintainVo);
}
//增量处理 等于之后就跳过本地循环
if(StringUtils.isNotBlank(maintainVo.getEmailUid()) && maintainVo.getEmailUid().equals(uid)){
@ -163,6 +167,12 @@ public class SnEmailGatherTask {
List<Map<String, String>> mapList = Lists.newArrayList();
EmailParseUtils.saveAttachment(msg, mapList);
log.debug("获取附件的数量:"+mapList.size());
if(StringUtils.isNotEmpty(maintainVo.getUserId())){
String username = emailMaintainService.getUserByUsername(maintainVo.getUserId());
if(StringUtils.isNotEmpty(username)){
maintainVo.setUserId(username);
}
}
for (Map<String, String> map : mapList) {
map.put("emailName",emailName);
String pdfStream = map.get("pdfStream");
@ -223,13 +233,18 @@ public class SnEmailGatherTask {
}
}
public void buildEmailMaintainVo(EmailMaintainVo emailMaintainVo){
emailMaintainService.update(emailMaintainVo);
}
public void buildMsg(MailGatherLogVo gatherLogVo, String type, String msg){
gatherLogVo.setOcrType(type);
gatherLogVo.setErrorMsg(msg);
mailGatherLogService.insert(gatherLogVo);
}
public static Map<String, Object> convertToOcrResult(List<OpenServiceOcr> openServiceOcrs, Map<String, String> map,EmailMaintainVo maintainVo){
public Map<String, Object> convertToOcrResult(List<OpenServiceOcr> openServiceOcrs, Map<String, String> map,EmailMaintainVo maintainVo){
List<OcrResultToyxVo> resultToyxVoList = Lists.newArrayList();
Map<String, Object> hashMap = Maps.newHashMap();
String batchId = String.valueOf(System.currentTimeMillis());
@ -251,7 +266,6 @@ public class SnEmailGatherTask {
resultToyxVo.setFileByte(map.get("pdfStream"));
resultToyxVo.setEmail(map.get("emailName"));
resultToyxVo.setEmployeeId(maintainVo.getUserId());
resultToyxVoList.add(resultToyxVo);
}
hashMap.put("list",resultToyxVoList);

@ -39,8 +39,6 @@ class SnEmailGatherTaskTest {
String mail_host = "mail.pop3.host";
String emailName = "745139984@qq.com";
String password = "ncmydeiilzyabfgb";
// String emailName = "15201210373@163.com";
// String password = "JKZATQTPHDDQTQSH";
String mailSuffix = emailName.split("@")[1];
//邮箱类型
String mailType = mailSuffix.split("\\.")[0];

@ -165,6 +165,10 @@
select username from sys_user where loginname = #{userCode}
</select>
<select id="getUserByUsername" resultType="java.lang.String">
select code from sys_user where username = #{username}
</select>
<select id="selectByEmail" resultType="java.lang.Integer">
select count(1) from email_maintain where email_address = #{email}
</select>

@ -401,6 +401,7 @@ public class SDNYMainProcessController extends AbstractController {
log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode));
String company = orgByCompCode.getCompany();
String taxno = orgByCompCode.getTaxno();
String taxname = orgByCompCode.getTaxname();
String result = "";
@ -414,6 +415,7 @@ public class SDNYMainProcessController extends AbstractController {
TDxInvoiceReimburse reimburse = new TDxInvoiceReimburse();
reimburse.setImageId(imageId);
reimburse.setCompCode(compCode);
reimburse.setGfName(taxname);
SNSAPObject object = new SNSAPObject();
object.setSYSID("FPXT");
@ -439,6 +441,12 @@ public class SDNYMainProcessController extends AbstractController {
for (SNInvoice invoice : invoiceInfoList) {
String fplxdm = "";
String snFplx = "";
if (invoice.getPurchaserTaxNo() == null || "".equals(invoice.getPurchaserTaxNo())){
invoice.setPurchaserTaxNo(taxno);
}
if (invoice.getPurchaserName() == null || "".equals(invoice.getPurchaserName())){
invoice.setPurchaserName(taxname);
}
result = snPushCheckRecordService.updateInvoicePoll(company, taxno, reimburse, invoice, fplxdm, imageId, compCode);
//价税分离判断

@ -137,8 +137,9 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
String kprq = snInvoice.getBillingDate();
String je = snInvoice.getTotalAmount();
String amountTax = snInvoice.getAmountTax();
String xfsh = snInvoice.getSalesTaxNo();
String se = snInvoice.getAmountTax();
String se = snInvoice.getTotalTax();
String gfsbh = snInvoice.getPurchaserTaxNo();
String gfmc = snInvoice.getPurchaserName();
String invoiceType = snInvoice.getInvoiceType();
@ -161,11 +162,27 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (se != null) {
recordInvoice.setTaxAmount(new BigDecimal(se));
}
if (amountTax != null){
recordInvoice.setTotalAmount(new BigDecimal(amountTax));
}
recordInvoice.setXfTaxNo(xfsh);
recordInvoice.setGfTaxNo(gfsbh);
recordInvoice.setGfName(gfmc);
recordInvoice.setCreateDate(new Date().toString());
// recordInvoice.setGfTaxNo(gfsbh);
// recordInvoice.setGfName(gfmc);
recordInvoice.setRzlx("5");
recordInvoice.setYqsqStatus("1");
if(current != null) {
recordInvoice.setYqCurrentPeriod(current.getCurrentTaxPeriod());
}else{
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
String month = format.format(new Date());
recordInvoice.setYqCurrentPeriod(month);
}
recordInvoice.setCreateDate(new Date());
recordInvoice.setYqsqDate(new Date());
recordInvoice.setSourceSystem("2");
recordInvoice.setInvoiceStatus("0");
recordInvoice.setInvoiceType(invoiceType);
@ -194,6 +211,8 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
recordInvoice.setImageId(imageId);
recordInvoice.setCompCode(compCode);
recordInvoice.setGfTaxNo(snInvoice.getPurchaserTaxNo());
recordInvoice.setGfName(snInvoice.getPurchaserName());
update = baseTDxRecordInvoiceDao.update(recordInvoice, recordWrapper);

@ -174,7 +174,7 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl<ExtInvoicePoolD
}
//报账单号字典值转换
// pageList.get(i).setInAccountStatus(dictdetaServcice.queryDictName(DictConstant.INACCOUNT_STATUS,pageList.get(i).getInAccountStatus()));
log.info("入账状态====>{}",pageList.get(i).getInAccountStatus());
// log.info("入账状态====>{}",pageList.get(i).getInAccountStatus());
pageList.get(i).setInvoiceType(InvoiceTypeUtils.invoiceTypeName(pageList.get(i).getInvoiceType()));
pageList.get(i).setQsrq(pageList.get(i).getQsrq() == null ? "" : pageList.get(i).getQsrq());
pageList.get(i).setRzrq(pageList.get(i).getRzrq() == null ? "" : pageList.get(i).getRzrq());

@ -130,6 +130,7 @@
<if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
and t.invoice_source = #{invoiceSource}
</if>
and t.invoice_type not in ('91','95','97','99','101','00')
</select>
<select id="listAddTaxInvoice" parameterType="java.util.Map"
resultType="com.dxhy.extend.entity.ExtAddTaxInvoice" databaseId="mysql">
@ -256,6 +257,7 @@
<!-- <if test="snVoucherNumber !=null and snVoucherNumber !='' and snVoucherNumber !='99'">-->
<!-- and t.sn_voucher_number = #{snVoucherNumber}-->
<!-- </if>-->
and t.invoice_type not in ('91','95','97','99','101','00')
</select>
<!--其他发票汇总-->
<select id="selectOtherHj" parameterType="java.util.Map"

Loading…
Cancel
Save