Merge branch 'dev-v6.0.1' of http://10.1.1.216/xm/sdenergy/jxpt/pt-sdenergy into dev-v6.0.1

release
wangzhikun 2 years ago
commit c5d9d1ad05
  1. 5
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 1
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java
  3. 8
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  4. 12
      dxhy-base/src/main/java/com/dxhy/base/service/receipt/BaseReceiptOutServiceImpl.java
  5. 60
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  6. 2
      dxhy-core/src/main/java/com/dxhy/core/controller/ExcelController.java
  7. 21
      dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java
  8. 29
      dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/MailGatherLogController.java
  9. 4
      dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java
  10. 13
      dxhy-core/src/main/java/com/dxhy/core/model/mailGather/MailGatherLogVo.java
  11. 18
      dxhy-core/src/main/java/com/dxhy/core/service/invoicedetail/InvoiceDetailServiceImpl.java
  12. 2
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java
  13. 6
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java
  14. 7
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/MailGatherLogServiceImpl.java
  15. 8
      dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java
  16. 14
      dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java
  17. 2
      dxhy-core/src/main/java/com/dxhy/core/util/InvoiceQueryUtil.java
  18. 2
      dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml
  19. 48
      dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml
  20. 10
      dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java
  21. 6
      dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java
  22. 9
      dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/SignFpqsServiceImpl.java

@ -423,6 +423,10 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("paymentDateEnd", map.get("paymentDateEnd")); pramsMap.put("paymentDateEnd", map.get("paymentDateEnd"));
pramsMap.put("settlementNo", map.get("settlementNo")); pramsMap.put("settlementNo", map.get("settlementNo"));
pramsMap.put("voucherNumber", map.get("voucherNumber")); pramsMap.put("voucherNumber", map.get("voucherNumber"));
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("postingTime", map.get("postingTime"));
pramsMap.put("imageId", map.get("imageId"));
pramsMap.put("accountPeriod", map.get("accountPeriod"));
String inAccountStatus = (String)map.get("inAccountStatus"); String inAccountStatus = (String)map.get("inAccountStatus");
if (sfkrz != null) { if (sfkrz != null) {
@ -628,6 +632,7 @@ public class BaseInvoiceController extends AbstractController {
return ResponseEntity.ok(R.error("签收状态不能为空!")); return ResponseEntity.ok(R.error("签收状态不能为空!"));
} }
String qsflag = getUserInfo().getQsStatus(); String qsflag = getUserInfo().getQsStatus();
log.info("签收开关qsflag:{}",qsflag);
if ("1".equals(qsflag)) { if ("1".equals(qsflag)) {
pramsMap.put("qszt", "1"); pramsMap.put("qszt", "1");
} }

@ -467,6 +467,7 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController {
pramsMap.put("gfsh", gfshList); pramsMap.put("gfsh", gfshList);
String qsflag = getUserInfo().getQsStatus(); String qsflag = getUserInfo().getQsStatus();
pramsMap.put("qsflag", qsflag); pramsMap.put("qsflag", qsflag);
log.info("签收认证状态为:{}",qsflag);
if (!StringHelper.isBlank(datalist)) { if (!StringHelper.isBlank(datalist)) {
pramsMap.put("datalist", datalist); pramsMap.put("datalist", datalist);

@ -14,6 +14,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.dxhy.common.constant.DictConstant; import com.dxhy.common.constant.DictConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -49,6 +50,7 @@ import com.github.pagehelper.PageInfo;
* @version 1.0 * @version 1.0
*/ */
@SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"}) @SuppressWarnings({"AlibabaLowerCamelCaseVariableNaming", "AlibabaUndefineMagicConstant", "AlibabaMethodTooLong"})
@Slf4j
@Service("baseInvoiceManualCheckService") @Service("baseInvoiceManualCheckService")
public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDxRecordInvoiceDao, BaseTDxRecordInvoice> public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDxRecordInvoiceDao, BaseTDxRecordInvoice>
implements BaseInvoiceManualCheckService { implements BaseInvoiceManualCheckService {
@ -204,10 +206,12 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
if (!"1".equals(pageList.get(i).getAuthStatus())) { if (!"1".equals(pageList.get(i).getAuthStatus())) {
vo.setSelect(false); vo.setSelect(false);
} }
log.info("返回的发票信息是:{}",pageList.get(i));
String invoiceStatus="07"; String invoiceStatus="07";
if ( !invoiceStatus.contains(pageList.get(i).getInvoiceStatus()) if ( !invoiceStatus.contains(pageList.get(i).getInvoiceStatus())
|| 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().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");
} }

@ -190,7 +190,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD
// 转出金额 // 转出金额
vo.setOutAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutInvoiceAmout().toPlainString()))); vo.setOutAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutInvoiceAmout().toPlainString())));
// 转出税额 // 转出税额
vo.setOutTax(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutTaxAmount().toPlainString()))); if (record.getOutTaxAmount() != null)
vo.setOutTax(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutTaxAmount().toPlainString())));
vo.setRemark(record.getOutRemark()); vo.setRemark(record.getOutRemark());
vo.setOutBelongDate(record.getOutBelongDate()); vo.setOutBelongDate(record.getOutBelongDate());
@ -199,7 +200,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD
QueryWrapper<BaseTDxOutReason> query = new QueryWrapper<>(); QueryWrapper<BaseTDxOutReason> query = new QueryWrapper<>();
query.eq("reason_code", record.getOutReason()); query.eq("reason_code", record.getOutReason());
BaseTDxOutReason reason = baseTDxOutReasonDao.selectOne(query); BaseTDxOutReason reason = baseTDxOutReasonDao.selectOne(query);
vo.setReason(reason.getOutReason()); if (reason != null)
vo.setReason(reason.getOutReason());
return vo; return vo;
} }
@ -643,7 +645,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD
// 转出金额 // 转出金额
vo.setOutAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutInvoiceAmout().toPlainString()))); vo.setOutAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutInvoiceAmout().toPlainString())));
// 转出税额 // 转出税额
vo.setOutTax(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutTaxAmount().toPlainString()))); if (record.getOutTaxAmount() != null)
vo.setOutTax(AmountFormatUtil.fmtMicrometer(MathUtil.round(record.getOutTaxAmount().toPlainString())));
vo.setRemark(record.getOutRemark()); vo.setRemark(record.getOutRemark());
vo.setOutDate(DateUtils.dateToStr(record.getOutDate())); vo.setOutDate(DateUtils.dateToStr(record.getOutDate()));
vo.setOutBelongDate(record.getOutBelongDate()); vo.setOutBelongDate(record.getOutBelongDate());
@ -651,7 +654,8 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutD
QueryWrapper<BaseTDxOutReason> query = new QueryWrapper<>(); QueryWrapper<BaseTDxOutReason> query = new QueryWrapper<>();
query.eq("reason_code", record.getOutReason()); query.eq("reason_code", record.getOutReason());
BaseTDxOutReason reason = baseTDxOutReasonDao.selectOne(query); BaseTDxOutReason reason = baseTDxOutReasonDao.selectOne(query);
vo.setReason(reason.getOutReason()); if (reason != null)
vo.setReason(reason.getOutReason());
// 认证日期 string类型的长日期转为string类型的短日期 // 认证日期 string类型的长日期转为string类型的短日期
String certDate = record.getCertDate(); String certDate = record.getCertDate();
Date date = new Date(); Date date = new Date();

