购方税号和组织编码修改

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. 20
      dxhy-export-domestic/src/main/resources/mapper/DomesticCustomsRecordMapper.xml
  13. 40
      dxhy-export-domestic/src/main/resources/mapper/DomesticExportCustomsMapper.xml
  14. 56
      dxhy-export-domestic/src/main/resources/mapper/DomesticExportInvoiceMapper.xml
  15. 27
      dxhy-export-domestic/src/main/resources/mapper/DomesticRecordInvoiceMapper.xml
  16. 36
      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") @PostMapping("/queryBdkByPage")
public ResponseEntity<?> queryBdkByPage(Page page, @RequestBody TdxExportCustomsModelDTO dto) { public ResponseEntity<?> queryBdkByPage(Page page, @RequestBody TdxExportCustomsModelDTO dto) {
try { try {
if (StringUtils.isBlank(dto.getGfsh())||StringUtils.isBlank(dto.getCompanyCode())){
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
return ResponseEntity return ResponseEntity
.ok(R.ok().put("data", domesticExportCustomsCkService.queryBdkByPage(page, dto, this.getUserInfo()))); .ok(R.ok().put("data", domesticExportCustomsCkService.queryBdkByPage(page, dto, this.getUserInfo())));
} catch (Exception e) { } catch (Exception e) {

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

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

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

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

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

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

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

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

@ -80,12 +80,7 @@ public class DomesticCustomsRefundServiceImpl extends MpBaseServiceImpl<Domestic
resultData.putTabulateMenu(tabulateMenu); resultData.putTabulateMenu(tabulateMenu);
List<String> buyerTaxNoList = new ArrayList<>(); if (StringUtils.isBlank(entity.getGfsh())){
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) {
resultData.setDataList(new ArrayList<>()); resultData.setDataList(new ArrayList<>());
return resultData.toJsonBase(); return resultData.toJsonBase();
} }
@ -491,12 +486,6 @@ public class DomesticCustomsRefundServiceImpl extends MpBaseServiceImpl<Domestic
resultData.putTabulateMenu(tabulateMenu); 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); Page<Map> result = this.baseMapper.queryCustomsRefundConfirmList(page, entity);
if (CollectionUtils.isNotEmpty(result.getRecords())) { if (CollectionUtils.isNotEmpty(result.getRecords())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

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

@ -459,16 +459,8 @@
and data_type = '17' and data_type = '17'
and export_mark='0' and export_mark='0'
and fill_in_date &gt;= '2017-01-01' 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} and gf_tax_no = #{queryParams.gfsh}
</if> and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''"> <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and customs_code = #{queryParams.customsCode} and customs_code = #{queryParams.customsCode}
</if> </if>
@ -526,16 +518,8 @@
</sql> </sql>
<sql id="queryCustomsRefundConfirm_mysql"> <sql id="queryCustomsRefundConfirm_mysql">
auth_status != '0' and (rzlx = '2' or rzlx = '3') 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} and gf_tax_no = #{queryParams.gfsh}
</if> and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
<if test="queryParams.customsCode!=null and queryParams.customsCode!=''"> <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
and customs_code = #{queryParams.customsCode} and customs_code = #{queryParams.customsCode}
</if> </if>

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

@ -186,18 +186,9 @@
p.comp_code as compCode p.comp_code as compCode
FROM FROM
t_dx_export_invoice p t_dx_export_invoice p
where company = #{queryParams.company} where p.gf_tax_no = #{queryParams.gfsh}
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0"> and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and p.gf_tax_no in and company = #{queryParams.company}
<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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()"> <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')) 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 sum(p.export_tax_amount) as hjse
FROM FROM
t_dx_export_invoice p t_dx_export_invoice p
where where p.gf_tax_no = #{queryParams.gfsh}
p.company = #{queryParams.company} and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
<if test="queryParams.gfTaxNo!=null and queryParams.gfTaxNo.size>0"> and p.company = #{queryParams.company}
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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()"> <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')) 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 t_dx_export_invoice p
where where
p.auth_status != '0' p.auth_status != '0'
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} and p.gf_tax_no = #{queryParams.gfsh}
</if> and (p.comp_code = #{queryParams.companyCode} or p.comp_code = '' or p.comp_code is null)
and p.company = #{queryParams.company}
<if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 "> <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
and p.rzh_yesorno = #{queryParams.rzhYesorno} and p.rzh_yesorno = #{queryParams.rzhYesorno}
@ -432,18 +404,8 @@
t_dx_export_invoice p t_dx_export_invoice p
where where
p.auth_status != '0' 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} and p.gf_tax_no = #{queryParams.gfsh}
</if> 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 "> <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
and p.rzh_yesorno = #{queryParams.rzhYesorno} and p.rzh_yesorno = #{queryParams.rzhYesorno}
</if> </if>

@ -1527,13 +1527,12 @@
ifnull(sum(t.invoice_amount),0) totalAmount, ifnull(sum(t.tax_amount),0) totalTaxAmount ifnull(sum(t.invoice_amount),0) totalAmount, ifnull(sum(t.tax_amount),0) totalTaxAmount
from t_dx_record_invoice t from t_dx_record_invoice t
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime} 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.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'
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' "> <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo} and t.invoice_no = #{invoiceNo}
</if> </if>
@ -1580,13 +1579,12 @@
ifnull(sum(t.invoice_amount),0) totalAmount, IFNULL(sum(t.tax_amount),0) totalTaxAmount ifnull(sum(t.invoice_amount),0) totalAmount, IFNULL(sum(t.tax_amount),0) totalTaxAmount
from t_dx_record_invoice t from t_dx_record_invoice t
WHERE date_format(t.invoice_date,'%Y-%m-%d') between #{invoiceStartTime} and #{invoiceEndTime} 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.rzlx = '2' or t.rzlx = '3')
and t.export_mark = '0' and t.export_mark = '0'
and t.company = #{company} 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' "> <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo} and t.invoice_no = #{invoiceNo}
</if> </if>
@ -1644,14 +1642,13 @@
from t_dx_record_invoice t from t_dx_record_invoice t
left join ${dxhyAdmin}.sys_business b on t.dept_id = b.business_code 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} 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.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'
and t.company = #{company} 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'"> <if test="invoiceStatus != '99'">
and t.invoice_status = #{invoiceStatus} and t.invoice_status = #{invoiceStatus}
</if> </if>
@ -1700,13 +1697,11 @@
from t_dx_record_invoice t from t_dx_record_invoice t
left join ${dxhyAdmin}.sys_business b on t.dept_id = b.business_code 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} 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.rzlx = '2' or t.rzlx = '3')
and t.export_mark = '0' and t.export_mark = '0'
and t.company = #{company} 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' "> <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo} and t.invoice_no = #{invoiceNo}
</if> </if>

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

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

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

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

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

Loading…
Cancel
Save