|
|
@@ -159,9 +159,13 @@ public class InviteRecordServiceImpl implements InviteRecordService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year) {
|
|
|
- String sql = "select time, count, 0 as doneCount,substr(time, -2) month from v$invitation_all where time like '%" + year + "%' and useruu = " + userUU + "order by time asc";
|
|
|
+ String sql = "select substr(time, -2) month,in_enuu enUU,count(1) count from(" +
|
|
|
+ "select to_char(in_date, 'yyyy-mm') time,COALESCE(in_active,0),in_enuu from invitationrecords where in_enuu = " + enUU + ")" +
|
|
|
+ "where time like '%" + year + "%' group by time,in_enuu order by time";
|
|
|
List<Invitation> all = commonDao.query(sql, Invitation.class);
|
|
|
- String sql1 = "select time, count doneCount,substr(time, -2) month from v$invitation where time like'%" + year + "%' and useruu = " + userUU + "and active = 1";
|
|
|
+ String sql1 = "select substr(time, -2) month,in_enuu enUU,count(1) count from(" +
|
|
|
+ "select to_char(in_date, 'yyyy-mm') time,COALESCE(in_active,0),in_enuu from invitationrecords where in_enuu = " + enUU + " and COALESCE(in_active,0) = 1)" +
|
|
|
+ "where time like '%" + year + "%' group by time,in_enuu order by tim";
|
|
|
List<Invitation> done = commonDao.query(sql1, Invitation.class);
|
|
|
if (!CollectionUtils.isEmpty(all) && !CollectionUtils.isEmpty(done)) {
|
|
|
for (Invitation a : all) {
|
|
|
@@ -236,19 +240,40 @@ public class InviteRecordServiceImpl implements InviteRecordService {
|
|
|
contactTel = cu.getUserTel();
|
|
|
}
|
|
|
}
|
|
|
+ final String enName = v.getEnName();
|
|
|
+ final String contactTel1 = contactTel;
|
|
|
+ final String adminTel1 = adnimTel;
|
|
|
+ final String userName = user.getUserName();
|
|
|
+ final String custName = c.getEnName();
|
|
|
// 发送短信通知
|
|
|
if (adnimTel.equals(contactTel)) {// 相同的人调用通知接口
|
|
|
- try {
|
|
|
- smsService.send(messageConf.getMsgAddPartForB2B(), adnimTel,
|
|
|
- new Object[] { user.getUserName(), c.getEnName(), v.getEnName() });
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ ThreadUtils.task(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ smsService.send(messageConf.getMsgAddPartForB2B(), adminTel1,
|
|
|
+ new Object[] { userName, custName, enName });
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).run();
|
|
|
+
|
|
|
} else { // 针对不同的人调用不同的接口
|
|
|
- // 发送给管理员
|
|
|
- sendMsgToManager(v.getEnName(), adnimTel);
|
|
|
- // 发送给联系人
|
|
|
- sendMsgToManager(v.getEnName(), contactTel);
|
|
|
+ ThreadUtils.task(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ // 发送给管理员
|
|
|
+ sendMsgToManager(enName, adminTel1);
|
|
|
+
|
|
|
+ // 发送给联系人
|
|
|
+ sendMsgToManager(enName, contactTel1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).run();
|
|
|
}
|
|
|
String result = AccountUtils.addNewRecord(record);
|
|
|
JSONObject object = JSON.parseObject(result);
|