|
|
@ -17,11 +17,9 @@ 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.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -65,7 +63,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
Boolean apply = false;
|
|
|
|
Boolean apply = false;
|
|
|
|
if (!clientLogs.isEmpty() && clientLogs.size() > 0) {
|
|
|
|
if (!clientLogs.isEmpty()) {
|
|
|
|
apply = true;
|
|
|
|
apply = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (new Date().compareTo(act.getDate("active_date")) < 0) {
|
|
|
|
if (new Date().compareTo(act.getDate("active_date")) < 0) {
|
|
|
@ -90,7 +88,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void actApply(JSONObject device) {
|
|
|
|
public void actApply(JSONObject device) {
|
|
|
|
JSONObject act = actAppMapper.getActDetail("1");
|
|
|
|
JSONObject act = actAppMapper.getActDetail("1");
|
|
|
|
Assert.notNull(act,"The activity is not valid");
|
|
|
|
Assert.notNull(act, "The activity is not valid");
|
|
|
|
if (!act.getBoolean("is_valid")) {
|
|
|
|
if (!act.getBoolean("is_valid")) {
|
|
|
|
throw new BadRequestException("The activity is not valid");
|
|
|
|
throw new BadRequestException("The activity is not valid");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,7 +102,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
if (!clientLogs.isEmpty() && clientLogs.size() > 0) {
|
|
|
|
if (!clientLogs.isEmpty()) {
|
|
|
|
throw new BadRequestException("您已经参与过活动,无需重复报名");
|
|
|
|
throw new BadRequestException("您已经参与过活动,无需重复报名");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
@ -125,7 +123,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService {
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
|
int client_id = device.getIntValue("client_id");
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client_id);
|
|
|
|
if (clientLogs.isEmpty() || clientLogs.size() == 0) {
|
|
|
|
if (clientLogs.isEmpty()) {
|
|
|
|
throw new BadRequestException("您未参加活动,不可取消");
|
|
|
|
throw new BadRequestException("您未参加活动,不可取消");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject clientLog = clientLogs.get(0);
|
|
|
|
JSONObject clientLog = clientLogs.get(0);
|
|
|
|