|
@@ -29,6 +29,7 @@ import com.ruoyi.system.mapper.InvestigateTableMapper;
|
|
|
import com.ruoyi.system.domain.InvestigateTable;
|
|
|
import com.ruoyi.system.service.IInvestigateTableService;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
import static com.ruoyi.common.config.RuoYiConfig.getProfile;
|
|
|
|
|
|
|
|
@@ -86,12 +87,12 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
|
|
|
Long investigateTableId = table.getInvestigateTableId();
|
|
|
sb.append(investigateTableId).append(",");
|
|
|
}
|
|
|
- String substring = sb.substring(0,sb.length() - 1);
|
|
|
+ String substring = sb.substring(0, sb.length() - 1);
|
|
|
|
|
|
investigateTable.setInvestigateTableIds(substring);
|
|
|
investigateTablesAll = investigateTableMapper.selectInvestigateTableListALL(investigateTable);
|
|
|
}
|
|
|
- if (investigateTablesAll != null && investigateTablesAll.size() > 0){
|
|
|
+ if (investigateTablesAll != null && investigateTablesAll.size() > 0) {
|
|
|
for (InvestigateTable table : investigateTablesAll) {
|
|
|
table.setType("进行中");
|
|
|
|
|
@@ -99,11 +100,11 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
|
|
|
Date endTime = table.getEndTime();
|
|
|
Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
|
- if (nowDate.before(beginTime)){
|
|
|
+ if (nowDate.before(beginTime)) {
|
|
|
|
|
|
table.setType("未开始");
|
|
|
|
|
|
- }else if (nowDate.after(endTime)){
|
|
|
+ } else if (nowDate.after(endTime)) {
|
|
|
|
|
|
table.setType("已结束");
|
|
|
}
|
|
@@ -179,7 +180,7 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
|
|
|
|
|
|
for (int i = 0; i < investigateDispositionTableList.size(); i++) {
|
|
|
Date nowDate = new Date();
|
|
|
- nowDate.setTime(nowDate.getTime()+ (i* 1000L));
|
|
|
+ nowDate.setTime(nowDate.getTime() + (i * 1000L));
|
|
|
InvestigateDispositionTable investigateDispositionTable = investigateDispositionTableList.get(i);
|
|
|
investigateDispositionTable.setInvestigateTableId(investigateTableId);
|
|
|
investigateDispositionTable.setCreateTime(nowDate);
|
|
@@ -213,105 +214,110 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void sendBatchSmsTable(Long investigateTableId, List<InvestigateUser> investigateUserList) {
|
|
|
- for (InvestigateUser investigateUser : investigateUserList) {
|
|
|
- StringBuffer phoneNumberJson = new StringBuffer();
|
|
|
- StringBuffer templateParamJson = new StringBuffer();
|
|
|
- StringBuffer signNameJson = new StringBuffer();
|
|
|
- phoneNumberJson.append("[");
|
|
|
- templateParamJson.append("[");
|
|
|
- signNameJson.append("[");
|
|
|
-
|
|
|
-
|
|
|
- String phone = investigateUser.getPhonenumber();
|
|
|
- if (StringUtils.isEmpty(phone)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- phoneNumberJson.append("\"" + phone + "\",");
|
|
|
- signNameJson.append("\"中新云\",");
|
|
|
-
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("number", investigateTableId);
|
|
|
- templateParamJson.append(jsonObject).append(",");
|
|
|
-
|
|
|
-
|
|
|
- phoneNumberJson.deleteCharAt(phoneNumberJson.length() - 1);
|
|
|
- templateParamJson.deleteCharAt(templateParamJson.length() - 1);
|
|
|
- signNameJson.deleteCharAt(signNameJson.length() - 1);
|
|
|
- phoneNumberJson.append("]");
|
|
|
- templateParamJson.append("]");
|
|
|
- signNameJson.append("]");
|
|
|
-
|
|
|
- SendBatchSmsRequest sendBatchSmsRequest = new SendBatchSmsRequest();
|
|
|
-
|
|
|
- sendBatchSmsRequest.setPhoneNumberJson(phoneNumberJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setSignNameJson(signNameJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setTemplateParamJson(templateParamJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setTemplateCode("SMS_463622836");
|
|
|
- long startTimeSend = System.currentTimeMillis();
|
|
|
- SendBatchSmsResponse sendBatchSmsResponse = SendSmsUtils.sendBatchSms(sendBatchSmsRequest);
|
|
|
- long endTimeSend = System.currentTimeMillis() - startTimeSend;
|
|
|
- System.out.println("执行批量下发短信接口请求:" + endTimeSend + "ms");
|
|
|
- String code = sendBatchSmsResponse.getBody().getCode();
|
|
|
- if (sendBatchSmsResponse.getBody().getCode() != null && "OK".equals(code)) {
|
|
|
- System.out.println("批量短信发送成功");
|
|
|
- } else {
|
|
|
- System.out.println("批量短信发送失败");
|
|
|
+ public void sendBatchSmsTable(Long investigateTableId, List<InvestigateUser> investigateUserList) {
|
|
|
+ if (investigateUserList != null && investigateUserList.size() > 0) {
|
|
|
+ for (InvestigateUser investigateUser : investigateUserList) {
|
|
|
+ StringBuffer phoneNumberJson = new StringBuffer();
|
|
|
+ StringBuffer templateParamJson = new StringBuffer();
|
|
|
+ StringBuffer signNameJson = new StringBuffer();
|
|
|
+ phoneNumberJson.append("[");
|
|
|
+ templateParamJson.append("[");
|
|
|
+ signNameJson.append("[");
|
|
|
+
|
|
|
+
|
|
|
+ String phone = investigateUser.getPhonenumber();
|
|
|
+ if (StringUtils.isEmpty(phone)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ phoneNumberJson.append("\"" + phone + "\",");
|
|
|
+ signNameJson.append("\"中新云\",");
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("number", investigateTableId);
|
|
|
+ templateParamJson.append(jsonObject).append(",");
|
|
|
+
|
|
|
+
|
|
|
+ phoneNumberJson.deleteCharAt(phoneNumberJson.length() - 1);
|
|
|
+ templateParamJson.deleteCharAt(templateParamJson.length() - 1);
|
|
|
+ signNameJson.deleteCharAt(signNameJson.length() - 1);
|
|
|
+ phoneNumberJson.append("]");
|
|
|
+ templateParamJson.append("]");
|
|
|
+ signNameJson.append("]");
|
|
|
+
|
|
|
+ SendBatchSmsRequest sendBatchSmsRequest = new SendBatchSmsRequest();
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setPhoneNumberJson(phoneNumberJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setSignNameJson(signNameJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setTemplateParamJson(templateParamJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setTemplateCode("SMS_463622836");
|
|
|
+ long startTimeSend = System.currentTimeMillis();
|
|
|
+ SendBatchSmsResponse sendBatchSmsResponse = SendSmsUtils.sendBatchSms(sendBatchSmsRequest);
|
|
|
+ long endTimeSend = System.currentTimeMillis() - startTimeSend;
|
|
|
+ System.out.println("执行批量下发短信接口请求:" + endTimeSend + "ms");
|
|
|
+ String code = sendBatchSmsResponse.getBody().getCode();
|
|
|
+ if (sendBatchSmsResponse.getBody().getCode() != null && "OK".equals(code)) {
|
|
|
+ System.out.println("批量短信发送成功");
|
|
|
+ } else {
|
|
|
+ System.out.println("批量短信发送失败");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void sendBatchSmsTableUpdate(Long investigateTableId, List<InvestigateUser> investigateUserList) {
|
|
|
- for (InvestigateUser investigateUser : investigateUserList) {
|
|
|
- StringBuffer phoneNumberJson = new StringBuffer();
|
|
|
- StringBuffer templateParamJson = new StringBuffer();
|
|
|
- StringBuffer signNameJson = new StringBuffer();
|
|
|
- phoneNumberJson.append("[");
|
|
|
- templateParamJson.append("[");
|
|
|
- signNameJson.append("[");
|
|
|
-
|
|
|
-
|
|
|
- String phone = investigateUser.getPhonenumber();
|
|
|
- if (StringUtils.isEmpty(phone)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- phoneNumberJson.append("\"" + phone + "\",");
|
|
|
- signNameJson.append("\"中新云\",");
|
|
|
-
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("number", investigateTableId);
|
|
|
- templateParamJson.append(jsonObject).append(",");
|
|
|
-
|
|
|
-
|
|
|
- phoneNumberJson.deleteCharAt(phoneNumberJson.length() - 1);
|
|
|
- templateParamJson.deleteCharAt(templateParamJson.length() - 1);
|
|
|
- signNameJson.deleteCharAt(signNameJson.length() - 1);
|
|
|
- phoneNumberJson.append("]");
|
|
|
- templateParamJson.append("]");
|
|
|
- signNameJson.append("]");
|
|
|
-
|
|
|
- SendBatchSmsRequest sendBatchSmsRequest = new SendBatchSmsRequest();
|
|
|
-
|
|
|
- sendBatchSmsRequest.setPhoneNumberJson(phoneNumberJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setSignNameJson(signNameJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setTemplateParamJson(templateParamJson.toString());
|
|
|
-
|
|
|
- sendBatchSmsRequest.setTemplateCode("SMS_463673720");
|
|
|
- long startTimeSend = System.currentTimeMillis();
|
|
|
- SendBatchSmsResponse sendBatchSmsResponse = SendSmsUtils.sendBatchSms(sendBatchSmsRequest);
|
|
|
- long endTimeSend = System.currentTimeMillis() - startTimeSend;
|
|
|
- System.out.println("执行批量下发短信接口请求:" + endTimeSend + "ms");
|
|
|
- String code = sendBatchSmsResponse.getBody().getCode();
|
|
|
- if (sendBatchSmsResponse.getBody().getCode() != null && "OK".equals(code)) {
|
|
|
- System.out.println("批量短信发送成功");
|
|
|
- } else {
|
|
|
- System.out.println("批量短信发送失败");
|
|
|
+ public void sendBatchSmsTableUpdate(Long investigateTableId, List<InvestigateUser> investigateUserList) {
|
|
|
+ if (investigateUserList != null && investigateUserList.size() > 0) {
|
|
|
+
|
|
|
+ for (InvestigateUser investigateUser : investigateUserList) {
|
|
|
+ StringBuffer phoneNumberJson = new StringBuffer();
|
|
|
+ StringBuffer templateParamJson = new StringBuffer();
|
|
|
+ StringBuffer signNameJson = new StringBuffer();
|
|
|
+ phoneNumberJson.append("[");
|
|
|
+ templateParamJson.append("[");
|
|
|
+ signNameJson.append("[");
|
|
|
+
|
|
|
+
|
|
|
+ String phone = investigateUser.getPhonenumber();
|
|
|
+ if (StringUtils.isEmpty(phone)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ phoneNumberJson.append("\"" + phone + "\",");
|
|
|
+ signNameJson.append("\"中新云\",");
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("number", investigateTableId);
|
|
|
+ templateParamJson.append(jsonObject).append(",");
|
|
|
+
|
|
|
+
|
|
|
+ phoneNumberJson.deleteCharAt(phoneNumberJson.length() - 1);
|
|
|
+ templateParamJson.deleteCharAt(templateParamJson.length() - 1);
|
|
|
+ signNameJson.deleteCharAt(signNameJson.length() - 1);
|
|
|
+ phoneNumberJson.append("]");
|
|
|
+ templateParamJson.append("]");
|
|
|
+ signNameJson.append("]");
|
|
|
+
|
|
|
+ SendBatchSmsRequest sendBatchSmsRequest = new SendBatchSmsRequest();
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setPhoneNumberJson(phoneNumberJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setSignNameJson(signNameJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setTemplateParamJson(templateParamJson.toString());
|
|
|
+
|
|
|
+ sendBatchSmsRequest.setTemplateCode("SMS_463673720");
|
|
|
+ long startTimeSend = System.currentTimeMillis();
|
|
|
+ SendBatchSmsResponse sendBatchSmsResponse = SendSmsUtils.sendBatchSms(sendBatchSmsRequest);
|
|
|
+ long endTimeSend = System.currentTimeMillis() - startTimeSend;
|
|
|
+ System.out.println("执行批量下发短信接口请求:" + endTimeSend + "ms");
|
|
|
+ String code = sendBatchSmsResponse.getBody().getCode();
|
|
|
+ if (sendBatchSmsResponse.getBody().getCode() != null && "OK".equals(code)) {
|
|
|
+ System.out.println("批量短信发送成功");
|
|
|
+ } else {
|
|
|
+ System.out.println("批量短信发送失败");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|