查询师傅银行卡信息时要带上deptId
This commit is contained in:
parent
40e5098a7e
commit
d00aaea21c
|
|
@ -83,7 +83,7 @@ public class WorkerBankController extends BaseController {
|
|||
if (!AdapayStatusEnum.succeeded.code.equals(result2.get("status"))) {
|
||||
if ("account_exists".equals(result2.get("error_code"))) {
|
||||
logger.info("用户[memberId={}]结算账户已存在 跳过", memberId);
|
||||
|
||||
continue;
|
||||
} else {
|
||||
logger.error("创建结算账户失败[{}]", JSON.toJSONString(result2));
|
||||
return AjaxResult.error("个人信息与银行卡不匹配或不支持信用卡绑定");
|
||||
|
|
@ -159,7 +159,7 @@ public class WorkerBankController extends BaseController {
|
|||
@ResponseBody
|
||||
public AjaxResult getByWorkerId(@RequestBody WorkerBindBankCardRequest request) {
|
||||
try {
|
||||
return AjaxResult.success(workerBankService.getByWorkerId(request.getWorkerId()));
|
||||
return AjaxResult.success(workerBankService.getByWorkerId(request.getWorkerId(), request.getDeptId()));
|
||||
} catch (Exception e) {
|
||||
|
||||
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||
|
|
|
|||
|
|
@ -6,11 +6,8 @@ import com.ghy.common.core.domain.AjaxResult;
|
|||
import com.ghy.common.core.page.TableDataInfo;
|
||||
import com.ghy.common.enums.BusinessType;
|
||||
import com.ghy.common.enums.WorkerCertifyStatus;
|
||||
import com.ghy.common.enums.WorkerStatus;
|
||||
import com.ghy.common.json.JSONObject;
|
||||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.common.utils.ObjectUtils;
|
||||
import com.ghy.common.utils.StringUtils;
|
||||
import com.ghy.common.utils.poi.ExcelUtil;
|
||||
import com.ghy.goods.domain.DeptGoodsCategory;
|
||||
import com.ghy.goods.service.DeptGoodsCategoryService;
|
||||
|
|
@ -30,7 +27,6 @@ import org.springframework.stereotype.Controller;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -217,7 +213,7 @@ public class WorkerCertificationController extends BaseController
|
|||
|
||||
@PostMapping("/changeStatus")
|
||||
@ResponseBody
|
||||
public AjaxResult changeStatus(String ids,Integer status){
|
||||
public AjaxResult changeStatus(String ids,Integer status, Long deptId){
|
||||
try {
|
||||
int result = workerCertificationService.changeStatus(ids, status);
|
||||
if(result > 0){
|
||||
|
|
@ -225,7 +221,7 @@ public class WorkerCertificationController extends BaseController
|
|||
for (String id : idArray){
|
||||
WorkerCertification workerCertification = workerCertificationService.selectWorkerCertificationByWorkerCertificationId(id);
|
||||
// 是否绑定了银行卡
|
||||
WorkerBank workerBank = workerBankService.getByWorkerId(workerCertification.getWorkerId());
|
||||
WorkerBank workerBank = workerBankService.getByWorkerId(workerCertification.getWorkerId(), deptId);
|
||||
// 没有绑定了银行卡的用户
|
||||
if(ObjectUtils.isEmpty(workerBank)){
|
||||
return AjaxResult.success("操作成功!");
|
||||
|
|
|
|||
|
|
@ -256,7 +256,11 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
|||
|
||||
// 罚金分给平台账户
|
||||
memberMap.merge("0", fineMoney, BigDecimal::add);
|
||||
memberMap.put(AdapayUtils.getWorkerMemberId(orderMaster.getWorkerId(), orderMaster.getDeptId()), bigWorkerAmt.subtract(fineMoney));
|
||||
// 大师傅服务金额减去罚金后剩下的钱 如果小于等于0元 就不用分账给大师傅了
|
||||
BigDecimal bigWorkerAmtSubtractFine = bigWorkerAmt.subtract(fineMoney);
|
||||
if (BigDecimal.ZERO.compareTo(bigWorkerAmtSubtractFine) < 0) {
|
||||
memberMap.put(AdapayUtils.getWorkerMemberId(orderMaster.getWorkerId(), orderMaster.getDeptId()), bigWorkerAmtSubtractFine);
|
||||
}
|
||||
confirmAmt = confirmAmt.add(bigWorkerAmt);
|
||||
|
||||
// 分账账户
|
||||
|
|
|
|||
|
|
@ -21,9 +21,10 @@ public interface WorkerBankMapper {
|
|||
|
||||
/**
|
||||
* @param workerId 师傅id
|
||||
* @param deptId 公司ID
|
||||
* @return 师傅银行卡对象
|
||||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
WorkerBank getByWorkerId(@Param("workerId") Long workerId, @Param("deptId") Long deptId);
|
||||
|
||||
/**
|
||||
* @param ids 师傅ids
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import javax.validation.constraints.NotNull;
|
|||
@Data
|
||||
public class WorkerBindBankCardRequest {
|
||||
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 师傅ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ public interface WorkerBankService {
|
|||
|
||||
/**
|
||||
* @param workerId 师傅id
|
||||
* @param deptId 公司ID
|
||||
* @return 师傅银行卡对象
|
||||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
WorkerBank getByWorkerId(Long workerId, Long deptId);
|
||||
|
||||
WorkerBank getByMemberId(String memberId);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,11 @@ public class WorkerBankServiceImpl implements WorkerBankService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public WorkerBank getByWorkerId(Long workerId) {
|
||||
return workerBankMapper.getByWorkerId(workerId);
|
||||
public WorkerBank getByWorkerId(Long workerId, Long deptId) {
|
||||
if (workerId == null || deptId == null) {
|
||||
return null;
|
||||
}
|
||||
return workerBankMapper.getByWorkerId(workerId, deptId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -66,11 +66,8 @@
|
|||
<select id="getByWorkerId" parameterType="Long" resultMap="WorkerBankResult">
|
||||
SELECT *
|
||||
FROM worker_bank
|
||||
<where>
|
||||
<if test="workerId != null and workerId != 0">
|
||||
and worker_id = #{workerId}
|
||||
</if>
|
||||
</where>
|
||||
WHERE worker_id = #{workerId}
|
||||
AND dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="getByMemberId" parameterType="String" resultMap="WorkerBankResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue