| | |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | |
| | | model.setName(door.getDescription()); |
| | | model.setCId(door.getCid()); |
| | | model.setDId(door.getId()); |
| | | model.setAccountStatus(Constants.TWO); |
| | | model.setPriceid(door.getPriceid()); |
| | | model.setParamId(door.getParam_id()); |
| | | model.setDeviceType(door.getDevice_type()); |
| | |
| | | model.setType(door.getType()); |
| | | model.setRelayStatus(door.getRelay_state()); |
| | | model.setCsq(door.getCsq()); |
| | | model.setAccountStatus(resolveAccountStatusByPurchaseCount(door.getCount())); |
| | | model.setRemark(JSONObject.toJSONString(device)); |
| | | return model; |
| | | } |
| | | |
| | | /** 购买次数大于 0 视为已开户 */ |
| | | private Integer resolveAccountStatusByPurchaseCount(String purchaseCount) { |
| | | if (StringUtils.isBlank(purchaseCount)) { |
| | | return Constants.ZERO; |
| | | } |
| | | try { |
| | | return new BigDecimal(purchaseCount.trim()).compareTo(BigDecimal.ZERO) > 0 |
| | | ? Constants.ONE : Constants.ZERO; |
| | | } catch (NumberFormatException e) { |
| | | return Constants.ZERO; |
| | | } |
| | | } |
| | | private MeterInfoResponse getDeviceByid(String indexCode, List<MeterInfoResponse> allHkList ) { |
| | | if(allHkList!=null && allHkList.size()>0){ |
| | | for(MeterInfoResponse info : allHkList){ |