|
|
@ -2,10 +2,12 @@ package au.com.royalpay.payment.manage.activities.monsettledelay.core.impls;
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleService;
|
|
|
|
import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleService;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActAppMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActAppMapper;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelayClientMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
import au.com.royalpay.payment.tools.device.DeviceSupport;
|
|
|
|
import au.com.royalpay.payment.tools.device.DeviceSupport;
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
@ -20,6 +22,8 @@ import com.github.miemiedev.mybatis.paginator.domain.Order;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.context.MessageSource;
|
|
|
|
import org.springframework.context.MessageSource;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -52,6 +56,14 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private MessageSource messageSource;
|
|
|
|
private MessageSource messageSource;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ClientMapper clientMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ActMonDelayClientMapper actMonDelayClientMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject getActNotice(JSONObject device) {
|
|
|
|
public JSONObject getActNotice(JSONObject device) {
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
@ -99,7 +111,11 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
res.put("apply", apply);
|
|
|
|
res.put("apply", apply);
|
|
|
|
res.put("total_redpack", total_redpack);
|
|
|
|
res.put("total_redpack", total_redpack);
|
|
|
|
res.put("list", list);
|
|
|
|
res.put("list", list);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
recodeActClient(device);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
logger.error("add or update act_mon_delay_read_logs failed:", e.getMessage(), e);
|
|
|
|
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -161,5 +177,28 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
clientManager.changeManualSettle(client_id,false,device.getString("account_id"),1,"退出活动关闭手动清算");
|
|
|
|
clientManager.changeManualSettle(client_id,false,device.getString("account_id"),1,"退出活动关闭手动清算");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void recodeActClient(JSONObject device){
|
|
|
|
|
|
|
|
JSONObject actClient = new JSONObject();
|
|
|
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
|
|
|
JSONObject clientLog = actMonDelayClientMapper.actClient(device.getIntValue("client_id"));
|
|
|
|
|
|
|
|
if(clientLog != null){
|
|
|
|
|
|
|
|
if(!clientLog.getString("account_id").equals(device.getString("account_id"))) {
|
|
|
|
|
|
|
|
actClient.put("account_id", account.getString("account_id"));
|
|
|
|
|
|
|
|
actClient.put("account_name", account.getString("display_name"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
actClient.put("last_read_time",new Date());
|
|
|
|
|
|
|
|
actClient.put("id",clientLog.getString("id"));
|
|
|
|
|
|
|
|
actMonDelayClientMapper.update(actClient);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
|
|
|
|
|
|
|
|
actClient.put("client_id",client.getString("client_id"));
|
|
|
|
|
|
|
|
actClient.put("client_moniker",client.getString("client_moniker"));
|
|
|
|
|
|
|
|
actClient.put("short_name",client.getString("short_name"));
|
|
|
|
|
|
|
|
actClient.put("account_id",account.getString("account_id"));
|
|
|
|
|
|
|
|
actClient.put("account_name",account.getString("display_name"));
|
|
|
|
|
|
|
|
actClient.put("create_time",new Date());
|
|
|
|
|
|
|
|
actClient.put("last_read_time",new Date());
|
|
|
|
|
|
|
|
actMonDelayClientMapper.save(actClient);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|