diff --git a/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java b/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java index 268186f2..034f8506 100644 --- a/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java +++ b/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java @@ -155,7 +155,7 @@ public class XhpcCardServiceImpl implements IXhpcCardService { } else if (UserTypeUtil.SYS_USER_TYPE_ZERO.equals(loginUserType)) { //平台可能会选中多个授权运营商 String grantOperatorIds = (String) queryConditions.getGrantOperatorIds(); - if (!"".equals(grantOperatorIds)) { + if (!"".equals(grantOperatorIds) && grantOperatorIds != null) { String[] splitGrantOperatorIds = grantOperatorIds.split(","); List idsList = Arrays.asList(splitGrantOperatorIds); queryConditions.setGrantOperatorIds(idsList); @@ -623,7 +623,7 @@ public class XhpcCardServiceImpl implements IXhpcCardService { xhpcIcCardInfo.setDelFlag(1L); xhpcCardMapper.updateByPrimaryKeySelective(xhpcIcCardInfo); TIccardInfo tIccardInfo = tIccardInfoMapper.selectByPrimaryKey(Math.toIntExact(cardRecordId)); - tIccardInfo.setStatus(5); + tIccardInfo.setStatus(0); tIccardInfoMapper.updateByPrimaryKeySelective(tIccardInfo); TIccardLog tIccardLog = new TIccardLog(); tIccardLog.setUniqueid(tIccardInfo.getCardid()); diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/controller/XhpcDataBigScreenController.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/controller/XhpcDataBigScreenController.java new file mode 100644 index 00000000..c187db72 --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/controller/XhpcDataBigScreenController.java @@ -0,0 +1,34 @@ +package com.xhpc.databigscreen.controller; + +import com.xhpc.common.core.domain.R; +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.databigscreen.domain.CoreParam; +import com.xhpc.databigscreen.service.XhpcDataBigScreenService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/big-screen") +public class XhpcDataBigScreenController extends BaseController { + + @Resource + XhpcDataBigScreenService xhpcDataBigScreenService; + + //@GetMapping("/user-total-count") + //public R> queryUserTotalCount(@RequestBody ) { + // + // return xhpcCardService.queryDeviceList(currentPage, items); + //} + + @GetMapping("/core-locations") + public R>> returnCoreLocation(CoreParam coreParam) { + + return xhpcDataBigScreenService.returnCoreLocation(coreParam); + } + +} diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/CoreParam.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/CoreParam.java new file mode 100644 index 00000000..9079b953 --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/CoreParam.java @@ -0,0 +1,23 @@ +package com.xhpc.databigscreen.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 核心参数类,所有接口都会用到 + * + * @author WH + * @date 2022/2/28 11:47 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class CoreParam { + + @JsonProperty("tenantIds") + private String tenantIds; + private String areaCode; + private String chargingStationIds; + +} diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/ReturnCoreLocation.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/ReturnCoreLocation.java new file mode 100644 index 00000000..d332721b --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/domain/ReturnCoreLocation.java @@ -0,0 +1,42 @@ +package com.xhpc.databigscreen.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@Data +public class ReturnCoreLocation { + + /** + * 场站名称 + */ + @JsonProperty("chargingStationName") + private String chargingStationName; + /** + * 场站id + */ + @JsonProperty("chargingStationId") + private Long chargingStationId; + /** + * 场站经度 + */ + @JsonProperty("chargingStationLongitude") + private Double chargingStationLongitude; + /** + * 场站纬度 + */ + @JsonProperty("chargingStationLatitude") + private Double chargingStationLatitude; + /** + * 场站区域码 + */ + @JsonProperty("chargingStationAreaCode") + private String chargingStationAreaCode; + /** + * 场站所属租户id + */ + @JsonProperty("chargingStationTenantId") + private Long chargingStationTenantId; + +} diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/mapper/XhpcChargingStationMapper.java new file mode 100644 index 00000000..8ff0d75f --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/mapper/XhpcChargingStationMapper.java @@ -0,0 +1,32 @@ +package com.xhpc.databigscreen.mapper; + +import com.xhpc.databigscreen.pojo.XhpcChargingStation; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public interface XhpcChargingStationMapper { + + int deleteByPrimaryKey(Long chargingStationId); + + int insert(XhpcChargingStation record); + + int insertSelective(XhpcChargingStation record); + + XhpcChargingStation selectByPrimaryKey(Long chargingStationId); + + int updateByPrimaryKeySelective(XhpcChargingStation record); + + int updateByPrimaryKey(XhpcChargingStation record); + + /** + * query charging station infos of special tenant or all ones by tenant Id List + * + * @author WH + * @date 2022/2/28 17:50 + * @since version-1.0 + */ + List> selectByTenantId(ArrayList tenantIdList); + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/pojo/XhpcChargingStation.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/pojo/XhpcChargingStation.java new file mode 100644 index 00000000..58755a1c --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/pojo/XhpcChargingStation.java @@ -0,0 +1,175 @@ +package com.xhpc.databigscreen.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * xhpc_charging_station + * + * @author + */ +@Data +public class XhpcChargingStation implements Serializable { + + /** + * 电站id + */ + private Long chargingStationId; + + /** + * 名称 + */ + private String name; + + /** + * 运营商id + */ + private Long operatorId; + + /** + * 电站位置(地上电站、地下电站) + */ + private Integer type; + + /** + * 建设场所 + */ + private Short constructionSite; + + /** + * 服务设施 + */ + private String serviceFacilities; + + /** + * 周边设施 + */ + private String peripheryFacilities; + + /** + * 地址code + */ + private Integer areaCode; + + /** + * 电站地址 + */ + private String address; + + /** + * 详细地址 + */ + private String detailedAddress; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 停车说明 + */ + private String parkingInstructions; + + /** + * 编号 + */ + private String serialNumber; + + /** + * 客户端可见类型 + */ + private String clientVisible; + + /** + * 状态(0启用 1停用) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 备注 + */ + private String remark; + + /** + * 当前计费模型id + */ + private Long rateModelId; + + /** + * 营业说明 + */ + private String businessInstructions; + + /** + * 温馨提示 + */ + private String reminderInstructions; + + /** + * 图片集合 + */ + private String imgId; + + /** + * 电站类型 + */ + private Short stationType; + + /** + * 营业执照18个字符(对接第三方平台及监管平台的OperatorID取9至17个) + */ + private String operatorIdEvcs; + + /** + * 站点电话 + */ + private String serviceTel; + + private String searchValue; + + /** + * 侧位数量 + */ + private Integer parkNums; + + /** + * 租户id + */ + private String tenantId; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/XhpcDataBigScreenService.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/XhpcDataBigScreenService.java new file mode 100644 index 00000000..4df28371 --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/XhpcDataBigScreenService.java @@ -0,0 +1,25 @@ +package com.xhpc.databigscreen.service; + +import com.xhpc.common.core.domain.R; +import com.xhpc.databigscreen.domain.CoreParam; + +import java.util.List; +import java.util.Map; + +/** + * @author WH + * @date 2022/2/28 17:13 + * @since version-1.0 + */ +public interface XhpcDataBigScreenService { + + /** + * return multiple location infos + * + * @author WH + * @date 2022/2/28 17:16 + * @since version-1.0 + */ + R>> returnCoreLocation(CoreParam coreParam); + +} diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/impl/XhpcDataBigScreenServiceImpl.java b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/impl/XhpcDataBigScreenServiceImpl.java new file mode 100644 index 00000000..41b9cf28 --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/java/com/xhpc/databigscreen/service/impl/XhpcDataBigScreenServiceImpl.java @@ -0,0 +1,49 @@ +package com.xhpc.databigscreen.service.impl; + +import com.xhpc.common.core.domain.R; +import com.xhpc.databigscreen.domain.CoreParam; +import com.xhpc.databigscreen.mapper.XhpcChargingStationMapper; +import com.xhpc.databigscreen.service.XhpcDataBigScreenService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @author WH + * @date 2022/2/28 17:14 + * @since version-1.0 + */ +@Service +public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService { + + @Resource + XhpcChargingStationMapper xhpcChargingStationMapper; + + @Override + public R>> returnCoreLocation(CoreParam coreParam) { + //judge care param function + if (coreParam.getAreaCode() == null || "".equals(coreParam.getAreaCode())) { + if (coreParam.getChargingStationIds() == null || "".equals(coreParam.getChargingStationIds())) { + //query location infos of charging station of special or all tenant + String tenantIds = coreParam.getTenantIds(); + ArrayList tenantIdList = new ArrayList<>(); + if (!"".equals(tenantIds) && tenantIds != null) { + String[] tenantIdArray = tenantIds.split(","); + List tenantIdStrList = Arrays.asList(tenantIdArray); + for (String tenantIdStr : tenantIdStrList) { + Long tenantId = Long.valueOf(tenantIdStr); + tenantIdList.add(tenantId); + } + } + List> xhpcChargingStationList = xhpcChargingStationMapper.selectByTenantId(tenantIdList); + return R.ok(xhpcChargingStationList); + } + } + return null; + } + +} diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-data-big-screen/src/main/resources/mapper/XhpcChargingStationMapper.xml new file mode 100644 index 00000000..31633a52 --- /dev/null +++ b/xhpc-modules/xhpc-data-big-screen/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + charging_station_id + , `name`, operator_id, `type`, construction_site, service_facilities, + periphery_facilities, area_code, address, detailed_address, longitude, latitude, + parking_instructions, serial_number, client_visible, `status`, del_flag, create_time, + create_by, update_time, update_by, remark, rate_model_id, business_instructions, + reminder_instructions, img_id, station_type, operator_id_evcs, service_tel, search_value, + park_nums, tenant_id + + + + + delete + from xhpc_charging_station + where charging_station_id = #{chargingStationId,jdbcType=BIGINT} + + + insert into xhpc_charging_station (`name`, operator_id, `type`, + construction_site, service_facilities, periphery_facilities, + area_code, address, detailed_address, + longitude, latitude, parking_instructions, + serial_number, client_visible, `status`, + del_flag, create_time, create_by, + update_time, update_by, remark, + rate_model_id, business_instructions, reminder_instructions, + img_id, station_type, operator_id_evcs, + service_tel, search_value, park_nums, + tenant_id) + values (#{name,jdbcType=VARCHAR}, #{operatorId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, + #{constructionSite,jdbcType=SMALLINT}, #{serviceFacilities,jdbcType=VARCHAR}, + #{peripheryFacilities,jdbcType=VARCHAR}, + #{areaCode,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{detailedAddress,jdbcType=VARCHAR}, + #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{parkingInstructions,jdbcType=VARCHAR}, + #{serialNumber,jdbcType=VARCHAR}, #{clientVisible,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, + #{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{rateModelId,jdbcType=BIGINT}, #{businessInstructions,jdbcType=VARCHAR}, + #{reminderInstructions,jdbcType=VARCHAR}, + #{imgId,jdbcType=VARCHAR}, #{stationType,jdbcType=SMALLINT}, #{operatorIdEvcs,jdbcType=VARCHAR}, + #{serviceTel,jdbcType=VARCHAR}, #{searchValue,jdbcType=VARCHAR}, #{parkNums,jdbcType=INTEGER}, + #{tenantId,jdbcType=VARCHAR}) + + + insert into xhpc_charging_station + + + `name`, + + + operator_id, + + + `type`, + + + construction_site, + + + service_facilities, + + + periphery_facilities, + + + area_code, + + + address, + + + detailed_address, + + + longitude, + + + latitude, + + + parking_instructions, + + + serial_number, + + + client_visible, + + + `status`, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + rate_model_id, + + + business_instructions, + + + reminder_instructions, + + + img_id, + + + station_type, + + + operator_id_evcs, + + + service_tel, + + + search_value, + + + park_nums, + + + tenant_id, + + + + + #{name,jdbcType=VARCHAR}, + + + #{operatorId,jdbcType=BIGINT}, + + + #{type,jdbcType=INTEGER}, + + + #{constructionSite,jdbcType=SMALLINT}, + + + #{serviceFacilities,jdbcType=VARCHAR}, + + + #{peripheryFacilities,jdbcType=VARCHAR}, + + + #{areaCode,jdbcType=INTEGER}, + + + #{address,jdbcType=VARCHAR}, + + + #{detailedAddress,jdbcType=VARCHAR}, + + + #{longitude,jdbcType=VARCHAR}, + + + #{latitude,jdbcType=VARCHAR}, + + + #{parkingInstructions,jdbcType=VARCHAR}, + + + #{serialNumber,jdbcType=VARCHAR}, + + + #{clientVisible,jdbcType=VARCHAR}, + + + #{status,jdbcType=INTEGER}, + + + #{delFlag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{rateModelId,jdbcType=BIGINT}, + + + #{businessInstructions,jdbcType=VARCHAR}, + + + #{reminderInstructions,jdbcType=VARCHAR}, + + + #{imgId,jdbcType=VARCHAR}, + + + #{stationType,jdbcType=SMALLINT}, + + + #{operatorIdEvcs,jdbcType=VARCHAR}, + + + #{serviceTel,jdbcType=VARCHAR}, + + + #{searchValue,jdbcType=VARCHAR}, + + + #{parkNums,jdbcType=INTEGER}, + + + #{tenantId,jdbcType=VARCHAR}, + + + + + update xhpc_charging_station + + + `name` = #{name,jdbcType=VARCHAR}, + + + operator_id = #{operatorId,jdbcType=BIGINT}, + + + `type` = #{type,jdbcType=INTEGER}, + + + construction_site = #{constructionSite,jdbcType=SMALLINT}, + + + service_facilities = #{serviceFacilities,jdbcType=VARCHAR}, + + + periphery_facilities = #{peripheryFacilities,jdbcType=VARCHAR}, + + + area_code = #{areaCode,jdbcType=INTEGER}, + + + address = #{address,jdbcType=VARCHAR}, + + + detailed_address = #{detailedAddress,jdbcType=VARCHAR}, + + + longitude = #{longitude,jdbcType=VARCHAR}, + + + latitude = #{latitude,jdbcType=VARCHAR}, + + + parking_instructions = #{parkingInstructions,jdbcType=VARCHAR}, + + + serial_number = #{serialNumber,jdbcType=VARCHAR}, + + + client_visible = #{clientVisible,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=INTEGER}, + + + del_flag = #{delFlag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + rate_model_id = #{rateModelId,jdbcType=BIGINT}, + + + business_instructions = #{businessInstructions,jdbcType=VARCHAR}, + + + reminder_instructions = #{reminderInstructions,jdbcType=VARCHAR}, + + + img_id = #{imgId,jdbcType=VARCHAR}, + + + station_type = #{stationType,jdbcType=SMALLINT}, + + + operator_id_evcs = #{operatorIdEvcs,jdbcType=VARCHAR}, + + + service_tel = #{serviceTel,jdbcType=VARCHAR}, + + + search_value = #{searchValue,jdbcType=VARCHAR}, + + + park_nums = #{parkNums,jdbcType=INTEGER}, + + + tenant_id = #{tenantId,jdbcType=VARCHAR}, + + + where charging_station_id = #{chargingStationId,jdbcType=BIGINT} + + + update xhpc_charging_station + set `name` = #{name,jdbcType=VARCHAR}, + operator_id = #{operatorId,jdbcType=BIGINT}, + `type` = #{type,jdbcType=INTEGER}, + construction_site = #{constructionSite,jdbcType=SMALLINT}, + service_facilities = #{serviceFacilities,jdbcType=VARCHAR}, + periphery_facilities = #{peripheryFacilities,jdbcType=VARCHAR}, + area_code = #{areaCode,jdbcType=INTEGER}, + address = #{address,jdbcType=VARCHAR}, + detailed_address = #{detailedAddress,jdbcType=VARCHAR}, + longitude = #{longitude,jdbcType=VARCHAR}, + latitude = #{latitude,jdbcType=VARCHAR}, + parking_instructions = #{parkingInstructions,jdbcType=VARCHAR}, + serial_number = #{serialNumber,jdbcType=VARCHAR}, + client_visible = #{clientVisible,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=INTEGER}, + del_flag = #{delFlag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + rate_model_id = #{rateModelId,jdbcType=BIGINT}, + business_instructions = #{businessInstructions,jdbcType=VARCHAR}, + reminder_instructions = #{reminderInstructions,jdbcType=VARCHAR}, + img_id = #{imgId,jdbcType=VARCHAR}, + station_type = #{stationType,jdbcType=SMALLINT}, + operator_id_evcs = #{operatorIdEvcs,jdbcType=VARCHAR}, + service_tel = #{serviceTel,jdbcType=VARCHAR}, + search_value = #{searchValue,jdbcType=VARCHAR}, + park_nums = #{parkNums,jdbcType=INTEGER}, + tenant_id = #{tenantId,jdbcType=VARCHAR} + where charging_station_id = #{chargingStationId,jdbcType=BIGINT} + + \ No newline at end of file