@ -64,7 +64,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq} WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
and t.export_mark = '0' and t.export_mark = '0'
@ -110,7 +110,7 @@
and t.payment_status = #{paymentStatus} and t.payment_status = #{paymentStatus}
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -171,6 +171,18 @@
<if test="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''"> <if test="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''">
order by t.invoice_date desc order by t.invoice_date desc
</if> </if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.postingTime = #{postingTime}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
</select> </select>
<select id="selectDksh" parameterType="java.util.Map" <select id="selectDksh" parameterType="java.util.Map"
resultType="com.dxhy.base.entity.BaseTDxDkCount" resultType="com.dxhy.base.entity.BaseTDxDkCount"
@ -199,7 +211,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
and t.export_mark = '0' and t.export_mark = '0'
@ -245,7 +257,7 @@
and t.payment_status = #{paymentStatus} and t.payment_status = #{paymentStatus}
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -323,6 +335,18 @@
<if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'"> <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
and t.ele_invoice_no = #{eleInvoiceNo} and t.ele_invoice_no = #{eleInvoiceNo}
</if> </if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTime != null and postingTime != '' and postingTime != 'null' and postingTime != '99'">
and t.postingTime = #{postingTime}
</if>
<if test="imageId != null and imageId != '' and imageId != 'null' and imageId != '99'">
and t.image_id = #{imageId}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
</select> </select>
<select id="selectHj" parameterType="java.util.Map" <select id="selectHj" parameterType="java.util.Map"
@ -331,7 +355,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq} WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
and t.export_mark = '0' and t.export_mark = '0'
@ -368,7 +392,7 @@
and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -439,7 +463,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE to_char(t.invoice_date,'yyyy-mm-dd') between #{kpksrq} and #{kpjsrq} WHERE to_char(t.invoice_date,'yyyy-mm-dd') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
and t.export_mark = '0' and t.export_mark = '0'
@ -455,10 +479,10 @@
<if <if
test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()"> test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '0'.toString()">
and (t.invoice_status in ('1','2','3','4','8','80') or t.invoice_amount &lt;0 or t.tax_amount &lt;0 or and t.invoice_status in ('1','2','3','4','8','80') or t.invoice_amount &lt;0 or t.tax_amount &lt;0 or
to_char(t.invoice_date,'yyyymmdd') &lt;= c.select_start_date or to_char(t.invoice_date,'yyyymmdd') &lt;= c.select_start_date or
to_char(t.invoice_date,'yyyymmdd') &gt;= to_char(t.invoice_date,'yyyymmdd') &gt;=
c.select_end_date or d.tj_status in ('1','2')) c.select_end_date or d.tj_status in ('1','2')
</if> </if>
and t.gf_tax_no in and t.gf_tax_no in
@ -476,7 +500,7 @@
and t.voucher_number like concat('%',concat(#{voucherNumber},'%')) and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -731,7 +755,7 @@
where date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq} where date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.export_mark = '0' and t.export_mark = '0'
and t.invoice_amount>0 and t.invoice_amount>0
and t.tax_amount>=0 and t.tax_amount>=0
@ -765,7 +789,7 @@
and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq} and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq}
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -810,7 +834,7 @@
where to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} where to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq}
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.invoice_amount>0 and t.invoice_amount>0
and t.tax_amount>=0 and t.tax_amount>=0
and t.auth_status in ('0','5','6') and t.auth_status in ('0','5','6')
@ -843,7 +867,7 @@
and to_char(t.qs_date,'yyyy-MM-dd') between #{qsksrq} and #{qsjsrq} and to_char(t.qs_date,'yyyy-MM-dd') between #{qsksrq} and #{qsjsrq}
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') ) and t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08')
</if> </if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' "> <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType} and t.invoice_type = #{invoiceType}
@ -901,7 +925,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq} WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
@ -988,7 +1012,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
@ -1070,7 +1094,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq} WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')
@ -1145,7 +1169,7 @@
from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno from t_dx_record_invoice t left join t_dx_tax_current c on t.gf_tax_no = c.taxno
left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq left join t_dx_dk_count d on c.taxno = d.taxno and c.current_tax_period = d.skssq
WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq} WHERE to_char(t.invoice_date,'yyyy-MM-dd') between #{kpksrq} and #{kpjsrq}
and (t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')) and t.invoice_type in('01','03','08','14','31','283','161','183','185') or (t.invoice_type ='32' and t.lq_tdyslxDm='08')
and t.rzh_yesorno = '0' and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7') and t.invoice_status in ('0','7')
and t.auth_status in('0','5','6') and t.auth_status in('0','5','6')

@ -253,7 +253,7 @@ public class ExcelController extends AbstractController {
Map<String, Object> returnMap = new HashMap<>(2); Map<String, Object> returnMap = new HashMap<>(2);
returnMap.put("id",tdxExcelExprortlog.getId()); returnMap.put("id",tdxExcelExprortlog.getId());
returnMap.put("setviceType","2"); returnMap.put("serviceType","2");
return ResponseEntity.ok(R.ok().put("data", returnMap)); return ResponseEntity.ok(R.ok().put("data", returnMap));
} catch (Exception e) { } catch (Exception e) {

@ -4,7 +4,9 @@ import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.controller.AbstractController; import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.util.UUIDUtils; import com.dxhy.common.util.UUIDUtils;
import com.dxhy.common.utils.Base64Encoding; import com.dxhy.common.utils.Base64Encoding;
import com.dxhy.common.utils.R; import com.dxhy.common.utils.R;
@ -91,6 +93,13 @@ public class EmailMaintainController extends AbstractController {
} }
String loginname = getUserInfo().getLoginname(); String loginname = getUserInfo().getLoginname();
emailMaintain.setCreateUser(loginname); emailMaintain.setCreateUser(loginname);
DynamicContextHolder.push(DbConstant.BASICS_READ);
EmailMaintainVo vo = new EmailMaintainVo();
vo.setEmailAddress(emailMaintain.getEmailAddress());
EmailMaintainVo maintainVo = emailMaintainService.getEmailMaintainVo(vo);
if(maintainVo != null){
return ResponseEntity.ok(R.error("邮箱地址已存在!"));
}
boolean insert = this.emailMaintainService.insert(emailMaintain); boolean insert = this.emailMaintainService.insert(emailMaintain);
if(insert){ if(insert){
return ResponseEntity.ok(R.ok()); return ResponseEntity.ok(R.ok());
@ -106,6 +115,16 @@ public class EmailMaintainController extends AbstractController {
*/ */
@PostMapping("/edit") @PostMapping("/edit")
public ResponseEntity<R> edit(@RequestBody EmailMaintainVo emailMaintain) { public ResponseEntity<R> edit(@RequestBody EmailMaintainVo emailMaintain) {
if(StringUtils.isBlank(emailMaintain.getEmailPassword())){
return ResponseEntity.ok(R.error("邮箱地址不能为空!"));
}
DynamicContextHolder.push(DbConstant.BASICS_READ);
EmailMaintainVo vo = new EmailMaintainVo();
vo.setEmailAddress(emailMaintain.getEmailAddress());
EmailMaintainVo maintainVo = emailMaintainService.getEmailMaintainVo(vo);
if(maintainVo != null && maintainVo.getId().equals(emailMaintain.getId())){
return ResponseEntity.ok(R.error("邮箱地址已存在!"));
}
boolean b = emailMaintainService.update(emailMaintain); boolean b = emailMaintainService.update(emailMaintain);
if(b){ if(b){
return ResponseEntity.ok(R.ok()); return ResponseEntity.ok(R.ok());
@ -142,6 +161,7 @@ public class EmailMaintainController extends AbstractController {
errorMsgList.add("第" + resultIndex + "行,用户编码不能为空"); errorMsgList.add("第" + resultIndex + "行,用户编码不能为空");
continue; continue;
} }
DynamicContextHolder.push(DbConstant.BASICS_READ);
String userName = emailMaintainService.getUserName(userId); String userName = emailMaintainService.getUserName(userId);
if(StringUtils.isBlank(userName)){ if(StringUtils.isBlank(userName)){
errorMsgList.add("第" + resultIndex + "行,用户编码在系统中查询不到,请核实!"); errorMsgList.add("第" + resultIndex + "行,用户编码在系统中查询不到,请核实!");
@ -206,6 +226,7 @@ public class EmailMaintainController extends AbstractController {
if(StringUtils.isEmpty(userCode)){ if(StringUtils.isEmpty(userCode)){
return ResponseEntity.ok(R.error("数据不能为空!")); return ResponseEntity.ok(R.error("数据不能为空!"));
} }
DynamicContextHolder.push(DbConstant.BASICS_READ);
String userName = emailMaintainService.getUserName(userCode); String userName = emailMaintainService.getUserName(userCode);
if(StringUtils.isNotEmpty(userName)){ if(StringUtils.isNotEmpty(userName)){
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();

@ -1,8 +1,12 @@
package com.dxhy.core.controller.mailGather; package com.dxhy.core.controller.mailGather;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.controller.AbstractController; import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.utils.R; import com.dxhy.common.utils.R;
import com.dxhy.core.service.mailGather.MailGatherLogService; import com.dxhy.core.service.mailGather.MailGatherLogService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -10,6 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map; import java.util.Map;
/** /**
@ -18,6 +25,7 @@ import java.util.Map;
* @author makejava * @author makejava
* @since 2023-03-23 08:42:35 * @since 2023-03-23 08:42:35
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("/mailGatherLog") @RequestMapping("/mailGatherLog")
public class MailGatherLogController extends AbstractController { public class MailGatherLogController extends AbstractController {
@ -26,6 +34,7 @@ public class MailGatherLogController extends AbstractController {
*/ */
@Resource @Resource
private MailGatherLogService mailGatherLogService; private MailGatherLogService mailGatherLogService;
final SimpleDateFormat sf2 = new SimpleDateFormat("yyyy-MM-dd");
/** /**
* 分页查询 * 分页查询
@ -46,6 +55,26 @@ public class MailGatherLogController extends AbstractController {
if (pramsMap.get("parseEnd") == null || "".equals(pramsMap.get("parseEnd"))) { if (pramsMap.get("parseEnd") == null || "".equals(pramsMap.get("parseEnd"))) {
return ResponseEntity.ok(R.error("结束日期不能为空!")); return ResponseEntity.ok(R.error("结束日期不能为空!"));
} }
Object parseStart = pramsMap.get("parseStart");
Object parseEnd = pramsMap.get("parseEnd");
if (parseEnd == null || parseEnd == null) {
} else {
try {
Date starttime = sf2.parse(String.valueOf(parseStart));
Date endtime = sf2.parse(String.valueOf(parseEnd));
if (starttime.after(endtime)) {
return ResponseEntity.ok(R.error("开始时间不能大于结束时间"));
}
pramsMap.put("startTime", starttime);
pramsMap.put("endTime", endtime);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
String loginname = getUserInfo().getLoginname();
pramsMap.put("createUser",loginname);
DynamicContextHolder.push(DbConstant.BASICS_READ);
return ResponseEntity.ok(R.ok().put("data",this.mailGatherLogService.queryByPage(pramsMap))); return ResponseEntity.ok(R.ok().put("data",this.mailGatherLogService.queryByPage(pramsMap)));
} }

@ -35,7 +35,7 @@ public interface EmailMaintainDao extends BaseMapper<EmailMaintainVo> {
* @param emailMaintainVo 查询条件 * @param emailMaintainVo 查询条件
* @return 总行数 * @return 总行数
*/ */
long count(EmailMaintainVo emailMaintainVo); EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintainVo);
/** /**
* 新增数据 * 新增数据
@ -81,4 +81,6 @@ public interface EmailMaintainDao extends BaseMapper<EmailMaintainVo> {
String getUserName(@Param("userCode") String userCode); String getUserName(@Param("userCode") String userCode);
} }

@ -26,4 +26,17 @@ public class MailGatherLogVo extends CommonDTO {
private String fileName; private String fileName;
private Date createTime; private Date createTime;
public String deptId;
private String companyCode;
public String deptName;
public String username;
public String userId;
public String createUser;
} }

@ -158,10 +158,18 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
// 取发票上的价税合计 // 取发票上的价税合计
String totalAmount = checkRecordVo.getTotalAmount(); String totalAmount = checkRecordVo.getTotalAmount();
// 价税合计小写 if(totalAmount != null && StringUtils.isNoneBlank(totalAmount)) {
checkInfo.put("detailAmountTotal", totalAmount); log.info("totalAmount={}",totalAmount);
// 价税合计大写 // 价税合计小写
checkInfo.put("stringTotalAmount", NumberToCN.number2CNMontrayUnit(new BigDecimal(totalAmount))); checkInfo.put("detailAmountTotal", totalAmount);
// 价税合计大写
checkInfo.put("stringTotalAmount", NumberToCN.number2CNMontrayUnit(new BigDecimal(totalAmount)));
}else{
// 价税合计小写
checkInfo.put("detailAmountTotal", "0");
// 价税合计大写
checkInfo.put("stringTotalAmount", "零");
}
// 发票票面信息 // 发票票面信息
checkInfo.put("invoiceSubjectList", JSON.toJSON(checkRecordVo)); checkInfo.put("invoiceSubjectList", JSON.toJSON(checkRecordVo));
// 机动车部分信息 // 机动车部分信息
@ -277,7 +285,7 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
} }
checkRecordVo.setTotalAmount(MathUtil.round(detailAmount.toPlainString())); checkRecordVo.setTotalAmount(MathUtil.round(detailAmount.toPlainString()));
} else { } else {
if (invoiceRecord.getTotalAmount() == null) { if (invoiceRecord.getTotalAmount() != null) {
BigDecimal add = invoiceRecord.getInvoiceAmount().add(invoiceRecord.getTaxAmount()); BigDecimal add = invoiceRecord.getInvoiceAmount().add(invoiceRecord.getTaxAmount());
checkRecordVo.setTotalAmount(MathUtil.round(add.toPlainString())); checkRecordVo.setTotalAmount(MathUtil.round(add.toPlainString()));
} else { } else {

@ -51,4 +51,6 @@ public interface EmailMaintainService {
String getUserName(String userCode); String getUserName(String userCode);
int insertBatch(List<EmailMaintainVo> entities); int insertBatch(List<EmailMaintainVo> entities);
EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintain);
} }

@ -117,9 +117,13 @@ public class EmailMaintainServiceImpl implements EmailMaintainService {
return emailMaintainDao.insertBatch(entities); return emailMaintainDao.insertBatch(entities);
} }
@Override
public EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintain) {
return emailMaintainDao.getEmailMaintainVo(emailMaintain);
}
//根据用户名进行查询 //根据用户名进行查询
public void getdeptInfo(String deptId){ public void getdeptInfo(String deptId){
DynamicContextHolder.push(DbConstant.BASICS_READ); DynamicContextHolder.push(DbConstant.BASICS_READ);
} }
} }

@ -5,16 +5,19 @@ import cn.hutool.core.codec.Base64;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.constant.DbConstant; import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.util.UUIDUtils;
import com.dxhy.core.dao.mailGather.MailGatherLogDao; import com.dxhy.core.dao.mailGather.MailGatherLogDao;
import com.dxhy.core.model.mailGather.MailGatherLogVo; import com.dxhy.core.model.mailGather.MailGatherLogVo;
import com.dxhy.core.service.mailGather.MailGatherLogService; import com.dxhy.core.service.mailGather.MailGatherLogService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -70,6 +73,10 @@ public class MailGatherLogServiceImpl implements MailGatherLogService {
*/ */
@Override @Override
public MailGatherLogVo insert(MailGatherLogVo mailGatherLog) { public MailGatherLogVo insert(MailGatherLogVo mailGatherLog) {
if(StringUtils.isEmpty(mailGatherLog.getId())){
mailGatherLog.setId(UUIDUtils.generateShortUuid());
}
mailGatherLog.setCreateTime(new Date());
this.mailGatherLogDao.insert(mailGatherLog); this.mailGatherLogDao.insert(mailGatherLog);
return mailGatherLog; return mailGatherLog;
} }

@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.dxhy.common.constant.DbConstant; import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.util.MD5; import com.dxhy.common.util.MD5;
import com.dxhy.common.util.UUIDUtils;
import com.dxhy.core.job.entity.ScheduleJobEntity; import com.dxhy.core.job.entity.ScheduleJobEntity;
import com.dxhy.core.job.service.ScheduleJobService; import com.dxhy.core.job.service.ScheduleJobService;
import com.dxhy.core.model.mailGather.EmailMaintainVo; import com.dxhy.core.model.mailGather.EmailMaintainVo;
@ -89,18 +90,17 @@ public class SnEmailGatherTask {
} }
public void parseEmail(EmailMaintainVo maintainVo){ public void parseEmail(EmailMaintainVo maintainVo){
log.info("邮箱采集内部方法开始执行--");
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
String password = Base64Decoder.decodeStr(maintainVo.getEmailPassword()); String password = Base64Decoder.decodeStr(maintainVo.getEmailPassword());
String emailName = maintainVo.getEmailAddress(); String emailName = maintainVo.getEmailAddress();
try { try {
Store store = mailAuth(emailName, password); Store store = mailAuth(emailName, password);
if(store == null){ if(store == null){
MailGatherLogVo gatherLogVo = new MailGatherLogVo(); MailGatherLogVo gatherLogVo = new MailGatherLogVo();
gatherLogVo.setId(IdUtil.nanoId()); gatherLogVo.setId(UUIDUtils.generateShortUuid());
gatherLogVo.setErrorMsg("邮箱认证失败"); gatherLogVo.setErrorMsg("邮箱认证失败");
gatherLogVo.setOcrType("1"); gatherLogVo.setOcrType("1");
gatherLogVo.setCreateTime(new Date());
gatherLogVo.setFromAddress(emailName); gatherLogVo.setFromAddress(emailName);
mailGatherLogService.insert(gatherLogVo); mailGatherLogService.insert(gatherLogVo);
return; return;
@ -127,7 +127,7 @@ public class SnEmailGatherTask {
gatherLogVo.setSubject(EmailParseUtils.getSubject(msg)); gatherLogVo.setSubject(EmailParseUtils.getSubject(msg));
gatherLogVo.setFromAddress(emailName); gatherLogVo.setFromAddress(emailName);
gatherLogVo.setReceiveAddress(EmailParseUtils.getReceiveAddress(msg, null)); gatherLogVo.setReceiveAddress(EmailParseUtils.getReceiveAddress(msg, null));
gatherLogVo.setSentDate( EmailParseUtils.getSentDate(msg, null)); gatherLogVo.setSentDate(EmailParseUtils.getSentDate(msg, null));
gatherLogVo.setCreateTime(new Date()); gatherLogVo.setCreateTime(new Date());
log.debug("主题: " + EmailParseUtils.getSubject(msg)); log.debug("主题: " + EmailParseUtils.getSubject(msg));

@ -37,8 +37,10 @@ class SnEmailGatherTaskTest {
String port = "110"; String port = "110";
//邮件接收服务器地址 //邮件接收服务器地址
String mail_host = "mail.pop3.host"; String mail_host = "mail.pop3.host";
String emailName = "15201210373@163.com"; String emailName = "1149953701@qq.com";
String password = "JKZATQTPHDDQTQSH"; String password = "pmdzleyabmlzgdhc";
// String emailName = "15201210373@163.com";
// String password = "JKZATQTPHDDQTQSH";
String mailSuffix = emailName.split("@")[1]; String mailSuffix = emailName.split("@")[1];
//邮箱类型 //邮箱类型
String mailType = mailSuffix.split("\\.")[0]; String mailType = mailSuffix.split("\\.")[0];
@ -61,7 +63,7 @@ class SnEmailGatherTaskTest {
//连接邮箱服务器 //连接邮箱服务器
//获取当前时间 //获取当前时间
Date currentTime = new Date(); Date currentTime = new Date();
// 获得收件箱 pop3协议只有一个有效的文件夹就是INBOX // 品 ping获得收件箱 pop3协议只有一个有效的文件夹就是INBOX
Folder folder = store.getFolder("INBOX"); Folder folder = store.getFolder("INBOX");
//获取邮件列表 //获取邮件列表
folder.open(Folder.READ_WRITE); folder.open(Folder.READ_WRITE);
@ -113,8 +115,8 @@ class SnEmailGatherTaskTest {
Map resultMap = JSONObject.parseObject(body, Map.class); Map resultMap = JSONObject.parseObject(body, Map.class);
Object status = resultMap.get("status"); Object status = resultMap.get("status");
System.out.println(JSONObject.toJSONString("================="+resultMap));
if(status != null && "200".equals(String.valueOf(status))){ if(status != null && "200".equals(String.valueOf(status))){
} }
System.out.println(body); System.out.println(body);
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
@ -165,7 +167,7 @@ class SnEmailGatherTaskTest {
OpenServiceOcr openServiceOcr = openServiceOcrs.get(i); OpenServiceOcr openServiceOcr = openServiceOcrs.get(i);
OpenServiceOcr.InvoiceOcrData invoiceOcrData = openServiceOcr.getData(); OpenServiceOcr.InvoiceOcrData invoiceOcrData = openServiceOcr.getData();
OcrResultToyxVo resultToyxVo = new OcrResultToyxVo(); OcrResultToyxVo resultToyxVo = new OcrResultToyxVo();
resultToyxVo.setCompanyId(""); resultToyxVo.setCompanyId("c040");
resultToyxVo.setSource("01"); resultToyxVo.setSource("01");
resultToyxVo.setInvoiceCode(invoiceOcrData.getFPDM()); resultToyxVo.setInvoiceCode(invoiceOcrData.getFPDM());
resultToyxVo.setInvoiceNumber(invoiceOcrData.getFPHM()); resultToyxVo.setInvoiceNumber(invoiceOcrData.getFPHM());
@ -176,7 +178,7 @@ class SnEmailGatherTaskTest {
resultToyxVo.setFileType("102"); resultToyxVo.setFileType("102");
resultToyxVo.setFileByte(map.get("pdfStream")); resultToyxVo.setFileByte(map.get("pdfStream"));
resultToyxVo.setEmail(map.get("emailName")); resultToyxVo.setEmail(map.get("emailName"));
resultToyxVo.setEmployeeId(""); resultToyxVo.setEmployeeId("01142085");
resultToyxVoList.add(resultToyxVo); resultToyxVoList.add(resultToyxVo);
} }

@ -164,7 +164,7 @@ public class InvoiceQueryUtil {
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){
requestData.put("invoiceType", "31"); requestData.put("invoiceType", "31");
requestData.put("invoiceCode", ""); requestData.put("invoiceCode", "");
requestData.put("invoiceNo", invoiceNo); requestData.put("invoiceNo", invoiceCode + invoiceNo);
}else { }else {
requestData.put("invoiceType", iu.getFplxdm()); requestData.put("invoiceType", iu.getFplxdm());
requestData.put("invoiceCode", invoiceCode); requestData.put("invoiceCode", invoiceCode);

@ -48,7 +48,7 @@
</select> </select>
<!--统计总行数--> <!--统计总行数-->
<select id="count" resultType="java.lang.Long"> <select id="getEmailMaintainVo" resultMap="EmailMaintainMap">
select count(1) select count(1)
from email_maintain from email_maintain
<where> <where>

@ -7,7 +7,7 @@
<result property="subject" column="subject" jdbcType="VARCHAR"/> <result property="subject" column="subject" jdbcType="VARCHAR"/>
<result property="fromAddress" column="from_address" jdbcType="VARCHAR"/> <result property="fromAddress" column="from_address" jdbcType="VARCHAR"/>
<result property="receiveAddress" column="receive_address" jdbcType="VARCHAR"/> <result property="receiveAddress" column="receive_address" jdbcType="VARCHAR"/>
<result property="sentDate" column="sent_date" jdbcType="VARCHAR"/> <result property="sentDate" column="sent_date" jdbcType="TIMESTAMP"/>
<result property="fileType" column="file_type" jdbcType="VARCHAR"/> <result property="fileType" column="file_type" jdbcType="VARCHAR"/>
<result property="fpdm" column="fpdm" jdbcType="VARCHAR"/> <result property="fpdm" column="fpdm" jdbcType="VARCHAR"/>
<result property="fphm" column="fphm" jdbcType="VARCHAR"/> <result property="fphm" column="fphm" jdbcType="VARCHAR"/>
@ -28,42 +28,32 @@
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="MailGatherLogMap" parameterType="java.util.Map"> <select id="queryAllByLimit" resultMap="MailGatherLogMap" parameterType="java.util.Map">
select SELECT
id, subject, from_address, receive_address, sent_date, file_type, fpdm, fphm, msg_uid, ocr_type, error_msg, file_name, create_time m.create_time, e.dept_name, e.username, m.from_address, m.file_name, m.file_type, m.ocr_type, m.error_msg
from mail_gather_log FROM
mail_gather_log m
LEFT JOIN email_maintain e ON m.from_address = e.email_address
<where> <where>
<if test="fromAddress != null and fromAddress != ''"> <if test="deptId != null and deptId != ''">
and from_address = #{fromAddress} and e.dept_id = #{deptId}
</if>
<if test="receiveAddress != null and receiveAddress != ''">
and receive_address = #{receiveAddress}
</if> </if>
<if test="sentDate != null and sentDate != ''"> <if test="username != null and username != ''">
and sent_date = #{sentDate} and e.username = #{username}
</if> </if>
<if test="fileType != null and fileType != ''"> <if test="userId != null and userId != ''">
and file_type = #{fileType} and e.user_id = #{userId}
</if> </if>
<if test="fpdm != null and fpdm != ''"> <if test="createUser != null and createUser != ''">
and fpdm = #{fpdm} and e.create_user = #{createUser}
</if>
<if test="fphm != null and fphm != ''">
and fphm = #{fphm}
</if>
<if test="msgUid != null and msgUid != ''">
and msg_uid = #{msgUid}
</if> </if>
<if test="ocrType != null and ocrType != ''"> <if test="ocrType != null and ocrType != ''">
and ocr_type = #{ocrType} and m.ocr_type = #{ocrType}
</if> </if>
<if test="errorMsg != null and errorMsg != ''"> <if test="startTime !=null and startTime != ''">
and error_msg = #{errorMsg} and m.create_time >= #{startTime}
</if>
<if test="fileName != null and fileName != ''">
and file_name = #{fileName}
</if> </if>
<if test="createTime != null"> <if test="endTime !=null and endTime != ''">
and create_time = #{createTime} and #{endTime} >= m.create_time
</if> </if>
</where> </where>
</select> </select>

@ -714,6 +714,16 @@ public class InterfaceController extends AbstractController {
returnResult = invoicePoolService.salsePush(globalInfo, requestParam, request, response, authorize); returnResult = invoicePoolService.salsePush(globalInfo, requestParam, request, response, authorize);
break; break;
// 接口编码不存在 // 接口编码不存在
// 获取单张发票
case "INVOICE.SINGLEINVOICECHECK":
returnResult = gatherService.singleInvoiceChenck(globalInfo, requestParam, request, response, authorize);
break;
// 获取单张发票
case "INVOICE.SYNCINVOICEINFO":
returnResult = gatherService.syncInvoiceInfo(globalInfo, requestParam, request, response, authorize);
break;
default: default:
returnResult = authStatusService.getInterfaceCodeError(globalInfo); returnResult = authStatusService.getInterfaceCodeError(globalInfo);
break; break;

@ -92,7 +92,11 @@ public class FpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao, TDx
// 1、基础信息校验 // 1、基础信息校验
String note =""; String note ="";
String uuid =""; String uuid ="";
uuid = pramsMap.get("invoiceCode") + pramsMap.get("invoiceNo"); if(pramsMap.get("invoiceCode") != null) {
uuid = pramsMap.get("invoiceCode") + pramsMap.get("invoiceNo");
}else{
uuid = pramsMap.get("invoiceNo");
}
if(!FplxEnum.QDZZP.getFplxDm().equals(invoiceType)){ if(!FplxEnum.QDZZP.getFplxDm().equals(invoiceType)){
note = signRulesUtils.validateInvoiceInfo(pramsMap.get("invoiceCode"), pramsMap.get("invoiceNo")); note = signRulesUtils.validateInvoiceInfo(pramsMap.get("invoiceCode"), pramsMap.get("invoiceNo"));
} }

@ -59,6 +59,7 @@ import javax.annotation.Resource;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.security.acl.LastOwnerException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -3386,7 +3387,13 @@ public class SignFpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao,
for (int i = 0; i < resultList.size(); i++) { for (int i = 0; i < resultList.size(); i++) {
QsExcelEntity qsExcelEntity = new QsExcelEntity(); QsExcelEntity qsExcelEntity = new QsExcelEntity();
BeanUtils.copyProperties(qsExcelEntity,resultList.get(i)); BeanUtils.copyProperties(qsExcelEntity,resultList.get(i));
qsExcelEntity.setInvoiceAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(resultList.get(i).getTotalAmount().toPlainString())));
log.info("导出的发票数据魏:{}",JSONObject.toJSONString(resultList.get(i)));
log.info("totalAmount={}",resultList.get(i).getTotalAmount());
if(resultList.get(i) != null && resultList.get(i).getInvoiceAmount() != null) {
qsExcelEntity.setInvoiceAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(resultList.get(i).getInvoiceAmount().toPlainString())));
}
excelList.add(qsExcelEntity); excelList.add(qsExcelEntity);
} }
} }

Loading…
Cancel
Save