Commit f007cc14 by ddx

增加全部重置按钮

parent a4d0c29c
...@@ -17,6 +17,7 @@ public class InvoiceFileTaxBatchManageReq implements Serializable { ...@@ -17,6 +17,7 @@ public class InvoiceFileTaxBatchManageReq implements Serializable {
private static final long serialVersionUID = 191691175092676480L; private static final long serialVersionUID = 191691175092676480L;
private String userCode; private String userCode;
private String errorCode; private String errorCode;
private String zoneCode;
private List<InvoiceFileTaxBatchManageFunctionReq> functionList; private List<InvoiceFileTaxBatchManageFunctionReq> functionList;
} }
...@@ -18,4 +18,5 @@ import lombok.*; ...@@ -18,4 +18,5 @@ import lombok.*;
public class TokenInfo { public class TokenInfo {
private String taxno; private String taxno;
private String zoneCode; private String zoneCode;
private String userCode;
} }
...@@ -16,6 +16,7 @@ import java.util.List; ...@@ -16,6 +16,7 @@ import java.util.List;
@Service @Service
public interface TokenClient { public interface TokenClient {
@RequestMapping(value ="/client/selectTokenListByErrorCode" , method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"}) @RequestMapping(value ="/client/selectTokenListByErrorCode" , method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"})
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode",required = true)String userCode, public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode")String userCode,
@RequestParam(value="errorCode",required = true)String errorCode); @RequestParam(value="errorCode")String errorCode,
@RequestParam(value="zoneCode")String zoneCode);
} }
...@@ -1192,7 +1192,8 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -1192,7 +1192,8 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
@Override @Override
public JsonResult<String> batchTaxManage(InvoiceFileTaxBatchManageReq invoiceFileTaxBatchManageReq) { public JsonResult<String> batchTaxManage(InvoiceFileTaxBatchManageReq invoiceFileTaxBatchManageReq) {
JsonResult jsonResult = new JsonResult(); JsonResult jsonResult = new JsonResult();
List<TokenInfo> errorTokenList = tokenClient.selectTokenListByErrorCode(invoiceFileTaxBatchManageReq.getUserCode(), invoiceFileTaxBatchManageReq.getErrorCode()); List<TokenInfo> errorTokenList = tokenClient.selectTokenListByErrorCode(invoiceFileTaxBatchManageReq.getUserCode(),
invoiceFileTaxBatchManageReq.getErrorCode(), invoiceFileTaxBatchManageReq.getZoneCode());
int rightNum = 0; int rightNum = 0;
for(TokenInfo errorToken:errorTokenList) { for(TokenInfo errorToken:errorTokenList) {
...@@ -1204,11 +1205,11 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -1204,11 +1205,11 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
invoiceFileReq.setTaxno(errorToken.getTaxno()); invoiceFileReq.setTaxno(errorToken.getTaxno());
invoiceFileReq.setZoneCode(errorToken.getZoneCode()); invoiceFileReq.setZoneCode(errorToken.getZoneCode());
invoiceFileReq.setFunctionList(functionList); invoiceFileReq.setFunctionList(functionList);
invoiceFileReq.setAccessKeyID(invoiceFileTaxBatchManageReq.getUserCode()); invoiceFileReq.setAccessKeyID(errorToken.getUserCode());
invoiceFileReq.setSignatureNonce(uuidFlag); invoiceFileReq.setSignatureNonce(uuidFlag);
JsonResult<String> manageResult = taxManage(invoiceFileReq); JsonResult<String> manageResult = taxManage(invoiceFileReq);
log.info(uuidFlag + "taxManage" + manageResult); log.info(uuidFlag + " batchTaxManage " + manageResult);
if(manageResult.isSuccess()) { if(manageResult.isSuccess()) {
rightNum++; rightNum++;
} }
......
...@@ -99,5 +99,6 @@ public interface TkTokenMapper { ...@@ -99,5 +99,6 @@ public interface TkTokenMapper {
int updateTokenInfo(TkToken record); int updateTokenInfo(TkToken record);
List<TkToken> selectTokenListByErrorCode(@Param("userCode") String userCode, @Param("errorCode") String errorCode); List<TkToken> selectTokenListByErrorCode(@Param("userCode") String userCode,
@Param("errorCode") String errorCode, @Param("zoneCode") String zoneCode);
} }
\ No newline at end of file
...@@ -543,8 +543,15 @@ ...@@ -543,8 +543,15 @@
FROM FROM
tk_token t tk_token t
WHERE WHERE
t.user_code = #{userCode,jdbcType=VARCHAR} t.is_valid = '0'
<if test="userCode != null and userCode !=''">
and t.user_code = #{userCode,jdbcType=VARCHAR}
</if>
<if test="errorCode != null and errorCode !=''">
and t.error_code = #{errorCode,jdbcType=VARCHAR} and t.error_code = #{errorCode,jdbcType=VARCHAR}
AND t.is_valid = '0' </if>
<if test="zoneCode != null and zoneCode !=''">
and t.zone_code = #{zoneCode,jdbcType=VARCHAR}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -51,7 +51,7 @@ public interface TkTokenService { ...@@ -51,7 +51,7 @@ public interface TkTokenService {
JsonResult<String> queryTokenInfo(String optType, String userCode, String taxno); JsonResult<String> queryTokenInfo(String optType, String userCode, String taxno);
List<TokenInfo> selectTokenListByErrorCode(String userCode, String errorCode); List<TokenInfo> selectTokenListByErrorCode(String userCode, String errorCode, String zoneCode);
boolean checkTokenRealRequestCount(String userCode, String taxno); boolean checkTokenRealRequestCount(String userCode, String taxno);
......
...@@ -970,12 +970,12 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -970,12 +970,12 @@ public class TkTokenServiceImpl implements TkTokenService {
return result; return result;
} }
public List<TokenInfo> selectTokenListByErrorCode(String userCode, String errorCode) { public List<TokenInfo> selectTokenListByErrorCode(String userCode, String errorCode, String zoneCode) {
List<TokenInfo> showTokenList = Lists.newArrayList(); List<TokenInfo> showTokenList = Lists.newArrayList();
List<TkToken> errorTokenList = tkTokenMapper.selectTokenListByErrorCode(userCode, errorCode); List<TkToken> errorTokenList = tkTokenMapper.selectTokenListByErrorCode(userCode, errorCode, zoneCode);
if(null!=errorTokenList&&errorTokenList.size()>0) { if(null!=errorTokenList&&errorTokenList.size()>0) {
for(TkToken token:errorTokenList) { for(TkToken token:errorTokenList) {
showTokenList.add(TokenInfo.builder().taxno(token.getTaxno()).zoneCode(token.getZoneCode()).build()); showTokenList.add(TokenInfo.builder().taxno(token.getTaxno()).zoneCode(token.getZoneCode()).userCode(token.getUserCode()).build());
} }
} }
logger.info("selectTokenListByErrorCode number is " + showTokenList.size()); logger.info("selectTokenListByErrorCode number is " + showTokenList.size());
......
...@@ -214,9 +214,10 @@ public class TokenController extends BaseClientController { ...@@ -214,9 +214,10 @@ public class TokenController extends BaseClientController {
@RequestMapping(value ="/selectTokenListByErrorCode") @RequestMapping(value ="/selectTokenListByErrorCode")
@LogT @LogT
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode",required = true)String userCode, public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode")String userCode,
@RequestParam(value="errorCode",required = true)String errorCode){ @RequestParam(value="errorCode")String errorCode,
return tokenService.selectTokenListByErrorCode(userCode, errorCode); @RequestParam(value="zoneCode")String zoneCode){
return tokenService.selectTokenListByErrorCode(userCode, errorCode, zoneCode);
} }
} }
...@@ -13,8 +13,8 @@ import java.util.Map; ...@@ -13,8 +13,8 @@ import java.util.Map;
public class TokenUnitTest { public class TokenUnitTest {
// static String host = "http://47.94.208.133:8762"; // static String host = "http://47.94.208.133:8762";
static String host = "http://127.0.0.1:8762"; // static String host = "http://127.0.0.1:8762";
// static String host = "https://api.xfapiao.com"; static String host = "https://api.xfapiao.com";
String accessKeyID = "eyongyou"; String accessKeyID = "eyongyou";
static String accessKeySecret = "yongyou!@#566ccd"; static String accessKeySecret = "yongyou!@#566ccd";
...@@ -173,8 +173,8 @@ public class TokenUnitTest { ...@@ -173,8 +173,8 @@ public class TokenUnitTest {
param.put("taxno","91440101MA5CRHH33W"); param.put("taxno","91440101MA5CRHH33W");
param.put("zoneCode","4400"); param.put("zoneCode","4400");
param.put("site","4400"); // param.put("site","4400");
param.put("target","4400"); // param.put("target","4400");
Map userparam = new HashMap<>(); Map userparam = new HashMap<>();
...@@ -184,7 +184,7 @@ public class TokenUnitTest { ...@@ -184,7 +184,7 @@ public class TokenUnitTest {
userparam.put("userType","办税人"); userparam.put("userType","办税人");
userparam.put("password","Fanny123456"); userparam.put("password","Fanny123456");
// param.put("userInfoJson",userparam); param.put("userInfoJson",userparam);
System.out.println(url); System.out.println(url);
System.out.println(JSON.toJSONString(param)); System.out.println(JSON.toJSONString(param));
ResponseContent ret = HttpHelper.postJsonEntity(url,JSON.toJSONString(param)); ResponseContent ret = HttpHelper.postJsonEntity(url,JSON.toJSONString(param));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment