技能审核通过判断是否要更新师傅状态
This commit is contained in:
parent
fb3fd4fe3d
commit
9314266499
|
|
@ -13,8 +13,10 @@ import com.ghy.common.utils.poi.ExcelUtil;
|
|||
import com.ghy.system.domain.SysArea;
|
||||
import com.ghy.system.service.ISysAreaService;
|
||||
import com.ghy.worker.domain.Worker;
|
||||
import com.ghy.worker.domain.WorkerBank;
|
||||
import com.ghy.worker.domain.WorkerCertification;
|
||||
import com.ghy.worker.service.IWorkerCertificationService;
|
||||
import com.ghy.worker.service.WorkerBankService;
|
||||
import com.ghy.worker.service.WorkerService;
|
||||
import com.ghy.worker.service.WorkerSpecialSkillService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -45,6 +47,9 @@ public class WorkerCertificationController extends BaseController
|
|||
@Autowired
|
||||
private WorkerSpecialSkillService workerSpecialSkillService;
|
||||
|
||||
@Autowired
|
||||
private WorkerBankService workerBankService;
|
||||
|
||||
@Autowired
|
||||
private ISysAreaService sysAreaService;
|
||||
|
||||
|
|
@ -193,6 +198,16 @@ public class WorkerCertificationController extends BaseController
|
|||
try {
|
||||
int result = workerCertificationService.changeStatus(ids, status);
|
||||
if(result > 0){
|
||||
// 是否绑定了银行卡
|
||||
List<WorkerBank> workerBanks = workerBankService.getByWorkerIds(ids);
|
||||
workerBanks.forEach(workerBank -> {
|
||||
// 绑定了的话更新师傅状态
|
||||
Worker worker = new Worker();
|
||||
worker.setWorkerId(workerBank.getWorkerId());
|
||||
worker.setStatus(0);
|
||||
workerService.updateWorker(worker);
|
||||
});
|
||||
|
||||
return AjaxResult.success("操作成功!");
|
||||
}else {
|
||||
return AjaxResult.warn("操作失败!");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ghy.worker.mapper;
|
||||
|
||||
import com.ghy.worker.domain.WorkerBank;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
|
|
@ -20,4 +23,10 @@ public interface WorkerBankMapper {
|
|||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
|
||||
/**
|
||||
* @param ids 师傅ids
|
||||
* @return 师傅银行卡集合
|
||||
*/
|
||||
List<WorkerBank> getByWorkerIds(@Param("ids") String ids);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ghy.worker.service;
|
|||
|
||||
import com.ghy.worker.domain.WorkerBank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
* 师傅银行卡service层
|
||||
|
|
@ -20,4 +22,10 @@ public interface WorkerBankService {
|
|||
*/
|
||||
WorkerBank getByWorkerId(Long workerId);
|
||||
|
||||
/**
|
||||
* @param ids 师傅ids
|
||||
* @return 师傅银行对象集合
|
||||
*/
|
||||
List<WorkerBank> getByWorkerIds(String ids);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -24,4 +25,9 @@ public class WorkerBankServiceImpl implements WorkerBankService {
|
|||
public WorkerBank getByWorkerId(Long workerId) {
|
||||
return workerBankMapper.getByWorkerId(workerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkerBank> getByWorkerIds(String ids) {
|
||||
return workerBankMapper.getByWorkerIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByWorkerIds">
|
||||
SELECT * FROM worker_bank
|
||||
WHERE worker_id in ( #{ids} )
|
||||
</select>
|
||||
|
||||
<!-- <select id="getWorkerTeamList" resultMap="WorkerTeamResult">-->
|
||||
<!-- <include refid="selectWorkerTeam"/>-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue