技能审核通过判断是否要更新师傅状态

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-10 17:57:20 +08:00
parent fb3fd4fe3d
commit 9314266499
5 changed files with 43 additions and 0 deletions

View File

@ -13,8 +13,10 @@ import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.system.domain.SysArea; import com.ghy.system.domain.SysArea;
import com.ghy.system.service.ISysAreaService; import com.ghy.system.service.ISysAreaService;
import com.ghy.worker.domain.Worker; import com.ghy.worker.domain.Worker;
import com.ghy.worker.domain.WorkerBank;
import com.ghy.worker.domain.WorkerCertification; import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.worker.service.WorkerBankService;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
import com.ghy.worker.service.WorkerSpecialSkillService; import com.ghy.worker.service.WorkerSpecialSkillService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -45,6 +47,9 @@ public class WorkerCertificationController extends BaseController
@Autowired @Autowired
private WorkerSpecialSkillService workerSpecialSkillService; private WorkerSpecialSkillService workerSpecialSkillService;
@Autowired
private WorkerBankService workerBankService;
@Autowired @Autowired
private ISysAreaService sysAreaService; private ISysAreaService sysAreaService;
@ -193,6 +198,16 @@ public class WorkerCertificationController extends BaseController
try { try {
int result = workerCertificationService.changeStatus(ids, status); int result = workerCertificationService.changeStatus(ids, status);
if(result > 0){ 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("操作成功!"); return AjaxResult.success("操作成功!");
}else { }else {
return AjaxResult.warn("操作失败!"); return AjaxResult.warn("操作失败!");

View File

@ -1,6 +1,9 @@
package com.ghy.worker.mapper; package com.ghy.worker.mapper;
import com.ghy.worker.domain.WorkerBank; import com.ghy.worker.domain.WorkerBank;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author clunt * @author clunt
@ -20,4 +23,10 @@ public interface WorkerBankMapper {
*/ */
WorkerBank getByWorkerId(Long workerId); WorkerBank getByWorkerId(Long workerId);
/**
* @param ids 师傅ids
* @return 师傅银行卡集合
*/
List<WorkerBank> getByWorkerIds(@Param("ids") String ids);
} }

View File

@ -2,6 +2,8 @@ package com.ghy.worker.service;
import com.ghy.worker.domain.WorkerBank; import com.ghy.worker.domain.WorkerBank;
import java.util.List;
/** /**
* @author clunt * @author clunt
* 师傅银行卡service层 * 师傅银行卡service层
@ -20,4 +22,10 @@ public interface WorkerBankService {
*/ */
WorkerBank getByWorkerId(Long workerId); WorkerBank getByWorkerId(Long workerId);
/**
* @param ids 师傅ids
* @return 师傅银行对象集合
*/
List<WorkerBank> getByWorkerIds(String ids);
} }

View File

@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Slf4j @Slf4j
@Service @Service
@ -24,4 +25,9 @@ public class WorkerBankServiceImpl implements WorkerBankService {
public WorkerBank getByWorkerId(Long workerId) { public WorkerBank getByWorkerId(Long workerId) {
return workerBankMapper.getByWorkerId(workerId); return workerBankMapper.getByWorkerId(workerId);
} }
@Override
public List<WorkerBank> getByWorkerIds(String ids) {
return workerBankMapper.getByWorkerIds(ids);
}
} }

View File

@ -60,6 +60,11 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getByWorkerIds">
SELECT * FROM worker_bank
WHERE worker_id in ( #{ids} )
</select>
<!-- <select id="getWorkerTeamList" resultMap="WorkerTeamResult">--> <!-- <select id="getWorkerTeamList" resultMap="WorkerTeamResult">-->
<!-- <include refid="selectWorkerTeam"/>--> <!-- <include refid="selectWorkerTeam"/>-->