消费者银行卡查询+师傅银行卡查询
This commit is contained in:
parent
020e8a7676
commit
1bc5946a49
|
|
@ -7,6 +7,7 @@ import com.ghy.common.adapay.model.AdapayStatusEnum;
|
|||
import com.ghy.common.adapay.model.Merchant;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.utils.AdapayUtils;
|
||||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.customer.domain.CustomerBank;
|
||||
import com.ghy.customer.request.BindBankCardRequest;
|
||||
import com.ghy.customer.service.CustomerBankService;
|
||||
|
|
@ -85,6 +86,18 @@ public class CustomerBankController {
|
|||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("getByCustomerId")
|
||||
@ResponseBody
|
||||
public AjaxResult getByCustomerId(@RequestBody BindBankCardRequest request){
|
||||
try {
|
||||
return AjaxResult.success(customerBankService.selectByCustomerId(request.getCustomerId()));
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ghy.common.adapay.model.Merchant;
|
|||
import com.ghy.common.core.controller.BaseController;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.utils.AdapayUtils;
|
||||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.worker.domain.WorkerBank;
|
||||
import com.ghy.worker.request.WorkerBindBankCardRequest;
|
||||
import com.ghy.worker.service.WorkerBankService;
|
||||
|
|
@ -89,5 +90,16 @@ public class WorkerBankController extends BaseController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/getByWorkerId")
|
||||
@ResponseBody
|
||||
public AjaxResult getByWorkerId(@RequestBody WorkerBindBankCardRequest request){
|
||||
try {
|
||||
return AjaxResult.success(workerBankService.getByWorkerId(request.getWorkerId()));
|
||||
}catch (Exception e){
|
||||
|
||||
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@ public interface CustomerBankService {
|
|||
*/
|
||||
List<CustomerBank> getCustomerBankList(CustomerBank customerBank);
|
||||
|
||||
/**
|
||||
* 用消费者ID查银行卡信息
|
||||
*
|
||||
* @param customerId 消费者ID
|
||||
*/
|
||||
CustomerBank selectByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 用消费者ID和部门ID查银行卡信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,6 +23,15 @@ public class CustomerBankServiceImpl implements CustomerBankService {
|
|||
return customerBankMapper.getCustomerBankList(customerBank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerBank selectByCustomerId(Long customerId){
|
||||
List<CustomerBank> list = customerBankMapper.selectByCustomerId(customerId);
|
||||
if(list.size()>0){
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerBank> selectByCustomerIdAndDeptId(Long customerId, Long deptId) {
|
||||
return customerBankMapper.selectByCustomerIdAndDeptId(customerId, deptId);
|
||||
|
|
|
|||
|
|
@ -14,4 +14,10 @@ public interface WorkerBankMapper {
|
|||
*/
|
||||
int insertWorkerBank(WorkerBank workerBank);
|
||||
|
||||
/**
|
||||
* @param workerId 师傅id
|
||||
* @return 师傅银行卡对象
|
||||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,10 @@ public interface WorkerBankService {
|
|||
*/
|
||||
int insertWorkerBank(WorkerBank workerBank);
|
||||
|
||||
/**
|
||||
* @param workerId 师傅id
|
||||
* @return 师傅银行卡对象
|
||||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,9 @@ public class WorkerBankServiceImpl implements WorkerBankService {
|
|||
public int insertWorkerBank(WorkerBank workerBank) {
|
||||
return workerBankMapper.insertWorkerBank(workerBank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkerBank getByWorkerId(Long workerId) {
|
||||
return workerBankMapper.getByWorkerId(workerId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,10 +51,15 @@
|
|||
)
|
||||
</insert>
|
||||
|
||||
<!-- <sql id="selectWorkerBank">-->
|
||||
<!-- SELECT *-->
|
||||
<!-- FROM worker_bank-->
|
||||
<!-- </sql>-->
|
||||
<select id="getByWorkerId" parameterType="Long" resultMap="WorkerTeamResult">
|
||||
SELECT *
|
||||
FROM worker_bank
|
||||
<where>
|
||||
<if test="workerId != null and workerId != 0">
|
||||
and worker_id = #{workerId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- <select id="getWorkerTeamList" resultMap="WorkerTeamResult">-->
|
||||
<!-- <include refid="selectWorkerTeam"/>-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue