|
|
@@ -13,6 +13,7 @@ import com.zhongshu.card.client.model.org.OrganizationUserSearch;
|
|
|
import com.zhongshu.card.client.model.school.*;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
+import com.zhongshu.card.client.type.CardCancelState;
|
|
|
import com.zhongshu.card.client.type.school.CardType;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationUserDao;
|
|
|
@@ -77,7 +78,6 @@ public class CardInfoPoolService extends SuperService {
|
|
|
*/
|
|
|
public ResultContent saveCardInfoPool(CardInfoPoolParam param) {
|
|
|
checkParamOid(param);
|
|
|
- initDefaultUserAndOid(param);
|
|
|
|
|
|
CardInfoPool entity = null;
|
|
|
// 这是学校的oid
|
|
|
@@ -99,12 +99,14 @@ public class CardInfoPoolService extends SuperService {
|
|
|
if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(entity.getId())) {
|
|
|
return ResultContent.buildFail(String.format("卡号已存在:%s", param.getCode()));
|
|
|
}
|
|
|
+ initUpdateEntity(entity);
|
|
|
} else {
|
|
|
entity = new CardInfoPool();
|
|
|
if (ObjectUtils.isNotEmpty(temp)) {
|
|
|
return ResultContent.buildFail(String.format("卡号已存在:%s", param.getCode()));
|
|
|
}
|
|
|
entity.setIsUsed(Boolean.FALSE);
|
|
|
+ initEntityNoCheckOid(entity);
|
|
|
}
|
|
|
BeanUtils.copyProperties(param, entity, "isUsed");
|
|
|
|
|
|
@@ -145,7 +147,7 @@ public class CardInfoPoolService extends SuperService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 恢复卡片
|
|
|
+ * 恢复卡片 (把卡片变成未使用)
|
|
|
*
|
|
|
* @param param
|
|
|
* @return
|
|
|
@@ -155,7 +157,12 @@ public class CardInfoPoolService extends SuperService {
|
|
|
if (ObjectUtils.isEmpty(entity)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, param.getId()));
|
|
|
}
|
|
|
+ // 判断是否可以恢复
|
|
|
+
|
|
|
entity.setIsUsed(Boolean.FALSE);
|
|
|
+ entity.setCardCancelState(CardCancelState.Common);
|
|
|
+ entity.setUseTime(0L);
|
|
|
+ entity.setUseUserId("");
|
|
|
cardInfoPoolDao.save(entity);
|
|
|
return ResultContent.buildSuccess(toModel(entity));
|
|
|
}
|