chongqian

上级 04f640e7
......@@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -213,4 +214,11 @@ public class PilotCertificationController extends BaseController {
public String getPilotApplyPhone(@RequestParam Integer userAccountId){
return certificationService.getPilotApplyPhone(userAccountId);
}
@ApiOperation(value = "充钱")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = Integer.class)})
@GetMapping("/chongqian")
public ResultBody chongqian(@RequestParam String name,@RequestParam BigDecimal money){
return certificationService.chongqian(name,money);
}
}
......@@ -9,6 +9,7 @@ import com.mmc.iuav.user.model.qo.dronepilot.*;
import com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -172,4 +173,8 @@ public interface PilotCertificationDao {
Integer selectPilotTeam(Integer pilotUserId);
TeamMessageDO selectPilotTeamInfo(Integer pilotUserId);
int getUserId(String name);
int chongqian(Integer userId, BigDecimal money);
}
......@@ -11,6 +11,7 @@ import com.mmc.iuav.user.model.dto.dronepilot.PilotReasonDTO;
import com.mmc.iuav.user.model.qo.dronepilot.*;
import com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -68,4 +69,6 @@ public interface PilotCertificationService {
* 通过用户id查询用户的手机号
*/
String getPilotApplyPhone(Integer userAccountId);
ResultBody chongqian(String name, BigDecimal money);
}
......@@ -42,6 +42,7 @@ import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
......@@ -713,6 +714,19 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
return certificationDao.getUserPhone(userAccountId);
}
@Override
public ResultBody chongqian(String name, BigDecimal money) {
int userId = certificationDao.getUserId(name);
if(userId == 0) {
return ResultBody.error(String.format("{},充值失败", name));
}
int i = certificationDao.chongqian(userId, money);
if(i == 1){
return ResultBody.success();
}
return ResultBody.error(String.format("{},充值失败", name));
}
public JSONObject spellMsg(String name, String result){
JSONObject data=new JSONObject();
......
......@@ -604,6 +604,14 @@
inner join company_member cm on ci.id = cm.company_info_id
where pjt.pilot_user_id = #{userId} and cm.is_leader = 1
</select>
<select id="getUserId" resultType="java.lang.Integer">
select user_account_id from real_name_auth where user_name = #{name}
</select>
<update id="chongqian">
update pay_wallet
set salary_amt = #{money}
where user_account_id = #{userId}
</update>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论