购方税号和组织编码修改

release
yishiqihuasheng 2 years ago
parent 8d6caead2b
commit 3ffcecd254
  1. 3
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticExportCustomsRzdkController.java
  2. 6
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticExportInvoiceRzdkController.java
  3. 7
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java
  4. 7
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticRefundController.java
  5. 6
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/model/dto/AuthenticationCheckConditionDTO.java
  6. 4
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/model/dto/AuthenticationConditionDTO.java
  7. 1
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/model/vo/BaseCustomsVO.java
  8. 2
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/ckzrz/impl/DomesticExportCustomsCkServiceImpl.java
  9. 4
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/ckzrz/impl/DomesticExportInvoiceCkServiceImpl.java
  10. 13
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/customsrefund/impl/DomesticCustomsRefundServiceImpl.java
  11. 36
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/drawback/impl/DomesticInvoiceDrawbackServiceImpl.java
  12. 24
      dxhy-export-domestic/src/main/resources/mapper/DomesticCustomsRecordMapper.xml
  13. 40
      dxhy-export-domestic/src/main/resources/mapper/DomesticExportCustomsMapper.xml
  14. 58
      dxhy-export-domestic/src/main/resources/mapper/DomesticExportInvoiceMapper.xml
  15. 27
      dxhy-export-domestic/src/main/resources/mapper/DomesticRecordInvoiceMapper.xml
  16. 40
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java
  17. 6
      dxhy-extend/src/main/resources/mapper/ExtBbfpmxMapper.xml
  18. 48
      dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml
  19. 12
      dxhy-extend/src/main/resources/mapper/ExtBbycfpbbcxMapper.xml
  20. 12
      dxhy-extend/src/main/resources/mapper/ExtBbycfpcxMapper.xml

@ -67,6 +67,9 @@ public class DomesticExportCustomsRzdkController extends AbstractController {
@PostMapping("/queryBdkByPage")
public ResponseEntity<?> queryBdkByPage(Page page, @RequestBody TdxExportCustomsModelDTO dto) {
try {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
return ResponseEntity
.ok(R.ok().put("data", domesticExportCustomsCkService.queryBdkByPage(page, dto, this.getUserInfo())));
} catch (Exception e) {

@ -67,6 +67,9 @@ public class DomesticExportInvoiceRzdkController extends AbstractController {
@PostMapping("/queryVatBdk")
public ResponseEntity<?> queryVatBdk(Page page, @RequestBody TdxExportInvoiceModelDTO dto) {
try {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
return ResponseEntity
.ok(R.ok().put("data", tDxExportInvoiceService.queryVatBdk(page, dto, this.getUserInfo())));
} catch (Exception e) {
@ -81,6 +84,9 @@ public class DomesticExportInvoiceRzdkController extends AbstractController {
@PostMapping("/queryVatRzcx")
public ResponseEntity<?> queryVatRzcx(Page page, @RequestBody TdxExportInvoiceModelDTO dto) {
try {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
return ResponseEntity
.ok(R.ok().put("data", tDxExportInvoiceService.queryVatRzcx(page, dto, this.getUserInfo())));
} catch (Exception e) {

@ -6,6 +6,7 @@ import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import com.dxhy.common.constant.CommonConstants;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@ -47,6 +48,9 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
@PostMapping("/authentication_list")
@ApiOperation(value = "退税手工认证列表接口")
public ResponseEntity<R> authenticationList(@RequestBody @Valid AuthenticationConditionDTO dto) {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
CommonListResponseVO<ManualAuthenticationListVO> resultVO =
domesticInvoiceDrawbackService.authenticationList(dto, getUserInfo());
return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(resultVO))));
@ -98,6 +102,9 @@ public class DomesticInvoiceDrawbackController extends AbstractController {
@PostMapping("/authentication_check")
@ApiOperation(value = "退税认证查询接口")
public ResponseEntity<R> authenticationCheck(@Valid @RequestBody AuthenticationCheckConditionDTO dto) {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
if (StringUtils.isEmpty(dto.getCompany())) {
dto.setCompany(getUserInfo().getCompany());
}

@ -10,6 +10,7 @@ import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@ -43,6 +44,9 @@ public class DomesticRefundController extends AbstractController {
@ResponseBody
public Object queryManualConfirmList(Page<Object> page, @RequestBody BaseCustomsVO baseCustomsVO) {
try {
if (StringUtils.isBlank(baseCustomsVO.getGfsh())||StringUtils.isBlank(baseCustomsVO.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
baseCustomsVO.setUserInfo(getUserInfo());
baseCustomsVO.setQsFlag(getUserInfo().getQsStatus());
baseCustomsVO.setBusiness(getUserInfo().getBusiness());
@ -135,6 +139,9 @@ public class DomesticRefundController extends AbstractController {
@ResponseBody
public Object queryConfirmList(Page<Object> page, @RequestBody BaseCustomsVO baseCustomsVO) {
try {
if (StringUtils.isBlank(baseCustomsVO.getGfsh())||StringUtils.isBlank(baseCustomsVO.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
baseCustomsVO.setUserInfo(getUserInfo());
baseCustomsVO.setBusiness(getUserInfo().getBusiness());
return ResponseEntity

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@ -19,7 +20,10 @@ public class AuthenticationCheckConditionDTO extends PageInfo implements Seriali
@NotBlank
@ApiModelProperty("购方税号,页面“购方名称”下拉框中购方名称相应税号")
private String buyerTaxNo;
private String gfsh;
@NotNull
private String companyCode;
@ApiModelProperty("业务部门,登录信息中获取部门Id")
private String deptId;

@ -19,7 +19,7 @@ public class AuthenticationConditionDTO extends PageInfo implements Serializable
@NotBlank
@ApiModelProperty("购方税号,页面“购方名称”下拉框中购方名称相应税号,默认99")
private String buyerTaxNo;
private String gfsh;
@ApiModelProperty("业务部门,登录信息中获取部门Id")
private String deptId;
@ -75,4 +75,6 @@ public class AuthenticationConditionDTO extends PageInfo implements Serializable
private String dxhyAdmin;
@ApiModelProperty("tertiary数据库")
private String dxhyTertiary;
private String companyCode;
}

@ -29,6 +29,7 @@ public class BaseCustomsVO extends CommonDTO {
/**
* 缴款书号码
*/
private String companyCode;
private String customsCode;
private String buyerName;

@ -407,7 +407,7 @@ public class DomesticExportCustomsCkServiceImpl extends ServiceImpl<DomesticExpo
JSONObject tabulateMenu = tabulateRedisService.getTabulateMenu(dto.getCompany(), dto.getMenuId());
resultData.putTabulateMenu(tabulateMenu);
if (StringUtils.isBlank(dto.getGfsh()) && dto.getGfTaxNo().size() <= 0) {
if (StringUtils.isBlank(dto.getGfsh())) {
resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase();
}

@ -386,7 +386,7 @@ public class DomesticExportInvoiceCkServiceImpl extends ServiceImpl<DomesticExpo
ResultData<Object> resultData = new ResultData<>();
resultData.putTabulateMenu(tabulateMenu);
if (StringUtils.isBlank(dto.getGfsh()) && dto.getGfTaxNo().size() <= 0) {
if (StringUtils.isBlank(dto.getGfsh())) {
resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase();
}
@ -506,7 +506,7 @@ public class DomesticExportInvoiceCkServiceImpl extends ServiceImpl<DomesticExpo
JSONObject tabulateMenu = tabulateRedisService.getTabulateMenu(dto.getCompany(), dto.getMenuId());
resultData.putTabulateMenu(tabulateMenu);
if (StringUtils.isBlank(dto.getGfsh()) && dto.getGfTaxNo().size() <= 0) {
if (StringUtils.isBlank(dto.getGfsh())) {
resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase();
}

@ -80,12 +80,7 @@ public class DomesticCustomsRefundServiceImpl extends MpBaseServiceImpl<Domestic
resultData.putTabulateMenu(tabulateMenu);
List<String> buyerTaxNoList = new ArrayList<>();
if (StringUtils.isEmpty(entity.getGfsh())) {
buyerTaxNoList = entity.getUserInfo().getOrg().stream().map(Tax::getTaxno).collect(Collectors.toList());
entity.setGfTaxNo(buyerTaxNoList);
}
if (StringUtils.isBlank(entity.getGfsh()) && buyerTaxNoList.size() <= 0) {
if (StringUtils.isBlank(entity.getGfsh())){
resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase();
}
@ -491,12 +486,6 @@ public class DomesticCustomsRefundServiceImpl extends MpBaseServiceImpl<Domestic
resultData.putTabulateMenu(tabulateMenu);
List<String> buyerTaxNoList = new ArrayList<>();
if (StringUtils.isEmpty(entity.getGfsh())) {
buyerTaxNoList = entity.getUserInfo().getOrg().stream().map(Tax::getTaxno).collect(Collectors.toList());
entity.setGfTaxNo(buyerTaxNoList);
}
Page<Map> result = this.baseMapper.queryCustomsRefundConfirmList(page, entity);
if (CollectionUtils.isNotEmpty(result.getRecords())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

@ -93,17 +93,17 @@ public class DomesticInvoiceDrawbackServiceImpl implements DomesticInvoiceDrawba
CommonListResponseVO<ManualAuthenticationListVO> responseVO =
tabulateMenu.toJavaObject(CommonListResponseVO.class);
// 判断购方税号是否指定
List<String> buyerTaxNoList;
if (CONDITION_ALL_TAG.equals(dto.getBuyerTaxNo())) {
buyerTaxNoList = UserInfoUtil.getGfshAll(userInfo.getOrg());
} else {
buyerTaxNoList = new ArrayList<>();
buyerTaxNoList.add(dto.getBuyerTaxNo());
}
// List<String> buyerTaxNoList;
// if (CONDITION_ALL_TAG.equals(dto.getBuyerTaxNo())) {
// buyerTaxNoList = UserInfoUtil.getGfshAll(userInfo.getOrg());
// } else {
// buyerTaxNoList = new ArrayList<>();
// buyerTaxNoList.add(dto.getBuyerTaxNo());
// }
// 将购方税号放入查询条件中并查询
dto.setTaxNoList(buyerTaxNoList);
if (CollectionUtils.isEmpty(dto.getTaxNoList())) {
// dto.setTaxNoList(buyerTaxNoList);
if (StringUtils.isBlank(dto.getGfsh())) {
responseVO.setDatalist(new ArrayList<>());
responseVO.setTotal(0L);
return responseVO;
@ -333,19 +333,19 @@ public class DomesticInvoiceDrawbackServiceImpl implements DomesticInvoiceDrawba
tabulateMenu.toJavaObject(CommonListResponseVO.class);
// 判断购方税号是否指定
List<String> buyerTaxNoList;
if (!CONDITION_ALL_TAG.equals(dto.getBuyerTaxNo())) {
buyerTaxNoList = new ArrayList<>();
buyerTaxNoList.add(dto.getBuyerTaxNo());
} else {
buyerTaxNoList = userInfo.getOrg().stream().map(Tax::getTaxno).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(buyerTaxNoList)) {
// List<String> buyerTaxNoList;
// if (!CONDITION_ALL_TAG.equals(dto.getBuyerTaxNo())) {
// buyerTaxNoList = new ArrayList<>();
// buyerTaxNoList.add(dto.getBuyerTaxNo());
// } else {
// buyerTaxNoList = userInfo.getOrg().stream().map(Tax::getTaxno).collect(Collectors.toList());
// }
if (StringUtils.isBlank(dto.getGfsh())) {
responseVO.setDatalist(new ArrayList<>());
responseVO.setTotal(0L);
return responseVO;
}
dto.setTaxNoList(buyerTaxNoList);
// dto.setTaxNoList(buyerTaxNoList);
DynamicContextHolder.push(userInfo.getDbName() + DbConstant.BUSINESS_READ);
PageHelper.startPage(dto.getCurrentPage(), dto.getPageSize());
dto.setDxhyAdmin(dxhyAdmin);

@ -459,16 +459,8 @@
and data_type = '17'
and export_mark='0'
and fill_in_date &gt;= '2017-01-01'
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and gf_tax_no = #{queryParams.gfsh}
</if>
and gf_tax_no = #{queryParams.gfsh}
and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and customs_code = #{queryParams.customsCode}
</if>
@ -526,16 +518,8 @@
</sql>
<sql id="queryCustomsRefundConfirm_mysql">
auth_status != '0' and (rzlx = '2' or rzlx = '3')
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and gf_tax_no = #{queryParams.gfsh}
</if>
and gf_tax_no = #{queryParams.gfsh}
and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and customs_code = #{queryParams.customsCode}
</if>

@ -136,19 +136,10 @@
t_dx_tax_current c on p.gf_tax_no = c.taxno
where
p.rzh_yesorno = '0'
and p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and p.auth_status in ('0','5','6')
and p.data_type = '17'
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and p.customs_code = #{queryParams.customsCode}
@ -187,13 +178,9 @@
t_dx_export_customs p
where
p.data_type = '17'
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
and p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
@ -203,10 +190,6 @@
and p.bdk_status = '2' and p.auth_status='4'
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and p.customs_code = #{queryParams.customsCode}
</if>
@ -261,13 +244,8 @@
t_dx_export_customs p
where
p.data_type = '17'
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
and p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
@ -277,10 +255,6 @@
and p.bdk_status = '2' and p.auth_status='4'
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and p.customs_code = #{queryParams.customsCode}
</if>

@ -186,18 +186,9 @@
p.comp_code as compCode
FROM
t_dx_export_invoice p
where company = #{queryParams.company}
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
where p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and company = #{queryParams.company}
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
@ -251,19 +242,9 @@
sum(p.export_tax_amount) as hjse
FROM
t_dx_export_invoice p
where
p.company = #{queryParams.company}
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
where p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and p.company = #{queryParams.company}
<if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
@ -343,18 +324,9 @@
t_dx_export_invoice p
where
p.auth_status != '0'
and p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and p.company = #{queryParams.company}
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
and p.rzh_yesorno = #{queryParams.rzhYesorno}
@ -432,18 +404,8 @@
t_dx_export_invoice p
where
p.auth_status != '0'
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0">
and p.gf_tax_no in
<foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
and p.gf_tax_no = #{queryParams.gfsh}
</if>
and p.gf_tax_no = #{queryParams.gfsh}
and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
and p.rzh_yesorno = #{queryParams.rzhYesorno}
</if>

@ -1527,13 +1527,12 @@
ifnull(sum(t.invoice_amount),0) totalAmount, ifnull(sum(t.tax_amount),0) totalTaxAmount
from t_dx_record_invoice t
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime}
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.gf_tax_no in
<foreach close=")" collection="taxNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
@ -1580,13 +1579,12 @@
ifnull(sum(t.invoice_amount),0) totalAmount, IFNULL(sum(t.tax_amount),0) totalTaxAmount
from t_dx_record_invoice t
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime}
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
and (t.rzlx = '2' or t.rzlx = '3')
and t.export_mark = '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach close=")" collection="taxNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
@ -1644,14 +1642,13 @@
from t_dx_record_invoice t
left join ${dxhyAdmin}.sys_business b on t.dept_id = b.business_code
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime}
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach close=")" collection="taxNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
<if test="invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}
</if>
@ -1700,13 +1697,11 @@
from t_dx_record_invoice t
left join ${dxhyAdmin}.sys_business b on t.dept_id = b.business_code
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime}
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
and (t.rzlx = '2' or t.rzlx = '3')
and t.export_mark = '0'
and t.company = #{company}
and t.gf_tax_no in
<foreach close=")" collection="taxNoList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
<if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>

@ -256,16 +256,19 @@ public class ExtFpzhcxController extends AbstractController {
data.put("bzdh",pramsMap.get("bzdh"));
data.put("bzr",pramsMap.get("bzr"));
data.put("inAccountStatus",pramsMap.get("inAccountStatus"));
List<String> gfshList = new ArrayList<>();
if (!"99".equals(pramsMap.get("gfsh")) && pramsMap.get("gfsh") != null && !"".equals(pramsMap.get("gfsh"))) {
gfshList.add(pramsMap.get("gfsh").toString());
} else {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
if (gfshList.size() == 0) {
return ResponseEntity.ok(R.ok().put("data", ""));
}
if(pramsMap.get("gfsh") == null || "".equals(pramsMap.get("gfsh"))){
return ResponseEntity.ok(R.error("购方税号不能为空"));
}
data.put("gfsh", gfshList);
String gfsh = (String) pramsMap.get("gfsh");
data.put("gfsh", gfsh);
if (pramsMap.get("companyCode") == null || "".equals(pramsMap.get("companyCode"))){
return ResponseEntity.ok(R.error("组织编码不能为空"));
}
String companyCode = (String) pramsMap.get("companyCode");
data.put("companyCode",companyCode);
if (pramsMap.get("yczt") != null && !"".equals(pramsMap.get("yczt")) && !"99".equals(pramsMap.get("yczt"))) {
data.put("yczt", pramsMap.get("yczt"));
}
@ -607,16 +610,17 @@ public class ExtFpzhcxController extends AbstractController {
pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName());
List<String> gfshList = new ArrayList<>();
if (!"99".equals(pramsMap.get("gfsh")) && pramsMap.get("gfsh") != null && !"".equals(pramsMap.get("gfsh"))) {
gfshList.add(pramsMap.get("gfsh").toString());
} else {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
if (gfshList.size() == 0) {
return ResponseEntity.ok(R.ok().put("data", ""));
}
if(pramsMap.get("gfsh") == null || "".equals(pramsMap.get("gfsh"))){
return ResponseEntity.ok(R.error("购方税号不能为空"));
}
pramsMap.put("gfsh", gfshList);
String gfsh = (String) pramsMap.get("gfsh");
pramsMap.put("gfsh", gfsh);
if (pramsMap.get("companyCode") == null || "".equals(pramsMap.get("companyCode"))){
return ResponseEntity.ok(R.error("组织编码不能为空"));
}
String companyCode = (String) pramsMap.get("companyCode");
pramsMap.put("companyCode",companyCode);
if (pramsMap.get("kpksrq") != null && !"".equals(pramsMap.get("kpksrq"))) {
pramsMap.put("kpksrq", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("kpksrq").toString())));

@ -39,10 +39,8 @@
${dxhyTertiary}.t_dx_record_invoice t
left join ${dxhyDetail}.t_dx_record_invoice_detail b on t.uuid = b.uuid
where t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test=" xfmc !=null and xfmc !='' and xfmc != 'null' ">
and t.xf_name like CONCAT(#{xfmc},'%')
</if>

@ -71,28 +71,8 @@
from t_dx_record_invoice t
WHERE t.company = #{company}
and t.invoice_date between #{kpksrq} and #{kpjsrq}
<if test="sign != '88'">
and t.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
<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>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test="bzdh != null and bzdh != '' and bzdh != 'null'">
and t.bzdh = #{bzdh}
</if>
@ -351,28 +331,8 @@
from t_dx_record_invoice t
where t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.company = #{company}
<if test="sign != '88'">
and t.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
<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>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' and invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus}

@ -30,10 +30,8 @@
and t.invoice_type in ('01','03','08','14')
and t.company = #{company}
and DATE_FORMAT(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<choose>
<when test="yczt != null and yczt != '' and yczt != 'null'">
and t.invoice_status = #{yczt}
@ -81,10 +79,8 @@
and t.invoice_type in ('01','03','08','14')
and t.company = #{company}
and DATE_FORMAT(t.invoice_date,'%Y-%m-%d') between #{kpksrq} and #{kpjsrq}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<choose>
<when test="yczt != null and yczt != '' and yczt != '0'">
and t.invoice_status = #{yczt}

@ -58,10 +58,8 @@
and t.invoice_type in ('01','03','08','14','31')
and t.company = #{company}
and t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test="bzdh != null and bzdh != '' and bzdh != 'null'">
and t.bzdh = #{bzdh}
</if>
@ -183,10 +181,8 @@
and t.invoice_type in ('01','03','08','14','31')
and t.company = #{company}
and t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.gf_tax_no = #{gfsh}
and (t.comp_code = #{companyCode} or t.comp_code = '' or t.comp_code is null)
<if test="bzdh != null and bzdh != '' and bzdh != 'null'">
and t.bzdh = #{bzdh}
</if>

Loading…
Cancel
Save