Commit f007cc14 by ddx

增加全部重置按钮

parent a4d0c29c
......@@ -17,6 +17,7 @@ public class InvoiceFileTaxBatchManageReq implements Serializable {
private static final long serialVersionUID = 191691175092676480L;
private String userCode;
private String errorCode;
private String zoneCode;
private List<InvoiceFileTaxBatchManageFunctionReq> functionList;
}
......@@ -18,4 +18,5 @@ import lombok.*;
public class TokenInfo {
private String taxno;
private String zoneCode;
private String userCode;
}
......@@ -16,6 +16,7 @@ import java.util.List;
@Service
public interface TokenClient {
@RequestMapping(value ="/client/selectTokenListByErrorCode" , method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"})
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode",required = true)String userCode,
@RequestParam(value="errorCode",required = true)String errorCode);
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode")String userCode,
@RequestParam(value="errorCode")String errorCode,
@RequestParam(value="zoneCode")String zoneCode);
}
......@@ -1192,7 +1192,8 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
@Override
public JsonResult<String> batchTaxManage(InvoiceFileTaxBatchManageReq invoiceFileTaxBatchManageReq) {
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;
for(TokenInfo errorToken:errorTokenList) {
......@@ -1204,11 +1205,11 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
invoiceFileReq.setTaxno(errorToken.getTaxno());
invoiceFileReq.setZoneCode(errorToken.getZoneCode());
invoiceFileReq.setFunctionList(functionList);
invoiceFileReq.setAccessKeyID(invoiceFileTaxBatchManageReq.getUserCode());
invoiceFileReq.setAccessKeyID(errorToken.getUserCode());
invoiceFileReq.setSignatureNonce(uuidFlag);
JsonResult<String> manageResult = taxManage(invoiceFileReq);
log.info(uuidFlag + "taxManage" + manageResult);
log.info(uuidFlag + " batchTaxManage " + manageResult);
if(manageResult.isSuccess()) {
rightNum++;
}
......
......@@ -99,5 +99,6 @@ public interface TkTokenMapper {
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 @@
FROM
tk_token t
WHERE
t.user_code = #{userCode,jdbcType=VARCHAR}
and t.error_code = #{errorCode,jdbcType=VARCHAR}
AND t.is_valid = '0'
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}
</if>
<if test="zoneCode != null and zoneCode !=''">
and t.zone_code = #{zoneCode,jdbcType=VARCHAR}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -51,7 +51,7 @@ public interface TkTokenService {
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);
......
......@@ -970,12 +970,12 @@ public class TkTokenServiceImpl implements TkTokenService {
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<TkToken> errorTokenList = tkTokenMapper.selectTokenListByErrorCode(userCode, errorCode);
List<TkToken> errorTokenList = tkTokenMapper.selectTokenListByErrorCode(userCode, errorCode, zoneCode);
if(null!=errorTokenList&&errorTokenList.size()>0) {
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());
......
......@@ -214,9 +214,10 @@ public class TokenController extends BaseClientController {
@RequestMapping(value ="/selectTokenListByErrorCode")
@LogT
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode",required = true)String userCode,
@RequestParam(value="errorCode",required = true)String errorCode){
return tokenService.selectTokenListByErrorCode(userCode, errorCode);
public List<TokenInfo> selectTokenListByErrorCode(@RequestParam(value="userCode")String userCode,
@RequestParam(value="errorCode")String errorCode,
@RequestParam(value="zoneCode")String zoneCode){
return tokenService.selectTokenListByErrorCode(userCode, errorCode, zoneCode);
}
}
......@@ -13,8 +13,8 @@ import java.util.Map;
public class TokenUnitTest {
// static String host = "http://47.94.208.133:8762";
static String host = "http://127.0.0.1:8762";
// static String host = "https://api.xfapiao.com";
// static String host = "http://127.0.0.1:8762";
static String host = "https://api.xfapiao.com";
String accessKeyID = "eyongyou";
static String accessKeySecret = "yongyou!@#566ccd";
......@@ -173,8 +173,8 @@ public class TokenUnitTest {
param.put("taxno","91440101MA5CRHH33W");
param.put("zoneCode","4400");
param.put("site","4400");
param.put("target","4400");
// param.put("site","4400");
// param.put("target","4400");
Map userparam = new HashMap<>();
......@@ -184,7 +184,7 @@ public class TokenUnitTest {
userparam.put("userType","办税人");
userparam.put("password","Fanny123456");
// param.put("userInfoJson",userparam);
param.put("userInfoJson",userparam);
System.out.println(url);
System.out.println(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