卡片管理
This commit is contained in:
parent
8cc276ae19
commit
c97abd5024
|
|
@ -45,12 +45,12 @@ public class AccCardHis extends BaseEntity {
|
|||
/** 卡类型 */
|
||||
@Excel(name = "卡类型")
|
||||
@ApiModelProperty(value = "卡类型")
|
||||
private Long cardType;
|
||||
private Integer cardType;
|
||||
|
||||
/** 记录类型 1-发卡2-退卡3-换卡 */
|
||||
@Excel(name = "记录类型 1-发卡2-退卡3-换卡")
|
||||
@ApiModelProperty(value = "记录类型 1-发卡2-退卡3-换卡")
|
||||
private Long recordType;
|
||||
private Integer recordType;
|
||||
|
||||
/** 押金 单位分 */
|
||||
@Excel(name = "押金 单位分")
|
||||
|
|
|
|||
|
|
@ -5,12 +5,16 @@ import java.util.List;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.bonus.canteen.core.account.constants.AccStatusEnum;
|
||||
import com.bonus.canteen.core.account.constants.CardRecordTypeEnum;
|
||||
import com.bonus.canteen.core.account.constants.CardStatusEnum;
|
||||
import com.bonus.canteen.core.account.constants.CardTypeEnum;
|
||||
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
||||
import com.bonus.canteen.core.account.mapper.AccCardHisMapper;
|
||||
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.houqin.constant.LeConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.account.mapper.AccCardMapper;
|
||||
|
|
@ -30,7 +34,9 @@ public class AccCardServiceImpl implements IAccCardService {
|
|||
@Autowired
|
||||
private AccCardMapper accCardMapper;
|
||||
@Autowired
|
||||
AccInfoMapper accInfoMapper;
|
||||
private AccInfoMapper accInfoMapper;
|
||||
@Autowired
|
||||
private AccCardHisMapper accCardHisMapper;
|
||||
|
||||
/**
|
||||
* 查询人员卡片资料
|
||||
|
|
@ -69,13 +75,32 @@ public class AccCardServiceImpl implements IAccCardService {
|
|||
accCard.setCardStatus(CardStatusEnum.NORMAL.getKey());
|
||||
accCard.setCardType(CardTypeEnum.IC_CARD.getKey());
|
||||
int count = accCardMapper.insertAccCard(accCard);
|
||||
//TODO 卡操作记录
|
||||
saveAccCardChangeRecord(accCard, CardRecordTypeEnum.APPLY.getKey());
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void saveAccCardChangeRecord(AccCard accCard, Integer cardRecordType) {
|
||||
AccCardHis accCardHis = new AccCardHis();
|
||||
accCardHis.setUserId(accCardHis.getUserId());
|
||||
accCardHis.setAccId(accCardHis.getAccId());
|
||||
accCardHis.setCardNum(String.valueOf(accCard.getCardNum()));
|
||||
accCardHis.setSerialNum(accCard.getSerialNum());
|
||||
accCardHis.setCardType(CardTypeEnum.IC_CARD.getKey());
|
||||
accCardHis.setRecordType(cardRecordType);
|
||||
accCardHis.setCardFaceNum(accCard.getCardFaceNum());
|
||||
accCardHis.setRemark(accCard.getRemark());
|
||||
if (CardRecordTypeEnum.APPLY.getKey().equals(cardRecordType)) {
|
||||
accCardHis.setDeposit(accCard.getDeposit());
|
||||
accCardHis.setProductCost(accCard.getProductCost());
|
||||
} else if (CardRecordTypeEnum.CHANGE.getKey().equals(cardRecordType)) {
|
||||
accCardHis.setProductCost(accCard.getProductCost());
|
||||
}
|
||||
accCardHisMapper.insertAccCardHis(accCardHis);
|
||||
}
|
||||
|
||||
public void checkAccInfoAndStatus(AccInfo accInfoVO) {
|
||||
if (ObjectUtil.isNull(accInfoVO)) {
|
||||
throw new ServiceException("账户不存在");
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class AllocCanteenEvaluate extends BaseEntity {
|
|||
private Long areaId;
|
||||
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
private Long areaName;
|
||||
private String areaName;
|
||||
|
||||
/** 食堂ID */
|
||||
@Excel(name = "食堂ID")
|
||||
|
|
@ -47,7 +47,7 @@ public class AllocCanteenEvaluate extends BaseEntity {
|
|||
private Long canteenId;
|
||||
|
||||
@ApiModelProperty(value = "食堂名称")
|
||||
private Long canteenName;
|
||||
private String canteenName;
|
||||
|
||||
/** 档口ID */
|
||||
@Excel(name = "档口ID")
|
||||
|
|
@ -55,7 +55,7 @@ public class AllocCanteenEvaluate extends BaseEntity {
|
|||
private Long shopstallId;
|
||||
|
||||
@ApiModelProperty(value = "档口名称")
|
||||
private Long shopstallName;
|
||||
private String shopstallName;
|
||||
|
||||
/** 评价日期 */
|
||||
@ApiModelProperty(value = "评价日期")
|
||||
|
|
|
|||
Loading…
Reference in New Issue