Commit 75f237fd authored by shangtx's avatar shangtx

feat: 维修工管理

parent 3df471f5
......@@ -14,5 +14,5 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class PageServiceWorkerDTO extends PageParams {
private String name;
}
......@@ -21,6 +21,7 @@ import com.onsiteservice.dao.common.page.PageInfoVO;
import com.onsiteservice.dao.mapper.service.ServiceWorkerAssignMapper;
import com.onsiteservice.dao.mapper.service.ServiceWorkerMapper;
import com.onsiteservice.dao.mapper.user.UserMapper;
import com.onsiteservice.entity.service.ServiceValuatorAssign;
import com.onsiteservice.entity.service.ServiceWorker;
import com.onsiteservice.entity.service.ServiceWorkerAssign;
import com.onsiteservice.entity.user.User;
......@@ -102,8 +103,12 @@ public class ServiceWorkerService extends AbstractMapper<ServiceWorker> {
public int delete(Long id, Long userId) {
log.info("worker delete id: {}, userId: {}", id, userId);
// checkAuth(userId);
var condition = new ServiceWorkerAssign();
condition.setWorkerId(id);
int assignCount = serviceWorkerAssignMapper.selectCount(condition);
if(assignCount > 0) {
throw new ServiceException("不允许删除已经指派过的维修工");
}
return this.deleteByPrimaryKey(id);
}
......
......@@ -4,7 +4,13 @@
<select id="selectServiceWorkerPage" resultType="com.onsiteservice.entity.service.ServiceWorker">
select * from service_worker order by create_time asc
select * from service_worker
<where>
<if test="name != null">
and name like "%"#{name}"%"
</if>
</where>
order by create_time asc
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment