移动端卡片管理 - web端卡片管理--/api/v4/app/custInfo/card/list
This commit is contained in:
parent
af1868c2c5
commit
0a7d96d57e
|
|
@ -1,10 +1,56 @@
|
|||
package com.bonus.core.account.v4.web.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.account.v4.constant.CardStatusEnum;
|
||||
import com.bonus.core.account.v4.web.mapper.AccCardMapper;
|
||||
import com.bonus.core.account.v4.web.model.AccCard;
|
||||
import com.bonus.core.customer.business.CardInfoBurialPointBusiness;
|
||||
import com.bonus.core.customer.service.CustInfoService;
|
||||
import com.bonus.core.customer.v4.web.dto.CardInfoDTO;
|
||||
import com.bonus.core.customer.v4.web.vo.CardInfoDetailVO;
|
||||
import com.bonus.core.customer.v4.web.vo.CardInfoVO;
|
||||
import com.bonus.domain.CustInfo;
|
||||
import com.bonus.utils.LeBeanUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CardInfoV4Service extends ServiceImpl<AccCardMapper, AccCard> {
|
||||
@Resource
|
||||
@Lazy
|
||||
CustInfoService custInfoService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardInfoBurialPointBusiness cardInfoBurialPointBusiness;
|
||||
|
||||
public CardInfoDetailVO queryCardsByCustId(CardInfoDTO content) {
|
||||
CustInfo custInfo = (CustInfo)this.custInfoService.getOne(Wrappers.lambdaQuery(CustInfo.class)
|
||||
.eq(CustInfo::getCustId, content.getCustId()));
|
||||
if (custInfo == null) {
|
||||
return new CardInfoDetailVO();
|
||||
} else {
|
||||
CardInfoDetailVO cardInfoDetailVO = (CardInfoDetailVO) LeBeanUtil.copyCreateProperties(custInfo, CardInfoDetailVO.class);
|
||||
List<AccCard> cards = this.list(Wrappers.lambdaQuery(AccCard.class)
|
||||
.eq(AccCard::getCustId, content.getCustId())
|
||||
.in(AccCard::getCardStatus,
|
||||
CardStatusEnum.normalAndLoss()));
|
||||
if (cards == null) {
|
||||
return cardInfoDetailVO;
|
||||
} else {
|
||||
List<CardInfoVO> cardInfoVO = BeanUtil.copyToList(cards, CardInfoVO.class);
|
||||
cardInfoDetailVO.setCardInfoList(cardInfoVO);
|
||||
this.cardInfoBurialPointBusiness.didGetCardList(cardInfoDetailVO);
|
||||
return cardInfoDetailVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.core.customer.business;
|
||||
|
||||
import com.bonus.core.common.custom.business.CustomBusiness;
|
||||
import com.bonus.core.customer.v4.web.vo.CardInfoDetailVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class CardInfoBurialPointBusiness implements CustomBusiness {
|
||||
|
||||
public void didGetCardList(CardInfoDetailVO cardInfoDetailVO) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.core.customer.v4;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class CustInfoBasic {
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("人员编号")
|
||||
private String custNum;
|
||||
@ApiModelProperty("人员姓名")
|
||||
private String custName;
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("卡序列号")
|
||||
private String serialNum;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer psnType;
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public String getCustNum() {
|
||||
return this.custNum;
|
||||
}
|
||||
|
||||
public String getCustName() {
|
||||
return this.custName;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return this.mobile;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public Integer getPsnType() {
|
||||
return this.psnType;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCustNum(final String custNum) {
|
||||
this.custNum = custNum;
|
||||
}
|
||||
|
||||
public void setCustName(final String custName) {
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public void setMobile(final String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
|
||||
public void setPsnType(final Integer psnType) {
|
||||
this.psnType = psnType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
package com.bonus.core.customer.v4.mobile.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.core.account.v4.web.service.CardInfoV4Service;
|
||||
import com.bonus.core.customer.v4.mobile.dto.ProfilePhotoDTO;
|
||||
import com.bonus.core.customer.v4.mobile.service.CustomerMobileService;
|
||||
import com.bonus.core.customer.v4.mobile.vo.FacePhotoVO;
|
||||
import com.bonus.core.customer.v4.mobile.vo.ProfilePhotoVO;
|
||||
import com.bonus.core.customer.v4.web.dto.CardInfoDTO;
|
||||
import com.bonus.core.customer.v4.web.vo.CardInfoDetailVO;
|
||||
import com.bonus.encrypt.RequiresGuest;
|
||||
import com.bonus.utils.LeRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -14,6 +17,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@RestController
|
||||
|
|
@ -24,8 +28,10 @@ import javax.validation.Valid;
|
|||
@RequestMapping({"/api/v4/app/custInfo"})
|
||||
public class CustomerMobileController extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CustomerMobileController.class);
|
||||
@Autowired
|
||||
@Resource
|
||||
CustomerMobileService customerMobileService;
|
||||
@Resource
|
||||
CardInfoV4Service cardInfoV4Service;
|
||||
|
||||
@ApiOperation(
|
||||
value = "移动端查询头像地址",
|
||||
|
|
@ -44,4 +50,14 @@ public class CustomerMobileController extends BaseController {
|
|||
return this.customerMobileService.facePhotoStatus(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(
|
||||
value = "移动端卡片管理",
|
||||
notes = "web端卡片管理"
|
||||
)
|
||||
@PostMapping({"/card/list"})
|
||||
@RequiresGuest
|
||||
public CardInfoDetailVO queryCardsByByCustId(@RequestBody @Valid CardInfoDTO dto) {
|
||||
return this.cardInfoV4Service.queryCardsByCustId(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package com.bonus.core.customer.v4.web.dto;
|
||||
|
||||
|
||||
import com.bonus.core.customer.v4.CustInfoBasic;
|
||||
|
||||
public class CardInfoDTO extends CustInfoBasic {
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package com.bonus.core.customer.v4.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CardInfoDetailVO {
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("人员限制id")
|
||||
private Integer custLimitId;
|
||||
@ApiModelProperty("人员编号")
|
||||
private String custNum;
|
||||
@ApiModelProperty("人员姓名")
|
||||
private String custName;
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("所属组织id")
|
||||
private Long orgId;
|
||||
@ApiModelProperty("机构全称")
|
||||
private String orgFullName;
|
||||
@ApiModelProperty("所属位置")
|
||||
private Long placeId;
|
||||
@ApiModelProperty("位置全称")
|
||||
private String placeFullName;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer psnType;
|
||||
@ApiModelProperty("人员类别名称")
|
||||
private String psnTypeName;
|
||||
@ApiModelProperty("人员卡片集合")
|
||||
private List<CardInfoVO> cardInfoList;
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Integer getCustLimitId() {
|
||||
return this.custLimitId;
|
||||
}
|
||||
|
||||
public String getCustNum() {
|
||||
return this.custNum;
|
||||
}
|
||||
|
||||
public String getCustName() {
|
||||
return this.custName;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return this.mobile;
|
||||
}
|
||||
|
||||
public Long getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
public String getOrgFullName() {
|
||||
return this.orgFullName;
|
||||
}
|
||||
|
||||
public Long getPlaceId() {
|
||||
return this.placeId;
|
||||
}
|
||||
|
||||
public String getPlaceFullName() {
|
||||
return this.placeFullName;
|
||||
}
|
||||
|
||||
public Integer getPsnType() {
|
||||
return this.psnType;
|
||||
}
|
||||
|
||||
public String getPsnTypeName() {
|
||||
return this.psnTypeName;
|
||||
}
|
||||
|
||||
public List<CardInfoVO> getCardInfoList() {
|
||||
return this.cardInfoList;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCustLimitId(final Integer custLimitId) {
|
||||
this.custLimitId = custLimitId;
|
||||
}
|
||||
|
||||
public void setCustNum(final String custNum) {
|
||||
this.custNum = custNum;
|
||||
}
|
||||
|
||||
public void setCustName(final String custName) {
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public void setMobile(final String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public void setOrgId(final Long orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public void setOrgFullName(final String orgFullName) {
|
||||
this.orgFullName = orgFullName;
|
||||
}
|
||||
|
||||
public void setPlaceId(final Long placeId) {
|
||||
this.placeId = placeId;
|
||||
}
|
||||
|
||||
public void setPlaceFullName(final String placeFullName) {
|
||||
this.placeFullName = placeFullName;
|
||||
}
|
||||
|
||||
public void setPsnType(final Integer psnType) {
|
||||
this.psnType = psnType;
|
||||
}
|
||||
|
||||
public void setPsnTypeName(final String psnTypeName) {
|
||||
this.psnTypeName = psnTypeName;
|
||||
}
|
||||
|
||||
public void setCardInfoList(final List<CardInfoVO> cardInfoList) {
|
||||
this.cardInfoList = cardInfoList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.bonus.core.customer.v4.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class CardInfoVO {
|
||||
@ApiModelProperty("人员id")
|
||||
private String custId;
|
||||
@ApiModelProperty("卡状态")
|
||||
private String cardStatus;
|
||||
@ApiModelProperty("开卡时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("卡片有效期")
|
||||
private LocalDate validityDate;
|
||||
@ApiModelProperty("卡物理号")
|
||||
private String serialNum;
|
||||
@ApiModelProperty("卡面号")
|
||||
private String cardFaceNum;
|
||||
@ApiModelProperty("押金")
|
||||
private Integer deposit;
|
||||
@ApiModelProperty("工本费")
|
||||
private Integer productCost;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
public String getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public String getCardStatus() {
|
||||
return this.cardStatus;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public LocalDate getValidityDate() {
|
||||
return this.validityDate;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public String getCardFaceNum() {
|
||||
return this.cardFaceNum;
|
||||
}
|
||||
|
||||
public Integer getDeposit() {
|
||||
return this.deposit;
|
||||
}
|
||||
|
||||
public Integer getProductCost() {
|
||||
return this.productCost;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return this.remark;
|
||||
}
|
||||
|
||||
public void setCustId(final String custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCardStatus(final String cardStatus) {
|
||||
this.cardStatus = cardStatus;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setValidityDate(final LocalDate validityDate) {
|
||||
this.validityDate = validityDate;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
|
||||
public void setCardFaceNum(final String cardFaceNum) {
|
||||
this.cardFaceNum = cardFaceNum;
|
||||
}
|
||||
|
||||
public void setDeposit(final Integer deposit) {
|
||||
this.deposit = deposit;
|
||||
}
|
||||
|
||||
public void setProductCost(final Integer productCost) {
|
||||
this.productCost = productCost;
|
||||
}
|
||||
|
||||
public void setRemark(final String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
Reference in New Issue