增加查看mondelay活动记录表

master
yuan 7 years ago
parent 332a2e6884
commit 8f363f5c07

@ -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.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.ActMonDelaySettleRedPackMapper;
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.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.device.DeviceSupport;
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.PageList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -52,6 +56,14 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
@Resource
private MessageSource messageSource;
@Resource
private ClientMapper clientMapper;
@Resource
private ActMonDelayClientMapper actMonDelayClientMapper;
private Logger logger = LoggerFactory.getLogger(getClass());
@Override
public JSONObject getActNotice(JSONObject device) {
int client_id = device.getIntValue("client_id");
@ -99,7 +111,11 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
res.put("apply", apply);
res.put("total_redpack", total_redpack);
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;
}
@ -161,5 +177,28 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
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);
}
}
}

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.mappers.act;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
@AutoMapper(tablename = "act_mon_delay_read_logs", pkName = "id")
public interface ActMonDelayClientMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject clientlog);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject clientlog);
@AutoSql(type = SqlType.SELECT)
JSONObject actClient(@Param("client_id") int client_id);
}
Loading…
Cancel
Save