作者 shenhailong

完善 公寓楼层修改 水表编号 更新新表充值量等问题

... ... @@ -133,13 +133,13 @@ public class LocationController {
// 查询旧表实施数据
WaterMeter realTime = waterMeterService.findRealTime(wmId);
// 计算旧表余量 新表累计充值量 = 旧表余量
String newWmIdSacc = AllUtils.nubmerSubtraction(realTime.getWmSacc(), realTime.getWmLacc());
log.info("旧表余量:{}",newWmIdSacc);
waterMeterSacc.setWmSacc(new BigDecimal(newWmIdSacc));
// String newWmIdSacc = AllUtils.nubmerSubtraction(realTime.getWmSacc(), realTime.getWmLacc());
log.info("旧表累计充值量:{}",realTime.getWmSacc());
// waterMeterSacc.setWmSacc(new BigDecimal(newWmIdSacc));
// 充值新表水量
Map<String, Object> datas = new HashMap<>();
datas.put("MtId", wmId);
datas.put("Add_sacc", newWmIdSacc);
datas.put("Add_sacc", realTime.getWmSacc());
datas.put("Add_addmode", "2");
String status = HttpsUtils.httpRequest("http://123.56.159.203:8023/mtfmset/allWMadd", datas);
datas.put("status", status);
... ...
... ... @@ -13,6 +13,7 @@ import com.sunyo.energy.location.service.PayOrderService;
import com.sunyo.energy.location.service.WaterMeterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
... ... @@ -24,6 +25,7 @@ import java.util.Map;
* 订单查询,新增,更新,删除
*/
@Api(description = "订单管理")
@Slf4j
@RestController
@RequestMapping("/order")
public class PayOrderController {
... ... @@ -144,7 +146,9 @@ public class PayOrderController {
/**
* 查询水表编号
*/
log.info("进入处理方法");
Location location = locationMapper.waterId_eleId(payRecords.getPaylocationname());
log.info("查询水表编号:{}",location.getWmid());
ResultJson resultJson = waterMeterService.remoteTopUpWater(location.getWmid());
return resultJson;
... ...
... ... @@ -15,6 +15,7 @@ import com.sunyo.energy.location.model.WaterMeterSacc;
import com.sunyo.energy.location.service.WaterMeterService;
import com.sunyo.energy.location.utils.AllUtils;
import com.sunyo.energy.location.utils.HttpsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
... ... @@ -24,7 +25,7 @@ import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.*;
@Slf4j
@Service
public class WaterMeterServiceImp implements WaterMeterService {
... ... @@ -248,12 +249,14 @@ public class WaterMeterServiceImp implements WaterMeterService {
public ResultJson remoteTopUpWater(String wmid) throws Exception {
ResultJson resultJson = new ResultJson();
WaterMeterSacc waterMeterSacc = waterMeterSaccMapper.selectByPrimaryKey(wmid);
log.info("水表编号累计充值量:{}",waterMeterSacc.getWmSacc(), wmid);
Map<String, Object> datas = new HashMap<>();
datas.put("MtId", wmid);
datas.put("Add_sacc", waterMeterSacc.getWmSacc());
datas.put("Add_addmode", "2");
String status = HttpsUtils.httpRequest(payUrl, datas);
datas.put("status", status);
log.info("远程调用水表充值接口:{}", datas.get("status").toString());
Map hashMap = JSON.parseObject(datas.get("status").toString(), HashMap.class);
/**
* 外部充值水表成功
... ...