Merge remote-tracking branch 'origin/mondelay' into mondelay

master
yuan 7 years ago
commit 6daca4a0a9

@ -15,6 +15,7 @@ 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.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
@ -88,6 +89,7 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService{
@Override
public void actApply(JSONObject device) {
JSONObject act = actAppMapper.getActDetail("1");
Assert.notNull(act,"The activity is not valid");
if (!act.getBoolean("is_valid")) {
throw new BadRequestException("The activity is not valid");
}
@ -106,11 +108,12 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService{
}
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
if (device.getIntValue("client_id") != account.getIntValue("client_id") || PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
throw new ForbiddenException("You have no permission");
throw new ForbiddenException("You have no permission.Please login in using the administrator account");
}
device.put("account_name", account.getString("display_name"));
device.put("create_time", new Date());
device.put("rate",new BigDecimal(12));
JSONObject params = act.getJSONObject("params_json");
device.put("rate", params.getBigDecimal("rate") == null ? new BigDecimal(0.15) : params.getBigDecimal("rate"));
device.put("expire_time", act.getDate("expire_date"));
actMonDelaySettleMapper.save(device);
}

Loading…
Cancel
Save