|
@@ -31,19 +31,15 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.mapping.ParameterMode;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.sql.JDBCType;
|
|
|
import java.text.MessageFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
|
|
|
@@ -291,7 +287,7 @@ public class BwMeterReadPlanController extends BaseController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "meterCardIds", value = "抄表卡ID集(多个英文逗号隔开)", dataType = "String")
|
|
|
})
|
|
|
- public ResultRespone doCalcFeeForUser(String meterCardIds) throws Exception {
|
|
|
+ public ResultRespone doCalcFeeForUser(@RequestPostSingleParam("meterCardIds") String meterCardIds) throws Exception {
|
|
|
if (StringUtils.isBlank(meterCardIds)) {
|
|
|
return ResultRespone.failed("算费失败:请选择需要算费的用户!");
|
|
|
}
|
|
@@ -311,16 +307,20 @@ public class BwMeterReadPlanController extends BaseController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "mrBooks", value = "抄表册编码集(多个英文逗号隔开)", dataType = "String")
|
|
|
})
|
|
|
- public ResultRespone doCalcFeeForMrBook(String mrBooks) throws Exception {
|
|
|
+ public ResultRespone doCalcFeeForMrBook(@RequestPostSingleParam("mrBooks") String mrBooks) throws Exception {
|
|
|
if (StringUtils.isBlank(mrBooks)) {
|
|
|
return ResultRespone.failed("算费失败:抄表册参数为空!");
|
|
|
}
|
|
|
mrBooks = "'" + mrBooks.replace(",", "','") + "'";
|
|
|
- ArrayList arrayList = bwMeterReadPlanMapper.getMeterCardIds(mrBooks);
|
|
|
- if (arrayList.size() == 0) {
|
|
|
+ List<HashMap<String, Object>> hashMapList = bwMeterReadPlanMapper.getMeterCardIds(mrBooks);
|
|
|
+ if (hashMapList.size() == 0) {
|
|
|
return ResultRespone.failed("算费失败:当前所选的抄表册不存在需算费的用户!");
|
|
|
}
|
|
|
- String[] arrList = (String[]) arrayList.toArray();
|
|
|
+ int len = hashMapList.size();
|
|
|
+ String[] arrList = new String[len];
|
|
|
+ for (int i = 0; i < len; i++) {
|
|
|
+ arrList[i] = (String) hashMapList.get(i).get("METER_CARD_ID");
|
|
|
+ }
|
|
|
return getResultResponse(arrList);
|
|
|
}
|
|
|
|
|
@@ -366,7 +366,7 @@ public class BwMeterReadPlanController extends BaseController {
|
|
|
|
|
|
String strMsg = "";
|
|
|
if (intSuccessNum == 0) {
|
|
|
- strMsg = MessageFormat.format("算费失败:已算费0条抄表记录!共耗时{0}秒!", strSecNum);
|
|
|
+ strMsg = MessageFormat.format("算费失败:已算费0条抄表记录,共耗时{0}秒!", strSecNum);
|
|
|
} else {
|
|
|
strMsg = MessageFormat.format("算费成功:成功算费{0}个用户,共耗时{1}秒!", intSuccessNum, strSecNum);
|
|
|
}
|