| | |
| | | import com.taoke.autopay.utils.StringUtil; |
| | | import com.taoke.autopay.utils.TimeUtil; |
| | | import com.taoke.autopay.vo.admin.UserCreditExchangeRecordSearchVO; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("approve") |
| | | public String approveRecords(Long[] ids) { |
| | | public String approveRecords(String ids) { |
| | | int successCount = 0; |
| | | int failCount = 0; |
| | | for(Long id :ids) { |
| | | JSONArray idsArray = JSONArray.fromObject(ids); |
| | | for (int i = 0; i < idsArray.size(); i++) { |
| | | long id = idsArray.optLong(i); |
| | | try { |
| | | userCreditExchangeManager.approveExchange(id); |
| | | successCount+=1; |
| | |
| | | failCount+=1; |
| | | } |
| | | } |
| | | return JsonUtil.loadTrueResult(String.format("成功通过 %d 条记录 通过异常 %d 条记录", successCount, failCount)); |
| | | return JsonUtil.loadFalseResult(String.format("成功通过 %d 条记录 通过异常 %d 条记录", successCount, failCount)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("reject") |
| | | public String rejectRecords(Long[] ids) { |
| | | public String rejectRecords(String ids) { |
| | | int successCount = 0; |
| | | int failCount = 0; |
| | | for(Long id :ids) { |
| | | JSONArray idsArray = JSONArray.fromObject(ids); |
| | | for (int i = 0; i < idsArray.size(); i++) { |
| | | long id = idsArray.optLong(i); |
| | | try { |
| | | userCreditExchangeManager.rejectExchange(id); |
| | | successCount+=1; |
| | |
| | | failCount+=1; |
| | | } |
| | | } |
| | | return JsonUtil.loadTrueResult(String.format("成功驳回 %d 条记录 驳回异常 %d 条记录", successCount, failCount)); |
| | | return JsonUtil.loadFalseResult(String.format("成功驳回 %d 条记录 驳回异常 %d 条记录", successCount, failCount)); |
| | | } |
| | | } |