Commit 6fbc4c7a authored by luzhuang's avatar luzhuang

积分字段int改string

parent 00ebe2b9
# 修改 blesson value
ALTER table b_lesson modify column value_consume VARCHAR (16);
ALTER table b_lesson modify column value_gain VARCHAR (16);
# 修改 b_lesson_person value
ALTER table b_lesson_person modify column `value` VARCHAR (16);
\ No newline at end of file
......@@ -108,10 +108,10 @@ public class BLesson extends IdEntity<BLesson> {
private String hotNumber;
@ApiModelProperty(value = "消耗积分")
private Integer valueConsume;
private String valueConsume;
@ApiModelProperty(value = "获得积分")
private Integer valueGain;
private String valueGain;
@ApiModelProperty(value = "更新积分日期")
private Date valueUpdateDate;
......
......@@ -325,7 +325,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
line = bLessonPersonRepository.updateByPrimaryKeySelective(bLessonPersonReal);
//扣除对应积分 添加用户积分详情 更新用户积分
//增加用户积分详情
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && !curUser.getUserId().equals(bLesson.getLecturerId())){
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && !curUser.getUserId().equals(bLesson.getLecturerId())){
BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(),"学习"+bLesson.getLessonName()+"课程",bLesson.getValueConsume(),"1");
bLessonServiceImpl.addValueEvent(curUser.getUserId(),bPersonValue,userInfo.getLockNum());
}
......@@ -343,7 +343,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
//扣除对应积分 添加用户积分详情 更新用户积分
//增加用户积分详情
//积分变化后 s_user表中value字段重新统计
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && !curUser.getUserId().equals(bLesson.getLecturerId())){
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && !curUser.getUserId().equals(bLesson.getLecturerId())){
BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(),"学习"+bLesson.getLessonName()+"课程",bLesson.getValueConsume(),"1");
bLessonServiceImpl.addValueEvent(curUser.getUserId(),bPersonValue,userInfo.getLockNum());
}
......
......@@ -1194,14 +1194,14 @@ public class BLessonServiceImpl implements BLessonService {
if (userInfo == null) {
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
}
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && Integer.parseInt(userInfo.getValue()) < bLesson.getValueConsume() && !curUser.getUserId().equals(bLesson.getLecturerId())) {
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && Integer.parseInt(userInfo.getValue()) < Integer.parseInt(bLesson.getValueConsume()) && !curUser.getUserId().equals(bLesson.getLecturerId())) {
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
}
int line = bLessonPersonRepository.updateByPrimaryKeySelective(person);
//TODO 更新用户积分明细表 重进计算积分
//扣除对应积分 添加用户积分详情 更新用户积分
//增加用户积分详情
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && !curUser.getUserId().equals(bLesson.getLecturerId())) {
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && !curUser.getUserId().equals(bLesson.getLecturerId())) {
BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(), "报名"+bLesson.getLessonName()+"培训", bLesson.getValueConsume(), "1");
addValueEvent(curUser.getUserId(), bPersonValue, userInfo.getLockNum());
}
......@@ -1225,14 +1225,14 @@ public class BLessonServiceImpl implements BLessonService {
if (userInfo == null) {
throw new ServiceException(ResultServiceEnums.COMPANY_NOT_EXISTS);
}
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && Integer.parseInt(userInfo.getValue()) < bLesson.getValueConsume()) {
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && Integer.parseInt(userInfo.getValue()) < Integer.parseInt(bLesson.getValueConsume())) {
throw new ServiceException(ResultServiceEnums.VALUE_NOT_ENOUGH);
}
int line = this.trainInsert("0", bLesson, bLessonPersons);
//TODO 更新用户积分明细表 重进计算积分
//扣除对应积分 添加用户积分详情 更新用户积分
//增加用户积分详情
if (bLesson.getValueConsume() != null && bLesson.getValueConsume() != 0 && !curUser.getUserId().equals(bLesson.getLecturerId())) {
if (bLesson.getValueConsume() != null && !"0".equals(bLesson.getValueConsume()) && !curUser.getUserId().equals(bLesson.getLecturerId())) {
BPersonValue bPersonValue = new BPersonValue(curUser.getUserId(), "报名"+bLesson.getLessonName()+"培训", bLesson.getValueConsume(), "1");
addValueEvent(curUser.getUserId(), bPersonValue, userInfo.getLockNum());
}
......@@ -1626,7 +1626,7 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = Exception.class)
public void addValueEvent(String personId, BPersonValue bPersonValue, Integer lockNum) {
if (StringUtils.isNotEmpty(personId) && bPersonValue != null && bPersonValue.getValue() != null && bPersonValue.getValue() != 0) {
if (StringUtils.isNotEmpty(personId) && bPersonValue != null && bPersonValue.getValue() != null && !"0".equals(bPersonValue.getValue())) {
log.debug("-----------------正在设置积分详情-------------------");
UserUtil.setCurrentPersistOperation(bPersonValue);
bPersonValueRepository.add(bPersonValue);
......
......@@ -25,7 +25,7 @@ public class BPersonValue extends IdEntity<BPersonValue> {
private String event;
private Integer value;
private String value;
private String type;
......
......@@ -40,7 +40,6 @@ public class BPersonValueServiceImpl implements BPersonValueService {
@Autowired
private SysUserMapper sysUserMapper;
@Override
public List<BPersonValue> queryByPagination(PageUtil pageUtil, CurUser curUser,PersonValueClientDto dto) {
if(dto.getBusinessId() == null || "".equals(dto.getBusinessId())){
......@@ -61,7 +60,7 @@ public class BPersonValueServiceImpl implements BPersonValueService {
UserUtil.setCurrentPersistOperation(bPersonValue);
try{
bPersonValue.setValue(Integer.parseInt(personValueDto.getValue().trim()));
bPersonValue.setValue(personValueDto.getValue().trim());
}catch (Exception e){
throw new ServiceException(ResultServiceEnums.NUM_IS_ERROR);
}
......
......@@ -23,9 +23,9 @@ public class BReleaseValue extends IdEntity<BReleaseValue> {
private String title;
private Integer lessonValue;
private String lessonValue;
private Integer trainValue;
private String trainValue;
private String corpId;
......
......@@ -62,8 +62,8 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
// BeanUtils.copyProperties(bReleaseValueDto, bReleaseValue);
bReleaseValue.setBusinessId(bReleaseValueDto.getBusinessId());
bReleaseValue.setTitle(bReleaseValueDto.getTitle());
bReleaseValue.setTrainValue(Integer.parseInt(bReleaseValueDto.getTrainValue()));
bReleaseValue.setLessonValue(Integer.parseInt(bReleaseValueDto.getLessonValue()));
bReleaseValue.setTrainValue(bReleaseValueDto.getTrainValue());
bReleaseValue.setLessonValue(bReleaseValueDto.getLessonValue());
UserUtil.setCurrentMergeOperation(bReleaseValue);
int line = bReleaseValueRepository.updateByPrimaryKeySelective(bReleaseValue);
// 删除子表中的相关记录
......@@ -78,8 +78,8 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
// BeanUtils.copyProperties(bReleaseValueDto, bReleaseValue);
bReleaseValue.setBusinessId(bReleaseValueDto.getBusinessId());
bReleaseValue.setTitle(bReleaseValueDto.getTitle());
bReleaseValue.setTrainValue(Integer.parseInt(bReleaseValueDto.getTrainValue()));
bReleaseValue.setLessonValue(Integer.parseInt(bReleaseValueDto.getLessonValue()));
bReleaseValue.setTrainValue(bReleaseValueDto.getTrainValue());
bReleaseValue.setLessonValue(bReleaseValueDto.getLessonValue());
UserUtil.setCurrentPersistOperation(bReleaseValue);
if(StringUtils.isNotEmpty(bReleaseValueDto.getUserIds())){
......@@ -195,8 +195,8 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
throw new ServiceException(ResultServiceEnums.VALUE_NOT_NULL);
}
try{
Integer.parseInt(valueConsume);
Integer.parseInt(valueGain);
Long.parseLong(valueConsume);
Long.parseLong(valueGain);
}catch (Exception e){
throw new ServiceException(ResultServiceEnums.NUM_IS_ERROR);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment