Merge branches '0602L' and 'test' of http://192.168.12.182/invoice/pt into test

release
yishiqihuasheng 2 years ago
commit 74c48adbdd
  1. 23
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 79
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java
  3. 1
      dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java
  4. 59
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  5. 163
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml

@ -893,6 +893,10 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("sign","99");
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
}
@ -931,7 +935,7 @@ public class BaseInvoiceController extends AbstractController {
String companyCode = (String) map.get("companyCode");
String gfsh = (String)map.get("gfsh");
List<String> gfshList = new ArrayList<>();
if(StringUtils.isBlank(gfsh) && "99".equals(gfsh)){
if(StringUtils.isNotBlank(gfsh) && "99".equals(gfsh)){
gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg());
}else {
gfshList.add(gfsh);
@ -959,16 +963,21 @@ public class BaseInvoiceController extends AbstractController {
//
// map.put("gfsh",gfshList);
//
// map.put("sign","88");
map.put("sign","99");
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
map.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",map.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
map.put("companyCode",companyCode);
}
String sgrzzngxcx = baseInvoiceManualCheckService.inTellingCheck(map);
BaseReturnData baseReturnData = JSON.parseObject(sgrzzngxcx, BaseReturnData.class);
String encode = Base64.decodeStr(baseReturnData.getData());
BaseReturnEntity baseReturnEntity = JSON.parseObject(encode, BaseReturnEntity.class);
log.info("sgrzzngxcx======={}",sgrzzngxcx);
String decodeStr = Base64.decodeStr(sgrzzngxcx);
BaseReturnEntity baseReturnEntity = JSON.parseObject(decodeStr, BaseReturnEntity.class);
List<BaseTDxRecordInvoice> dataList = baseReturnEntity.getDataList();
StringBuilder uuids = new StringBuilder();
StringBuilder dkses = new StringBuilder();
@ -981,6 +990,8 @@ public class BaseInvoiceController extends AbstractController {
dkses.append(",");
}
}
log.info("uuids====>{}",uuids);
log.info("dkses====>{}",dkses);
}else {
return ResponseEntity.ok(R.error("没有可操作的数据"));

@ -136,9 +136,37 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController {
String xfmc = (String)map.get("xfmc");
String position = (String)map.get("position");
String fpzt = (String)map.get("invoiceStatus");
String companyCode = (String) map.get("companyCode");
String qsr = (String)map.get("qsr");
String bzdh = (String) map.get("bzdh");
String bzr = (String) map.get("bzr");
String inAccountStatus = (String) map.get("inAccountStatus");
String sfkrz = (String)map.get("sfkrz");
String suspendDate = (String) map.get("suspendDate");
if (org.apache.commons.lang3.StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){
suspendDate = suspendDate.substring(0,7);
}
String suspendStatus = (String) map.get("suspendStastus");
Map<String, Object> pramsMap = new HashMap<>(20);
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("suspendDate",suspendDate);
pramsMap.put("suspendStatus",suspendStatus);
if (sfkrz != null) {
if (!"99".equals(sfkrz)) {
pramsMap.put("sfkrz", sfkrz);
}
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageNumber",pramsMap.get("imageNumber"));
}
pramsMap.put("postingTimeEnd", map.get("postingTimeEnd"));
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("postingTimeStart", map.get("postingTimeStart"));
pramsMap.put("company", map.get("company"));
pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName());
pramsMap.put("name", getUserName());
@ -146,6 +174,13 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController {
List<Tax> taxList = getUserInfo().getOrg();
pramsMap.put("taxList", taxList);
pramsMap.put("qsflag", getUserInfo().getQsStatus());
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
List<String> gfshList = new ArrayList<>();
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
@ -155,6 +190,14 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController {
}
pramsMap.put("gfsh", gfshList);
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
}
if (!StringUtils.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
pramsMap.put("invoiceType", invoiceType);
@ -272,15 +315,47 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController {
String xfmc = (String)map.get("xfmc");
String position = (String)map.get("position");
String fpzt = (String)map.get("invoiceStatus");
String companyCode = (String) map.get("companyCode");
String qsr = (String)map.get("qsr");
String bzdh = (String) map.get("bzdh");
String bzr = (String) map.get("bzr");
String inAccountStatus = (String) map.get("inAccountStatus");
String sfkrz = (String)map.get("sfkrz");
String suspendDate = (String) map.get("suspendDate");
if (org.apache.commons.lang3.StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){
suspendDate = suspendDate.substring(0,7);
}
String suspendStatus = (String) map.get("suspendStastus");
Map<String, Object> pramsMap = new HashMap<>(20);
pramsMap.put("bzdh",bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("inAccountStatus",inAccountStatus);
pramsMap.put("suspendDate",suspendDate);
pramsMap.put("suspendStatus",suspendStatus);
if (sfkrz != null) {
if (!"99".equals(sfkrz)) {
pramsMap.put("sfkrz", sfkrz);
}
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageNumber",pramsMap.get("imageNumber"));
}
pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName());
pramsMap.put("name", getUserName());
List<Tax> taxList = getUserInfo().getOrg();
pramsMap.put("taxList", taxList);
pramsMap.put("qsflag", getUserInfo().getQsStatus());
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
pramsMap.put("postingTimeEnd", map.get("postingTimeEnd"));
pramsMap.put("snVoucherNumber", map.get("snVoucherNumber"));
pramsMap.put("postingTimeStart", map.get("postingTimeStart"));
pramsMap.put("company", map.get("company"));
List<String> gfshList = new ArrayList<>();
if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {

@ -165,4 +165,5 @@ public class BaseSggxCxRespVO {
private String bzr;
private String uuid;
}

@ -487,37 +487,43 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
String hjsl = "0";
String hjje = "0";
String hjse = "0";
List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectChooseHj(pramsMap);
BaseTDxRecordInvoice hjxx = hjList.get(0);
hjsl = hjxx.getSfygx();
if (!"0".equals(hjsl)) {
hjje = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getInvoiceAmount().toPlainString()));
hjse = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getTaxAmount().toPlainString()));
}
json.put("hjsl", AmountFormatUtil.fmtMicrometer(hjsl));
json.put("hjje", hjje);
json.put("hjse", hjse);
if ("0".equals(hjsl)) {
json.put("message", "无可操作的数据");
json.put("code", "501");
return super.responseResult(json);
}
String isChooseAll = (String) pramsMap.get("isChooseAll");
if ("N".equals(isChooseAll)){
int total = Integer.parseInt(hjsl);
//如果不是勾选所有进行统计和分页
if ("N".equalsIgnoreCase(isChooseAll)){
int curr = (int) pramsMap.get("curr");
int size = (int) pramsMap.get("size");
int totalPage = total % size == 0?total/size:total/size+1;
// 合计信息,仅第一页时需要统计,减少数据库压力
if (curr == 1) {
String hjsl = "0";
String hjje = "0";
String hjse = "0";
List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectChooseHj(pramsMap);
BaseTDxRecordInvoice hjxx = hjList.get(0);
hjsl = hjxx.getSfygx();
if (!"0".equals(hjsl)) {
hjje = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getInvoiceAmount().toPlainString()));
hjse = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getTaxAmount().toPlainString()));
}
json.put("hjsl", AmountFormatUtil.fmtMicrometer(hjsl));
json.put("hjje", hjje);
json.put("hjse", hjse);
if ("0".equals(hjsl)) {
json.put("message", "无可操作的数据");
json.put("code", "501");
return super.responseResult(json);
}
if (curr<1){
curr =1;
}
PageHelper.startPage(curr, size);
if (curr>totalPage){
curr = totalPage;
}
curr = (curr -1)*size;
pramsMap.put("curr",curr);
}
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectInTellingCheck(pramsMap);
@ -534,7 +540,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
// 转化为页面展示对象
List<BaseSggxCxRespVO> returnList = new ArrayList<>();
//记录数量
int count = 0;
int count = 1;
//税额上限
List<Business> businessList = (List<Business>)pramsMap.get("business");
@ -558,7 +564,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
json.put("total", pageInfo.getTotal());
json.put("total", hjsl);
json.put("datalist", returnList);
} catch (Exception e) {
@ -595,6 +601,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String businessName = this.getBusinessName(businessCode, businessList);
// log.info("businessName={}",businessName);
vo.setUuid(baseTDxRecordInvoice.getUuid());
vo.setVoucherNumber(baseTDxRecordInvoice.getVoucherNumber());
vo.setSnVoucherNumber(baseTDxRecordInvoice.getSnVoucherNumber());
vo.setImageNumber(baseTDxRecordInvoice.getImageNumber());

@ -1031,11 +1031,74 @@
and t.invoice_amount>0
and t.tax_amount>=0
and d.tj_status in('0','3')
and date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date
and invoice_date between c.select_start_date and c.select_end_date
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
)
</if>
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
and t.invoice_amount>0
and t.tax_amount>=0
and t.invoice_date between c.select_start_date and c.select_end_date
and d.tj_status in('0','3')
</if>
<if 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
t.invoice_date &lt;= c.select_start_date or
t.invoice_date &gt;=
c.select_end_date or d.tj_status in ('1','2'))
</if>
<if test="suspendStatus != null and suspendStatus != '' and suspendStatus != 'null' and suspendStatus != '99' and suspendStatus == '1'.toString()">
and t.suspend_status = '1'
</if>
<if test="suspendStatus != null and suspendStatus != '' and suspendStatus != 'null' and suspendStatus != '99' and suspendStatus == '0'.toString()">
and (t.suspend_status = '' or t.suspend_status is null or t.suspend_status = '0')
</if>
<if test="suspendDate != null and suspendDate != '' and suspendDate != 'null' ">
and t.suspend_date = #{suspendDate}
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
and t.bzr like concat('%',#{bzr},'%')
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
@ -1201,10 +1264,73 @@
and t.tax_amount>=0
and d.tj_status in('0','3')
and date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date
and t.company = #{company}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
)
</if>
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
and t.invoice_amount>0
and t.tax_amount>=0
and t.invoice_date between c.select_start_date and c.select_end_date
and d.tj_status in('0','3')
</if>
<if 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
t.invoice_date &lt;= c.select_start_date or
t.invoice_date &gt;=
c.select_end_date or d.tj_status in ('1','2'))
</if>
<if test="suspendStatus != null and suspendStatus != '' and suspendStatus != 'null' and suspendStatus != '99' and suspendStatus == '1'.toString()">
and t.suspend_status = '1'
</if>
<if test="suspendStatus != null and suspendStatus != '' and suspendStatus != 'null' and suspendStatus != '99' and suspendStatus == '0'.toString()">
and (t.suspend_status = '' or t.suspend_status is null or t.suspend_status = '0')
</if>
<if test="suspendDate != null and suspendDate != '' and suspendDate != 'null' ">
and t.suspend_date = #{suspendDate}
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
and t.bzr like concat('%',#{bzr},'%')
</if>
<if test="bzdh != null and bzdh != '' and bzdh != 'null' and bzdh != '99'">
and t.bzdh = #{bzdh}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and (t.inaccount_status = '0' or t.inaccount_status = '' or t.inaccount_status is null)
</if>
<if test="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<if test="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<if test="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<if test="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
@ -1381,38 +1507,41 @@
and invoice_status = '0'
and company = #{company}
<if test="sign !='88'">
and t.gf_tax_no in
and gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (t.comp_code in
and (comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
or comp_code is null or comp_code = ''
)
</if>
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
and comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
and (comp_code = '' or comp_code is null)
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and t.inaccount_status = '1'
and inaccount_status = '1'
</if>
<if test="qsflag != null and qsflag != '' and qsflag != 'null' and qsflag == '1'.toString()">
and t.qs_status = '1'
and qs_status = '1'
</if>
ORDER BY tax_amount
) AS subquery
WHERE <![CDATA[ max_tax <= #{max_tax} ]]>
WHERE <![CDATA[ max_tax <= #{maxTax} ]]>
<if test="isChooseAll != null and isChooseAll != '' and isChooseAll == 'N'.toString()">
limit #{curr},#{size}
</if>
</select>
@ -1438,38 +1567,38 @@
and invoice_status = '0'
and company = #{company}
<if test="sign !='88'">
and t.gf_tax_no in
and gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode == '99'">
and (t.comp_code in
and (comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" separator="," open="(" close=")">
#{companyCode}
</foreach>
or t.comp_code is null or t.comp_code = ''
or comp_code is null or comp_code = ''
)
</if>
<if test="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'" >
and t.comp_code = #{companyCode}
and comp_code = #{companyCode}
</if>
<if test="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
and (comp_code = '' or comp_code is null)
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and t.inaccount_status = '1'
and inaccount_status = '1'
</if>
<if test="qsflag != null and qsflag != '' and qsflag != 'null' and qsflag == '1'.toString()">
and t.qs_status = '1'
and qs_status = '1'
</if>
ORDER BY tax_amount
) AS subquery
WHERE <![CDATA[ max_tax <= #{max_tax} ]]>
WHERE <![CDATA[ max_tax <= #{maxTax} ]]>
</select>
<update id="updateSuspendType" parameterType="java.util.Map" databaseId="mysql">

Loading…
Cancel
Save