添加用户校验调整
余额调整bug修改
This commit is contained in:
+16
-6
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 子员工信息表
|
* @Description: 子员工信息表
|
||||||
@@ -106,14 +107,23 @@ public class CqBaseEmployeePayController extends JeecgController<CqBaseEmployee,
|
|||||||
if(StringUtils.isBlank(sysUserSub.getRealname())){
|
if(StringUtils.isBlank(sysUserSub.getRealname())){
|
||||||
return Result.error("用户名不能为空");
|
return Result.error("用户名不能为空");
|
||||||
}
|
}
|
||||||
//家庭用户
|
if(StringUtils.isNotEmpty(sysUserSub.getWorkNo())){
|
||||||
if(StringUtils.isNotBlank(sysUserSub.getMainUserId()) && StringUtils.isBlank(sysUserSub.getMainUserRelation())){
|
//校验工号是否已存在
|
||||||
return Result.error("与主账户关系不能为空");
|
LambdaQueryWrapper<SysUserSub> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SysUserSub::getWorkNo, sysUserSub.getWorkNo());
|
||||||
|
List<SysUserSub> list = sysUserSubService.list(queryWrapper);
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
return Result.error("工号已存在" + list.stream().map(SysUserSub::getRealname).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
//非正式员工
|
|
||||||
if(StringUtils.isBlank(sysUserSub.getMainUserId()) && StringUtils.isBlank(sysUserSub.getPhone())){
|
|
||||||
return Result.error("手机号不能为空");
|
|
||||||
}
|
}
|
||||||
|
// //家庭用户
|
||||||
|
// if(StringUtils.isNotBlank(sysUserSub.getMainUserId()) && StringUtils.isBlank(sysUserSub.getMainUserRelation())){
|
||||||
|
// return Result.error("与主账户关系不能为空");
|
||||||
|
// }
|
||||||
|
// //非正式员工
|
||||||
|
// if(StringUtils.isBlank(sysUserSub.getMainUserId()) && StringUtils.isBlank(sysUserSub.getPhone())){
|
||||||
|
// return Result.error("手机号不能为空");
|
||||||
|
// }
|
||||||
return cqBaseEmployeeService.saveEmpSub(sysUserSub);
|
return cqBaseEmployeeService.saveEmpSub(sysUserSub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -92,37 +92,37 @@
|
|||||||
<update id="changeBalanceAndIntegral">
|
<update id="changeBalanceAndIntegral">
|
||||||
UPDATE st_client_member_balance
|
UPDATE st_client_member_balance
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
<set>
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<choose>
|
<choose>
|
||||||
<!--余额补录影响累计余额-->
|
<!--余额补录影响累计余额-->
|
||||||
<when test="status == 1">
|
<when test="status == 1">
|
||||||
<if test="topUpBalance != null">
|
<if test="topUpBalance != null">
|
||||||
top_up_balance = top_up_balance + #{topUpBalance,jdbcType=DECIMAL},
|
top_up_balance = top_up_balance + #{topUpBalance,jdbcType=DECIMAL},
|
||||||
top_up_total = top_up_total + #{topUpBalance,jdbcType=DECIMAL}
|
top_up_total = top_up_total + #{topUpBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
<if test="rewardBalance != null">
|
<if test="rewardBalance != null">
|
||||||
reward_balance = reward_balance + #{rewardBalance,jdbcType=DECIMAL}
|
reward_balance = reward_balance + #{rewardBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="integralBalance != null">
|
<if test="integralBalance != null">
|
||||||
integral_balance = integral_balance + #{integralBalance,jdbcType=DECIMAL}
|
integral_balance = integral_balance + #{integralBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
<!--扣减不影响累计余额-->
|
<!--扣减不影响累计余额-->
|
||||||
<when test="status == 2">
|
<when test="status == 2">
|
||||||
<if test="topUpBalance != null">
|
<if test="topUpBalance != null">
|
||||||
top_up_balance = top_up_balance - #{topUpBalance,jdbcType=DECIMAL}
|
top_up_balance = top_up_balance - #{topUpBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
<if test="rewardBalance != null">
|
<if test="rewardBalance != null">
|
||||||
reward_balance = reward_balance - #{rewardBalance,jdbcType=DECIMAL}
|
reward_balance = reward_balance - #{rewardBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="integralBalance != null">
|
<if test="integralBalance != null">
|
||||||
integral_balance = integral_balance - #{integralBalance,jdbcType=DECIMAL}
|
integral_balance = integral_balance - #{integralBalance,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</set>
|
</trim>
|
||||||
</if>
|
</if>
|
||||||
WHERE id = #{id,jdbcType=INTEGER}
|
WHERE id = #{id,jdbcType=INTEGER}
|
||||||
<!--扣减需要余额大于扣减数额-->
|
<!--扣减需要余额大于扣减数额-->
|
||||||
|
|||||||
Reference in New Issue
Block a user