Commit 4eb7b080 by 徐高华

异常处理

parent 30da8a99
...@@ -472,6 +472,10 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -472,6 +472,10 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
@Override @Override
public void getMomentId(Long planId) { public void getMomentId(Long planId) {
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ; TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
if(null == plan) {
logger.info("计划已删除");
return;
}
String wxEnterpriseId =plan.getWxEnterpriseId() ; String wxEnterpriseId =plan.getWxEnterpriseId() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(), ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
......
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService; import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
...@@ -66,9 +69,78 @@ public class ServiceTest { ...@@ -66,9 +69,78 @@ public class ServiceTest {
System.out.println(System.currentTimeMillis()); System.out.println(System.currentTimeMillis());
} }
public static void main(String[] args) {
String jsonStr= "{\"errorCode\":0,\"message\":\"操作失败\",\"result\":{\"errcode\":0,\"buy_list\":[{\"corpid\":\"wp59NLDQAAlZ9Rult9unyE4roTdV8a_w\",\"sub_order_id\":\"OI00000D4BD3E7680DED116965C5CN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAAGUfp8zn_ez-oYnKoPoihcw\",\"sub_order_id\":\"OI00000D4BD3E7680DED1118F5758N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":44}},{\"corpid\":\"wp59NLDQAATvkxhisqE3NXp90IvMmdZg\",\"sub_order_id\":\"OI00000D4BD3E7680DED117813A43N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":40}},{\"corpid\":\"wp59NLDQAAU5xS6uHuRZQctEqJ4TjFvA\",\"sub_order_id\":\"OI00000D4BD3E7680DED111BF533CN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":30}},{\"corpid\":\"wp59NLDQAA9g337QS5MVmjLHufy8EbcA\",\"sub_order_id\":\"OI00000D4BD3E7680DED115F22364N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":15}},{\"corpid\":\"wp59NLDQAA1OsuBr_Ac4c7EkwTIPLfCg\",\"sub_order_id\":\"OI00000D4BD3E7680DED116BA4795N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAy54low6qauvmN0lB2FiLzA\",\"sub_order_id\":\"OI00000D4BD3E7680DED116602217N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":65}},{\"corpid\":\"wp59NLDQAAmsl3meSg7NJAumEGtT5tyg\",\"sub_order_id\":\"OI00000D4BD3E7680DED11077BAF6N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":33}},{\"corpid\":\"wp59NLDQAALEf-MGwDpgZOl6GdWl7gww\",\"sub_order_id\":\"OI00000D4BD3E7680DED113A7E88DN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":37}},{\"corpid\":\"wp59NLDQAAK3R7gkc4UiZZMAdSd0wvAQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED11310D0ABN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":26}},{\"corpid\":\"wp59NLDQAAWRSxDmV1ZSJ7fGdLtTXXbg\",\"sub_order_id\":\"OI00000D4BD3E7680DED123E4DC44N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAARKujYEXe1nB_PRFE4RCrCA\",\"sub_order_id\":\"OI00000D4BD3E7680DED1210DAC12N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAYWli5ocP5GXponVDa3AjPQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED125E44D6DN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":50}},{\"corpid\":\"wp59NLDQAA_5wb25e2d6NGAlFrEB9PNQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED120E62EDBN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":30}},{\"corpid\":\"wp59NLDQAA321-b4ux0oXNpXLfWU8hjw\",\"sub_order_id\":\"OI00000D4BD3E7680DED12422BFF3N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAAy314aiNop5slRXNbvMcMeg\",\"sub_order_id\":\"OI00000D4BD3E7680DED1239D5293N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":42}},{\"corpid\":\"wp59NLDQAAjLLBiDY-7Y4BZt2E3DZ_qQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED1240E5675N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":8}},{\"corpid\":\"wp59NLDQAAdl7NgGUvIQnROSg57JfeVg\",\"sub_order_id\":\"OI00000D4BD3E7680DED125C2B87DN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAomGLxnDeXtvfgZ0asxzE_g\",\"sub_order_id\":\"OI00000D4BD3E7680DED122DAA3A8N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAAFqMr4D7rXgLKTqpJIR8Teg\",\"sub_order_id\":\"OI00000D4BD3E7680DED122916C2BN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":12}},{\"corpid\":\"wp59NLDQAAcUtEX6_OeOU7AYqLhpCakw\",\"sub_order_id\":\"OI00000D4BD3E7680DED123C01CC2N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAMLWSg5yaxaWzydLT8IVViA\",\"sub_order_id\":\"OI00000D4BD3E7680DED12534E86DN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":16}},{\"corpid\":\"wp59NLDQAAST74gAhNRf4LjpUQB7eTRA\",\"sub_order_id\":\"OI00000D4BD3E7680DED124FE37F9N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":16}},{\"corpid\":\"wp59NLDQAAFKFX-1SIWJHTC9Lfla_LhQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED12245A818N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":15}},{\"corpid\":\"wp59NLDQAAvEZNjlBiV48WxS79dVpQ2A\",\"sub_order_id\":\"OI00000D4BD3E7680DED12033DBD0N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":15}},{\"corpid\":\"wp59NLDQAAfiyAZX1AZaqdl2Gi8AITYg\",\"sub_order_id\":\"OI00000D4BD3E7680DED120BFDE88N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":150}},{\"corpid\":\"wp59NLDQAAMOpiKesxQyf6lgO34rN_VA\",\"sub_order_id\":\"OI00000D4BD3E7680DED121647E84N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":23}},{\"corpid\":\"wp59NLDQAA-N2yhlxIL6Nu9-2JuslG4Q\",\"sub_order_id\":\"OI00000D4BD3E7680DED12335C17BN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAmG8VtKfVWd5mh5mc8ydQEg\",\"sub_order_id\":\"OI00000D4BD3E7680DED1220E7BF1N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":21}},{\"corpid\":\"wp59NLDQAAY3xucFkJn7EUfDx_PqGFhw\",\"sub_order_id\":\"OI00000D4BD3E7680DED120C47498N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAAaTnDWcpvb7L0EKfjjRj1CQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED136090AB3N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":16}},{\"corpid\":\"wp59NLDQAAJmZ0cgpH_o5_ElpAaM76ww\",\"sub_order_id\":\"OI00000D4BD3E7680DED1343FFE56N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":20}},{\"corpid\":\"wp59NLDQAAqdPjlqsjrGh5A5zhTdAjDQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED1354650C6N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":11}},{\"corpid\":\"wp59NLDQAAIQhZmMlD_R_Zhzpwk7nKpg\",\"sub_order_id\":\"OI00000D4BD3E7680DED1315779CAN\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":10}},{\"corpid\":\"wp59NLDQAAODq-aJ0aX1faHvqHJKjB4w\",\"sub_order_id\":\"OI00000D4BD3E7680DED1301AEBB4N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":2}},{\"corpid\":\"wp59NLDQAADjdhTn-mF0SgaMCA6dtlEQ\",\"sub_order_id\":\"OI00000D4BD3E7680DED1315BCA83N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":2}},{\"corpid\":\"wp59NLDQAAiVDbe9wuHbvWsY2Kl6LNXw\",\"sub_order_id\":\"OI00000D4BD3E7680DED134DB1B84N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":3}},{\"corpid\":\"wp59NLDQAAtUoDgmRomOAJncgidWcT0A\",\"sub_order_id\":\"OI00000D4BD3E7680DED131AEB6D6N\",\"account_duration\":{\"months\":12},\"account_count\":{\"base_count\":0,\"external_contact_count\":2}}],\"errmsg\":\"ok\",\"has_more\":0,\"order\":{\"order_status\":1,\"create_time\":1745743121,\"price\":3615000,\"order_id\":\"OI00000D4BD3E7680DED11773F145F\",\"order_type\":8,\"pay_time\":1745743753}},\"detailError\":null}" ;
JSONObject j1 = JSONObject.parseObject(jsonStr);
JSONObject j2 = j1.getJSONObject("result") ;
JSONArray a1 = j2.getJSONArray("buy_list") ;
for(int i=0;i<a1.size();i++) {
JSONObject j3 = a1.getJSONObject(i) ;
String corpid = j3.getString("corpid") ;
String sub_order_id = j3.getString("sub_order_id") ;
int months = j3.getJSONObject("account_duration").getIntValue("months") ;
int account_count = j3.getJSONObject("account_count").getIntValue("external_contact_count") ;
String sql = String.format("INSERT INTO `haoban3.0`.`tab_haoban_qywx_fee_order` (`fee_order_id`, `order_id`, `corp_id`, `wx_enterprise_id`, `order_type`, `order_status`, `price`, `base_count`, `external_contact_count`, `months`, `create_time`, `pay_time`, `update_time`) " +
"VALUES ('%s', '%s', '%s', '%s', '1', '1', '0', '0', '%s', '%s', '2025-04-27 12:00:00', '2025-04-27 12:00:00', '2025-04-27 12:00:00');" , UniqueIdUtils.uniqueLong(),sub_order_id,corpid,"",account_count,months) ;
System.out.println(sql);
}
}
// UPDATE `haoban3.0`.`tab_haoban_qywx_fee_order` a LEFT JOIN `haoban3.0`.tab_haoban_wx_enterprise b ON a.corp_id=b.`open_corpid` SET a.wx_enterprise_id=b.`wx_enterprise_id` WHERE a.`wx_enterprise_id` ='' AND b.`wx_enterprise_id` IS NOT NULL
@Test @Test
public void test3() { public void test3() {
haobanQywxFeeApiService.addFee("5bd929fd3b2c49deaa1184bcb0d669b3");
List<String> list= Arrays.asList("0bd39f2386824e41a0a145cc4dcda29d",
"0feac8068fef4736b03a57aeb0c03cb5",
"18e66bd54f694399be7271befe2205bc",
"1ccbf4b3646a4697969760bfe9879816",
"2277c0c559bc4671bf2246905217136b",
"232389f7ab2e4e529b6818ff0eeacd5c",
"249d8e02797b40fba8c38c88d01d2fcb",
"255903d9ba5c4aa1b7c5f81912dfbd37",
"37331d01245d434896bc54bffc69dcf6",
"398fa1d1021c4ed6b40582d6c695a495",
"3b06ddfc9eed4e9ba4b7af13926402cc",
"3b63712d97944996959b72c1df443491",
"457d80d1ac65483fb04d37fc4ef945a9",
"45a039d8b56a4b78b4cd316b9485fc7a",
"4bb66817efe44cde8d5ca53fce61a1bd",
"54bc94380dbe42d69feeeff7992da1f6",
"55902436994f4949a3f6e6b901510061",
"6326baa3cb7a4ba6a9d75a85a2c07769",
"68d1fa15838a4604a58af9c5dcff1a23",
"70ec36aa789f41ed9c8e11210e06fae2",
"771c4c6d5d9844ff85550f3764fe3741",
"778fefcbbf5c43969d17b1895a406237",
"8167f2030c06456f91020f2ea62b231a",
"8aef68018c3a4a25a8d8c89e63af3191",
"8e4e3768c05048dfb286aca9e097c053",
"91a7d4ce31e34163a7cd56d1487decb1",
"94a8d2b32e4c494db3055cd39771e1d6",
"979278e8b08c4b7aa5bfb95ec4cac89a",
"a05c50e72a0945b9afe175d4ad3f258f",
"aaeb11a19ebc49d0b9e05f4c6e0ee98e",
"b724dd8c26684db4ba3993972c4f76ae",
"bbf8e5d0aac64b0b982e3afd971b8ff0",
"d1b2bcfe1f814f2b934334c4c22419a2",
"e8ed7566c9ef421895235b69b51d01fd",
"f7dea30408aa47a6aed0edcd801e1500",
"fa88746dfe964acd8761d1de8ff7d139",
"fcae29cc5d7d4739a353e777e5e77d82") ;
for(int i=0;i<list.size();i++) {
haobanQywxFeeApiService.addFee(list.get(i));
}
} }
@Test @Test
......
...@@ -139,6 +139,9 @@ public class OfflinePreController { ...@@ -139,6 +139,9 @@ public class OfflinePreController {
if(StringUtils.isBlank(offlinePreId) || !offlinePreId.trim().chars().allMatch(Character::isDigit)) { if(StringUtils.isBlank(offlinePreId) || !offlinePreId.trim().chars().allMatch(Character::isDigit)) {
return RestResponse.failure("9999","参数错误") ; return RestResponse.failure("9999","参数错误") ;
} }
if(offlinePreId.length()>18) {
return RestResponse.failure("9999","参数错误") ;
}
ServiceResponse<Void> countOfflinePre = offlinePreApiService.checkOfflinePreWriteOff(Long.valueOf(offlinePreId.trim()), storeId); ServiceResponse<Void> countOfflinePre = offlinePreApiService.checkOfflinePreWriteOff(Long.valueOf(offlinePreId.trim()), storeId);
return JSONObject.parseObject(JSONObject.toJSONString(countOfflinePre, SerializerFeature.WriteMapNullValue), RestResponse.class); return JSONObject.parseObject(JSONObject.toJSONString(countOfflinePre, SerializerFeature.WriteMapNullValue), RestResponse.class);
} }
......
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