mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -243,6 +243,17 @@ public class PileService {
|
||||
.build();
|
||||
memberService.checkVerificationCode(registerAndLoginDTO);
|
||||
|
||||
// 判断桩是否为个人桩
|
||||
PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(dto.getPileSn());
|
||||
if (pileBasicInfo == null) {
|
||||
// 未查到则说明没有此桩
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_NOT_INFO);
|
||||
}
|
||||
String businessType = pileBasicInfo.getBusinessType();
|
||||
if (!StringUtils.equals(BusinessTypeEnum.INDIVIDUAL_PILE.getValue(), businessType)){
|
||||
// 不一致则此桩不是个人桩
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_PILE_NOT_PERSONAL_PILE);
|
||||
}
|
||||
// 检查桩是否已经被绑定
|
||||
PileMemberRelation pileMemberRelation = new PileMemberRelation();
|
||||
pileMemberRelation.setPileSn(dto.getPileSn());
|
||||
@@ -252,11 +263,6 @@ public class PileService {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_HAS_BEEN_BINDING_ERROR);
|
||||
}
|
||||
// 如果没被绑定,先校验桩密钥是否一致
|
||||
PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(dto.getPileSn());
|
||||
if (pileBasicInfo == null) {
|
||||
// 未查到则说明没有此桩
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_NOT_INFO);
|
||||
}
|
||||
if (!StringUtils.equals(pileBasicInfo.getSecretKey(), dto.getSecretKey())) {
|
||||
// 错误的密钥信息
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SECRET_KEY_ERROR);
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.jsowell.web.controller.pile;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
import com.jsowell.common.enums.BusinessType;
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.service.IPileAuthCardService;
|
||||
import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 充电站鉴权卡Controller
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-03-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pile/card")
|
||||
public class PileAuthCardController extends BaseController {
|
||||
@Autowired
|
||||
private IPileAuthCardService pileAuthCardService;
|
||||
|
||||
/**
|
||||
* 查询充电站鉴权卡列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PileAuthCard pileAuthCard) {
|
||||
startPage();
|
||||
List<PileAuthCard> list = pileAuthCardService.selectPileAuthCardList(pileAuthCard);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出充电站鉴权卡列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:export')")
|
||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PileAuthCard pileAuthCard) {
|
||||
List<PileAuthCard> list = pileAuthCardService.selectPileAuthCardList(pileAuthCard);
|
||||
ExcelUtil<PileAuthCard> util = new ExcelUtil<PileAuthCard>(PileAuthCard.class);
|
||||
util.exportExcel(response, list, "充电站鉴权卡数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充电站鉴权卡详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(pileAuthCardService.selectPileAuthCardById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增充电站鉴权卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:add')")
|
||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PileAuthCard pileAuthCard) {
|
||||
return toAjax(pileAuthCardService.insertPileAuthCard(pileAuthCard));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充电站鉴权卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:edit')")
|
||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PileAuthCard pileAuthCard) {
|
||||
return toAjax(pileAuthCardService.updatePileAuthCard(pileAuthCard));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充电站鉴权卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:card:remove')")
|
||||
@Log(title = "充电站鉴权卡", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pileAuthCardService.deletePileAuthCardByIds(ids));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user